diff --git a/app/Http/Controllers/KhazanahController.php b/app/Http/Controllers/KhazanahController.php index 2ec148f0..46e694e8 100644 --- a/app/Http/Controllers/KhazanahController.php +++ b/app/Http/Controllers/KhazanahController.php @@ -3578,5 +3578,49 @@ class KhazanahController extends Controller return view('khazanah.status', compact('cawangan_info','api_url','permohonan','getdescription')); } + + public function CITPermohonan(Request $request) + { + $auth_user = Auth::user(); + $api_url = config('api.url'); + + + $resitname = time().'.'.$request->resit->extension(); + $resitdata = base64_encode($request->resit->get()); + + $invoicename = time().'.'.$request->invoice->extension(); + $invoicedata = base64_encode($request->invoice->get()); + + $updatelulus = Http::accept('application/'.$request->resit->extension() . ',application/'.$request->invoice->extension())->post(config('api.url') . '/admin/permohonan/tagcit',[ + 'resitcit' => $request->noresit, + 'bank' => $request->selectedbank, + 'mohonid' => $request->mohonid, + 'dataresit' => $resitdata, + 'datainvoice' => $invoicedata, + 'resittype' => $request->resit->extension(), + 'invoicetype' => $request->invoice->extension(), + 'resitname' => $resitname, + 'invoicename' => $invoicename, + + ])->json(); + + if($updatelulus) + return redirect()->back()->with('message', 'Berjaya mengemaskini CIT Permohonan!'); + else + return redirect()->back()->with('error', 'Ralat dalam menjana sebarang kemaskini!'); + + } + + public function DownloadFiles(Request $request){ + + $download = Http::get(config('api.url').'/admin/permohonan/viewfiles',[ + 'files_id' => $request->files_id + ])->json(); + + return response(base64_decode($download['data']), 200, [ + 'Content-type' => 'application/' . $download['type'], + 'Content-Disposition' => 'inline; filename='.$download['filename'] + ]); + } } diff --git a/resources/views/khazanah/permohonanwang.blade.php b/resources/views/khazanah/permohonanwang.blade.php index 82286049..641f0a60 100644 --- a/resources/views/khazanah/permohonanwang.blade.php +++ b/resources/views/khazanah/permohonanwang.blade.php @@ -38,7 +38,7 @@
Senarai Permohonan Masih Aktif
- + Rekod Permohonan
@@ -64,17 +64,17 @@ {{ $mohon['tarikh_permohonan'] }} {{ number_format($mohon['amaun_mohon'],2) }} - + {{ $mohon['jenismohon'] }} @php if($mohon['tagdeposit'] === 1) { - echo ''; + echo ''; }else if(($mohon['tagcit'] === 0 && $mohon['jenismohon'] === 'bayaranbalik')) { - echo ''; + echo ''; } else{ echo 'DALAM PROSES'; @@ -106,14 +106,24 @@ $(this) .find("input[name='jumlahmohon']") .val('') + .removeClass('is-invalid') .end() .find("input[type=checkbox], input[type=radio]") .prop("checked", "") .end(); + $("#erroramaun").hide(); + $("#pilihper").hide(); }) + $('#CITModal').on('shown.bs.modal', function (e) { + + let mohon = $('#btncit').data('mohonid'); + $('#mohonid').val(mohon); + + }); + function funcpermohonan(){ let amaun = $('#jumlahmohon').val(); @@ -128,6 +138,11 @@ $("#erroramaun").show(); // $("[name='erroramaun']").text("*Isikan amaun dalam input!"); $("[name='jumlahmohon']").addClass('is-invalid'); + boolamaun = true; + }else{ + $("#erroramaun").hide(); + $("[name='jumlahmohon']").removeClass('is-invalid'); + boolamaun = false; } if(!jenis) @@ -136,7 +151,7 @@ booljenis = true; }else{ - $("pilihper").hide(); + $("#pilihper").hide(); booljenis = false; } diff --git a/resources/views/khazanah/rekodpermohonan.blade.php b/resources/views/khazanah/rekodpermohonan.blade.php index a33a894b..fcbce70a 100644 --- a/resources/views/khazanah/rekodpermohonan.blade.php +++ b/resources/views/khazanah/rekodpermohonan.blade.php @@ -55,11 +55,11 @@ {{ number_format($mohon['amaun_mohon'],2) }} {{ number_format($mohon['jumlah_diluluskan'],2) }} - + {{ $mohon['jenismohon'] }} @php - if($mohon['tagterima'] === 1) + if($mohon['tagterima'] === 1 || ($mohon['jenismohon'] == 'bayaranbalik' && $mohon['tagoperasi'] === 1 && $mohon['tagcit'] === 1 && $mohon['tagakaun'] === 1)) echo 'BERJAYA'; else echo 'BATAL'; @endphp diff --git a/resources/views/khazanah/status.blade.php b/resources/views/khazanah/status.blade.php index 3ce88dd0..4dfdf77c 100644 --- a/resources/views/khazanah/status.blade.php +++ b/resources/views/khazanah/status.blade.php @@ -125,6 +125,21 @@ @section('content')
+
+ @csrf + +
+ +
+ @csrf + +
+ +
+ @csrf + +
+
@@ -181,12 +196,12 @@
@else
-
-
    -
  • -
  • -
  • -
  • +
    +
      +
    • +
    • +
    • +
@@ -238,26 +253,26 @@
@else -
-
+
+

Permohonan
Cawangan

-
+

CIT Selesai Deposit ke Bank

-
+

Pengesahan
Operasi

-
+

Akaun

@@ -290,15 +305,15 @@ break; case 3: echo $desc['description'] . '
' . 'NAMA AKAUN :' . $desc[0]['nama_akaun']; break; - case 4: echo $desc['description'] . '
' . 'JUMLAH DILULUSKAN :RM' . number_format($desc[0]['jumlah_diluluskan'],2); + case 4: echo $desc['description'] . '
' . 'JUMLAH DILULUSKAN :RM' . number_format($desc[0]['jumlah_diluluskan'],2) . '
'; break; - case 5: echo $desc['description'] . '
' . 'JENIS BANK :' . $desc[0]['jenisbank'] . '
' . 'NO RESIT :' . $desc[0]['noresit']; + case 5: echo $desc['description'] . '
' . 'JENIS BANK :' . $desc[0]['jenisbank'] . 'JENIS CIT:' . $desc[0]['jeniscit'] . '
' . 'NO RESIT :' . $desc[0]['noresit'] . 'NAMA SYARIKAT:' . $desc[0]['namasyarikat']; break; case 6: echo $desc['description'] . '
' . 'NAMA PENERIMA :' . $desc[0]['nama_penerima']; break; case 7: echo $desc['description']; break; - case 8: echo $desc['description'] . '
' . 'JENIS BANK :' . $desc[0]['jenisbank']; + case 8: echo $desc['description'] . '
' . 'JENIS BANK :' . $desc[0]['jenisbank'] .'
'; break; } @@ -319,5 +334,21 @@
@endsection diff --git a/resources/views/modal/CITModal.blade.php b/resources/views/modal/CITModal.blade.php index f8c34aa3..941ee8a9 100644 --- a/resources/views/modal/CITModal.blade.php +++ b/resources/views/modal/CITModal.blade.php @@ -12,7 +12,9 @@
-
+ @csrf + +
+ +
diff --git a/resources/views/modal/permohonanwang.blade.php b/resources/views/modal/permohonanwang.blade.php index 72234b69..a45435d2 100644 --- a/resources/views/modal/permohonanwang.blade.php +++ b/resources/views/modal/permohonanwang.blade.php @@ -18,21 +18,21 @@
- -
+ +
*Nyatakan Jumlah Permohonan
- +

{{ $tarikhsemasa }}

- +

RM {{ number_format($getVault,2) }}

@@ -43,7 +43,7 @@
--}}
- +

