Commit 19bec183 authored by Muhamad's avatar Muhamad

upgrade .js scripts_js_m scripts_js_o scripts_layout, dll

parent 12b4d15f
......@@ -7,7 +7,7 @@ from django.contrib.auth.decorators import login_required
app_name = 'api'
urlpatterns = [
path('search_auto', views.search_auto, name='search'),
path('search_auto', views.search_auto),
path('kantor_administrasi', views.kantor_administrasi, name='kantor_administrasi'),
path('layanan_kesehatan', views.layanan_kesehatan, name='layanan_kesehatan'),
......@@ -30,7 +30,7 @@ urlpatterns = [
path('edit', views.editpoly, name='edit'),
path('validatedit', views.validatedit, name='validatedit'),
path('hapus', views.hapus, name='hapus'),
path('hasilsearch', views.hasilsearch, name='ressearch'),
path('ressearch', views.hasilsearch, name='ressearch'),
path('editkependudukan/', views.editkependudukan, name='kependudukan'),
......@@ -83,13 +83,12 @@ urlpatterns = [
path('3d-maps', views.maps3d, name='3d-maps'),
path('deletejalan', views.deletejalan, name='hapus-jalan'),
path('hapus-jalan', views.deletejalan, name='hapus-jalan'),
path('filt_perbaikan_kecamatan', views.filt_perbaikan_kecamatan),
path('filt_perbaikan_desa', views.filt_perbaikan_desa),
path('user-data', views.user_data, name='user-data'),
path('deletejalan', views.deletejalan, name='hapus-jalan'),
path('search_spes', views.search_spes, name='search_spes'),
path('search_lanjut', views.search_lanjut, name='search_lanjut'),
path('load_point_id', views.load_point_id),
......
......@@ -16,9 +16,9 @@ class Dashboard(generic.TemplateView):
# @method_decorator(login_required(login_url='/login/'))
def get(self, request):
# print(Group.objects.get(user=request.user))
# with conn.cursor() as all_:
# all_.execute("SELECT * from global_oku")
# all = all_.fetchall()
with conn.cursor() as all_:
all_.execute("SELECT * from global_oku")
all = all_.fetchall()
# 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, gambar),'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), 'poi',(jml_puskesma, jml_sekolah, jml_sarib),'geometry', ST_AsGeoJSON(geom :: geometry) :: json) from geo_data_kelurahan")
......@@ -502,105 +502,105 @@ class Dashboard(generic.TemplateView):
# }
# res_all.append(data_all)
# perm_group = []
# if request.user.is_authenticated:
# current_user = request.user
# thisUser = current_user.id
# for xx in request.user.get_group_permissions():
# perm_group.append(xx.split(".")[1])
# if thisUser == None:
# user_data = {"filepath":'placeholder.jpg'}
# else:
# # print()
# sql = "select * from auth_user where id = "+str(thisUser)
# with conn.cursor() as userprop:
# userprop.execute(sql)
# us = userprop.fetchall()
# user_data = []
# for row in us:
# datas = {
# "id": row[0],
# "username": row[4],
# "firstname": row[5],
# "lastname": row[6],
# "email" : row[7],
# "filepath": row[11],
# # "password": row[1]
# }
perm_group = []
if request.user.is_authenticated:
current_user = request.user
thisUser = current_user.id
for xx in request.user.get_group_permissions():
perm_group.append(xx.split(".")[1])
if thisUser == None:
user_data = {"filepath":'placeholder.jpg'}
else:
# print()
sql = "select * from auth_user where id = "+str(thisUser)
with conn.cursor() as userprop:
userprop.execute(sql)
us = userprop.fetchall()
user_data = []
for row in us:
datas = {
"id": row[0],
"username": row[4],
"firstname": row[5],
"lastname": row[6],
"email" : row[7],
"filepath": row[11],
# "password": row[1]
}
# user_data.append(datas)
user_data.append(datas)
# with conn.cursor() as userlist_:
# if request.user.is_superuser or request.user.is_staff:
# # print("is superuser")
# sql = """
# SELECT
# au.id,
# au.username,
# au.first_name,
# au.last_name,
# au.is_active,
# au.last_login,
# au.email,
# ag.name,
# au.is_staff,
# au.is_superuser,
# au.file_path
# FROM
# auth_user au,
# auth_user_groups aug,
# auth_group ag
# WHERE
# au.id = aug.user_id AND
# ag.id = aug.group_id
# ORDER BY
# au.username ASC"""
# else:
# sql = """
# SELECT
# au.id,
# au.username,
# au.first_name,
# au.last_name,
# au.is_active,
# au.last_login,
# au.email,
# ag.name,
# au.is_staff,
# au.is_superuser,
# au.file_path
# FROM
# auth_user au,
# auth_user_groups aug,
# auth_group ag
# WHERE
# au.id = aug.user_id AND
# ag.id = aug.group_id
# ORDER BY
# au.username ASC"""
# userlist_.execute(sql)
# allUser = userlist_.fetchall()
# user_res = []
# for rows in allUser:
# datas = {
# "id": rows[0],
# "username": rows[1],
# "name": rows[2] +" "+ rows[3],
# "email": rows[6],
# "isactive": rows[4],
# "last": rows[5],
# "group": rows[7],
# "filepath": rows[10]
# }
# user_res.append(datas)
with conn.cursor() as userlist_:
if request.user.is_superuser or request.user.is_staff:
# print("is superuser")
sql = """
SELECT
au.id,
au.username,
au.first_name,
au.last_name,
au.is_active,
au.last_login,
au.email,
ag.name,
au.is_staff,
au.is_superuser,
au.file_path
FROM
auth_user au,
auth_user_groups aug,
auth_group ag
WHERE
au.id = aug.user_id AND
ag.id = aug.group_id
ORDER BY
au.username ASC"""
else:
sql = """
SELECT
au.id,
au.username,
au.first_name,
au.last_name,
au.is_active,
au.last_login,
au.email,
ag.name,
au.is_staff,
au.is_superuser,
au.file_path
FROM
auth_user au,
auth_user_groups aug,
auth_group ag
WHERE
au.id = aug.user_id AND
ag.id = aug.group_id
ORDER BY
au.username ASC"""
userlist_.execute(sql)
allUser = userlist_.fetchall()
user_res = []
for rows in allUser:
datas = {
"id": rows[0],
"username": rows[1],
"name": rows[2] +" "+ rows[3],
"email": rows[6],
"isactive": rows[4],
"last": rows[5],
"group": rows[7],
"filepath": rows[10]
}
user_res.append(datas)
# else:
# user_data = [{"id":"Not Login", "username":"Not Login", "firstname":"Not Login", "lastname":"Not Login","email":"Not Login","filepath":"Not Login"}]
# user_res = [{"id":"Not Login", "username":"Not Login", "name":"Not Login", "isactive":"Not Login","email":"Not Login","last":"Not Login", "group":"Not Login", "filepath":"Not Login"}]
else:
user_data = [{"id":"Not Login", "username":"Not Login", "firstname":"Not Login", "lastname":"Not Login","email":"Not Login","filepath":"Not Login"}]
user_res = [{"id":"Not Login", "username":"Not Login", "name":"Not Login", "isactive":"Not Login","email":"Not Login","last":"Not Login", "group":"Not Login", "filepath":"Not Login"}]
......@@ -619,11 +619,11 @@ class Dashboard(generic.TemplateView):
# 'terminal':terminal_result,
# 'cagar_budaya':cagar_budaya_result,
# 'gardu_listrik':gardu_listrik_result,
# 'global':all[0],
'global':all[0],
# 'res_all':res_all,
# 'thisUser' : user_data,
# 'perm_group' : perm_group
# 'user_res':user_res
'thisUser' : user_data,
'perm_group' : perm_group,
'user_res':user_res
}
return render (request, self.template_name, context)
......
......@@ -1340,7 +1340,7 @@ function l_kes() {
if (checkBox.checked == true) {
// loaderPage(true);
$.ajax({
url: "api/layanan_kesehatan'%}",
url: "api/layanan_kesehatan",
dataType: 'json',
type: 'GET',
success: function(response) {
......@@ -1790,7 +1790,7 @@ function pks() {
if (checkBox.checked == true) {
// loaderPage(true);
$.ajax({
url: "api/apiviewpuskesmas'%}",
url: "api/apiviewpuskesmas",
dataType: 'json',
type: 'GET',
success: function(response) {
......@@ -2225,7 +2225,7 @@ function rs() {
if (checkBox.checked == true) {
// loaderPage(true);
$.ajax({
url: "api/rumah_sakit'%}",
url: "api/rumah_sakit",
dataType: 'json',
type: 'GET',
success: function(response) {
......@@ -2781,7 +2781,7 @@ function fiksi() {
if (checkBox.checked == true) {
// loaderPage(true);
$.ajax({
url: "api/sarana_ibadah'%}",
url: "api/sarana_ibadah",
dataType: 'json',
type: 'GET',
success: function(response) {
......@@ -3319,7 +3319,7 @@ function didik() {
if (checkBox.checked == true) {
// loaderPage(true);
$.ajax({
url: "api/sarana_pendidikan'%}",
url: "api/sarana_pendidikan",
dataType: 'json',
type: 'GET',
success: function(response) {
......@@ -5710,15 +5710,24 @@ function swiftAlert(itype, ititle, itext) {
// var map_cesium = new Cesium.Viewer('map-cesium');
function mapsganti() {
// $.getScript('/static/Cesium-185/Build/Cesium/Cesium.js', function() {
// });
// $.getScript('/static/Cesium-185/Build/Cesium/Cesium.js');
var checkBox_3d = document.getElementById("mapschange");
$('#scrcesium').append('<script id="scrheadcesium" src="/static/Cesium-185/Build/Cesium/Cesium.js"><\/script>');
var map_cesium = new Cesium.Viewer('map-cesium', {
imageryProvider: new Cesium.BingMapsImageryProvider({
url: '//dev.virtualearth.net',
key: 'Anj9XBZaRShAMdbXJlZ16iqEVpjikY1eY_dzqGl451WYkSKV3l_FJaFgMbhwdbLz',
mapStyle: Cesium.BingMapsStyle.AERIAL
//url : '//services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer',
//url : Cesium.buildModuleUrl('/static/Cesium-185/Build/Cesium/Assets/Textures/NaturalEarthII')
}),
baseLayerPicker: false,
geocoder: false
});
if (checkBox_3d.checked == true) {
$("#modalsearch3d").modal()
$.ajax({
url: "api/search",
url: "api/search_auto",
data: {
'namadesa': 'search'
},
......
......@@ -857,6 +857,9 @@ function batasdesa() {
var checkBox = document.getElementById("batas_desa");
if (checkBox.checked == true) {
// loaderPage(true);
$('#scrapex').append(`<script id="idscrapexmin" type="text/javascript " src="static/js/apexcharts.min.js"><\/script>`);
$('#scrapex').append(`<script id="idscrapex" type="text/javascript " src="static/js/apexcharts.js"><\/script>`);
if (map.hasLayer(geo_batas_kel)) {
geo_batas_kel.clearLayers()
geo_batas_kel.remove()
......
......@@ -374,14 +374,16 @@
<!-- <script type="text/javascript" src="{% static 'js/pages/form_checkboxes_radios.js' %}"></script> -->
<!-- <script type="text/javascript " src="{% static 'js/apexcharts.min.js' %}"></script>
<script type="text/javascript " src="{% static 'js/apexcharts.js' %}"></script> -->
<script type="text/javascript " src="{% static 'js/plugins/tables/datatables/datatables.min.js' %} "></script>
<script type="text/javascript " src="{% static 'js/plugins/forms/selects/select2.min.js' %} "></script>
<!-- <script type="text/javascript" src="{% static 'js/plugins/media/cropper.min.js' %}"></script>
<script type="text/javascript" src="{% static 'js/pages/extension_image_cropper.js' %}"></script> -->
<!-- /theme JS files -->
<div id ='scrapex'></div>
<div id ='scrcesium'></div>
<div id='scrapex'></div>
<div id='scrcesium'></div>
<!-- <script type="text/javascript " src="{% static 'js/plugins/tables/datatables/datatables.min.js' %} "></script> -->
<script type="text/javascript " src="{% static 'js/plugins/forms/selects/select2.min.js' %} "></script>
......@@ -390,8 +392,16 @@
<script type="text/javascript" src="{% static 'js/maps.js' %}"></script>
<script src="{% static 'js/scripts.js' %}"></script>
<script src="http://code.jquery.com/ui/1.10.2/jquery-ui.js"></script>
{% include 'includes/permission.html' %} {% include 'includes/js-o.html' %} {% include 'includes/js-m.html' %}
{% include 'includes/permission.html' %}
<script type="text/javascript" src="{% static 'js/action.js' %}"></script>
<script src="{% static 'js/scripts_js_o.js' %}"></script>
<script src="{% static 'js/scripts_js_m.js' %}"></script>
<script src="{% static 'js/action.js' %}"></script>
<script src="{% static 'js/scripts_sidebar.js' %}"></script>
<script>
// start disabled inspect
......@@ -2549,147 +2559,12 @@
$(".tombol-edit").html('ilang')
</script>
{% endif %}
{% include 'includes/permission.html' %}
<script src="{% static 'js/scripts_js_o.js' %}"></script>
<script src="{% static 'js/scripts_js_m.js' %}"></script>
<script src="{% static 'js/action.js' %}"></script>
<script src="{% static 'js/scripts_layout.js' %}"></script>
<script src="{% static 'js/scripts_sidebar.js' %}"></script>
</body>
</html>{% include 'includes/js-m.html' %}
<script>
// start disabled inspect
// document.addEventListener('contextmenu', function(e) {
// e.preventDefault();
// });
// document.onkeydown = function(e) {
// if(event.keyCode == 123) {
// return false;
// }
// if(e.ctrlKey && e.shiftKey && e.keyCode == 'I'.charCodeAt(0)) {
// return false;
// }
// if(e.ctrlKey && e.shiftKey && e.keyCode == 'C'.charCodeAt(0)) {
// return false;
// }
// if(e.ctrlKey && e.shiftKey && e.keyCode == 'J'.charCodeAt(0)) {
// return false;
// }
// if(e.ctrlKey && e.keyCode == 'U'.charCodeAt(0)) {
// return false;
// }
// }
// end disabled inspect
</script>
<!-- <script>
$(function() {
// Switchery
// ------------------------------
// Initialize multiple switches
if (Array.prototype.forEach) {
var elems = Array.prototype.slice.call(document.querySelectorAll('.switchery'));
elems.forEach(function(html) {
var switchery = new Switchery(html);
});
}
else {
var elems = document.querySelectorAll('.switchery');
for (var i = 0; i < elems.length; i++) {
var switchery = new Switchery(elems[i]);
}
}
// Colored switches
var primary = document.querySelector('.switchery-primary');
var switchery = new Switchery(primary, { color: '#2196F3' });
var danger = document.querySelector('.switchery-danger');
var switchery = new Switchery(danger, { color: '#EF5350' });
var warning = document.querySelector('.switchery-warning');
var switchery = new Switchery(warning, { color: '#FF7043' });
var info = document.querySelector('.switchery-info');
var switchery = new Switchery(info, { color: '#00BCD4'});
// Checkboxes/radios (Uniform)
// ------------------------------
// Default initialization
$(".styled, .multiselect-container input").uniform({
radioClass: 'choice'
});
// File input
$(".file-styled").uniform({
wrapperClass: 'bg-blue',
fileButtonHtml: '<i class="icon-file-plus"></i>'
});
//
// Contextual colors
//
// Primary
$(".control-primary").uniform({
radioClass: 'choice',
wrapperClass: 'border-primary-600 text-primary-800'
});
// Danger
$(".control-danger").uniform({
radioClass: 'choice',
wrapperClass: 'border-danger-600 text-danger-800'
});
// Success
$(".control-success").uniform({
radioClass: 'choice',
wrapperClass: 'border-success-600 text-success-800'
});
// Warning
$(".control-warning").uniform({
radioClass: 'choice',
wrapperClass: 'border-warning-600 text-warning-800'
});
// Info
$(".control-info").uniform({
radioClass: 'choice',
wrapperClass: 'border-info-600 text-info-800'
});
// Custom color
$(".control-custom").uniform({
radioClass: 'choice',
wrapperClass: 'border-indigo-600 text-indigo-800'
});
// Bootstrap switch
// ------------------------------
$(".switch").bootstrapSwitch();
});
</script> -->
</html>
<style>
@media (max-width: 720px) {
#map>div.row>div.col-sm-4.input-group.content-group.head {
......
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