Commit 7db050e3 by Jansa Jose

Merge branch 'master' into 'dev_production'

Master See merge request !211
parents c3ab9223 5900be34
......@@ -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));
......
......@@ -214,6 +214,8 @@ class Organizer_model extends CI_Model {
if(!empty($postData['event_id'])){
$insertEventDate = array();
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){
$date = $postData['start_date'];
foreach (json_decode($postData['show_timing']) AS $time) {
......@@ -229,7 +231,6 @@ class Organizer_model extends CI_Model {
$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);
}
$insertTag = array();
......
......@@ -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);
......@@ -1902,7 +1902,7 @@ class Webservice_model extends CI_Model {
$result = $this->db->query("SELECT CUST.customer_id,CUST.name,CUST.phone,CUST.profile_image,
CUST.profile_image_qr,CHT.type AS friend_status
FROM customer AS CUST
LEFT JOIN chats AS CHT ON ((CUST.customer_id=CHT.from_user OR CUST.customer_id=CHT.to_user) AND CHT.type=1)
LEFT JOIN chats AS CHT ON ((CUST.customer_id=CHT.from_user OR CUST.customer_id=CHT.to_user) AND CHT.type IN (0,1))
WHERE CUST.customer_id IN ($user_ids) AND
customer_id NOT IN
(SELECT from_user FROM chats
......
......@@ -66,8 +66,7 @@
<div class="form-group">
<label>Language</label>
<input type="text" class="form-control required" data-parsley-trigger="change"
data-parsley-minlength="2" data-parsley-pattern="^[a-zA-Z]+$"
name="language" required="" value="<?= (isset($countryData->language))?$countryData->language:'' ?>"placeholder="Country Name">
data-parsley-minlength="2" name="language" required="" value="<?= (isset($countryData->language))?$countryData->language:'' ?>"placeholder="Country Name">
<span class="glyphicon form-control-feedback"></span>
</div>
</div>
......
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