Commit 895f1d4e authored by Muhamad's avatar Muhamad

perbaikan 3d

parent 96f254b9
......@@ -48,9 +48,9 @@ import random
@api_view(('GET',))
@renderer_classes((TemplateHTMLRenderer, JSONRenderer))
def search_auto(request):
nama_desa = request.GET.get('namadesa')
with conn.cursor() as desa:
desa.execute(f"SELECT id, desa, kecamatan FROM geo_data_kelurahan WHERE desa ILIKE '{nama_desa}%' order by desa ASC limit 5")
desa.execute(f"SELECT id, desa, kecamatan FROM geo_data_kelurahan order by desa ASC")
all = desa.fetchall()
data = {'nama_des':all}
......@@ -737,22 +737,116 @@ def hapus(request):
print(respon)
return Response(respon)
@api_view(('GET',))
@renderer_classes((TemplateHTMLRenderer, JSONRenderer))
def hasilsearch(request):
if request.method == 'GET':
id_desa = request.GET.get("id_desa_search")
nama_desa = request.GET.get("id_desa_search")
nama_desa = nama_desa.split(",")[0]
with conn.cursor() as bts:
bts.execute("""
SELECT
st_asgeojson ( ST_ExteriorRing ( the_geom ) ) AS erings
FROM
( SELECT ( ST_Dump ( geom ) ).geom AS the_geom FROM geo_data_kelurahan WHERE desa = '%s' ) as foo
"""% nama_desa)
batas = bts.fetchall()
# batas_desa = json.loads(batas)
line_o = []
for i in batas:
o_pol1 = ''
o_poly = []
for x in json.loads(i[0])['coordinates']:
o_pol1 += (f'{x[0]},{x[1]}""')
o_pol2 = o_pol1.replace('""1',',1')
with conn.cursor() as kel:
kel.execute("SELECT json_build_object('type', 'Feature', 'administrasi', (kode_desa, desa, kecamatan, kab_kota, provinsi, jumlah_pen, jumlah_kk, luas_desa),'penduduk', (pria, wanita, belum_kawin, kawin, cerai_hidup, cerai_mati, wajib_ktp, islam, kristen, khatolik, hindu, budha, konghucu, kepercayaan_lain, u0, u5, u10, u15, u20, u25, u30, u35, u40, u45, u50, u55, u60, u65, u70, u75),'pekerjaan_pendidikan', (tidak_sekolah, belum_tamat, tamat_sd, sltp, slta, diploma_i, diploma_ii, diploma_iv, strata_ii, strata_iii, tidak_bekerja, aparatur_pemerintah, tenaga_pendidik, wiraswasta, pertanian, tenaga_kesehatan, pensiunan, pegawai, tentara, kepolisian, pedagang, petani, peternak, nelayan, karyawan, buruh, pembantu, tukang, pendeta, pastor, ustadz, dosen, guru, pilot, pengacara, notaris, arsitek, akuntan, konsultan, dokter, bidan, perawat, psikiater, sopir, lainnya),'geometry', ST_AsGeoJSON(geom :: geometry) :: json) from geo_data_kelurahan where id = %s"% int(id_desa))
kel_res_ = kel.fetchall()
o_poly.append(o_pol2.replace('""',''))
line_o.append(o_poly)
with conn.cursor() as desa:
desa.execute("""
SELECT
ST_AsGeoJson ( ST_centroid ( geom ) )
FROM
geo_data_kelurahan
WHERE
desa = '%s'"""% nama_desa)
lat_lng = desa.fetchall()
with conn.cursor() as bang:
bang.execute("""SELECT
json_build_object (
'type',
'Feature',
'properties',
( buildings.ID, buildings.NAME, buildings.information ),
'administrasi',
(
buildings.address_1,
buildings.address_2,
buildings.address_3,
buildings.provinsi,
buildings.alamat,
buildings.luas_bangunan,
buildings.luas_tanah,
buildings.tinggi_bangunan,
buildings.gambar,
buildings.pemilik
),
'geometry',
ST_AsGeoJSON ( buildings.geom :: geometry ) :: json
)
FROM
geo_bangunan buildings
JOIN geo_data_kelurahan desa ON st_intersects ( ST_SetSRID(desa.geom, 0), buildings.geom )
WHERE
desa.desa = '%s'"""% nama_desa)
kel_res = []
for i in kel_res_:
kel_res.append(i[0])
bangunan = bang.fetchall()
polygon_o = []
info_polygon = []
tinggi_pol = []
for i in bangunan:
o_pol1 = ''
o_poly = []
for x in i[0]['geometry']['coordinates'][0][0]:
o_pol1 += (f'{x[0]},{x[1]}""')
o_pol2 = o_pol1.replace('""1',',1')
data = {'result':kel_res}
return Response(data)
o_poly.append(o_pol2.replace('""',''))
polygon_o.append(o_poly)
tinggi_pol.append(i[0]['administrasi']['f8'])
info_polygon.append(i[0]['properties']['f1'])
# for i in batas:
# o_batas = ''
# o_poly_batas = []
# for x in i[0]['geometry']['coordinates'][0][0]:
# o_batas += (f'{x[0]},{x[1]}""')
# o_pol2 = o_pol1.replace('""1',',1')
# o_poly.append(o_pol2.replace('""',''))
# polygon_o.append(o_poly)
# tinggi_pol.append(i[0]['administrasi']['f8'])
# info_polygon.append(i[0]['properties']['f1'])
lat = json.loads(lat_lng[0][0])['coordinates'][0]
lng = json.loads(lat_lng[0][0])['coordinates'][1]
respon={'polygon_o':polygon_o,'tinggi_pol':tinggi_pol, 'info_polygon': info_polygon, 'lat':lat, 'lng':lng, 'line_o':line_o}
return Response(respon)
import random
......
{% for group in user.groups.all %} {% if group.name == 'Superadmin' %}
<style>
.leaflet-popup{
.leaflet-popup {
display: block;
}
#btn_edit_kelurahan {
display: block;
}
......@@ -14,7 +15,7 @@
#btn_edit_bangunan {
display: block;
}
#btn_delete_bangunan {
display: block;
}
......@@ -46,6 +47,7 @@
#btn_edit_adm {
display: block;
}
#btn_delete_adm {
display: block;
}
......@@ -69,8 +71,8 @@
#btn_edit_si {
display: block;
}
.leaflet-popup{
.leaflet-popup {
display: block;
}
</style>
......@@ -79,7 +81,7 @@
<script>
var kantor_administrasi = "{{ kantor_administrasi }}".replace(/&#x27;/g, '"');
var result_kan_adm = JSON.parse("" + kantor_administrasi + "")
console.log(result_kan_adm)
console.log(result_kan_adm)
geo_po_adm = L.geoJson(null, {
pointToLayer: function(feature, latlng) {
......@@ -275,8 +277,7 @@
offset: [0, 0]
});
return marker
}
else if (feature.administrasi.f2 == 'none') {
} else if (feature.administrasi.f2 == 'none') {
var smallIcon = new L.Icon({
iconSize: [20, 20],
iconAnchor: [13, 27],
......@@ -306,7 +307,7 @@
var geogeo = geocodeService.reverse().latlng(e.latlng).run(function(error, result) {
tay = result.address.Address;
console.log(feature.administrasi.f8)
// aladije(result.address.Address)
// aladije(result.address.Address)
if (feature.administrasi.f3 == 'alamat') {
if (tay != '') {
var alamak = tay;
......@@ -408,7 +409,7 @@
</div>
</tbody>
</table>`;
content_delete_adm = `
content_delete_adm = `
<div class="modal-dialog md">
<div class="modal-content">
<div class="modal-header bg-info" style="background-color: #40777c !important;">
......@@ -447,7 +448,7 @@
</div>
</div>
</div>`;
content_edit_adm = `
content_edit_adm = `
<div class="modal-dialog md">
<div class="modal-content">
<div class="modal-header bg-info" style="background-color: #40777c !important;">
......@@ -558,11 +559,11 @@
</div>
</div>
</div>`;
$("#isi_panel").html(content)
$("#modald_adm").html(content_delete_adm)
$("#modal_adm").html(content_edit_adm)
$("#isi_panel").html(content)
$("#modald_adm").html(content_delete_adm)
$("#modal_adm").html(content_edit_adm)
})
hidelegend();
}
})
......@@ -655,7 +656,7 @@
data.append('alamat', $('#alamat_adm_edit').val())
data.append('perangkat', $('#perangkat_adm_edit').val())
data.append('point', poi),
data.append('gambar', $('#gambar_adm_edit').val())
data.append('gambar', $('#gambar_adm_edit').val())
$.ajax({
url: "{% url 'api:kantor' %}",
......@@ -720,7 +721,7 @@
map_delete.setView([data['geometry']['coordinates'][1], data['geometry']['coordinates'][0]], 19);
let dapoin = [data['geometry']['coordinates'][1], data['geometry']['coordinates'][0]]
var poinin = L.marker(dapoin).addTo(map_delete)
// poinin.enableEdit();
// poinin.enableEdit();
$('#saveeditadm').click(function() {
var hasil = (JSON.stringify(poinin.toGeoJSON()))
$("#coordinateZoneedit_adm_del").val(hasil);
......@@ -1109,7 +1110,7 @@
data.append('alamat', $('#alamat_lk_edit').val())
data.append('perangkat', $('#perangkat_lk_edit').val())
data.append('point', poi),
data.append('gambar', $('#gambar_lk_edit').val())
data.append('gambar', $('#gambar_lk_edit').val())
$.ajax({
url: "{% url 'api:layanankesehatan' %}",
......@@ -1657,7 +1658,7 @@
</div>
</tbody>
</table>`;
content_edit_rs=`
content_edit_rs = `
<div class="modal-dialog md">
<div class="modal-content">
<div class="modal-header bg-info" style="background-color: #40777c !important;">
......@@ -2676,7 +2677,7 @@
data.append('alamat', $('#alamat_sp_edit').val())
data.append('perangkat', $('#perangkat_sp_edit').val())
data.append('point', poi),
data.append('gambar', $('#gambar_sp_edit').val())
data.append('gambar', $('#gambar_sp_edit').val())
$.ajax({
url: "{% url 'api:sekolah' %}",
......@@ -4411,7 +4412,7 @@
data.append('alamat', $('#alamat').val())
data.append('perangkat', $('#perangkat').val())
data.append('point', poi),
data.append('gambar', $('#gambar').val())
data.append('gambar', $('#gambar').val())
$.ajax({
url: "{% url 'api:gardu' %}",
......@@ -4483,18 +4484,18 @@
}
function showpanel(content) {
$("#button_hide_panel").css("display", "block")
// $("#thisFooter").css('left', '380px');
// $("#thisFooter").css('width', '930px');
//
$("#isi_panel").html(content);
}
function showlegend() {
$("#legendapo").css('display', 'block');
}
function hidelegend() {
......@@ -4518,14 +4519,14 @@
if ((checkBox1.checked == true) || (checkBox2.checked == true) || (checkBox3.checked == true) || (checkBox4.checked == true) || (checkBox5.checked == true) || (checkBox6.checked == true) || (checkBox7.checked == true) || (checkBox8.checked == true) || (checkBox9.checked == true) || (checkBox10.checked == true) || (checkBox11.checked == true) || (checkBox12.checked == true)) {
showlegend()
} else if ((checkBox1.checked == false) && (checkBox2.checked == false) && (checkBox3.checked == false) && (checkBox4.checked == false) && (checkBox5.checked == false) && (checkBox6.checked == false) && (checkBox7.checked == false) && (checkBox8.checked == false) && (checkBox9.checked == false) && (checkBox10.checked == false) && (checkBox11.checked == false) && (checkBox12.checked == false)) {
hidelegend()
}
}
......@@ -4543,10 +4544,10 @@
map.removeLayer(marques);
map.addLayer(marques);
map.removeLayer(xnxx);
$("#legendapo").css('display', 'block');
} else {
$("#legendapo").css('display', 'none');
map.removeLayer(marques);
}
......@@ -4604,175 +4605,229 @@
}
}
//3d begin
function map3d() {
var checkBox_3d = document.getElementById("3d-maps");
if (checkBox_3d.checked == true) {
$("#map").css('display', 'none');
$("#map-cesium").css('display', 'block');
//3d begin
Cesium.Ion.defaultAccessToken = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiJhOTc0NDkxMi02N2NkLTQwYjMtOTE1Yi1iMGNkZDU0Zjg3MGMiLCJpZCI6NDQ1ODgsImlhdCI6MTYxNDE0NjM5NH0.sRHzNNa7uV_huqGxERySWlL8J5UVx1VwU-pRwNd0GJk';
Cesium.Ion.defaultAccessToken = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiJhOTc0NDkxMi02N2NkLTQwYjMtOTE1Yi1iMGNkZDU0Zjg3MGMiLCJpZCI6NDQ1ODgsImlhdCI6MTYxNDE0NjM5NH0.sRHzNNa7uV_huqGxERySWlL8J5UVx1VwU-pRwNd0GJk';
var worldTerrain = new Cesium.ArcGISTiledElevationTerrainProvider({
url:
"https://elevation3d.arcgis.com/arcgis/rest/services/WorldElevation3D/Terrain3D/ImageServer",
});
var map_cesium = new Cesium.Viewer('map-cesium');
// var map_cesium = new Cesium.Viewer('map-cesium', {
// terrainProvider: worldTerrain,
// });
map_cesium.camera.flyTo({
destination: Cesium.Cartesian3.fromDegrees(104.171696, -4.120217, 10000)
});
map_cesium.camera.moveEnd.addEventListener(function() {
var windowPosition = new Cesium.Cartesian2(map_cesium.container.clientWidth / 2, map_cesium.container.clientHeight / 2);
var pickRay = map_cesium.scene.camera.getPickRay(windowPosition);
var pickPosition = map_cesium.scene.globe.pick(pickRay, map_cesium.scene);
var pickPositionCartographic = map_cesium.scene.globe.ellipsoid.cartesianToCartographic(pickPosition);
var longitudee = pickPositionCartographic.longitude * (180 / Math.PI);
var lattitudee = pickPositionCartographic.latitude * (180 / Math.PI);
// map_cesium.terrainProvider = worldTerrain;
console.log(lattitudee)
console.log(longitudee)
var map_cesium = new Cesium.Viewer('map-cesium');
//
$.ajax({
url: "{% url 'api:3d-maps' %}",
data: {
'latt': lattitudee,
'loog': longitudee
},
dataType: 'json',
success: function(data) {
for (var i = 0; i < data["polygon_o"].length; i++) {
polygon_oo = data["polygon_o"][i][0].replace(/&#x27;/g, '');
poll = JSON.parse("[" + polygon_oo + "]");
var poly_osm = map_cesium.entities.add({
polygon: {
hierarchy: Cesium.Cartesian3.fromDegreesArray(
poll
),
height: 0,
material: Cesium.Color.FLORALWHITE.withAlpha(0.7),
outline: true,
outlineColor: Cesium.Color.GREEN,
},
name: data["info_polygon"][i]
});
poly_osm.polygon.extrudedHeight = data["tinggi_pol"][i];
// poly_osm.polygon.extrudedHeight = 10;
// console.log(data["tinggi_pol"])
};
}
});
});
map_cesium.selectedEntityChanged.addEventListener(function(selectedEntity) {
if (Cesium.defined(selectedEntity)) {
if (Cesium.defined(selectedEntity.name)) {
var id_poly = selectedEntity.name
$.ajax({
url: "{% url 'api:edit' %}",
data: {
'id_poly': id_poly
},
dataType: 'json',
success: function(data) {
if (data['administrasi']['f9'] == 'None') {
var path_img = "static/img/image_null.jpg"
} else {
var path_img = `"static/image/bangunan/` + data['administrasi']['f9'] + `"`
}
content = `<table class="table table-hover 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: 237px;height:237">
</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;">
` + data['properties']['f2'] + `
</span>
</h1>
</div>
</th>
</tr>
</div>
<div class= "container">
<tr style="height: 30px;">
<th>
<span>
` + data['properties']['f3'] + `
</span>
</th>
</tr>
</div>
<div class= "container">
<tr style="height: 40px;">
<th>
<span>
` + data['administrasi']['f1'] + `, ` + data['administrasi']['f2'] + `, ` + data['administrasi']['f3'] + `, ` + data['administrasi']['f4'] + `
</span>
</th>
</tr>
</div>
<div class= "container">
<tr style="height: 40px;">
<th>
<p>
<span>Luas Bangunan : ` + data['administrasi']['f6'] + `</span>
</p>
<p>
<span>Luas Tanah : ` + data['administrasi']['f7'] + `</span>
</p>
<p>
<span>Tinggi Bangunan : ` + data['administrasi']['f8'] + `</span>
</p>
<p>
<span>Pemilik : ` + data['administrasi']['f10'] + `</span>
</p>
</th>
</tr>
</div>
</tbody>
</table>`;
$("#isi_panel").html(content)
//
//function mapsganti() {
// $("#modalsearch3d").modal()
//}
}
})
console.log('Selected ' + selectedEntity.name);
} else {
console.log('Unknown entity selected.');
function mapsganti() {
var checkBox_3d = document.getElementById("mapschange");
if (checkBox_3d.checked == true) {
$("#modalsearch3d").modal()
$.ajax({
url: "{% url 'api:search'%}",
data: {
'namadesa': 'search'
},
dataType: 'json',
success: function(response) {
var len = response['nama_des'].length;
var data_de = []
for (var i = 0; i < len; i++) {
var id = response['nama_des'][i][0];
var desa = response['nama_des'][i][1];
var kec = response['nama_des'][i][2];
var da = `<option value="` + desa + `,` + kec + `">` + desa + `,` + kec + `</option>`;
data_de.push(da)
}
} else {
console.log('Deselected.');
$("#search_desa").html(data_de);
}
});
})
} else {
//location.reload();
// $("#labelchange").html(`<h1 style="color: white;margin-top: 5px;margin-left: 8px;">
// 3D
//</h1>`)
//map_cesium.entities.removeAll();
//map_cesium.destroy();
setTimeout(function() {
map.invalidateSize();
}, 1000);
$("#map").css('display', 'block');
$(".no3d").css('display', 'block')
$("#map-cesium").css('display', 'none');
//$(".filter3d").removeClass("d3filter");
}
}
//3d end
$("#search3D").click(function() {
$("#map").css('display', 'none');
$("#map-cesium").css('display', 'block');
$(".no3d").css('display', 'none')
$("#labelchange").html(`<h1 style="color: white;margin-top: 5px;margin-left: 8px;">
2D
</h1>`)
var nama_desa = $("#search_desa").val();
$.ajax({
url: "{% url 'api:ressearch' %}",
data: {
'id_desa_search': nama_desa
},
dataType: 'json',
success: function(data) {
$("#modalsearch3d").modal("toggle")
console.log(data['polygon_o'])
console.log(data['line_o'])
map_cesium.camera.flyTo({
destination: Cesium.Cartesian3.fromDegrees(data['lat'], data['lng'], 750)
});
for (var i = 0; i < data["polygon_o"].length; i++) {
polygon_oo = data["polygon_o"][i][0].replace(/&#x27;/g, '');
poll = JSON.parse("[" + polygon_oo + "]");
var poly_osm = map_cesium.entities.add({
polygon: {
hierarchy: Cesium.Cartesian3.fromDegreesArray(
poll
),
height: 0,
material: Cesium.Color.FLORALWHITE.withAlpha(0.7),
outline: true,
outlineColor: Cesium.Color.GREEN,
},
name: data["info_polygon"][i]
});
poly_osm.polygon.extrudedHeight = data["tinggi_pol"][i];
// poly_osm.polygon.extrudedHeight = 10;
// console.log(data["tinggi_pol"])
};
for (var i = 0; i < data["line_o"].length; i++) {
line_oo = data["line_o"][i][0].replace(/&#x27;/g, '');
lin = JSON.parse("[" + line_oo + "]");
var redLine = map_cesium.entities.add({
polyline: {
positions: Cesium.Cartesian3.fromDegreesArray(
lin
),
width: 5,
material: Cesium.Color.RED,
clampToGround: true,
},
});
}
map_cesium.selectedEntityChanged.addEventListener(function(selectedEntity) {
if (Cesium.defined(selectedEntity)) {
if (Cesium.defined(selectedEntity.name)) {
var id_poly = selectedEntity.name
$.ajax({
url: "{% url 'api:edit' %}",
data: {
'id_poly': id_poly
},
dataType: 'json',
success: function(data) {
if (data['administrasi']['f9'] == 'None') {
var path_img = "static/img/image_null.jpg"
} else {
var path_img = `"static/image/bangunan/` + data['administrasi']['f9'] + `"`
}
content = `<table class="table table-hover 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: 237px;height:237">
</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;">
` + data['properties']['f2'] + `
</span>
</h1>
</div>
</th>
</tr>
</div>
<div class= "container">
<tr style="height: 30px;">
<th>
<span>
` + data['properties']['f3'] + `
</span>
</th>
</tr>
</div>
<div class= "container">
<tr style="height: 40px;">
<th>
<span>
` + data['administrasi']['f1'] + `, ` + data['administrasi']['f2'] + `, ` + data['administrasi']['f3'] + `, ` + data['administrasi']['f4'] + `
</span>
</th>
</tr>
</div>
<div class= "container">
<tr style="height: 40px;">
<th>
<p>
<span>Luas Bangunan : ` + data['administrasi']['f6'] + `</span>
</p>
<p>
<span>Luas Tanah : ` + data['administrasi']['f7'] + `</span>
</p>
<p>
<span>Tinggi Bangunan : ` + data['administrasi']['f8'] + `</span>
</p>
<p>
<span>Pemilik : ` + data['administrasi']['f10'] + `</span>
</p>
</th>
</tr>
</div>
</tbody>
</table>`;
$("#isi_panel").html(content)
}
})
console.log('Selected ' + selectedEntity.name);
} else {
console.log('Unknown entity selected.');
}
} else {
console.log('Deselected.');
}
});
}
});
});
function load3dbang() {
$(".label-bangunan").css("display", "none");
}
//3d end
var geocodeService = L.esri.Geocoding.geocodeService();
var geocoderNominatim = new L.Control.Geocoder.Nominatim();
......@@ -4816,22 +4871,22 @@
var path_img = `"static/image/bangunan/` + feature.administrasi.f9 + `"`
}
console.log(feature.administrasi.f11)
// if (feature.administrasi.f11 != 'None'){
// var cbb = `<option value="null" disabled>-- Pilih Jenis Point --</option>
// <option value="bangunan" `if(feature.administrasi.f11 != 'bangunan'){`selected`};` >Bangunan Biasa</option>
// <option value="kantor_administrasi">Kantor Administrasi</option>
// <option value="layanan_kesehatan">Layanan Kesehatan</option>
// <option value="puskesmas">Puskesmas</option>
// <option value="rumah_sakit">Rumah Sakit</option>
// <option value="sarana_ibadah">Sarana Ibadah</option>
// <option value="sarana_pendidikan">Sarana Pendidikan</option>
// <option value="spbu">SPBU</option>
// <option value="stasiun">Stasiun</option>
// <option value="terminal_bus">Terminal Bus</option>
// <option value="cagar_budaya">Cagar Budaya dan Tempat Wisata</option>
// <option value="gardu_listrik">Gardu Listrik</option>`
// }
// if (feature.administrasi.f11 != 'None'){
// var cbb = `<option value="null" disabled>-- Pilih Jenis Point --</option>
// <option value="bangunan" `if(feature.administrasi.f11 != 'bangunan'){`selected`};` >Bangunan Biasa</option>
// <option value="kantor_administrasi">Kantor Administrasi</option>
// <option value="layanan_kesehatan">Layanan Kesehatan</option>
// <option value="puskesmas">Puskesmas</option>
// <option value="rumah_sakit">Rumah Sakit</option>
// <option value="sarana_ibadah">Sarana Ibadah</option>
// <option value="sarana_pendidikan">Sarana Pendidikan</option>
// <option value="spbu">SPBU</option>
// <option value="stasiun">Stasiun</option>
// <option value="terminal_bus">Terminal Bus</option>
// <option value="cagar_budaya">Cagar Budaya dan Tempat Wisata</option>
// <option value="gardu_listrik">Gardu Listrik</option>`
// }
// var list_history = feature.properties.f7
// var list_history_panel = ``
......@@ -4871,7 +4926,7 @@
</div>
</div>
<div class="col-md-4">
<input type="text" class="hidden" name="coordinatebangunan" id="coordinatebangunan" value="`+feature.geometry+`">
<input type="text" class="hidden" name="coordinatebangunan" id="coordinatebangunan" value="` + feature.geometry + `">
<table>
<tr style="margin-top: 10px">
<th>
......@@ -4879,28 +4934,28 @@
</th>
<td>
<input type="file" id="imgbangunan" name="images[]" multiple accept="image/jpg,image/png,image/jpeg,image/gif">
<input style="display:none;" id="gambar" type="text" class="form-control" value="`+feature.administrasi.f9+`"required>
<input style="display:none;" id="gambar" type="text" class="form-control" value="` + feature.administrasi.f9 + `"required>
</td>
</tr>
<tr>
<td>
<input type="text" name="idbangunan" id="idbangunan" class="form-control hidden" value="`+feature.properties.f1+`" disable>
<input type="text" name="idbangunan" id="idbangunan" class="form-control hidden" value="` + feature.properties.f1 + `" disable>
<input style="display:none;" id="coordinateZoneeditbang" type="text" class="form-control" value=""required>
</td>
</tr>
<tr>
<th>Nama Bangunan</th>
<td>
<input type="text" name="namebangunan" id="namebangunan" class="form-control" value="`+feature.properties.f2+`">
<input type="text" name="namebangunan" id="namebangunan" class="form-control" value="` + feature.properties.f2 + `">
</td>
</tr>
<tr>
<th>Jenis Bangunan</th>
<td>
<input type="text" class="hidden" name="tipe1" id="tipe111" value="`+feature.administrasi.f11+`">
<input type="text" class="hidden" name="tipe1" id="tipe222" value="`+feature.administrasi.f12+`">
<input type="text" class="hidden" name="tipe1" id="tipe333" value="`+feature.administrasi.f13+`">
<input type="text" class="hidden" name="tipe1" id="tipe444" value="`+feature.administrasi.f14+`">
<input type="text" class="hidden" name="tipe1" id="tipe111" value="` + feature.administrasi.f11 + `">
<input type="text" class="hidden" name="tipe1" id="tipe222" value="` + feature.administrasi.f12 + `">
<input type="text" class="hidden" name="tipe1" id="tipe333" value="` + feature.administrasi.f13 + `">
<input type="text" class="hidden" name="tipe1" id="tipe444" value="` + feature.administrasi.f14 + `">
<select style="border-bottom: 1px solid rgb(83, 83, 83) !important;width: 220px;" id="tipe_point_b_e" data-placeholder="select point.." class="select-size-md">
<option value="null" selected disabled>-- Pilih Jenis Point --</option>
<option value="bangunan">Bangunan Biasa</option>
......@@ -4934,31 +4989,31 @@
<tr>
<th>Informasi Bangunan</th>
<td>
<input type="text" name="infobangunan" id="infobangunan" class="form-control" value="`+feature.properties.f3+`">
<input type="text" name="infobangunan" id="infobangunan" class="form-control" value="` + feature.properties.f3 + `">
</td>
</tr>
<tr>
<th>Kelurahan</th>
<td>
<input type=" text " name="nmkelurahan " id="nmkelurahan" class="form-control " value="`+feature.administrasi.f1+`">
<input type=" text " name="nmkelurahan " id="nmkelurahan" class="form-control " value="` + feature.administrasi.f1 + `">
</td>
</tr>
<tr>
<th>Kecamatan</th>
<td>
<input type="text " name="nmkecamatan " id="nmkecamatan" class="form-control " value="`+feature.administrasi.f2+`">
<input type="text " name="nmkecamatan " id="nmkecamatan" class="form-control " value="` + feature.administrasi.f2 + `">
</td>
</tr>
<tr>
<th>Kab/Kota</th>
<td>
<input type="text " name="nmkabkota " id="nmkabkota" class="form-control " value="`+feature.administrasi.f3+`">
<input type="text " name="nmkabkota " id="nmkabkota" class="form-control " value="` + feature.administrasi.f3 + `">
</td>
</tr>
<tr>
<th>Provinsi</th>
<td>
<input type="text " name="nmprovinsi " id="nmprovinsi" class="form-control " value="`+feature.administrasi.f4+`">
<input type="text " name="nmprovinsi " id="nmprovinsi" class="form-control " value="` + feature.administrasi.f4 + `">
</td>
</tr>
......@@ -4971,25 +5026,25 @@
<tr>
<th>Luas Bangunan</th>
<td>
<input type="text " name="luasbangunan " id="luasbangunan" class="form-control " value="`+feature.administrasi.f6+`">
<input type="text " name="luasbangunan " id="luasbangunan" class="form-control " value="` + feature.administrasi.f6 + `">
</td>
</tr>
<tr>
<th>Luas Tanah</th>
<td>
<input type="text " name="luastanah " id="luastanah" class="form-control " value="`+feature.administrasi.f7+`">
<input type="text " name="luastanah " id="luastanah" class="form-control " value="` + feature.administrasi.f7 + `">
</td>
</tr>
<tr>
<th>Tinggi Bangunan</th>
<td>
<input type="text " name="tinggibangunan " id="tinggibangunan" class="form-control " value="`+feature.administrasi.f8+`">
<input type="text " name="tinggibangunan " id="tinggibangunan" class="form-control " value="` + feature.administrasi.f8 + `">
</td>
</tr>
<tr>
<th>Pemilik</th>
<td>
<input type="text " name="pemilik " id="pemilik" class="form-control " value="`+feature.administrasi.f10+`">
<input type="text " name="pemilik " id="pemilik" class="form-control " value="` + feature.administrasi.f10 + `">
</td>
</tr>
</table>
......@@ -5003,7 +5058,7 @@
</div>
</div>
</div>`;
content_delete=`
content_delete = `
<div class="modal-dialog" style="width: max-content;height: max-content;">
<div class="modal-content">
<div class="modal-header bg-info" style="background-color:#40777c;">
......@@ -5019,9 +5074,9 @@
<div class="form-group">
<div class="col-lg-12" style="margin-top:10px;margin-bottom:10px;">
<input type="text" class="hidden" name="coordinatebangunan" id="coordinatebangunanhps" value="">
<input type="text" name="idbangunan" id="idbangunanhps" class="form-control hidden" value="`+feature.properties.f1+`" disable>
<input type="text" name="namebangunan" id="namebangunanhps" class="form-control" value="`+feature.properties.f2+`">
<input type="text" name="infobangunan" id="infobangunanhps" class="form-control" value="`+feature.properties.f3+`">
<input type="text" name="idbangunan" id="idbangunanhps" class="form-control hidden" value="` + feature.properties.f1 + `" disable>
<input type="text" name="namebangunan" id="namebangunanhps" class="form-control" value="` + feature.properties.f2 + `">
<input type="text" name="infobangunan" id="infobangunanhps" class="form-control" value="` + feature.properties.f3 + `">
</div>
</div>
</div>
......@@ -5263,7 +5318,7 @@
loaderPage(true);
var tipe1 = $('#tipe111').val();
$('#tipe_point_b_e option[value='+tipe1+']').attr('selected','selected');
$('#tipe_point_b_e option[value=' + tipe1 + ']').attr('selected', 'selected');
// $("#tipe_point_b_e option").val(tipe1).change();
$("#tipe_point_b_e").change(function() {
......@@ -5280,7 +5335,7 @@
var data_all_kab = []
for (var i = 0; i < data['result'].length; i++) {
var data_k = data['result'][i][0];
// if (feature.administrasi.f12 == data_k){
// var data_kab = `<option value="` + data_k + `" selected>` + data_k + `</option>`;
// } else{
......@@ -5298,8 +5353,8 @@
// $('#tipe_point_2_b_e option[value='+tipe2+']').attr('selected','selected');
if (tipe2 == 'null') {
$('#tipe_point_2_b_e').html(`<option value="null" selected disabled>-- Pilih Tipe Point --</option>`);
} else{
$('#tipe_point_2_b_e').html(`<option value="`+tipe2+`" selected disabled>`+tipe2+`</option>`);
} else {
$('#tipe_point_2_b_e').html(`<option value="` + tipe2 + `" selected disabled>` + tipe2 + `</option>`);
}
$("#tipe_point_2_b_e").change(function() {
......@@ -5321,7 +5376,7 @@
var data_po = data['result'][i][1];
console.log(data_id)
console.log(data_po)
var data_kab = `<option value="` +data_id + `">` + data_po + `</option>`;
var data_kab = `<option value="` + data_id + `">` + data_po + `</option>`;
data_all_kab.push(data_kab)
};
$('#tipe_point_3_b_e').html(`<option value="null" selected disabled>-- Pilih Point --</option>` + data_all_kab);
......@@ -5332,11 +5387,11 @@
var tipe3 = $('#tipe333').val();
var tipe4 = $('#tipe444').val();
// $('#tipe_point_3_b_e option[value='+tipe3+']').attr('selected','selected');
if (tipe3 == 'null') {
$('#tipe_point_3_b_e').html(`<option value="null" selected disabled>-- Pilih Point --</option>`);
} else{
$('#tipe_point_3_b_e').html(`<option value="`+tipe3+`" selected disabled>`+tipe4+`</option>`);
} else {
$('#tipe_point_3_b_e').html(`<option value="` + tipe3 + `" selected disabled>` + tipe4 + `</option>`);
}
$.ajax({
......@@ -5372,10 +5427,10 @@
})
}
})
});
$(document).on("click", "#btnsavebangunan", function() {
var data = new FormData();
......@@ -5535,42 +5590,41 @@
// ]).addTo(map_bang)
$(document).on("click", "#btn_perbaikan_bangunan", function() {
// if (map_bang.hasLayer(polyxxx)) {
// polyxxx.remove()
// }
// var id_polyx = $('#idbangunan').val();
// if (map_bang.hasLayer(polyxxx)) {
// polyxxx.remove()
// }
// var id_polyx = $('#idbangunan').val();
$("#input_perbaikan_bang").css("display", "block");
// $.ajax({
// url: "{% url 'apps:input-perbaikan-bang' %}",
// data: {
// 'id_bangunan': id_polyx
// },
// dataType: 'json',
// success: function(data) {
// $("#nama_bang").val(data[0]);
// $("#type_bang").val(data[1]);
// $("#id_bang_perbaikan").val(data[3]);
// $("#type_id_bang").val("1")
// var latlngs = data[2];
// map_bang.setView([latlngs['geometry']['coordinates'][0][0][1], latlngs['geometry']['coordinates'][0][0][0]], 19)
// let lop_poly_edit = data['geometry']['coordinates'][0][0];
// let list_poly_edit = [];
// for (var i = 0; i < lop_poly_edit.length; i++) {
// geoj = lop_poly_edit[i][0];
// polygigi = [lop_poly_edit[i][1], lop_poly_edit[i][0]]
// list_poly_edit.push(polygigi);
// };
// polylyly = L.polygon(list_poly_edit).addTo(map_bang)
// polylyly.enableEdit();
// var hasil = (JSON.stringify(polylyly.toGeoJSON()))
// }
// })
// $.ajax({
// url: "{% url 'apps:input-perbaikan-bang' %}",
// data: {
// 'id_bangunan': id_polyx
// },
// dataType: 'json',
// success: function(data) {
// $("#nama_bang").val(data[0]);
// $("#type_bang").val(data[1]);
// $("#id_bang_perbaikan").val(data[3]);
// $("#type_id_bang").val("1")
// var latlngs = data[2];
// map_bang.setView([latlngs['geometry']['coordinates'][0][0][1], latlngs['geometry']['coordinates'][0][0][0]], 19)
// let lop_poly_edit = data['geometry']['coordinates'][0][0];
// let list_poly_edit = [];
// for (var i = 0; i < lop_poly_edit.length; i++) {
// geoj = lop_poly_edit[i][0];
// polygigi = [lop_poly_edit[i][1], lop_poly_edit[i][0]]
// list_poly_edit.push(polygigi);
// };
// polylyly = L.polygon(list_poly_edit).addTo(map_bang)
// polylyly.enableEdit();
// var hasil = (JSON.stringify(polylyly.toGeoJSON()))
// }
// })
})
</script>
{% include 'includes/insert.html' %}
\ No newline at end of file
......@@ -1054,7 +1054,7 @@
var desa = response['nama_des'][i][1];
var kec = response['nama_des'][i][2];
var da = `<li value='` + id + `'>` + desa + `,` + kec + `</li>`;
var da = `<li value='` + desa + `,` + kec + `'>` + desa + `,` + kec + `</li>`;
data_de.push(da)
}
......@@ -1071,6 +1071,9 @@
});
//3d begin
function setsearch(element) {
var value = $(element).text();
......@@ -1086,11 +1089,8 @@
},
dataType: 'json',
success: function(response) {
var resultan = response['result'][0]
geo_json_search(resultan);
map.setView([resultan['geometry']['coordinates'][0][0][0][1], resultan['geometry']['coordinates'][0][0][0][0]], 14);
search_desa.addTo(map)
geo_batas.remove()
console.log(response)
}
});
}
......@@ -1467,7 +1467,7 @@
// } else {
// var path_img = `"static/image/bangunan/` + feature.administrasi.f9 + `"`
// }
// // var list_history = feature.properties.f7
// // var list_history_panel = ``
......
......@@ -579,9 +579,28 @@
</div>
</div>
<div class="modal fade" id="modalsearch3d" tabindex="-1" role="dialog">
<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>
</div>
<div class="modal-body">
<fieldset>
<select id="search_desa" placeholder="Pick a state..." style="width: 256px;height: 35px;">
</select>
<br>
</fieldset>
</div>
<div class="modal-footer">
<input class="btn btn-success btn-block" id="search3D" type="submit" value="Search">
</div>
</div>
</div>
</div>
</div>
<!--
<script>
$("#tipe_point").change(function() {
var tipe = $(this).val();
......@@ -609,4 +628,4 @@
}
});
});
</script>
\ No newline at end of file
</script> -->
\ No newline at end of file
......@@ -10,9 +10,11 @@
top: 7px;">
</i>
<!-- <i class="icon-location4 fa-gradient"></i> -->
<b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;OKU-GIS</b>
<b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Teman-KU
</b> (Sistem Informasi Pembangunan OKU)
</a>
<ul class="nav navbar-nav pull-right visible-xs-block">
<li><a data-toggle="collapse" data-target="#navbar-mobile"><i class="icon-tree5"></i></a></li>
</ul>
......
{% load static %}
<ul class="dock" style="right: 0;position: absolute;">
<li class="fixed-plugin" style="top: 100px;">
<li class="fixed-plugin" style="top: 50px;">
<div class="dropdown show-dropdown" style="top: 1px;">
<a href="#" type="checkbox">
<input type="checkbox" name="checkbox" onclick="mapsganti()" id="mapschange" style="position: absolute;opacity: 0;width: 48px;height: 30px;">
<div id="labelchange">
<h1 style="color: white;margin-top: 5px;margin-left: 8px;">
3D
</h1>
</div>
<!-- <i class="fa fa-map-o fa-2x" style="color: white;
margin: 10px 10px;
width: auto;"> </i> -->
</a>
</div>
</li>
<li class="fixed-plugin no3d" style="top: 110px;">
<div class="dropdown show-dropdown" style="top: 1px;">
<a href="#" data-toggle="dropdown">
<i class="fa fa-map-o fa-2x" style="color: white;
......@@ -55,9 +73,9 @@
</ul>
</div>
</li>
<li class="fixed-plugin" style="top: 160px;">
<li class="fixed-plugin no3d" style="top: 170px;">
<div class="dropdown show-dropdown">
<div class="dropdown show-dropdown ">
<a href="#" data-toggle="dropdown">
<i class="fa fa-cog fa-2x" style="font-size: 36px;
color: white;
......@@ -71,7 +89,6 @@
<div class="panel-body"> -->
<div class="row" style="margin: 0;padding: 0;">
<div class="col-md-6">
<div class="checkbox">
<label>
<input type="checkbox" id="geo_tuplah" onclick="geotuplah()" style="margin-top:2px;">
......@@ -79,14 +96,13 @@
</label>
</div>
<div class="checkbox">
<label>
<input type="checkbox" id="geo_building" style="margin-top:2px;">
Bangunan
</label>
</div>
<ul class="nasted active">
<!-- <ul class="nasted active">
<div class="checkbox">
<label>
<input type="checkbox" id="2d-maps" style="margin-top:2px;">
......@@ -99,13 +115,7 @@
Bangunan 3D Maps
</label>
</div>
</ul>
</ul> -->
<div class="checkbox">
<label>
<input type="checkbox" id="geo_jalan" onclick="geojalan()" style="margin-top:2px;">
......
......@@ -465,7 +465,7 @@
}
li.fixed-plugin .fa:hover {
transform: rotate(180deg);
transform: rotate(360deg);
transition: all 0.3s linear;
}
/*.move-btn .caret {*/
......@@ -683,10 +683,15 @@
<div class="row">
<div class="col-lg-12">
<div id="map">
</div>
<div id="map-cesium" style="z-index: -999; height: 605px; display:none"></div>
<div id="map-cesium" style="z-index: -999; height: 100vh; display:none">
<div class="label-bangunan" style="margin: 0px 0 0px 0px;padding-top: 55px;position: absolute;z-index: 1;right: 20px;">
<label style="background-color: white;">
&nbsp;&nbsp;left click + ctrl to rotate maps&nbsp;&nbsp;
</label>
</div>
<div class="page_loader_3d"></div>
</div>
</div>
</div>
</div>
......
......@@ -11,7 +11,7 @@
<link rel="stylesheet" href="https://unpkg.com/leaflet@1.7.1/dist/leaflet.css" />
<script src="https://unpkg.com/leaflet@1.7.1/dist/leaflet.js"></script>
<link rel="stylesheet" href="https://unpkg.com/leaflet.markercluster@1.4.1/dist/MarkerCluster.css">
<link rel="stylesheet" href="https://unpkg.com/leaflet.markercluster@1.4.1/dist/MarkerCluster.Default.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/leaflet.locatecontrol/dist/L.Control.Locate.min.css" />
......@@ -35,7 +35,7 @@
padding: 0;
height: 100%;
}
.modal-backdrop {
z-index: -999!important;
}
......@@ -57,14 +57,14 @@
margin-right: 0px;
}
.modal-colors{
.modal-colors {
background-color: #1a222f;
}
.lbl-top{
.lbl-top {
margin-top: 10px;
}
.select2-selection--multiple:not([class*=bg-]) .select2-selection__choice {
background-color: #eee;
color: #333333;
......@@ -72,7 +72,7 @@
margin-bottom: 3px;
border-radius: 0px;
}
.page_loader {
position: fixed;
background: url('../../static/img/loadingz.gif') 50% 50% no-repeat rgb(249, 249, 249);
......@@ -111,12 +111,19 @@
<!-- Main navbar -->
<div class="navbar navbar-inverse">
<div class="navbar-header">
<a class="navbar-brand" href="{% url 'apps:dashboard' %}">
<a class="navbar-brand gradient-text " href="{% url 'apps:dashboard' %}">
<!-- <h3>NationalAddress</h3> -->
<i class=" icon-location4"></i>
<b>&nbsp;&nbsp;OKU-GISs</b>
<i>
<img src="{% static 'img/logo-ok.png' %}" alt="" style="position: absolute;
width: 26px;
top: 7px;">
</i>
<!-- <i class="icon-location4 fa-gradient"></i> -->
<b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Teman-KU
</b> (Sistem Informasi Pembangunan OKU)
</a>
<ul class="nav navbar-nav pull-right visible-xs-block">
<li><a data-toggle="collapse" data-target="#navbar-mobile"><i class="icon-tree5"></i></a></li>
</ul>
......@@ -188,14 +195,14 @@
<!-- Main -->
<li class="navigation-header"> <i class="icon-menu" title="Main pages"></i></li>
<li><a href="?page=user" class="tablinks" id="defaultOpen"><i class="icon-user"></i><span>User Management</span></a></li>
<li><a href="?page=group" class="tablinks" id="defaultOpen"><i class="icon-users4"></i><span>Group</span></a></li>
<li><a href="?page=user" class="tablinks" id="defaultOpen"><i class="icon-user"></i><span>User Management</span></a></li>
<li><a href="?page=group" class="tablinks" id="defaultOpen"><i class="icon-users4"></i><span>Group</span></a></li>
<!-- <li><a class="tablinks" onclick="openInfo(event, 'info-penduduk')" id="defaultOpen"><span>Kependudukan</span></a></li>
<li><a class="tablinks" onclick="openInfo(event, 'info-pendidikan')" id="defaultOpen"><span>Pendidikan</span></a></li>
<li><a class="tablinks" onclick="openInfo(event, 'info-pekerjaan')" id="defaultOpen"><span>Pekerjaan</span></a></li>
<li><a class="tablinks" onclick="openInfo(event, 'info-poi')" id="defaultOpen"><span>POI</span></a></li> -->
<!-- /page kits -->
<!-- /page kits -->
</ul>
</div>
......@@ -260,12 +267,10 @@
{% if user.isactive == True %}
<span class="label label-success">
Active
</span>
{% else %}
</span> {% else %}
<span class="label label-danger">
Inactive
</span>
{% endif %}
</span> {% endif %}
</td>
<td class="text-center">
<ul class="icons-list">
......@@ -273,9 +278,9 @@
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
<i class="icon-menu9"></i>
</a>
<ul class="dropdown-menu dropdown-menu-right">
<li><a onclick="switchuserstatus('{{user.id}}, {{user.isactive}}')" ><i class="icon-user-block"></i> Switch user status</a></li>
<li><a onclick="switchuserstatus('{{user.id}}, {{user.isactive}}')"><i class="icon-user-block"></i> Switch user status</a></li>
<li><a onclick="loaduserbyid('{{user.id}}')"><i class="icon-users"></i> Edit user</a></li>
</ul>
</li>
......@@ -320,7 +325,7 @@
<hr style="margin-top: 0px;">
<div class="panel-body">
<table class="table table-responsive datatable-groups table-sm" id="usergroup" >
<table class="table table-responsive datatable-groups table-sm" id="usergroup">
<thead>
<tr>
<th>No.</th>
......@@ -339,9 +344,9 @@
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
<i class="icon-menu9"></i>
</a>
<ul class="dropdown-menu dropdown-menu-right">
<li><a onclick="deletegroup('{{group.id}}', '{{group.name}}')" ><i class="icon-user-block"></i> Delete group</a></li>
<li><a onclick="deletegroup('{{group.id}}', '{{group.name}}')"><i class="icon-user-block"></i> Delete group</a></li>
<li><a onclick="showmodalgroup('{{group.id}}', '{{group.name}}')"><i class="icon-users"></i> Edit group</a></li>
</ul>
</li>
......@@ -358,7 +363,7 @@
<!-- /main charts -->
</div>
</div>
<!-- /main content -->
</div>
<!-- /page content -->
......@@ -374,72 +379,72 @@
</div>
<div class="modal-body" style="max-height: 450px;overflow-y: auto;">
<input type="hidden" id="iduser">
<div class="row">
<div class="form-group">
<label class="col-lg-3 control-label lbl-top" >Username</label>
<div class="col-lg-9">
<input id="inUsername" type="text" class="form-control" value=""required>
</div>
<input type="hidden" id="iduser">
<div class="row">
<div class="form-group">
<label class="col-lg-3 control-label lbl-top">Username</label>
<div class="col-lg-9">
<input id="inUsername" type="text" class="form-control" value="" required>
</div>
</div>
<div class="row">
<div class="form-group">
<label class="col-lg-3 control-label lbl-top" >First Name</label>
<div class="col-lg-9">
<input id="inNameF" type="text" class="form-control" value=""required>
</div>
</div>
<div class="row">
<div class="form-group">
<label class="col-lg-3 control-label lbl-top">First Name</label>
<div class="col-lg-9">
<input id="inNameF" type="text" class="form-control" value="" required>
</div>
</div>
</div>
<div class="row">
<div class="form-group">
<label class="col-lg-3 control-label lbl-top" >Last Name</label>
<div class="col-lg-9">
<input id="inNameL" type="text" class="form-control" value=""required>
</div>
<div class="row">
<div class="form-group">
<label class="col-lg-3 control-label lbl-top">Last Name</label>
<div class="col-lg-9">
<input id="inNameL" type="text" class="form-control" value="" required>
</div>
</div>
<div class="row">
<div class="form-group">
<label class="col-lg-3 control-label lbl-top" >Email</label>
<div class="col-lg-9">
<input id="inEmail" type="text" class="form-control" value=""required>
</div>
</div>
<div class="row">
<div class="form-group">
<label class="col-lg-3 control-label lbl-top">Email</label>
<div class="col-lg-9">
<input id="inEmail" type="text" class="form-control" value="" required>
</div>
</div>
</div>
<div class="row" style="margin-top: 20px;">
<div class="form-group">
<label class="col-lg-3 control-label">Staff</label>
<div class="col-lg-9">
<label class="radio-inline">
<div class="row" style="margin-top: 20px;">
<div class="form-group">
<label class="col-lg-3 control-label">Staff</label>
<div class="col-lg-9">
<label class="radio-inline">
<input type="radio" class="styled" value="true" name="isStaff" checked="checked">
Ya
</label>
<label class="radio-inline">
<label class="radio-inline">
<input type="radio" class="styled" value="false" name="isStaff">
Tidak
</label>
</div>
</div>
</div>
<div class="row">
<div class="form-group" style="margin-top: 10px !important;">
<label class="col-lg-3 control-label lbl-top" >Groups</label>
<div class="col-lg-9" >
<select style="border-bottom: 1px solid rgb(83, 83, 83) !important;" id="select_group" data-placeholder="select group.." class="select-size-xs">
</div>
<div class="row">
<div class="form-group" style="margin-top: 10px !important;">
<label class="col-lg-3 control-label lbl-top">Groups</label>
<div class="col-lg-9">
<select style="border-bottom: 1px solid rgb(83, 83, 83) !important;" id="select_group" data-placeholder="select group.." class="select-size-xs">
<option></option>
</select>
</div>
</div>
</div>
</div>
</div>
<hr>
<div class="modal-footer">
......@@ -459,91 +464,91 @@
</div>
<div class="modal-body" style="max-height: 450px;overflow-y: auto;">
<input type="hidden" id="idgroup">
<input type="hidden" id="idgroup">
<div class="row">
<div class="form-group">
<label class="col-lg-3 control-label lbl-top" >Nama Group</label>
<div class="col-lg-9">
<input id="inGroupName" type="text" class="form-control" value=""required>
</div>
<div class="row">
<div class="form-group">
<label class="col-lg-3 control-label lbl-top">Nama Group</label>
<div class="col-lg-9">
<input id="inGroupName" type="text" class="form-control" value="" required>
</div>
</div>
</div>
<div class>
<div class>
<div class="row" id="container_sparent">
<div class="form-group" style="margin-top: 10px !important;">
<label class="col-lg-3 control-label lbl-top" >Group Parent</label>
<div class="col-lg-9" >
<label class="col-lg-3 control-label lbl-top">Group Parent</label>
<div class="col-lg-9">
<select style="border-bottom: 1px solid rgb(83, 83, 83) !important;" id="select_group_parent" data-placeholder="select group.." class="select-size-xs">
<option></option>
</select>
</div>
</div>
</div>
</div>
<hr>
<div class="modal-footer">
<button type="button" class="btn btn-link" data-dismiss="modal" onclick="destroyfade()">Close</button>
<button type="button" class="btn btn-info" id="savegroup">Save changes</button>
</div>
<hr>
<div class="modal-footer">
<button type="button" class="btn btn-link" data-dismiss="modal" onclick="destroyfade()">Close</button>
<button type="button" class="btn btn-info" id="savegroup">Save changes</button>
</div>
</div>
</div>
</div>
</div>
<div class="page_loader"></div>
<div class="page_loader"></div>
<!-- Core JS files -->
<script type="text/javascript" src="{% static 'js/plugins/loaders/pace.min.js' %}"></script>
<script type="text/javascript" src="{% static 'js/core/libraries/jquery.min.js' %}"></script>
<script type="text/javascript" src="{% static 'js/core/libraries/bootstrap.min.js' %}"></script>
<script type="text/javascript" src="{% static 'js/plugins/loaders/blockui.min.js' %}"></script>
<script type="text/javascript" src="{% static 'js/plugins/ui/nicescroll.min.js' %}"></script>
<script type="text/javascript" src="{% static 'js/plugins/ui/drilldown.js' %}"></script>
<!-- /core JS files -->
<!-- Core JS files -->
<script type="text/javascript" src="{% static 'js/plugins/loaders/pace.min.js' %}"></script>
<script type="text/javascript" src="{% static 'js/core/libraries/jquery.min.js' %}"></script>
<script type="text/javascript" src="{% static 'js/core/libraries/bootstrap.min.js' %}"></script>
<script type="text/javascript" src="{% static 'js/plugins/loaders/blockui.min.js' %}"></script>
<script type="text/javascript" src="{% static 'js/plugins/ui/nicescroll.min.js' %}"></script>
<script type="text/javascript" src="{% static 'js/plugins/ui/drilldown.js' %}"></script>
<!-- /core JS files -->
<script src="https://use.fontawesome.com/d232835e93.js"></script>
<script src="https://use.fontawesome.com/d232835e93.js"></script>
<script src="https://unpkg.com/leaflet.markercluster@1.4.1/dist/leaflet.markercluster.js"></script>
<!-- <script src="https://cdn.jsdelivr.net/npm/leaflet.locatecontrol/dist/L.Control.Locate.min.js" charset="utf-8"></script>
<script src="https://unpkg.com/leaflet.markercluster@1.4.1/dist/leaflet.markercluster.js"></script>
<!-- <script src="https://cdn.jsdelivr.net/npm/leaflet.locatecontrol/dist/L.Control.Locate.min.js" charset="utf-8"></script>
<script src="https://cdn.jsdelivr.net/npm/leaflet.locatecontrol/dist/L.Control.Locate.min.js" charset="utf-8"></script> -->
<script src="https://unpkg.com/esri-leaflet@2.5.1/dist/esri-leaflet.js"></script>
<script src="https://unpkg.com/esri-leaflet-geocoder@2.3.3/dist/esri-leaflet-geocoder.js"></script>
<script src="https://unpkg.com/leaflet-control-geocoder/dist/Control.Geocoder.js"></script>
<script src="https://code.jquery.com/jquery-3.5.1.js"></script>
<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/leaflet.draw/1.0.4/leaflet.draw-src.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/list.js/1.5.0/list.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/handlebars.js/4.7.6/handlebars.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/typeahead.js/0.11.1/typeahead.bundle.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/leaflet.fullscreen/1.4.2/Control.FullScreen.min.js"></script>
<!-- Theme JS files -->
<script type="text/javascript" src="{% static 'js/plugins/visualization/d3/d3.min.js' %}"></script>
<script type="text/javascript" src="{% static 'js/plugins/visualization/d3/d3_tooltip.js' %}"></script>
<script type="text/javascript" src="{% static 'js/plugins/forms/styling/switchery.min.js' %}"></script>
<script type="text/javascript" src="{% static 'js/plugins/forms/styling/uniform.min.js' %}"></script>
<script type="text/javascript" src="{% static 'js/plugins/forms/selects/bootstrap_multiselect.js' %}"></script>
<script type="text/javascript" src="{% static 'js/plugins/ui/moment/moment.min.js' %}"></script>
<script type="text/javascript" src="{% static 'js/plugins/pickers/daterangepicker.js' %}"></script>
<!-- <script type="text/javascript" src="{% static 'js/plugins/ui/ripple.min.js' %}"></script> -->
<!-- /theme JS files -->
{% include 'includes/scripts.html' %}
<script src="{% static 'js/leaflet-bing-layer.js' %}"></script>
<!-- <script src="https://unpkg.com/sweetalert/dists/sweetalert.min.js"></script> -->
<script type="text/javascript" src="{% static 'js/core/libraries/jquery_ui/interactions.min.js' %}"></script>
<script type="text/javascript" src="{% static 'js/plugins/forms/selects/select2.min.js' %}"></script>
<script type="text/javascript" src="{% static 'js/pages/form_select2.js' %}"></script>
<script src="https://unpkg.com/esri-leaflet@2.5.1/dist/esri-leaflet.js"></script>
<script src="https://unpkg.com/esri-leaflet-geocoder@2.3.3/dist/esri-leaflet-geocoder.js"></script>
<script src="https://unpkg.com/leaflet-control-geocoder/dist/Control.Geocoder.js"></script>
<script src="https://code.jquery.com/jquery-3.5.1.js"></script>
<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/leaflet.draw/1.0.4/leaflet.draw-src.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/list.js/1.5.0/list.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/handlebars.js/4.7.6/handlebars.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/typeahead.js/0.11.1/typeahead.bundle.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/leaflet.fullscreen/1.4.2/Control.FullScreen.min.js"></script>
<!-- Theme JS files -->
<script type="text/javascript" src="{% static 'js/plugins/visualization/d3/d3.min.js' %}"></script>
<script type="text/javascript" src="{% static 'js/plugins/visualization/d3/d3_tooltip.js' %}"></script>
<script type="text/javascript" src="{% static 'js/plugins/forms/styling/switchery.min.js' %}"></script>
<script type="text/javascript" src="{% static 'js/plugins/forms/styling/uniform.min.js' %}"></script>
<script type="text/javascript" src="{% static 'js/plugins/forms/selects/bootstrap_multiselect.js' %}"></script>
<script type="text/javascript" src="{% static 'js/plugins/ui/moment/moment.min.js' %}"></script>
<script type="text/javascript" src="{% static 'js/plugins/pickers/daterangepicker.js' %}"></script>
<!-- <script type="text/javascript" src="{% static 'js/plugins/ui/ripple.min.js' %}"></script> -->
<!-- /theme JS files -->
{% include 'includes/scripts.html' %}
<script src="{% static 'js/leaflet-bing-layer.js' %}"></script>
<!-- <script src="https://unpkg.com/sweetalert/dists/sweetalert.min.js"></script> -->
<script type="text/javascript" src="{% static 'js/core/libraries/jquery_ui/interactions.min.js' %}"></script>
<script type="text/javascript" src="{% static 'js/plugins/forms/selects/select2.min.js' %}"></script>
<script type="text/javascript" src="{% static 'js/pages/form_select2.js' %}"></script>
</body>
</html>
......@@ -555,7 +560,7 @@
// blah.src = URL.createObjectURL(fil)
// }
// }
jQuery(document).ajaxSend(function(event, xhr, settings) {
function getCookie(name) {
......@@ -613,139 +618,140 @@
const queryString = window.location.search;
const urlParams = new URLSearchParams(queryString);
const page = urlParams.get('page')
if(page == "group"){
if (page == "group") {
$("#usergroup").css("display", "block");
$("#info-maps").css("display", "none");
}else{
} else {
$("#usergroup").css("display", "none");
$("#info-maps").css("display", "block");
}
function destroyfade(){
$(".modal-backdrop").css("display","none")
function destroyfade() {
$(".modal-backdrop").css("display", "none")
$(".modal-backdrop").removeClass('show');
$("body").css('padding-right','0px !important')
$("body").css('padding-right', '0px !important')
}
$('.datatable-show-all').DataTable({
autoWidth: false,
columnDefs: [
{
columnDefs: [{
orderable: false,
width: '20px',
targets: [ 0 ],
targets: [0],
},
// {
// width: '100px',
// targets: [ 4 ]
// },
{
{
orderable: false,
width: '20px',
targets: [ 6 ],
},
{
targets: [6],
}, {
orderable: false,
width: '20px',
targets: [ 7 ],
targets: [7],
},
],
dom: '<"float-left"B>frtip',
buttons: [
{
text: 'Tambah User',
action: function ( e, dt, node, config ) {
$("#modalAddButton").click()
$("#inUsername").attr("disabled", false);
$("#inUsername").val(null);
$("#inNameF").val(null);
$("#inNameL").val(null);
$("#inEmail").val(null);
$("#iduser").val(null);
$(".modstit").html("Tambah User")
loadGroups(null)
}
buttons: [{
text: 'Tambah User',
action: function(e, dt, node, config) {
$("#modalAddButton").click()
$("#inUsername").attr("disabled", false);
$("#inUsername").val(null);
$("#inNameF").val(null);
$("#inNameL").val(null);
$("#inEmail").val(null);
$("#iduser").val(null);
$(".modstit").html("Tambah User")
loadGroups(null)
}
],
}],
language: {
search: '<span>Filter:</span> _INPUT_',
searchPlaceholder: 'Type to filter...',
lengthMenu: '<span>Show:</span> _MENU_',
paginate: { 'first': 'First', 'last': 'Last', 'next': '&rarr;', 'previous': '&larr;' }
paginate: {
'first': 'First',
'last': 'Last',
'next': '&rarr;',
'previous': '&larr;'
}
},
drawCallback: function () {
drawCallback: function() {
$(this).find('tbody tr').slice(-3).find('.dropdown, .btn-group').addClass('dropup');
},
preDrawCallback: function() {
$(this).find('tbody tr').slice(-3).find('.dropdown, .btn-group').removeClass('dropup');
}
});
$('.datatable-groups').DataTable({
autoWidth: false,
columnDefs: [
{
orderable: false,
width: '100px',
targets: [ 2 ]
},
{
orderable: false,
width: '100px',
targets: [ 0 ]
}
],
columnDefs: [{
orderable: false,
width: '100px',
targets: [2]
}, {
orderable: false,
width: '100px',
targets: [0]
}],
dom: '<"float-left"B>frtip',
buttons: [
{
text: 'Tambah Group',
action: function ( e, dt, node, config ) {
$("#modalAddButtong").click();
$("#idgroup").val(null);
$(".modstitg").html("Tambah Group")
$("#inGroupName").val(null)
$("#container_sparent").css("display", "block")
loadGroups(null)
}
buttons: [{
text: 'Tambah Group',
action: function(e, dt, node, config) {
$("#modalAddButtong").click();
$("#idgroup").val(null);
$(".modstitg").html("Tambah Group")
$("#inGroupName").val(null)
$("#container_sparent").css("display", "block")
loadGroups(null)
}
],
}],
language: {
search: '<span>Filter:</span> _INPUT_',
searchPlaceholder: 'Type to filter...',
lengthMenu: '<span>Show:</span> _MENU_',
paginate: { 'first': 'First', 'last': 'Last', 'next': '&rarr;', 'previous': '&larr;' }
paginate: {
'first': 'First',
'last': 'Last',
'next': '&rarr;',
'previous': '&larr;'
}
},
drawCallback: function () {
drawCallback: function() {
$(this).find('tbody tr').slice(-3).find('.dropdown, .btn-group').addClass('dropup');
},
preDrawCallback: function() {
$(this).find('tbody tr').slice(-3).find('.dropdown, .btn-group').removeClass('dropup');
}
});
$("#modalAddButton").click(function(){
$("body").css("padding-right","0px !important")
$("#modalAddButton").click(function() {
$("body").css("padding-right", "0px !important")
})
$("#saveuser").on("click", function(){
$("#saveuser").on("click", function() {
addUser()
})
function addUser(){
function addUser() {
var isObject = {};
var ars = ''
var ars = ''
var group = $("#select_group").val();
var iduser = $("#iduser").val();
console.log(group);
if(iduser){
if (iduser) {
isObject.id = iduser;
}
......@@ -757,16 +763,16 @@
// }
// }
// return false
isObject['username'] = $("#inUsername").val();
isObject['username'] = $("#inUsername").val();
isObject['first_name'] = $("#inNameF").val();
isObject['last_name'] = $("#inNameL").val();
isObject['email'] = $("#inEmail").val();
isObject.group = group
isObject.isStaff = $('input[name="isStaff"]:checked').val();
isObject['last_name'] = $("#inNameL").val();
isObject['email'] = $("#inEmail").val();
isObject.group = group
isObject.isStaff = $('input[name="isStaff"]:checked').val();
console.log(isObject);
$.ajax({
url: "{% url 'adduser' %}",
......@@ -776,38 +782,38 @@
success: function(data) {
let response = data;
if(response.code == 0){
if (response.code == 0) {
$("#modal_theme_info").modal('toggle');
destroyfade();
swal({
title : response.info,
text : response.data,
type : "success",
icon : "success",
title: response.info,
text: response.data,
type: "success",
icon: "success",
confirmButtonColor: "#00BCD4"
}).then((isok) => {
location.reload();
})
}else{
} else {
swal({
title : response.info,
text : response.data,
type : "alert",
icon : "error",
title: response.info,
text: response.data,
type: "alert",
icon: "error",
confirmButtonColor: "#00BCD4"
})
}
}
});
}
$("#select_group").on("click", function(e){
$("#select_group").on("click", function(e) {
e.preventDefault()
})
function loadGroups(isSelect){
function loadGroups(isSelect) {
var isObject = {}
console.log(isSelect)
isObject.func_name = "loadGroups";
......@@ -818,66 +824,66 @@
dataType: 'json',
type: 'post',
success: function(data) {
let response = data;
console.log(response)
if(response.code == 0){
if (response.code == 0) {
var groups = response.data;
var html = `<option value="null" selected disabled>-- Pilih Group --</option>`;
for(i in groups){
if(isSelect){
if(isSelect.length>=1){
for(j in isSelect){
if(isSelect[j] == groups[i]){
html += `<option value="`+groups[i]+`" selected>`+groups[i]+`</option>`;
var html = `<option value="null" selected disabled>-- Pilih Group --</option>`;
for (i in groups) {
if (isSelect) {
if (isSelect.length >= 1) {
for (j in isSelect) {
if (isSelect[j] == groups[i]) {
html += `<option value="` + groups[i] + `" selected>` + groups[i] + `</option>`;
console.log(groups[i])
}else{
html += `<option value="`+groups[i]+`">`+groups[i]+`</option>`;
} else {
html += `<option value="` + groups[i] + `">` + groups[i] + `</option>`;
}
}
}else{
html += `<option value="`+groups[i]+`">`+groups[i]+`</option>`;
} else {
html += `<option value="` + groups[i] + `">` + groups[i] + `</option>`;
}
}else{
html += `<option value="`+groups[i]+`">`+groups[i]+`</option>`;
} else {
html += `<option value="` + groups[i] + `">` + groups[i] + `</option>`;
}
}
$("#select_group").html(html);
$("#select_group_parent").html(html);
console.log(html)
}else{
} else {
$("#select_group").html("group tidak tersedia");
$("#select_group_parent").html("group tidak tersedia");
}
}
});
}
function switchuserstatus(id, isactive){
function switchuserstatus(id, isactive) {
var isObject = {}
var params = id.split(",");
isObject.id = params[0];
isObject.stat = params[1].replace(" ", "");
isObject.id = params[0];
isObject.stat = params[1].replace(" ", "");
console.log(params)
if(isObject.stat == "True"){
if (isObject.stat == "True") {
var title = "Nonaktifkan";
var text = "User tidak akan bisa login jika dinonaktifkan!";
}else{
var text = "User tidak akan bisa login jika dinonaktifkan!";
} else {
var title = "Aktifkan";
var text = "User dapat kembali login jika diaktifkan!";
var text = "User dapat kembali login jika diaktifkan!";
}
swal({
title: title+" user?",
title: title + " user?",
text: text,
type: "warning",
showCancelButton: true,
......@@ -886,48 +892,48 @@
cancelButtonText: "Tidak!",
closeOnConfirm: false,
closeOnCancel: false
}).then((isConfirm) =>{
}).then((isConfirm) => {
console.log(isConfirm)
if (isConfirm.value) {
$.ajax({
url: "{% url 'switchStatus' %}",
data: isObject,
dataType: 'json',
type: 'post',
success: function(data) {
let response = data;
if(isObject.stat == "True"){
if (isObject.stat == "True") {
var inf = "dinonaktifkan"
}else{
} else {
var inf = "diaktifkan"
}
if(response.code == 0){
if (response.code == 0) {
swal({
title : "sukses",
text : "User berhasil "+inf,
type : "success",
icon : "success",
confirmButtonColor: "#00BCD4"
}).then((isok) => {
location.reload();
})
}else{
title: "sukses",
text: "User berhasil " + inf,
type: "success",
icon: "success",
confirmButtonColor: "#00BCD4"
}).then((isok) => {
location.reload();
})
} else {
alert("no data in database")
}
}
});
} else {
swal("Dibatalkan", "User status tidak berubah", "error");
}
});
}
function loaduserbyid(id){
function loaduserbyid(id) {
var isObject = {};
$(".modstit").html("Update User")
$("#inUsername").attr("disabled", true)
......@@ -941,27 +947,27 @@
dataType: 'json',
type: 'post',
success: function(data) {
let response = data;
if(response.code == 0){
if (response.code == 0) {
var user = response.data;
console.log(user)
$("#inUsername").val(user.username);
$("#inNameF").val(user.firstname);
$("#inNameL").val(user.lastname);
$("#inEmail").val(user.email);
if(user.is_staff){
if (user.is_staff) {
$('input[name=isStaff][value=true]').attr('checked', true)
}else{
} else {
$('input[name=isStaff][value=false]').attr('checked', true)
}
loadGroups(user.group)
$("#modalAddButton").click()
}else{
} else {
}
}
});
}
......@@ -977,23 +983,23 @@
}
};
$("#savegroup").on("click", function(){
$("#savegroup").on("click", function() {
addGroup();
})
function addGroup(){
function addGroup() {
var isObject = {}
var idgroup = $("#idgroup").val();
var idgroup = $("#idgroup").val();
isObject.parent = $("#select_group_parent").val()
isObject.name = $("#inGroupName").val();
isObject.name = $("#inGroupName").val();
if(idgroup){
isObject.id = idgroup;
if (idgroup) {
isObject.id = idgroup;
}
console.log(isObject)
// return false
// return false
$.ajax({
url: "{% url 'addGroup' %}",
data: isObject,
......@@ -1002,34 +1008,34 @@
success: function(data) {
let response = data;
if(response.code == 0){
if (response.code == 0) {
$("#modal_group").modal('toggle');
destroyfade();
swal({
title : response.info,
text : response.data,
type : "success",
icon : "success",
title: response.info,
text: response.data,
type: "success",
icon: "success",
confirmButtonColor: "#00BCD4"
}).then((isok) => {
window.location.href = window.location.origin+"/usermanagement/?page=group"
window.location.href = window.location.origin + "/usermanagement/?page=group"
})
}else{
} else {
swal({
title : response.info,
text : response.data,
type : "alert",
icon : "error",
title: response.info,
text: response.data,
type: "alert",
icon: "error",
confirmButtonColor: "#00BCD4"
})
}
}
});
}
function showmodalgroup(id, name){
function showmodalgroup(id, name) {
console.log(id);
console.log(name);
......@@ -1037,7 +1043,7 @@
$("#inGroupName").val(name);
$(".modstitg").html("Edit Group");
// $("#modalAddButtong").click();
var isObject = {}
isObject.id = id
$.ajax({
......@@ -1048,43 +1054,43 @@
success: function(data) {
let response = data;
if(response.code == 0){
if (response.code == 0) {
var datas = response.data
if(datas.length == 0){
if (datas.length == 0) {
$("#container_sparent").css("display", "none")
}else{
} else {
$("#container_sparent").css("display", "block")
}
loadGroups(datas)
$("#modalAddButtong").click();
}else{
} else {
swal({
title : response.info,
text : response.data,
type : "alert",
icon : "error",
title: response.info,
text: response.data,
type: "alert",
icon: "error",
confirmButtonColor: "#00BCD4"
})
}
}
});
}
function deletegroup(id, group){
function deletegroup(id, group) {
var isObject = {}
var params = id;
var params = id;
isObject.id = params;
isObject.id = params;
swal({
title: "Hapus group?",
text: "Group "+group+" akan dihapus",
text: "Group " + group + " akan dihapus",
type: "warning",
showCancelButton: true,
confirmButtonClass: "btn-danger",
......@@ -1092,39 +1098,39 @@
cancelButtonText: "Tidak!",
closeOnConfirm: false,
closeOnCancel: false
}).then((isConfirm) =>{
}).then((isConfirm) => {
console.log(isConfirm)
if (isConfirm.value) {
$.ajax({
url: "{% url 'deleteGroup' %}",
data: isObject,
dataType: 'json',
type: 'post',
success: function(data) {
let response = data;
if(response.code == 0){
if (response.code == 0) {
swal({
title : "sukses",
text : "Group berhasil dihapus",
type : "success",
icon : "success",
confirmButtonColor: "#00BCD4"
}).then((isok) => {
location.reload();
})
}else{
title: "sukses",
text: "Group berhasil dihapus",
type: "success",
icon: "success",
confirmButtonColor: "#00BCD4"
}).then((isok) => {
location.reload();
})
} else {
alert("no data in database")
}
}
});
} else {
swal("Dibatalkan", "User status tidak berubah", "error");
}
});
}
</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