diff --git a/app/Http/Controllers/BayaranController.php b/app/Http/Controllers/BayaranController.php index eab99f3..a8cc694 100644 --- a/app/Http/Controllers/BayaranController.php +++ b/app/Http/Controllers/BayaranController.php @@ -35,6 +35,8 @@ class BayaranController extends Controller public function SenaraiPembayaran() { + $api_url = config('api.url'); + $arraysag = []; $auth_user = Auth::user(); @@ -58,7 +60,7 @@ class BayaranController extends Controller $belum_tebus = $arraysag; // return view('pembayaran.senaraibayaran', compact('belum_tebus')); - return view('includes.bayaran.senaraibayaransag', compact('belum_tebus')); + return view('includes.bayaran.senaraibayaransag', compact('belum_tebus','api_url')); } public function PembayaranAction(Request $request) @@ -269,6 +271,8 @@ class BayaranController extends Controller 'billplz_id' => $data['billplz']['id'] ])->json(); + // \Mail::to(Auth::user()->email)->send(new \App\Mail\BayaranMail($array_payment)); + return redirect()->route('pay.success',[ 'transactionOnline' => $transactionOnline ]); diff --git a/app/Http/Controllers/HomeController.php b/app/Http/Controllers/HomeController.php index bcba937..b42635e 100644 --- a/app/Http/Controllers/HomeController.php +++ b/app/Http/Controllers/HomeController.php @@ -1,6 +1,8 @@ config('app.api_verify')])->get(config('api.url') .'/api/harga_emas/')->json(); $hargaemasterdahulu = array(); @@ -35,6 +38,49 @@ class HomeController extends Controller } - return view('includes.home',compact('hargaemasterdahulu')); + + $CustomerInfo = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') .'/portal/customer/info',['ic' => $auth_user['icno']])->json(); + + $total = 0.00; + $sixmonths = 0; + $bilangan = 0; + foreach($CustomerInfo['gadai'] as $index=>$gadai) + { + $bilangan++; + $total += $gadai['pinjaman']; + + if($gadai['tempoh'] >= 6) + { + $sixmonths++; + } + } + + $bilanganlelong = 0; + foreach($CustomerInfo['lelong'] as $index1=>$lelong) + { + $bilanganlelong += 1; + } + + $arraysag = []; + $belum_tebus = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') . '/api/customers/'. $auth_user['icno'] . '/gadai/' . 'belum_tebus')->json(); + + if(is_array($belum_tebus)) + { + if(sizeof($belum_tebus) > 0) + { + foreach($belum_tebus as $index=>$bt) + { + foreach($bt as $index1=>$bet) + { + array_push($arraysag,$bet); + } + } + } + } + + $belum_tebus = $arraysag; + $api_url = config('api.url'); + + return view('includes.home',compact('api_url','belum_tebus','hargaemasterdahulu','bilangan','sixmonths','total','bilanganlelong')); } } diff --git a/app/Http/Controllers/InformationController.php b/app/Http/Controllers/InformationController.php new file mode 100644 index 0000000..8ec9fc7 --- /dev/null +++ b/app/Http/Controllers/InformationController.php @@ -0,0 +1,76 @@ + config('app.api_verify')])->get(config('api.url') .'/portal/customer/info',['ic' => $auth_user['icno']])->json(); + + $pembiayaansemasa = []; + if(isset($CustomerInfo['gadai'])) + { + $pembiayaansemasa = $CustomerInfo['gadai']; + } + + return view('includes.information.pembiayaansemasa',compact('pembiayaansemasa')); + } + + public function pembiayaanaktif() + { + $auth_user = Auth::User(); + + $CustomerInfo = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') .'/portal/customer/info',['ic' => $auth_user['icno']])->json(); + + $pembiayaansemasa = []; + if(isset($CustomerInfo['gadai'])) + { + $pembiayaansemasa = $CustomerInfo['gadai']; + } + + return view('includes.information.pembiayaanaktif',compact('pembiayaansemasa')); + } + + public function pembiayaanmelebihi6bulan() + { + $auth_user = Auth::User(); + + $CustomerInfo = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') .'/portal/customer/info',['ic' => $auth_user['icno']])->json(); + + $melebihi6bulan = []; + if(isset($CustomerInfo['gadai'])) + { + foreach($CustomerInfo['gadai'] as $index=>$gadai) + { + if($gadai['jbg'] >= 6) + { + array_push($melebihi6bulan,$gadai); + } + } + } + + return view('includes.information.melebihi6bulan',compact('melebihi6bulan')); + } + + public function pembiayaanakandilelong() + { + $auth_user = Auth::User(); + + $CustomerInfo = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') .'/portal/customer/info',['ic' => $auth_user['icno']])->json(); + + $lelong = []; + if(isset($CustomerInfo['lelong'])) + { + $lelong += $CustomerInfo['lelong']; + } + + return view('includes.information.lelongan',compact('lelong')); + } +} diff --git a/app/Mail/BayaranMail.php b/app/Mail/BayaranMail.php new file mode 100644 index 0000000..b042874 --- /dev/null +++ b/app/Mail/BayaranMail.php @@ -0,0 +1,36 @@ +details = $details; + } + + /** + * Build the message. + * + * @return $this + */ + public function build() + { + return $this->subject('Emel Bayaran Yang Dibuat') + ->view('emails.bayaran'); + } +} diff --git a/resources/views/auth/passwords/email.blade.php b/resources/views/auth/passwords/email.blade.php index 88b8cdc..d2f13de 100644 --- a/resources/views/auth/passwords/email.blade.php +++ b/resources/views/auth/passwords/email.blade.php @@ -2,7 +2,7 @@ @section('content') -Lupa Kata Laluan | Customer Portal +Lupa Kata Laluan | Portal Pelanggan
Lupa Kata Laluan
@@ -83,7 +83,7 @@
- Speed Payment(SPARE) + Bayaran Pantas(SPARE)

diff --git a/resources/views/auth/passwords/forgetpassword.blade.php b/resources/views/auth/passwords/forgetpassword.blade.php index 46a8581..1369dc6 100644 --- a/resources/views/auth/passwords/forgetpassword.blade.php +++ b/resources/views/auth/passwords/forgetpassword.blade.php @@ -2,7 +2,7 @@ @section('content') -Lupa Kata Laluan | Customer Portal +Lupa Kata Laluan | Portal Pelanggan

Lupa Kata Laluan
diff --git a/resources/views/auth/pertama-kali/firsttime.blade.php b/resources/views/auth/pertama-kali/firsttime.blade.php index c5f226f..bb6df13 100644 --- a/resources/views/auth/pertama-kali/firsttime.blade.php +++ b/resources/views/auth/pertama-kali/firsttime.blade.php @@ -52,7 +52,7 @@ -->
-

Customer Portal

+

Portal Pelanggan

diff --git a/resources/views/auth/pertama-kali/firsttime2.blade.php b/resources/views/auth/pertama-kali/firsttime2.blade.php index 2a3f8b2..819b5a6 100644 --- a/resources/views/auth/pertama-kali/firsttime2.blade.php +++ b/resources/views/auth/pertama-kali/firsttime2.blade.php @@ -76,7 +76,7 @@ -Daftar Akaun | Customer Portal +Daftar Akaun | Portal Pelanggan + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/resources/views/includes/analisaportal.blade.php b/resources/views/includes/analisaportal.blade.php index 7b26cf3..7635451 100644 --- a/resources/views/includes/analisaportal.blade.php +++ b/resources/views/includes/analisaportal.blade.php @@ -53,7 +53,7 @@ } -Analisa | Customer Portal +Analisa | Portal Pelanggan
pattern-lines @@ -90,7 +90,7 @@
-
Bilangan Pembiayaan Aktif
+
Pembiayaan Aktif
{{ number_format($bilangan_belum_tebus) }}
@@ -124,12 +124,12 @@
-
Bilangan Pembiayaan Akan Dilelong
+
Pembiayaan Akan Dilelong
{{ number_format($bilakandilelong) }}
- +
diff --git a/resources/views/includes/bayaran/pembayaransag.blade.php b/resources/views/includes/bayaran/pembayaransag.blade.php index 16d3b94..c8173ea 100644 --- a/resources/views/includes/bayaran/pembayaransag.blade.php +++ b/resources/views/includes/bayaran/pembayaransag.blade.php @@ -12,7 +12,7 @@ } -Bayar SAG | Customer Portal +Bayar SAG | Portal Pelanggan
@@ -283,13 +283,22 @@
+
+
+ +
+ +
+ RM 1.00 +
+
- RM 0.00 + RM 1.00
@@ -298,7 +307,7 @@
- Batal + Batal
@@ -494,7 +503,7 @@ $("#spanbayaranarrahn").text(sumarrahn.toFixed(2)); $("#spanbayarantawarruq").text(sumtawarruq.toFixed(2)); - $('#spanjumlah').text(formatter.format(sum)); + $('#spanjumlah').text(formatter.format(sum + 1)); } if (document.addEventListener) { diff --git a/resources/views/includes/bayaran/senaraibayaransag.blade.php b/resources/views/includes/bayaran/senaraibayaransag.blade.php index a2be44b..c39fa94 100644 --- a/resources/views/includes/bayaran/senaraibayaransag.blade.php +++ b/resources/views/includes/bayaran/senaraibayaransag.blade.php @@ -25,12 +25,12 @@ @enderror -Pembayaran | Customer Portal +Pembayaran | Portal Pelanggan
@@ -67,7 +67,7 @@ # - Ar-Rahn + Cawangan No Rujukan Keuntungan Semasa @@ -118,7 +118,7 @@ @php $marhun = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') . '/api/marhun/' . $bt['norujukan'] )->json(); @endphp - {{ $bt['norujukan'] }} + {{ $bt['norujukan'] }}
@@ -141,7 +141,7 @@
- +
@@ -150,6 +150,8 @@
+ + +@endsection \ No newline at end of file diff --git a/resources/views/includes/home.blade.php b/resources/views/includes/home.blade.php index 592ce88..3a3dae4 100644 --- a/resources/views/includes/home.blade.php +++ b/resources/views/includes/home.blade.php @@ -1,6 +1,6 @@ @extends ('layouts.indexfirst') - @section('content') +@include('modal.marhun') -Home | Customer Portal +Home | Portal Pelanggan - +@error('chkboxsag') + +@enderror - - - img-colored-shadow - -
-
-
- Tebus -
- -
- - -
-
-
- - img-colored-shadow - -
- -
-
-
-
-
- - - - img-colored-shadow - -
-
-
- PitihEmas -
- -
-
-
- -
-
- {{--
-
-
-

Harga Emas

+
+
+
+
+
+
+
Jumlah Pemb. Semasa
+ RM{{ number_format($total,2) }} +
+
+
+ +
+
+ Masuk +
+
+
+
+
+ +
+
+
+
+
+
Pembiayaan
Aktif
+ {{ $bilangan }} +
+
+
+ +
+
+ Masuk +
+
+
+
+
+
+
+
+
+
+
Pembiayaan Melebihi 6 Bulan
+ {{ $sixmonths }} +
+
+
+ +
+
+ Masuk +
+
+
+
+
+
+
+
+
+
+
Pembiayaan Akan Dilelong
+ {{ $bilanganlelong }} +
+
+
+ +
+
+ Masuk +
-
--}} -
- - - - - - - - - - - @foreach($hargaemasterdahulu as $index=>$hm) - - - - @if($hm['percent'] > 0) - - @else - - @endif - - @endforeach - - -
KaratHarga (RM)Perubahan (%)
{{ $hm['karat'] }}{{ $hm['hargasemasa'] }}({{ number_format($hm['percent'],2) }})({{ number_format($hm['percent']*-1,2) }})
+ + +
+ @csrf +
+
+ +
+ Maksimum 3 SAG dibenarkan dalam satu transaksi . +
+
+ + + + + + + + + + + @foreach($belum_tebus as $index=>$bt) + @if($bt['hargajualan'] != '') + @php + $searchonline = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') . '/portal/searchsagonline/',['norujukan' => $bt['norujukan']])->json(); + + $searchLelong = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url').'/api/search/lelong',[ + 'kodcaw' => $bt['kodcaw'], + 'norujukan' => $bt['norujukan'] + ])->json(); + + if($searchLelong){ + $t_lelong = Carbon\Carbon::parse($searchLelong['t_lelong'].' 00:00:00'); + $tarikhini = Carbon\Carbon::parse($tarikh_hari_ini.' 00:00:00'); + $diff=date_diff($tarikhini,$t_lelong); + $diff = (int)$diff->format("%R%a"); + if($diff <= 2){ // 'messageamaran'=>'Rekod Gadaian Dalam Proses Lelong, Sila Hadir ke Cawangan.' + }elseif($searchLelong['t_jual'] != null && $searchLelong['hargajual'] != 0.00){ + // 'messageamaran'=>'Rekod Gadaian Telah Dilelong.' + + } + } + + $koskeuntungan = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') . '/api/upahtawarruq/' . $bt['kodcaw'] . '/' . $bt['norujukan'])->json(); + $keuntungan_1bln = $bt['pinjaman'] * ($bt['kadarupah'] / 100); + $ten_percent = floatval($bt['nilaimarhun']) * 0.1; + $baki_pinjaman = floatval($bt['bakipjm']); + $max_bayaran = $baki_pinjaman - $ten_percent; + @endphp + + + + + + {{-- --}} + + @endif + @endforeach + +
#CawanganNo RujukanKeuntungan Semasa
+ + {{-- --}} + + @php + $namacawangan = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') . '/api/cawangan/detail/' . $bt['kodcaw'] )->json(); + echo ucwords(strtolower(substr($namacawangan[0]['namacaw'],8))); + @endphp + +
+
+ @php + $marhun = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') . '/api/marhun/' . $bt['norujukan'] )->json(); + @endphp + {{ $bt['norujukan'] }} +
+
+
+ {{ is_numeric($koskeuntungan) ? number_format($koskeuntungan,2) : $koskeuntungan }} + + @if($bt['taglel'] === 1) + Akan Dilelong + @endif +
+
+
+
+
+ +
+ +
+ +
+ +
-

Customer Portal

+

Portal Pelanggan

diff --git a/resources/views/includes/login/loginportal.blade.php b/resources/views/includes/login/loginportal.blade.php index 15e9088..7afefaa 100644 --- a/resources/views/includes/login/loginportal.blade.php +++ b/resources/views/includes/login/loginportal.blade.php @@ -9,14 +9,14 @@ } -Log In | Customer Portal +Log In | Portal Pelanggan
Log-Masuk
diff --git a/resources/views/includes/profile.blade.php b/resources/views/includes/profile.blade.php index d3930f3..af300f8 100644 --- a/resources/views/includes/profile.blade.php +++ b/resources/views/includes/profile.blade.php @@ -2,7 +2,7 @@ @section('content') -Profil | Customer Portal +Profil | Portal Pelanggan
diff --git a/resources/views/includes/rekod/pilihcawangan.blade.php b/resources/views/includes/rekod/pilihcawangan.blade.php index cc3f9a0..f8f9adb 100644 --- a/resources/views/includes/rekod/pilihcawangan.blade.php +++ b/resources/views/includes/rekod/pilihcawangan.blade.php @@ -2,7 +2,7 @@ @section('content') -Rekod Pembayaran | Customer Portal +Rekod Pembayaran | Portal Pelanggan
@@ -25,7 +25,7 @@ logo ar-rahn -

Senarai SAG gadaian dan penebusan pelanggan.

+

Senarai Pembayaran dan penebusan pelanggan.

Cawangan : {{ $cawangan_info[0]['cawangan'] }}
diff --git a/resources/views/modal/marhun.blade.php b/resources/views/modal/marhun.blade.php index 492d33b..c4a0811 100644 --- a/resources/views/modal/marhun.blade.php +++ b/resources/views/modal/marhun.blade.php @@ -4,55 +4,109 @@