diff --git a/app/Events/PendahuluanSerahan.php b/app/Events/PendahuluanSerahan.php index ab97a35..b6ca1ff 100644 --- a/app/Events/PendahuluanSerahan.php +++ b/app/Events/PendahuluanSerahan.php @@ -13,11 +13,13 @@ class PendahuluanSerahan implements ShouldBroadcast public $pengesahan; public $cawangan; + public $kodlaluan; - public function __construct($pengesahan,$cawangan) + public function __construct($pengesahan,$cawangan,$kodlaluan) { $this->pengesahan = $pengesahan; $this->cawangan = $cawangan; + $this->kodlaluan = $kodlaluan; } public function broadcastOn() diff --git a/app/Http/Controllers/KhazanahController.php b/app/Http/Controllers/KhazanahController.php index 69127d0..08c75e9 100644 --- a/app/Http/Controllers/KhazanahController.php +++ b/app/Http/Controllers/KhazanahController.php @@ -1149,7 +1149,7 @@ class KhazanahController extends Controller ]); - event(new PendahuluanSerahan("Lulus",$auth_user['cawangan'])); + event(new PendahuluanSerahan("Lulus",$auth_user['cawangan'],$request->teller)); $updaterequest=Http::withOptions(['verify' => config('app.api_verify')])->put(config('api.url').'/api/requestTeller/update/'. $auth_user['cawangan'],[ 'kodlaluan' => $request->teller, @@ -1229,7 +1229,7 @@ class KhazanahController extends Controller ]); - event(new PendahuluanSerahan("Lulus",$auth_user['cawangan'])); + event(new PendahuluanSerahan("Lulus",$auth_user['cawangan'],$request->teller)); $updaterequest=Http::withOptions(['verify' => config('app.api_verify')])->put(config('api.url').'/api/requestTeller/update/'. $auth_user['cawangan'],[ 'kodlaluan' => $request->teller, @@ -3079,7 +3079,7 @@ class KhazanahController extends Controller 'kodlaluan'=>$kodlaluan ]); - event(new PendahuluanSerahan("Batal",$auth_user['cawangan'])); + event(new PendahuluanSerahan("Batal",$auth_user['cawangan'],$kodlaluan)); return response('Berjaya'); } diff --git a/app/Http/Controllers/UserController.php b/app/Http/Controllers/UserController.php index 444e7a9..3588530 100644 --- a/app/Http/Controllers/UserController.php +++ b/app/Http/Controllers/UserController.php @@ -24,4 +24,35 @@ class UserController extends Controller return view('user.index_operasi',compact('cawangan_info','api_url','auth_user')); } } + + public function edit(){ + $api_url = config('api.url'); + $auth_user = Auth::user(); + $cawangan_info = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') . '/api/cawangan/'. $auth_user['cawangan'])->json(); + + if($auth_user->roles == 'teller' || $auth_user->roles == 'ppc' || $auth_user->roles == 'pc'){ + return view('user.edit',compact('cawangan_info','api_url','auth_user')); + }else{ + return view('user.edit_operasi',compact('cawangan_info','api_url','auth_user')); + } + } + + public function editStore(Request $request){ + + + $validated = $request->validate([ + 'nama' => 'required|max:255', + 'notel' => 'required|numeric|min:10', + ]); + + $auth_user = Auth::user(); + $user = User::find($auth_user->id); + + $user->name = $request->nama; + $user->no_telefon = $request->notel; + + $user->save(); + + return redirect()->route('profile')->with('success', 'Perubahan Maklumat Pengguna Telah Dikemaskini.'); + } } diff --git a/public/js/main.js b/public/js/main.js index dc37820..e1620b1 100644 --- a/public/js/main.js +++ b/public/js/main.js @@ -465,8 +465,7 @@ async function openuptambahdanserah(e) var channel = pusher.subscribe('pendahuluanserahan-notice'); channel.bind('penserahan-event', function(data) { - console.log(data); - if(data.pengesahan === 'Lulus' && data.cawangan == kodcaw) + if(data.pengesahan === 'Lulus' && data.cawangan == kodcaw && data.kodlaluan == teller) { Swal.fire({ icon: 'success', @@ -630,9 +629,8 @@ function tambahdanserahanfunc(e) var channel = pusher.subscribe('pendahuluanserahan-notice'); channel.bind('penserahan-event', function(data) { // let message = JSON.stringify(data); - console.log(data); - if(data.pengesahan === 'Lulus' && data.cawangan == kodcaw) + if(data.pengesahan === 'Lulus' && data.cawangan == kodcaw && data.kodlaluan == teller) { Swal.fire({ icon: 'success', diff --git a/resources/views/aliran_tunai/index.blade.php b/resources/views/aliran_tunai/index.blade.php index 0db0a5c..fc2b555 100644 --- a/resources/views/aliran_tunai/index.blade.php +++ b/resources/views/aliran_tunai/index.blade.php @@ -8,13 +8,17 @@ @if($countproses > 0) @endif @@ -31,7 +35,7 @@ - +
@@ -561,7 +565,6 @@ function cetakserahankeseluruhan() { - console.log('ets'); let urlroute = '{{ route("laporan.serahanteller") }}'; window.open(urlroute, '_blank'); diff --git a/resources/views/user/edit.blade.php b/resources/views/user/edit.blade.php new file mode 100644 index 0000000..3ffc8bc --- /dev/null +++ b/resources/views/user/edit.blade.php @@ -0,0 +1,53 @@ +@extends('layouts.app') + +@section('content') +
+
+
+ +
+
+ @csrf +
+
+
+
+
+
Nama
+
+ @error('nama') {{ $message }} @enderror +
+
No Telefon
+
+ @error('notel') {{ $message }} @enderror +
+
Email
+
+
+
+
+
+
No Kad Pengenalan
+
+
Jawatan
+
+
Baki Perubatan
+
+
+
+
+
+ +
+
+
+
+
+
+@endsection \ No newline at end of file diff --git a/resources/views/user/edit_operasi.blade.php b/resources/views/user/edit_operasi.blade.php new file mode 100644 index 0000000..bcb5b3d --- /dev/null +++ b/resources/views/user/edit_operasi.blade.php @@ -0,0 +1,49 @@ +@extends('layouts.app_operasi') + +@section('content') +
+
+
+ +
+
+
+
+ @csrf +
+
+
+
NAMA
+
+ @error('nama') {{ $message }} @enderror +
+
NO TELEFON
+
+ @error('notel') {{ $message }} @enderror +
+
+
+
+
+
NO KP
+
+
JAWATAN
+
+
+
+
+ +
+
+
+
+
+
+
+@endsection \ No newline at end of file diff --git a/resources/views/user/index.blade.php b/resources/views/user/index.blade.php index 9166d71..e8e1d8a 100644 --- a/resources/views/user/index.blade.php +++ b/resources/views/user/index.blade.php @@ -13,6 +13,10 @@
+ + @if(Session::has('success')) +
{{ Session::get('success') }}
+ @endif
@@ -36,6 +40,7 @@
+ Kemaskini Profil Kemaskini Katalaluan
diff --git a/resources/views/user/index_operasi.blade.php b/resources/views/user/index_operasi.blade.php index cf6d494..b4371a8 100644 --- a/resources/views/user/index_operasi.blade.php +++ b/resources/views/user/index_operasi.blade.php @@ -32,6 +32,8 @@
+ Kemaskini Profil + Kemaskini Katalaluan diff --git a/resources/views/user/update_password.blade.php b/resources/views/user/update_password.blade.php index 4e1caff..cdde4d9 100644 --- a/resources/views/user/update_password.blade.php +++ b/resources/views/user/update_password.blade.php @@ -1,4 +1,4 @@ -@extends('layouts.app') +@extends('layouts.app_operasi') @section('content')
@@ -23,7 +23,7 @@ @endforeach
- +
@@ -31,7 +31,7 @@
- +
@@ -39,7 +39,7 @@
- +
diff --git a/routes/web.php b/routes/web.php index 3f7bcc0..834e02b 100644 --- a/routes/web.php +++ b/routes/web.php @@ -82,6 +82,8 @@ Route::put('/aliran_tunai/Tebusan',['as'=>'alirantunai.tebus','uses' => 'AliranT Route::put('/aliran_tunai/advansur',['as'=>'alirantunai.advansur','uses' => 'AliranTunaiController@alirantunaiUpahBknTawarruq'])->middleware('auth','teller'); Route::get('/harga_emas','HargaEmasController@index')->middleware('auth','teller'); Route::get('/profile',['as'=>'profile','uses'=>'UserController@index'])->middleware('auth'); +Route::get('/profile/edit',['as'=>'profile.edit','uses'=>'UserController@edit'])->middleware('auth'); +Route::post('/profile/edit/store',['as'=>'profile.editstore','uses'=>'UserController@editStore'])->middleware('auth'); Route::get('/customer/search',['as'=>'customer.search','uses'=>'CustomersController@search'])->middleware('auth','teller'); Route::post('/customer/store',['as'=>'customer.store','uses'=>'CustomersController@store'])->middleware('auth','teller'); Route::post('/gadai/store',['as'=>'gadai.store','uses'=>'GadaianController@store'])->middleware('auth','teller');