RM {{ number_format($dashboard[0]['outstanding'],2) }}

diff --git a/routes/web.php b/routes/web.php index 3b370905..f5939b42 100644 --- a/routes/web.php +++ b/routes/web.php @@ -141,8 +141,8 @@ Route::get('/permohonan',['as'=>'permohonan.index','uses' => 'KhazanahController Route::get('/permohonan/rekod',['as'=>'permohonan.rekod','uses' => 'KhazanahController@RekodPermohonan'])->middleware('auth','khazanah'); Route::post('/permohonan/simpan',['as'=>'permohonan.simpan','uses' => 'KhazanahController@SimpanPermohonan'])->middleware('auth','khazanah'); Route::get('/permohonan/status/{mohonid}',['as'=>'permohonan.status','uses' => 'KhazanahController@StatusPermohonan'])->middleware('auth','khazanah'); -Route::get('/permohonan/cit/{mohonid}',['as'=>'permohonan.cit','uses' => 'KhazanahController@CITPermohonan'])->middleware('auth','khazanah'); - +Route::post('/permohonan/cit',['as'=>'permohonan.cit','uses' => 'KhazanahController@CITPermohonan'])->middleware('auth','khazanah'); +Route::post('/permohonan/download',['as'=>'permohonan.download','uses' => 'KhazanahController@DownloadFiles'])->middleware('auth','khazanah'); Route::post('/kakitangan/harian',['as'=>'kakitangan.harian','uses'=>'KakitanganController@kakitanganHarian'])->middleware('auth','khazanah'); Route::get('/lelong',['as'=>'lelong','uses'=>'LelongController@lelong']);