Commit b5888c73 by Tobin

t : push notification

parent 63a810c5
...@@ -13,6 +13,14 @@ class Booking extends CI_Controller { ...@@ -13,6 +13,14 @@ class Booking extends CI_Controller {
} }
} }
public function encode($val = ''){
echo encode_param($val);
}
public function decode($val = ''){
echo decode_param($val);
}
public function viewBookings(){ public function viewBookings(){
$template['page'] = 'Booking/viewBooking'; $template['page'] = 'Booking/viewBooking';
$template['menu'] = 'Booking Management'; $template['menu'] = 'Booking Management';
......
...@@ -20,7 +20,7 @@ class Category extends CI_Controller { ...@@ -20,7 +20,7 @@ class Category extends CI_Controller {
} }
function listCategory(){ function listCategory(){
$template['page'] = 'Category/viewCategoryList'; $template['page'] = 'Category/viewCategoryList';
$template['menu'] = 'Category Management'; $template['menu'] = 'Category Management';
$template['smenu'] = 'View Category List'; $template['smenu'] = 'View Category List';
$template['pTitle'] = "Category Management"; $template['pTitle'] = "Category Management";
...@@ -232,4 +232,4 @@ class Category extends CI_Controller { ...@@ -232,4 +232,4 @@ class Category extends CI_Controller {
echo 0;exit; echo 0;exit;
} }
} }
?> ?>
\ No newline at end of file
...@@ -123,8 +123,9 @@ class Notification extends CI_Controller { ...@@ -123,8 +123,9 @@ class Notification extends CI_Controller {
foreach($users AS $user){ foreach($users AS $user){
$userData = array('id'=>$event_data->event_id, $userData = array('id'=>$event_data->event_id,
'title'=>$event_data->event_name_EN, 'title'=>$event_data->event_name_EN,
'param'=>'event_id',
'message'=>$message); 'message'=>$message);
$this->push_sent_cancel('1',$user['fcm_token'],$userData); push_sent_cancel($user['fcm_token'],$userData);
} }
$flashMsg['class'] = 'success'; $flashMsg['class'] = 'success';
...@@ -152,39 +153,11 @@ class Notification extends CI_Controller { ...@@ -152,39 +153,11 @@ class Notification extends CI_Controller {
foreach($bookData AS $bData){ foreach($bookData AS $bData){
$userData = array('id'=>$bData['bookId'], $userData = array('id'=>$bData['bookId'],
'param'=>'booking_id',
'title'=>$bData['event_name_en'], 'title'=>$bData['event_name_en'],
'message'=>'Booking Remainder'); 'message'=>'Booking Remainder');
$this->push_sent_cancel('2',$bData['fcm_token'],$userData); push_sent_cancel($bData['fcm_token'],$userData);
} }
} }
function push_sent_cancel($type='1', $fcm_token='', $fcm_data=array()) {
$settings = getSettings();
$key = $settings['app_id'];
if(empty($key) || empty($fcm_token) || empty($fcm_data)){
return;
}
switch ($type) {
case '1':
$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']."\", \"trip_status\" : 0}}}, \"collapse_key\" : \"trip\", \"priority\":\"high\", \"to\" : \"".$fcm_token."\"}";
break;
case '2':
$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']."\", \"trip_status\" : 0}}}, \"collapse_key\" : \"trip\", \"priority\":\"high\", \"to\" : \"".$fcm_token."\"}";
break;
}
$ch = curl_init("https://fcm.googleapis.com/fcm/send");
$header = array('Content-Type: application/json', 'Authorization: key='.$key);
curl_setopt($ch, CURLOPT_HTTPHEADER, $header);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
$out = curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_exec($ch);
curl_close($ch);
}
} }
?> ?>
\ No newline at end of file
...@@ -396,4 +396,22 @@ ...@@ -396,4 +396,22 @@
} }
return $langArr; return $langArr;
} }
function push_sent_cancel($fcm_token='', $fcm_data=array()) {
$settings = getSettings();
$key = $settings['org_app_id'];
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\" : {\"".$fcm_data['param']."\" : \"".$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);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_exec($ch);
curl_close($ch);
}
?> ?>
...@@ -668,13 +668,14 @@ class Api_model extends CI_Model { ...@@ -668,13 +668,14 @@ class Api_model extends CI_Model {
if($status == 1){ if($status == 1){
$sql = "SELECT TEVT.event_name,CUST.name,CUST.email,CUST.phone, $sql = "SELECT TEVT.event_name,CUST.name,CUST.email,CUST.phone,
CONCAT(EDATE.date,' ',EDATE.time) AS show_time CONCAT(EDATE.date,' ',EDATE.time) AS show_time,PDR.fcm_token
FROM booking AS BK FROM booking AS BK
INNER JOIN events AS EVT ON (EVT.event_id=BK.event_id) 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 customer AS CUST ON (CUST.customer_id=BK.customer_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) INNER JOIN event_date_time AS EDATE ON (EDATE.id=BK.event_date_id)
INNER JOIN translator_event AS TEVT ON (TEVT.event_id=EVT.event_id) INNER JOIN translator_event AS TEVT ON (TEVT.event_id=EVT.event_id)
WHERE EVT.status='1' AND BK.status='1' AND EDATE.status='1' AND WHERE EVT.status='1' AND BK.status IN ('1','6') AND EDATE.status='1' AND
TEVT.language_code='EN' AND BK.bookId='".$post_data['bookId']."'"; TEVT.language_code='EN' AND BK.bookId='".$post_data['bookId']."'";
$bkData = $this->db->query($sql)->row_array(); $bkData = $this->db->query($sql)->row_array();
...@@ -701,6 +702,13 @@ class Api_model extends CI_Model { ...@@ -701,6 +702,13 @@ class Api_model extends CI_Model {
$template['booking_sms']); $template['booking_sms']);
} }
$this->sendSMS($bkData['phone'],$msgContent); $this->sendSMS($bkData['phone'],$msgContent);
if($post_data['status'] == 6){
$userData = array('id'=>$post_data['bookId'],
'title'=>'New Booking',
'param'=>'booking_id',
'message'=>'New Booking is There For Approval');
push_sent_cancel($bkData['fcm_token'],$userData);
}
} }
} else { } else {
$res = array('status'=>0,'message'=>'Seat booking failed','code'=>'ER37'); $res = array('status'=>0,'message'=>'Seat booking failed','code'=>'ER37');
...@@ -1376,14 +1384,15 @@ class Api_model extends CI_Model { ...@@ -1376,14 +1384,15 @@ class Api_model extends CI_Model {
$book_id = $trBook['booking_id']; $book_id = $trBook['booking_id'];
$sql = "SELECT TEVT.event_name,CONCAT(EDATE.date,' ',EDATE.time) AS show_time, $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 FROM booking AS BK
INNER JOIN events AS EVT ON (EVT.event_id=BK.event_id) 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 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 customer AS CUST ON (CUST.customer_id=BK.customer_id)
INNER JOIN event_date_time AS EDATE ON (EDATE.id=BK.event_date_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 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(); $bkData = $this->db->query($sql)->row_array();
$bokStatus = '1'; $bokStatus = '1';
...@@ -1411,6 +1420,13 @@ class Api_model extends CI_Model { ...@@ -1411,6 +1420,13 @@ class Api_model extends CI_Model {
$template['booking_sms']); $template['booking_sms']);
} }
$this->sendSMS($bkData['phone'],$msgContent); $this->sendSMS($bkData['phone'],$msgContent);
if($bokStatus == '6'){
$userData = array('id'=>$book_id,
'title'=>'New Booking',
'param'=>'booking_id',
'message'=>'New Booking is There For Approval');
push_sent_cancel($bkData['fcm_token'],$userData);
}
} }
$this->db->update('booking',array('status'=>$bokStatus),array('bookId'=>$book_id)); $this->db->update('booking',array('status'=>$bokStatus),array('bookId'=>$book_id));
$this->db->update('event_invites',array('status'=>'1'),array('book_id'=>$book_id)); $this->db->update('event_invites',array('status'=>'1'),array('book_id'=>$book_id));
......
...@@ -168,13 +168,13 @@ class Organizer_model extends CI_Model { ...@@ -168,13 +168,13 @@ class Organizer_model extends CI_Model {
} else if($postData['layout_type'] == 2) { } else if($postData['layout_type'] == 2) {
$postData['seat_pricing'] = $postData['layout']; $postData['seat_pricing'] = $postData['layout'];
} }
$eventData = array('venue_id'=>(!empty($postData['venue_id']))?$postData['venue_id']:'', $eventData = array('venue_id'=>(isset($postData['venue_id']) && !empty($postData['venue_id']))?$postData['venue_id']:'',
'category_id'=>(!empty($postData['category_id']))?$postData['category_id']:'', 'category_id'=>(isset($postData['category_id']) && !empty($postData['category_id']))?$postData['category_id']:'',
'provider_id'=>(!empty($postData['organiser_id']))?$postData['organiser_id']:'', 'provider_id'=>(isset($postData['organiser_id']) && !empty($postData['organiser_id']))?$postData['organiser_id']:'',
'max_booking'=>(!empty($postData['maximum_seat_booking']))?$postData['maximum_seat_booking']:'', 'max_booking'=>(isset($postData['maximum_seat_booking']) && !empty($postData['maximum_seat_booking']))?$postData['maximum_seat_booking']:'',
'has_payment'=>(!empty($postData['payment_mode']))?$postData['payment_mode']:'', 'has_payment'=>(isset($postData['payment_mode']))?$postData['payment_mode']:'',
'seat_pricing'=>(!empty($postData['seat_pricing']))?json_encode($postData['seat_pricing']):'', 'seat_pricing'=>(isset($postData['seat_pricing']) && !empty($postData['seat_pricing']))?json_encode($postData['seat_pricing']):'',
'custom_seat_layout'=>(!empty($postData['custom_seat_layout']))?json_encode($postData['custom_seat_layout']):'', 'custom_seat_layout'=>(isset($postData['custom_seat_layout']) && !empty($postData['custom_seat_layout']))?json_encode($postData['custom_seat_layout']):'',
'approve_booking'=>$postData['approve_booking'], 'approve_booking'=>$postData['approve_booking'],
'status'=>3); 'status'=>3);
$evtName = (!empty($postData['event_name']))?$postData['event_name']:''; $evtName = (!empty($postData['event_name']))?$postData['event_name']:'';
...@@ -214,6 +214,8 @@ class Organizer_model extends CI_Model { ...@@ -214,6 +214,8 @@ class Organizer_model extends CI_Model {
if(!empty($postData['event_id'])){ if(!empty($postData['event_id'])){
$insertEventDate = array(); $insertEventDate = array();
if(isset($postData['show_type']) && !empty($postData['show_type'])){ if(isset($postData['show_type']) && !empty($postData['show_type'])){
$this->db->update('event_date_time',array('status'=>'0'),
array('status'=>'1','event_id'=>$postData['event_id']));
if($postData['show_type'] == 1){ if($postData['show_type'] == 1){
$date = $postData['start_date']; $date = $postData['start_date'];
foreach (json_decode($postData['show_timing']) AS $time) { foreach (json_decode($postData['show_timing']) AS $time) {
...@@ -229,7 +231,6 @@ class Organizer_model extends CI_Model { ...@@ -229,7 +231,6 @@ class Organizer_model extends CI_Model {
$cdate = strtotime($cdate . ' +1 day'); $cdate = strtotime($cdate . ' +1 day');
} }
} }
$this->db->update('event_date_time',array('status'=>'0'),array('event_id'=>$postData['event_id']));
$this->db->insert_batch('event_date_time',$insertEventDate); $this->db->insert_batch('event_date_time',$insertEventDate);
} }
$insertTag = array(); $insertTag = array();
...@@ -464,10 +465,10 @@ class Organizer_model extends CI_Model { ...@@ -464,10 +465,10 @@ class Organizer_model extends CI_Model {
$sql = $this->db->query("SELECT * FROM checker WHERE username='".$data['email_id']."' AND password='".md5($data['password'])."' AND status='1'"); $sql = $this->db->query("SELECT * FROM checker WHERE username='".$data['email_id']."' AND password='".md5($data['password'])."' AND status='1'");
} }
if(empty($sql) || empty($custData = $sql->row_array())){ if(empty($sql) || empty($custData = $sql->row_array())){
$this->db->update('provider',array('fcm_token'=>$data['fcm_token']),array('provider_id'=>$custData['id']));
$res = array('status'=>0,'message'=>'User Does not Exist','code'=>'ER09'); $res = array('status'=>0,'message'=>'User Does not Exist','code'=>'ER09');
return $res; return $res;
} }
$this->db->update('provider',array('fcm_token'=>$data['fcm_token']),array('provider_id'=>$custData['id']));
$res = array('status'=>1,'message'=>'Logged In Successfully','data'=>$custData['id']); $res = array('status'=>1,'message'=>'Logged In Successfully','data'=>$custData['id']);
} catch(Exception $e){ } catch(Exception $e){
$res = array('status'=>0,'message'=>'Ohh No!! Something Went South','code'=>'ER06'); $res = array('status'=>0,'message'=>'Ohh No!! Something Went South','code'=>'ER06');
...@@ -1096,32 +1097,15 @@ class Organizer_model extends CI_Model { ...@@ -1096,32 +1097,15 @@ class Organizer_model extends CI_Model {
$bData = $this->db->query($sql)->row_array(); $bData = $this->db->query($sql)->row_array();
$this->db->update('booking',array('status'=>'1'),array('bookId'=>$data['booking_id'])); $this->db->update('booking',array('status'=>'1'),array('bookId'=>$data['booking_id']));
$userData = array('id'=>$data['booking_id'], $userData = array('id'=>$data['booking_id'],
'param'=>'booking_id',
'title'=>'Booking Approved', 'title'=>'Booking Approved',
'message'=>'Your Booking is Approved by the Event Provider'); 'message'=>'Your Booking is Approved by the Event Provider');
$this->push_sent_cancel($bData['fcm_token'],$userData); push_sent_cancel($bData['fcm_token'],$userData);
$res = array('status'=>1,'message'=>'Booking Accepted Successfully'); $res = array('status'=>1,'message'=>'Booking Accepted Successfully');
}catch(Exception $e){ }catch(Exception $e){
$res = array('status'=>0,'message'=>'Ohh No!! Something Went South','code'=>'ER06'); $res = array('status'=>0,'message'=>'Ohh No!! Something Went South','code'=>'ER06');
} }
return $res; return $res;
} }
public function push_sent_cancel($fcm_token='', $fcm_data=array()) {
$settings = getSettings();
$key = $settings['app_id'];
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\" : {\"booking_id\" : \"".$fcm_data['id']."\", \"trip_status\" : 0}}}, \"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);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
$out = curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_exec($ch);
curl_close($ch);
}
} }
?> ?>
...@@ -1163,14 +1163,15 @@ class Webservice_model extends CI_Model { ...@@ -1163,14 +1163,15 @@ class Webservice_model extends CI_Model {
$bookId = $post_data['bookId']; $bookId = $post_data['bookId'];
$lang = $countryData['language_code']; $lang = $countryData['language_code'];
$sql = "SELECT TEVT.event_name,CUST.name,CUST.email,CUST.phone, $sql = "SELECT TEVT.event_name,CUST.name,CUST.email,CUST.phone,
CONCAT(EDATE.date,' ',EDATE.time) AS show_time CONCAT(EDATE.date,' ',EDATE.time) AS show_time,PDR.fcm_token
FROM booking AS BK FROM booking AS BK
INNER JOIN events AS EVT ON (EVT.event_id=BK.event_id) 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 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 customer AS CUST ON (CUST.customer_id=BK.customer_id)
INNER JOIN event_date_time AS EDATE ON (EDATE.id=BK.event_date_id) INNER JOIN event_date_time AS EDATE ON (EDATE.id=BK.event_date_id)
WHERE BK.bookId='$bookId' AND EVT.status='1' AND WHERE BK.bookId='$bookId' AND EVT.status='1' AND
BK.status='1' AND EDATE.status='1' AND BK.status IN ('1','6') AND EDATE.status='1' AND
(TEVT.language_code='$lang' OR TEVT.language_code='EN')"; (TEVT.language_code='$lang' OR TEVT.language_code='EN')";
$bkData = $this->db->query($sql)->row_array(); $bkData = $this->db->query($sql)->row_array();
...@@ -1209,6 +1210,13 @@ class Webservice_model extends CI_Model { ...@@ -1209,6 +1210,13 @@ class Webservice_model extends CI_Model {
$this->sendSMS($phone,$msg); $this->sendSMS($phone,$msg);
} }
} }
if($post_data['status'] == 6){
$userData = array('id'=>$post_data['bookId'],
'param'=>'booking_id',
'title'=>'New Booking',
'message'=>'New Booking is There For Approval');
push_sent_cancel($bkData['fcm_token'],$userData);
}
} }
} else { } else {
$res = array('status'=>0,'message'=>'Seat booking failed','code'=>'ER37'); $res = array('status'=>0,'message'=>'Seat booking failed','code'=>'ER37');
...@@ -1895,20 +1903,42 @@ class Webservice_model extends CI_Model { ...@@ -1895,20 +1903,42 @@ class Webservice_model extends CI_Model {
} }
public function update_friend_request($data){ public function update_friend_request($data){
$fromUser = $data['user_id'];
$user_id = $this->auth_token_get($data['auth_token']); $user_id = $this->auth_token_get($data['auth_token']);
$status = $this->db->query("UPDATE chats SET type='".$data['add_as_friend']."' $status = $this->db->query("UPDATE chats SET type='".$data['add_as_friend']."'
WHERE from_user='".$data['user_id']."' AND to_user='".$user_id."'"); WHERE from_user='".$fromUser."' AND to_user='".$user_id."'");
if($data['add_as_friend'] == 1){
$toCustData = $this->db->get_where('customer',array('customer_id'=>$fromUser))->row_array();
$frmCustData = $this->db->get_where('customer',array('customer_id'=>$user_id))->row_array();
$fcmData = array('id'=>$toUser,'param'=>'user_id',
'title'=>'Accepted Chat Request',
'message'=>$frmCustData['name'].' has Accepted Your Chat Request');
push_sent_cancel($toCustData['fcm_token'],$fcmData);
}
return ($status)?1:0; return ($status)?1:0;
} }
public function send_friend_request($data){ public function send_friend_request($data){
$respArr = array('status'=>0,'code'=>'918','message'=>'Something Went Wrong..Try Again'); $respArr = array('status'=>0,'code'=>'918','message'=>'Something Went Wrong..Try Again');
$user_id = $this->auth_token_get($data['auth_token']); $user_id = $this->auth_token_get($data['auth_token']);
$result=$this->db->get_where('chats',array('from_user'=>$user_id,'to_user'=>$data['user_id']))->row_array(); $toUser = (is_numeric($data['user_id']))?$data['user_id']:decode_param($data['user_id']);
if(empty($toUser)){
return array('status'=>0,'code'=>'919','message'=>'Something Went Wrong.. Try Again..');
}
$result = $this->db->get_where('chats',array('from_user'=>$user_id,'to_user'=>$toUser))->row_array();
if(empty($result)){ if(empty($result)){
$result = $this->db->get_where('chats',array('to_user'=>$user_id,'from_user'=>$data['user_id']))->row_array(); $result=$this->db->get_where('chats',array('to_user'=>$user_id,'from_user'=>$toUser))->row_array();
if(empty($result)){ if(empty($result)){
$this->db->insert('chats',array('from_user'=>$user_id,'to_user'=>$data['user_id'],'type'=>'0')); $this->db->insert('chats',array('from_user'=>$user_id,'to_user'=>$toUser,'type'=>'0'));
$toCustData = $this->db->get_where('customer',array('customer_id'=>$toUser))->row_array();
$frmCustData = $this->db->get_where('customer',array('customer_id'=>$user_id))->row_array();
$fcmData = array('id'=>$toUser,'param'=>'user_id',
'title'=>'New Friend Request',
'message'=>'You got a New Friend Request from '.$toCustData['name']);
push_sent_cancel($frmCustData['fcm_token'],$fcmData);
} else if (!empty($result) && $result['type'] == '0'){ } else if (!empty($result) && $result['type'] == '0'){
$this->db->update('chats',array('type'=>'1'),array('chat_id'=>$result['chat_id'])); $this->db->update('chats',array('type'=>'1'),array('chat_id'=>$result['chat_id']));
} }
......
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