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

konflik js-m

parents 696fadf2 18486b82
......@@ -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")
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()
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 = []
kel_res = []
for i in kel_res_:
kel_res.append(i[0])
for x in json.loads(i[0])['coordinates']:
o_pol1 += (f'{x[0]},{x[1]}""')
data = {'result':kel_res}
return Response(data)
o_pol2 = o_pol1.replace('""1',',1')
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)
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')
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;
}
......@@ -46,6 +47,7 @@
#btn_edit_adm {
display: block;
}
#btn_delete_adm {
display: block;
}
......@@ -70,7 +72,7 @@
display: block;
}
.leaflet-popup{
.leaflet-popup {
display: block;
}
</style>
......@@ -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],
......@@ -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;">
......@@ -4604,46 +4605,88 @@
}
}
//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';
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)
});
//
//function mapsganti() {
// $("#modalsearch3d").modal()
//}
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)
function mapsganti() {
var checkBox_3d = document.getElementById("mapschange");
if (checkBox_3d.checked == true) {
$("#modalsearch3d").modal()
$.ajax({
url: "{% url 'api:3d-maps' %}",
url: "{% url 'api:search'%}",
data: {
'latt': lattitudee,
'loog': longitudee
'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)
}
$("#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");
}
}
$("#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 + "]");
......@@ -4664,9 +4707,23 @@
// 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)) {
......@@ -4747,10 +4804,6 @@
</tbody>
</table>`;
$("#isi_panel").html(content)
}
})
console.log('Selected ' + selectedEntity.name);
......@@ -4762,17 +4815,19 @@
}
});
} else {
//map_cesium.entities.removeAll();
//map_cesium.destroy();
setTimeout(function() {
map.invalidateSize();
}, 1000);
$("#map").css('display', 'block');
$("#map-cesium").css('display', 'none');
}
});
});
function load3dbang() {
$(".label-bangunan").css("display", "none");
}
//3d end
//3d end
var geocodeService = L.esri.Geocoding.geocodeService();
var geocoderNominatim = new L.Control.Geocoder.Nominatim();
......@@ -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>
......@@ -5370,7 +5425,12 @@
loaderPage(true);
var tipe1 = $('#tipe111').val();
<<<<<<< HEAD
$('#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();
>>>>>>> 18486b82a9845aa577f0dadfb192db38146dcdcf
$("#tipe_point_b_e").change(function() {
$('#tipe_point_2_b_e').empty();
......@@ -5405,8 +5465,8 @@
var tipe2 = $('#tipe222').val();
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() {
......@@ -5429,7 +5489,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);
......@@ -5439,11 +5499,16 @@
var tipe3 = $('#tipe333').val();
var tipe4 = $('#tipe444').val();
<<<<<<< HEAD
=======
// $('#tipe_point_3_b_e option[value='+tipe3+']').attr('selected','selected');
>>>>>>> 18486b82a9845aa577f0dadfb192db38146dcdcf
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({
......@@ -5482,6 +5547,11 @@
});
<<<<<<< HEAD
=======
>>>>>>> 18486b82a9845aa577f0dadfb192db38146dcdcf
$(document).on("click", "#btnsavebangunan", function() {
var data = new FormData();
data.append("file", $("input[id^='imgbangunan']")[0].files[0]);
......@@ -5651,6 +5721,7 @@
// }).addTo(map_bang);
$(document).on("click", "#btn_perbaikan_bangunan", function() {
<<<<<<< HEAD
var map_bang = new L.map('map-insert-renov-bang', {
editable: true,
zoomControl: false,
......@@ -5662,12 +5733,19 @@
minZoom: 4,
}).addTo(map_bang);
=======
// if (map_bang.hasLayer(polyxxx)) {
// polyxxx.remove()
// }
// var id_polyx = $('#idbangunan').val();
>>>>>>> 18486b82a9845aa577f0dadfb192db38146dcdcf
$("#input_perbaikan_bang").css("display", "block");
if (map_bang.hasLayer(polyxxx)) {
polyxxx.remove()
}
var id_polyx = $('#idbangunan').val();
<<<<<<< HEAD
$.ajax({
url: "{% url 'apps:input-perbaikan-bang' %}",
data: {
......@@ -5802,5 +5880,37 @@
})
});
=======
// $.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()))
// }
// })
})
>>>>>>> 18486b82a9845aa577f0dadfb192db38146dcdcf
</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)
}
});
}
......
......@@ -699,9 +699,28 @@
</div>
</div>
</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>
<!--
<script>
$("#tipe_point").change(function() {
var tipe = $(this).val();
......@@ -729,4 +748,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>
......
......@@ -57,11 +57,11 @@
margin-right: 0px;
}
.modal-colors{
.modal-colors {
background-color: #1a222f;
}
.lbl-top{
.lbl-top {
margin-top: 10px;
}
......@@ -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>
......@@ -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">
......@@ -275,7 +280,7 @@
</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>
......@@ -341,7 +346,7 @@
</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>
......@@ -378,36 +383,36 @@
<div class="row">
<div class="form-group">
<label class="col-lg-3 control-label lbl-top" >Username</label>
<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>
<input id="inUsername" 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" >First Name</label>
<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>
<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>
<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>
<input id="inNameL" 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" >Email</label>
<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>
<input id="inEmail" type="text" class="form-control" value="" required>
</div>
</div>
</div>
......@@ -431,8 +436,8 @@
<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" >
<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>
......@@ -463,9 +468,9 @@
<div class="row">
<div class="form-group">
<label class="col-lg-3 control-label lbl-top" >Nama Group</label>
<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>
<input id="inGroupName" type="text" class="form-control" value="" required>
</div>
</div>
</div>
......@@ -474,8 +479,8 @@
<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>
......@@ -614,28 +619,27 @@
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],
},
// {
......@@ -645,21 +649,19 @@
{
orderable: false,
width: '20px',
targets: [ 6 ],
targets: [6],
},
{
}, {
orderable: false,
width: '20px',
targets: [ 7 ],
targets: [7],
},
],
dom: '<"float-left"B>frtip',
buttons: [
{
buttons: [{
text: 'Tambah User',
action: function ( e, dt, node, config ) {
action: function(e, dt, node, config) {
$("#modalAddButton").click()
$("#inUsername").attr("disabled", false);
$("#inUsername").val(null);
......@@ -670,15 +672,19 @@
$(".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() {
......@@ -690,23 +696,19 @@
$('.datatable-groups').DataTable({
autoWidth: false,
columnDefs: [
{
columnDefs: [{
orderable: false,
width: '100px',
targets: [ 2 ]
},
{
targets: [2]
}, {
orderable: false,
width: '100px',
targets: [ 0 ]
}
],
targets: [0]
}],
dom: '<"float-left"B>frtip',
buttons: [
{
buttons: [{
text: 'Tambah Group',
action: function ( e, dt, node, config ) {
action: function(e, dt, node, config) {
$("#modalAddButtong").click();
$("#idgroup").val(null);
$(".modstitg").html("Tambah Group")
......@@ -714,15 +716,19 @@
$("#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() {
......@@ -731,21 +737,21 @@
});
$("#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 group = $("#select_group").val();
var iduser = $("#iduser").val();
console.log(group);
if(iduser){
if (iduser) {
isObject.id = iduser;
}
......@@ -776,25 +782,25 @@
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"
})
......@@ -803,11 +809,11 @@
});
}
$("#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";
......@@ -821,28 +827,28 @@
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>`;
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>`;
}
}
......@@ -850,7 +856,7 @@
$("#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");
}
......@@ -860,7 +866,7 @@
}
function switchuserstatus(id, isactive){
function switchuserstatus(id, isactive) {
var isObject = {}
var params = id.split(",");
......@@ -868,16 +874,16 @@
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{
} else {
var title = "Aktifkan";
var text = "User dapat kembali login jika diaktifkan!";
}
swal({
title: title+" user?",
title: title + " user?",
text: text,
type: "warning",
showCancelButton: true,
......@@ -886,7 +892,7 @@
cancelButtonText: "Tidak!",
closeOnConfirm: false,
closeOnCancel: false
}).then((isConfirm) =>{
}).then((isConfirm) => {
console.log(isConfirm)
if (isConfirm.value) {
......@@ -899,22 +905,22 @@
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",
title: "sukses",
text: "User berhasil " + inf,
type: "success",
icon: "success",
confirmButtonColor: "#00BCD4"
}).then((isok) => {
location.reload();
})
}else{
} else {
alert("no data in database")
}
......@@ -927,7 +933,7 @@
}
function loaduserbyid(id){
function loaduserbyid(id) {
var isObject = {};
$(".modstit").html("Update User")
$("#inUsername").attr("disabled", true)
......@@ -944,21 +950,21 @@
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,18 +983,18 @@
}
};
$("#savegroup").on("click", function(){
$("#savegroup").on("click", function() {
addGroup();
})
function addGroup(){
function addGroup() {
var isObject = {}
var idgroup = $("#idgroup").val();
isObject.parent = $("#select_group_parent").val()
isObject.name = $("#inGroupName").val();
if(idgroup){
if (idgroup) {
isObject.id = idgroup;
}
......@@ -1002,25 +1008,25 @@
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"
})
......@@ -1029,7 +1035,7 @@
});
}
function showmodalgroup(id, name){
function showmodalgroup(id, name) {
console.log(id);
console.log(name);
......@@ -1048,12 +1054,12 @@
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")
}
......@@ -1061,12 +1067,12 @@
$("#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"
})
......@@ -1076,7 +1082,7 @@
}
function deletegroup(id, group){
function deletegroup(id, group) {
var isObject = {}
var params = id;
......@@ -1084,7 +1090,7 @@
swal({
title: "Hapus group?",
text: "Group "+group+" akan dihapus",
text: "Group " + group + " akan dihapus",
type: "warning",
showCancelButton: true,
confirmButtonClass: "btn-danger",
......@@ -1092,7 +1098,7 @@
cancelButtonText: "Tidak!",
closeOnConfirm: false,
closeOnCancel: false
}).then((isConfirm) =>{
}).then((isConfirm) => {
console.log(isConfirm)
if (isConfirm.value) {
......@@ -1105,17 +1111,17 @@
let response = data;
if(response.code == 0){
if (response.code == 0) {
swal({
title : "sukses",
text : "Group berhasil dihapus",
type : "success",
icon : "success",
title: "sukses",
text: "Group berhasil dihapus",
type: "success",
icon: "success",
confirmButtonColor: "#00BCD4"
}).then((isok) => {
location.reload();
})
}else{
} else {
alert("no data in database")
}
......
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