Commit 0c7bf91e authored by Manggar Mahardhika's avatar Manggar Mahardhika

wah fix

parent 0fecd5ae
...@@ -3605,7 +3605,8 @@ def filt_perbaikan_kecamatan(request): ...@@ -3605,7 +3605,8 @@ def filt_perbaikan_kecamatan(request):
tp.TYPE, tp.TYPE,
tp.tgl_perbaikan, tp.tgl_perbaikan,
tp.anggaran, tp.anggaran,
tp.tgl_selesai tp.tgl_selesai,
tp.id
FROM FROM
( SELECT tbl_perbaikan.*, ROW_NUMBER ( ) OVER ( PARTITION BY id_object ORDER BY tgl_selesai DESC ) AS rn FROM tbl_perbaikan ) tp ( SELECT tbl_perbaikan.*, ROW_NUMBER ( ) OVER ( PARTITION BY id_object ORDER BY tgl_selesai DESC ) AS rn FROM tbl_perbaikan ) tp
JOIN geo_label gl ON gl.ID = tp.type_id JOIN geo_label gl ON gl.ID = tp.type_id
...@@ -3636,7 +3637,8 @@ def filt_perbaikan_kecamatan(request): ...@@ -3636,7 +3637,8 @@ def filt_perbaikan_kecamatan(request):
tp.anggaran, tp.anggaran,
tp.tgl_selesai, tp.tgl_selesai,
gdl.desa, gdl.desa,
gdc.kecamatan gdc.kecamatan,
tp.id
FROM FROM
( SELECT tbl_perbaikan.*, ROW_NUMBER ( ) OVER ( PARTITION BY id_object ORDER BY tgl_selesai DESC ) AS rn FROM tbl_perbaikan ) tp ( SELECT tbl_perbaikan.*, ROW_NUMBER ( ) OVER ( PARTITION BY id_object ORDER BY tgl_selesai DESC ) AS rn FROM tbl_perbaikan ) tp
JOIN geo_label gl ON gl.ID = tp.type_id JOIN geo_label gl ON gl.ID = tp.type_id
...@@ -3659,6 +3661,7 @@ def filt_perbaikan_kecamatan(request): ...@@ -3659,6 +3661,7 @@ def filt_perbaikan_kecamatan(request):
'tgl_selesai':j[6], 'tgl_selesai':j[6],
'desa':j[7], 'desa':j[7],
'kecamatan':j[8], 'kecamatan':j[8],
'id':j[9],
} }
res_all.append(data_all) res_all.append(data_all)
...@@ -3682,7 +3685,8 @@ def filt_perbaikan_desa(request): ...@@ -3682,7 +3685,8 @@ def filt_perbaikan_desa(request):
tp.anggaran, tp.anggaran,
tp.tgl_selesai, tp.tgl_selesai,
gdl.desa, gdl.desa,
gdc.kecamatan gdc.kecamatan,
tp.id
FROM FROM
( SELECT tbl_perbaikan.*, ROW_NUMBER ( ) OVER ( PARTITION BY id_object ORDER BY tgl_selesai DESC ) AS rn FROM tbl_perbaikan ) tp ( SELECT tbl_perbaikan.*, ROW_NUMBER ( ) OVER ( PARTITION BY id_object ORDER BY tgl_selesai DESC ) AS rn FROM tbl_perbaikan ) tp
JOIN geo_label gl ON gl.ID = tp.type_id JOIN geo_label gl ON gl.ID = tp.type_id
...@@ -3705,6 +3709,7 @@ def filt_perbaikan_desa(request): ...@@ -3705,6 +3709,7 @@ def filt_perbaikan_desa(request):
'tgl_selesai':j[6], 'tgl_selesai':j[6],
'desa':j[7], 'desa':j[7],
'kecamatan':j[8], 'kecamatan':j[8],
'id':j[9],
} }
res_all.append(data_all) res_all.append(data_all)
...@@ -4392,12 +4397,15 @@ def search_list_perbaikan(request): ...@@ -4392,12 +4397,15 @@ def search_list_perbaikan(request):
tp.TYPE, tp.TYPE,
tp.tgl_perbaikan, tp.tgl_perbaikan,
tp.anggaran, tp.anggaran,
tp.tgl_selesai tp.tgl_selesai,
tp.id
FROM FROM
( SELECT tbl_perbaikan.*, ROW_NUMBER ( ) OVER ( PARTITION BY id_object ORDER BY tgl_selesai DESC ) AS rn FROM tbl_perbaikan ) tp ( SELECT tbl_perbaikan.*, ROW_NUMBER ( ) OVER ( PARTITION BY id_object ORDER BY tgl_selesai DESC ) AS rn FROM tbl_perbaikan ) tp
JOIN geo_label gl ON gl.ID = tp.type_id JOIN geo_label gl ON gl.ID = tp.type_id
WHERE WHERE
( gl.NAME ILIKE'{}%' OR tp.NAME ILIKE'{}%' OR tp.TYPE ILIKE'{}%' OR tp.anggaran ILIKE'{}%' )""".format(v,v,v,v)) ( gl.NAME ILIKE'{}%' OR tp.NAME ILIKE'{}%' OR tp.TYPE ILIKE'{}%' OR tp.anggaran ILIKE'{}%' )
Order by tp.id desc
""".format(v,v,v,v))
search_list = list_s.fetchall() search_list = list_s.fetchall()
return Response(search_list) return Response(search_list)
...@@ -4470,12 +4478,14 @@ def data_perbaikan(request): ...@@ -4470,12 +4478,14 @@ def data_perbaikan(request):
tp.anggaran, tp.anggaran,
tp.tgl_selesai, tp.tgl_selesai,
gdl.desa, gdl.desa,
gdc.kecamatan gdc.kecamatan,
tp.id
FROM FROM
( SELECT tbl_perbaikan.*, ROW_NUMBER ( ) OVER ( PARTITION BY id_object ORDER BY tgl_selesai DESC ) AS rn FROM tbl_perbaikan ) tp ( SELECT tbl_perbaikan.*, ROW_NUMBER ( ) OVER ( PARTITION BY id_object ORDER BY tgl_selesai DESC ) AS rn FROM tbl_perbaikan ) tp
JOIN geo_label gl ON gl.ID = tp.type_id JOIN geo_label gl ON gl.ID = tp.type_id
JOIN geo_data_kelurahan gdl on st_intersects(st_setsrid(gdl.geom, 4326), st_setsrid(tp.geom, 4326)) JOIN geo_data_kelurahan gdl on st_intersects(st_setsrid(gdl.geom, 4326), st_setsrid(tp.geom, 4326))
JOIN geo_data_kecamatan gdc ON st_intersects ( st_setsrid ( gdc.geom, 4326 ), st_setsrid ( tp.geom, 4326 ) ) JOIN geo_data_kecamatan gdc ON st_intersects ( st_setsrid ( gdc.geom, 4326 ), st_setsrid ( tp.geom, 4326 ) )
ORDER BY tp.id desc
""") """)
res_perbaikan = data_per.fetchall() res_perbaikan = data_per.fetchall()
...@@ -4491,6 +4501,7 @@ def data_perbaikan(request): ...@@ -4491,6 +4501,7 @@ def data_perbaikan(request):
'tgl_selesai':j[6], 'tgl_selesai':j[6],
'desa':j[7], 'desa':j[7],
'kecamatan':j[8], 'kecamatan':j[8],
'id':j[9],
} }
res_all.append(data_all) res_all.append(data_all)
......
...@@ -711,7 +711,8 @@ def perbaikanrenovasi(request): ...@@ -711,7 +711,8 @@ def perbaikanrenovasi(request):
@api_view(('POST',)) @api_view(('POST',))
def loadDetail(request): def loadDetail(request):
id_object = request.POST.get('id') id_object = request.POST.get('ido')
id = request.POST.get('id')
with conn.cursor() as data_per: with conn.cursor() as data_per:
data_per.execute(""" data_per.execute("""
SELECT SELECT
...@@ -737,7 +738,7 @@ def loadDetail(request): ...@@ -737,7 +738,7 @@ def loadDetail(request):
FROM FROM
tbl_perbaikan tp tbl_perbaikan tp
JOIN geo_label gl ON gl.ID = tp.type_id JOIN geo_label gl ON gl.ID = tp.type_id
where tp.id_object = %s"""% id_object) where tp.id_object = %s and tp.id = %s"""% (id_object,id))
res_perbaikan = data_per.fetchall() res_perbaikan = data_per.fetchall()
res_all = [] res_all = []
...@@ -873,16 +874,25 @@ def saveperbaikan(request): ...@@ -873,16 +874,25 @@ def saveperbaikan(request):
# print('tidakoke') # print('tidakoke')
yak = str(coor) yak = str(coor)
suk = yak.replace("""{"type":"Feature","properties":{},"geometry":{"type":"LineString","coordinates":""","") # suk = yak.replace("""{"type":"Feature","properties":{},"geometry":{"type":"LineString","coordinates":""","")
sik = suk.replace("""}}""","") # sik = suk.replace("""}}""","")
cor = sik.replace("""[[[""","(") # cor = sik.replace("""[[[""","(")
coran = cor.replace("""]]]""",")") # coran = cor.replace("""]]]""",")")
ll = coran.replace(","," ") # ll = coran.replace(","," ")
ii = ll.replace("] [",",") # ii = ll.replace("] [",",")
mm = ii.replace('{"type":"FeatureCollection" "features":', '') # mm = ii.replace('{"type":"FeatureCollection" "features":', '')
nn = mm.replace('}', '') # nn = mm.replace('}', '')
corcoran = f'MULTILINESTRING({nn})' suk = yak.replace("""[[[""","(")
sik = suk.replace("]],[[",").(")
sak = sik.replace("],["," . ")
sok = sak.replace(","," ")
sot = sok.replace(").(","),(")
siap = sot.replace(" . "," , ")
sek = siap.replace("]]]",")")
corcoran = f'MULTILINESTRING({sek})'
print(corcoran)
format = (proposal.name).split(".") format = (proposal.name).split(".")
num = random.randrange(1, 10000000000000) num = random.randrange(1, 10000000000000)
...@@ -977,6 +987,7 @@ def saveperbaikan(request): ...@@ -977,6 +987,7 @@ def saveperbaikan(request):
code = 1 code = 1
respon = {"data":data,"info":info,"code":code} respon = {"data":data,"info":info,"code":code}
return Response(respon) return Response(respon)
# return 1
# from django.core.files.storage import FileSystemStorage # from django.core.files.storage import FileSystemStorage
# import random # import random
...@@ -1015,7 +1026,7 @@ def saveperbaikanbangunan(request): ...@@ -1015,7 +1026,7 @@ def saveperbaikanbangunan(request):
# co_edit = cood_edit['geometry']['coordinates'] # co_edit = cood_edit['geometry']['coordinates']
yak = str(coor) yak = str(coor)
suk = yak.replace("""{"type":"Feature","properties":{},"geometry":{"type":"Polygon","coordinates":""","") suk = yak.replace("""{"type":"Feature","properties":{},"geometry":{"type":"MultiPolygon","coordinates":""","")
sik = suk.replace("""}}""","") sik = suk.replace("""}}""","")
cor = sik.replace("""[[[""","((") cor = sik.replace("""[[[""","((")
coran = cor.replace("""]]]""","))") coran = cor.replace("""]]]""","))")
......
...@@ -43,7 +43,8 @@ $("#upload_image").change(function() { ...@@ -43,7 +43,8 @@ $("#upload_image").change(function() {
}); });
function getdetailper(id) { function getdetailper(id) {
$(".map_detail_p_p").html(``)
console.log(id)
$.ajax({ $.ajax({
url: "get-detail-perbaikan", url: "get-detail-perbaikan",
data: { data: {
...@@ -53,10 +54,12 @@ function getdetailper(id) { ...@@ -53,10 +54,12 @@ function getdetailper(id) {
success: function(data) { success: function(data) {
$(".map_detail_p_p").html(`<div id="map_detail_perbaikan_dash" style=" position: relative; height: 220px; width: 90%; border-radius: 5px; ">`)
var map_detail_perbaikan = L.map('map_detail_perbaikan_dash', { var map_detail_perbaikan = L.map('map_detail_perbaikan_dash', {
editable: true, editable: false,
zoomControl: false, zoomControl: false,
drawControl: true drawControl: false
}).setView([-4.125826277307029, 104.1881561279297], 10); }).setView([-4.125826277307029, 104.1881561279297], 10);
L.tileLayer('https://mt1.google.com/vt/lyrs=s&x={x}&y={y}&z={z}&s=Gal&apistyle=s.t:0|s.e:l|p.v:off', { L.tileLayer('https://mt1.google.com/vt/lyrs=s&x={x}&y={y}&z={z}&s=Gal&apistyle=s.t:0|s.e:l|p.v:off', {
...@@ -96,27 +99,41 @@ function getdetailper(id) { ...@@ -96,27 +99,41 @@ function getdetailper(id) {
$(".nama_detail_dash").html(data[0]['name']); $(".nama_detail_dash").html(data[0]['name']);
$(".type_detail_dash").html(data[0]['type']) $(".type_detail_dash").html(data[0]['type'])
$(".tanggal_perbaikan_detail_dash").text(data[0]['tgl_perbaikan']) $(".tanggal_perbaikan_detail_dash").text(data[0]['tgl_perbaikan'])
$(".anggaran_detail_dash").html(data[0]['anggaran']) // $(".anggaran_detail_dash").html(data[0]['anggaran'])
$(".penanggung_jawab_detail_dash").html(data[0]['pj']) // $(".penanggung_jawab_detail_dash").html(data[0]['pj'])
$(".penanggung_jawab_lapangan_detail_dash").html(data[0]['pj_lapangan']) // $(".penanggung_jawab_lapangan_detail_dash").html(data[0]['pj_lapangan'])
$(".kontraktor_detail_dash").html(data[0]['kontraktor']) // $(".kontraktor_detail_dash").html(data[0]['kontraktor'])
$(".panjang_jalan_detail_dash").html(data[0]['panjang']) $(".panjang_jalan_detail_dash").html(data[0]['panjang'])
$(".lebar_jalan_detail_dash").html(data[0]['lbr_jln_reno']) $(".lebar_jalan_detail_dash").html(data[0]['lbr_jln_reno'])
$(".proposal_detail_dash").html(` // $(".proposal_detail_dash").html(`
<a href="static/media/proposal/` + data[0]['proposal'] + `" target="_blank" "id="downloadproposal"> // <a href="static/media/proposal/` + data[0]['proposal'] + `" target="_blank" "id="downloadproposal">
<img src="static/img/icon-1/proposal.svg" alt=" " style="height: 65px;width: 65px; "> // <img src="static/img/icon-1/proposal.svg" alt=" " style="height: 65px;width: 65px; ">
</a>`); // </a>`);
$(".bukti_detail_perbaikan_dash").html(` // $(".bukti_detail_perbaikan_dash").html(`
<a href="static/media/bukti_penyelesaian/` + data[0].bukti_selesai + `" target="_blank" id="view-bukti"> // <a href="static/media/bukti_penyelesaian/` + data[0].bukti_selesai + `" target="_blank" id="view-bukti">
<img src="static/img/icon-1/bukti.svg" alt=" " style="height: 70px; // <img src="static/img/icon-1/bukti.svg" alt=" " style="height: 70px;
width: 50px;"> // width: 50px;">
</a>`); // </a>`);
//hide ngaco
// $("#bkt_ang").html(``)
// $("#bkt_peja").html(``)
// $("#bkt_pjlap").html(``)
// $("#bkt_kont").html(``)
// $("#bkt_lbrjln").html(``)
// $("#bkt_prop").html(``)
// $("#bkt_bukti").html(``)
//end hide ngaco
$('.map_detail_p_jalan').show()
map_detail_perbaikan.setView([data[0]['geometry']['coordinates'][0][0][1], data[0]['geometry']['coordinates'][0][0][0]], 18) map_detail_perbaikan.setView([data[0]['geometry']['coordinates'][0][0][1], data[0]['geometry']['coordinates'][0][0][0]], 18)
var myLines = [data[0]['geometry']]; var myLines = [data[0]['geometry']];
// var myLines = data;
// console.log(myLines)
var geo_jalan_perbaikan = L.geoJson(data[0]['geometry'], { var geo_jalan_perbaikan = L.geoJson(data[0]['geometry'], {
style: function(feature) { style: function(feature) {
......
This diff is collapsed.
...@@ -1988,7 +1988,7 @@ $(document).on("click", "#btnsavetuplah", function() { ...@@ -1988,7 +1988,7 @@ $(document).on("click", "#btnsavetuplah", function() {
var geo_jalan = L.geoJson(null, { var geo_jalan = L.geoJson(null, {
style: function(feature) { style: function(feature) {
var zoom = map.getZoom() var zoom = map.getZoom()
console.log(zoom) // console.log(zoom)
if (zoom < 18) { if (zoom < 18) {
return { return {
...@@ -2076,10 +2076,10 @@ var geo_jalan = L.geoJson(null, { ...@@ -2076,10 +2076,10 @@ var geo_jalan = L.geoJson(null, {
if (feature.properties.f7 != null) { if (feature.properties.f7 != null) {
console.log(feature.properties.f7) // console.log(feature.properties.f7)
var list_history = feature.properties.f7 var list_history = feature.properties.f7
console.log(list_history[0].split(",")[0]) // console.log(list_history[0].split(",")[0])
var perbaikan_jl = `<div class='row'> var perbaikan_jl = `<div class='row'>
<label class="col-md-8">` + list_history[0].split(",")[1] + `</label> <label class="col-md-8">` + list_history[0].split(",")[1] + `</label>
...@@ -2625,7 +2625,7 @@ var geo_sungai = L.geoJson(null, { ...@@ -2625,7 +2625,7 @@ var geo_sungai = L.geoJson(null, {
layer.on({ layer.on({
click: function(e) { click: function(e) {
console.log('cdcd') // console.log('cdcd')
} }
}); });
...@@ -3075,6 +3075,7 @@ $(document).on("click", "#btn_perbaikan_jalan", function() { ...@@ -3075,6 +3075,7 @@ $(document).on("click", "#btn_perbaikan_jalan", function() {
} }
editableLayers.addLayer(layer); editableLayers.addLayer(layer);
}); });
// console.log(editableLayers)
function getjalanper(id) { function getjalanper(id) {
$.ajax({ $.ajax({
...@@ -3144,13 +3145,17 @@ $(document).on("click", "#btn_perbaikan_jalan", function() { ...@@ -3144,13 +3145,17 @@ $(document).on("click", "#btn_perbaikan_jalan", function() {
var latlngs = data[3]; var latlngs = data[3];
map_input.setView([latlngs['geometry']['coordinates'][0][0][1], latlngs['geometry']['coordinates'][0][0][0]], 17) map_input.setView([latlngs['geometry']['coordinates'][0][0][1], latlngs['geometry']['coordinates'][0][0][0]], 17)
geo_jalan_input.addData(data[3]); geo_jalan_input.addData(data[3]);
$("#map-insert > div.leaflet-control-container > div.leaflet-top.leaflet-left > div:nth-child(1) > div > div > a.leaflet-draw-draw-marker").css("display", "none") $("#map-insert > div.leaflet-control-container > div.leaflet-top.leaflet-left > div:nth-child(1) > div > div > a.leaflet-draw-draw-marker").css("display", "none")
$('#save-perbaikan').click(function() { $('#save-perbaikan').click(function() {
// console.log(editableLayers)
var hasil = JSON.stringify(editableLayers.toGeoJSON()); var hasil = JSON.stringify(editableLayers.toGeoJSON());
$("#coorjalbaru").val(hasil); var h2 = hasil.replace(`{"type":"FeatureCollection","features":`,``)
var h3 = h2.replace(/{"type":"Feature","properties":{},"geometry":{"type":"LineString","coordinates":/g,"")
var h4 = h3.replace(/}},/g,",")
var h5 = h4.replace(/}}]}/g,"]")
// console.log(h5)
$("#coorjalbaru").val(h5);
// console.log(hasil); // console.log(hasil);
// console.log($("#coorjalbaru").val()); // console.log($("#coorjalbaru").val());
}) })
...@@ -3225,7 +3230,7 @@ $(document).on("click", "#save-perbaikan", function() { ...@@ -3225,7 +3230,7 @@ $(document).on("click", "#save-perbaikan", function() {
'kecamatan': kecamatan 'kecamatan': kecamatan
}] }]
console.log(data_umum) // console.log(data_umum)
data = new FormData() data = new FormData()
data.append("proposal", $("input[id^='proposal']")[0].files[0]); data.append("proposal", $("input[id^='proposal']")[0].files[0]);
data.append("bukti_selesai", $("input[id^='buktiselesai']")[0].files[0]); data.append("bukti_selesai", $("input[id^='buktiselesai']")[0].files[0]);
...@@ -4116,7 +4121,7 @@ map.on('contextmenu', function(e) { ...@@ -4116,7 +4121,7 @@ map.on('contextmenu', function(e) {
var data_all_kab = [] var data_all_kab = []
for (var i = 0; i < data['result'].length; i++) { for (var i = 0; i < data['result'].length; i++) {
var data_k = data['result'][i][0]; var data_k = data['result'][i][0];
console.log(data_k) // console.log(data_k)
var data_kab = `<option value="` + data_k + `">` + data_k + `</option>`; var data_kab = `<option value="` + data_k + `">` + data_k + `</option>`;
data_all_kab.push(data_kab) data_all_kab.push(data_kab)
}; };
...@@ -4138,7 +4143,7 @@ map.on('contextmenu', function(e) { ...@@ -4138,7 +4143,7 @@ map.on('contextmenu', function(e) {
}, },
dataType: 'json', dataType: 'json',
success: function(data) { success: function(data) {
console.log(data) // console.log(data)
var data_all_kab = [] var data_all_kab = []
for (var i = 0; i < data['result'].length; i++) { for (var i = 0; i < data['result'].length; i++) {
var data_id = data['result'][i][0]; var data_id = data['result'][i][0];
...@@ -4493,7 +4498,7 @@ map.on('contextmenu', function(e) { ...@@ -4493,7 +4498,7 @@ map.on('contextmenu', function(e) {
}, },
dataType: 'json', dataType: 'json',
success: function(data) { success: function(data) {
console.log(data) // console.log(data)
var data_all_kab = [] var data_all_kab = []
for (var i = 0; i < data['result'].length; i++) { for (var i = 0; i < data['result'].length; i++) {
var data_k = data['result'][i][0]; var data_k = data['result'][i][0];
......
...@@ -89,10 +89,10 @@ $(document).on("click", "#btn_search_spes", function() { ...@@ -89,10 +89,10 @@ $(document).on("click", "#btn_search_spes", function() {
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();
var dapoin = [data[0][0]['geometry']['coordinates'][1], data[0][0]['geometry']['coordinates'][0]] var dapoin = [data[0][0]['geometry']['coordinates'][1], data[0][0]['geometry']['coordinates'][0]]
console.log(data[0]) //console.log(data[0])
// map.setView([data[0]['geometry']['coordinates'][0][0][0][1], data[0]['geometry']['coordinates'][0][0][0][0]], 19); // map.setView([data[0]['geometry']['coordinates'][0][0][0][1], data[0]['geometry']['coordinates'][0][0][0][0]], 19);
// var result_point = JSON.parse("" + data + "") // var result_point = JSON.parse("" + data + "")
// console.log(result_point) // //console.log(result_point)
var geo_point = L.geoJson(null, { var geo_point = L.geoJson(null, {
pointToLayer: function(feature, latlng) { pointToLayer: function(feature, latlng) {
...@@ -370,7 +370,7 @@ $(document).on("click", "#btn_search_spes", function() { ...@@ -370,7 +370,7 @@ $(document).on("click", "#btn_search_spes", function() {
// }, // },
// dataType: 'json', // dataType: 'json',
// success: function(data) { // success: function(data) {
// console.log(data) // //console.log(data)
// dapoin = [data[0][0]['geometry']['coordinates'][1], data[0][0]['geometry']['coordinates'][0]] // dapoin = [data[0][0]['geometry']['coordinates'][1], data[0][0]['geometry']['coordinates'][0]]
// // var poinin = L.marker(dapoin).addTo(map) // // var poinin = L.marker(dapoin).addTo(map)
...@@ -434,7 +434,7 @@ $(document).on("click", "#btn_search_spes", function() { ...@@ -434,7 +434,7 @@ $(document).on("click", "#btn_search_spes", function() {
data.append('point', poi), data.append('point', poi),
data.append('gambar', $('#gambar').val()), data.append('gambar', $('#gambar').val()),
data.append('dbspo', dbsave) data.append('dbspo', dbsave)
console.log(data) //console.log(data)
$.ajax({ $.ajax({
url: "api/saveeditspo", url: "api/saveeditspo",
data: data, data: data,
...@@ -536,9 +536,9 @@ $(document).on("click", "#btn_search_spes", function() { ...@@ -536,9 +536,9 @@ $(document).on("click", "#btn_search_spes", function() {
// var list_history = feature.properties.f4 // var list_history = feature.properties.f4
// for (var i = 0; i < list_history.length; i++) { // for (var i = 0; i < list_history.length; i++) {
// var dt_history = list_history[i].split(","); // var dt_history = list_history[i].split(",");
// console.log(dt_history[0]) // //console.log(dt_history[0])
// console.log(dt_history[1]) // //console.log(dt_history[1])
// console.log(dt_history[2]) // //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>
...@@ -1362,7 +1362,7 @@ $(document).on("click", "#btn_search_spes", function() { ...@@ -1362,7 +1362,7 @@ $(document).on("click", "#btn_search_spes", function() {
}).addTo(map_delete); }).addTo(map_delete);
var id_polyhps = $('#idbangunanhps').val(); var id_polyhps = $('#idbangunanhps').val();
// console.log(id_polyhps) // //console.log(id_polyhps)
loaderPage(true); loaderPage(true);
$.ajax({ $.ajax({
...@@ -1695,7 +1695,7 @@ $(document).on("click", "#btn_search_spes", function() { ...@@ -1695,7 +1695,7 @@ $(document).on("click", "#btn_search_spes", function() {
if (feature.properties.f7 != null) { if (feature.properties.f7 != null) {
var list_history = feature.properties.f7 var list_history = feature.properties.f7
console.log(list_history[0].split(",")[0]) //console.log(list_history[0].split(",")[0])
var perbaikan_jl = `<div class='row'> var perbaikan_jl = `<div class='row'>
<label class="col-md-8">` + list_history[0].split(",")[1] + `</label> <label class="col-md-8">` + list_history[0].split(",")[1] + `</label>
...@@ -1818,9 +1818,9 @@ $(document).on("click", "#btn_search_spes", function() { ...@@ -1818,9 +1818,9 @@ $(document).on("click", "#btn_search_spes", function() {
$("#coordinatejalan").val(feature.geometry); $("#coordinatejalan").val(feature.geometry);
var najal = $('#namajalanedit').val(); var najal = $('#namajalanedit').val();
console.log(najal) //console.log(najal)
var ijal = $('#idjalan').val(); var ijal = $('#idjalan').val();
console.log(ijal) //console.log(ijal)
} }
}); });
...@@ -1932,7 +1932,7 @@ $(document).on("click", "#btn_search_spes", function() { ...@@ -1932,7 +1932,7 @@ $(document).on("click", "#btn_search_spes", function() {
polygon_edit_jalan.remove() polygon_edit_jalan.remove()
} }
var id_poly = $('#idjalan').val(); var id_poly = $('#idjalan').val();
console.log(id_poly) //console.log(id_poly)
// var id_poly = idm // var id_poly = idm
$.ajax({ $.ajax({
...@@ -2037,7 +2037,7 @@ $(document).on("click", "#btn_search_spes", function() { ...@@ -2037,7 +2037,7 @@ $(document).on("click", "#btn_search_spes", function() {
$(document).on("click", "#btnsavejalan", function() { $(document).on("click", "#btnsavejalan", function() {
var cek = $("#namajalanedit").val() var cek = $("#namajalanedit").val()
console.log(cek) //console.log(cek)
var data = new FormData(); var data = new FormData();
data.append("file", $("input[id^='imgjalan']")[0].files[0]); data.append("file", $("input[id^='imgjalan']")[0].files[0]);
data.append("csrfmiddlewaretoken", "{{ csrf_token }}"); data.append("csrfmiddlewaretoken", "{{ csrf_token }}");
......
// SIDEBAR JS // SIDEBAR JS
$("#sel-kec ").change(function() { $("#sel-kec ").change(function() {
var id_kec = $(this).val() var id_kec = $(this).val()
console.log(id_kec) // console.log(id_kec)
// $(".datatable-show-all.list_perb").dataTable().fnDestroy(); // $(".datatable-show-all.list_perb").dataTable().fnDestroy();
// $("#list_perbaikan").dataTable().fnDestroy(); // $("#list_perbaikan").dataTable().fnDestroy();
...@@ -47,8 +47,9 @@ $("#sel-kec ").change(function() { ...@@ -47,8 +47,9 @@ $("#sel-kec ").change(function() {
var tgl_perbaikan = data['res_perbaikan'][i]['tgl_perbaikan']; var tgl_perbaikan = data['res_perbaikan'][i]['tgl_perbaikan'];
var anggaran = data['res_perbaikan'][i]['anggaran']; var anggaran = data['res_perbaikan'][i]['anggaran'];
var tgl_selesai = data['res_perbaikan'][i]['tgl_selesai']; var tgl_selesai = data['res_perbaikan'][i]['tgl_selesai'];
var idbenar = data['res_perbaikan'][i]['id'];
console.log(number, name, name_perbaikan) // console.log(id_object,idbenar)
var data_gab = `<tr> var data_gab = `<tr>
<td>` + number + `</td> <td>` + number + `</td>
...@@ -58,7 +59,7 @@ $("#sel-kec ").change(function() { ...@@ -58,7 +59,7 @@ $("#sel-kec ").change(function() {
<td>` + tgl_perbaikan + `</td> <td>` + tgl_perbaikan + `</td>
<td>` + tgl_selesai + `</td> <td>` + tgl_selesai + `</td>
<td class="text-center "> <td class="text-center ">
<a class="btn mdlFire " onclick="loaddetailid( '` + id_object + `') " data-toggle="modal " data-target="#modal_detail_perbaikan " style="background-color: #5A9AFB;color: white;border-radius: 5px;width: 85px;height: 25px; "> <a class="btn mdlFire " onclick="loaddetailid(`+id_object+`,`+idbenar+`) " data-toggle="modal " data-target="#modal_detail_perbaikan " style="background-color: #5A9AFB;color: white;border-radius: 5px;width: 85px;height: 25px; ">
<div style="margin-top: -5px; "> <div style="margin-top: -5px; ">
<i class="icon-search4 text-muted text-size-base " style="color: white;font-size: 10px; "></i> <i class="icon-search4 text-muted text-size-base " style="color: white;font-size: 10px; "></i>
<span>&nbsp;&nbsp; <span>&nbsp;&nbsp;
...@@ -118,7 +119,7 @@ $("#sel-kec ").change(function() { ...@@ -118,7 +119,7 @@ $("#sel-kec ").change(function() {
$("#sel-desa ").change(function() { $("#sel-desa ").change(function() {
var id_desa = $(this).val() var id_desa = $(this).val()
console.log(id_desa) // console.log(id_desa)
// $(".datatab").dataTable().fnDestroy() // $(".datatab").dataTable().fnDestroy()
// $(".datatable-show-all.list_perb").dataTable().fnDestroy(); // $(".datatable-show-all.list_perb").dataTable().fnDestroy();
...@@ -146,8 +147,9 @@ $("#sel-desa ").change(function() { ...@@ -146,8 +147,9 @@ $("#sel-desa ").change(function() {
var tgl_perbaikan = data['res_perbaikan'][i]['tgl_perbaikan']; var tgl_perbaikan = data['res_perbaikan'][i]['tgl_perbaikan'];
var anggaran = data['res_perbaikan'][i]['anggaran']; var anggaran = data['res_perbaikan'][i]['anggaran'];
var tgl_selesai = data['res_perbaikan'][i]['tgl_selesai']; var tgl_selesai = data['res_perbaikan'][i]['tgl_selesai'];
var idbenar = data['res_perbaikan'][i]['id'];
console.log(number, name, name_perbaikan) // console.log(number, name, name_perbaikan)
var data_gab = `<tr> var data_gab = `<tr>
<td>` + number + `</td> <td>` + number + `</td>
...@@ -157,7 +159,7 @@ $("#sel-desa ").change(function() { ...@@ -157,7 +159,7 @@ $("#sel-desa ").change(function() {
<td>` + tgl_perbaikan + `</td> <td>` + tgl_perbaikan + `</td>
<td>` + tgl_selesai + `</td> <td>` + tgl_selesai + `</td>
<td class="text-center "> <td class="text-center ">
<a class="btn mdlFire " onclick="loaddetailid( '` + id_object + `') " data-toggle="modal " data-target="#modal_detail_perbaikan " style="background-color: #5A9AFB;color: white;border-radius: 5px;width: 85px;height: 25px; "> <a class="btn mdlFire " onclick="loaddetailid(`+id_object+`,`+idbenar+`)" data-toggle="modal " data-target="#modal_detail_perbaikan " style="background-color: #5A9AFB;color: white;border-radius: 5px;width: 85px;height: 25px; ">
<div style="margin-top: -5px; "> <div style="margin-top: -5px; ">
<i class="icon-search4 text-muted text-size-base " style="color: white;font-size: 10px; "></i> <i class="icon-search4 text-muted text-size-base " style="color: white;font-size: 10px; "></i>
<span>&nbsp;&nbsp; <span>&nbsp;&nbsp;
...@@ -267,12 +269,14 @@ function datatatata() { ...@@ -267,12 +269,14 @@ function datatatata() {
// //
// }) // })
function loaddetailid(id) { function loaddetailid(ido,id) {
$(".map_detail_p").html(``) $(".map_detail_p").html(``)
var isObject = {}; var isObject = {};
isObject.ido = ido;
isObject.id = id; isObject.id = id;
$("#iduser ").val(id) $("#iduser ").val(ido)
// console.log(ido,id)
$.ajax({ $.ajax({
url: "loadDetail", url: "loadDetail",
...@@ -324,7 +328,7 @@ function loaddetailid(id) { ...@@ -324,7 +328,7 @@ function loaddetailid(id) {
// </a>`); // </a>`);
} else { } else {
console.log(data[0]['jenis']) // console.log(data[0]['jenis'])
if (data[0]['jenis'] == 'jalan') { if (data[0]['jenis'] == 'jalan') {
$(".nama_detail").html(data[0]['name']); $(".nama_detail").html(data[0]['name']);
$(".type_detail ").html(data[0]['type']) $(".type_detail ").html(data[0]['type'])
...@@ -726,7 +730,7 @@ $(".search_list").on('input', function() { ...@@ -726,7 +730,7 @@ $(".search_list").on('input', function() {
var tgl_perbaikan = data[i][4]; var tgl_perbaikan = data[i][4];
var anggaran = data[i][5]; var anggaran = data[i][5];
var tgl_selesai = data[i][6]; var tgl_selesai = data[i][6];
var idbenar = data[i][9];
var data_gab = `<li class="media panel panel-body stack-media-on-mobile" style="background: transparent;border: none;color: white;"> var data_gab = `<li class="media panel panel-body stack-media-on-mobile" style="background: transparent;border: none;color: white;">
<div> <div>
...@@ -748,7 +752,7 @@ $(".search_list").on('input', function() { ...@@ -748,7 +752,7 @@ $(".search_list").on('input', function() {
` + tgl_selesai + ` ` + tgl_selesai + `
</div> </div>
<div> <div>
<a class="btn mdlFire " onclick="loaddetailid( '` + id_object + `') " data-toggle="modal" data-target="#modal_detail_perbaikan" style="background-color: #5A9AFB;color: white;border-radius: 5px;height: 25px; "> <a class="btn mdlFire " onclick="loaddetailid(`+id_object+`,`+idbenar+`)" data-toggle="modal" data-target="#modal_detail_perbaikan" style="background-color: #5A9AFB;color: white;border-radius: 5px;height: 25px; ">
<span> <span>
<i class="icon-search4 text-muted text-size-base " style="color: white;font-size: 10px; "></i> <i class="icon-search4 text-muted text-size-base " style="color: white;font-size: 10px; "></i>
&nbsp;&nbsp; &nbsp;&nbsp;
...@@ -774,7 +778,7 @@ $("#perbaikan_manage").on("click", function() { ...@@ -774,7 +778,7 @@ $("#perbaikan_manage").on("click", function() {
type: 'get', type: 'get',
success: function(data) { success: function(data) {
console.log(data) // console.log(data)
var data_per = [] var data_per = []
var num = 0 var num = 0
for (i in data) { for (i in data) {
...@@ -803,9 +807,8 @@ $("#perbaikan_manage").on("click", function() { ...@@ -803,9 +807,8 @@ $("#perbaikan_manage").on("click", function() {
` + data[i].tgl_selesai + ` ` + data[i].tgl_selesai + `
</div> </div>
<div> <div>
<a class="btn mdlFire " onclick="loaddetailid( '` + data[i].id_object + `') " data-toggle="modal" data-target="#modal_detail_perbaikan" style="background-color: #5A9AFB;color: white;border-radius: 5px;"> <a class="btn mdlFire " onclick="loaddetailid(`+data[i].id_object+`,`+data[i].id+`)" data-toggle="modal" data-target="#modal_detail_perbaikan" style="background-color: #5A9AFB;color: white;border-radius: 5px;">
<i class="icon-search4 text-muted text-size-base " style="color: white;font-size: 10px; "></i> &nbsp;&nbsp; Detail <i class="icon-search4 text-muted text-size-base " style="color: white;font-size: 10px; "></i> &nbsp;&nbsp; Detail
</a> </a>
</div> </div>
</li>`; </li>`;
......
...@@ -181,7 +181,7 @@ var geo_build = L.geoJson(null, { ...@@ -181,7 +181,7 @@ var geo_build = L.geoJson(null, {
<td>` + result.address.Postal + `</td> <td>` + result.address.Postal + `</td>
</tr> </tr>
<table>`; <table>`;
console.log(result) // console.log(result)
$("#feature-info").html(content); $("#feature-info").html(content);
if (error) { if (error) {
......
...@@ -1582,7 +1582,7 @@ ...@@ -1582,7 +1582,7 @@
</div> </div>
</div> </div>
<div class="isi_detail_cek "> <!-- <div class="isi_detail_cek " id="bkt_ang">
<div> <div>
<div> <div>
<span>Anggaran</span> <span>Anggaran</span>
...@@ -1592,9 +1592,9 @@ ...@@ -1592,9 +1592,9 @@
</div> </div>
</div> </div>
</div> </div> -->
<div class="isi_detail_cek "> <!-- <div class="isi_detail_cek " id="bkt_peja">
<div> <div>
<div> <div>
<span>Penanggung jawab</span> <span>Penanggung jawab</span>
...@@ -1606,7 +1606,7 @@ ...@@ -1606,7 +1606,7 @@
</div> </div>
</div> </div>
<div class="isi_detail_cek "> <div class="isi_detail_cek " id="bkt_pjlap">
<div> <div>
<div> <div>
<span>Penanggung jawab lapangan</span> <span>Penanggung jawab lapangan</span>
...@@ -1618,7 +1618,7 @@ ...@@ -1618,7 +1618,7 @@
</div> </div>
</div> </div>
<div class="isi_detail_cek "> <div class="isi_detail_cek " id="bkt_kont">
<div> <div>
<div> <div>
<span>Kontraktor</span> <span>Kontraktor</span>
...@@ -1628,7 +1628,7 @@ ...@@ -1628,7 +1628,7 @@
</div> </div>
</div> </div>
</div> </div> -->
<div class="isi_detail_cek "> <div class="isi_detail_cek ">
<div> <div>
...@@ -1642,7 +1642,7 @@ ...@@ -1642,7 +1642,7 @@
</div> </div>
</div> </div>
<div class="isi_detail_cek "> <div class="isi_detail_cek " id="bkt_lbrjln">
<div> <div>
<div> <div>
<span>Lebar jalan yang diperbaiki</span> <span>Lebar jalan yang diperbaiki</span>
...@@ -1655,8 +1655,8 @@ ...@@ -1655,8 +1655,8 @@
</div> </div>
<div style="margin-top: 20px; "> <div style="margin-top: 20px; ">
<div class="row"> <!-- <div class="row">
<div class="col-md-6 "> <div class="col-md-6 " id="bkt_prop">
<div> <div>
<span>Proposal</span> <span>Proposal</span>
</div> </div>
...@@ -1667,7 +1667,7 @@ ...@@ -1667,7 +1667,7 @@
</div> </div>
</div> </div>
<div class="col-md-6 "> <div class="col-md-6 " id="bkt_bukti">
<div> <div>
<span>Bukti penyelesaian</span> <span>Bukti penyelesaian</span>
</div> </div>
...@@ -1676,7 +1676,7 @@ ...@@ -1676,7 +1676,7 @@
</div> </div>
</div> </div>
</div> </div> -->
<div> <div>
<span>Ruas yang diperbaiki</span> <span>Ruas yang diperbaiki</span>
<!-- <div class="row"> <!-- <div class="row">
...@@ -1689,7 +1689,7 @@ ...@@ -1689,7 +1689,7 @@
</div> </div>
<div id="previewImage" style="display: none;"></div> --> <div id="previewImage" style="display: none;"></div> -->
<div class="map_detail_p"> <div class="map_detail_p_p">
<div id="map_detail_perbaikan_dash" style=" position: relative; height: 220px; width: 90%; border-radius: 5px; "> <div id="map_detail_perbaikan_dash" style=" position: relative; height: 220px; width: 90%; border-radius: 5px; ">
</div> </div>
......
...@@ -533,10 +533,10 @@ ...@@ -533,10 +533,10 @@
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();
var dapoin = [data[0][0]['geometry']['coordinates'][1], data[0][0]['geometry']['coordinates'][0]] var dapoin = [data[0][0]['geometry']['coordinates'][1], data[0][0]['geometry']['coordinates'][0]]
console.log(data[0]) //console.log(data[0])
// map.setView([data[0]['geometry']['coordinates'][0][0][0][1], data[0]['geometry']['coordinates'][0][0][0][0]], 19); // map.setView([data[0]['geometry']['coordinates'][0][0][0][1], data[0]['geometry']['coordinates'][0][0][0][0]], 19);
// var result_point = JSON.parse("" + data + "") // var result_point = JSON.parse("" + data + "")
// console.log(result_point) // //console.log(result_point)
var geo_point = L.geoJson(null, { var geo_point = L.geoJson(null, {
pointToLayer: function(feature, latlng) { pointToLayer: function(feature, latlng) {
...@@ -814,7 +814,7 @@ ...@@ -814,7 +814,7 @@
// }, // },
// dataType: 'json', // dataType: 'json',
// success: function(data) { // success: function(data) {
// console.log(data) // //console.log(data)
// dapoin = [data[0][0]['geometry']['coordinates'][1], data[0][0]['geometry']['coordinates'][0]] // dapoin = [data[0][0]['geometry']['coordinates'][1], data[0][0]['geometry']['coordinates'][0]]
// // var poinin = L.marker(dapoin).addTo(map) // // var poinin = L.marker(dapoin).addTo(map)
...@@ -878,7 +878,7 @@ ...@@ -878,7 +878,7 @@
data.append('point', poi), data.append('point', poi),
data.append('gambar', $('#gambar').val()), data.append('gambar', $('#gambar').val()),
data.append('dbspo', dbsave) data.append('dbspo', dbsave)
console.log(data) //console.log(data)
$.ajax({ $.ajax({
url: "{% url 'api:saveeditspo' %}", url: "{% url 'api:saveeditspo' %}",
data: data, data: data,
...@@ -980,9 +980,9 @@ ...@@ -980,9 +980,9 @@
// var list_history = feature.properties.f4 // var list_history = feature.properties.f4
// for (var i = 0; i < list_history.length; i++) { // for (var i = 0; i < list_history.length; i++) {
// var dt_history = list_history[i].split(","); // var dt_history = list_history[i].split(",");
// console.log(dt_history[0]) // //console.log(dt_history[0])
// console.log(dt_history[1]) // //console.log(dt_history[1])
// console.log(dt_history[2]) // //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>
...@@ -1806,7 +1806,7 @@ ...@@ -1806,7 +1806,7 @@
}).addTo(map_delete); }).addTo(map_delete);
var id_polyhps = $('#idbangunanhps').val(); var id_polyhps = $('#idbangunanhps').val();
// console.log(id_polyhps) // //console.log(id_polyhps)
loaderPage(true); loaderPage(true);
$.ajax({ $.ajax({
...@@ -2139,7 +2139,7 @@ ...@@ -2139,7 +2139,7 @@
if (feature.properties.f7 != null) { if (feature.properties.f7 != null) {
var list_history = feature.properties.f7 var list_history = feature.properties.f7
console.log(list_history[0].split(",")[0]) //console.log(list_history[0].split(",")[0])
var perbaikan_jl = `<div class='row'> var perbaikan_jl = `<div class='row'>
<label class="col-md-8">` + list_history[0].split(",")[1] + `</label> <label class="col-md-8">` + list_history[0].split(",")[1] + `</label>
...@@ -2262,9 +2262,9 @@ ...@@ -2262,9 +2262,9 @@
$("#coordinatejalan").val(feature.geometry); $("#coordinatejalan").val(feature.geometry);
var najal = $('#namajalanedit').val(); var najal = $('#namajalanedit').val();
console.log(najal) //console.log(najal)
var ijal = $('#idjalan').val(); var ijal = $('#idjalan').val();
console.log(ijal) //console.log(ijal)
} }
}); });
...@@ -2376,7 +2376,7 @@ ...@@ -2376,7 +2376,7 @@
polygon_edit_jalan.remove() polygon_edit_jalan.remove()
} }
var id_poly = $('#idjalan').val(); var id_poly = $('#idjalan').val();
console.log(id_poly) //console.log(id_poly)
// var id_poly = idm // var id_poly = idm
$.ajax({ $.ajax({
...@@ -2481,7 +2481,7 @@ ...@@ -2481,7 +2481,7 @@
$(document).on("click", "#btnsavejalan", function() { $(document).on("click", "#btnsavejalan", function() {
var cek = $("#namajalanedit").val() var cek = $("#namajalanedit").val()
console.log(cek) //console.log(cek)
var data = new FormData(); var data = new FormData();
data.append("file", $("input[id^='imgjalan']")[0].files[0]); data.append("file", $("input[id^='imgjalan']")[0].files[0]);
data.append("csrfmiddlewaretoken", "{{ csrf_token }}"); data.append("csrfmiddlewaretoken", "{{ csrf_token }}");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment