Commit a56718c6 authored by Muhamad's avatar Muhamad

delete button + functionny

parent ced77bc2
......@@ -76,6 +76,7 @@ urlpatterns = [
path('search_lanjut', views.search_lanjut, name='search_lanjut'),
path('load_point_id', views.load_point_id),
path('edit_detail_poin', views.edit_detail_poin),
path('dpoint', views.dpoint, name='dpoint'),
path('download_perbaikan_data', views.download_perbaikan_data)
]
\ No newline at end of file
......@@ -2830,6 +2830,28 @@ def createpoint(request):
def filt_perbaikan_kecamatan(request):
id_kec = request.GET.get('id_kec')
if id_kec == 'all_kecamatan':
res_kel = 'all_kecamatan'
with conn.cursor() as data_per:
data_per.execute("""
SELECT
gl.NAME,
tp.id_object,
tp.NAME,
tp.TYPE,
tp.tgl_perbaikan,
tp.anggaran,
tp.tgl_selesai
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))
WHERE
rn = 1
""")
res_perbaikan = data_per.fetchall()
else:
with conn.cursor() as kel:
kel.execute("""SELECT ID,
desa
......@@ -2840,6 +2862,7 @@ def filt_perbaikan_kecamatan(request):
"""% int(id_kec))
res_kel = kel.fetchall()
with conn.cursor() as data_per:
data_per.execute("""
SELECT
......@@ -2856,7 +2879,6 @@ def filt_perbaikan_kecamatan(request):
JOIN geo_data_kecamatan gdk on st_intersects(st_setsrid(gdk.geom, 4326), st_setsrid(tp.geom, 4326))
WHERE
rn = 1 and gdk.ID = %s
LIMIT 10
"""% int(id_kec))
res_perbaikan = data_per.fetchall()
......@@ -3530,3 +3552,26 @@ def download_perbaikan_data(request):
'data' : per_res,
}
return Response(respon)
@api_view(('POST',))
def dpoint(request):
id = request.POST.get('id')
db = request.POST.get('db')
try:
with conn.cursor() as editka:
editka.execute("""update %s set is_deleted = 1 where id = %s"""%(db, id))
conn.commit()
data = {'status':'Success'}
data = 'SUCCESS'
info = 'data telah diperbaharui, akan terupdate setelah reload'
status = 0
except:
data = 'Sorry'
info = 'Gagal diperbaharui, hubungi developer'
status = 1
respon={'data':data, 'info': info, 'status':status}
return Response(respon)
\ No newline at end of file
......@@ -49,7 +49,7 @@ class HomeView(View):
class CustomLogoutView(LogoutView):
template_name = 'user/login.html'
next_page = 'login'
next_page = '/'
class Userprofile(generic.TemplateView):
template_name = 'user/user_profile.html'
......
#map-jalan>div.leaflet-control-container>div.leaflet-top.leaflet-left>div>div {
display: none;
}
\ No newline at end of file
<svg width="24" height="19" viewBox="0 0 24 19" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M3.07985 17.7188L20.6739 17.7188C21.6456 17.7188 22.4333 16.931 22.4333 15.9593V3.64348C22.4333 2.67179 21.6456 1.88407 20.6739 1.88407L3.07985 1.88407C2.10816 1.88407 1.32045 2.67179 1.32045 3.64348V15.9593C1.32045 16.931 2.10816 17.7188 3.07985 17.7188Z" stroke="#212232" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
</svg>
......@@ -67,7 +67,6 @@
.active {
display: block;
}
/* #button_hide {
line-height: 15px;
width: 40px;
......@@ -139,10 +138,134 @@
display: none!important;
}
</style>
{% if user.is_authenticated %}
<style>
#btn_perbaikan_jalan {
display: block;
}
.btn_action {
display: block;
}
#btn_edit_bangunan {
display: block;
}
#btn_delete_bangunan {
display: block;
}
#btn_edit_kelurahan {
display: block;
top: 5px;
}
#btn_edit_kelurahan :hover {
border-color: #DADCE0;
background-color: #F1F3F4;
}
#btn_edit_tuplah {
display: block;
}
#btn_jalan {
display: block;
}
#btn_edit_gl {
display: block;
}
#btn_edit_lk {
display: block;
}
#btn_edit_puskes {
display: block;
}
#btn_edit_adm {
display: block;
}
#btn_delete_adm {
display: block;
}
#btn_edit_rs {
display: block;
}
#btn_edit_si {
display: block;
}
#btn_edit_sp {
display: block;
}
#btn_edit_spbu {
display: block;
}
#btn_edit_st {
display: block;
}
#btn_edit_tr {
display: block;
}
#btn_edit_cb {
display: block;
}
#btn_detail_per_bang {
display: block;
}
#btn_perbaikan_bangunan {
display: block;
}
#btn_upload_tampak {
display: block;
}
#map>div.leaflet-control-container>div.leaflet-bottom.leaflet-right {
right: 65px;
}
#map>div.leaflet-control-container>div.leaflet-bottom.leaflet-right>div.leaflet-control-attribution.leaflet-control {
right: 0px;
}
</style>
{% else %}
<style>
.tombol_save_create {
display: none;
}
.tombol-edit {
display: none;
}
#btn_perbaikan_jalan {
display: none;
}
.btn_action {
display: none;
}
#btn_edit_bangunan {
display: none;
}
#btn_delete_bangunan {
display: none;
}
......@@ -152,7 +275,7 @@
top: 5px;
}
#btn_edit_kelurahan :hover{
#btn_edit_kelurahan :hover {
border-color: #DADCE0;
background-color: #F1F3F4;
}
......@@ -184,6 +307,7 @@
#btn_edit_adm {
display: none;
}
#btn_delete_adm {
display: none;
}
......@@ -228,7 +352,9 @@
display: none;
}
.leaflet-popup{
.leaflet-popup {
display: none;
}
</style>
{% endif %}
\ No newline at end of file
This diff is collapsed.
{% load static %} {% for group in user.groups.all %} {% if group.name == 'Dinas Pekerjaan Umum dan Penataan Ruang' %}
<style>
#btn_edit_kelurahan {
display: block;
}
#btn_edit_tuplah {
display: block;
}
#btn_edit_bangunan {
display: block;
}
#btn_delete_bangunan {
display: block;
}
#btn_jalan {
display: block;
}
#btn_edit_gl {
display: block;
}
#btn_edit_adm {
display: block;
}
#btn_delete_adm {
display: block;
}
.leaflet-popup {
display: block;
}
#btn_detail_per_bang {
display: block;
}
#btn_perbaikan_bangunan {
display: block;
}
#btn_upload_tampak {
display: block;
}
</style>
{% elif group.name == 'Dinas Kependudukan dan Pencatatan Sipil' %}
<style>
#btn_edit_kelurahan {
display: block;
}
</style>
{% elif group.name == 'Dinas Kesehatan' %}
<style>
#btn_edit_rs {
display: block;
}
#btn_edit_puskes {
display: block;
}
#btn_edit_lk {
display: block;
}
</style>
{% elif group.name == 'Dinas Ketahanan Pangan' %}
<style>
#btn_edit_tuplah {
display: block;
}
</style>
{% elif group.name == 'Dinas Lingkungan Hidup' %}
<style>
#btn_edit_tuplah {
display: block;
}
#btn_edit_bangunan {
display: block;
}
#btn_delete_bangunan {
display: block;
}
#btn_jalan {
display: block;
}
#btn_edit_cb {
display: block;
}
#btn_upload_tampak {
display: block;
}
{% load static %}
<script>
//notif overlay
function cek_overlay() {
var jml_ceklis = 0
var check_tuplah = document.getElementById("geo_tuplah");
var check_rumah = document.getElementById("geo_building");
var check_jalan = document.getElementById("geo_jalan");
var check_kota = document.getElementById("batas_kota");
var check_kec = document.getElementById("batas_kec");
var check_desa = document.getElementById("batas_desa");
.leaflet-popup {
display: block;
if (check_tuplah.checked == true) {
jml_ceklis = jml_ceklis + 1
}
</style>
{% elif group.name == 'Dinas Pariwisata dan Kebudayaan' %}
<style>
#btn_edit_cb {
display: block;
if (check_rumah.checked == true) {
jml_ceklis = jml_ceklis + 1
}
</style>
{% elif group.name == 'Dinas Pemberdayaan Masyarakat Desa' %}
<style>
#btn_edit_kelurahan {
display: block;
if (check_jalan.checked == true) {
jml_ceklis = jml_ceklis + 1
}
</style>
{% elif group.name == 'Dinas Pemberdayaan Perempuan dan PA' %}
<style>
#btn_edit_kelurahan {
display: block;
if (check_kota.checked == true) {
jml_ceklis = jml_ceklis + 1
}
</style>
{% elif group.name == 'Dinas Kearsipan dan Perpustakaan' %}
<style>
#btn_edit_adm {
display: block;
if (check_kec.checked == true) {
jml_ceklis = jml_ceklis + 1
}
</style>
{% elif group.name == 'Dinas Pendidikan' %}
<style>
#btn_edit_sp {
display: block;
}
</style>
{% elif group.name == 'Dinas Perdagangan dan Perindustrian' %}
<style>
#btn_edit_spbu {
display: block;
}
</style>
{% elif group.name == 'Dinas Perhubungan' %}
<style>
#btn_edit_st {
display: block;
if (check_desa.checked == true) {
jml_ceklis = jml_ceklis + 1
}
#btn_edit_tr {
display: block;
}
</style>
{% elif group.name == 'Dinas Perikanan dan Peternakan' %}
<style>
#btn_edit_tuplah {
display: block;
}
</style>
{% elif group.name == 'Dinas Pertanian' %}
<style>
#btn_edit_tuplah {
display: block;
}
</style>
{% elif group.name == 'Dinas Perumahan dan Kawasan Permukiman' %}
<style>
#btn_edit_tuplah {
display: block;
}
if (jml_ceklis != 0) {
$(".jumlah-ceklis").html(`<div style="position: absolute;right: -5px;top: -5px;background:
#90CAFF;width: 20px;height: 20px;text-align: center;border-radius: 10px;color:#FFFFFF;"><b>` + jml_ceklis + `</b></div>`)
#btn_edit_bangunan {
display: block;
}
$(".overlay-cek").css("background", "#1E2233")
$(".overlay-cek").css("box-shadow", "0px 4px 47px rgb(175 141 246 / 86%)")
#btn_delete_bangunan {
display: block;
} else {
$(".jumlah-ceklis").html(``)
$(".overlay-cek").css("background", "#FFFFFF")
$(".overlay-cek").css("box-shadow", "0")
}
#btn_upload_tampak {
display: block;
}
.leaflet-popup {
display: block;
}
</style>
{% elif group.name == 'Dinas Sosial' %}
<style>
#btn_edit_si {
display: none;
}
</style>
{% endif %}{% endfor %}
<script>
cek_overlay()
//tes
function panel_samp() {
$("#panel-samping").addClass("move");
......@@ -953,6 +805,7 @@
} else {
geo_batas_kel.remove()
}
cek_overlay()
}
function bataskota() {
......@@ -962,6 +815,7 @@
} else {
geo_batas.remove()
}
cek_overlay()
}
function bataskec() {
......@@ -971,6 +825,18 @@
} else {
geo_batas_kec.remove()
}
cek_overlay()
}
function georumah() {
var checkBox = document.getElementById("geo_building");
if (checkBox.checked == true) {
$(".help_bangunan").html('Polygon Bangunan dan Line Jalan terlihat pada zoom > 16')
} else {
$(".help_bangunan").html('')
}
cek_overlay()
}
function batasall() {
......@@ -990,6 +856,7 @@
geo_batas_kel.remove()
geo_batas.remove()
}
cek_overlay()
}
var search_desa = batas_desa_desa();
......@@ -1216,6 +1083,7 @@
}
function geotuplah() {
var checkBox = document.getElementById("geo_tuplah");
if (checkBox.checked == true) {
loaderPage(true);
......@@ -1244,6 +1112,8 @@
$("#legenda").css('display', 'none');
geo_tuplah.remove()
}
cek_overlay()
}
......@@ -2228,8 +2098,10 @@
}
function geojalan() {
var checkBox = document.getElementById("geo_jalan");
if (checkBox.checked == true) {
$(".help_bangunan").html('Polygon Bangunan dan Line Jalan terlihat pada zoom > 16')
map.on("movestart", function() {
if (map.hasLayer(geo_jalan)) {
geo_jalan.clearLayers()
......@@ -2270,9 +2142,11 @@
});
} else {
$(".help_bangunan").html('')
geo_jalan.clearLayers();
geo_jalan.remove();
}
cek_overlay()
}
var map_edit_jalan = L.map('map-jalan', {
......@@ -2296,6 +2170,11 @@
});
$(document).on("click", "#btn_jalan", function() {
$("#koordinat_cek").addClass("active")
$("#info_umum").removeClass("active")
$("#left-tab1-feas-upl-j").addClass("active")
$("#right-tab2-feas-upl-j").removeClass("active")
if (map_edit_jalan.hasLayer(polygon_edit_jalan)) {
polygon_edit_jalan.remove()
}
......@@ -2874,6 +2753,11 @@
$(document).on("click", "#btn_perbaikan_jalan", function() {
$("#koordinat_cek").addClass("active")
$("#info_umum").removeClass("active")
$("#left-tab1-feas-upl-j").addClass("active")
$("#right-tab2-feas-upl-j").removeClass("active")
geo_jalan_input.clearLayers(geo_jalan_input)
$("#input_perbaikan").css("display", "block");
var id_jalan = $("#idjalan").val();
......@@ -3489,7 +3373,6 @@
<script>
//klik kanan begin
map.on('contextmenu', function(e) {
$("#modal_option_create").modal("show");
......@@ -4768,7 +4651,7 @@
var alamat_poly = $('#tahun_create').val();
var lb_poly = $('#luas_lahan_create').val();
$.ajax({
url: "{% url 'api:c_lahan' %}",
url: "api/c_lahan",
data: {
'polygon': polygin,
'name': name_poly,
......
......@@ -130,13 +130,13 @@
<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-j" data-toggle="tab">Koordinat</a></li>
<li onclick="changetabs(this)"><a href="#right-tab2-feas-upl-j" data-toggle="tab">Informasi Umum</a></li>
<li onclick="changetabs(this)" id="koordinat_cek" class="active"><a href="#left-tab1-feas-upl-j" data-toggle="tab">Koordinat</a></li>
<li onclick="changetabs(this)" id="info_umum"><a href="#right-tab2-feas-upl-j" data-toggle="tab">Informasi Umum</a></li>
</ul>
<div class="tab-content">
<div class="tab-pane active" id="left-tab1-feas-upl-j">
<div id="map-jalan" style="width: 400px;height: 300px;position: relative;margin-left: 100px;"></div>
<div id="map-jalan" style="height: 300px;position: relative;"></div>
<div class="form-group">
<label class="col-lg-2 control-label" style="margin-top:10px">Image</label>
......@@ -1640,9 +1640,9 @@
<!-- Main charts -->
<div class="panel panel-flat" style="display: none;width: 1000px;">
<div class="panel-header" style="height: 50px;background: #1E2233;border-top-left-radius: 10px;border-top-right-radius: 10px;">
<!-- <button type="button" class="close" onclick="destroyWraper()" style=" width: 30px;
<button type="button" class="close" onclick="destroyWraper()" style=" width: 30px;
color: white;
height: 30px;">&times;</button> -->
height: 30px;">&times;</button>
<h5 class="modal-title title-create" style="color: white;margin-left: 25px;padding-top: 10px;">Input Perbaikan</h5>
</div>
<div class="panel-body" style="padding-top: 10px;">
......@@ -1977,8 +1977,8 @@
<div class="tabbable">
<ul class="nav nav-tabs nav-tabs-bottom nav-justified">
<li onclick="changetabs(this)" class="active"><a href="#left-tab1-feas-upli" data-toggle="tab">Koordinat</a></li>
<li onclick="changetabs(this)"><a href="#right-tab2-feas-upli" data-toggle="tab">Informasi Umum</a></li>
<li onclick="changetabs(this)" id="koordinat_cek" class="active"><a href="#left-tab1-feas-upli" data-toggle="tab">Koordinat</a></li>
<li onclick="changetabs(this)" id="info_umum"><a href="#right-tab2-feas-upli" data-toggle="tab">Informasi Umum</a></li>
</ul>
<div class="tab-content">
......
......@@ -4,14 +4,14 @@
<div class="dropdown show-dropdown">
<a href="#" type="checkbox">
<input type="checkbox" name="checkbox" onclick="mapsganti()" id="mapschange" style="position: absolute;opacity: 0;width: 40px;height: 40px;margin-top: -5px;">
<input type="checkbox" name="checkbox" onclick="mapsganti()" id="mapschange" style="position: absolute;opacity: 0;width: 50px;height: 50px;margin-top: 0px;z-index:2;cursor: pointer;">
<div id="labelchange">
<img src="{% static 'img/icon-1/Vector3d.svg' %}" alt="" style="height: 50px;
width: 50px;">
</div>
</a>
</div>
<span class="tooltiptext tooltip-left" style="font-family: 'gilroysemibold';
<span class="tooltiptext tooltip-left tooltip-3d" style="font-family: 'gilroysemibold';
color: #085E8C;">3D</span>
</li>
......@@ -71,8 +71,11 @@
</ul>
</div>
</li>
<li class="fixed-plugin no3d" style="top: 170px;">
<li class="fixed-plugin no3d overlay-cek" style="top: 170px;">
<span class="tooltiptext tooltip-left" style="font-family: 'gilroysemibold';color: #6D3FDE;">Overlay</span>
<div class="jumlah-ceklis">
</div>
<div class="dropdown show-dropdown ">
<a href="#" data-toggle="dropdown">
<img src="{% static 'img/icon-1/Vectoroverlay.svg' %}" alt="" style="height: 50px;
......@@ -100,7 +103,7 @@
<div class="checkbox">
<label>
<input type="checkbox" id="geo_building" style="margin-top:2px;">
<input type="checkbox" id="geo_building" onclick="georumah()" style="margin-top:2px;">
<img src="/static/img/icon-1/Buildingsbangunan.svg" alt="" style="margin-top: -5px;">
<span>
Bangunan
......
......@@ -413,7 +413,7 @@
<div class="form-group" style="margin-top: 15px;width: 98%;">
<select name="select" id="sel-kec" class="form-control input-sm" style="background-color: #393E54;border-radius: 8px;border-color: #393E54;color: white;">
<option>Pilih Kecamatan</option>
<option value="all_kecamatan">Pilih Kecamatan</option>
{% for nama_kecamatan in kecamatan %}
<option value="{{nama_kecamatan.administrasi.f1}}">{{nama_kecamatan.administrasi.f2}}</option>
{% endfor %}
......@@ -686,7 +686,9 @@
},
dataType: 'json',
success: function(data) {
if (data['res_kel'] == 'all_kecamatan') {
$('#sel-desa').html(`<option>Pilih Desa</option>`);
} else {
var data_all_desa = []
for (var i = 0; i < data['res_kel'].length; i++) {
var id_k = data['res_kel'][i][0];
......@@ -698,6 +700,9 @@
data_all_desa.push(data_kel)
};
$('#sel-desa').html(`<option>Pilih Desa</option>` + data_all_desa);
}
var data_perbaikan = []
var number = 0;
......
......@@ -94,7 +94,8 @@
<script type="text/javascript" src="{% static 'js/core/libraries/jquery.min.js' %}"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/html2canvas/0.4.1/html2canvas.js"></script>
<link rel="stylesheet" href="{% static 'css/layout-style.css' %}"> {% endblock css %}
<link rel="stylesheet" href="{% static 'css/layout-style.css' %}">
<link rel="stylesheet" href="{% static 'css/st.css' %}"> {% endblock css %}
<link href="http://code.jquery.com/ui/1.10.2/themes/smoothness/jquery-ui.css" rel="Stylesheet"></link>
<!-- Theme JS files -->
......@@ -127,6 +128,7 @@
<div class="content-wrapper">
<div class="content">
<div id="map">
<div class="help_bangunan" style="position: absolute;z-index: 999;top: 0px;right: 60px;"></div>
<div class="col-md-4 col-md-offset-4 input-group content-group head">
<!-- <div class="input-group">
......@@ -2288,3 +2290,9 @@
});
</script> -->
{% if user.is_authenticated %} {% else %}
<script>
$(".tombol-edit").html('ilang')
</script>
{% endif %}
\ 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