diff --git a/app/Http/Controllers/TacController.php b/app/Http/Controllers/TacController.php index 36f522c..7881c5c 100644 --- a/app/Http/Controllers/TacController.php +++ b/app/Http/Controllers/TacController.php @@ -30,11 +30,12 @@ class TacController extends Controller public function requestKadPengenalan(Request $request){ $currentDateTime = Carbon::now(); + $expiretac = tacportal::where('icno',$request->icno) ->whereDate('created_at','=',$currentDateTime) ->whereDate('expired_at','=',$currentDateTime) - ->whereTime('expired_at','>=',$currentDateTime->toDateTimeString()) - ->where('created_at','<=',$currentDateTime->toDateTimeString()) + ->whereTime('expired_at','>=',$currentDateTime->toTimeString()) + ->whereTime('created_at','<=',$currentDateTime->toTimeString()) ->latest() ->first(); @@ -69,7 +70,7 @@ class TacController extends Controller $currentDateTime = Carbon::now(); - $expired_at = Carbon::now()->addMinutes(15); + $expired_at = Carbon::now()->addMinutes(5); $tac_token = $this->randum_number(6,2,false); @@ -83,21 +84,21 @@ class TacController extends Controller $tac->save(); - // $mobileno = '6' . $customer['notelefon']; - $mobileno = '601114884900'; + $mobileno = '6' . $customer['notelefon']; + // $mobileno = '601114884900'; $messages = 'AR-RAHN PKB PORTAL : TAC: ' . $tac_token . ' ' . $currentDateTime . '. AR-RAHN CARELINE CENTRE 1300-22-4343'; - // $status = Http::get('http://gateway.onewaysms.com.my:10001/api.aspx',[ - // 'apiusername' => 'APIUK330HDAFO', - // 'apipassword' => 'APIUK330HDAFOUK330', - // 'senderid' => 'INFO', - // 'mobileno' => $mobileno, - // 'message'=> $messages, - // 'languagetype'=> 1 - // ]); + $status = Http::get('http://gateway.onewaysms.com.my:10001/api.aspx',[ + 'apiusername' => 'APIUK330HDAFO', + 'apipassword' => 'APIUK330HDAFOUK330', + 'senderid' => 'INFO', + 'mobileno' => $mobileno, + 'message'=> $messages, + 'languagetype'=> 1 + ]); - // return response($status); - return response(1); + return response($status); + // return response(1); } private function randum_number($len = 6,$dup = 1, $sort = false){ diff --git a/resources/views/auth/pertama-kali/firsttime2.blade.php b/resources/views/auth/pertama-kali/firsttime2.blade.php index 2842c28..2b73a66 100644 --- a/resources/views/auth/pertama-kali/firsttime2.blade.php +++ b/resources/views/auth/pertama-kali/firsttime2.blade.php @@ -404,7 +404,7 @@ $.notify({ icon: 'fas fa-exclamation-triangle fa-2x', newest_on_top: true, - message: "anda telah meminta tac kurang daripada 15minit!" + message: "anda telah meminta tac kurang daripada 5 minit!" }, { type: 'warning', allow_dismiss: false, @@ -450,8 +450,26 @@ $("#divsahkan").removeClass('d-none'); $('#backphone').text(data['notelefon']); + $.notify({ + icon: 'fas fa-2x fa-exclamation-triangle', + newest_on_top: true, + message: "Permohonan TAC telah dihantar melalui SMS!" + }, { + type: 'success', + allow_dismiss: false, + placement: { + align: 'center', + from: 'bottom' + }, + animate: { + enter: 'animate__animated animate__bounce', + + exit: 'animate__animated animate__bounceOutDown' + } + }); + }else{ - console.log(data); + // console.log(data); } } }); @@ -469,7 +487,6 @@ var otp_icno = $('#login-icno').val(); var boolotp = false; var boolicno = false; - if (otp_verify == null || otp_verify == '') { // $('#errorotp').text('Sila Isi Nombor OTP!'); // $('#spanotp').addClass('visible'); @@ -505,7 +522,6 @@ method: 'GET', success: function(data) { - console.log(data.status); if (data.status == 1) { $('input[name="name"]').val(data.customerinfo.nama); @@ -535,9 +551,9 @@ }); } else { $.notify({ - icon: 'fas fa-exclamation-triangle', + icon: 'fas fa-2x fa-exclamation-triangle', newest_on_top: true, - message: "Pelanggan tidak membuat sebarang login!" + message: "TAC anda salah sila periksa balik!" }, { type: 'danger', allow_dismiss: false, @@ -556,6 +572,24 @@ } }); + }else{ + $.notify({ + icon: 'fas fa-2x fa-exclamation-triangle', + newest_on_top: true, + message: "Sila masukkan ruang yang disediakan!" + }, { + type: 'danger', + allow_dismiss: false, + placement: { + align: 'center', + from: 'bottom' + }, + animate: { + enter: 'animate__animated animate__bounce', + + exit: 'animate__animated animate__bounceOutDown' + } + }); } } diff --git a/resources/views/includes/home.blade.php b/resources/views/includes/home.blade.php index 7e66251..a2f1b5a 100644 --- a/resources/views/includes/home.blade.php +++ b/resources/views/includes/home.blade.php @@ -1,6 +1,5 @@ @extends ('layouts.indexfirst') @section('content') -@include('modal.marhun')