diff --git a/app/Http/Controllers/KhazanahController.php b/app/Http/Controllers/KhazanahController.php index 2ec148f..46e694e 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 8228604..823540c 100644 --- a/resources/views/khazanah/permohonanwang.blade.php +++ b/resources/views/khazanah/permohonanwang.blade.php @@ -114,6 +114,13 @@ }) + $('#CITModal').on('shown.bs.modal', function (e) { + + let mohon = $('#btncit').data('mohonid'); + $('#mohonid').val(mohon); + + }); + function funcpermohonan(){ let amaun = $('#jumlahmohon').val(); diff --git a/resources/views/khazanah/status.blade.php b/resources/views/khazanah/status.blade.php index 3ce88dd..4dfdf77 100644 --- a/resources/views/khazanah/status.blade.php +++ b/resources/views/khazanah/status.blade.php @@ -125,6 +125,21 @@ @section('content')
+
Permohonan
Cawangan
+
CIT Selesai Deposit ke Bank
+
Pengesahan
Operasi
+
Akaun