Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OKU-GIS
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Muhamad
OKU-GIS
Commits
7514bdf4
Commit
7514bdf4
authored
Aug 09, 2021
by
Manggar Mahardhika
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bug fix + history bangunan
parent
1fcdd69e
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
278 additions
and
141 deletions
+278
-141
API/views.py
API/views.py
+40
-2
Application/urls.py
Application/urls.py
+1
-0
Application/views.py
Application/views.py
+54
-0
templates/includes/css-o.html
templates/includes/css-o.html
+8
-0
templates/includes/js-m.html
templates/includes/js-m.html
+167
-139
templates/includes/js-o.html
templates/includes/js-o.html
+8
-0
No files found.
API/views.py
View file @
7514bdf4
...
@@ -7,7 +7,6 @@ from django.core.files.storage import FileSystemStorage
...
@@ -7,7 +7,6 @@ from django.core.files.storage import FileSystemStorage
from
django.core.files.base
import
ContentFile
,
File
from
django.core.files.base
import
ContentFile
,
File
import
base64
import
base64
import
json
import
json
from
PIL
import
Image
from
django.contrib.auth.decorators
import
login_required
,
user_passes_test
from
django.contrib.auth.decorators
import
login_required
,
user_passes_test
from
django.utils.decorators
import
method_decorator
from
django.utils.decorators
import
method_decorator
...
@@ -82,7 +81,46 @@ def building(request):
...
@@ -82,7 +81,46 @@ def building(request):
# kulon lor, wetan lor, wetan kidul, kulon kidul, kulon lor
# kulon lor, wetan lor, wetan kidul, kulon kidul, kulon lor
with
conn
.
cursor
()
as
buldings
:
with
conn
.
cursor
()
as
buldings
:
buldings
.
execute
(
"SELECT json_build_object('type', 'Feature', 'properties', (id, name, information), 'administrasi',(address_1, address_2, address_3, provinsi, alamat, luas_bangunan, luas_tanah, tinggi_bangunan, gambar, pemilik, db_tipe, remark, point_id, point_name), 'geometry', ST_AsGeoJSON(geom :: geometry) :: json) FROM geo_bangunan WHERE st_intersects(geom,'SRID=0;POLYGON((
%
s
%
s,
%
s
%
s,
%
s
%
s,
%
s
%
s,
%
s
%
s))')"
%
(
kulon
,
lor
,
wetan
,
lor
,
wetan
,
kidul
,
kulon
,
kidul
,
kulon
,
lor
))
buldings
.
execute
(
"""SELECT
json_build_object (
'type',
'Feature',
'properties',
( gb.ID, gb.NAME, gb.information,
(
SELECT ARRAY_AGG
( '' || ID || ',' || tgl_perbaikan || ',' || jenis_perbaikan || '' ORDER BY tgl_perbaikan DESC )
FROM
tbl_perbaikan
WHERE
id_object = gb.ID
AND type_id = 1
)
),
'administrasi',
(
gb.address_1,
gb.address_2,
gb.address_3,
gb.provinsi,
gb.alamat,
gb.luas_bangunan,
gb.luas_tanah,
gb.tinggi_bangunan,
gb.gambar,
gb.pemilik,
gb.db_tipe,
gb.remark,
gb.point_id,
gb.point_name
),
'geometry',
ST_AsGeoJSON ( gb.geom :: geometry ) :: json
)
FROM
geo_bangunan gb
WHERE
st_intersects ( gb.geom, 'SRID=0;POLYGON((
%
s
%
s,
%
s
%
s,
%
s
%
s,
%
s
%
s,
%
s
%
s))' )"""
%
(
kulon
,
lor
,
wetan
,
lor
,
wetan
,
kidul
,
kulon
,
kidul
,
kulon
,
lor
))
prov_res
=
buldings
.
fetchall
()
prov_res
=
buldings
.
fetchall
()
polbang
=
[]
polbang
=
[]
...
...
Application/urls.py
View file @
7514bdf4
...
@@ -20,5 +20,6 @@ urlpatterns = [
...
@@ -20,5 +20,6 @@ urlpatterns = [
path
(
'get-jalan-perbaikan'
,
views
.
getjalanperbaikan
,
name
=
'get-jalan-perbaikan'
),
path
(
'get-jalan-perbaikan'
,
views
.
getjalanperbaikan
,
name
=
'get-jalan-perbaikan'
),
path
(
'get-detail-perbaikan'
,
views
.
getdetailperbaikan
,
name
=
'get-detail-perbaikan'
),
path
(
'get-detail-perbaikan'
,
views
.
getdetailperbaikan
,
name
=
'get-detail-perbaikan'
),
path
(
'get-detail-perbaikan-bang'
,
views
.
getdetailperbaikanbangunan
,
name
=
'get-detail-perbaikan-bang'
),
]
]
\ No newline at end of file
Application/views.py
View file @
7514bdf4
...
@@ -1042,6 +1042,60 @@ def getdetailperbaikan(request):
...
@@ -1042,6 +1042,60 @@ def getdetailperbaikan(request):
respon
=
res_all
respon
=
res_all
return
Response
(
respon
)
return
Response
(
respon
)
@
api_view
((
'GET'
,))
def
getdetailperbaikanbangunan
(
request
):
id_object
=
request
.
GET
.
get
(
'id'
)
with
conn
.
cursor
()
as
data_per
:
data_per
.
execute
(
"""
SELECT
gl.NAME,
tp.name,
gj.remark,
tp.tgl_pembuatan,
tp.tgl_perbaikan,
tp.tgl_selesai,
tp.anggaran,
tp.pj,
tp.pj_lapangan,
tp.kontraktor,
ST_AsGeoJSON ( tp.geom :: geometry ) :: json,
tp.id_object,
tp.id,
tp.proposal,
tp.bukti_selesai,
tp.jenis_perbaikan
FROM
tbl_perbaikan tp
JOIN geo_label gl ON gl.ID = tp.type_id
JOIN geo_bangunan gj ON gj.ID = tp.id_object
where tp.id_object =
%
s
order by tp.tgl_perbaikan desc"""
%
id_object
)
res_perbaikan
=
data_per
.
fetchall
()
res_all
=
[]
for
j
in
res_perbaikan
:
data_all
=
{
'name'
:
j
[
1
],
'type'
:
j
[
2
],
'tgl_pembuatan'
:
j
[
3
],
'tgl_perbaikan'
:
j
[
4
],
'tgl_selesai'
:
j
[
5
],
'anggaran'
:
j
[
6
],
'pj'
:
j
[
7
],
'pj_lapangan'
:
j
[
8
],
'kontraktor'
:
j
[
9
],
'geometry'
:
j
[
10
],
'id_object'
:
j
[
11
],
'id'
:
j
[
12
],
'proposal'
:
j
[
13
],
'bukti_selesai'
:
j
[
14
],
'jenis_perbaikan'
:
j
[
15
]
}
res_all
.
append
(
data_all
)
respon
=
res_all
return
Response
(
respon
)
@
api_view
((
'GET'
,))
@
api_view
((
'GET'
,))
def
editkelurahan
(
request
):
def
editkelurahan
(
request
):
kode_dagri
=
request
.
GET
.
get
(
'kode_dagri'
)
kode_dagri
=
request
.
GET
.
get
(
'kode_dagri'
)
...
...
templates/includes/css-o.html
View file @
7514bdf4
...
@@ -223,6 +223,14 @@
...
@@ -223,6 +223,14 @@
display
:
none
;
display
:
none
;
}
}
#btn_detail_per_bang
{
display
:
none
;
}
#btn_perbaikan_bangunan
{
display
:
none
;
}
.leaflet-popup
{
.leaflet-popup
{
display
:
none
;
display
:
none
;
}
}
...
...
templates/includes/js-m.html
View file @
7514bdf4
...
@@ -72,6 +72,14 @@
...
@@ -72,6 +72,14 @@
display
:
block
;
display
:
block
;
}
}
#btn_detail_per_bang
{
display
:
block
;
}
#btn_perbaikan_bangunan
{
display
:
block
;
}
.leaflet-popup
{
.leaflet-popup
{
display
:
block
;
display
:
block
;
}
}
...
@@ -4827,8 +4835,6 @@
...
@@ -4827,8 +4835,6 @@
}
}
//3d end
//3d end
var
geocodeService
=
L
.
esri
.
Geocoding
.
geocodeService
();
var
geocodeService
=
L
.
esri
.
Geocoding
.
geocodeService
();
var
geocoderNominatim
=
new
L
.
Control
.
Geocoder
.
Nominatim
();
var
geocoderNominatim
=
new
L
.
Control
.
Geocoder
.
Nominatim
();
...
@@ -4870,7 +4876,13 @@
...
@@ -4870,7 +4876,13 @@
}
else
{
}
else
{
var
path_img
=
`"static/image/bangunan/`
+
feature
.
administrasi
.
f9
+
`"`
var
path_img
=
`"static/image/bangunan/`
+
feature
.
administrasi
.
f9
+
`"`
}
}
console
.
log
(
feature
.
administrasi
.
f11
)
// var list_history = feature.properties.f4
// for (var i = 0; i
<
list_history
.
length
;
i
++
)
{
// var dt_history = list_history[i].split(",");
// console.log(dt_history[0])
// console.log(dt_history[1])
// console.log(dt_history[2])
// }
// if (feature.administrasi.f11 != 'None'){
// if (feature.administrasi.f11 != 'None'){
// var cbb = `
<
option
value
=
"
null
"
disabled
>--
Pilih
Jenis
Point
--<
/option
>
// var cbb = `
<
option
value
=
"
null
"
disabled
>--
Pilih
Jenis
Point
--<
/option
>
//
<
option
value
=
"
bangunan
"
`if(feature.administrasi.f11 != 'bangunan'){`
selected
`};`
>
Bangunan
Biasa
<
/option
>
//
<
option
value
=
"
bangunan
"
`if(feature.administrasi.f11 != 'bangunan'){`
selected
`};`
>
Bangunan
Biasa
<
/option
>
...
@@ -4886,31 +4898,61 @@
...
@@ -4886,31 +4898,61 @@
//
<
option
value
=
"
cagar_budaya
"
>
Cagar
Budaya
dan
Tempat
Wisata
<
/option
>
//
<
option
value
=
"
cagar_budaya
"
>
Cagar
Budaya
dan
Tempat
Wisata
<
/option
>
//
<
option
value
=
"
gardu_listrik
"
>
Gardu
Listrik
<
/option>
`
//
<
option
value
=
"
gardu_listrik
"
>
Gardu
Listrik
<
/option>
`
// }
// }
var
history
if
(
feature
.
administrasi
.
f11
==
'
kantor_administrasi
'
||
feature
.
administrasi
.
f11
==
'
layanan_kesehatan
'
||
feature
.
administrasi
.
f11
==
'
puskesmas
'
||
feature
.
administrasi
.
f11
==
'
rumah_sakit
'
||
feature
.
administrasi
.
f11
==
'
sarana_pendidikan
'
||
feature
.
administrasi
.
f11
==
'
stasiun
'
||
feature
.
administrasi
.
f11
==
'
terminal_bus
'
||
feature
.
administrasi
.
f11
==
'
cagar_budaya
'
||
feature
.
administrasi
.
f11
==
'
gardu_listrik
'
){
if
(
feature
.
properties
.
f4
!=
null
)
{
var
list_history
=
feature
.
properties
.
f4
var
list_history_panel
=
``
for
(
var
i
=
0
;
i
<
list_history
.
length
;
i
++
)
{
var
dt_history
=
list_history
[
i
].
split
(
"
,
"
);
console
.
log
(
dt_history
[
0
])
console
.
log
(
dt_history
[
1
])
console
.
log
(
dt_history
[
2
])
var
data_history
=
`<div class="form-group" style="margin-bottom:0px;">
<div class="row">
<label class="col-md-6">`
+
dt_history
[
1
]
+
`</label>
<label class="col-md-6">`
+
dt_history
[
2
]
+
`</label>
</div>
</div>`
;
list_history_panel
+=
data_history
};
// var list_history = feature.properties.f7
history
=
`
<tr style="height: 40px;">
// var list_history_panel = ``
<th id="history_panel">
// for (var i = 0; i
<
list_history
.
length
;
i
++
)
{
<p class="text-center">
// var dt_history = list_history[i].split(",");
History Perbaikan
</p>
// var data_history = `
<
div
class
=
"
form-group
"
style
=
"
margin-bottom:0px;
"
>
<br>
//
<
div
class
=
"
row
"
>
<label class="col-md-6"><b>Tanggal</b></label>
//
<
label
class
=
"
col-md-6
"
>
` + dt_history[1] + `
<
/label
>
<label class="col-md-6"><b>Jenis Perbaikan</b></label>
//
<
a
class
=
"
col-md-3
"
onclick
=
"
getjalanper(` + dt_history[0] + `)
"
><
i
>
View
Ruas
<
/i></
a
>
`
+
list_history_panel
+
`
//
<
a
class
=
"
col-md-3
"
onclick
=
"
getdetailper(` + dt_history[0] + `)
"
data
-
toggle
=
"
modal
"
data
-
target
=
"
#modal_detail
"
><
i
>
View
Detail
<
/i></
a
>
<p class="text-center" style="margin-top: 15px;">
//
<
/div
>
<a id='btn_detail_per_bang' onclick="getdetailperbang(`
+
feature
.
properties
.
f1
+
`)" data-toggle="modal" data-target="#modal_detail" class="btn btn-default"><i>View Detail</i></a>
//
<
/div>`
;
<a href="#" id='btn_perbaikan_bangunan' data-toggle="modal" data-target="#input_perbaikan_bang" data-backdrop="static" data-keyboard="false" class="btn btn-default"><i>Tambah History Perbaikan</i></a>
// list_history_panel += data_history
</p>
// };
</th>
</tr>`
;
// history = `
<
p
class
=
"
text-center
"
>
}
else
{
// History Perbaikan
history
=
`
//
<
/p
>
<tr style="height: 40px;">
//
<
br
>
<th id="history_panel">
// ` + list_history_panel + `
<p class="text-center">
//
<
p
class
=
"
text-center
"
style
=
"
margin-top: 10px;
"
>
History Perbaikan
//
<
a
href
=
"
#
"
id
=
'
btn_perbaikan_jalan
'
class
=
"
btn btn-default
"
><
i
>
Tambah
History
Perbaikan
<
/i></
a
>
</p>
//
<
/p>`
;
<br>
<p class="text-center" style="margin-top: 10px;">Belum Ada History</p>
<p class="text-center" style="margin-top: 10px;">
<a href="#" id='btn_perbaikan_bangunan' data-toggle="modal" data-target="#input_perbaikan_bang" data-backdrop="static" data-keyboard="false" class="btn btn-default"><i>Tambah History Perbaikan</i></a>
</p>
</th>
</tr>`
;
}
}
else
{
history
=
``
}
content_edit
=
`
content_edit
=
`
<div class="modal-dialog" style="width: max-content;height: max-content;">
<div class="modal-dialog" style="width: max-content;height: max-content;">
...
@@ -4926,7 +4968,7 @@
...
@@ -4926,7 +4968,7 @@
</div>
</div>
</div>
</div>
<div class="col-md-4">
<div class="col-md-4">
<input type="text" class="hidden" name="coordinatebangunan" id="coordinatebangunan" value="`
+
feature
.
geometry
+
`">
<input type="text" class="hidden" name="coordinatebangunan" id="coordinatebangunan" value="`
+
feature
.
geometry
+
`">
<table>
<table>
<tr style="margin-top: 10px">
<tr style="margin-top: 10px">
<th>
<th>
...
@@ -4934,28 +4976,28 @@
...
@@ -4934,28 +4976,28 @@
</th>
</th>
<td>
<td>
<input type="file" id="imgbangunan" name="images[]" multiple accept="image/jpg,image/png,image/jpeg,image/gif">
<input type="file" id="imgbangunan" name="images[]" multiple accept="image/jpg,image/png,image/jpeg,image/gif">
<input style="display:none;" id="gambar" type="text" class="form-control" value="`
+
feature
.
administrasi
.
f9
+
`"required>
<input style="display:none;" id="gambar" type="text" class="form-control" value="`
+
feature
.
administrasi
.
f9
+
`"required>
</td>
</td>
</tr>
</tr>
<tr>
<tr>
<td>
<td>
<input type="text" name="idbangunan" id="idbangunan" class="form-control hidden" value="`
+
feature
.
properties
.
f1
+
`" disable>
<input type="text" name="idbangunan" id="idbangunan" class="form-control hidden" value="`
+
feature
.
properties
.
f1
+
`" disable>
<input style="display:none;" id="coordinateZoneeditbang" type="text" class="form-control" value=""required>
<input style="display:none;" id="coordinateZoneeditbang" type="text" class="form-control" value=""required>
</td>
</td>
</tr>
</tr>
<tr>
<tr>
<th>Nama Bangunan</th>
<th>Nama Bangunan</th>
<td>
<td>
<input type="text" name="namebangunan" id="namebangunan" class="form-control" value="`
+
feature
.
properties
.
f2
+
`">
<input type="text" name="namebangunan" id="namebangunan" class="form-control" value="`
+
feature
.
properties
.
f2
+
`">
</td>
</td>
</tr>
</tr>
<tr>
<tr>
<th>Jenis Bangunan</th>
<th>Jenis Bangunan</th>
<td>
<td>
<input type="text" class="hidden" name="tipe1" id="tipe111" value="`
+
feature
.
administrasi
.
f11
+
`">
<input type="text" class="hidden" name="tipe1" id="tipe111" value="`
+
feature
.
administrasi
.
f11
+
`">
<input type="text" class="hidden" name="tipe1" id="tipe222" value="`
+
feature
.
administrasi
.
f12
+
`">
<input type="text" class="hidden" name="tipe1" id="tipe222" value="`
+
feature
.
administrasi
.
f12
+
`">
<input type="text" class="hidden" name="tipe1" id="tipe333" value="`
+
feature
.
administrasi
.
f13
+
`">
<input type="text" class="hidden" name="tipe1" id="tipe333" value="`
+
feature
.
administrasi
.
f13
+
`">
<input type="text" class="hidden" name="tipe1" id="tipe444" value="`
+
feature
.
administrasi
.
f14
+
`">
<input type="text" class="hidden" name="tipe1" id="tipe444" value="`
+
feature
.
administrasi
.
f14
+
`">
<select style="border-bottom: 1px solid rgb(83, 83, 83) !important;width: 220px;" id="tipe_point_b_e" data-placeholder="select point.." class="select-size-md">
<select style="border-bottom: 1px solid rgb(83, 83, 83) !important;width: 220px;" id="tipe_point_b_e" data-placeholder="select point.." class="select-size-md">
<option value="null" selected disabled>-- Pilih Jenis Point --</option>
<option value="null" selected disabled>-- Pilih Jenis Point --</option>
<option value="bangunan">Bangunan Biasa</option>
<option value="bangunan">Bangunan Biasa</option>
...
@@ -4989,31 +5031,31 @@
...
@@ -4989,31 +5031,31 @@
<tr>
<tr>
<th>Informasi Bangunan</th>
<th>Informasi Bangunan</th>
<td>
<td>
<input type="text" name="infobangunan" id="infobangunan" class="form-control" value="`
+
feature
.
properties
.
f3
+
`">
<input type="text" name="infobangunan" id="infobangunan" class="form-control" value="`
+
feature
.
properties
.
f3
+
`">
</td>
</td>
</tr>
</tr>
<tr>
<tr>
<th>Kelurahan</th>
<th>Kelurahan</th>
<td>
<td>
<input type=" text " name="nmkelurahan " id="nmkelurahan" class="form-control " value="`
+
feature
.
administrasi
.
f1
+
`">
<input type=" text " name="nmkelurahan " id="nmkelurahan" class="form-control " value="`
+
feature
.
administrasi
.
f1
+
`">
</td>
</td>
</tr>
</tr>
<tr>
<tr>
<th>Kecamatan</th>
<th>Kecamatan</th>
<td>
<td>
<input type="text " name="nmkecamatan " id="nmkecamatan" class="form-control " value="`
+
feature
.
administrasi
.
f2
+
`">
<input type="text " name="nmkecamatan " id="nmkecamatan" class="form-control " value="`
+
feature
.
administrasi
.
f2
+
`">
</td>
</td>
</tr>
</tr>
<tr>
<tr>
<th>Kab/Kota</th>
<th>Kab/Kota</th>
<td>
<td>
<input type="text " name="nmkabkota " id="nmkabkota" class="form-control " value="`
+
feature
.
administrasi
.
f3
+
`">
<input type="text " name="nmkabkota " id="nmkabkota" class="form-control " value="`
+
feature
.
administrasi
.
f3
+
`">
</td>
</td>
</tr>
</tr>
<tr>
<tr>
<th>Provinsi</th>
<th>Provinsi</th>
<td>
<td>
<input type="text " name="nmprovinsi " id="nmprovinsi" class="form-control " value="`
+
feature
.
administrasi
.
f4
+
`">
<input type="text " name="nmprovinsi " id="nmprovinsi" class="form-control " value="`
+
feature
.
administrasi
.
f4
+
`">
</td>
</td>
</tr>
</tr>
...
@@ -5026,25 +5068,25 @@
...
@@ -5026,25 +5068,25 @@
<tr>
<tr>
<th>Luas Bangunan</th>
<th>Luas Bangunan</th>
<td>
<td>
<input type="text " name="luasbangunan " id="luasbangunan" class="form-control " value="`
+
feature
.
administrasi
.
f6
+
`">
<input type="text " name="luasbangunan " id="luasbangunan" class="form-control " value="`
+
feature
.
administrasi
.
f6
+
`">
</td>
</td>
</tr>
</tr>
<tr>
<tr>
<th>Luas Tanah</th>
<th>Luas Tanah</th>
<td>
<td>
<input type="text " name="luastanah " id="luastanah" class="form-control " value="`
+
feature
.
administrasi
.
f7
+
`">
<input type="text " name="luastanah " id="luastanah" class="form-control " value="`
+
feature
.
administrasi
.
f7
+
`">
</td>
</td>
</tr>
</tr>
<tr>
<tr>
<th>Tinggi Bangunan</th>
<th>Tinggi Bangunan</th>
<td>
<td>
<input type="text " name="tinggibangunan " id="tinggibangunan" class="form-control " value="`
+
feature
.
administrasi
.
f8
+
`">
<input type="text " name="tinggibangunan " id="tinggibangunan" class="form-control " value="`
+
feature
.
administrasi
.
f8
+
`">
</td>
</td>
</tr>
</tr>
<tr>
<tr>
<th>Pemilik</th>
<th>Pemilik</th>
<td>
<td>
<input type="text " name="pemilik " id="pemilik" class="form-control " value="`
+
feature
.
administrasi
.
f10
+
`">
<input type="text " name="pemilik " id="pemilik" class="form-control " value="`
+
feature
.
administrasi
.
f10
+
`">
</td>
</td>
</tr>
</tr>
</table>
</table>
...
@@ -5058,7 +5100,7 @@
...
@@ -5058,7 +5100,7 @@
</div>
</div>
</div>
</div>
</div>`
;
</div>`
;
content_delete
=
`
content_delete
=
`
<div class="modal-dialog" style="width: max-content;height: max-content;">
<div class="modal-dialog" style="width: max-content;height: max-content;">
<div class="modal-content">
<div class="modal-content">
<div class="modal-header bg-info" style="background-color:#40777c;">
<div class="modal-header bg-info" style="background-color:#40777c;">
...
@@ -5074,9 +5116,9 @@
...
@@ -5074,9 +5116,9 @@
<div class="form-group">
<div class="form-group">
<div class="col-lg-12" style="margin-top:10px;margin-bottom:10px;">
<div class="col-lg-12" style="margin-top:10px;margin-bottom:10px;">
<input type="text" class="hidden" name="coordinatebangunan" id="coordinatebangunanhps" value="">
<input type="text" class="hidden" name="coordinatebangunan" id="coordinatebangunanhps" value="">
<input type="text" name="idbangunan" id="idbangunanhps" class="form-control hidden" value="`
+
feature
.
properties
.
f1
+
`" disable>
<input type="text" name="idbangunan" id="idbangunanhps" class="form-control hidden" value="`
+
feature
.
properties
.
f1
+
`" disable>
<input type="text" name="namebangunan" id="namebangunanhps" class="form-control" value="`
+
feature
.
properties
.
f2
+
`">
<input type="text" name="namebangunan" id="namebangunanhps" class="form-control" value="`
+
feature
.
properties
.
f2
+
`">
<input type="text" name="infobangunan" id="infobangunanhps" class="form-control" value="`
+
feature
.
properties
.
f3
+
`">
<input type="text" name="infobangunan" id="infobangunanhps" class="form-control" value="`
+
feature
.
properties
.
f3
+
`">
</div>
</div>
</div>
</div>
</div>
</div>
...
@@ -5259,17 +5301,7 @@
...
@@ -5259,17 +5301,7 @@
</tr>
</tr>
</div>
</div>
<div class="container">
<div class="container">
<tr style="height: 40px;">
`
+
history
+
`
<th id="history_panel">
<p class="text-center">
History Perbaikan
</p>
<br>
<p class="text-center" style="margin-top: 10px;">
<a href="#" id='btn_perbaikan_bangunan' data-toggle="modal" data-target="#input_perbaikan_bang" data-backdrop="static" data-keyboard="false" class="btn btn-default"><i>Tambah History Perbaikan</i></a>
</p>
</th>
</tr>
</div>
</div>
</tbody>
</tbody>
</table>`
;
</table>`
;
...
@@ -5340,10 +5372,6 @@
...
@@ -5340,10 +5372,6 @@
geo_bangunan
.
addData
(
data
)
geo_bangunan
.
addData
(
data
)
}
}
var
checkBox_building
=
document
.
getElementById
(
"
geo_building
"
);
var
checkBox_2d
=
document
.
getElementById
(
"
2d-maps
"
);
map
.
on
(
"
movestart
"
,
function
()
{
map
.
on
(
"
movestart
"
,
function
()
{
geo_bangunan
.
clearLayers
();
geo_bangunan
.
clearLayers
();
});
});
...
@@ -5356,7 +5384,10 @@
...
@@ -5356,7 +5384,10 @@
var
center
=
map
.
getBounds
().
getCenter
();
var
center
=
map
.
getBounds
().
getCenter
();
var
zoom
=
map
.
getZoom
();
var
zoom
=
map
.
getZoom
();
if
(
checkBox_building
.
checked
==
true
||
checkBox_2d
.
checked
==
true
)
{
var
checkBox_building
=
document
.
getElementById
(
"
geo_building
"
);
// var checkBox_2d = document.getElementById("2d-maps");
if
(
checkBox_building
.
checked
==
true
)
{
if
(
zoom
>
17
)
{
if
(
zoom
>
17
)
{
if
(
map
.
hasLayer
(
geo_bangunan
))
{
if
(
map
.
hasLayer
(
geo_bangunan
))
{
...
@@ -5425,12 +5456,7 @@
...
@@ -5425,12 +5456,7 @@
loaderPage
(
true
);
loaderPage
(
true
);
var
tipe1
=
$
(
'
#tipe111
'
).
val
();
var
tipe1
=
$
(
'
#tipe111
'
).
val
();
<<<<<<<
HEAD
$
(
'
#tipe_point_b_e option[value=
'
+
tipe1
+
'
]
'
).
attr
(
'
selected
'
,
'
selected
'
);
$
(
'
#tipe_point_b_e option[value=
'
+
tipe1
+
'
]
'
).
attr
(
'
selected
'
,
'
selected
'
);
=======
$
(
'
#tipe_point_b_e option[value=
'
+
tipe1
+
'
]
'
).
attr
(
'
selected
'
,
'
selected
'
);
// $("#tipe_point_b_e option").val(tipe1).change();
>>>>>>>
18486
b82a9845aa577f0dadfb192db38146dcdcf
$
(
"
#tipe_point_b_e
"
).
change
(
function
()
{
$
(
"
#tipe_point_b_e
"
).
change
(
function
()
{
$
(
'
#tipe_point_2_b_e
'
).
empty
();
$
(
'
#tipe_point_2_b_e
'
).
empty
();
...
@@ -5465,8 +5491,8 @@
...
@@ -5465,8 +5491,8 @@
var
tipe2
=
$
(
'
#tipe222
'
).
val
();
var
tipe2
=
$
(
'
#tipe222
'
).
val
();
if
(
tipe2
==
'
null
'
)
{
if
(
tipe2
==
'
null
'
)
{
$
(
'
#tipe_point_2_b_e
'
).
html
(
`<option value="null" selected disabled>-- Pilih Tipe Point --</option>`
);
$
(
'
#tipe_point_2_b_e
'
).
html
(
`<option value="null" selected disabled>-- Pilih Tipe Point --</option>`
);
}
else
{
}
else
{
$
(
'
#tipe_point_2_b_e
'
).
html
(
`<option value="`
+
tipe2
+
`" selected disabled>`
+
tipe2
+
`</option>`
);
$
(
'
#tipe_point_2_b_e
'
).
html
(
`<option value="`
+
tipe2
+
`" selected disabled>`
+
tipe2
+
`</option>`
);
}
}
$
(
"
#tipe_point_2_b_e
"
).
change
(
function
()
{
$
(
"
#tipe_point_2_b_e
"
).
change
(
function
()
{
...
@@ -5489,7 +5515,7 @@
...
@@ -5489,7 +5515,7 @@
var
data_po
=
data
[
'
result
'
][
i
][
1
];
var
data_po
=
data
[
'
result
'
][
i
][
1
];
console
.
log
(
data_id
)
console
.
log
(
data_id
)
console
.
log
(
data_po
)
console
.
log
(
data_po
)
var
data_kab
=
`<option value="`
+
data_id
+
`">`
+
data_po
+
`</option>`
;
var
data_kab
=
`<option value="`
+
data_id
+
`">`
+
data_po
+
`</option>`
;
data_all_kab
.
push
(
data_kab
)
data_all_kab
.
push
(
data_kab
)
};
};
$
(
'
#tipe_point_3_b_e
'
).
html
(
`<option value="null" selected disabled>-- Pilih Point --</option>`
+
data_all_kab
);
$
(
'
#tipe_point_3_b_e
'
).
html
(
`<option value="null" selected disabled>-- Pilih Point --</option>`
+
data_all_kab
);
...
@@ -5499,16 +5525,11 @@
...
@@ -5499,16 +5525,11 @@
var
tipe3
=
$
(
'
#tipe333
'
).
val
();
var
tipe3
=
$
(
'
#tipe333
'
).
val
();
var
tipe4
=
$
(
'
#tipe444
'
).
val
();
var
tipe4
=
$
(
'
#tipe444
'
).
val
();
<<<<<<<
HEAD
=======
// $('#tipe_point_3_b_e option[value='+tipe3+']').attr('selected','selected');
>>>>>>>
18486
b82a9845aa577f0dadfb192db38146dcdcf
if
(
tipe3
==
'
null
'
)
{
if
(
tipe3
==
'
null
'
)
{
$
(
'
#tipe_point_3_b_e
'
).
html
(
`<option value="null" selected disabled>-- Pilih Point --</option>`
);
$
(
'
#tipe_point_3_b_e
'
).
html
(
`<option value="null" selected disabled>-- Pilih Point --</option>`
);
}
else
{
}
else
{
$
(
'
#tipe_point_3_b_e
'
).
html
(
`<option value="`
+
tipe3
+
`" selected disabled>`
+
tipe4
+
`</option>`
);
$
(
'
#tipe_point_3_b_e
'
).
html
(
`<option value="`
+
tipe3
+
`" selected disabled>`
+
tipe4
+
`</option>`
);
}
}
$
.
ajax
({
$
.
ajax
({
...
@@ -5547,11 +5568,6 @@
...
@@ -5547,11 +5568,6 @@
});
});
<<<<<<<
HEAD
=======
>>>>>>>
18486
b82a9845aa577f0dadfb192db38146dcdcf
$
(
document
).
on
(
"
click
"
,
"
#btnsavebangunan
"
,
function
()
{
$
(
document
).
on
(
"
click
"
,
"
#btnsavebangunan
"
,
function
()
{
var
data
=
new
FormData
();
var
data
=
new
FormData
();
data
.
append
(
"
file
"
,
$
(
"
input[id^='imgbangunan']
"
)[
0
].
files
[
0
]);
data
.
append
(
"
file
"
,
$
(
"
input[id^='imgbangunan']
"
)[
0
].
files
[
0
]);
...
@@ -5721,7 +5737,6 @@
...
@@ -5721,7 +5737,6 @@
// }).addTo(map_bang);
// }).addTo(map_bang);
$
(
document
).
on
(
"
click
"
,
"
#btn_perbaikan_bangunan
"
,
function
()
{
$
(
document
).
on
(
"
click
"
,
"
#btn_perbaikan_bangunan
"
,
function
()
{
<<<<<<<
HEAD
var
map_bang
=
new
L
.
map
(
'
map-insert-renov-bang
'
,
{
var
map_bang
=
new
L
.
map
(
'
map-insert-renov-bang
'
,
{
editable
:
true
,
editable
:
true
,
zoomControl
:
false
,
zoomControl
:
false
,
...
@@ -5733,19 +5748,12 @@
...
@@ -5733,19 +5748,12 @@
minZoom
:
4
,
minZoom
:
4
,
}).
addTo
(
map_bang
);
}).
addTo
(
map_bang
);
=======
// if (map_bang.hasLayer(polyxxx)) {
// polyxxx.remove()
// }
// var id_polyx = $('#idbangunan').val();
>>>>>>>
18486
b82a9845aa577f0dadfb192db38146dcdcf
$
(
"
#input_perbaikan_bang
"
).
css
(
"
display
"
,
"
block
"
);
$
(
"
#input_perbaikan_bang
"
).
css
(
"
display
"
,
"
block
"
);
if
(
map_bang
.
hasLayer
(
polyxxx
))
{
if
(
map_bang
.
hasLayer
(
polyxxx
))
{
polyxxx
.
remove
()
polyxxx
.
remove
()
}
}
var
id_polyx
=
$
(
'
#idbangunan
'
).
val
();
var
id_polyx
=
$
(
'
#idbangunan
'
).
val
();
<<<<<<<
HEAD
$
.
ajax
({
$
.
ajax
({
url
:
"
{% url 'apps:input-perbaikan-bang' %}
"
,
url
:
"
{% url 'apps:input-perbaikan-bang' %}
"
,
data
:
{
data
:
{
...
@@ -5880,37 +5888,57 @@
...
@@ -5880,37 +5888,57 @@
})
})
});
});
=======
function
getdetailperbang
(
id
)
{
// $.ajax({
$
.
ajax
({
// url: "{% url 'apps:input-perbaikan-bang' %}",
url
:
"
{% url 'apps:get-detail-perbaikan-bang' %}
"
,
// data: {
data
:
{
// 'id_bangunan': id_polyx
'
id
'
:
id
// },
},
// dataType: 'json',
dataType
:
'
json
'
,
// success: function(data) {
success
:
function
(
data
)
{
// $("#nama_bang").val(data[0]);
// $("#type_bang").val(data[1]);
// $("#id_bang_perbaikan").val(data[3]);
// $("#type_id_bang").val("1")
// var latlngs = data[2];
// map_bang.setView([latlngs['geometry']['coordinates'][0][0][1], latlngs['geometry']['coordinates'][0][0][0]], 19)
// let lop_poly_edit = data['geometry']['coordinates'][0][0];
// let list_poly_edit = [];
// for (var i = 0; i
<
lop_poly_edit
.
length
;
i
++
)
{
// geoj = lop_poly_edit[i][0];
// polygigi = [lop_poly_edit[i][1], lop_poly_edit[i][0]]
// list_poly_edit.push(polygigi);
// };
// polylyly = L.polygon(list_poly_edit).addTo(map_bang)
isi_modal_detail
=
[]
// polylyly.enableEdit();
for
(
var
i
=
0
;
i
<
data
.
length
;
i
++
)
{
// var hasil = (JSON.stringify(polylyly.toGeoJSON()))
isi_modal_detail
.
push
(
`
<tr>
<td>`
+
i
+
`</td>
<td>`
+
data
[
i
].
name
+
`</td>
<td>`
+
data
[
i
].
type
+
`</td>
<td>`
+
data
[
i
].
tgl_perbaikan
+
`</td>
<td>`
+
data
[
i
].
anggaran
+
`</td>
<td>`
+
data
[
i
].
pj
+
`</td>
<td>`
+
data
[
i
].
pj_lapangan
+
`</td>
<td>`
+
data
[
i
].
kontraktor
+
`</td>
<td>`
+
data
[
i
].
jenis_perbaikan
+
`</td>
<td><a href="media/proposal/`
+
data
[
i
].
proposal
+
`" id="downloadproposal">View</a></td>
<td><a href="media/bukti_penyelesaian/`
+
data
[
i
].
bukti_selesai
+
`" onclick="viewBukti()" id="view-bukti">View</a></td>
</tr>`
)
}
$
(
"
#isi_modal_detail
"
).
html
(
`
<table class="table table-responsive datatable-show-all table-sm" id="isi_detail" style="word-wrap:break-word;">
<thead>
<tr>
<th>No.</th>
<th>Nama</th>
<th>Type</th>
<th>Tanggal Perbaikan</th>
<th>Anggaran</th>
<th>Penanggung Jawab</th>
<th>Penanggung Jawab Lapangan</th>
<th>Kontraktor</th>
<th>Jenis Perbaikan</th>
<th>Proposal</th>
<th>Bukti Penyelesaian</th>
</tr>
</thead>
<tbody>
`
+
isi_modal_detail
+
`
</tbody>
</table>`
)
// }
}
// })
});
})
};
>>>>>>>
18486
b82a9845aa577f0dadfb192db38146dcdcf
</script>
</script>
{% include 'includes/insert.html' %}
{% include 'includes/insert.html' %}
\ No newline at end of file
templates/includes/js-o.html
View file @
7514bdf4
...
@@ -47,6 +47,14 @@
...
@@ -47,6 +47,14 @@
.leaflet-popup
{
.leaflet-popup
{
display
:
block
;
display
:
block
;
}
}
#btn_detail_per_bang
{
display
:
block
;
}
#btn_perbaikan_bangunan
{
display
:
block
;
}
</style>
</style>
{% elif group.name == 'Dinas Kependudukan dan Pencatatan Sipil' %}
{% elif group.name == 'Dinas Kependudukan dan Pencatatan Sipil' %}
<style>
<style>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment