Commit 46257a7c authored by Manggar Mahardhika's avatar Manggar Mahardhika

bug fix

parent 6561492a
......@@ -2976,14 +2976,17 @@ def filt_perbaikan_kecamatan(request):
tp.TYPE,
tp.tgl_perbaikan,
tp.anggaran,
tp.tgl_selesai
tp.tgl_selesai,
gdl.desa,
gdc.kecamatan
FROM
( 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_data_kecamatan gdk on st_intersects(st_setsrid(gdk.geom, 4326), st_setsrid(tp.geom, 4326))
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_kecamatan gdc ON st_intersects ( st_setsrid ( gdc.geom, 4326 ), st_setsrid ( tp.geom, 4326 ) )
WHERE
rn = 1 and gdk.ID = %s
"""% int(id_kec))
rn = 1 and gdc.ID = %s
"""% int(id_kec))
res_perbaikan = data_per.fetchall()
res_all = []
......@@ -2996,6 +2999,8 @@ def filt_perbaikan_kecamatan(request):
'tgl_perbaikan':j[4],
'anggaran':j[5],
'tgl_selesai':j[6],
'desa':j[7],
'kecamatan':j[8],
}
res_all.append(data_all)
......@@ -3017,13 +3022,16 @@ def filt_perbaikan_desa(request):
tp.TYPE,
tp.tgl_perbaikan,
tp.anggaran,
tp.tgl_selesai
tp.tgl_selesai,
gdl.desa,
gdc.kecamatan
FROM
( 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_data_kelurahan gdk on st_intersects(st_setsrid(gdk.geom, 4326), st_setsrid(tp.geom, 4326))
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_kecamatan gdc ON st_intersects ( st_setsrid ( gdc.geom, 4326 ), st_setsrid ( tp.geom, 4326 ) )
WHERE
rn = 1 and gdk.ID = %s
rn = 1 and gdl.ID = %s
"""% int(id_desa))
res_perbaikan = data_per.fetchall()
......@@ -3037,6 +3045,8 @@ def filt_perbaikan_desa(request):
'tgl_perbaikan':j[4],
'anggaran':j[5],
'tgl_selesai':j[6],
'desa':j[7],
'kecamatan':j[8],
}
res_all.append(data_all)
......
......@@ -484,10 +484,14 @@ class Dashboard(generic.TemplateView):
tp.TYPE,
tp.tgl_perbaikan,
tp.anggaran,
tp.tgl_selesai
tp.tgl_selesai,
gdl.desa,
gdc.kecamatan
FROM
( 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_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 ) )
WHERE
rn = 1
""")
......@@ -503,6 +507,8 @@ class Dashboard(generic.TemplateView):
'tgl_perbaikan':j[4],
'anggaran':j[5],
'tgl_selesai':j[6],
'desa':j[7],
'kecamatan':j[8],
}
res_all.append(data_all)
......@@ -673,10 +679,14 @@ def perbaikanrenovasi(request):
tp.TYPE,
tp.tgl_perbaikan,
tp.anggaran,
tp.tgl_selesai
tp.tgl_selesai,
gdl.desa,
gdc.kecamatan
FROM
( 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_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 ) )
WHERE
rn = 1
""")
......@@ -694,6 +704,8 @@ def perbaikanrenovasi(request):
'tgl_perbaikan':j[4],
'anggaran':j[5],
'tgl_selesai':j[6],
'desa':j[7],
'kecamatan':j[8],
}
res_all.append(data_all)
......@@ -708,8 +720,8 @@ def loadDetail(request):
SELECT
gl.NAME,
tp.name,
gj.remark,
st_length ( gj.geom :: geography ),
tp.type,
st_length ( tp.geom :: geography ),
tp.tgl_pembuatan,
tp.tgl_perbaikan,
tp.tgl_selesai,
......@@ -723,17 +735,18 @@ def loadDetail(request):
tp.id_object,
tp.id,
tp.proposal,
tp.bukti_selesai
tp.bukti_selesai,
tp.jenis_perbaikan
FROM
tbl_perbaikan tp
JOIN geo_label gl ON gl.ID = tp.type_id
JOIN geo_jalan gj ON gj.ID = tp.id_object
where tp.id_object = %s"""% id_object)
res_perbaikan = data_per.fetchall()
res_all = []
for j in res_perbaikan:
data_all = {
'jenis':j[0],
'name':j[1],
'type':j[2],
'panjang':j[3],
......@@ -750,7 +763,8 @@ def loadDetail(request):
'id_object':j[14],
'id':j[15],
'proposal':j[16],
'bukti_selesai':j[17]
'bukti_selesai':j[17],
'jenis_perbaikan':j[18]
}
res_all.append(data_all)
......
......@@ -903,7 +903,11 @@
}, function() {
$("#modal_adm").modal('hide');
$("#modal_detail_non_kelurahan").modal('hide')
//location.reload();
// location.reload();
// var checkBox = document.getElementById("knt_adm");
// document.getElementById("knt_adm").checked = true;
// newe(markeradm, geo_po_adm, checkBox)
})
} else {
swal({
......
......@@ -1472,10 +1472,10 @@
</div>
</div>
<div id="modal_detail_perbaikan_dash" class="modal fade mymodal" style="padding-top: 0px;padding-bottom: 0px;right: -11px;width: 100% !important;max-height: 657px;overflow-y:hidden; left: 0px;">
<div class="modal-dialog modal-sm " style="max-height: 657px;margin: 0;float: right;bottom: 0;
<div id="modal_detail_perbaikan_dash" class="modal fade mymodal" style="padding-top: 0px;padding-bottom: 0px;right: -11px;width: 100% !important;max-height: 100%;overflow-y:hidden; left: 0px;">
<div class="modal-dialog modal-sm " style="height: 100%;margin: 0;float: right;bottom: 0;
width: 320px;">
<div class="modal-content " style="background-color: #1B1F2D;max-height: 657px;color: white; ">
<div class="modal-content " style="background-color: #1B1F2D;height: 100%;color: white; overflow-y: scroll;">
<div class="modal-body " style="padding: 0px;background-color: #1B1F2D; ">
<div style="float: right;margin: -42px 10px 0px 0px; ">
<button type="button " class="btn btn-link " onclick="cetakExcel() " style="color: white;padding-top: 2px;"><i class="icon-printer"></i>
......@@ -1488,7 +1488,7 @@
<span>x</span>
</button>
</div>
<div class="isi text " style="margin-top: 50px;overflow-y: scroll;max-height: 607px;overflow-x: hidden; ">
<div class="isi text " style="margin-top: 50px;height: 100%;overflow-x: hidden; ">
<div class="isi_detail_cek ">
<div>
<div>
......
......@@ -441,7 +441,7 @@ background: none;border-color: transparent;">
</div>
</div>
<div class="panel panel-flat " id="perbaikan-dashboard " style="background: #181B27;position: absolute;z-index: 9;width: 77%;height:100vh;left: 23%;transition: all 0.5s ease;color: white; border: none; ">
<div class="panel panel-flat " id="perbaikan-dashboard " style="background: #181B27;position: absolute;z-index: 9;width: 77%;height:100vh;left: 23%;transition: all 0.5s ease;color: white; border: none; overflow-y: scroll; ">
<div class="panel-body " style="padding:14px 0px;">
<table class="table table-responsive datatable-show-all table-sm bg-slate-610 list_perb" id="list_perbaikan" style="font-size : 8pt;padding:0px;border-top:0.5pt solid #343434;border-bottom:0.5pt solid #343434;margin-bottom: 10px;">
......@@ -478,6 +478,9 @@ background: none;border-color: transparent;">
<div>
{{all.name}}
</div>
<div>
{{all.desa}}, {{all.kecamatan}}
</div>
<div>
{{all.type}}
</div>
......@@ -491,12 +494,11 @@ background: none;border-color: transparent;">
{{all.anggaran}}
</div>
<div>
<a class="btn mdlFire " onclick="loaddetailid( '{{all.id_object}}') " 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; ">
<a class="btn mdlFire " onclick="loaddetailid( '{{all.id_object}}') " 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>
<span>&nbsp;&nbsp;
Detail</span>
</div>
&nbsp;&nbsp;
Detail
</a>
</div>
</li>
......@@ -656,7 +658,7 @@ background: none;border-color: transparent;">
<div class="isi_detail_cek ">
<div>
<div>
<span>Panjang jalan yang diperbaiki</span>
<span class="judul_panjang_jalan_detail">Panjang jalan yang diperbaiki</span>
</div>
<div>
<span class="panjang_jalan_detail">NAMA JALAN</span>
......@@ -665,7 +667,7 @@ background: none;border-color: transparent;">
</div>
</div>
<div class="isi_detail_cek ">
<div class="isi_detail_cek_jalan ">
<div>
<div>
<span>Lebar jalan yang diperbaiki</span>
......@@ -700,7 +702,7 @@ background: none;border-color: transparent;">
</div>
</div>
<div>
<div class="map_detail_p_jalan">
<span>Ruas yang diperbaiki</span>
<!-- <div class="row">
<div class="col-sm-6">
......@@ -751,8 +753,9 @@ background: none;border-color: transparent;">
$ul.find('div').wrap('<td><td/>').contents().unwrap();
$ul.contents().unwrap()
$table.prepend(`<thead><tr><th>No.</th>
<th>Sarana Perbaiakn</th>
<th>Sarana Perbaikan</th>
<th>Nama</th>
<th>Alamat</th>
<th>Type</th>
<th>Tanggal Mulai</th>
<th>Tanggal Selesai</th>
......@@ -770,16 +773,6 @@ background: none;border-color: transparent;">
orderable: false,
width: '20px',
targets: [0],
}, {
orderable: false,
width: '20px',
targets: [6],
}, {
orderable: false,
width: '20px',
targets: [7],
}, ],
dom: '<"float-left "B>frtip',
language: {
......@@ -848,24 +841,24 @@ background: none;border-color: transparent;">
var tgl_perbaikan = data['res_perbaikan'][i]['tgl_perbaikan'];
var anggaran = data['res_perbaikan'][i]['anggaran'];
var tgl_selesai = data['res_perbaikan'][i]['tgl_selesai'];
var desa = data['res_perbaikan'][i]['desa'];
var kecamatan = data['res_perbaikan'][i]['kecamatan'];
var data_gab = `<tr>
<td>` + number + `</td>
<td>` + name_perbaikan + `</td>
<td>` + name + `</td>
<td>` + desa +`, `+ kecamatan + `</td>
<td>` + type + `</td>
<td>` + tgl_perbaikan + `</td>
<td>` + tgl_selesai + `</td>
<td>` + anggaran + `</td>
<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; ">
<div style="margin-top: -5px; ">
<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; ">
<span>
<i class="icon-search4 text-muted text-size-base " style="color: white;font-size: 10px; "></i>
<span>&nbsp;&nbsp;
Detail</span>
</div>
&nbsp;&nbsp;Detail
</span>
</a>
</td>
</tr>`;
......@@ -917,12 +910,11 @@ background: none;border-color: transparent;">
<td>` + anggaran + `</td>
<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; ">
<div style="margin-top: -5px; ">
<span>
<i class="icon-search4 text-muted text-size-base " style="color: white;font-size: 10px; "></i>
<span>&nbsp;&nbsp;
Detail</span>
</div>
&nbsp;&nbsp;
Detail
</span>
</a>
</td>
</tr>`;
......@@ -1046,41 +1038,67 @@ background: none;border-color: transparent;">
</a>`);
} else {
$(".nama_detail").html(data[0]['name']);
$(".type_detail ").html(data[0]['type'])
$(".tanggal_perbaikan_detail ").text(data[0]['tgl_perbaikan'])
$(".anggaran_detail ").html(data[0]['anggaran'])
$(".penanggung_jawab_detail ").html(data[0]['pj'])
$(".penanggung_jawab_lapangan_detail ").html(data[0]['pj_lapangan'])
$(".kontraktor_detail ").html(data[0]['kontraktor'])
$(".panjang_jalan_detail ").html(data[0]['panjang'])
$(".lebar_jalan_detail ").html(data[0]['lbr_jln_reno'])
$(".proposal_detail ").html(`
<a href="media/proposal/` + data[0]['proposal'] + ` target="_blank" "id="downloadproposal">
<img src="{% static 'img/icon-1/proposal.svg' %} " alt=" " style="height: 65px;width: 65px; ">
</a>`);
$(".bukti_detail_perbaikan").html(`
<a href="media/bukti_penyelesaian/` + data[0].bukti_selesai + ` target="_blank" id="view-bukti">
<img src="{% static 'img/icon-1/bukti.svg' %} " alt=" " style="height: 70px;
width: 50px;">
</a>`);
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 geo_jalan_perbaikan = L.geoJson(data[0]['geometry'], {
style: function(feature) {
return {
color: "#FAFA00",
weight: 10,
opacity: 2,
zIndex: 1001
};
}
}).addTo(map_detail_perbaikan);
console.log(data[0]['jenis'])
if (data[0]['jenis'] == 'jalan'){
$(".nama_detail").html(data[0]['name']);
$(".type_detail ").html(data[0]['type'])
$(".tanggal_perbaikan_detail ").text(data[0]['tgl_perbaikan'])
$(".anggaran_detail ").html(data[0]['anggaran'])
$(".penanggung_jawab_detail ").html(data[0]['pj'])
$(".penanggung_jawab_lapangan_detail ").html(data[0]['pj_lapangan'])
$(".kontraktor_detail ").html(data[0]['kontraktor'])
$(".panjang_jalan_detail ").html(data[0]['panjang'])
$(".lebar_jalan_detail ").html(data[0]['lbr_jln_reno'])
$(".proposal_detail ").html(`
<a href="media/proposal/` + data[0]['proposal'] + ` target="_blank" "id="downloadproposal">
<img src="{% static 'img/icon-1/proposal.svg' %} " alt=" " style="height: 65px;width: 65px; ">
</a>`);
$(".bukti_detail_perbaikan").html(`
<a href="media/bukti_penyelesaian/` + data[0].bukti_selesai + ` target="_blank" id="view-bukti">
<img src="{% static 'img/icon-1/bukti.svg' %} " alt=" " style="height: 70px;
width: 50px;">
</a>`);
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 geo_jalan_perbaikan = L.geoJson(data[0]['geometry'], {
style: function(feature) {
return {
color: "#FAFA00",
weight: 10,
opacity: 2,
zIndex: 1001
};
}
}).addTo(map_detail_perbaikan);
} else if (data[0]['jenis'] == 'bangunan'){
$(".nama_detail").html(data[0]['name']);
$(".type_detail ").html(data[0]['type'])
$(".tanggal_perbaikan_detail ").text(data[0]['tgl_perbaikan'])
$(".anggaran_detail ").html(data[0]['anggaran'])
$(".penanggung_jawab_detail ").html(data[0]['pj'])
$(".penanggung_jawab_lapangan_detail ").html(data[0]['pj_lapangan'])
$(".kontraktor_detail ").html(data[0]['kontraktor'])
$(".proposal_detail ").html(`
<a href="media/proposal/` + data[0]['proposal'] + ` target="_blank" "id="downloadproposal">
<img src="{% static 'img/icon-1/proposal.svg' %} " alt=" " style="height: 65px;width: 65px; ">
</a>`);
$(".judul_panjang_jalan_detail ").html('Jenis Perbaikan')
$(".panjang_jalan_detail ").html(data[0]['jenis_perbaikan'])
$('.isi_detail_cek_jalan').hide()
$('.map_detail_p_jalan').hide()
$(".bukti_detail_perbaikan").html(`
<a href="media/bukti_penyelesaian/` + data[0].bukti_selesai + ` target="_blank" id="view-bukti">
<img src="{% static 'img/icon-1/bukti.svg' %} " alt=" " style="height: 70px;
width: 50px;">
</a>`);
}
}
}
});
......@@ -1435,12 +1453,13 @@ background: none;border-color: transparent;">
` + anggaran + `
</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;width: 85px;height: 25px; ">
<div style="margin-top: -5px; ">
<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; ">
<span>
<i class="icon-search4 text-muted text-size-base " style="color: white;font-size: 10px; "></i>
<span>&nbsp;&nbsp;
Detail</span>
</div>
&nbsp;&nbsp;
Detail
</span>
</a>
</div>
</li>`;
......
......@@ -112,7 +112,7 @@
</head>
<body style="font-family: 'gilroylight';" oncontextmenu="return false">
<body style="font-family: 'gilroylight'; overflow-y: hidden;" oncontextmenu="return false">
......
......@@ -328,8 +328,9 @@
<thead>
<tr>
<th>No.</th>
<th>Sarana Perbaiakn</th>
<th>Sarana Perbaikan</th>
<th>Nama</th>
<th>Alamat</th>>
<th>Type</th>
<th>Tanggal Mulai</th>
<th>Tanggal Selesai</th>
......@@ -344,6 +345,7 @@
<td>{{forloop.counter}}</td>
<td>{{all.name_perbaikan}}</td>
<td>{{all.name}}</td>
<td>{{all.desa}}, {{all.kecamatan}}</td>
<td>{{all.type}}</td>
<td>{{all.tgl_perbaikan}}</td>
<td>{{all.tgl_selesai}}</td>
......@@ -942,6 +944,8 @@
isi_modal_detail = []
for (var i = 0; i < data.length; i++) {
var crosser = data[i].jenis
console.log(crosser)
isi_modal_detail.push(`<tr>
<td>` + i + `</td>
<td>` + data[i].name + `</td>
......
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