diff --git a/app/Http/Controllers/KhazanahController.php b/app/Http/Controllers/KhazanahController.php index 891ce28..2ec148f 100644 --- a/app/Http/Controllers/KhazanahController.php +++ b/app/Http/Controllers/KhazanahController.php @@ -1587,7 +1587,7 @@ class KhazanahController extends Controller } public function cetaklaporanLelongan(Request $request){ - // dd($request); + // dd($request->all()); $api_url = config('api.url'); $auth_user = Auth::user(); $current = Carbon::now(); @@ -1596,7 +1596,15 @@ class KhazanahController extends Controller if($request->jeniscetakan === 'cetak') { - $lelong = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url'). '/api/senaraibatch/laporan/'. $auth_user['cawangan'],['batchno' => $request->batchno])->json(); + if($request->fasa == 1) + { + $lelong = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url'). '/api/senaraibatch/laporan/'. $auth_user['cawangan'] . '/' . 'fasa1',['batchno' => $request->batchno])->json(); + }else{ + $lelong = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url'). '/api/senaraibatch/laporan/'. $auth_user['cawangan'] . '/' . 'fasa2',['batchno' => $request->batchno])->json(); + } + + // $lelong = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url'). '/api/senaraibatch/laporan/'. $auth_user['cawangan'],['batchno' => $request->batchno])->json(); + $cawangan=Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url').'/api/cawangan/detail/'.$auth_user['cawangan'])->json(); $cawangan_detail=$cawangan[0]; @@ -1605,7 +1613,12 @@ class KhazanahController extends Controller }else if($request->jeniscetakan === 'excel') { - $lelong = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url'). '/api/senaraibatch/laporan/'. $auth_user['cawangan'],['batchno' => $request->batchno])->json(); + if($request->fasa == 1) + { + $lelong = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url'). '/api/senaraibatch/laporan/'. $auth_user['cawangan'] . '/' . 'fasa1',['batchno' => $request->batchno])->json(); + }else{ + $lelong = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url'). '/api/senaraibatch/laporan/'. $auth_user['cawangan'] . '/' . 'fasa2',['batchno' => $request->batchno])->json(); + } $cawangan=Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url').'/api/cawangan/detail/'.$auth_user['cawangan'])->json(); $cawangan_detail=$cawangan[0]; @@ -1613,7 +1626,14 @@ class KhazanahController extends Controller }else if($request->jeniscetakan === 'pdf'){ - $lelong = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url'). '/api/senaraibatch/laporan/'. $auth_user['cawangan'],['batchno' => $request->batchno])->json(); + if($request->fasa == 1) + { + $lelong = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url'). '/api/senaraibatch/laporan/'. $auth_user['cawangan'] . '/' . 'fasa1',['batchno' => $request->batchno])->json(); + $fasa = 'fasa1'; + }else{ + $lelong = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url'). '/api/senaraibatch/laporan/'. $auth_user['cawangan'] . '/' . 'fasa2',['batchno' => $request->batchno])->json(); + $fasa = 'fasa2'; + } $notislelong = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url'). '/api/details/notislelong/'. $auth_user['cawangan'])->json(); $cawangan_info = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') . '/api/cawangan/'. $auth_user['cawangan'])->json(); $cawangan = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url').'/api/cawangan/detail/'.$auth_user['cawangan'])->json(); @@ -1621,8 +1641,8 @@ class KhazanahController extends Controller // return view('print.notislelong', compact('cawangan_info','notislelong','api_url','cawangan_detail','lelong','tarikh_cetak')); - $pdf=PDF::loadView('print.notislelong', compact('cawangan_info','notislelong','api_url','cawangan_detail','lelong','tarikh_cetak'))->setPaper('A4','potrait'); - return $pdf->download('notislelong_'.$tarikh_cetak.'.pdf'); + $pdf=PDF::loadView('print.notislelong', compact('cawangan_info','notislelong','api_url','cawangan_detail','lelong','fasa','tarikh_cetak'))->setPaper('A4','potrait'); + return $pdf->download('notislelong_'.$tarikh_cetak.'_'.$fasa.'.pdf'); // return $pdf->stream('notislelong_'.$tarikh_cetak.'.pdf'); // return view('print.notislelong', compact('cawangan_info','api_url','cawangan_detail','lelong','tarikh_cetak')); @@ -3558,30 +3578,5 @@ class KhazanahController extends Controller return view('khazanah.status', compact('cawangan_info','api_url','permohonan','getdescription')); } - - public function TriggerBakiPetiBesi(Request $request) - { - $auth_user = Auth::user(); - $api_url = config('api.url'); - - $current = Carbon::now(); - $tarikhsemasa = $current->toDateString(); - - $cawangan = CawanganAR::where('kodcaw','KB2')->get()->toArray(); - $getVault = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url').'/api/TunaiDiTangan/' . 'KB2',['tarikh' => $tarikhsemasa])->json(); - - if(floatval($getVault) > $cawangan[0]['max']) - { - session(['status' => 'max']); - event(new NotifikasiPetiBesi('KB2','max',$getVault)); - - }else if(floatval($getVault) < $cawangan[0]['min']) - { - session(['status' => 'min']); - event(new NotifikasiPetiBesi('KB2','min',$getVault)); - }else{ - echo 'tiada'; - } - } } diff --git a/app/Http/Controllers/LelongController.php b/app/Http/Controllers/LelongController.php index c988d21..d3cc344 100644 --- a/app/Http/Controllers/LelongController.php +++ b/app/Http/Controllers/LelongController.php @@ -41,9 +41,10 @@ class LelongController extends Controller $auth_user = Auth::user(); $api_url = config('api.url'); $cawangan_info = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') . '/api/cawangan/'. $auth_user['cawangan'])->json(); - $senaraibatch = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url'). '/api/senaraibatch/aktif/'. $auth_user['cawangan'])->json(); + $senaraibatchfasa1 = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url'). '/api/senaraibatch/aktif/'. $auth_user['cawangan'] . '/' . 'fasa1')->json(); + $senaraibatchfasa2 = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url'). '/api/senaraibatch/aktif/'. $auth_user['cawangan'] . '/' . 'fasa2')->json(); - return view('khazanah.lelong',compact('cawangan_info','api_url','senaraibatch')); + return view('khazanah.lelong',compact('cawangan_info','api_url','senaraibatchfasa1','senaraibatchfasa2')); } public function resittuntutbaki($norujukan){ diff --git a/resources/views/khazanah/lelong.blade.php b/resources/views/khazanah/lelong.blade.php index 0d88dda..34f7d14 100644 --- a/resources/views/khazanah/lelong.blade.php +++ b/resources/views/khazanah/lelong.blade.php @@ -22,31 +22,47 @@
- @if(sizeof($senaraibatch) !== 0) + @if(sizeof($senaraibatchfasa1) !== 0 || sizeof($senaraibatchfasa2) !== 0) + - @foreach($senaraibatch as $index=>$sb) + @foreach($senaraibatchfasa1 as $index=>$sb) + @endforeach + @foreach($senaraibatchfasa2 as $index=>$sb) + + + + + + + + + @endforeach
No. Batch No.Fasa Bilangan Aktif Tarikh Lelong Action
{{ $loop->iteration }} {{ $sb['batchno'] }}Fasa 1 {{ $sb['total'] }} {{ $sb['t_lelong'] }} - Cetak - Excel - PDF + Cetak + Excel + PDF
{{ $loop->iteration }}{{ $sb['batchno'] }}Fasa 2{{ $sb['total'] }}{{ $sb['t_lelong'] }} + Cetak + Excel + PDF +
@else diff --git a/resources/views/layouts/app.blade.php b/resources/views/layouts/app.blade.php index 65954c5..8ec1b39 100644 --- a/resources/views/layouts/app.blade.php +++ b/resources/views/layouts/app.blade.php @@ -187,27 +187,6 @@ }); - var channel2 = pusher.subscribe('notice-notify'); - channel2.bind('trigger-notify', function(data) { - if(cawangankhazanah == data.cawangan) - { - if(data.status == 'max') - { - $("#notify-maksimum").removeClass("d-none"); - $("#notify-maksimum").addClass("d-block"); - $("#value-maksimum").text('RM ' + data.bakipetibesi); - } - - if(data.status == 'min') - { - $("#notify-minimum").removeClass("d-none"); - $("#notify-minimum").addClass("d-block"); - $("#value-minimum").text('RM ' + data.bakipetibesi); - } - } - }); - - $("#navbarDropdown").click(function(){ $('#bell').css("color", "grey"); }); @@ -332,14 +311,27 @@ - {{-- {{ dd(session()->has('status')) }} --}} - - - + @if ($auth_user['roles'] == 'ppc' || $auth_user['roles'] == 'pc') + + @php + $current = Carbon\Carbon::now(); + $tarikhsemasa = $current->toDateString(); + + $cawangan = App\CawanganAR::where('kodcaw',$auth_user['cawangan'])->get()->toArray(); + $getVault = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url').'/api/TunaiDiTangan/' . $auth_user['cawangan'],['tarikh' => $tarikhsemasa])->json(); + @endphp + @if(floatval($getVault) > $cawangan[0]['max']) + + @elseif(floatval($getVault) < $cawangan[0]['min']) + + @else + @endif + @endif +
@yield('content')
diff --git a/resources/views/print/notislelong.blade.php b/resources/views/print/notislelong.blade.php index f38a8e5..73a2e73 100644 --- a/resources/views/print/notislelong.blade.php +++ b/resources/views/print/notislelong.blade.php @@ -228,7 +228,12 @@ {{-- Customise Ayat pelelong--}} {{-- {!! nl2br(e($notislelong[0]['para2'])) !!} --}} - @php echo $notislelong[0]['para2']; @endphp + @php if($fasa == 'fasa1') + { + echo $notislelong[0]['para2']; + }else{ + echo $notislelong[0]['para3']; + } @endphp {{--

1. Tebus sepenuhnya

2. Tebus gadai semula

2. Bayar upah sepenuhnya dan tempoh akan dilanjutkan sehingga 12 bulan bagi tempoh gadaian.

--}}