Commit 4fc71c83 by Tobin

Merge branch 'master' into 'dev_production'

Master See merge request !34
parents b71da38f fadf0e11
......@@ -94,6 +94,7 @@ class Notification extends CI_Controller {
$flashMsg = array('message'=>'Something went wrong, please try again..!','class'=>'error');
if(!isset($_POST) || empty($_POST) ||
!isset($_POST['event_id']) || empty($event_id = $_POST['event_id']) ||
!isset($_POST['notifMsg']) || empty($message = $_POST['notifMsg']) ||
!isset($_POST['tags']) || empty($cities = $_POST['tags'])){
$this->session->set_flashdata('message',$flashMsg);
redirect(base_url('Notification/pushNotification'));
......@@ -113,9 +114,10 @@ class Notification extends CI_Controller {
foreach($users AS $user){
$userData = array('id'=>$event_data->event_id,
'title'=>$event_data->event_name,
'message'=>'New Event in your City');
'message'=>$message);
$this->push_sent_cancel('1',$user['fcm_token'],$userData);
}
$flashMsg['class'] = 'success';
$flashMsg['message'] = 'Push Send Successfully';
$this->session->set_flashdata('message',$flashMsg);
......@@ -137,16 +139,13 @@ class Notification extends CI_Controller {
EDATE.date='$date' AND EDATE.time<='$eTime' AND EDATE.time>='$sTime'
GROUP BY BOK.id,CUST.customer_id";
$sql = "SELECT CUST.customer_id,CUST.fcm_token,BOK.id AS booking_id,BOK.bookId,EVT.event_name FROM booking AS BOK INNER JOIN customer AS CUST ON (CUST.customer_id=BOK.customer_id) INNER JOIN users AS USR ON (USR.id=CUST.customer_id) INNER JOIN events AS EVT ON (EVT.event_id=BOK.event_id) INNER JOIN event_date_time AS EDATE ON (EDATE.event_id=BOK.event_id) WHERE BOK.status='1' AND USR.status='1' AND EDATE.status='1' AND EDATE.date='2019-04-29' AND EDATE.time<='09:45' AND EDATE.time>='09:44' GROUP BY BOK.id,CUST.customer_id";
$bookData = $this->db->query($sql)->result_array();
foreach($bookData AS $bData){
$userData = array('id'=>$bData['bookId'],
'title'=>$bData['event_name'],
'message'=>'Booking Remainder');
$this->push_sent_cancel('2',$bData['fcm_token'],$userData);
break;
}
}
......
......@@ -39,6 +39,18 @@ class Webservice extends CI_Controller {
}
}
public function update_fcm_token(){
$data = (array) json_decode(file_get_contents('php://input'));
$data['auth_token'] = $this->auth_token;
$res = $this->Webservice_model->update_fcm_token($data);
if($res['status']!=0){
$this->successResponse($res);
}
else{
$this->errorResponse($res['code'],$res['message']);
}
}
public function login() {
$data = (array) json_decode(file_get_contents('php://input'));
$res = $this->Webservice_model->login($data);
......@@ -395,5 +407,18 @@ class Webservice extends CI_Controller {
$this->errorResponse($res['code'],$res['message']);
}
}
public function user_language(){
$data = (array) json_decode(file_get_contents('php://input'));
$data['auth_token'] = $this->auth_token;
$res = $this->Webservice_model->user_language($data);
if($res['status']!=0){
$this->successResponse($res);
}
else{
$this->errorResponse($res['code'],$res['message']);
}
}
}
?>
\ No newline at end of file
......@@ -1092,7 +1092,11 @@ class Api_model extends CI_Model {
if(count($result)>0){
$result->seat_class = '';
if(!empty($ticketDetls = json_decode($result->ticket_details))){
$result->seat_class = $ticketDetls[0]->color;
if(is_array($ticketDetls) && isset($ticketDetls[0]) && isset($ticketDetls[0]->color)){
$result->seat_class = $ticketDetls[0]->color;
} else if (isset($ticketDetls->color)){
$result->seat_class = $ticketDetls->color;
}
}
$res = array('status'=>1,'data'=>$result);
......
......@@ -40,6 +40,8 @@ class Validation_app_model extends CI_Model {
'get_last_booking'=>array('auth_token'=>array('required'=>array('code'=>'ER17', 'message'=>'User Id is null or empty'),
)
),
'user_language'=> array('auth_token'=>array('required'=>array('code'=>'ER17', 'message'=>'User Id is null or empty')),
'language'=>array('required'=>array('code'=>'ER16', 'message'=>'Language is null or empty')),),
'add_favorites'=> array('auth_token'=>array('required'=>array('code'=>'ER17', 'message'=>'User Id is null or empty')),
......@@ -89,7 +91,8 @@ class Validation_app_model extends CI_Model {
'cancel_booking'=> array('auth_token'=>array('required'=>array('code'=>'ER17', 'message'=>'User Id is null or empty')),
'booking_id'=>array('required'=>array('code'=>'ER34', 'message'=>'Booking Id is null or empty')),),
'update_fcm_token'=> array('auth_token'=>array('required'=>array('code'=>'ER17', 'message'=>'User Id is null or empty')),
'fcm_token'=>array('required'=>array('code'=>'ER16', 'message'=>'Fcm token is null or empty')),),
......
......@@ -29,27 +29,32 @@
<div class="box-body">
<?php if(!empty($regionData)){ ?>
<div class="col-sm-4">
<div class="form-group">
<div class="box-header with-border">
<h3 class="box-title padLeft10 ">Event</h3>
<div class="col-sm-12">
<div class="form-group">
<label>Event</label>
<select name="event_id" class="form-control required" placeholder="Select Event" required>
<option selected disabled>Choose an Event</option>
<?php
foreach ($event_data as $event) {
echo '<option value="'.$event->event_id.'">'.$event->event_name.'</option>';
}
?>
</select>
</div>
</div>
<select name="event_id" class="form-control required" placeholder="Select Event" required>
<option selected disabled>Choose an Event</option>
<?php
foreach ($event_data as $event) {
echo '<option value="'.$event->event_id.'">'.$event->event_name.'</option>';
}
?>
</select>
<div class="col-sm-12">
<div class="form-group">
<input type="text" class="form-control required" data-parsley-trigger="change"
data-parsley-minlength="2" name="notifMsg" required data-parsley-pattern="^[a-zA-Z0-9\ . _ @ \/]+$" placeholder="Enter Notification Message">
</div>
</div>
</div>
<?php } ?>
<?php if(!empty($regionData)){ ?>
<div class="col-sm-8">
<div class="box-header with-border">
<h3 class="box-title padLeft10 ">Tags</h3>
</div>
<div type="parent" class="header-tag-box marginTop10">
<label>Tags</label>
<div type="parent" class="header-tag-box marginTop10" style="height:82px;">
<?php foreach($regionData AS $region){ ?>
<div id="tag_<?= $region->id ?>" class="header-tag cpoint"
tag_id="<?= $region->name ?>" select="0" onclick="manageTags(jQuery(this))">
......
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