Commit 5900be34 by Jansa Jose

J : push notification in update payment

parent cb18672b
......@@ -701,7 +701,7 @@ class Api_model extends CI_Model {
}
$this->sendSMS($bkData['phone'],$msgContent);
if($post_data['status'] == 6){
$userData = array('id'=>$post_data['event_id'],
$userData = array('id'=>$post_data['bookId'],
'title'=>'New Booking',
'message'=>'New Booking is There For Approval');
$this->push_sent_cancel($bkData['fcm_token'],$userData);
......@@ -1399,14 +1399,15 @@ class Api_model extends CI_Model {
$book_id = $trBook['booking_id'];
$sql = "SELECT TEVT.event_name,CONCAT(EDATE.date,' ',EDATE.time) AS show_time,
CUST.name,CUST.email,CUST.phone,EVT.approve_booking
CUST.name,CUST.email,CUST.phone,EVT.approve_booking,PDR.fcm_token
FROM booking AS BK
INNER JOIN events AS EVT ON (EVT.event_id=BK.event_id)
INNER JOIN provider AS PDR ON (PDR.provider_id=EVT.provider_id)
INNER JOIN translator_event AS TEVT ON (TEVT.event_id=EVT.event_id)
INNER JOIN customer AS CUST ON (CUST.customer_id=BK.customer_id)
INNER JOIN event_date_time AS EDATE ON (EDATE.id=BK.event_date_id)
WHERE BK.bookId='".$trBook['booking_id']."' AND EVT.status='1' AND
BK.status='3' AND EDATE.status='1' AND TEVT.language_code='EN'";
BK.status IN('3','6') AND EDATE.status='1' AND TEVT.language_code='EN'";
$bkData = $this->db->query($sql)->row_array();
$bokStatus = '1';
......@@ -1434,6 +1435,12 @@ class Api_model extends CI_Model {
$template['booking_sms']);
}
$this->sendSMS($bkData['phone'],$msgContent);
if($bokStatus == '6'){
$userData = array('id'=>$book_id,
'title'=>'New Booking',
'message'=>'New Booking is There For Approval');
$this->push_sent_cancel($bkData['fcm_token'],$userData);
}
}
$this->db->update('booking',array('status'=>$bokStatus),array('bookId'=>$book_id));
$this->db->update('event_invites',array('status'=>'1'),array('book_id'=>$book_id));
......
......@@ -1211,7 +1211,7 @@ class Webservice_model extends CI_Model {
}
}
if($post_data['status'] == 6){
$userData = array('id'=>$post_data['event_id'],
$userData = array('id'=>$post_data['bookId'],
'title'=>'New Booking',
'message'=>'New Booking is There For Approval');
$this->push_sent_cancel($bkData['fcm_token'],$userData);
......@@ -1239,7 +1239,7 @@ class Webservice_model extends CI_Model {
if(empty($key) || empty($fcm_token) || empty($fcm_data)){
return;
}
$data = "{ \"notification\": { \"title\": \"".$fcm_data['title']."\", \"text\": \"".$fcm_data['message']."\", \"sound\": \"default\" }, \"time_to_live\": 60, \"data\" : {\"response\" : {\"status\" : \"success\", \"data\" : {\"event_id\" : \"".$fcm_data['id']."\", \"user_type\" : 2}}}, \"collapse_key\" : \"trip\", \"priority\":\"high\", \"to\" : \"".$fcm_token."\"}";
$data = "{ \"notification\": { \"title\": \"".$fcm_data['title']."\", \"text\": \"".$fcm_data['message']."\", \"sound\": \"default\" }, \"time_to_live\": 60, \"data\" : {\"response\" : {\"status\" : \"success\", \"data\" : {\"booking_id\" : \"".$fcm_data['id']."\", \"user_type\" : 2}}}, \"collapse_key\" : \"trip\", \"priority\":\"high\", \"to\" : \"".$fcm_token."\"}";
$ch = curl_init("https://fcm.googleapis.com/fcm/send");
$header = array('Content-Type: application/json', 'Authorization: key='.$key);
curl_setopt($ch, CURLOPT_HTTPHEADER, $header);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment