367 lines
17 KiB
PHP
367 lines
17 KiB
PHP
@php
|
|
$siteBreadcumb = [
|
|
["url"=>"/admin/users","label"=>$siteTitle],
|
|
["url"=>"/admin/users","label"=>$sitesubTitle]
|
|
];
|
|
@endphp
|
|
|
|
@extends('layouts.empty')
|
|
|
|
@section('styles')
|
|
<link rel="stylesheet" href="{{ $baseUrl }}/AdminLTE-3.2.0/plugins/datatables-bs4/css/dataTables.bootstrap4.min.css">
|
|
<link rel="stylesheet" href="{{ $baseUrl }}/AdminLTE-3.2.0/plugins/datatables-responsive/css/responsive.bootstrap4.min.css">
|
|
<link rel="stylesheet" href="{{ $baseUrl }}/AdminLTE-3.2.0/plugins/datatables-buttons/css/buttons.bootstrap4.min.css">
|
|
<link rel="stylesheet" href="{{ $baseUrl }}/AdminLTE-3.2.0/plugins/datatables-rowgroup/css/rowGroup.bootstrap4.min.css">
|
|
<link rel="stylesheet" href="{{ $baseUrl }}/AdminLTE-3.2.0/plugins/datatables-fixedcolumns/css/fixedColumns.bootstrap4.min.css">
|
|
@endsection
|
|
|
|
@section('content')
|
|
<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>
|
|
</div>
|
|
</div>
|
|
<div class="card-body">
|
|
<table id="dtTableUser" class="table table-striped jambo_table">
|
|
<tr>
|
|
<thead>
|
|
<th width="50">No</th>
|
|
<th>NRK</th>
|
|
<th>Nama</th>
|
|
<th>Level</th>
|
|
<th><input class="form-check-input" type="checkbox" id="btn_lock_all" value="1">Lock Upload</th>
|
|
<th><input class="form-check-input" type="checkbox" id="btn_lock_tambah" value="1" {{ $pengaturan->check_all_tambah=="1"?"checked":"" }}>Lock Tambah</th>
|
|
<th><input class="form-check-input" type="checkbox" id="btn_lock_ubah" value="1" {{ $pengaturan->check_all_ubah=="1"?"checked":"" }}>Lock Ubah</th>
|
|
<th><input class="form-check-input" type="checkbox" id="btn_lock_hapus" value="1" {{ $pengaturan->check_all_hapus=="1"?"checked":"" }}>Lock Hapus</th>
|
|
<th class="text-center">Action</th>
|
|
</thead>
|
|
</tr>
|
|
{{-- @foreach ($data as $key => $value)
|
|
<tr>
|
|
<td>{{ ++$i }}</td>
|
|
<td>{{ $value->nrk }}</td>
|
|
<td>{{ $value->name }}</td>
|
|
<td>{{ $value->role_name }}</td>
|
|
<td class="text-center">
|
|
<form class="form-delete" action="{{ route('users.destroy',$value->id) }}" method="POST">
|
|
<a class="btn btn-default btn-sm" href="{{ route('users.show',$value->id) }}" title="Lihat"><i class="fa fa-bullseye"></i></a>
|
|
<a class="btn btn-default btn-sm" href="{{ route('users.edit',$value->id) }}" title="Ubah"><i class="fa fa-edit"></i></a>
|
|
@csrf
|
|
@method('DELETE')
|
|
<button type="submit" class="btn btn-default btn-sm" title="Hapus"><i class="fa fa-trash"></i></button>
|
|
</form>
|
|
</td>
|
|
</tr>
|
|
@endforeach --}}
|
|
</table>
|
|
{{-- {!! $data->links() !!} --}}
|
|
</div>
|
|
</div>
|
|
|
|
@section('scripts')
|
|
<script src="{{ $baseUrl }}/AdminLTE-3.2.0/plugins/datatables/jquery.dataTables.min.js"></script>
|
|
<script src="{{ $baseUrl }}/AdminLTE-3.2.0/plugins/datatables-bs4/js/dataTables.bootstrap4.min.js"></script>
|
|
<script src="{{ $baseUrl }}/AdminLTE-3.2.0/plugins/datatables-responsive/js/dataTables.responsive.min.js"></script>
|
|
<script src="{{ $baseUrl }}/AdminLTE-3.2.0/plugins/datatables-responsive/js/responsive.bootstrap4.min.js"></script>
|
|
<script src="{{ $baseUrl }}/AdminLTE-3.2.0/plugins/datatables-buttons/js/dataTables.buttons.min.js"></script>
|
|
<script src="{{ $baseUrl }}/AdminLTE-3.2.0/plugins/datatables-buttons/js/buttons.bootstrap4.min.js"></script>
|
|
<script src="{{ $baseUrl }}/AdminLTE-3.2.0/plugins/jszip/jszip.min.js"></script>
|
|
<script src="{{ $baseUrl }}/AdminLTE-3.2.0/plugins/pdfmake/pdfmake.min.js"></script>
|
|
<script src="{{ $baseUrl }}/AdminLTE-3.2.0/plugins/pdfmake/vfs_fonts.js"></script>
|
|
<script src="{{ $baseUrl }}/AdminLTE-3.2.0/plugins/datatables-buttons/js/buttons.html5.min.js"></script>
|
|
<script src="{{ $baseUrl }}/AdminLTE-3.2.0/plugins/datatables-buttons/js/buttons.print.min.js"></script>
|
|
<script src="{{ $baseUrl }}/AdminLTE-3.2.0/plugins/datatables-buttons/js/buttons.colVis.min.js"></script>
|
|
<script src="{{ $baseUrl }}/AdminLTE-3.2.0/plugins/datatables-fixedcolumns/js/dataTables.fixedColumns.min.js"></script>
|
|
<script src="{{ $baseUrl }}/AdminLTE-3.2.0/plugins/datatables-fixedcolumns/js/fixedColumns.bootstrap4.min.js"></script>
|
|
<script src="{{ $baseUrl }}/AdminLTE-3.2.0/plugins/datatables-rowgroup/js/dataTables.rowGroup.min.js"></script>
|
|
<script src="{{ $baseUrl }}/AdminLTE-3.2.0/plugins/datatables-rowgroup/js/rowGroup.bootstrap4.min.js"></script>
|
|
<script type="text/javascript">
|
|
$(document).ready(function() {
|
|
var dtTable = $('#dtTableUser').DataTable({
|
|
"processing": true,
|
|
"serverSide": true,
|
|
"ordering": false,
|
|
"autoWidth": true,
|
|
"ajax": {
|
|
url: "{{ $baseUrl }}/admin/users/datatable",
|
|
type: "POST",
|
|
headers: {
|
|
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
|
|
},
|
|
data: function(d) {
|
|
|
|
}
|
|
},
|
|
"dom": "<\"top\" <\"row\"<\"col-md-6\"l><\"col-md-6 text-right\"f>>>rt<\"bottom\" <\"row\"<\"col-md-6\"i><\"col-md-6\"p>> ><\"clear\">",
|
|
"lengthMenu": [
|
|
[10, 25, 50],
|
|
["10", "25", "50"]
|
|
],
|
|
"paging": true, // Table pagination
|
|
"columns": [{
|
|
"data": null
|
|
},
|
|
{
|
|
"data": "nrk",
|
|
"className": "text-center"
|
|
},
|
|
{
|
|
"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" },
|
|
],
|
|
"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(`<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"] + `/edit" title="Ubah"><i class="fa fa-edit"></i></a>
|
|
@csrf
|
|
@method("DELETE")
|
|
<a class="btn btn-success btn-sm btn_reset_password" href="{{ URL::to("/admin/users") }}/` + aData["id"] + `/reset" title="Reset"><i class="fas fa-key"></i></a>
|
|
<button type="submit" class="btn btn-danger btn-sm"title="Hapus"><i class="fa fa-trash"></i></button>
|
|
</form>`);
|
|
|
|
return nRow;
|
|
},
|
|
"language": {
|
|
"lengthMenu": "Tampilkan _MENU_ Data per Halaman",
|
|
"zeroRecords": "Data tidak ditemukan!",
|
|
"info": "Halaman _PAGE_ dari _PAGES_ Halaman ( _TOTAL_ Data )",
|
|
"infoEmpty": "Data tidak tersedia",
|
|
"infoFiltered": "(Disaring dari _MAX_ Data)",
|
|
"paginate": {
|
|
"previous": "<i class='fas fa-angle-double-left'></i>",
|
|
"next": "<i class='fas fa-angle-double-right'></i>",
|
|
},
|
|
"processing": "<div class='loading'></div>",
|
|
},
|
|
});
|
|
|
|
|
|
$(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!?',
|
|
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-upload-all/0/0";
|
|
}
|
|
})
|
|
});
|
|
|
|
|
|
|
|
$("#btn_reset_lock_all").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-upload-all/0/1";
|
|
}
|
|
})
|
|
});
|
|
|
|
|
|
$("#btn_lock_tambah").on("click", function() {
|
|
let checkVal = $(this).prop("checked");
|
|
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) {
|
|
let val = checkVal == true ? 1 : 2;
|
|
location.href = "{{ URL::to(" / admin / users ") }}/lock-tambah-all/0/0/" + val;
|
|
}
|
|
})
|
|
});
|
|
|
|
$("#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 checkVal = $(this).prop("checked");
|
|
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) {
|
|
let val = checkVal == true ? 1 : 2;
|
|
location.href = "{{ URL::to(" / admin / users ") }}/lock-ubah-all/0/0/" + val;
|
|
}
|
|
})
|
|
});
|
|
|
|
$("#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 checkVal = $(this).prop("checked");
|
|
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) {
|
|
let val = checkVal == true ? 1 : 2;
|
|
location.href = "{{ URL::to(" / admin / users ") }}/lock-hapus-all/0/0/" + val;
|
|
}
|
|
})
|
|
});
|
|
|
|
$("#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");
|
|
let test = Swal.fire({
|
|
title: 'Password akan direset!?',
|
|
showDenyButton: true,
|
|
showCancelButton: false,
|
|
confirmButtonText: 'Ya',
|
|
denyButtonText: "Tidak",
|
|
icon: "warning",
|
|
}).then((result) => {
|
|
/* Read more about isConfirmed, isDenied below */
|
|
if (result.isConfirmed) {
|
|
location.href = url;
|
|
}
|
|
})
|
|
});
|
|
$("#optRole").on("change", function() {
|
|
dtTable.draw();
|
|
});
|
|
});
|
|
</script>
|
|
@endsection
|
|
@stop |