Commit 46d3747e authored by Muhamad's avatar Muhamad

USER PROFILE

parent 6298bfae
......@@ -73,4 +73,5 @@ urlpatterns = [
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)
]
\ No newline at end of file
......@@ -2961,47 +2961,47 @@ def user_data(request):
with conn.cursor() as po:
po.execute("""
SELECT id, namobj, alamat, luas_bangunan, perangkat
SELECT id, namobj, alamat, luas_bangunan, perangkat ,'geo_kantor_administrasi'
FROM
geo_kantor_administrasi
UNION
SELECT id, namobj, alamat, luas_bangunan, perangkat
SELECT id, namobj, alamat, luas_bangunan, perangkat, 'geo_layanan_kesehatan'
FROM
geo_layanan_kesehatan
UNION
SELECT id, namobj, alamat, luas_bangunan, perangkat
SELECT id, namobj, alamat, luas_bangunan, perangkat, 'geo_puskesmas'
FROM
geo_puskesmas
UNION
SELECT id, namobj, alamat, luas_bangunan, perangkat
SELECT id, namobj, alamat, luas_bangunan, perangkat, 'geo_rumah_sakit'
FROM
geo_rumah_sakit
UNION
SELECT id, namobj, alamat, luas_bangunan, perangkat
SELECT id, namobj, alamat, luas_bangunan, perangkat, 'geo_sarana_ibadah'
FROM
geo_sarana_ibadah
UNION
SELECT id, namobj, alamat, luas_bangunan, perangkat
SELECT id, namobj, alamat, luas_bangunan, perangkat, 'geo_sarana_pendidikan'
FROM
geo_sarana_pendidikan
UNION
SELECT id, namobj, alamat, luas_bangunan, perangkat
SELECT id, namobj, alamat, luas_bangunan, perangkat, 'geo_spbu'
FROM
geo_spbu
UNION
SELECT id, namobj, alamat, luas_bangunan, perangkat
SELECT id, namobj, alamat, luas_bangunan, perangkat, 'geo_stasiun'
FROM
geo_stasiun
UNION
SELECT id, namobj, alamat, luas_bangunan, perangkat
SELECT id, namobj, alamat, luas_bangunan, perangkat, 'geo_terminal_bus'
FROM
geo_terminal_bus
UNION
SELECT id, namobj, alamat, luas_bangunan, perangkat
SELECT id, namobj, alamat, luas_bangunan, perangkat, 'geo_cagar_budaya'
FROM
geo_cagar_budaya
UNION
SELECT id, namobj, alamat, luas_bangunan, perangkat
SELECT id, namobj, alamat, luas_bangunan, perangkat, 'geo_gardu_listrik'
FROM
geo_gardu_listrik
""")
......@@ -3015,7 +3015,8 @@ def user_data(request):
"nama_tempat":p[1],
"alamat":p[2],
"luas":p[3],
"pj":p[4]
"pj":p[4],
"table":p[5]
}
point.append(datap)
......@@ -3349,3 +3350,27 @@ def search_lanjut(request):
kills = data_jal
return Response(kills)
@api_view(('GET',))
def load_point_id(request):
id = request.GET.get('idx')
dtb = request.GET.get('db')
with conn.cursor() as poi:
poi.execute("""
SELECT json_build_object (
'type',
'Feature',
'properties',
(id, namobj, alamat, luas_bangunan, perangkat),
'geometry',
ST_AsGeoJSON ( geom :: geometry ) :: json
)
FROM
%s
WHERE
id = %s
"""%(dtb, id))
poin = poi.fetchall()
context = {'result':poin}
return Response(context)
\ No newline at end of file
......@@ -21,5 +21,6 @@ urlpatterns = [
path('get-jalan-perbaikan', views.getjalanperbaikan, name='get-jalan-perbaikan'),
path('get-detail-perbaikan', views.getdetailperbaikan, name='get-detail-perbaikan'),
path('get-detail-perbaikan-bang', views.getdetailperbaikanbangunan, name='get-detail-perbaikan-bang'),
path('loadPointbyId', views.loadPointbyId)
]
\ No newline at end of file
......@@ -504,6 +504,7 @@ class Dashboard(generic.TemplateView):
}
res_all.append(data_all)
if request.user.is_authenticated:
current_user = request.user
thisUser = current_user.id
......@@ -531,7 +532,7 @@ class Dashboard(generic.TemplateView):
user_data.append(datas)
with conn.cursor() as userlist_:
if request.user.is_superuser:
if request.user.is_superuser or request.user.is_staff:
# print("is superuser")
sql = """
SELECT
......@@ -556,7 +557,6 @@ class Dashboard(generic.TemplateView):
ORDER BY
au.username ASC"""
else:
if request.user.is_staff:
sql = """
SELECT
au.id,
......@@ -579,8 +579,6 @@ class Dashboard(generic.TemplateView):
ag.id = aug.group_id AND
ORDER BY
au.username ASC"""
else:
print('not staff')
userlist_.execute(sql)
allUser = userlist_.fetchall()
......@@ -598,6 +596,12 @@ class Dashboard(generic.TemplateView):
}
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"}]
context = {
'title':'Dashboard',
'kelurahan':kel_res,
......@@ -1256,3 +1260,13 @@ def editkelurahan(request):
prov = res_edit_poly[0][0]['administrasi'][4]
context = {'desa':desa, 'kec':kec, 'kab':kab, 'prov':prov,'result_poly': res_edit_poly[0][0], 'avg_la':avg_la, 'avg_lo':avg_lo}
return Response(context)
@api_view(('GET',))
def loadPointbyId(request):
tab = request.GET.get("db")
id = request.GET.get("idx")
tipe = request.GET.get("type")
print(tab, id, tipe)
context = {'result':'result'}
return Response(context)
\ No newline at end of file
......@@ -759,6 +759,10 @@ li.active>a:after {
border-bottom-right-radius: 10px;
}
#maps_detail_p>div.leaflet-control-container>div.leaflet-top.leaflet-left>div>div {
display: none;
}
@media (max-width: 1025px) {
.dock {
position: absolute;
......
This diff is collapsed.
This diff is collapsed.
......@@ -669,6 +669,7 @@
<script>
$("#sel-kec ").change(function() {
$("#list_perbaikan").removeClass("datatable-show-all")
var id_kec = $(this).val()
......@@ -679,6 +680,7 @@
},
dataType: 'json',
success: function(data) {
$("#list_perbaikan").addClass("datatable-kecamatan")
var data_all_desa = []
for (var i = 0; i < data['res_kel'].length; i++) {
var id_k = data['res_kel'][i][0];
......@@ -729,6 +731,43 @@
};
$("#tbody_perbaikan").html(data_perbaikan)
$('.datatable-kecamatan').DataTable({
autoWidth: false,
columnDefs: [{
orderable: false,
width: '20px',
targets: [0],
}, {
orderable: false,
width: '20px',
targets: [6],
}, {
orderable: false,
width: '20px',
targets: [7],
}, ],
dom: '<"float-left "B>frtip',
language: {
search: ' _INPUT_',
searchPlaceholder: 'Data Perbaikan...',
lengthMenu: '<span>Show:</span><hr> _MENU_',
paginate: {
'first': 'First',
'last': 'Last',
'next': '&rarr;',
'previous': '&larr;'
}
},
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');
}
});
}
});
......@@ -785,6 +824,7 @@
$("#tbody_perbaikan ").html(data_perbaikan)
}
});
......
......@@ -246,7 +246,7 @@
</div>
<div style="margin-bottom: 10px;">
<a href="#" class="btn btn-default" style="background-color: #ffffff;
<!-- <a href="#" class="btn btn-default" style="background-color: #ffffff;
border: 1px solid #dadce0;
-webkit-border-radius: 100px;
border-radius: 100px;
......@@ -260,7 +260,7 @@
padding: 8px 16px;
text-align: center;
text-decoration: none;
text-overflow: ellipsis;" id="pengaturan_btn" data-toggle="modal" data-target="#user_profile" data-backdrop="static" data-keyboard="false">Pengaturan</a>
text-overflow: ellipsis;" id="pengaturan_btn" data-toggle="modal" data-target="#user_profile" data-backdrop="static" data-keyboard="false">Pengaturan</a> -->
</div>
</div>
......@@ -270,7 +270,7 @@
<li>
<div style="border-bottom: 0.5px solid #DCDCDC;margin-bottom:10px;">
<div style="margin-bottom: 10px;">
<a href="{% url 'usermanagement' %}" style=" background-color: #ffffff;
<a href="#" style=" background-color: #ffffff;
color: #3c4043;
display: table;
font: 500 14px/16px Google Sans,Roboto,RobotoDraft,Helvetica,Arial,sans-serif;
......@@ -279,7 +279,7 @@
padding: 14px 41px;
text-align: center;
text-decoration: none;
width: 100%;"><i class="icon-user"></i>&nbsp;&nbsp;Kelola User</a>
width: 100%;" id="pengaturan_btn" data-toggle="modal" data-target="#user_profile" data-backdrop="static" data-keyboard="false"><i class="icon-user"></i>&nbsp;&nbsp;PENGATURAN</a>
</div>
</div>
</li>
......
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