Melakukan Perubahan di admin
This commit is contained in:
@@ -19,10 +19,17 @@
|
||||
<div class="card card-secondary">
|
||||
<div class="card-header">
|
||||
<h5 class="card-title"><i class="fa fa-th-list"></i> @php echo $sitesubTitle; @endphp</h5>
|
||||
|
||||
<div class="card-tools">
|
||||
<a class="btn btn-tool btn-dark" href="{{ route('users.create') }}"><i class="fa fa-edit"></i> Tambah Data</a>
|
||||
<button id="btn_lock_all" type="button" class="btn btn-tool btn-dark"><i class="fa fa-lock"></i> Lock Upload Data</button>
|
||||
<!-- <button id="btn_lock_all" type="button" class="btn btn-tool btn-dark"><i class="fa fa-lock"></i> Lock Upload Data</button> -->
|
||||
<button id="btn_reset_lock_all" type="button" class="btn btn-tool btn-dark"><i class="fa fa-unlock"></i> unLock Upload Data</button>
|
||||
<!-- <button id="btn_lock_tambah" type="button" class="btn btn-tool btn-dark"><i class="fa fa-lock"></i> Lock Tambah Data</button> -->
|
||||
<button id="btn_reset_tambah" type="button" class="btn btn-tool btn-dark"><i class="fa fa-unlock"></i> unLock Tambah Data</button>
|
||||
<!-- <button id="btn_lock_ubah" type="button" class="btn btn-tool btn-dark"><i class="fa fa-lock"></i> Lock Ubah Data</button> -->
|
||||
<button id="btn_reset_ubah" type="button" class="btn btn-tool btn-dark"><i class="fa fa-unlock"></i> unLock Ubah Data</button>
|
||||
<button id="btn_lock_hapus" type="button" class="btn btn-tool btn-dark"><i class="fa fa-lock"></i> Lock Hapus Data</button>
|
||||
<button id="btn_reset_hapus" type="button" class="btn btn-tool btn-dark"><i class="fa fa-unlock"></i> unLock Hapus Data</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
@@ -33,8 +40,11 @@
|
||||
<th>NRK</th>
|
||||
<th>Nama</th>
|
||||
<th>Level</th>
|
||||
<th>Lock Upload</th>
|
||||
<th width="150px" class="text-center">Action</th>
|
||||
<th><input class="form-check-input" type="checkbox" id="btn_lock_all" >Lock Upload</th>
|
||||
<th><input class="form-check-input" type="checkbox" id="btn_lock_tambah">Lock Tambah</th>
|
||||
<th><input class="form-check-input" type="checkbox" id="btn_lock_ubah">Lock Ubah</th>
|
||||
<th><input class="form-check-input" type="checkbox" id="btn_lock_hapus">Lock Hapus</th>
|
||||
<th class="text-center">Action</th>
|
||||
</thead>
|
||||
</tr>
|
||||
{{-- @foreach ($data as $key => $value)
|
||||
@@ -105,17 +115,27 @@
|
||||
{ "data": "name", "className":"text-left" },
|
||||
{ "data": "role_name", "className":"text-center" },
|
||||
{ "data": null, "className":"text-center" },
|
||||
{ "data": null, "className":"text-center" },
|
||||
{ "data": null, "className":"text-center" },
|
||||
{ "data": null, "className":"text-center" },
|
||||
{ "data": null, "className":"text-center" },
|
||||
{ "data": null, "className":"text-center" },
|
||||
// { "data": null, "className":"text-center" },
|
||||
],
|
||||
"rowCallback": function(nRow, aData, iDisplayIndex, iDisplayIndexFull, oSettings) {
|
||||
let info = dtTable.page.info();
|
||||
let numStart = info.page;
|
||||
let index = (numStart * dtTable.page.len()) + iDisplayIndex + 1;
|
||||
let checked = aData["is_lock_upload"] == 1 ? "checked":"";
|
||||
let checkedTambahData = aData["lock_tambah_data"] == 1 ? "checked":"";
|
||||
let checkedUbahData = aData["lock_ubah_data"] == 1 ? "checked":"";
|
||||
let checkedHapusData = aData["lock_hapus_data"] == 1 ? "checked":"";
|
||||
|
||||
$("td:eq(0)", nRow).html(index);
|
||||
$("td:eq(4)", nRow).html("<input type='checkbox' class='chk-upload' value='"+aData["id"]+"' "+checked+">");
|
||||
$("td:eq(5)", nRow).html(
|
||||
$("td:eq(5)", nRow).html(`<input class="user_lock_tambah_data" type="checkbox" name="lock-tambah-data[]" ` + checkedTambahData + ` value="` + aData["id"] + `">`);
|
||||
$("td:eq(6)", nRow).html(`<input class="user_lock_ubah_data" type="checkbox" name="lock-ubah-data[]" ` + checkedUbahData + ` value="` + aData["id"] + `">`);
|
||||
$("td:eq(7)", nRow).html(`<input class="user_lock_hapus_data" type="checkbox" name="lock-hapus-data[]" ` + checkedHapusData + ` value="` + aData["id"] + `">`);
|
||||
$("td:eq(8)", nRow).html(
|
||||
`<form class="form-delete" action="{{ URL::to("/admin/users") }}/`+ aData["id"] +`" method="POST">
|
||||
<a class="btn btn-info btn-sm" href="{{ URL::to("/admin/users") }}/`+ aData["id"] +`" title="Lihat"><i class="fa fa-eye"></i></a>
|
||||
<a class="btn btn-warning btn-sm" href="{{ URL::to("/admin/users") }}/`+ aData["id"] +`/update" title="Ubah"><i class="fa fa-edit"></i></a>
|
||||
@@ -141,12 +161,31 @@
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
$(document).on("click",".chk-upload", function(){
|
||||
let val = $(this).val();
|
||||
let reset = $(this).prop("checked") == 1 ?0:1;
|
||||
location.href = "{{ URL::to("/admin/users") }}/"+val+"/lock-upload/"+reset;
|
||||
});
|
||||
|
||||
$(document).on("click",".user_lock_tambah_data", function(){
|
||||
let val = $(this).val();
|
||||
let reset = $(this).prop("checked") == 1 ?0:1;
|
||||
location.href = "{{ URL::to("/admin/users") }}/"+val+"/lock-tambah-data/"+reset;
|
||||
});
|
||||
|
||||
$(document).on("click",".user_lock_ubah_data", function(){
|
||||
let val = $(this).val();
|
||||
let reset = $(this).prop("checked") == 1 ?0:1;
|
||||
location.href = "{{ URL::to("/admin/users") }}/"+val+"/lock-ubah-data/"+reset;
|
||||
});
|
||||
|
||||
$(document).on("click",".user_lock_hapus_data", function(){
|
||||
let val = $(this).val();
|
||||
let reset = $(this).prop("checked") == 1 ?0:1;
|
||||
location.href = "{{ URL::to("/admin/users") }}/"+val+"/lock-hapus-data/"+reset;
|
||||
});
|
||||
|
||||
$("#btn_lock_all").on("click", function(){
|
||||
let test = Swal.fire({
|
||||
title: 'Fitur upload data akan dikunci untuk semua user!?',
|
||||
@@ -175,10 +214,108 @@
|
||||
/* Read more about isConfirmed, isDenied below */
|
||||
if (result.isConfirmed) {
|
||||
location.href = "{{ URL::to("/admin/users") }}/lock-upload-all/0/1";
|
||||
}
|
||||
})
|
||||
});
|
||||
|
||||
|
||||
$("#btn_lock_tambah").on("click", function(){
|
||||
let test = Swal.fire({
|
||||
title: 'Fitur tambah data akan dikunci untuk semua user!?',
|
||||
showDenyButton: true,
|
||||
showCancelButton: false,
|
||||
confirmButtonText: 'Ya',
|
||||
denyButtonText: "Tidak",
|
||||
icon: "warning",
|
||||
}).then((result) => {
|
||||
/* Read more about isConfirmed, isDenied below */
|
||||
if (result.isConfirmed) {
|
||||
location.href = "{{ URL::to("/admin/users") }}/lock-tambah-all/0/0";
|
||||
}
|
||||
})
|
||||
});
|
||||
|
||||
$("#btn_reset_tambah").on("click", function(){
|
||||
let test = Swal.fire({
|
||||
title: 'Fitur tambah data akan direset untuk semua user!?',
|
||||
showDenyButton: true,
|
||||
showCancelButton: false,
|
||||
confirmButtonText: 'Ya',
|
||||
denyButtonText: "Tidak",
|
||||
icon: "warning",
|
||||
}).then((result) => {
|
||||
/* Read more about isConfirmed, isDenied below */
|
||||
if (result.isConfirmed) {
|
||||
location.href = "{{ URL::to("/admin/users") }}/lock-tambah-all/0/1";
|
||||
}
|
||||
})
|
||||
});
|
||||
|
||||
$("#btn_lock_ubah").on("click", function(){
|
||||
let test = Swal.fire({
|
||||
title: 'Fitur ubah data akan dikunci untuk semua user!?',
|
||||
showDenyButton: true,
|
||||
showCancelButton: false,
|
||||
confirmButtonText: 'Ya',
|
||||
denyButtonText: "Tidak",
|
||||
icon: "warning",
|
||||
}).then((result) => {
|
||||
/* Read more about isConfirmed, isDenied below */
|
||||
if (result.isConfirmed) {
|
||||
location.href = "{{ URL::to("/admin/users") }}/lock-ubah-all/0/0";
|
||||
}
|
||||
})
|
||||
});
|
||||
|
||||
$("#btn_reset_ubah").on("click", function(){
|
||||
let test = Swal.fire({
|
||||
title: 'Fitur ubah data akan direset untuk semua user!?',
|
||||
showDenyButton: true,
|
||||
showCancelButton: false,
|
||||
confirmButtonText: 'Ya',
|
||||
denyButtonText: "Tidak",
|
||||
icon: "warning",
|
||||
}).then((result) => {
|
||||
/* Read more about isConfirmed, isDenied below */
|
||||
if (result.isConfirmed) {
|
||||
location.href = "{{ URL::to("/admin/users") }}/lock-ubah-all/0/1";
|
||||
}
|
||||
})
|
||||
});
|
||||
|
||||
$("#btn_lock_hapus").on("click", function(){
|
||||
let test = Swal.fire({
|
||||
title: 'Fitur hapus data akan dikunci untuk semua user!?',
|
||||
showDenyButton: true,
|
||||
showCancelButton: false,
|
||||
confirmButtonText: 'Ya',
|
||||
denyButtonText: "Tidak",
|
||||
icon: "warning",
|
||||
}).then((result) => {
|
||||
/* Read more about isConfirmed, isDenied below */
|
||||
if (result.isConfirmed) {
|
||||
location.href = "{{ URL::to("/admin/users") }}/lock-hapus-all/0/0";
|
||||
}
|
||||
})
|
||||
});
|
||||
|
||||
$("#btn_reset_hapus").on("click", function(){
|
||||
let test = Swal.fire({
|
||||
title: 'Fitur upload data akan direset untuk semua user!?',
|
||||
showDenyButton: true,
|
||||
showCancelButton: false,
|
||||
confirmButtonText: 'Ya',
|
||||
denyButtonText: "Tidak",
|
||||
icon: "warning",
|
||||
}).then((result) => {
|
||||
/* Read more about isConfirmed, isDenied below */
|
||||
if (result.isConfirmed) {
|
||||
location.href = "{{ URL::to("/admin/users") }}/lock-hapus-all/0/1";
|
||||
}
|
||||
})
|
||||
});
|
||||
|
||||
|
||||
$(document).on("click",".btn_reset_password",function (e){
|
||||
e.preventDefault();
|
||||
let url = $(this).attr("href");
|
||||
@@ -196,6 +333,9 @@
|
||||
}
|
||||
})
|
||||
});
|
||||
$("#optRole").on("change",function(){
|
||||
dtTable.draw();
|
||||
});
|
||||
});
|
||||
</script>
|
||||
@endsection
|
||||
|
||||
Reference in New Issue
Block a user