From b75eecdafbefbb5f7c95e26a9bcdaea6956222b5 Mon Sep 17 00:00:00 2001 From: hafifierahman Date: Tue, 26 Apr 2022 10:35:36 +0800 Subject: [PATCH] fix skit2 --- .../Controllers/InformationController.php | 14 +- app/Http/Controllers/TacController.php | 14 +- .../views/auth/passwords/email.blade.php | 2 +- .../auth/pertama-kali/firsttime2.blade.php | 6 +- .../includes/bayaran/pembayaransag.blade.php | 2 +- .../views/includes/home.blade copy 2.php | 243 ++++++++++ resources/views/includes/home.blade.php | 450 ++++++++++++++---- .../includes/login/loginportal.blade.php | 2 +- 8 files changed, 625 insertions(+), 108 deletions(-) create mode 100644 resources/views/includes/home.blade copy 2.php diff --git a/app/Http/Controllers/InformationController.php b/app/Http/Controllers/InformationController.php index 8ec9fc7..7580401 100644 --- a/app/Http/Controllers/InformationController.php +++ b/app/Http/Controllers/InformationController.php @@ -20,7 +20,9 @@ class InformationController extends Controller $pembiayaansemasa = $CustomerInfo['gadai']; } - return view('includes.information.pembiayaansemasa',compact('pembiayaansemasa')); + return response()->json($pembiayaansemasa,200); + + // return view('includes.information.pembiayaansemasa',compact('pembiayaansemasa')); } public function pembiayaanaktif() @@ -35,7 +37,8 @@ class InformationController extends Controller $pembiayaansemasa = $CustomerInfo['gadai']; } - return view('includes.information.pembiayaanaktif',compact('pembiayaansemasa')); + return response()->json($pembiayaansemasa,200); + // return view('includes.information.pembiayaanaktif',compact('pembiayaansemasa')); } public function pembiayaanmelebihi6bulan() @@ -56,7 +59,8 @@ class InformationController extends Controller } } - return view('includes.information.melebihi6bulan',compact('melebihi6bulan')); + return response()->json($melebihi6bulan,200); + // return view('includes.information.melebihi6bulan',compact('melebihi6bulan')); } public function pembiayaanakandilelong() @@ -71,6 +75,8 @@ class InformationController extends Controller $lelong += $CustomerInfo['lelong']; } - return view('includes.information.lelongan',compact('lelong')); + + return response()->json($lelong,200); + // return view('includes.information.lelongan',compact('lelong')); } } diff --git a/app/Http/Controllers/TacController.php b/app/Http/Controllers/TacController.php index 5cdb8c8..36f522c 100644 --- a/app/Http/Controllers/TacController.php +++ b/app/Http/Controllers/TacController.php @@ -6,6 +6,7 @@ use Illuminate\Http\Request; use Illuminate\Support\Facades\Http; use App\Models\tacportal; +use App\Models\User; use Carbon\Carbon; class TacController extends Controller @@ -30,14 +31,13 @@ class TacController extends Controller $currentDateTime = Carbon::now(); $expiretac = tacportal::where('icno',$request->icno) - ->whereDate('created_at','>=',$currentDateTime) - ->whereDate('expired_at','<=',$currentDateTime) - ->where('created_at','>=',$currentDateTime->toDateTimeString()) - // ->whereTime('expired_at','<=',$currentDateTime) - // ->orderBy('tac_id','desc') - // ->latest() + ->whereDate('created_at','=',$currentDateTime) + ->whereDate('expired_at','=',$currentDateTime) + ->whereTime('expired_at','>=',$currentDateTime->toDateTimeString()) + ->where('created_at','<=',$currentDateTime->toDateTimeString()) + ->latest() ->first(); - dd($expiretac); + if($expiretac){ return response(['notexpired' => true]); } diff --git a/resources/views/auth/passwords/email.blade.php b/resources/views/auth/passwords/email.blade.php index d2f13de..113db80 100644 --- a/resources/views/auth/passwords/email.blade.php +++ b/resources/views/auth/passwords/email.blade.php @@ -83,7 +83,7 @@
- Bayaran Pantas(SPARE) + Bayaran Pantas (SPARE)

diff --git a/resources/views/auth/pertama-kali/firsttime2.blade.php b/resources/views/auth/pertama-kali/firsttime2.blade.php index 51b1e66..2842c28 100644 --- a/resources/views/auth/pertama-kali/firsttime2.blade.php +++ b/resources/views/auth/pertama-kali/firsttime2.blade.php @@ -154,7 +154,7 @@

