Merge branch 'kaunter' into 'new-super'
tarikh matang See merge request online-sistem1/kaunter!192
This commit is contained in:
@@ -209,60 +209,20 @@ class CustomersController extends Controller
|
|||||||
return redirect()->route('customer_info')->with( ['customer_info' => $customer_info] );
|
return redirect()->route('customer_info')->with( ['customer_info' => $customer_info] );
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Display the specified resource.
|
|
||||||
*
|
|
||||||
* @param \App\Customer $customer
|
|
||||||
* @return \Illuminate\Http\Response
|
|
||||||
*/
|
|
||||||
public function show(Customer $customer)
|
|
||||||
{
|
|
||||||
//
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Show the form for editing the specified resource.
|
|
||||||
*
|
|
||||||
* @param \App\Customer $customer
|
|
||||||
* @return \Illuminate\Http\Response
|
|
||||||
*/
|
|
||||||
public function edit(Customer $customer)
|
|
||||||
{
|
|
||||||
//
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Update the specified resource in storage.
|
|
||||||
*
|
|
||||||
* @param \Illuminate\Http\Request $request
|
|
||||||
* @param \App\Customer $customer
|
|
||||||
* @return \Illuminate\Http\Response
|
|
||||||
*/
|
|
||||||
public function update(Request $request, Customer $customer)
|
|
||||||
{
|
|
||||||
//
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Remove the specified resource from storage.
|
|
||||||
*
|
|
||||||
* @param \App\Customer $customer
|
|
||||||
* @return \Illuminate\Http\Response
|
|
||||||
*/
|
|
||||||
public function destroy(Customer $customer)
|
|
||||||
{
|
|
||||||
//
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getOTP(Request $request){
|
public function getOTP(Request $request){
|
||||||
$auth_user = Auth::user();
|
$auth_user = Auth::user();
|
||||||
$expired = Carbon::now();
|
$expired = Carbon::now();
|
||||||
$expired = new Carbon();
|
$expired = new Carbon();
|
||||||
$expired = $expired->addHours(24);
|
$expired = $expired->addHours(24);
|
||||||
|
$currentDateTime = Carbon::now();
|
||||||
|
|
||||||
|
$cawangan_info = Http::get(config('api.url') . '/api/cawangan/'. $auth_user['cawangan'])->json();
|
||||||
|
$nama_cawangan = $cawangan_info["details_caw"];
|
||||||
|
|
||||||
$nokp = $request->noic_otp;
|
$nokp = $request->noic_otp;
|
||||||
$customer = Http::get(config('api.url'). '/api/customers/'.$nokp)->json();
|
$customer = Http::get(config('api.url'). '/api/customers/'.$nokp)->json();
|
||||||
$recipient = '+6'.$customer['telefon'];
|
$recipient = '6'.$customer['telefon'];
|
||||||
|
// $recipient = '60189025461';
|
||||||
//pembinaan token
|
//pembinaan token
|
||||||
function token($length) {
|
function token($length) {
|
||||||
$characters = array(
|
$characters = array(
|
||||||
@@ -294,7 +254,8 @@ class CustomersController extends Controller
|
|||||||
'expired' => $expired,
|
'expired' => $expired,
|
||||||
'kodcaw' => $auth_user['cawangan']
|
'kodcaw' => $auth_user['cawangan']
|
||||||
]);
|
]);
|
||||||
$message = "Your TAC code is " . $random;
|
// $message = "Your OTP code is " . $random;
|
||||||
|
$message = 'AR-RAHN PKB ' . $nama_cawangan . ' : OTP: ' . $random . ' ' . $currentDateTime . '. AR-RAHN CARELINE CENTRE 1300-22-4343';
|
||||||
$this->sendWhatsAppMessage($message, $recipient);
|
$this->sendWhatsAppMessage($message, $recipient);
|
||||||
return response()->json(['otp'=>$random]);
|
return response()->json(['otp'=>$random]);
|
||||||
}
|
}
|
||||||
@@ -306,7 +267,8 @@ class CustomersController extends Controller
|
|||||||
'expired' => $expired,
|
'expired' => $expired,
|
||||||
'kodcaw' => $auth_user['cawangan']
|
'kodcaw' => $auth_user['cawangan']
|
||||||
]);
|
]);
|
||||||
$message = "Your TAC code is " . $random;
|
// $message = "Your OTP code is " . $random;
|
||||||
|
$message = 'AR-RAHN PKB ' . $nama_cawangan . ' : OTP: ' . $random . ' ' . $currentDateTime . '. AR-RAHN CARELINE CENTRE 1300-22-4343';
|
||||||
$this->sendWhatsAppMessage($message, $recipient);
|
$this->sendWhatsAppMessage($message, $recipient);
|
||||||
return response()->json(['otp'=>$random]);
|
return response()->json(['otp'=>$random]);
|
||||||
}
|
}
|
||||||
@@ -323,7 +285,8 @@ class CustomersController extends Controller
|
|||||||
'expired' => $expired,
|
'expired' => $expired,
|
||||||
'kodcaw' => $auth_user['cawangan']
|
'kodcaw' => $auth_user['cawangan']
|
||||||
]);
|
]);
|
||||||
$message = "Your TAC code is " . $random;
|
// $message = "Your OTP code is " . $random;
|
||||||
|
$message = 'AR-RAHN PKB ' . $nama_cawangan . ' : OTP: ' . $random . ' ' . $currentDateTime . '. AR-RAHN CARELINE CENTRE 1300-22-4343';
|
||||||
$this->sendWhatsAppMessage($message, $recipient);
|
$this->sendWhatsAppMessage($message, $recipient);
|
||||||
return response()->json(['otp'=>$random]);
|
return response()->json(['otp'=>$random]);
|
||||||
}
|
}
|
||||||
@@ -335,34 +298,26 @@ class CustomersController extends Controller
|
|||||||
'expired' => $expired,
|
'expired' => $expired,
|
||||||
'kodcaw' => $auth_user['cawangan']
|
'kodcaw' => $auth_user['cawangan']
|
||||||
]);
|
]);
|
||||||
$message = "Your TAC code is " . $random;
|
// $message = "Your OTP code is " . $random;
|
||||||
|
$message = 'AR-RAHN PKB ' . $nama_cawangan . ' : OTP: ' . $random . ' ' . $currentDateTime . '. AR-RAHN CARELINE CENTRE 1300-22-4343';
|
||||||
$this->sendWhatsAppMessage($message, $recipient);
|
$this->sendWhatsAppMessage($message, $recipient);
|
||||||
return response()->json(['otp'=>$random]);
|
return response()->json(['otp'=>$random]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function listenToReplies(Request $request)
|
|
||||||
{
|
|
||||||
$from = $request->input('From');
|
|
||||||
|
|
||||||
$message = "Someone send you a message on whatsapp";
|
|
||||||
|
|
||||||
$this->sendWhatsAppMessage($message, $from);
|
|
||||||
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function sendWhatsAppMessage(string $message, string $recipient)
|
public function sendWhatsAppMessage(string $message, string $recipient)
|
||||||
{
|
{
|
||||||
$twilio_whatsapp_number = getenv('TWILIO_WHATSAPP_NUMBER');
|
$status = Http::get('http://gateway.onewaysms.com.my:10001/api.aspx',[
|
||||||
$account_sid = getenv("TWILIO_SID");
|
'apiusername' => 'APIUK330HDAFO',
|
||||||
$auth_token = getenv("TWILIO_AUTH_TOKEN");
|
'apipassword' => 'APIUK330HDAFOUK330',
|
||||||
$from = "whatsapp:".$twilio_whatsapp_number;
|
'senderid' => 'INFO',
|
||||||
$to = "whatsapp:".$recipient;
|
'mobileno' => $recipient,
|
||||||
|
'message'=> $message,
|
||||||
|
'languagetype'=> 1
|
||||||
|
]);
|
||||||
|
|
||||||
$client = new Client($account_sid, $auth_token);
|
return ($status);
|
||||||
return $client->messages->create($to, array('from' => $from, 'body' => $message));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -745,11 +745,16 @@
|
|||||||
taglel,
|
taglel,
|
||||||
]).draw();
|
]).draw();
|
||||||
}else{
|
}else{
|
||||||
|
if(gadai_detail['lelong_tawarruq'] == 0){
|
||||||
|
var tarikh_matang = gadai_detail['t_matang1'];
|
||||||
|
}else{
|
||||||
|
var tarikh_matang = gadai_detail['t_matang'];
|
||||||
|
}
|
||||||
tablegadai.row.add([
|
tablegadai.row.add([
|
||||||
'<input type="radio" value='+ gadai_detail["norujukan"] +' name="belum"/>',
|
'<input type="radio" value='+ gadai_detail["norujukan"] +' name="belum"/>',
|
||||||
'<a href="#" onclick="checkserah(this)" data-norujukan='+ gadai_detail['norujukan'] +' data-url=' + urlroute +'>' + gadai_detail['norujukan'] + '</a>',
|
'<a href="#" onclick="checkserah(this)" data-norujukan='+ gadai_detail['norujukan'] +' data-url=' + urlroute +'>' + gadai_detail['norujukan'] + '</a>',
|
||||||
gadai_detail['t_gadai'],
|
gadai_detail['t_gadai'],
|
||||||
gadai_detail['t_matang'],
|
tarikh_matang,
|
||||||
'RM '+ formatter.format(gadai_detail['bakihargajualan']),
|
'RM '+ formatter.format(gadai_detail['bakihargajualan']),
|
||||||
'RM '+formatter.format(gadai_detail['bakipjm']),
|
'RM '+formatter.format(gadai_detail['bakipjm']),
|
||||||
(((Number(gadai_detail['pinjaman'])/Number(gadai_detail['nilaimarhun']))*100).toFixed(2)).toLocaleString("en-GB") + '%',
|
(((Number(gadai_detail['pinjaman'])/Number(gadai_detail['nilaimarhun']))*100).toFixed(2)).toLocaleString("en-GB") + '%',
|
||||||
|
|||||||
@@ -518,11 +518,16 @@
|
|||||||
gadai_detail['tempoh']
|
gadai_detail['tempoh']
|
||||||
]).draw();
|
]).draw();
|
||||||
}else{
|
}else{
|
||||||
|
if(gadai_detail['lelong_tawarruq'] == 0){
|
||||||
|
var tarikh_matang = gadai_detail['t_matang1'];
|
||||||
|
}else{
|
||||||
|
var tarikh_matang = gadai_detail['t_matang'];
|
||||||
|
}
|
||||||
tablegadai.row.add([
|
tablegadai.row.add([
|
||||||
'<input type="radio" value='+ gadai_detail["norujukan"] +' name="belum"/>',
|
'<input type="radio" value='+ gadai_detail["norujukan"] +' name="belum"/>',
|
||||||
'<a href="#" onclick="checkserah(this)" data-norujukan='+ gadai_detail['norujukan'] +' data-url=' + urlroute +'>' + gadai_detail['norujukan'] + '</a>',
|
'<a href="#" onclick="checkserah(this)" data-norujukan='+ gadai_detail['norujukan'] +' data-url=' + urlroute +'>' + gadai_detail['norujukan'] + '</a>',
|
||||||
gadai_detail['t_gadai'],
|
gadai_detail['t_gadai'],
|
||||||
gadai_detail['t_matang1'],
|
tarikh_matang,
|
||||||
'RM '+ formatter.format(gadai_detail['bakihargajualan']),
|
'RM '+ formatter.format(gadai_detail['bakihargajualan']),
|
||||||
'RM '+formatter.format(gadai_detail['bakipjm']),
|
'RM '+formatter.format(gadai_detail['bakipjm']),
|
||||||
(((Number(gadai_detail['pinjaman'])/Number(gadai_detail['nilaimarhun']))*100).toFixed(2)).toLocaleString("en-GB") + '%',
|
(((Number(gadai_detail['pinjaman'])/Number(gadai_detail['nilaimarhun']))*100).toFixed(2)).toLocaleString("en-GB") + '%',
|
||||||
|
|||||||
Reference in New Issue
Block a user