From 1a86a9081facc0ee7d29732ecd64395f2d53632c Mon Sep 17 00:00:00 2001 From: afiq Date: Mon, 9 Aug 2021 01:19:58 +0800 Subject: [PATCH] admin page customer --- app/Http/Controllers/HomeController.php | 8 + app/Http/Controllers/KhazanahController.php | 25 +- .../views/admin/customer_index.blade.php | 860 ++++++++++++++++++ resources/views/admin/customer_info.blade.php | 363 ++++++++ resources/views/admin/poskod.blade.php | 53 ++ resources/views/homepage/admin/home.blade.php | 2 + resources/views/print/sag.blade.php | 4 +- routes/web.php | 4 + 8 files changed, 1313 insertions(+), 6 deletions(-) create mode 100644 resources/views/admin/customer_index.blade.php create mode 100644 resources/views/admin/customer_info.blade.php create mode 100644 resources/views/admin/poskod.blade.php diff --git a/app/Http/Controllers/HomeController.php b/app/Http/Controllers/HomeController.php index 4bf15b1..5296414 100644 --- a/app/Http/Controllers/HomeController.php +++ b/app/Http/Controllers/HomeController.php @@ -52,4 +52,12 @@ class HomeController extends Controller return view('homepage.'.$auth_user['roles'].'.home',compact('cawangan_info','api_url')); } } + + public function poskod(){ + $api_url = config('api.url'); + $auth_user = Auth::user(); + $cawangan_info = Http::get(config('api.url') . '/api/cawangan/'. $auth_user['cawangan'])->json(); + + return view('admin.poskod',compact('cawangan_info','api_url','auth_user')); + } } diff --git a/app/Http/Controllers/KhazanahController.php b/app/Http/Controllers/KhazanahController.php index d9dca21..c7e2df5 100644 --- a/app/Http/Controllers/KhazanahController.php +++ b/app/Http/Controllers/KhazanahController.php @@ -41,7 +41,11 @@ class KhazanahController extends Controller $idtype = 'nokp'; $cawangan_info = Http::get(config('api.url') . '/api/cawangan/'. $auth_user['cawangan'])->json(); $bank = Http::get(config('api.url') . '/api/bank')->json(); - return view('khazanah.index',compact('search','cawangan_info','bank','api_url','idtype')); + if($auth_user->roles == 'admin'){ + return view('admin.customer_index',compact('search','cawangan_info','bank','api_url','idtype','auth_user')); + }else{ + return view('khazanah.index',compact('search','cawangan_info','bank','api_url','idtype','auth_user')); + } } public function search(Request $request){ @@ -66,9 +70,17 @@ class KhazanahController extends Controller if($customer_info){ Session::put('customer_info_khazanah',$customer_info); - return redirect()->route('khazanah.customer_info')->with( ['customer_info' => $customer_info,'cawangan_info'=>$cawangan_info,'api_url'=>$api_url]); + if($auth_user->roles == 'admin'){ + return redirect()->route('admin.customer_info')->with( ['customer_info' => $customer_info,'cawangan_info'=>$cawangan_info,'api_url'=>$api_url]); + }else{ + return redirect()->route('khazanah.customer_info')->with( ['customer_info' => $customer_info,'cawangan_info'=>$cawangan_info,'api_url'=>$api_url]); + } }else{ - return view('khazanah.index',compact('search','noic','cawangan_info','bank','api_url','idtype')); + if($auth_user->roles == 'admin'){ + return view('admin.customer_index',compact('search','noic','cawangan_info','bank','api_url','idtype')); + }else{ + return view('khazanah.index',compact('search','noic','cawangan_info','bank','api_url','idtype')); + } } } @@ -92,7 +104,12 @@ class KhazanahController extends Controller $request->session()->forget('page_reload'); $request->session()->forget('norujukan'); - return view('khazanah.info',compact('cawangan_info','api_url','customer_info','bakilelong','rugilelong','negeri')); + + if($auth_user->roles == 'admin'){ + return view('admin.customer_info',compact('cawangan_info','api_url','customer_info','bakilelong','rugilelong','negeri')); + }else{ + return view('khazanah.info',compact('cawangan_info','api_url','customer_info','bakilelong','rugilelong','negeri')); + } } public function menu() diff --git a/resources/views/admin/customer_index.blade.php b/resources/views/admin/customer_index.blade.php new file mode 100644 index 0000000..8e3c1ca --- /dev/null +++ b/resources/views/admin/customer_index.blade.php @@ -0,0 +1,860 @@ +@extends('layouts.app_operasi') + +@section('content') + +
+
+
+ + + +
+
+
+
masukkan nombor kad pengenalan
+
+
+
+
+ +
+ +
+
+ +
+
+
+
+
+
+ @if($search == true ) +
+ +
+ @endif +
+
+ + + + +
+
+
+ +@endsection \ No newline at end of file diff --git a/resources/views/admin/customer_info.blade.php b/resources/views/admin/customer_info.blade.php new file mode 100644 index 0000000..067d5d2 --- /dev/null +++ b/resources/views/admin/customer_info.blade.php @@ -0,0 +1,363 @@ +@extends('layouts.app_operasi') + + +@section('content') +@include('modal.historytebus') +@include('modal.wakil') +@include('modal.agh') + + +
+
+
+ + +
+
+
+
+
+
+
+ Nama +
+
+ +
+
+
+
+ No KP +
+
+ +
+
+
+
+ No Pelanggan +
+
+ +
+
+
+
+ No Telefon 1 +
+
+ + +
+
+
+
+ No Telefon 2 +
+
+ + +
+
+
+
+ Bank +
+
+ @php + $bank = Http::get($api_url . '/api/bank')->json(); + @endphp + + +
+
+
+
+ No Akaun +
+
+ + +
+
+
+
+
+
+ Alamat +
+
+ +
+
+
+
+ Poskod +
+
+ +
+
+
+
+ Daerah +
+
+ @php + $poskod = Http::get($api_url . '/api/poskod/'. $customer_info['poskod'])->json(); + if(empty($poskod)){ + $poskod = array('koddaerah'=>'NIL','kodnegeri' => 'NIL'); + } + $daerah = Http::get($api_url . '/api/daerah/' . $poskod['koddaerah'])->json(); + @endphp + +
+
+
+
+ Negeri +
+
+ @php + $negeri = Http::get($api_url . '/api/negeri/' . $poskod['kodnegeri'])->json(); + @endphp + +
+
+
+
+ Nota +
+
+ +
+
+
+
+
+ + +
+
+
+
+
+
+
+ + +@endsection diff --git a/resources/views/admin/poskod.blade.php b/resources/views/admin/poskod.blade.php new file mode 100644 index 0000000..7b30aa2 --- /dev/null +++ b/resources/views/admin/poskod.blade.php @@ -0,0 +1,53 @@ +@extends('layouts.app_operasi') + +@section('content') + +
+
+
+ + + +
+
+
+
masukkan poskod
+
+
+
+
+ +
+ +
+
+
+
+
+
+ @if($search ?? '' == true ) +
+ +
+ @endif +
+
+
+
+
+ +@endsection \ No newline at end of file diff --git a/resources/views/homepage/admin/home.blade.php b/resources/views/homepage/admin/home.blade.php index 6c00060..26281b3 100644 --- a/resources/views/homepage/admin/home.blade.php +++ b/resources/views/homepage/admin/home.blade.php @@ -15,6 +15,8 @@
Kakitangan + Pelanggan +
diff --git a/resources/views/print/sag.blade.php b/resources/views/print/sag.blade.php index 610e3cf..ff9af6a 100644 --- a/resources/views/print/sag.blade.php +++ b/resources/views/print/sag.blade.php @@ -446,7 +446,7 @@ NO MYKAD - {{$gadai_detail['nokp']}} + {{$gadai_detail['nokp']}} TARIKH PEMBIAYAAN @php @@ -889,7 +889,7 @@ NO MYKAD - {{$gadai_detail['nokp']}} + {{$gadai_detail['nokp']}} TARIKH PEMBIAYAAN @php diff --git a/routes/web.php b/routes/web.php index 2cdba5d..7a192a6 100644 --- a/routes/web.php +++ b/routes/web.php @@ -278,3 +278,7 @@ Route::post('admin/kakitangan/delete',['as'=>'admin.kakitangan.delete','uses'=>' Route::get('admin/kakitangan/edit',['as'=>'admin.kakitangan.edit','uses'=>'KakitanganController@editKakitangan'])->middleware('auth','admin'); Route::post('admin/kakitangan/edit/store',['as'=>'admin.kakitangan.edit.store','uses'=>'KakitanganController@editStoreKakitangan'])->middleware('auth','admin'); Route::get('admin/kakitangan/resetcredentials',['as'=>'admin.kakitangan.resetcredentials','uses'=>'KakitanganController@resetCredentials'])->middleware('auth','admin'); +Route::get('admin/pelanggan',['as'=>'admin.pelanggan','uses'=>'KhazanahController@index'])->middleware('auth','admin'); +Route::get('admin/customer_info',['as'=>'admin.customer_info','uses'=>'KhazanahController@info'])->middleware('auth','admin'); +Route::get('admin/searchpelanggan',['as'=>'admin.searchpelanggan','uses'=>'KhazanahController@search'])->middleware('auth','admin'); +Route::get('admin/poskod',['as'=>'admin.poskod','uses'=>'HomeController@poskod']); \ No newline at end of file