Commit 3a8f4735 authored by Manggar Mahardhika's avatar Manggar Mahardhika

fix search, history bangunan, 3d

parent b7b0b9a0
......@@ -625,9 +625,6 @@
</div>
</div>
<div>
<div>
<span>Perbaikan Terakhir</span>
</div>
<div>
<span>` + perbaikan_pt + `</span>
</div>
......@@ -7095,44 +7092,78 @@
list_history_panel += data_history
};
history = `
<tr style="height: 40px;">
<th id="history_panel">
<p class="text-center">
<img src="static/img/icon/samping_history.svg" alt="Image" style="height: 20px; width: 20px;">
</p>
<p class="text-center">
<b>History Perbaikan</b>
</p>
<br>
<label class="col-md-6"><b>Tanggal</b></label>
<label class="col-md-6"><b>Jenis Perbaikan</b></label>
` + list_history_panel + `
<p class="text-center" style="margin-top: 15px;">
<a id='btn_detail_per_bang' onclick="getdetailperbang(` + feature.properties.f1 + `)" data-toggle="modal" data-target="#modal_detail" class="btn btn-primary" style="border-radius: 200px; margin-bottom: 5px;"><i class="fa fa-list-ul" style="color:#ffffff"> </i><i style="margin-left: 5px;">View Detail</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-primary" style="border-radius: 200px; margin-bottom: 5px;"><i class="fa fa-plus" style="color:#ffffff"> </i><i style="margin-left: 5px;">Tambah History Perbaikan</i></a>
</p>
</th>
</tr>`;
history = `
<div>
<div style="margin-top: 150px;">
<span>Perbaikan Terakhir</span>
<span>
<a id='btn_detail_per_bang' onclick="getdetailperbang(` + feature.properties.f1 + `)" data-toggle="modal" data-target="#modal_detail" style = "text-align:right; margin-right:26px;"><i>Detail</i></a>
</span>
</div>
<div>
<span>
<tr style="height: 40px;">
<th id="history_panel">
<div class="form-group" style="margin-bottom:0px;">
<div class="row">
<label class="col-md-6">` + list_history[0].split(",")[1] + `</label>
<label class="col-md-6">` + list_history[0].split(",")[2] + `</label>
</div>
</div>
<p class="text-center" style="margin-top: 5px;">
<a class="btn" id="btn_perbaikan_bangunan" data-toggle="modal" data-target="#input_perbaikan_bang"><i>Input Perbaikan</i></a>
</p>
</th>
</tr>
</span>
</div>
</div>
`;
} else {
history = `
<tr style="height: 40px;">
<th id="history_panel">
<p class="text-center">
History Perbaikan
</p>
<br>
<p class="text-center" style="margin-top: 10px;"><i>Belum Ada History</i></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-primary" style="border-radius: 200px; margin-bottom: 5px;"><i class="fa fa-plus" style="color:#ffffff"> </i><i style="margin-left: 5px;">Tambah History Perbaikan</i></a>
</p>
</th>
</tr>`;
<div>
<div style="margin-top: 150px;">
<span>Perbaikan Terakhir</span>
</div>
<div>
<span>
<tr style="height: 40px;">
<th id="history_panel">
<p class="text-center" style="margin-top: 10px;"><i>Belum Ada History</i></p>
<p class="text-center" style="margin-top: 10px;">
<a class="btn" id="btn_perbaikan_bangunan" data-toggle="modal" data-target="#input_perbaikan_bang"><i>Input Perbaikan</i></a>
</p>
</th>
</tr>
</span>
</div>
</div>
`;
}
} else {
history = ``
}
// if (feature.properties.f4 != null) {
// var list_history = feature.properties.f4
// console.log(list_history[0].split(",")[0])
// var perbaikan_bg = `
// <div class='row'>
// <label class="col-md-8">` + list_history[0].split(",")[1] + `</label>
// <a class="col-md-4" onclick="getdetailper(` + list_history[0].split(",")[0] + `)" data-toggle="modal" data-target="#input_perbaikan_bang"><i>Detail</i></a>
// </div>
// <a class="btn" id="btn_perbaikan_bangunan" data-toggle="modal" data-target="#input_perbaikan_bang"><i>Input Perbaikan</i></a>`
// } else {
// var perbaikan_bg = `<div class='row'>
// <div class="col-md-6">
// <label class="col-md-6">-</label>
// </div>
// </div>
// <a class="btn" id="btn_perbaikan_bangunan" data-toggle="modal" data-target="#input_perbaikan_bang"><i>Input Perbaikan</i></a>
// `
// }
content_edit = `
<div class="modal-dialog" style="width: max-content;height: max-content;">
<div class="modal-content">
......@@ -7307,135 +7338,197 @@
</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">&times;</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="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">&times;</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" value="` + feature.properties.f1 + `" disable>
<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-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="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 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 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>
</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>`;
if (feature.properties.f4 != null) {
var list_history = feature.properties.f4
console.log(list_history[0].split(",")[0])
var perbaikan_bg = `<div class='row'>
<label class="col-md-8">` + list_history[0].split(",")[1] + `</label>
<a class="col-md-4" onclick="getdetailper(` + list_history[0].split(",")[0] + `)" data-toggle="modal" data-target="#input_perbaikan_bang"><i>Detail</i></a>
</div>
<a class="col-md-6" class="btn" id="btn_perbaikan_jalan"><i>Input Perbaikan</i></a>`
</div>`;
} else {
var perbaikan_bg = `<div class='row'>
<div class="col-md-6">
<label class="col-md-6">Null</label>
</div>
</div>
<a class="btn" id="btn_perbaikan_hist" data-toggle="modal" data-target="#input_perbaikan_bang"><i>Input Perbaikan</i></a>
`
}
content = `
<table class="table tasks-list">
<thead style="text-align: center;">
<tr>
<th style="padding: 0 0 0 0px;">
<img src=` + path_img + ` alt="Image" style="width: 100%;max-height: 368px;height:368">
</th>
</tr>
</thead>
<tbody>
<div class= "container">
<tr style="height: 100px;">
<th>
<div>
<h1 style="font-family: Google Sans,Roboto,Arial,sans-serif;
letter-spacing: 0;
font-weight: 400;">
<span style="font-size: x-large;">
` + feature.properties.f2 + `
</span>
</h1>
</div>
</th>
</tr>
</div>
<div class= "container">
<tr style="height: 30px;">
<th>
<span>
` + feature.administrasi.f12 + `
</span>
</th>
</tr>
</div>
<div class= "container">
<tr style="height: 40px;">
<th>
<p style="text-align:center;">
<img src="static/img/icon/samping_location.svg" alt="Image" style="height: 30px; width: 30px;">
</p>
<p>
<span>
` + alamat + feature.administrasi.f1 + `, ` + feature.administrasi.f2 + `, ` + feature.administrasi.f3 + `, ` + feature.administrasi.f4 + `
</span>
</p>
</th>
</tr>
</div>
<div class= "container">
<tr style="height: 40px;">
<th>
<p style="text-align:center;">
<img src="static/img/icon/samping_informasi.svg" alt="Image" style="height: 30px; width: 30px;">
</p>
<p>
<span>Luas Bangunan : ` + feature.administrasi.f6 + `</span>
</p>
<p>
<span>Luas Tanah : ` + feature.administrasi.f7 + `</span>
</p>
<p>
<span>Tinggi Bangunan : ` + feature.administrasi.f8 + `</span>
</p>
<p>
<span>Pemilik : ` + feature.administrasi.f10 + `</span>
</p>
</th>
</tr>
</div>
<div class= "container">
<tr style="height: 40px;">
<th>
<p class="text-center" style="margin-top: 5px;">
<a href="#" class="btn btn-primary" data-toggle="modal" data-target="#modal_bangunan_edit" id="btn_edit_bangunan" data-backdrop="static" data-keyboard="false" style="border-radius: 200px; margin-bottom: 5px;"><i class="fa fa-edit" style="color:#ffffff"> </i><i style="margin-left: 5px;">Edit Informasi Bangunan</i></a>
<a href="#" id='btn_delete_bangunan' class='btn
btn-primary btn_edit_bangunan' data-toggle="modal" data-target="#modal_bangunan_delete" data-backdrop="static" data-keyboard="false" style="border-radius: 200px; margin-bottom: 5px;"><i class="fa fa-trash" style="color:#ffffff"> </i><i style="margin-left: 5px;">Delete Bangunan</i></a>
</p>
</th>
</tr>
</div>
<div class="container">
` + history + `
</div>
</tbody>
</table>`;
$(".gambar_keterangan").html(`<img src="` + path_img + `" alt="" style="width:100%;height:240px;border-top-left-radius: 10px;border-bottom-left-radius: 10px;">`)
......@@ -7457,77 +7550,61 @@
<div class="col-md-6">
<div>
<div>
<span>Jenis Bangunan</span>
<span style="font-family: 'gilroylight';">Jenis Bangunan</span>
</div>
<div>
<span>
` + feature.administrasi.f12 + `
</span>
<span style="font-family: 'gilroysemibold';">` + feature.administrasi.f12 + `</span>
</div>
</div>
<div>
<div>
<span>Luas Bangunan</span>
<div style="margin-top:5px;">
<span style="font-family: 'gilroylight';">Luas Bangunan</span>
</div>
<div>
<span style="font-family: 'Roboto';">` + feature.administrasi.f6 + ` m</span>
<span style="font-family: 'gilroysemibold';">` + feature.administrasi.f6 + ` m</span>
</div>
</div>
<div>
<div>
<span>Luas Tanah</span>
<span style="font-family: 'gilroylight';">Luas Tanah</span>
</div>
<div>
<span style="font-family: 'Roboto';">` + feature.administrasi.f7 + ` m</span>
<span style="font-family: 'gilroysemibold';">` + feature.administrasi.f7 + ` m</span>
</div>
</div>
</div>
<div class="col-md-6">
<div>
<div>
<span>Tinggi Bangunan</span>
<span style="font-family: 'gilroylight';">Tinggi Bangunan</span>
</div>
<div>
<span style="font-family: 'Roboto';">` + feature.administrasi.f8 + ` m</span>
<span style="font-family: 'gilroysemibold';">` + feature.administrasi.f8 + ` m</span>
</div>
</div>
<div>
<div>
<span>Pemilik</span>
<div style="margin-top:5px;">
<span style="font-family: 'gilroylight';">Pemilik</span>
</div>
<div>
<span style="font-family: 'Roboto';">` + feature.administrasi.f10 + ` m</span>
<span style="font-family: 'gilroysemibold';">` + feature.administrasi.f10 + ` m</span>
</div>
</div>
</div>
<div>
<div style="margin-top: 150px;">
<span>Perbaikan Terakhir</span>
</div>
<div>
<span>` + perbaikan_bg + `</span>
</div>
</div>
` + history + `
`);
$(".btn_action").html(`<div class="tombol-edit-keterangan text-center" style="background-color: #5A9AFB;position: absolute;width: 40px;height: 40px;bottom: 2px;right: 5px;border: 1pt solid rosybrown;border-radius: 8px;">
<a href="#" id="btn_edit_bangunan" data-toggle="modal" data-target="#modal_bangunan_edit" class="btn" style="border-bottom-left-radius: 8px;border-top-right-radius: 8px;width: 100%;height: 100%;bottom: 0px;color: white;"><i class="icon-pencil5"></i></a>
</div>
<div class="tombol-delete-keterangan text-center" data-toggle="modal" data-target="#modal_bangunan_delete" style="background-color: indianred;position: absolute;width: 40px;height: 40px;bottom: 2px;right: 50px;border: 1pt solid rosybrown;border-radius: 10px;">
<a href="#" id="btn_delete_bangunan" data-toggle="modal" data-target="#modal_bangunan_delete" class="btn" style="border-bottom-left-radius: 8px;border-top-right-radius: 8px;width: 100%;height: 100%;bottom: 0px;color: white;"><i class="icon-eraser2"></i></a>
</div>
`)
<a href="#" id="btn_edit_bangunan" data-toggle="modal" data-target="#modal_bangunan_edit" class="btn" style="border-bottom-left-radius: 8px;border-top-right-radius: 8px;width: 100%;height: 100%;bottom: 0px;color: white;"><i class="icon-pencil5"></i></a>
</div>
<div class="tombol-delete-keterangan text-center" data-toggle="modal" data-target="#modal_bangunan_delete" style="background-color: indianred;position: absolute;width: 40px;height: 40px;bottom: 2px;right: 50px;border: 1pt solid rosybrown;border-radius: 10px;">
<a href="#" id="btn_delete_bangunan" data-toggle="modal" data-target="#modal_bangunan_delete" class="btn" style="border-bottom-left-radius: 8px;border-top-right-radius: 8px;width: 100%;height: 100%;bottom: 0px;color: white;"><i class="icon-eraser2"></i></a>
</div>
`)
$("#isi_panel").html(content);
$("#modal_bangunan_edit").html(content_edit);
$("#modal_bangunan_delete").html(content_delete);
$("#input_perbaikan_bang").html(content_inp_his_bang);
......@@ -7595,9 +7672,6 @@
geo_bangunan.addData(data)
}
var checkBox_building = document.getElementById("geo_building");
map.on("movestart", function() {
geo_bangunan.clearLayers();
});
......@@ -7610,6 +7684,8 @@
var center = map.getBounds().getCenter();
var zoom = map.getZoom();
var checkBox_building = document.getElementById("geo_building");
if (checkBox_building.checked == true) {
if (zoom > 17) {
......@@ -7944,39 +8020,10 @@
});
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);
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() {
// $("#input_perbaikan_bang-s").css("display", "block");
var map_bang = new L.map('map-insert-renov-bang', {
editable: true,
editable: false,
zoomControl: false,
drawControl: true
}).setView([-2, 118], 5);
......@@ -7986,11 +8033,13 @@
minZoom: 4,
}).addTo(map_bang);
$("#input_perbaikan_bang").css("display", "block");
if (map_bang.hasLayer(polyxxx)) {
polyxxx.remove()
}
var id_polyx = $('#idbangunan').val();
// if (map_bang.hasLayer(polyxxx)) {
// polyxxx.remove()
// }
var id_polyx = $('#id_bang_perbaikan').val();
loaderPage(true);
$.ajax({
url: "{% url 'apps:input-perbaikan-bang' %}",
......@@ -7999,7 +8048,12 @@
},
dataType: 'json',
success: function(data) {
console.log(data)
setTimeout(function() {
map_bang.invalidateSize();
}, 1000);
loaderPage(false);
$("#nama_bang").val(data[0]);
$("#type_bang").val(data[4]);
$("#id_bang_perbaikan").val(data[3]);
......@@ -8008,7 +8062,7 @@
$("#kecamatan_bang").val(data[6]);
var latlngs = data[2];
console.log(data[2])
var lattitud, longitud;
map_bang.setView([data[2]['geometry']['coordinates'][0][0][0][1], data[2]['geometry']['coordinates'][0][0][0][0]], 19);
......@@ -8029,7 +8083,7 @@
})
}
})
})
});
$(document).on("click", "#save-perbaikan_bang", function(e) {
var polyginbang = $('#coorbangbaru').val();
......@@ -8043,7 +8097,7 @@
var anggaran = $("#anggaran_bang").val();
var proposal = $("#proposal_bang").val();
var bukti_selesai = $("#buktiselesai_bang").val();
console.log(bukti_selesai)
var pj = $("#pihakpengesahan_bang").val();
var pj_lapangan = $("#pjlapangan_bang").val();
var kontraktor = $("#kontraktor_bang").val();
......
......@@ -268,6 +268,10 @@
</div>
<div id="input_perbaikan_bang-s" class="modal fade">
</div>
<!-- modal tuplah -->
<div id="modal-edit-tuplah" class="modal fade">
<div class="modal-dialog" style="width: max-content;height: max-content;">
......@@ -324,8 +328,8 @@
<div class="modal-dialog modal-xs">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
<h4 class="modal-title">3D Searching</h4>
<button type="button" class="close" style="color: white;" data-dismiss="modal" aria-hidden="true">&times;</button>
<h4 class="modal-title" style="color: white;">3D Searching</h4>
</div>
<div class="modal-body">
<fieldset>
......
......@@ -542,61 +542,7 @@
// <option value="cagar_budaya">Cagar Budaya dan Tempat Wisata</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(",");
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
};
history = `
<tr style="height: 40px;">
<th id="history_panel">
<p class="text-center">
<img src="static/img/icon/samping_history.svg" alt="Image" style="height: 20px; width: 20px;">
</p>
<p class="text-center">
<b>History Perbaikan</b>
</p>
<br>
<label class="col-md-6"><b>Tanggal</b></label>
<label class="col-md-6"><b>Jenis Perbaikan</b></label>
` + list_history_panel + `
<p class="text-center" style="margin-top: 15px;">
<a id='btn_detail_per_bang' onclick="getdetailperbang(` + feature.properties.f1 + `)" data-toggle="modal" data-target="#modal_detail" class="btn btn-primary" style="border-radius: 200px; margin-bottom: 5px;"><i class="fa fa-list-ul" style="color:#ffffff"> </i><i style="margin-left: 5px;">View Detail</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-primary" style="border-radius: 200px; margin-bottom: 5px;"><i class="fa fa-plus" style="color:#ffffff"> </i><i style="margin-left: 5px;">Tambah History Perbaikan</i></a>
</p>
</th>
</tr>`;
} else {
history = `
<tr style="height: 40px;">
<th id="history_panel">
<p class="text-center">
History Perbaikan
</p>
<br>
<p class="text-center" style="margin-top: 10px;"><i>Belum Ada History</i></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-primary" style="border-radius: 200px; margin-bottom: 5px;"><i class="fa fa-plus" style="color:#ffffff"> </i><i style="margin-left: 5px;">Tambah History Perbaikan</i></a>
</p>
</th>
</tr>`;
}
} else {
history = ``
}
content_edit = `
<div class="modal-dialog" style="width: max-content;height: max-content;">
......@@ -791,9 +737,9 @@
<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="id_bang_perbaikan" value="` + feature.properties.f1 + `" disable>
<input type="text" class="hidden" id="type_id_bang">
<div id="map-insert-renov-bang" style="height: 375px;width: 100%">
<div id="map-insert-renov-bang-s" style="height: 375px;width: 100%">
</div>
</div>
......@@ -877,92 +823,162 @@
</div>
</div>
</div>`;
// content = `
// <table class="table tasks-list">
// <thead style="text-align: center;">
// <tr>
// <th style="padding: 0 0 0 0px;">
// <img src=` + path_img + ` alt="Image" style="width: 100%;max-height: 368px;height:368">
// </th>
// </tr>
// </thead>
// <tbody>
// <div class= "container">
// <tr style="height: 100px;">
// <th>
// <div>
// <h1 style="font-family: Google Sans,Roboto,Arial,sans-serif;
// letter-spacing: 0;
// font-weight: 400;">
// <span style="font-size: x-large;">
// ` + feature.properties.f2 + `
// </span>
// </h1>
// </div>
// </th>
// </tr>
// </div>
// <div class= "container">
// <tr style="height: 30px;">
// <th>
// <span>
// ` + feature.administrasi.f12 + `
// </span>
// </th>
// </tr>
// </div>
// <div class= "container">
// <tr style="height: 40px;">
// <th>
// <p style="text-align:center;">
// <img src="static/img/icon/samping_location.svg" alt="Image" style="height: 30px; width: 30px;">
// </p>
// <p>
// <span>
// ` + alamat + feature.administrasi.f1 + `, ` + feature.administrasi.f2 + `, ` + feature.administrasi.f3 + `, ` + feature.administrasi.f4 + `
// </span>
// </p>
// </th>
// </tr>
// </div>
// <div class= "container">
// <tr style="height: 40px;">
// <th>
// <p style="text-align:center;">
// <img src="static/img/icon/samping_informasi.svg" alt="Image" style="height: 30px; width: 30px;">
// </p>
// <p>
// <span>Luas Bangunan : ` + feature.administrasi.f6 + `</span>
// </p>
// <p>
// <span>Luas Tanah : ` + feature.administrasi.f7 + `</span>
// </p>
// <p>
// <span>Tinggi Bangunan : ` + feature.administrasi.f8 + `</span>
// </p>
// <p>
// <span>Pemilik : ` + feature.administrasi.f10 + `</span>
// </p>
// </th>
// </tr>
// </div>
// <div class= "container">
// <tr style="height: 40px;">
// <th>
// <p class="text-center" style="margin-top: 5px;">
// <a href="#" class="btn btn-primary" data-toggle="modal" data-target="#modal_bangunan_edit" id="btn_edit_bangunan" data-backdrop="static" data-keyboard="false" style="border-radius: 200px; margin-bottom: 5px;"><i class="fa fa-edit" style="color:#ffffff"> </i><i style="margin-left: 5px;">Edit Informasi Bangunan</i></a>
// <a href="#" id='btn_delete_bangunan' class='btn
// btn-primary btn_edit_bangunan' data-toggle="modal" data-target="#modal_bangunan_delete" data-backdrop="static" data-keyboard="false" style="border-radius: 200px; margin-bottom: 5px;"><i class="fa fa-trash" style="color:#ffffff"> </i><i style="margin-left: 5px;">Delete Bangunan</i></a>
// </p>
// </th>
// </tr>
// </div>
// <div class="container">
// `+history+`
// </div>
// </tbody>
// </table>`;
// $("#isi_panel").html(content);
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(",");
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
};
history = `
<div>
<div style="margin-top: 150px;">
<span>Perbaikan Terakhir</span>
<span>
<a id='btn_detail_per_bang' onclick="getdetailperbang(` + feature.properties.f1 + `)" data-toggle="modal" data-target="#modal_detail" style = "text-align:right; margin-right:26px;"><i>Detail</i></a>
</span>
</div>
<div>
<span>
<tr style="height: 40px;">
<th id="history_panel">
<div class="form-group" style="margin-bottom:0px;">
<div class="row">
<label class="col-md-6">` + list_history[0].split(",")[1] + `</label>
<label class="col-md-6">` + list_history[0].split(",")[2] + `</label>
</div>
</div>
<p class="text-center" style="margin-top: 5px;">
<a href="#" id="btn_perbaikan_bangunan-s" data-toggle="modal" data-target="#input_perbaikan_bang-s"><i>Input Perbaikan</i></a>
</p>
</th>
</tr>
</span>
</div>
</div>
`;
} else {
history = `
<div>
<div style="margin-top: 150px;">
<span>Perbaikan Terakhir</span>
</div>
<div>
<span>
<tr style="height: 40px;">
<th id="history_panel">
<p class="text-center" style="margin-top: 10px;"><i>Belum Ada History</i></p>
<p class="text-center" style="margin-top: 10px;">
<a href="#" id="btn_perbaikan_bangunan-s" data-toggle="modal" data-target="#input_perbaikan_bang-s"><i>Input Perbaikan</i></a>
</p>
</th>
</tr>
</span>
</div>
</div>
`;
}
} else {
history = ``
}
content = `
<table class="table tasks-list">
<thead style="text-align: center;">
<tr>
<th style="padding: 0 0 0 0px;">
<img src=` + path_img + ` alt="Image" style="width: 100%;max-height: 368px;height:368">
</th>
</tr>
</thead>
<tbody>
<div class= "container">
<tr style="height: 100px;">
<th>
<div>
<h1 style="font-family: Google Sans,Roboto,Arial,sans-serif;
letter-spacing: 0;
font-weight: 400;">
<span style="font-size: x-large;">
` + feature.properties.f2 + `
</span>
</h1>
</div>
</th>
</tr>
</div>
<div class= "container">
<tr style="height: 30px;">
<th>
<span>
` + feature.administrasi.f12 + `
</span>
</th>
</tr>
</div>
<div class= "container">
<tr style="height: 40px;">
<th>
<p style="text-align:center;">
<img src="static/img/icon/samping_location.svg" alt="Image" style="height: 30px; width: 30px;">
</p>
<p>
<span>
` + alamat + feature.administrasi.f1 + `, ` + feature.administrasi.f2 + `, ` + feature.administrasi.f3 + `, ` + feature.administrasi.f4 + `
</span>
</p>
</th>
</tr>
</div>
<div class= "container">
<tr style="height: 40px;">
<th>
<p style="text-align:center;">
<img src="static/img/icon/samping_informasi.svg" alt="Image" style="height: 30px; width: 30px;">
</p>
<p>
<span>Luas Bangunan : ` + feature.administrasi.f6 + `</span>
</p>
<p>
<span>Luas Tanah : ` + feature.administrasi.f7 + `</span>
</p>
<p>
<span>Tinggi Bangunan : ` + feature.administrasi.f8 + `</span>
</p>
<p>
<span>Pemilik : ` + feature.administrasi.f10 + `</span>
</p>
</th>
</tr>
</div>
<div class= "container">
<tr style="height: 40px;">
<th>
<p class="text-center" style="margin-top: 5px;">
<a href="#" class="btn btn-primary" data-toggle="modal" data-target="#modal_bangunan_edit" id="btn_edit_bangunan" data-backdrop="static" data-keyboard="false" style="border-radius: 200px; margin-bottom: 5px;"><i class="fa fa-edit" style="color:#ffffff"> </i><i style="margin-left: 5px;">Edit Informasi Bangunan</i></a>
<a href="#" id='btn_delete_bangunan' class='btn
btn-primary btn_edit_bangunan' data-toggle="modal" data-target="#modal_bangunan_delete" data-backdrop="static" data-keyboard="false" style="border-radius: 200px; margin-bottom: 5px;"><i class="fa fa-trash" style="color:#ffffff"> </i><i style="margin-left: 5px;">Delete Bangunan</i></a>
</p>
</th>
</tr>
</div>
<div class="container">
` + history + `
</div>
</tbody>
</table>
`;
$(".gambar_keterangan").html(`<img src="` + path_img + `" alt="" style="width:100%;height:240px;border-top-left-radius: 10px;border-bottom-left-radius: 10px;">`)
$(".nama_keterangan").html(`<div>
<span style="font-size: large;">
......@@ -978,51 +994,54 @@
`)
$(".isi_keterangan").html(`<input type="text" name="idjalan" id="idjalan" class="hidden" value="">
<input type="text" name="coordinatejalan" id="coordinatejalan" class="hidden" value="">
<div>
<div>
<span>Jenis Bangunan</span>
</div>
<div>
<span>
` + feature.administrasi.f12 + `
</span>
</div>
</div>
<div>
<div>
<span>Luas Bangunan</span>
</div>
<div>
<span style="font-family: 'Roboto';">` + feature.administrasi.f6 + ` m</span>
</div>
</div>
<div>
<div>
<span>Luas Tanah</span>
</div>
<div>
<span style="font-family: 'Roboto';">` + feature.administrasi.f7 + ` m</span>
</div>
</div>
<div>
<div>
<span>Tinggi Bangunan</span>
</div>
<div>
<span style="font-family: 'Roboto';">` + feature.administrasi.f8 + ` m</span>
</div>
</div>
<input type="text" name="coordinatejalan" id="coordinatejalan" class="hidden" value="">
<div class="col-md-6">
<div>
<div>
<span style="font-family: 'gilroylight';">Jenis Bangunan</span>
</div>
<div>
<span style="font-family: 'gilroysemibold';">` + feature.administrasi.f12 + `</span>
</div>
</div>
<div>
<div style="margin-top:5px;">
<span style="font-family: 'gilroylight';">Luas Bangunan</span>
</div>
<div>
<span style="font-family: 'gilroysemibold';">` + feature.administrasi.f6 + ` m</span>
</div>
</div>
<div>
<div>
<span style="font-family: 'gilroylight';">Luas Tanah</span>
</div>
<div>
<span style="font-family: 'gilroysemibold';">` + feature.administrasi.f7 + ` m</span>
</div>
</div>
</div>
<div class="col-md-6">
<div>
<div>
<span style="font-family: 'gilroylight';">Tinggi Bangunan</span>
</div>
<div>
<span style="font-family: 'gilroysemibold';">` + feature.administrasi.f8 + ` m</span>
</div>
</div>
<div>
<div>
<span>Pemilik</span>
</div>
<div>
<span style="font-family: 'Roboto';">` + feature.administrasi.f10 + ` m</span>
</div>
</div>`);
<div>
<div style="margin-top:5px;">
<span style="font-family: 'gilroylight';">Pemilik</span>
</div>
<div>
<span style="font-family: 'gilroysemibold';">` + feature.administrasi.f10 + ` m</span>
</div>
</div>
</div>
` + history + `
`);
$(".btn_action").html(`<div class="tombol-edit-keterangan text-center" style="background-color: #5A9AFB;position: absolute;width: 40px;height: 40px;bottom: 2px;right: 5px;border: 1pt solid rosybrown;border-radius: 8px;">
<a href="#" id="btn_edit_bangunan" class="btn" style="border-bottom-left-radius: 8px;border-top-right-radius: 8px;width: 100%;height: 100%;bottom: 0px;color: white;"><i class="icon-pencil5"></i></a>
......@@ -1031,96 +1050,10 @@
<a href="#" id="btn_delete_bangunan" class="btn" style="border-bottom-left-radius: 8px;border-top-right-radius: 8px;width: 100%;height: 100%;bottom: 0px;color: white;"><i class="icon-eraser2"></i></a>
</div>
`)
content = `
<table class="table tasks-list">
<thead style="text-align: center;">
<tr>
<th style="padding: 0 0 0 0px;">
<img src=` + path_img + ` alt="Image" style="width: 100%;max-height: 368px;height:368">
</th>
</tr>
</thead>
<tbody>
<div class= "container">
<tr style="height: 100px;">
<th>
<div>
<h1 style="font-family: Google Sans,Roboto,Arial,sans-serif;
letter-spacing: 0;
font-weight: 400;">
<span style="font-size: x-large;">
` + feature.properties.f2 + `
</span>
</h1>
</div>
</th>
</tr>
</div>
<div class= "container">
<tr style="height: 30px;">
<th>
<span>
` + feature.administrasi.f12 + `
</span>
</th>
</tr>
</div>
<div class= "container">
<tr style="height: 40px;">
<th>
<p style="text-align:center;">
<img src="static/img/icon/samping_location.svg" alt="Image" style="height: 30px; width: 30px;">
</p>
<p>
<span>
` + alamat + feature.administrasi.f1 + `, ` + feature.administrasi.f2 + `, ` + feature.administrasi.f3 + `, ` + feature.administrasi.f4 + `
</span>
</p>
</th>
</tr>
</div>
<div class= "container">
<tr style="height: 40px;">
<th>
<p style="text-align:center;">
<img src="static/img/icon/samping_informasi.svg" alt="Image" style="height: 30px; width: 30px;">
</p>
<p>
<span>Luas Bangunan : ` + feature.administrasi.f6 + `</span>
</p>
<p>
<span>Luas Tanah : ` + feature.administrasi.f7 + `</span>
</p>
<p>
<span>Tinggi Bangunan : ` + feature.administrasi.f8 + `</span>
</p>
<p>
<span>Pemilik : ` + feature.administrasi.f10 + `</span>
</p>
</th>
</tr>
</div>
<div class= "container">
<tr style="height: 40px;">
<th>
<p class="text-center" style="margin-top: 5px;">
<a href="#" class="btn btn-primary" data-toggle="modal" data-target="#modal_bangunan_edit" id="btn_edit_bangunan" data-backdrop="static" data-keyboard="false" style="border-radius: 200px; margin-bottom: 5px;"><i class="fa fa-edit" style="color:#ffffff"> </i><i style="margin-left: 5px;">Edit Informasi Bangunan</i></a>
<a href="#" id='btn_delete_bangunan' class='btn
btn-primary btn_edit_bangunan' data-toggle="modal" data-target="#modal_bangunan_delete" data-backdrop="static" data-keyboard="false" style="border-radius: 200px; margin-bottom: 5px;"><i class="fa fa-trash" style="color:#ffffff"> </i><i style="margin-left: 5px;">Delete Bangunan</i></a>
</p>
</th>
</tr>
</div>
<div class="container">
` + history + `
</div>
</tbody>
</table>`;
$("#isi_panel").html(content);
$("#modal_bangunan_edit").html(content_edit);
$("#modal_bangunan_delete").html(content_delete);
$("#input_perbaikan_bang").html(content_inp_his_bang);
$("#input_perbaikan_bang-s").html(content_inp_his_bang);
panel_samp();
});
// $("#tipe_point_b_e").val('feature.administrasi.f11').change();
......@@ -1220,53 +1153,10 @@
});
map.setView([data['gen'][0][0]['geometry']['coordinates'][0][0][0][1], data['gen'][0][0]['geometry']['coordinates'][0][0][0][0]], 19);
geo_bangunan.addTo(map)
// if (checkBox_building.checked == false) {
// geo_bangunan.clearLayers();
// geo_bangunan.remove();
// }
// map.eachLayer(function (layer) {
// if (!!geo_bangunan.toGeoJSON) {
// map.removeLayer(geo_bangunan);
// }
// geo_bangunan.clearLayers()
// map.on("movestart", function() {
// geo_bangunan.clearLayers();
// });
// function gasin(){
// $.ajax({
// url: "{% url 'api:search_lanjut' %}",
// data: {
// 'type':dar,
// 'idx':idm,
// 'db':db
// },
// dataType: 'json',
// success: function(data) {
// // if (map.hasLayer(geo_bangunan)) {
// // geo_bangunan.clearLayers()
// // geo_bangunan.remove()
// // }
// let list_poly = [];
// for (var i = 0; i < data['gen'].length; i++) {
// geoj = data['gen'][i][0];
// list_poly.push(geoj);
// };
// // geo_bangunan.clearLayers()
// // geo_bangunan.remove()
// geo_json_bangunan(list_poly);
// }
// });
// map.setView([data['gen'][0][0]['geometry']['coordinates'][0][0][0][1], data['gen'][0][0]['geometry']['coordinates'][0][0][0][0]], 19);
// // geo_bangunan.clearLayers()
// geo_bangunan.addTo(map)
// }
// });
geo_bangunan.addTo(map);
$(document).on("click", "#btn_edit_bangunan", function() {
$("#modal_bangunan_edit").css('display', 'block');
var tipe1 = $('#tipe111').val();
$('#tipe_point_b_e option[value=' + tipe1 + ']').attr('selected', 'selected');
......@@ -1468,6 +1358,7 @@
});
$(document).on("click", "#btn_delete_bangunan", function() {
$("#modal_bangunan_delete").css('display', 'block');
var map_delete = new L.map('map-delete', {
editable: true,
zoomControl: false,
......@@ -1478,6 +1369,7 @@
maxZoom: 22,
minZoom: 4,
}).addTo(map_delete);
var id_polyhps = $('#idbangunanhps').val();
// console.log(id_polyhps)
loaderPage(true);
......@@ -1552,39 +1444,10 @@
});
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);
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() {
var map_bang = new L.map('map-insert-renov-bang', {
editable: true,
$(document).on("click", "#btn_perbaikan_bangunan-s", function() {
// $("#input_perbaikan_bang-s").css("display", "block");
var map_bang = new L.map('map-insert-renov-bang-s', {
editable: false,
zoomControl: false,
drawControl: true
}).setView([-2, 118], 5);
......@@ -1594,11 +1457,13 @@
minZoom: 4,
}).addTo(map_bang);
$("#input_perbaikan_bang").css("display", "block");
if (map_bang.hasLayer(polyxxx)) {
polyxxx.remove()
}
var id_polyx = $('#idbangunan').val();
// if (map_bang.hasLayer(polyxxx)) {
// polyxxx.remove()
// }
var id_polyx = $('#id_bang_perbaikan').val();
loaderPage(true);
$.ajax({
url: "{% url 'apps:input-perbaikan-bang' %}",
......@@ -1607,6 +1472,12 @@
},
dataType: 'json',
success: function(data) {
setTimeout(function() {
map_bang.invalidateSize();
}, 1000);
loaderPage(false);
$("#nama_bang").val(data[0]);
$("#type_bang").val(data[4]);
$("#id_bang_perbaikan").val(data[3]);
......@@ -1636,7 +1507,7 @@
})
}
})
})
});
$(document).on("click", "#save-perbaikan_bang", function(e) {
var polyginbang = $('#coorbangbaru').val();
......@@ -1716,7 +1587,7 @@
icon: "success",
confirmButtonColor: "#00BCD4"
}, function() {
$("#input_perbaikan_bang").css("display", "none");
$("#input_perbaikan_bang-s").css("display", "none");
})
} else {
swal({
......@@ -2104,7 +1975,7 @@
});
$(document).on("click", "#btn_jalan", function() {
$("#modal-jalan").css('display', 'block');
if (map_edit_jalan.hasLayer(polygon_edit_jalan)) {
polygon_edit_jalan.remove()
}
......@@ -2162,7 +2033,7 @@
//tes
$(document).on("click", "#btn_hapus_jalan", function() {
$("#modal-hapus-jalan").css('display', 'block');
var id_poly = $('#idjalan').val();
$.ajax({
......
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