Commit 6298bfae authored by Muhamad's avatar Muhamad

downloader user list, downloader point list

parent 19264452
...@@ -72,7 +72,5 @@ urlpatterns = [ ...@@ -72,7 +72,5 @@ urlpatterns = [
path('user-data', views.user_data, name='user-data'), path('user-data', views.user_data, name='user-data'),
path('deletejalan', views.deletejalan, name='hapus-jalan'), path('deletejalan', views.deletejalan, name='hapus-jalan'),
path('search_spes', views.search_spes, name='search_spes'), path('search_spes', views.search_spes, name='search_spes'),
path('search_lanjut', views.search_lanjut, name='search_lanjut') path('search_lanjut', views.search_lanjut, name='search_lanjut'),
] ]
\ No newline at end of file
...@@ -2913,7 +2913,8 @@ def user_data(request): ...@@ -2913,7 +2913,8 @@ def user_data(request):
WHERE WHERE
au.id = aug.user_id AND au.id = aug.user_id AND
ag.id = aug.group_id AND ag.id = aug.group_id AND
ag.id IN("""+ars+")" ORDER BY
au.username ASC"""
else: else:
print('not staff') print('not staff')
userlist_.execute(sql) userlist_.execute(sql)
...@@ -2959,7 +2960,51 @@ def user_data(request): ...@@ -2959,7 +2960,51 @@ def user_data(request):
with conn.cursor() as po: with conn.cursor() as po:
po.execute("select id, namobj, alamat, luas_bangunan, perangkat from geo_kantor_administrasi") po.execute("""
SELECT id, namobj, alamat, luas_bangunan, perangkat
FROM
geo_kantor_administrasi
UNION
SELECT id, namobj, alamat, luas_bangunan, perangkat
FROM
geo_layanan_kesehatan
UNION
SELECT id, namobj, alamat, luas_bangunan, perangkat
FROM
geo_puskesmas
UNION
SELECT id, namobj, alamat, luas_bangunan, perangkat
FROM
geo_rumah_sakit
UNION
SELECT id, namobj, alamat, luas_bangunan, perangkat
FROM
geo_sarana_ibadah
UNION
SELECT id, namobj, alamat, luas_bangunan, perangkat
FROM
geo_sarana_pendidikan
UNION
SELECT id, namobj, alamat, luas_bangunan, perangkat
FROM
geo_spbu
UNION
SELECT id, namobj, alamat, luas_bangunan, perangkat
FROM
geo_stasiun
UNION
SELECT id, namobj, alamat, luas_bangunan, perangkat
FROM
geo_terminal_bus
UNION
SELECT id, namobj, alamat, luas_bangunan, perangkat
FROM
geo_cagar_budaya
UNION
SELECT id, namobj, alamat, luas_bangunan, perangkat
FROM
geo_gardu_listrik
""")
poi = po.fetchall() poi = po.fetchall()
point = [] point = []
...@@ -2980,7 +3025,6 @@ def user_data(request): ...@@ -2980,7 +3025,6 @@ def user_data(request):
'point':point 'point':point
} }
return Response(respon) return Response(respon)
return Response(respon)
@api_view(('GET',)) @api_view(('GET',))
def search_spes(request): def search_spes(request):
......
This diff is collapsed.
This diff is collapsed.
...@@ -115,79 +115,6 @@ $("#manage_perbaikan").click(function() { ...@@ -115,79 +115,6 @@ $("#manage_perbaikan").click(function() {
$("#perbaikan-dashboard").toggleClass("perbaikan-dashboard"); $("#perbaikan-dashboard").toggleClass("perbaikan-dashboard");
// var content_perbaikan = `
// <div id="panel-samping-child" class="sidebar-2" style="background: #1B1F2D;position: absolute;z-index: 9;width: 23%;height:100vh;left: -30%;transition: all 0.5s ease;">
// <div style="margin-left: 50px;background: #1B1F2D;">
// <div class="header" style="margin-top: 25px;background: #2F3445;">
// <h6 class="panel-title" style="color: #ffff;margin-left: 20px;font-size: 12pt;">Laporan Perbaikan<a class="heading-elements-toggle"><i class="icon-more"></i></a></h6>
// </div>
// <div class="bod" style="margin-top: 10px;margin-left:6px;">
// <div style="color: white;">
// <span>Filter:</span>
// </div>
// <div class="form-group" style="margin-top: 15px;width: 250px;">
// <select name="select" id="sel-kec" class="form-control input-sm" style="background-color: #393E54;border-radius: 8px;border-color: #393E54;color: white;">
// <option value="opt1">Pilih Kecamatan</option>
// <option value="opt1">Pilih Kecamatan</option>
// <option value="opt1">Pilih Kecamatan</option>
// {% for nama_kecamatan in kec_res %}
// {% endfor %}
// </select>
// </div>
// <div class="form-group" style="margin-top: 15px;width: 250px;">
// <select name="select" id="sel-desa" class="form-control input-sm" style="background-color: #393E54;border-radius: 8px;border-color: #393E54;color: white;">
// <option value="opt1">Pilih Desa</option>
// </select>
// </div>
// </div>
// </div>
// </div>
// <div class="panel panel-flat" id="perbaikan-dashboard" style="background: #181B27;position: absolute;z-index: 9;width: 77%;height:100vh;left: 23%;transition: all 0.5s ease;color: white; border: none;">
// <div class="panel-heading" style="background-color:#181B27;border-bottom: 0.5pt solid #313649;">
// <h6 class="panel-title">Table Data Perbaikan</h6>
// </div>
// <div class="panel-body">
// <table class="table table-responsive datatable-show-all table-sm" id="userList" style="word-wrap:break-word;">
// <thead>
// <tr>
// <th>No.</th>
// <th>Sarana Perbaiakn</th>
// <th>Nama</th>
// <th>Type</th>
// <th>Tanggal Mulai</th>
// <th>Tanggal Selesai</th>
// <th>Anggaran</th>
// <th>Keterangan</th>
// </tr>
// </thead>
// <tbody id="loop-perbaikan">
// {% for all in res_all %}
// <tr>
// <td>{{forloop.counter}}</td>
// <td>{{all.name_perbaikan}}</td>
// <td>{{all.name}}</td>
// <td>{{all.type}}</td>
// <td>{{all.tgl_perbaikan}}</td>
// <td>{{all.tgl_selesai}}</td>
// <td>{{all.anggaran}}</td>
// <td class="text-center">
// <a class="mdlFire" onclick="loadjlbyid('{{all.id_object}}')" data-toggle="modal" data-target="#modal_detail">Detail</a>
// </td>
// </tr>
// {% endfor %}
// </tbody>
// </table>
// </div>
// </div>`;
// $("#panel-samping").html(content_perbaikan)
}) })
......
...@@ -92,7 +92,6 @@ ...@@ -92,7 +92,6 @@
<script> <script>
var kantor_administrasi = "{{ kantor_administrasi }}".replace(/&#x27;/g, '"'); var kantor_administrasi = "{{ kantor_administrasi }}".replace(/&#x27;/g, '"');
console.log(kantor_administrasi)
var result_kan_adm = JSON.parse("" + kantor_administrasi + "") var result_kan_adm = JSON.parse("" + kantor_administrasi + "")
...@@ -7165,7 +7164,7 @@ ...@@ -7165,7 +7164,7 @@
for (var i = 0; i < data['result'].length; i++) { for (var i = 0; i < data['result'].length; i++) {
var data_id = data['result'][i][0]; var data_id = data['result'][i][0];
var data_po = data['result'][i][1]; var data_po = data['result'][i][1];
var data_kab = `<option value="` +data_id + `">` + data_po + `</option>`; var data_kab = `<option value="` + data_id + `">` + data_po + `</option>`;
console.log(data_id) console.log(data_id)
console.log(data_po) console.log(data_po)
var data_kab = `<option value="` + data_id + `">` + data_po + `</option>`; var data_kab = `<option value="` + data_id + `">` + data_po + `</option>`;
......
...@@ -342,47 +342,6 @@ ...@@ -342,47 +342,6 @@
</div> </div>
</div> </div>
<style>
#modal_detail_kelurahan>div>div>div>fieldset>div>div:nth-child(1)>div:nth-child(2)>div.row>div>div>div:nth-child(1) {
margin-bottom: 5px;
}
#modal_detail_kelurahan>div>div>div>fieldset>div>div:nth-child(1)>div:nth-child(2)>div.row>div>div>div:nth-child(2) {
margin-bottom: 10px;
font-family: 'gilroysemibold';
}
#modal_detail_non_kelurahan>div>div>div.modal-body>fieldset>div>div:nth-child(2)>div>div>div>div:nth-child(2) {
margin-bottom: 10px;
font-family: 'gilroysemibold';
}
li.active>a:after {
border-bottom: 2pt solid #60B2FD;
}
.apexcharts-menu-icon {
width: 150px;
color: white;
left: -16px;
}
.apexcharts-toolbar {
right: -50px!important;
top: 104%!important;
background-color: #5A9AFB;
border-top-left-radius: 10px;
width: 150px;
height: 45px;
border-bottom-right-radius: 10px;
}
.apexcharts-menu {
top: -98px!important;
right: 0px!important;
}
</style>
<div class="modal fade" id="modal_detail_kelurahan" tabindex="-1" role="dialog"> <div class="modal fade" id="modal_detail_kelurahan" tabindex="-1" role="dialog">
<div class="modal-dialog modal-md" style="width: 820px;max-height: 500px;min-height: 500px;"> <div class="modal-dialog modal-md" style="width: 820px;max-height: 500px;min-height: 500px;">
<div class="modal-content" style="border-radius:10px;max-height: 500px;min-height: 500px;"> <div class="modal-content" style="border-radius:10px;max-height: 500px;min-height: 500px;">
...@@ -750,7 +709,7 @@ ...@@ -750,7 +709,7 @@
<div style="margin-bottom: 10px;"> <div style="margin-bottom: 10px;">
<a href="#personalinformation" data-toggle="tab" class="tab-user btn btn-default" style=" <a href="#personalinformation" data-toggle="tab" class="tab-user btn btn-default " style="
width: 90%; width: 90%;
background: #FFFFFF; background: #FFFFFF;
box-sizing: border-box; box-sizing: border-box;
...@@ -1027,7 +986,7 @@ ...@@ -1027,7 +986,7 @@
<div class="tab-pane" id="monitoringdatauser"> <div class="tab-pane" id="monitoringdatauser">
<table class="table table-responsive datatable-show-all table-sm list_point" id="list_point" style="font-size : 8pt;padding:0px;border-top:0.5pt solid #EFEFEF;border-bottom:0.5pt solid #EFEFEF;margin-bottom: 10px;"> <table class="table table-responsive datatable-show-all table-sm list_point" id="list_point" style="font-size : 8pt;padding:0px;border-top:0.5pt solid #EFEFEF;border-bottom:0.5pt solid #EFEFEF;margin-bottom: 10px;">
<div style="position: absolute;right: 30px;font-size: 10pt;"> <div style="position: absolute;right: 30px;font-size: 10pt;">
<a class="btn side-bar-but" id="download_perbaikan" onclick="download_user_list('xlsx')" style="z-index:9;"> <a class="btn side-bar-but" id="download_perbaikan" onclick="download_point_list('xlsx')" style="z-index:9;">
<div> <div>
<i class="icon-download4"></i><span>&nbsp;&nbsp;&nbsp;Download</span> <i class="icon-download4"></i><span>&nbsp;&nbsp;&nbsp;Download</span>
</div> </div>
...@@ -1365,77 +1324,5 @@ ...@@ -1365,77 +1324,5 @@
</div> </div>
<script> <table id="table_downloader" style="display: none;">
function btnuserclick(evt) { </table>
var i, tabcontent, tablinks; \ No newline at end of file
tablinks = document.getElementsByClassName("tab-user");
for (i = 0; i < tablinks.length; i++) {
tablinks[i].className = tablinks[i].className.replace(" active", "");
}
evt.currentTarget.className += " active";
//$(".tab-user").style.border = "#4C97DC";
}
// $('.datatable-show-all.list_user').DataTable({
// autoWidth: false,
// columnDefs: [{
// orderable: false,
// width: '20px',
// targets: [0],
//
// }, {
// orderable: false,
// width: '20px',
// targets: [5],
//
// }, {
// orderable: false,
// width: '20px',
// targets: [6],
//
// }, ],
// 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');
// }
// });
function download_user_list(type, fn, dl) {
var elt = document.getElementById('list_user');
var wb = XLSX.utils.table_to_book(elt, {
sheet: "sheet1"
});
return dl ?
XLSX.write(wb, {
bookType: type,
bookSST: true,
type: 'base64'
}) :
XLSX.writeFile(wb, fn || ('data_user.' + (type || 'xlsx')));
}
</script>
<style>
.tab-user.active {
border: 1pt solid #4C97DC!important;
color: #4C97DC!important;
}
.tab-user.active {}
</style>
\ No newline at end of file
...@@ -48,12 +48,6 @@ ...@@ -48,12 +48,6 @@
</a> </a>
</li> </li>
<hr> <hr>
<li>
<a href="#" id="btn-hide-all" class="side-bar-but" style="position: absolute;margin-top: 1px;">
<i class="icon-arrow-right13"></i>
</a>
</li>
</ul> </ul>
</div> </div>
</div> </div>
...@@ -429,6 +423,7 @@ ...@@ -429,6 +423,7 @@
</div> </div>
</div> </div>
</div> </div>
<div class="panel panel-flat " id="perbaikan-dashboard " style="background: #181B27;position: absolute;z-index: 9;width: 77%;height:100vh;left: 23%;transition: all 0.5s ease;color: white; border: none; "> <div class="panel panel-flat " id="perbaikan-dashboard " style="background: #181B27;position: absolute;z-index: 9;width: 77%;height:100vh;left: 23%;transition: all 0.5s ease;color: white; border: none; ">
<div class="panel-body " style="padding:14px 0px;"> <div class="panel-body " style="padding:14px 0px;">
......
This diff is collapsed.
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