Commit 1dc705f3 authored by Manggar Mahardhika's avatar Manggar Mahardhika

push

parent 88ae78e8
......@@ -47,6 +47,7 @@ urlpatterns = [
path('hapus', views.hapus, name='hapus'),
path('dkantor', views.deletekantoradmin, name='dkantor'),
path('change-tipe', views.changetipe, name='change-tipe'),
path('c_bangunan', views.createbang, name='c_bangunan'),
path('create-jalan', views.createjalan, name='create-jalan'),
......
This diff is collapsed.
......@@ -13,6 +13,7 @@ urlpatterns = [
path('perbaikan', views.perbaikanrenovasi, name='perbaikan'),
path('loadDetail', views.loadDetail, name='loadDetail'),
path('input-perbaikan', views.inpuperbaikan, name='input-perbaikan'),
path('input-perbaikan-bang', views.inputperbaikanbangunan, name='input-perbaikan-bang'),
path('save-perbaikan', views.saveperbaikan, name='save-perbaikan'),
path('load-jl-by-id-detail', views.loadbyiddetail, name='load-jl-by-id-detail'),
......
......@@ -75,7 +75,8 @@ class Dashboard(generic.TemplateView):
geo_kantor_administrasi A
JOIN geo_prov_kab b ON st_intersects ( A.geom, b.geom )
JOIN geo_data_kecamatan c ON st_intersects(A.geom, c.geom)
join geo_data_kelurahan d on st_intersects(A.geom, d.geom)""")
join geo_data_kelurahan d on st_intersects(A.geom, d.geom)
WHERE a.is_deleted = 0""")
kantor_administrasi_res = kantor_administrasi.fetchall()
kantor_administrasi_result = []
......@@ -466,7 +467,6 @@ class Dashboard(generic.TemplateView):
context = {
'title':'Dashboard',
'kelurahan':kel_res,
......@@ -641,6 +641,26 @@ def inpuperbaikan(request):
respon = res_data[0]
return Response(respon)
@api_view(('GET',))
def inputperbaikanbangunan(request):
id = request.GET.get('id_bangunan')
with conn.cursor() as data_per:
data_per.execute("""
SELECT
name,
type,
json_build_object ( 'type', 'Feature', 'geometry', ST_AsGeoJSON ( geom :: geometry ) :: json ),
ID
FROM
geo_bangunan
WHERE
ID = %s
"""% id)
res_data = data_per.fetchall()
respon = res_data[0]
return Response(respon)
from django.core.files.storage import FileSystemStorage
import random
import re
......@@ -770,7 +790,7 @@ def saveperbaikan(request):
jenis_perbaikan,
coordinat))
conn.commit()
data = "Alhamdulilah"
data = "Sukses"
info = "Data Telah Berhasil di Perbaharui"
code = 0
......
......@@ -87,8 +87,8 @@ DATABASES = {
'PASSWORD' : 'khansia215758',
'HOST': '30.10.20.102',
'PORT': '5432',
# 'HOST': '103.126.28.66',
# 'PORT': '8082',
#'HOST': '103.126.28.66',
#'PORT': '8082',
}
}
......
......@@ -121,6 +121,128 @@
</div>
<div class="content-wrapper mymodal" id="input_perbaikan_bang" style="display: none;padding: 60px;">
<div class="content" style="padding: 15px;max-height: 550px;">
<!-- Main charts -->
<div class="panel panel-flat" style="display: none;">
<div class="panel-body" style="padding-top: 10px;">
<div class="tabbable">
<ul class="nav nav-tabs nav-tabs-bottom nav-justified">
<button type="button" class="close" onclick="destroyWraper()">&times;</button>
<li class="active"><a href="#left-tab-input-coordinat" data-toggle="tab">Koordinat</a></li>
<li><a href="#right-tab-input-informasi" data-toggle="tab">Insert Informasi</a></li>
</ul>
</div>
<div class="tab-content">
<div class="tab-pane active" id="left-tab-input-coordinat">
<div class="modal-body" style="max-height: 450px;overflow-y: auto;">
<input type="text" class="hidden" id="poly_create_input_bang">
<input type="text" class="hidden" id="id_bang_perbaikan">
<input type="text" class="hidden" id="type_id_bang">
<div id="map-insert-bang" style="height: 375px;width: 100%">
</div>
</div>
</div>
<div class="tab-pane" id="right-tab-input-informasi">
<div class="modal-body" style="max-height: 415px;overflow-y: auto;">
<div class="row">
<div class="col-md-6">
<div class="form-group">
<label>Nama :</label>
<input type="text" id="nama_bang" class="form-control" value="">
</div>
<div class="form-group">
<label>Type :</label>
<input type="text" id="type_bang" class="form-control" value="">
</div>
<div class="form-group">
<label>Kelurahan :</label>
<input type="text" id="kelurahan_bang" class="form-control" value="">
</div>
<div class="form-group">
<label>Kecamatan :</label>
<input type="text" id="kecamatan_bang" class="form-control" value="">
</div>
<div class="form-group">
<label>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>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>Penanggung Jawab Lapangan :</label>
<input type="text" id="pjlapangan_bang" class="form-control" value="">
</div>
<div class="form-group">
<label>Kontraktor :</label>
<input type="text" id="kontraktor_bang" class="form-control" value="">
</div>
<!-- <div class="form-group">
<label>Panjang Jalan Keseluruhan :</label>
<input type="text" id="panjangjalanall" class="form-control" value="">
</div>
<div class="form-group">
<label>Panjang Jalan Perbaikan :</label>
<input type="text" id="panjangjalanperbaikan" class="form-control" value="">
</div>
<div class="form-group">
<label>Lebar Jalan Perbaikan :</label>
<input type="text" id="lebarjalanperbaikan" class="form-control" value="">
</div> -->
<div class="form-group">
<label>Jenis Perbaikan :</label>
<input type="text" id="jenisperbaikan_bang" class="form-control" value="">
</div>
<div class="form-group">
<label>Proposal (.pdf):</label>
<input type="file" id="proposal_bang">
</div>
<div class="form-group">
<label>Bukti Selesai Perbaikan (.png/.jpg/.jpeg/):</label>
<input type="file" id="buktiselesai_bang">
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="panel-footer">
<button type="button" class="btn btn-info" id="save-perbaikan_bang" style="float: right; margin-right: 40px;">SAVE</button>
<button type="button" class="btn btn-link" onclick="destroyWraper()" style="float: right;">Close</button>
</div>
</div>
</div>
<!-- /main charts -->
</div>
<!-- editing kelurahan -->
<div class="content-wrapper mymodal" id="edit_kelurahan" style="display: none;padding: 60px;">
<div class="content" style="padding: 15px;max-height: 550px;">
......
......@@ -143,6 +143,9 @@
#btn_edit_bangunan {
display: none;
}
#btn_delete_bangunan {
display: none;
}
#btn_edit_kelurahan {
display: block;
......@@ -188,6 +191,9 @@
#btn_edit_adm {
display: none;
}
#btn_delete_adm {
display: none;
}
#btn_edit_rs {
display: none;
......
......@@ -244,7 +244,7 @@
map_create_bangunan.on(L.Draw.Event.CREATED, function(e) {
var layer = e.layer;
$("#poly_create").empty();
$("#poly_create_bangunan").empty();
var type = e.layerType;
var layer = e.layer;
......@@ -262,7 +262,7 @@
}
}
window.thisBaseDrawPolygonLayer = layer;
$("#poly_create").val(JSON.stringify(kordinat));
$("#poly_create_bangunan").val(JSON.stringify(kordinat));
});
polygon_options = {
......@@ -427,6 +427,7 @@
});
$(document).on("click", "#create_save_jalan", function(e) {
data = new FormData()
data.append("gambar", $("input[id^='img_jalan']")[0].files[0]);
......@@ -470,7 +471,7 @@
$(document).on("click", "#create_save_bangunan", function(e) {
var polygin = $('#poly_create').val();
var polygin = $('#poly_create_bangunan').val();
var name_poly = $('#name_create').val();
var info_poly = $('#info_create').val();
var alamat_poly = $('#alamat_create').val();
......
This diff is collapsed.
This diff is collapsed.
......@@ -126,6 +126,7 @@
<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">
<input type="text" name="idjalan" id="idjalan" class="form-control hidden" value="">
<div class="tabbable">
<ul class="nav nav-tabs nav-tabs-bottom nav-justified">
......@@ -140,7 +141,7 @@
<div class="form-group">
<label class="col-lg-2 control-label" style="margin-top:10px">Image</label>
<div class="col-lg-9" style="margin-top:10px">
<input type="file" id="imgbangunan" name="images[]" multiple accept="image/jpg,image/png,image/jpeg,image/gif">
<input type="file" id="imgjalan" name="images[]" multiple accept="image/jpg,image/png,image/jpeg,image/gif">
</div>
</div>
</div>
......@@ -149,8 +150,8 @@
<div class="row" style="height: 337px;">
<input type="text" class="hidden" name="coordinatebangunan" id="coordinatebangunan" value="">
<input type="text" name="idbangunan" id="idbangunan" class="form-control hidden" value="" disable>
<input type="text" class="hidden" name="coordinatejalan" id="coordinatejalan" value="">
<input type="text" name="idjalan" id="idjalan" class="form-control hidden" value="" disable>
<table style="margin-left: 50px;
width: 100vh;">
<tr>
......@@ -199,7 +200,7 @@
<div class="modal-footer ">
<button type="button" class="btn btn-link" onclick="destroyfade()" data-dismiss="modal">Close</button>
<button type="button" id="btnsavebangunan" class="btn btn-info">Save changes</button>
<button type="button" id="btnsavejalan" class="btn btn-info">Save changes</button>
</div>
</div>
</div>
......@@ -471,7 +472,7 @@
<div class="row" style="margin-top: 15px;">
<div class="form-group">
<label class="col-lg-3 control-label lbl-top" style="margin-top: 15px;">Tipe Point</label>
<label class="col-lg-3 control-label lbl-top" style="margin-top: 15px;">Jenis Point</label>
<div class="col-lg-9">
<select style="border-bottom: 1px solid rgb(83, 83, 83) !important;" id="tipe_point" data-placeholder="select point.." class="select-size-md">
<option value="null" selected disabled>-- Pilih Jenis Point --</option>
......@@ -494,9 +495,11 @@
<div class="row" style="margin-top: 15px;">
<div class="form-group">
<label class="col-lg-3 control-label lbl-top" style="margin-top: 15px;">Informasi Bangunan</label>
<label class="col-lg-3 control-label lbl-top" style="margin-top: 15px;">Tipe Point</label>
<div class="col-lg-9">
<input id="info_create_point" type="text" class="form-control" value="" placeholder="Rumah/Gedung/Ruko/Pabrik/dsb" required>
<select style="border-bottom: 1px solid rgb(83, 83, 83) !important;width: 220px;" id="tipe_point_2" data-placeholder="select point.." class="select-size-md">
<option value="null" selected disabled>-- Pilih Tipe Point --</option>
</select>
</div>
</div>
</div>
......@@ -578,3 +581,32 @@
</div>
</div>
</div>
<script>
$("#tipe_point").change(function() {
var tipe = $(this).val();
$.ajax({
url: "{% url 'api:change-tipe' %}",
data: {
'tipe': tipe
},
dataType: 'json',
success: function(data) {
console.log(data)
var data_all_kab = []
for (var i = 0; i < data['result'].length; i++) {
var data_k = data['result'][i][0];
console.log(data_k)
var data_kab = `<option value="` +
data_k +
`">` +
data_k +
`</option>`;
data_all_kab.push(data_kab)
};
$('#tipe_point_2').html(`<option value="null" selected disabled>-- Pilih Tipe Point --</option>` + data_all_kab);
}
});
});
</script>
\ No newline at end of file
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