diff --git a/app/Http/Controllers/CustomersController.php b/app/Http/Controllers/CustomersController.php index f86df08..c5b978d 100644 --- a/app/Http/Controllers/CustomersController.php +++ b/app/Http/Controllers/CustomersController.php @@ -40,9 +40,10 @@ class CustomersController extends Controller $idtype = 'nokp'; $cawangan_info = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') . '/api/cawangan/'. $auth_user['cawangan'])->json(); $bank = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') . '/api/bank')->json(); + $pekerjaan = Http::withOptions(['verify' => config('app.api_verify')])->get($api_url . '/api/pekerjaan')->json(); $blacklist_search = false; - return view('customers.' . $cawangan_info['version'] . '.index',compact('search','blacklist_search','cawangan_info','bank','api_url','idtype')); + return view('customers.' . $cawangan_info['version'] . '.index',compact('search','blacklist_search','cawangan_info','bank','api_url','idtype','pekerjaan')); } public function info(Request $request){ @@ -51,7 +52,8 @@ class CustomersController extends Controller $cawangan_info = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') . '/api/cawangan/'. $auth_user['cawangan'])->json(); $customer_info = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') . '/api/customers/'. Session::get('noic'))->json(); - + // dd($customer_info); + $pekerjaan = Http::withOptions(['verify' => config('app.api_verify')])->get($api_url . '/api/pekerjaan')->json(); $komoditi = Komoditi::first(); $min_komoditi = $komoditi['min_komoditi']; @@ -68,7 +70,7 @@ class CustomersController extends Controller $request->session()->flash('activate_tab', 'SAG_baru'); } - return view($customer_page,compact('cawangan_info','api_url','customer_info','bakilelong','rugilelong','min_komoditi')); + return view($customer_page,compact('cawangan_info','api_url','customer_info','bakilelong','rugilelong','min_komoditi','pekerjaan')); } public function search(Request $request){ @@ -81,6 +83,7 @@ class CustomersController extends Controller $cawangan_info = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') . '/api/cawangan/'. $auth_user['cawangan'])->json(); $bank = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') . '/api/bank')->json(); $customer_info = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') . '/api/customers/'. $noic)->json(); + $pekerjaan = Http::withOptions(['verify' => config('app.api_verify')])->get($api_url . '/api/pekerjaan')->json(); $blacklist = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') . '/api/customer/blacklist',[ 'nokp' => $noic @@ -105,9 +108,9 @@ class CustomersController extends Controller }else{ if($blacklist){ $blacklist_search = true; - return view('customers.' . $cawangan_info['version'] . '.index',compact('blacklist_search','customer_info','search','noic','cawangan_info','bank','api_url','idtype')); + return view('customers.' . $cawangan_info['version'] . '.index',compact('blacklist_search','customer_info','search','noic','cawangan_info','bank','api_url','idtype','pekerjaan')); }else{ - return view('customers.' . $cawangan_info['version'] . '.index',compact('blacklist_search','customer_info','search','noic','cawangan_info','bank','api_url','idtype')); + return view('customers.' . $cawangan_info['version'] . '.index',compact('blacklist_search','customer_info','search','noic','cawangan_info','bank','api_url','idtype','pekerjaan')); } } } @@ -219,6 +222,7 @@ class CustomersController extends Controller 'nosiri' => $nosiri_latest, 'nota'=>$request->nota, 'kodkerja'=>$request->pekerjaan, + 'nota_pekerjaan'=>$request->nota_pekerjaan, 'tujuangadai'=>$request->tujuan_gadai, ]); diff --git a/app/Http/Controllers/KhazanahController.php b/app/Http/Controllers/KhazanahController.php index 5107345..2f056fd 100644 --- a/app/Http/Controllers/KhazanahController.php +++ b/app/Http/Controllers/KhazanahController.php @@ -79,15 +79,17 @@ class KhazanahController extends Controller Session::put('customer_info_khazanah',$customer_info); 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]); } + return redirect()->route('khazanah.customer_info')->with( ['customer_info' => $customer_info,'cawangan_info'=>$cawangan_info,'api_url'=>$api_url]); + + // return redirect()->back()->with('failed','Maaf,Tiada Data Pelanggan...'); + }else{ 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')); } + // return view('khazanah.index',compact('search','noic','cawangan_info','bank','api_url','idtype')); + return redirect()->back()->with('failed','Maaf, hanya taraf teller sahaja yang boleh mendaftar'); } } diff --git a/resources/views/admin/customer_info.blade.php b/resources/views/admin/customer_info.blade.php index 8400672..5d93938 100644 --- a/resources/views/admin/customer_info.blade.php +++ b/resources/views/admin/customer_info.blade.php @@ -145,10 +145,10 @@ -
+ {{--
-
+
--}} diff --git a/resources/views/callcenter/index.blade.php b/resources/views/callcenter/index.blade.php index 909a8dc..c707dc7 100644 --- a/resources/views/callcenter/index.blade.php +++ b/resources/views/callcenter/index.blade.php @@ -46,7 +46,7 @@ - +
@@ -56,14 +56,14 @@ @if ($message = Session::get('success')) -
-

