diff --git a/app/Http/Controllers/GadaianController.php b/app/Http/Controllers/GadaianController.php index 400c64b..79d15a6 100644 --- a/app/Http/Controllers/GadaianController.php +++ b/app/Http/Controllers/GadaianController.php @@ -357,6 +357,7 @@ class GadaianController extends Controller $transaction = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') . '/api/transaction/one/'. $id)->json(); + $gadai = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') . '/api/gadai/norujukan/'. $id)->json(); if(sizeof($gadai) != 0) @@ -367,7 +368,12 @@ class GadaianController extends Controller // if(sizeof($customers_info) != 0) // $customers_info = $customers_info[0]; - return view('print.resitansuran',compact('transaction','gadai','customers_info')); + $wakil = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') . '/api/getwakil/' . $auth_user['cawangan'] . '/code/' . $transaction['nowakil'])->json(); + + if(sizeof($wakil) != 0) + $wakil = $wakil[0]; + + return view('print.resitansuran',compact('transaction','gadai','customers_info','wakil')); } public function resitbelumansurans($id) diff --git a/app/Http/Controllers/PenebusanController.php b/app/Http/Controllers/PenebusanController.php index 705782f..ba224ac 100644 --- a/app/Http/Controllers/PenebusanController.php +++ b/app/Http/Controllers/PenebusanController.php @@ -82,7 +82,8 @@ class PenebusanController extends Controller $updategadai = Http::withOptions(['verify' => config('app.api_verify')])->put(config('api.url').'/api/gadaikaunter/'. $request->kodcaw .'/norujukan/' . $request->norujukan,[ 'bayaran' => $request->bayaran, - 'teller' => $request->teller + 'teller' => $request->teller, + 'nowakil' => $request->nowakil ])->json(); $getTunai2=Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url').'/api/GetCurrentTunai/'.$request->kodcaw,['kodlaluan' => $request->teller])->json(); diff --git a/app/Http/Middleware/NoHttpCache.php b/app/Http/Middleware/NoHttpCache.php index d76a5eb..21392d2 100644 --- a/app/Http/Middleware/NoHttpCache.php +++ b/app/Http/Middleware/NoHttpCache.php @@ -31,10 +31,10 @@ class NoHttpCache /** * @var $headers \Symfony\Component\HttpFoundation\HeaderBag */ - $response->header('Pragma', 'no-cache'); - $response->header('Expires', 'Fri, 01 Jan 1990 00:00:00 GMT'); - $response->header('Cache-Control', 'no-cache, must-revalidate, no-store, max-age=0, private'); + $response->headers->set('Pragma', 'no-cache'); + $response->headers->set('Expires', 'Fri, 01 Jan 1990 00:00:00 GMT'); + $response->headers->set('Cache-Control', 'no-cache, must-revalidate, no-store, max-age=0, private'); return $response; } -} \ No newline at end of file +} diff --git a/config/filesystems.php b/config/filesystems.php index 94c8112..6298208 100644 --- a/config/filesystems.php +++ b/config/filesystems.php @@ -48,6 +48,11 @@ return [ 'root' => storage_path('app'), ], + 'supports' => [ + 'driver' => 'local', + 'root' => storage_path('drivers'), + ], + 'public' => [ 'driver' => 'local', 'root' => storage_path('app/public'), diff --git a/public/js/iris-mykad-websocket-client-api.js b/public/js/iris-mykad-websocket-client-api.js index 6101f3d..181dfe5 100644 --- a/public/js/iris-mykad-websocket-client-api.js +++ b/public/js/iris-mykad-websocket-client-api.js @@ -1,258 +1,294 @@ -WebSocketManager = { - url:"", +WebSocketManager = { + url:"", init: function(url) { WebSocketManager.url = url; - }, - open: function(callback, slot) { + }, + open: function(callback, slot) { wsocket = new WebSocket(WebSocketManager.url); wsocket.onopen = function () { - wsocket.send('{"Cmd":"OPEN","Slot":"'+ slot +'"}'); - }; + wsocket.send('{"Cmd":"OPEN","Slot":"'+ slot +'"}'); + }; wsocket.onmessage = function (evt) { var obj = JSON.parse(evt.data); wsocket.close(); callback(obj); - }; - - }, - listReader: function(callback) { + }; + + }, + listReader: function(callback) { wsocket = new WebSocket(WebSocketManager.url); wsocket.onopen = function () { - wsocket.send('{"Cmd":"LIST_READER"}'); - }; + wsocket.send('{"Cmd":"LIST_READER"}'); + }; wsocket.onmessage = function (evt) { - var obj = JSON.parse(evt.data); - var data = JSON.parse(obj.RespMessage); + var obj = JSON.parse(evt.data); + var data = JSON.parse(obj.RespMessage); wsocket.close(); callback(data, obj.RespCode); - }; - - }, + }; + + wsocket.onerror = evt => { + let hideLoader = () => { + let pageLoader = document.getElementById('page_loader'); + pageLoader.removeAttribute('class'); + }; + + hideLoader(); + wsocket.close(); + Swal.fire({ + icon: 'error', + title: 'MyKad driver/services not found, please install driver', + html: ` +
Tuan/Puan adalah dikehendaki untuk membuat urusan berikut pada atau sebelum @php $myDateTime = DateTime::createFromFormat('Y-m-d', $lel['tarikhlelong'] ); - $datez = $myDateTime->modify('-2 day')->format('d-m-Y'); + $datez = $myDateTime->modify('-3 day')->format('d-m-Y'); echo($datez); @endphp:-
diff --git a/resources/views/print/resit_tuntutbaki.blade.php b/resources/views/print/resit_tuntutbaki.blade.php index 0306726..40ffc24 100644 --- a/resources/views/print/resit_tuntutbaki.blade.php +++ b/resources/views/print/resit_tuntutbaki.blade.php @@ -194,7 +194,7 @@