diff --git a/app/Http/Controllers/Admin/MstPenggunaController.php b/app/Http/Controllers/Admin/MstPenggunaController.php index 8f80f75..dc549bb 100644 --- a/app/Http/Controllers/Admin/MstPenggunaController.php +++ b/app/Http/Controllers/Admin/MstPenggunaController.php @@ -82,7 +82,7 @@ class MstPenggunaController extends Controller $request->validate([ 'name' => 'required', 'opt_role' => 'required', - 'wilayah' => 'required', + // 'wilayah' => 'required', ]); $requestAll = $request->all(); diff --git a/resources/views/admin/mst_pengguna/edit.blade.php b/resources/views/admin/mst_pengguna/edit.blade.php index 46b6110..880448f 100644 --- a/resources/views/admin/mst_pengguna/edit.blade.php +++ b/resources/views/admin/mst_pengguna/edit.blade.php @@ -1,76 +1,99 @@ @php - $siteBreadcumb = [ - ["url"=>"/admin/users","label"=>$siteTitle], - ["url"=>"/admin/users","label"=>$sitesubTitle] - ]; +$siteBreadcumb = [ +["url"=>"/admin/users","label"=>$siteTitle], +["url"=>"/admin/users","label"=>$sitesubTitle] +]; @endphp @extends('layouts.app') - + @section('content') -
-
-
-
@php echo $sitesubTitle; @endphp
-
-
- Back -
+
+
+
+
@php echo $sitesubTitle; @endphp
+
+
- -
- @csrf - @method('PUT') - -
-
-
- NRK: - -
-
-
-
- Nama Pengguna: - -
-
-
-
- Level: - -
-
-
- +
+ + + @csrf + @method('PUT') + +
+
+
+ NRK: +
- - +
+
+ Nama Pengguna: + +
+
+
+
+ Level: + +
+
+ +
+ +
+
+ + @endsection @section('scripts') - + $("#opt_role").val("{{ $user->role_name }}"); + + $(document).ready(function() { + $('#opt_role').on('change', function() { + if (this.value === 'sbpk') { + $('#wilayahForm').show(); + } else { + $('#wilayahForm').hide(); + } + }); + }); + }); + @endsection \ No newline at end of file diff --git a/resources/views/admin/mst_pengguna/index.blade.php b/resources/views/admin/mst_pengguna/index.blade.php index 7c70de5..d19c31b 100644 --- a/resources/views/admin/mst_pengguna/index.blade.php +++ b/resources/views/admin/mst_pengguna/index.blade.php @@ -1,342 +1,367 @@ @php - $siteBreadcumb = [ - ["url"=>"/admin/users","label"=>$siteTitle], - ["url"=>"/admin/users","label"=>$sitesubTitle] - ]; +$siteBreadcumb = [ +["url"=>"/admin/users","label"=>$siteTitle], +["url"=>"/admin/users","label"=>$sitesubTitle] +]; @endphp @extends('layouts.empty') @section('styles') - - - - - + + + + + @endsection @section('content') -
-
-
@php echo $sitesubTitle; @endphp
- - -
-
- - - - - - - - - - - - - - - {{-- @foreach ($data as $key => $value) - - - - - - - - @endforeach --}} -
NoNRKNamaLevelLock Uploadcheck_all_tambah=="1"?"checked":"" }}>Lock Tambahcheck_all_ubah=="1"?"checked":"" }}>Lock Ubahcheck_all_hapus=="1"?"checked":"" }}>Lock HapusAction
{{ ++$i }}{{ $value->nrk }}{{ $value->name }}{{ $value->role_name }} -
- - - @csrf - @method('DELETE') - -
-
- {{-- {!! $data->links() !!} --}} +
+
+
@php echo $sitesubTitle; @endphp
+ +
+
+ + + + + + + + + + + + + + + {{-- @foreach ($data as $key => $value) + + + + + + + + @endforeach --}} +
NoNRKNamaLevelLock Uploadcheck_all_tambah=="1"?"checked":"" }}>Lock Tambahcheck_all_ubah=="1"?"checked":"" }}>Lock Ubahcheck_all_hapus=="1"?"checked":"" }}>Lock HapusAction
{{ ++$i }}{{ $value->nrk }}{{ $value->name }}{{ $value->role_name }} +
+ + + @csrf + @method('DELETE') + +
+
+ {{-- {!! $data->links() !!} --}} +
+
- @section('scripts') - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + - @endsection + + + $(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(); + }); + }); + +@endsection @stop \ No newline at end of file