{{ $message }}

-
- @elseif ($message = Session::get('failed')) -
-

{{ $message }}

-
- @endif +
+

{{ $message }}

+
+ @elseif ($message = Session::get('failed')) +
+

{{ $message }}

+
+ @endif @if($search == true ) diff --git a/resources/views/customers/v2/index.blade.php b/resources/views/customers/v2/index.blade.php index b151aea..10d2fcb 100644 --- a/resources/views/customers/v2/index.blade.php +++ b/resources/views/customers/v2/index.blade.php @@ -182,23 +182,24 @@
Pekerjaan
- @php - $pekerjaan = Http::withOptions(['verify' => config('app.api_verify')])->get($api_url . '/api/pekerjaan')->json(); - @endphp +
- @foreach($pekerjaan as $kerja) - + @endforeach +
Nota
-
+
-
Pekerjaan
- @php - $pekerjaan = Http::withOptions(['verify' => config('app.api_verify')])->get($api_url . '/api/pekerjaan')->json(); - @endphp +
- @foreach($pekerjaan as $kerja) - + @endforeach +
Nota
@@ -446,16 +448,17 @@
Pekerjaan
- @php - $pekerjaan = Http::withOptions(['verify' => config('app.api_verify')])->get($api_url . '/api/pekerjaan')->json(); - @endphp +
- @foreach($pekerjaan as $kerja) - + @endforeach +
Nota
@@ -527,6 +530,34 @@ function newcustomer(){ var id_type = $('#customerIDType').val(); + var nokp = $('#noic').val(); + + const date = nokp.substring(0, 6); + const year = parseInt(date.substring(0, 2), 10); + const month = parseInt(date.substring(2, 4), 10) - 1; + const day = parseInt(date.substring(4, 6), 10); + + const cutofYear = 20; + + const fullYear = year < cutofYear ? 2000 + year : 1900 + year; + const dateconvert = new Date(fullYear, month, day); + const today = new Date(); + + const eighteenthBirthday = new Date(dateconvert); + + eighteenthBirthday.setFullYear(dateconvert.getFullYear() + 18); + console.log(today,eighteenthBirthday); + if (today < eighteenthBirthday) { + Swal.fire({ + icon: 'error', + title: 'Amaran!', + text: 'Pelanggan Ini Dibawah Umur!' + }); + event.preventDefault(); + return false; + } + + if(id_type=='nokp'){ $('#daftar_pelanggan').modal('show'); }else if(id_type=='passport'){ @@ -1222,6 +1253,31 @@ var id_type = $('#customerIDType').val(); var nokp = $('#noic').val(); if(id_type=='nokp'){ + const date = nokp.substring(0, 6); + const year = parseInt(date.substring(0, 2), 10); + const month = parseInt(date.substring(2, 4), 10) - 1; + const day = parseInt(date.substring(4, 6), 10); + + const cutofYear = 20; + + const fullYear = year < cutofYear ? 2000 + year : 1900 + year; + const dateconvert = new Date(fullYear, month, day); + const today = new Date(); + + const eighteenthBirthday = new Date(dateconvert); + + eighteenthBirthday.setFullYear(dateconvert.getFullYear() + 18); + + if (today < eighteenthBirthday) { + Swal.fire({ + icon: 'error', + title: 'Amaran!', + text: 'Pelanggan Ini Dibawah Umur!' + }); + event.preventDefault(); + return false; + } + if($.isNumeric(nokp) == false){ if(nokp.substr(-1) != '*') { @@ -1281,6 +1337,17 @@ + @push('additional_scripts') @endpush -@endsection \ No newline at end of file +@endsection diff --git a/resources/views/customers/v2/info.blade.php b/resources/views/customers/v2/info.blade.php index c86a400..d57aa22 100644 --- a/resources/views/customers/v2/info.blade.php +++ b/resources/views/customers/v2/info.blade.php @@ -121,13 +121,13 @@
- + +
+ - -
@@ -143,14 +143,14 @@ +
- + - +
@@ -347,6 +347,28 @@
+
+
+ Pekerjaan +
+
+ @php + $pekerjaan = Http::withOptions(['verify' => config('app.api_verify')])->get($api_url . '/api/pekerjaan')->json(); + @endphp + +
+ +
+
+
No Akaun @@ -2519,6 +2541,8 @@ $('#telefon').attr('readonly', false); $('#telefon2').attr('readonly', false); $('#kodbank').attr('disabled', false); + $('#kodkerja').attr('disabled', false); + $('#nota_pekerjaan').attr('disabled', false); $('#noakaun').attr('readonly', false); $('#nota').attr('readonly', false); $('#alamat').attr('readonly', false); @@ -2540,6 +2564,8 @@ $('#telefon').attr('readonly', true); $('#telefon2').attr('readonly', true); $('#kodbank').attr('disabled', true); + $('#kodkerja').attr('disabled', true); + $('#nota_pekerjaan').attr('disabled', true); $('#noakaun').attr('readonly', true); $('#nota').attr('readonly', true); $('#alamat').attr('readonly', true); @@ -2553,6 +2579,8 @@ var telefon1 = $('#telefon').val(); var telefon2 = $('#telefon2').val(); var kodbank = $('#kodbank').val(); + var kodkerja = $('#kodkerja').val(); + var nota_pekerjaan = $('#nota_pekerjaan').val(); var noakaun = $('#noakaun').val(); var nota = $('#nota').val(); var alamat = $('#alamat').val(); @@ -2566,6 +2594,8 @@ "telefon1": telefon1, "telefon2": telefon2, "kodbank":kodbank, + "kodkerja":kodkerja, + "nota_pekerjaan":nota_pekerjaan, "noakaun":noakaun, 'nota':nota, 'alamat':alamat, @@ -2650,6 +2680,8 @@ $('#telefon2').attr('readonly', true); $('#noakaun').attr('readonly', true); $('#kodbank').attr('disabled', true); + $('#kodkerja').attr('disabled', true); + $('#nota_pekerjaan').attr('disabled', true); $('#nota').attr('readonly', true); $('#alamat').attr('readonly', true); $('#poskod').attr('readonly', true); @@ -2695,7 +2727,7 @@ }); async function removeansuran(event){ - + let ansid = $('input[name="belum"]:checked').val(); let harini = new Date();harini.setHours(0, 0, 0, 0); @@ -2706,7 +2738,7 @@ text: 'Ansuran untuk Pembiayaan Belum Selesai Sahaja!' }); - return false; + return false; } if(ansid == null && $("input[name='options']:checked").val() == 'belum_tebus'){ @@ -2729,7 +2761,7 @@ let ansuranlatest = await fetch(api_url + '/admin/ansuran/getLatest?' + queryString) .then(response => response.json()) .then(response => {return response}); - + if(Object.keys(ansuranlatest).length == 0){ Swal.fire({ icon: 'error', @@ -2747,9 +2779,9 @@ }catch(error){ console.error("Error:", error); } - - - + + + } @@ -2762,7 +2794,7 @@ } async function getKelulusanKhazanahOperasi(textstatus = 'none',norujukan){ - + const swalWithBootstrapButtons = Swal.mixin({ customClass: { confirmButton: 'btn btn-success', @@ -2829,7 +2861,7 @@ }) .then(response => response.json()) .then(response => {return response}); - + return siricreated; }else if (result.dismiss === Swal.DismissReason.cancel){ @@ -2923,7 +2955,7 @@ }).then(()=>{ location.reload(); }); - + }catch(error){ Swal.fire({ @@ -2934,4 +2966,15 @@ } } + @endsection diff --git a/resources/views/khazanah/index.blade.php b/resources/views/khazanah/index.blade.php index ea440a0..6567f34 100644 --- a/resources/views/khazanah/index.blade.php +++ b/resources/views/khazanah/index.blade.php @@ -33,13 +33,22 @@
+ @if ($message = Session::get('success')) +
+

{{ $message }}

+
+ @elseif ($message = Session::get('failed')) +
+

{{ $message }}

+
+ @endif
diff --git a/resources/views/khazanah/v2/info.blade.php b/resources/views/khazanah/v2/info.blade.php index e558cba..1be8e8a 100644 --- a/resources/views/khazanah/v2/info.blade.php +++ b/resources/views/khazanah/v2/info.blade.php @@ -122,13 +122,13 @@
- + +
+ - -
@@ -142,7 +142,7 @@ +
@@ -332,6 +332,28 @@ +
+
+ Pekerjaan +
+
+ @php + $pekerjaan = Http::withOptions(['verify' => config('app.api_verify')])->get($api_url . '/api/pekerjaan')->json(); + @endphp + +
+ +
+
+
No Akaun @@ -869,7 +891,7 @@ $.each(data,function(index,gadai_detail){ let histid = $('input[name="sudahtebus"]:checked').val(); let checkps = await checkPS(histid); - + if(histid == null){ Swal.fire({ icon: 'error', @@ -1383,6 +1405,8 @@ $.each(data,function(index,gadai_detail){ $('#telefon').attr('readonly', false); $('#telefon2').attr('readonly', false); $('#kodbank').attr('disabled', false); + $('#kodkerja').attr('disabled', false); + $('#nota_pekerjaan').attr('disabled', false); $('#noakaun').attr('readonly', false); $('#nota').attr('readonly', false); $('#nama').attr('readonly', false); @@ -1404,6 +1428,8 @@ $.each(data,function(index,gadai_detail){ $('#telefon').attr('readonly', true); $('#telefon2').attr('readonly', true); $('#kodbank').attr('disabled', true); + $('#kodkerja').attr('disabled', true); + $('#nota_pekerjaan').attr('disabled', true); $('#noakaun').attr('readonly', true); $('#nota').attr('readonly', true); $('#nama').attr('readonly', true); @@ -1427,6 +1453,8 @@ $.each(data,function(index,gadai_detail){ var telefon1 = $('#telefon').val(); var telefon2 = $('#telefon2').val(); var kodbank = $('#kodbank').val(); + var kodkerja = $('#kodkerja').val(); + var nota_pekerjaan = $('#nota_pekerjaan').val(); var noakaun = $('#noakaun').val(); var nota = $('#nota').val(); var nama = $('#nama').val(); @@ -1441,6 +1469,8 @@ $.each(data,function(index,gadai_detail){ "telefon1": telefon1, "telefon2": telefon2, "kodbank":kodbank, + "kodkerja":kodkerja, + "nota_pekerjaan":nota_pekerjaan, "noakaun":noakaun, 'nota':nota, 'nama':nama, @@ -1526,6 +1556,8 @@ $.each(data,function(index,gadai_detail){ $('#telefon2').attr('readonly', true); $('#noakaun').attr('readonly', true); $('#kodbank').attr('disabled', true); + $('#kodkerja').attr('disabled', true); + $('#nota_pekerjaan').attr('disabled', true); $('#nota').attr('readonly', true); $('#nama').attr('readonly', true); $('#alamat').attr('readonly', true); @@ -1580,4 +1612,16 @@ $.each(data,function(index,gadai_detail){ }); }); + + @endsection