Commit 1a377254 by Tobin

dc

parent 0a6e2ead
...@@ -179,7 +179,17 @@ class Booking extends CI_Controller { ...@@ -179,7 +179,17 @@ class Booking extends CI_Controller {
if(isset($data['Book_Status'])){ if(isset($data['Book_Status'])){
switch ($data['Book_Status']) { switch ($data['Book_Status']) {
case '0': $reportData[$key]['Book_Status'] = 'Cancelled'; break; case '0': $reportData[$key]['Book_Status'] = 'Cancelled'; break;
case '1': $reportData[$key]['Book_Status'] = 'Booked'; break; case '1':
if($data['has_payment'] == 1){
switch($data['trans_status']){
case 0: $reportData[$key]['Book_Status'] = 'Payment Failed'; break;
case 1: $reportData[$key]['Book_Status'] = 'Booked'; break;
case 2: $reportData[$key]['Book_Status'] = 'Pending'; break;
}
} else {
echo 'Booked';
}
break;
case '2': $reportData[$key]['Book_Status'] = 'Completed'; break; case '2': $reportData[$key]['Book_Status'] = 'Completed'; break;
case '3': $reportData[$key]['Book_Status'] = 'Pending'; break; case '3': $reportData[$key]['Book_Status'] = 'Pending'; break;
case '4': $reportData[$key]['Book_Status'] = 'Deleted'; break; case '4': $reportData[$key]['Book_Status'] = 'Deleted'; break;
......
...@@ -9,7 +9,7 @@ class Api_model extends CI_Model { ...@@ -9,7 +9,7 @@ class Api_model extends CI_Model {
public function login($data){ public function login($data){
try{ try{
$this->db->select('customer.name,customer.dob,customer.phone,customer.email,customer.profile_image $this->db->select('customer.name,customer.dob,customer.phone,customer.email,customer.profile_image
AS image,customer.gender,users.id AS userId,customer.city,customer.dob,customer.email_verified'); AS image,customer.gender,users.id AS userId,customer.profile_city AS city,customer.dob,customer.email_verified');
$this->db->where('users.status',1); $this->db->where('users.status',1);
$this->db->where('users.password',md5($data['password'])); $this->db->where('users.password',md5($data['password']));
$this->db->where('customer.email',$data['email_id']); $this->db->where('customer.email',$data['email_id']);
...@@ -447,7 +447,7 @@ class Api_model extends CI_Model { ...@@ -447,7 +447,7 @@ class Api_model extends CI_Model {
try{ try{
$user_id = $this->auth_token_get($data['auth_token']); $user_id = $this->auth_token_get($data['auth_token']);
if($user_id > 0) { if($user_id > 0) {
$this->db->select('customer.name,customer.phone,customer.email,customer.profile_image AS image,customer.gender,users.id AS userId, customer.city'); $this->db->select('customer.name,customer.phone,customer.email,customer.profile_image AS image,customer.gender,users.id AS userId, customer.profile_city AS city');
$this->db->where('users.id',$user_id); $this->db->where('users.id',$user_id);
$this->db->from('users'); $this->db->from('users');
$this->db->join('customer','customer.customer_id = users.id'); $this->db->join('customer','customer.customer_id = users.id');
...@@ -475,6 +475,10 @@ class Api_model extends CI_Model { ...@@ -475,6 +475,10 @@ class Api_model extends CI_Model {
unset($post_data['file']); unset($post_data['file']);
unset($post_data['auth_token']); unset($post_data['auth_token']);
$post_data['dob'] = (!empty($post_data['dob']))?strtotime($post_data['dob'])*1000:''; $post_data['dob'] = (!empty($post_data['dob']))?strtotime($post_data['dob'])*1000:'';
if(isset($post_data['city'])){
$post_data['profile_city'] = $post_data['city'];
unset($post_data['city']);
}
if(isset($data['file'])){ if(isset($data['file'])){
$img=$data['file']['name']; $img=$data['file']['name'];
$expbanner = explode('.',$img); $expbanner = explode('.',$img);
...@@ -486,7 +490,7 @@ class Api_model extends CI_Model { ...@@ -486,7 +490,7 @@ class Api_model extends CI_Model {
$imagePath="./assets/uploads/".$bannername; $imagePath="./assets/uploads/".$bannername;
$post_data['profile_image'] = "assets/uploads/".$bannername; $post_data['profile_image'] = "assets/uploads/".$bannername;
move_uploaded_file($data['file']["tmp_name"],$imagePath); move_uploaded_file($data['file']["tmp_name"],$imagePath);
$state = $this->db->where('customer_id',$user_id)->update('customer',$post_data); $state=$this->db->where('customer_id',$user_id)->update('customer',$post_data);
if($state){ if($state){
$img_error = 1; $img_error = 1;
} else { } else {
...@@ -505,7 +509,9 @@ class Api_model extends CI_Model { ...@@ -505,7 +509,9 @@ class Api_model extends CI_Model {
} }
if($img_error == 1) { if($img_error == 1) {
$this->db->select('customer.name,customer.dob,customer.phone,customer.email,customer.profile_image AS image,customer.gender,users.id AS userId, customer.city'); $this->db->select('customer.name,customer.dob,customer.phone,customer.email,
customer.profile_image AS image,customer.gender,
users.id AS userId, customer.profile_city AS city');
$this->db->where('users.id',$user_id); $this->db->where('users.id',$user_id);
$this->db->from('users'); $this->db->from('users');
$this->db->join('customer','customer.customer_id = users.id'); $this->db->join('customer','customer.customer_id = users.id');
...@@ -517,7 +523,6 @@ class Api_model extends CI_Model { ...@@ -517,7 +523,6 @@ class Api_model extends CI_Model {
$res = array('status'=>0,'message'=>'Invalid user','code'=>'ER19'); $res = array('status'=>0,'message'=>'Invalid user','code'=>'ER19');
} }
} }
} else { } else {
$res = array('status'=>0,'message'=>'Invalid user','code'=>'ER19'); $res = array('status'=>0,'message'=>'Invalid user','code'=>'ER19');
} }
...@@ -970,7 +975,7 @@ class Api_model extends CI_Model { ...@@ -970,7 +975,7 @@ class Api_model extends CI_Model {
return 0; return 0;
} }
$this->db->select('customer.name,customer.dob,customer.phone,customer.email,customer.gender, $this->db->select('customer.name,customer.dob,customer.phone,customer.email,customer.gender,
customer.profile_image AS image,users.id AS userId,customer.city,customer.dob, customer.profile_image AS image,users.id AS userId,customer.profile_city AS city,customer.dob,
customer.email_verified'); customer.email_verified');
$this->db->where('users.status',1); $this->db->where('users.status',1);
$this->db->where('customer.customer_id',$cust_id); $this->db->where('customer.customer_id',$cust_id);
......
...@@ -15,12 +15,13 @@ class Booking_model extends CI_Model { ...@@ -15,12 +15,13 @@ class Booking_model extends CI_Model {
CUST.dob,CUST.city,CUST.profile_image,BOK.event_id,BOK.bookId,BOK.event_date_id, CUST.dob,CUST.city,CUST.profile_image,BOK.event_id,BOK.bookId,BOK.event_date_id,
BOK.qrcode,BOK.no_of_ticket,BOK.ticket_details,BOK.amount, BOK.qrcode,BOK.no_of_ticket,BOK.ticket_details,BOK.amount,
BOK.reserved_by,BOK.status AS book_status,EVT.venue_id,EVT.category_id, BOK.reserved_by,BOK.status AS book_status,EVT.venue_id,EVT.category_id,
EVT.provider_id,EVT.event_name,EVT.event_discription, EVT.provider_id,EVT.event_name,EVT.event_discription,EVT.has_payment,
EVT.max_booking,EVT.seat_pricing,EVT.custom_seat_layout,EVT.status AS evt_status, EVT.max_booking,EVT.seat_pricing,EVT.custom_seat_layout,EVT.status AS evt_status,
HCAT.host_category,HCAT.show_layout,EDT.date,EDT.time,ECAT.category, HCAT.host_category,HCAT.show_layout,EDT.date,EDT.time,ECAT.category,
ECAT.category_description,ECAT.category_image,PRV.name AS provider_name, ECAT.category_description,ECAT.category_image,PRV.name AS provider_name,
PRV.email AS provider_email,PRV.phone AS provider_phone, PRV.email AS provider_email,PRV.phone AS provider_phone,
PRV.profile_image AS provider_image,VEN.venue_name,VEN.venue_details,VEN.location PRV.profile_image AS provider_image,VEN.venue_name,VEN.venue_details,VEN.location,
TRANS.transaction_id,TRANS.status AS trans_status
FROM booking AS BOK FROM booking AS BOK
INNER JOIN events AS EVT ON (EVT.event_id=BOK.event_id) INNER JOIN events AS EVT ON (EVT.event_id=BOK.event_id)
INNER JOIN customer AS CUST ON (CUST.customer_id=BOK.customer_id) INNER JOIN customer AS CUST ON (CUST.customer_id=BOK.customer_id)
...@@ -28,6 +29,7 @@ class Booking_model extends CI_Model { ...@@ -28,6 +29,7 @@ class Booking_model extends CI_Model {
INNER JOIN venue AS VEN ON (VEN.id=EVT.venue_id) INNER JOIN venue AS VEN ON (VEN.id=EVT.venue_id)
INNER JOIN host_categories AS HCAT ON (HCAT.host_cat_id=VEN.host_cat_id) INNER JOIN host_categories AS HCAT ON (HCAT.host_cat_id=VEN.host_cat_id)
INNER JOIN event_date_time AS EDT ON (EDT.id=BOK.event_date_id) INNER JOIN event_date_time AS EDT ON (EDT.id=BOK.event_date_id)
LEFT JOIN transaction AS TRANS ON (TRANS.booking_id=BOK.bookId)
LEFT JOIN provider AS PRV ON (PRV.provider_id=EVT.provider_id) LEFT JOIN provider AS PRV ON (PRV.provider_id=EVT.provider_id)
WHERE $cond AND EVT.status!='2'"; WHERE $cond AND EVT.status!='2'";
...@@ -83,7 +85,8 @@ class Booking_model extends CI_Model { ...@@ -83,7 +85,8 @@ class Booking_model extends CI_Model {
$where_clause .= " BOK.status = '".$where_cond['status']."' "; $where_clause .= " BOK.status = '".$where_cond['status']."' ";
} }
} }
$fields = 'BOK.id AS Booking_ID,'.$fields; $fields = 'BOK.id AS Booking_ID,TRANS.transaction_id,TRANS.status AS trans_status,
EVT.has_payment,'.$fields;
$sql = "SELECT ".$fields." $sql = "SELECT ".$fields."
FROM booking AS BOK FROM booking AS BOK
INNER JOIN events AS EVT ON (EVT.event_id=BOK.event_id) INNER JOIN events AS EVT ON (EVT.event_id=BOK.event_id)
...@@ -94,7 +97,9 @@ class Booking_model extends CI_Model { ...@@ -94,7 +97,9 @@ class Booking_model extends CI_Model {
INNER JOIN event_date_time AS EDT ON (EDT.id=BOK.event_date_id) INNER JOIN event_date_time AS EDT ON (EDT.id=BOK.event_date_id)
INNER JOIN region AS REG ON (REG.id=VEN.region_id) INNER JOIN region AS REG ON (REG.id=VEN.region_id)
INNER JOIN provider AS PRV ON (PRV.provider_id=EVT.provider_id) INNER JOIN provider AS PRV ON (PRV.provider_id=EVT.provider_id)
LEFT JOIN transaction AS TRANS ON (TRANS.booking_id=BOK.bookId)
".$where_clause." ".$where_clause."
GROUP BY Booking_ID
ORDER BY BOK.id ASC"; ORDER BY BOK.id ASC";
$data = $this->db->query($sql); $data = $this->db->query($sql);
......
...@@ -63,7 +63,17 @@ ...@@ -63,7 +63,17 @@
<?php <?php
switch($booking->book_status){ switch($booking->book_status){
case 0: echo 'Cancelled'; break; case 0: echo 'Cancelled'; break;
case 1: echo 'Booked'; break; case 1:
if($booking->has_payment == 1){
switch($booking->trans_status){
case 0: echo 'Payment Failed'; break;
case 1: echo 'Booked'; break;
case 2: echo 'Pending'; break;
}
} else {
echo 'Booked';
}
break;
case 2: echo 'Completed'; break; case 2: echo 'Completed'; break;
case 3: echo 'Pending'; break; case 3: echo 'Pending'; break;
} }
......
...@@ -126,34 +126,28 @@ ...@@ -126,34 +126,28 @@
</div> </div>
<div class="row"> <div class="row">
<div class="col-md-6"> <div class="col-md-2">
<div class="row"> Event Name
<div class="col-md-5">
Event Name
</div>
<div class="col-md-1">
:
</div>
<div class="col-md-5">
<?= $bookData->event_name ?>
</div>
</div>
</div> </div>
<div class="col-md-6"> <div class="col-md-1" style="padding-left: 52px;">
<div class="row"> :
<div class="col-md-5"> </div>
Event Description <div class="col-md-9">
</div> <?= $bookData->event_name ?>
<div class="col-md-1">
:
</div>
<div class="col-md-5">
<p class="truncateText"><?= $bookData->event_discription ?></p>
</div>
</div>
</div> </div>
</div> </div>
<div class="row">
<div class="col-md-2">
Event Description
</div>
<div class="col-md-1" style="padding-left: 52px;">
:
</div>
<div class="col-md-9">
<?= $bookData->event_discription ?>
</div>
</div>
<div class="row"> <div class="row">
<div class="col-md-6"> <div class="col-md-6">
......
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