- Speed Payment(SPARE) + BAYARAN PANTAS (SPARE)

Log-Masuk @@ -186,13 +186,13 @@ Koperasi Permodalan Kelantan Berhad -

+ {{-- +
--}} diff --git a/resources/views/includes/bayaran/pembayaransag.blade.php b/resources/views/includes/bayaran/pembayaransag.blade.php index c8173ea..935eb8e 100644 --- a/resources/views/includes/bayaran/pembayaransag.blade.php +++ b/resources/views/includes/bayaran/pembayaransag.blade.php @@ -285,7 +285,7 @@
- +
diff --git a/resources/views/includes/home.blade copy 2.php b/resources/views/includes/home.blade copy 2.php new file mode 100644 index 0000000..9494aa9 --- /dev/null +++ b/resources/views/includes/home.blade copy 2.php @@ -0,0 +1,243 @@ +@extends ('layouts.indexfirst') + +@section('content') + + + +Home | Portal Pelanggan + +
+
+
+
+
+
+
Jumlah Pemb. Semasa
+ RM{{ number_format($total,2) }} +
+
+
+ +
+
+ Masuk +
+
+
+
+
+ +
+
+
+
+
+
Pembiayaan
Aktif
+ {{ $bilangan }} +
+
+
+ +
+
+ Masuk +
+
+
+
+
+
+
+
+
+
+
Pembiayaan Melebihi 6 Bulan
+ {{ $sixmonths }} +
+
+
+ +
+
+ Masuk +
+
+
+
+
+
+
+
+
+
+
Pembiayaan Akan Dilelong
+ {{ $bilanganlelong }} +
+
+
+ +
+
+ Masuk +
+
+
+
+
+
+ +{{--
+
+ + +
+
--}} +
+
+
+ + img-colored-shadow + +
+
+
+ Pembayaran +
+ Masuk +
+
+
+
+
+
+ + + + + img-colored-shadow + +
+
+
+ Tebus +
+ +
+
+
+{{-- --}} +
+
+
+ + + + img-colored-shadow + +
+
+
+ Pitih Emas +
+ +
+
+
+ +
+
+ {{--
+
+
+

Harga Emas

+
+
+
--}} +
+ + + + + + + {{-- --}} + + + + @foreach($hargaemasterdahulu as $index=>$hm) + + + + + @endforeach + +
KaratHarga (RM)Perubahan (%)
{{ $hm['karat'] }}{{ $hm['hargasemasa'] }}
+
+
+
+ + + +@endsection \ No newline at end of file diff --git a/resources/views/includes/home.blade.php b/resources/views/includes/home.blade.php index 3a3dae4..488fd34 100644 --- a/resources/views/includes/home.blade.php +++ b/resources/views/includes/home.blade.php @@ -17,6 +17,27 @@ box-sizing: border-box; z-index: 10000 !important; } + + .loadertable { + border: 16px solid #f3f3f3; + border-radius: 50%; + border-top: 16px solid #3498db; + width: 120px; + height: 120px; + -webkit-animation: spin 2s linear infinite; /* Safari */ + animation: spin 2s linear infinite; + } + + /* Safari */ + @-webkit-keyframes spin { + 0% { -webkit-transform: rotate(0deg); } + 100% { -webkit-transform: rotate(360deg); } + } + + @keyframes spin { + 0% { transform: rotate(0deg); } + 100% { transform: rotate(360deg); } + } Home | Portal Pelanggan @@ -49,15 +70,15 @@
-
Jumlah Pemb. Semasa
+
Jum. Pembiayaan Semasa
RM{{ number_format($total,2) }}
-
- +
+

- Masuk +
@@ -73,11 +94,11 @@ {{ $bilangan }}
-
- +
+

- Masuk +
@@ -92,11 +113,11 @@ {{ $sixmonths }}
-
- +
+

- Masuk +
@@ -115,7 +136,7 @@
- Masuk + @@ -124,14 +145,18 @@ -
+
+ + @csrf
- Maksimum 3 SAG dibenarkan dalam satu transaksi . + Maksima 3 No Rujukan Sahaja Dibenarkan Dalam Satu Transaksi Pembayaran.
+ Sila 'Tick' Pada Kotak Yang Hendak Dibayar.
+
@@ -139,70 +164,23 @@ - + + + + - @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 +
# Cawangan No RujukanKeuntungan SemasaJBGKeuntunganT LanjutAkan Dilelong
1111111
- - {{-- --}} - - @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 -
@@ -250,6 +228,294 @@ var hargaemastable = $('#harga_emas').DataTable({ "scrollX": true }); + $( document ).ready(function() { + filterjumlahpembsemasa(); + }); + + function filterjumlahpembsemasa(){ + + $('#loadertable').removeClass('d-none'); + $('#formtable').addClass('d-none'); + + let datapembsemasa = []; + $.ajax({ + url: '{{ route("info.pembsemasa") }}', + method: 'get', + async: false, + dataType: "json", + success: function(data) { + for(i in data){ + datapembsemasa.push(data[i]); + } + $('#loadertable').addClass('d-none'); + $('#formtable').removeClass('d-none'); + + } + }); + + + selepastawarruqtable.clear().draw(); + var counter = 1; + $.each(datapembsemasa,function(index,ps){ + + let namacawangan = ''; + $.ajax({ + url: api_url + '/api/cawangan/detail/' + ps.kodcaw, + method: 'get', + async:false, + dataType: "json", + success: function(data) { + namacawangan = data[0].namacaw; + namacawangan = namacawangan.toLowerCase().substring(8).replace(/\b[a-z]/g, function(value) { + return value.toUpperCase(); + }); + } + }); + + let marhun = []; + $.ajax({ + url: api_url + '/api/marhun/' + ps.norujukan, + method: 'get', + async:false, + dataType: "json", + success: function(response) { + // console.log(response); + for(i in response){ + marhun.push(response[i]); + } + } + }); + + + let marh = JSON.stringify(marhun[0]); + + selepastawarruqtable.row.add([ + ``, + namacawangan, + `${ps.norujukan}`, + ps.tempoh, + ps.bakiupah, + ps.t_matang, + ps.taglel + ]).draw(); + + counter = counter + 1; + }); + + } + + function linktargetfunc(e){ + var arraymarhun = $(e).data('marhun'); + var norujukan = $(e).data('norujukan'); + var kodcaw = $(e).data('kodcaw'); + var hargajualan = $(e).data('hargajualan'); + var pinjaman = $(e).data('pinjaman'); + var bakipjm = $(e).data('bakipjm'); + var lelong = $(e).data('lelong'); + var pjmnum = $(e).data('pjmnum'); + + bayaranfunc(e,api_url); + + $('#pemb').text('RM ' + pjmnum); + $('#bpemb').text('RM ' + bakipjm); + + if(lelong === 1) + { + $('#statuslelong').text('Akan Dilelong'); + }else{ + $('#statuslelong').text('-'); + } + + $('#norujukan_modal').val(norujukan); + $('#pinjaman_modal').val(pinjaman); + $('#tablemarhun').empty(); + var bil_count = 0; + $.each(arraymarhun, function(index, marhun) { + var marhun_name; + $.ajax({ + method: 'GET', + url: api_url + '/api/jemas/nama_marhun', + dataType: 'json', + data: { + marhun: marhun['marhun'] + }, + success: function(marhun_ajax) { + bil_count++; + $("#tablemarhun").append("" + bil_count + "" + marhun_ajax['descpt'] + "" + marhun['berat'] + "" + marhun['karat'] + "RM " + marhun['n_marhun'].toLocaleString(undefined, { + minimumFractionDigits: 2 + }) + "" + marhun['nota'] + ""); + } + }); + }); + + } + + function tickfunc(e){ + var count = parseInt($('#totalsag').text()); + console.log(count); + if ($(e).is(':checked')) { + var total = count + 1; + + if (total <= 3) { + $('#totalsag').text(total); + } else { + $(e).prop('checked', false); + } + } else { + var total = count - 1; + $('#totalsag').text(total); + } + + return false; + } + + function filterpembiayaanaktif(){ + + $('#loadertable').removeClass('d-none'); + $('#formtable').addClass('d-none'); + + let datapembaktif = []; + $.ajax({ + url: '{{ route("info.pembaktif") }}', + method: 'get', + async: false, + dataType: "json", + success: function(data) { + for(i in data){ + datapembaktif.push(data[i]); + } + + $('#loadertable').addClass('d-none'); + $('#formtable').removeClass('d-none'); + } + }); + + + + + selepastawarruqtable.clear().draw(); + var counter = 1; + $.each(datapembaktif,function(index,ps){ + + let namacawangan = ''; + $.ajax({ + url: api_url + '/api/cawangan/detail/' + ps.kodcaw, + method: 'get', + async:false, + dataType: "json", + success: function(data) { + namacawangan = data[0].namacaw; + namacawangan = namacawangan.toLowerCase().substring(8).replace(/\b[a-z]/g, function(value) { + return value.toUpperCase(); + }); + } + }); + + let marhun = []; + $.ajax({ + url: api_url + '/api/marhun/' + ps.norujukan, + method: 'get', + async:false, + dataType: "json", + success: function(response) { + // console.log(response); + for(i in response){ + marhun.push(response[i]); + } + } + }); + + let marh = JSON.stringify(marhun[0]); + + selepastawarruqtable.row.add([ + ``, + namacawangan, + `${ps.norujukan}`, + ps.tempoh, + ps.bakiupah, + ps.t_matang, + ps.taglel + ]).draw(); + + counter = counter + 1; + }); + } + + function filterpembiayaan6bulan(){ + + $('#loadertable').removeClass('d-none'); + $('#formtable').addClass('d-none'); + + let datapemb6 = []; + $.ajax({ + url: '{{ route("info.pemb6bulan") }}', + method: 'get', + async: false, + dataType: "json", + success: function(data) { + for(i in data){ + datapemb6.push(data[i]); + } + + $('#loadertable').addClass('d-none'); + $('#formtable').removeClass('d-none'); + + + } + }); + + + selepastawarruqtable.clear().draw(); + var counter = 1; + $.each(datapemb6,function(index,ps){ + + let namacawangan = ''; + $.ajax({ + url: api_url + '/api/cawangan/detail/' + ps.kodcaw, + method: 'get', + async:false, + dataType: "json", + success: function(data) { + namacawangan = data[0].namacaw; + namacawangan = namacawangan.toLowerCase().substring(8).replace(/\b[a-z]/g, function(value) { + return value.toUpperCase(); + }); + } + }); + + let marhun = []; + $.ajax({ + url: api_url + '/api/marhun/' + ps.norujukan, + method: 'get', + async:false, + dataType: "json", + success: function(response) { + // console.log(response); + for(i in response){ + marhun.push(response[i]); + } + } + }); + + + let marh = JSON.stringify(marhun[0]); + + selepastawarruqtable.row.add([ + ``, + namacawangan, + `${ps.norujukan}`, + ps.tempoh, + ps.bakiupah, + ps.t_matang, + ps.taglel + ]).draw(); + + counter = counter + 1; + }); + } + + + function bayaranfunc(e,api){ let norujukan = $(e).data('norujukan'); @@ -260,8 +526,6 @@ var hargaemastable = $('#harga_emas').DataTable({ let berat = $(e).data('berat'); let nm = $(e).data('nm'); - console.log(pinjaman,upah12,bakipjm,berat,nm); - $('#pembiayaan').text('RM ' + pinjaman); $('#bpembiayaan').text('RM ' + bakipjm); $('#nm').text('RM ' + nm); @@ -299,30 +563,34 @@ var hargaemastable = $('#harga_emas').DataTable({ }); } - $("input[type='checkbox'][name='chkboxsag[]']").click(function() { - var count = parseInt($('#totalsag').text()); - if ($(this).is(':checked')) { - var total = count + 1; + // $("input[type='checkbox'][name='chkboxsag[]']").click(function() { + // var count = parseInt($('#totalsag').text()); + // console.log(count); + // if ($(this).is(':checked')) { + // var total = count + 1; - if (total <= 3) { - $('#totalsag').text(total); - } else { - $(this).prop('checked', false); - } - } else { - var total = count - 1; - $('#totalsag').text(total); - } - }); + // if (total <= 3) { + // $('#totalsag').text(total); + // } else { + // $(this).prop('checked', false); + // } + // } else { + // var total = count - 1; + // $('#totalsag').text(total); + // } + + // return false; + // }); function validateform() { return true; } - + $('.linktarget').off('click', 'tr'); + $('.linktarget').on('click', function(event) { - + console.log(event); var arraymarhun = $(this).data('marhun'); var norujukan = $(this).data('norujukan'); var kodcaw = $(this).data('kodcaw'); diff --git a/resources/views/includes/login/loginportal.blade.php b/resources/views/includes/login/loginportal.blade.php index 7afefaa..6717c28 100644 --- a/resources/views/includes/login/loginportal.blade.php +++ b/resources/views/includes/login/loginportal.blade.php @@ -41,7 +41,7 @@