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
696fadf2
Commit
696fadf2
authored
Aug 06, 2021
by
Manggar Mahardhika
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
push go
parent
96f254b9
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
557 additions
and
64 deletions
+557
-64
Application/urls.py
Application/urls.py
+1
-0
Application/views.py
Application/views.py
+143
-2
templates/includes/content.html
templates/includes/content.html
+6
-5
templates/includes/js-m.html
templates/includes/js-m.html
+286
-56
templates/includes/modal.html
templates/includes/modal.html
+121
-1
No files found.
Application/urls.py
View file @
696fadf2
...
...
@@ -15,6 +15,7 @@ urlpatterns = [
path
(
'input-perbaikan'
,
views
.
inpuperbaikan
,
name
=
'input-perbaikan'
),
path
(
'input-perbaikan-bang'
,
views
.
inputperbaikanbangunan
,
name
=
'input-perbaikan-bang'
),
path
(
'save-perbaikan'
,
views
.
saveperbaikan
,
name
=
'save-perbaikan'
),
path
(
'save-perbaikan-bang'
,
views
.
saveperbaikanbangunan
,
name
=
'save-perbaikan-bang'
),
path
(
'load-jl-by-id-detail'
,
views
.
loadbyiddetail
,
name
=
'load-jl-by-id-detail'
),
path
(
'get-jalan-perbaikan'
,
views
.
getjalanperbaikan
,
name
=
'get-jalan-perbaikan'
),
...
...
Application/views.py
View file @
696fadf2
...
...
@@ -648,9 +648,12 @@ def inputperbaikanbangunan(request):
data_per
.
execute
(
"""
SELECT
name,
type,
type
_id
,
json_build_object ( 'type', 'Feature', 'geometry', ST_AsGeoJSON ( geom :: geometry ) :: json ),
ID
ID,
remark,
address_1,
address_2
FROM
geo_bangunan
WHERE
...
...
@@ -714,6 +717,7 @@ def saveperbaikan(request):
ll
=
ll
.
replace
(
"[["
,
"("
)
coordinat
=
f
'MULTILINESTRING({ll})'
print
(
ll
)
if
coord
[
'features'
][
0
][
'geometry'
][
'type'
]
==
'Polygon'
:
print
(
'tidakoke'
)
...
...
@@ -801,6 +805,143 @@ def saveperbaikan(request):
respon
=
{
"data"
:
data
,
"info"
:
info
,
"code"
:
code
}
return
Response
(
respon
)
# from django.core.files.storage import FileSystemStorage
# import random
# import re
# import json
@
api_view
((
'POST'
,))
def
saveperbaikanbangunan
(
request
):
type_id
=
'1'
id_object
=
request
.
POST
.
get
(
"object_idbang"
)
name
=
request
.
POST
.
get
(
"namebang"
)
type
=
request
.
POST
.
get
(
"typebang"
)
# tgl_pembuatan = request.POST.get("tgl_pembuatanbang")
tgl_perbaikan
=
request
.
POST
.
get
(
"tgl_perbaikanbang"
)
tgl_disetujui
=
request
.
POST
.
get
(
"tgl_disetujuibang"
)
anggaran
=
request
.
POST
.
get
(
"anggaranbang"
)
pj
=
request
.
POST
.
get
(
"pjbang"
)
pj_lapangan
=
request
.
POST
.
get
(
"pj_lapanganbang"
)
kontraktor
=
request
.
POST
.
get
(
"kontraktorbang"
)
jenis_perbaikan
=
request
.
POST
.
get
(
"jenis_perbaikanbang"
)
coor
=
request
.
POST
.
get
(
"coordbang"
)
# for co in coor['features']:
# ll = coor['geometry']['coordinates']
# ll += ll
# ll = ll.replace(", "," ")
# ll = ll.replace("]][[","),(")
# ll = ll.replace("] [",", ")
# ll = ll.replace("]]",")")
# ll = ll.replace("[[","(")
# corcoran = ll
# p_create = coor.replace('"','')
# po_create = p_create.replace(', ','],[')
# cood_edit = json.loads(coor)
# co_edit = cood_edit['geometry']['coordinates']
yak
=
str
(
coor
)
suk
=
yak
.
replace
(
"""{"type":"Feature","properties":{},"geometry":{"type":"Polygon","coordinates":"""
,
""
)
sik
=
suk
.
replace
(
"""}}"""
,
""
)
cor
=
sik
.
replace
(
"""[[["""
,
"(("
)
coran
=
cor
.
replace
(
"""]]]"""
,
"))"
)
ll
=
coran
.
replace
(
","
,
" "
)
ii
=
ll
.
replace
(
"] ["
,
","
)
corcoran
=
f
'MULTIPOLYGON({ii})'
print
(
"-------------------"
)
print
(
str
(
corcoran
))
print
(
"-------------------"
)
# print(yak)
tgl_selesai
=
request
.
POST
.
get
(
"tgl_selesaibang"
)
proposal
=
request
.
FILES
.
get
(
"proposal_bang"
)
bukti_selesai
=
request
.
FILES
.
get
(
"bukti_selesai_bang"
)
fss_p
=
FileSystemStorage
(
location
=
'media/proposal/'
)
fss_b
=
FileSystemStorage
(
location
=
'media/bukti_penyelesaian/'
)
try
:
format
=
(
proposal
.
name
)
.
split
(
"."
)
num
=
random
.
randrange
(
1
,
10000000000000
)
nproposal
=
f
"{name}_{num}.{format[-1:][0]}"
nproposal
=
nproposal
.
replace
(
" "
,
"-"
)
filename_p
=
fss_p
.
save
(
nproposal
,
proposal
)
url_p
=
fss_p
.
url
(
filename_p
)
nbukti
=
f
"{name}_{num}.{format[-1:][0]}"
nbukti
=
nbukti
.
replace
(
" "
,
"-"
)
filename_b
=
fss_b
.
save
(
nbukti
,
bukti_selesai
)
url_b
=
fss_b
.
url
(
filename_b
)
with
conn
.
cursor
()
as
data_per
:
data_per
.
execute
(
"""
INSERT INTO tbl_perbaikan (
type_id,
id_object,
name,
type,
tgl_selesai,
tgl_perbaikan,
tgl_disetujui,
anggaran,
proposal,
bukti_selesai,
pj,
pj_lapangan,
kontraktor,
jenis_perbaikan,
geom
)
VALUES
(
%
s,
%
s,
'
%
s',
'
%
s',
'
%
s',
'
%
s',
'
%
s',
%
s,
'
%
s',
'
%
s',
'
%
s',
'
%
s',
'
%
s',
'
%
s',
ST_GeomFromText('
%
s')
)
"""
%
(
int
(
type_id
),
int
(
id_object
),
name
,
type
,
tgl_selesai
,
tgl_perbaikan
,
tgl_disetujui
,
int
(
anggaran
),
nproposal
,
nbukti
,
pj
,
pj_lapangan
,
kontraktor
,
jenis_perbaikan
,
corcoran
))
conn
.
commit
()
data
=
"Sukses"
info
=
"Data Telah Berhasil di Perbaharui"
code
=
0
except
:
data
=
"Pastikan Semua Data Terisi Termasuk Proposal dan Bukti Selesai"
info
=
"Oops"
code
=
1
respon
=
{
"data"
:
data
,
"info"
:
info
,
"code"
:
code
}
return
Response
(
respon
)
@
api_view
((
'GET'
,))
def
loadbyiddetail
(
request
):
id
=
request
.
GET
.
get
(
'id'
)
...
...
templates/includes/content.html
View file @
696fadf2
...
...
@@ -130,21 +130,21 @@
<ul
class=
"nav nav-tabs nav-tabs-bottom nav-justified"
>
<button
type=
"button"
class=
"close"
onclick=
"destroyWraper()"
>
×
</button>
<li
class=
"active"
><a
href=
"#left-tab-input-coordinat"
data-toggle=
"tab"
>
Koordinat
</a></li>
<li><a
href=
"#right-tab-input-informasi"
data-toggle=
"tab"
>
Insert Informasi
</a></li>
<li
class=
"active"
><a
href=
"#left-tab-input-coordinat
_bang
"
data-toggle=
"tab"
>
Koordinat
</a></li>
<li><a
href=
"#right-tab-input-informasi
_bang
"
data-toggle=
"tab"
>
Insert Informasi
</a></li>
</ul>
</div>
<div
class=
"tab-content"
>
<div
class=
"tab-pane active"
id=
"left-tab-input-coordinat"
>
<div
class=
"tab-pane active"
id=
"left-tab-input-coordinat
_bang
"
>
<div
class=
"modal-body"
style=
"max-height: 450px;overflow-y: auto;"
>
<input
type=
"text"
class=
"hidden"
id=
"poly_create_input_bang"
>
<input
type=
"text"
class=
"hidden"
id=
"id_bang_perbaikan"
>
<input
type=
"text"
class=
"hidden"
id=
"type_id_bang"
>
<div
id=
"map-insert-bang"
style=
"height: 375px;width: 100%"
>
<div
id=
"map-insert-
renov-
bang"
style=
"height: 375px;width: 100%"
>
</div>
</div>
</div>
<div
class=
"tab-pane"
id=
"right-tab-input-informasi"
>
<div
class=
"tab-pane"
id=
"right-tab-input-informasi
_bang
"
>
<div
class=
"modal-body"
style=
"max-height: 415px;overflow-y: auto;"
>
<div
class=
"row"
>
<div
class=
"col-md-6"
>
...
...
@@ -232,6 +232,7 @@
</div>
<div
class=
"panel-footer"
>
<input
type=
"text"
id=
"coorbangbaru"
class=
"form-control"
value=
""
>
<button
type=
"button"
class=
"btn btn-info"
id=
"save-perbaikan_bang"
style=
"float: right; margin-right: 40px;"
>
SAVE
</button>
<button
type=
"button"
class=
"btn btn-link"
onclick=
"destroyWraper()"
style=
"float: right;"
>
Close
</button>
...
...
templates/includes/js-m.html
View file @
696fadf2
...
...
@@ -5031,6 +5031,112 @@
</div>
</div>
</div>`
;
content_inp_his_bang
=
`
<div class="modal-dialog" style="height: max-content;">
<div class="modal-content">
<div class="modal-header bg-info" style="background-color:#40777c;">
<button type="button" class="close" data-dismiss="modal">×</button>
<h6 class="modal-title">Renovasi Bangunan</h6>
</div>
<div class="modal-body" style="max-height: 450px;overflow-y: auto;">
<div class="tab-pane has-padding" id="panel-tab2">
<div class="tab-pane" id="bottom-justified-data">
<div class="tabbable">
<ul class="nav nav-tabs nav-tabs-bottom nav-justified">
<li onclick="changetabs(this)" class="active"><a href="#left-tab1-feas-upl" data-toggle="tab">Koordinat</a></li>
<li onclick="changetabs(this)"><a href="#right-tab2-feas-upl" data-toggle="tab">Informasi Umum</a></li>
</ul>
<div class="tab-content">
<div class="tab-pane active" id="left-tab1-feas-upl">
<input type="text" class="hidden" id="poly_create_input_bang">
<input type="text" class="hidden" id="id_bang_perbaikan">
<input type="text" class="hidden" id="type_id_bang">
<div id="map-insert-renov-bang" style="height: 375px;width: 100%">
</div>
</div>
<div class="tab-pane" id="right-tab2-feas-upl">
<div class="row">
<div class="col-md-6">
<div class="form-group">
<label>Nama :</label>
<input type="text" id="nama_bang" class="form-control" value="">
</div>
<div class="form-group">
<label>Jenis :</label>
<input type="text" id="type_bang" class="form-control" value="">
</div>
<div class="form-group">
<label>Kelurahan :</label>
<input type="text" id="kelurahan_bang" class="form-control" value="">
</div>
<div class="form-group">
<label>Kecamatan :</label>
<input type="text" id="kecamatan_bang" class="form-control" value="">
</div>
<div class="form-group">
<label>Tanggal Disetujui :</label>
<input type="date" id="tgldisetujui_bang" class="form-control" value="">
</div>
<div class="form-group">
<label>Tanggal Mulai Perbaikan :</label>
<input type="date" id="tglmulaiperbaikan_bang" class="form-control" value="">
</div>
<div class="form-group">
<label>Tanggal Selesai Perbaikan :</label>
<input type="date" id="tglselesaiperbaikan_bang" class="form-control" value="">
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label>Anggaran :</label>
<input type="text" id="anggaran_bang" class="form-control" value="">
</div>
<div class="form-group">
<label>Pihak yang Mengesahkan :</label>
<input type="text" id="pihakpengesahan_bang" class="form-control" value="">
</div>
<div class="form-group">
<label>Penanggung Jawab Lapangan :</label>
<input type="text" id="pjlapangan_bang" class="form-control" value="">
</div>
<div class="form-group">
<label>Jenis Perbaikan :</label>
<input type="text" id="jenisperbaikan_bang" class="form-control" value="">
</div>
<div class="form-group">
<label>Kontraktor/Vendor :</label>
<input type="text" id="kontraktor_bang" class="form-control" value="">
</div>
<div class="form-group">
<label>Proposal (.pdf):</label>
<input type="file" id="proposal_bang">
</div>
<div class="form-group">
<label>Bukti Selesai Perbaikan (.png/.jpg/.jpeg/):</label>
<input type="file" id="buktiselesai_bang">
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="modal-footer">
<input type="text" id="coorbangbaru" class="hidden" value="">
<button type="button" class="btn btn-info" id="save-perbaikan_bang" style="float: right; margin-top: 5px; margin-right: 10px;">SAVE</button>
</div>
</div>
</div>`
;
content
=
`
<table class="table tasks-list">
<thead style="text-align: center;">
...
...
@@ -5060,7 +5166,7 @@
<tr style="height: 30px;">
<th>
<span>
`
+
feature
.
properties
.
f3
+
`
`
+
feature
.
administrasi
.
f12
+
`
</span>
</th>
</tr>
...
...
@@ -5105,7 +5211,7 @@
</p>
<br>
<p class="text-center" style="margin-top: 10px;">
<a href="#" id='btn_perbaikan_bangunan' class="btn btn-default"><i>Tambah History Perbaikan</i></a>
<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>
...
...
@@ -5115,6 +5221,7 @@
$
(
"
#isi_panel
"
).
html
(
content
);
$
(
"
#modal_bangunan_edit
"
).
html
(
content_edit
);
$
(
"
#modal_bangunan_delete
"
).
html
(
content_delete
);
$
(
"
#input_perbaikan_bang
"
).
html
(
content_inp_his_bang
);
});
// $("#tipe_point_b_e").val('feature.administrasi.f11').change();
// $('#tipe_point_b_e').val(feature.properties.f11).attr('selected','selected');
...
...
@@ -5264,9 +5371,10 @@
var
tipe1
=
$
(
'
#tipe111
'
).
val
();
$
(
'
#tipe_point_b_e option[value=
'
+
tipe1
+
'
]
'
).
attr
(
'
selected
'
,
'
selected
'
);
// $("#tipe_point_b_e option").val(tipe1).change();
$
(
"
#tipe_point_b_e
"
).
change
(
function
()
{
$
(
'
#tipe_point_2_b_e
'
).
empty
();
$
(
'
#tipe_point_3_b_e
'
).
empty
();
var
tipe
=
$
(
this
).
val
();
$
.
ajax
({
...
...
@@ -5295,7 +5403,6 @@
});
var
tipe2
=
$
(
'
#tipe222
'
).
val
();
// $('#tipe_point_2_b_e option[value='+tipe2+']').attr('selected','selected');
if
(
tipe2
==
'
null
'
)
{
$
(
'
#tipe_point_2_b_e
'
).
html
(
`<option value="null" selected disabled>-- Pilih Tipe Point --</option>`
);
}
else
{
...
...
@@ -5303,6 +5410,7 @@
}
$
(
"
#tipe_point_2_b_e
"
).
change
(
function
()
{
$
(
'
#tipe_point_3_b_e
'
).
empty
();
var
jenis
=
$
(
this
).
val
();
var
tipx
=
$
(
"
#tipe_point_b_e
"
).
val
();
...
...
@@ -5331,7 +5439,6 @@
var
tipe3
=
$
(
'
#tipe333
'
).
val
();
var
tipe4
=
$
(
'
#tipe444
'
).
val
();
// $('#tipe_point_3_b_e option[value='+tipe3+']').attr('selected','selected');
if
(
tipe3
==
'
null
'
)
{
$
(
'
#tipe_point_3_b_e
'
).
html
(
`<option value="null" selected disabled>-- Pilih Point --</option>`
);
...
...
@@ -5375,8 +5482,6 @@
});
$
(
document
).
on
(
"
click
"
,
"
#btnsavebangunan
"
,
function
()
{
var
data
=
new
FormData
();
data
.
append
(
"
file
"
,
$
(
"
input[id^='imgbangunan']
"
)[
0
].
files
[
0
]);
...
...
@@ -5515,62 +5620,187 @@
});
// var map_bang = new L.map('map-insert
-bang', {
//
editable: true,
//
zoomControl: false,
//
drawControl: true
//
}).setView([-2, 118], 5);
var
map_bang
=
new
L
.
map
(
'
map-insert-renov
-bang
'
,
{
editable
:
true
,
zoomControl
:
false
,
drawControl
:
true
}).
setView
([
-
2
,
118
],
5
);
// mapss
= L.tileLayer('https://mt1.google.com/vt/lyrs=s&x={x}&y={y}&z={z}', {
//
maxZoom: 22,
//
minZoom: 4,
//
}).addTo(map_bang);
mapssx
=
L
.
tileLayer
(
'
https://mt1.google.com/vt/lyrs=s&x={x}&y={y}&z={z}
'
,
{
maxZoom
:
22
,
minZoom
:
4
,
}).
addTo
(
map_bang
);
// var polyxxx = L.polygon([
// [-4.1283969, 104.1674575],
// [-4.128396, 104.1674947],
// [-4.1284664, 104.1674964],
// [-4.1284674, 104.1674593],
// [-4.1283969, 104.1674575]
// ]).addTo(map_bang)
var
polyxxx
=
L
.
polygon
([
[
-
4.1283969
,
104.1674575
],
[
-
4.128396
,
104.1674947
],
[
-
4.1284664
,
104.1674964
],
[
-
4.1284674
,
104.1674593
],
[
-
4.1283969
,
104.1674575
]
]).
addTo
(
map_bang
)
// var geo_bangunan_input = L.geoJson(null, {
// style: function(feature) {
// return {
// color: "#06FF08",
// weight: 8,
// opacity: 2,
// zIndex: 1000
// };
// }
// }).addTo(map_bang);
$
(
document
).
on
(
"
click
"
,
"
#btn_perbaikan_bangunan
"
,
function
()
{
// if (map_bang.hasLayer(polyxxx)) {
// polyxxx.remove()
// }
// var id_polyx = $('#idbangunan').val();
var
map_bang
=
new
L
.
map
(
'
map-insert-renov-bang
'
,
{
editable
:
true
,
zoomControl
:
false
,
drawControl
:
true
}).
setView
([
-
2
,
118
],
5
);
mapssx
=
L
.
tileLayer
(
'
https://mt1.google.com/vt/lyrs=s&x={x}&y={y}&z={z}
'
,
{
maxZoom
:
22
,
minZoom
:
4
,
}).
addTo
(
map_bang
);
$
(
"
#input_perbaikan_bang
"
).
css
(
"
display
"
,
"
block
"
);
if
(
map_bang
.
hasLayer
(
polyxxx
))
{
polyxxx
.
remove
()
}
var
id_polyx
=
$
(
'
#idbangunan
'
).
val
();
// $.ajax({
// url: "{% url 'apps:input-perbaikan-bang' %}",
// data: {
// 'id_bangunan': id_polyx
// },
// dataType: 'json',
// 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);
// };
$
.
ajax
({
url
:
"
{% url 'apps:input-perbaikan-bang' %}
"
,
data
:
{
'
id_bangunan
'
:
id_polyx
},
dataType
:
'
json
'
,
success
:
function
(
data
)
{
console
.
log
(
data
)
$
(
"
#nama_bang
"
).
val
(
data
[
0
]);
$
(
"
#type_bang
"
).
val
(
data
[
4
]);
$
(
"
#id_bang_perbaikan
"
).
val
(
data
[
3
]);
$
(
"
#type_id_bang
"
).
val
(
"
1
"
);
$
(
"
#kelurahan_bang
"
).
val
(
data
[
5
]);
$
(
"
#kecamatan_bang
"
).
val
(
data
[
6
]);
var
latlngs
=
data
[
2
];
console
.
log
(
data
[
2
])
var
lattitud
,
longitud
;
// polylyly = L.polygon(list_poly_edit).addTo(map_bang)
// polylyly.enableEdit();
// var hasil = (JSON.stringify(polylyly.toGeoJSON()))
map_bang
.
setView
([
data
[
2
][
'
geometry
'
][
'
coordinates
'
][
0
][
0
][
0
][
1
],
data
[
2
][
'
geometry
'
][
'
coordinates
'
][
0
][
0
][
0
][
0
]],
19
);
// }
// })
let
lop_poly_edit
=
data
[
2
][
'
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
)
polylyly
.
enableEdit
();
var
hasil
=
(
JSON
.
stringify
(
polylyly
.
toGeoJSON
()))
$
(
'
#save-perbaikan_bang
'
).
click
(
function
()
{
$
(
"
#coorbangbaru
"
).
val
(
hasil
);
})
}
})
})
$
(
document
).
on
(
"
click
"
,
"
#save-perbaikan_bang
"
,
function
(
e
)
{
var
polyginbang
=
$
(
'
#coorbangbaru
'
).
val
();
var
type_id
=
$
(
"
#type_id
"
).
val
();
var
idbang
=
$
(
'
#id_bang_perbaikan
'
).
val
();
var
namabang
=
$
(
'
#nama_bang
'
).
val
();
var
type
=
$
(
"
#type_bang
"
).
val
();
var
tgl_perbaikan
=
$
(
"
#tglmulaiperbaikan_bang
"
).
val
();
var
tgl_selesai
=
$
(
"
#tglselesaiperbaikan_bang
"
).
val
();
var
tgl_disetujui
=
$
(
"
#tgldisetujui_bang
"
).
val
();
var
anggaran
=
$
(
"
#anggaran_bang
"
).
val
();
var
proposal
=
$
(
"
#proposal_bang
"
).
val
();
var
bukti_selesai
=
$
(
"
#buktiselesai_bang
"
).
val
();
var
pj
=
$
(
"
#pihakpengesahan_bang
"
).
val
();
var
pj_lapangan
=
$
(
"
#pjlapangan_bang
"
).
val
();
var
kontraktor
=
$
(
"
#kontraktor_bang
"
).
val
();
var
jenis_perbaikan
=
$
(
"
#jenisperbaikan_bang
"
).
val
();
var
kelurahan
=
$
(
"
#kelurahan_bang
"
).
val
();
var
kecamatan
=
$
(
"
#kecamatan_bang
"
).
val
();
var
data_umum
=
[{
'
coordbang
'
:
polyginbang
},
{
'
object_idbang
'
:
idbang
},
{
'
type_idbang
'
:
type_id
},
{
'
namebang
'
:
namabang
},
{
'
typebang
'
:
type
},
{
'
tgl_selesaibang
'
:
tgl_selesai
},
{
'
tgl_perbaikanbang
'
:
tgl_perbaikan
},
{
'
tgl_disetujuibang
'
:
tgl_disetujui
},
{
'
anggaranbang
'
:
anggaran
},
{
'
pjbang
'
:
pj
},
{
'
pj_lapanganbang
'
:
pj_lapangan
},
{
'
jenis_perbaikanbang
'
:
jenis_perbaikan
},
{
'
kontraktorbang
'
:
kontraktor
},
{
'
kelurahanbang
'
:
kelurahan
},
{
'
kecamatanbang
'
:
kecamatan
}]
data
=
new
FormData
()
data
.
append
(
"
proposal_bang
"
,
$
(
"
input[id^='proposal_bang']
"
)[
0
].
files
[
0
]);
data
.
append
(
"
bukti_selesai_bang
"
,
$
(
"
input[id^='buktiselesai_bang']
"
)[
0
].
files
[
0
]);
for
(
var
i
=
0
;
i
<
data_umum
.
length
;
i
++
)
{
var
keyss
=
Object
.
keys
(
data_umum
[
i
]);
data
.
append
(
keyss
[
0
],
data_umum
[
i
][
keyss
[
0
]])
}
$
.
ajax
({
url
:
"
{% url 'apps:save-perbaikan-bang' %}
"
,
data
:
data
,
dataType
:
'
json
'
,
type
:
'
POST
'
,
processData
:
false
,
contentType
:
false
,
success
:
function
(
data
)
{
let
response
=
data
;
if
(
response
.
code
==
0
)
{
swal
({
title
:
response
.
info
,
text
:
response
.
data
,
type
:
"
success
"
,
icon
:
"
success
"
,
confirmButtonColor
:
"
#00BCD4
"
},
function
()
{
$
(
"
#input_perbaikan_bang
"
).
css
(
"
display
"
,
"
none
"
);
// $("#info-jalan").css("display", "block");
// $("#info-pendidikan").css("display", "none");
})
}
else
{
swal
({
title
:
response
.
info
,
text
:
response
.
data
,
type
:
"
warning
"
,
icon
:
"
error
"
,
confirmButtonColor
:
"
#00BCD4
"
})
}
}
})
});
</script>
{% include 'includes/insert.html' %}
\ No newline at end of file
templates/includes/modal.html
View file @
696fadf2
...
...
@@ -358,7 +358,6 @@
</div>
</div>
</div>
</div>
<div
id=
"modal_bangunan_delete"
class=
"modal fade"
>
<div
class=
"modal-dialog"
style=
"width: max-content;height: max-content;"
>
...
...
@@ -392,6 +391,127 @@
</div>
</div>
<div
id=
"input_perbaikan_bang"
class=
"modal fade"
>
<div
class=
"modal-dialog"
style=
"width: max-content;height: max-content;"
>
<div
class=
"modal-content"
>
<div
class=
"modal-header bg-info"
style=
"background-color:#40777c;"
>
<button
type=
"button"
class=
"close"
data-dismiss=
"modal"
>
×
</button>
<h6
class=
"modal-title"
>
Renovasi Bangunan
</h6>
</div>
<div
class=
"modal-body"
style=
"max-height: 450px;overflow-y: auto;"
>
<div
class=
"tab-pane has-padding"
id=
"panel-tab2"
>
<div
class=
"tab-pane"
id=
"bottom-justified-data"
>
<div
class=
"tabbable"
>
<ul
class=
"nav nav-tabs nav-tabs-bottom nav-justified"
>
<li
onclick=
"changetabs(this)"
class=
"active"
><a
href=
"#left-tab1-feas-upl"
data-toggle=
"tab"
>
Koordinat
</a></li>
<li
onclick=
"changetabs(this)"
><a
href=
"#right-tab2-feas-upl"
data-toggle=
"tab"
>
Informasi Umum
</a></li>
</ul>
<div
class=
"tab-content"
>
<div
class=
"tab-pane active"
id=
"left-tab1-feas-upl"
>
<input
type=
"text"
class=
"hidden"
id=
"poly_create_input_bang"
>
<input
type=
"text"
class=
"hidden"
id=
"id_bang_perbaikan"
>
<input
type=
"text"
class=
"hidden"
id=
"type_id_bang"
>
<div
id=
"map-insert-renov-bang"
style=
"height: 375px;width: 100%"
>
</div>
</div>
<div
class=
"tab-pane"
id=
"right-tab2-feas-upl"
>
<div
class=
"row"
>
<div
class=
"col-md-6"
>
<div
class=
"form-group"
>
<label>
Nama :
</label>
<input
type=
"text"
id=
"nama_bang"
class=
"form-control"
value=
""
>
</div>
<div
class=
"form-group"
>
<label>
Type :
</label>
<input
type=
"text"
id=
"type_bang"
class=
"form-control"
value=
""
>
</div>
<div
class=
"form-group"
>
<label>
Kelurahan :
</label>
<input
type=
"text"
id=
"kelurahan_bang"
class=
"form-control"
value=
""
>
</div>
<div
class=
"form-group"
>
<label>
Kecamatan :
</label>
<input
type=
"text"
id=
"kecamatan_bang"
class=
"form-control"
value=
""
>
</div>
<div
class=
"form-group"
>
<label>
Tanggal Disetujui :
</label>
<input
type=
"date"
id=
"tgldisetujui_bang"
class=
"form-control"
value=
""
>
</div>
<div
class=
"form-group"
>
<label>
Tanggal Mulai Perbaikan :
</label>
<input
type=
"date"
id=
"tglmulaiperbaikan_bang"
class=
"form-control"
value=
""
>
</div>
<div
class=
"form-group"
>
<label>
Tanggal Selesai Perbaikan :
</label>
<input
type=
"date"
id=
"tglselesaiperbaikan_bang"
class=
"form-control"
value=
""
>
</div>
</div>
<div
class=
"col-md-6"
>
<div
class=
"form-group"
>
<label>
Anggaran :
</label>
<input
type=
"text"
id=
"anggaran_bang"
class=
"form-control"
value=
""
>
</div>
<div
class=
"form-group"
>
<label>
Pihak yang Mengesahkan :
</label>
<input
type=
"text"
id=
"pihakpengesahan_bang"
class=
"form-control"
value=
""
>
</div>
<div
class=
"form-group"
>
<label>
Penanggung Jawab Lapangan :
</label>
<input
type=
"text"
id=
"pjlapangan_bang"
class=
"form-control"
value=
""
>
</div>
<div
class=
"form-group"
>
<label>
Kontraktor :
</label>
<input
type=
"text"
id=
"kontraktor_bang"
class=
"form-control"
value=
""
>
</div>
<!-- <div class="form-group">
<label>Panjang Jalan Keseluruhan :</label>
<input type="text" id="panjangjalanall" class="form-control" value="">
</div>
<div class="form-group">
<label>Panjang Jalan Perbaikan :</label>
<input type="text" id="panjangjalanperbaikan" class="form-control" value="">
</div>
<div class="form-group">
<label>Lebar Jalan Perbaikan :</label>
<input type="text" id="lebarjalanperbaikan" class="form-control" value="">
</div> -->
<div
class=
"form-group"
>
<label>
Jenis Perbaikan :
</label>
<input
type=
"text"
id=
"jenisperbaikan_bang"
class=
"form-control"
value=
""
>
</div>
<div
class=
"form-group"
>
<label>
Proposal (.pdf):
</label>
<input
type=
"file"
id=
"proposal_bang"
>
</div>
<div
class=
"form-group"
>
<label>
Bukti Selesai Perbaikan (.png/.jpg/.jpeg/):
</label>
<input
type=
"file"
id=
"buktiselesai_bang"
>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div
class=
"modal-footer"
>
<input
type=
"text"
id=
"coorbangbaru"
class=
"form-control"
value=
""
>
<button
type=
"button"
class=
"btn btn-info"
id=
"save-perbaikan_bang"
style=
"float: right; margin-right: 40px;"
>
SAVE
</button>
</div>
</div>
</div>
</div>
<!-- modal tuplah -->
<div
id=
"modal-edit-tuplah"
class=
"modal fade"
>
<div
class=
"modal-dialog"
style=
"width: max-content;height: max-content;"
>
...
...
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