Commit c87c96e9 by Tobin

dc

parent ac99572b
...@@ -659,6 +659,11 @@ class Api extends CI_Controller { ...@@ -659,6 +659,11 @@ class Api extends CI_Controller {
} }
} }
public function addCard(){
pr($_POST);
}
/*================ START : Checker API ================*/ /*================ START : Checker API ================*/
public function checker_bookingDetails(){ public function checker_bookingDetails(){
......
...@@ -21,7 +21,5 @@ class Dashboard extends CI_Controller { ...@@ -21,7 +21,5 @@ class Dashboard extends CI_Controller {
$this->load->view('template',$template); $this->load->view('template',$template);
} }
} }
?> ?>
...@@ -570,5 +570,15 @@ class Webservice extends CI_Controller { ...@@ -570,5 +570,15 @@ class Webservice extends CI_Controller {
$this->errorResponse($res['code'],$res['message']); $this->errorResponse($res['code'],$res['message']);
} }
} }
public function create_guest_user() {
$res = $this->Webservice_model->createGuestUser();
if($res['status'] == 'success'){
$this->response($res['data']);
}
else{
$this->errorResponse($res['code'],$res['message']);
}
}
} }
?> ?>
...@@ -8,6 +8,7 @@ class Api_model extends CI_Model { ...@@ -8,6 +8,7 @@ class Api_model extends CI_Model {
public function login($data){ public function login($data){
try{ try{
$res = array('status'=>0,'message'=>'Something went wrong','code'=>'ER07');
$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.profile_city AS 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);
......
...@@ -95,7 +95,7 @@ class Booking_model extends CI_Model { ...@@ -95,7 +95,7 @@ class Booking_model extends CI_Model {
$end_date = date('Y-m-d',strtotime(trim($where_cond['end_date']).' 23:59')); $end_date = date('Y-m-d',strtotime(trim($where_cond['end_date']).' 23:59'));
$where_clause .= " BOK.booking_date <= '".$end_date."' "; $where_clause .= " BOK.booking_date <= '".$end_date."' ";
} }
if(!empty($where_cond['status'])){ if($where_cond['status'] != ''){
$where_clause .= (empty($where_clause))?' WHERE ':' AND '; $where_clause .= (empty($where_clause))?' WHERE ':' AND ';
$where_clause .= " BOK.status = '".$where_cond['status']."' "; $where_clause .= " BOK.status = '".$where_cond['status']."' ";
......
...@@ -5,10 +5,11 @@ class Country_model extends CI_Model { ...@@ -5,10 +5,11 @@ class Country_model extends CI_Model {
} }
public function getCountryData($country_id='',$view=''){ public function getCountryData($country_id='',$view=''){
$cond = (!empty($view))?" status IN ($view) ":" status != '2' "; $cond = (!empty($view))?" CTRY.status IN ($view) ":" CTRY.status != '2' ";
$cond .= (!empty($country_id))?" AND country_id='$country_id' ":""; $cond .= (!empty($country_id))?" AND CTRY.country_id='$country_id' ":"";
$countryData = $this->db->query("SELECT * FROM country WHERE $cond"); $sql = "SELECT CTRY.* FROM country AS CTRY WHERE $cond";
$countryData = $this->db->query($sql);
if(!empty($countryData)){ if(!empty($countryData)){
return (empty($country_id))?$countryData->result():$countryData->row(); return (empty($country_id))?$countryData->result():$countryData->row();
} }
...@@ -35,8 +36,7 @@ class Country_model extends CI_Model { ...@@ -35,8 +36,7 @@ class Country_model extends CI_Model {
if(empty($country_id)){ if(empty($country_id)){
return 0; return 0;
} }
$status = $this->db->update('country',array('status'=>$status), $status = $this->db->update('country',array('status'=>$status),array('country_id'=>$country_id));
array('country_id'=>$country_id));
return $status; return $status;
} }
......
...@@ -209,7 +209,7 @@ class Event_model extends CI_Model { ...@@ -209,7 +209,7 @@ class Event_model extends CI_Model {
if(empty($event_id) || empty($eventData)){ if(empty($event_id) || empty($eventData)){
return 0; return 0;
} }
$this->db->update('event_date_time',array('status'=>'0'),array('event_id'=>$event_id)); $this->db->update('event_date_time',array('status'=>'0'),array('event_id'=>$event_id,'status'=>'1'));
$status = $this->db->insert_batch('event_date_time',$eventData); $status = $this->db->insert_batch('event_date_time',$eventData);
return $status; return $status;
} }
......
...@@ -168,7 +168,8 @@ class Validation_app_model extends CI_Model { ...@@ -168,7 +168,8 @@ class Validation_app_model extends CI_Model {
'message' => 'Total Cost is null or empty' 'message' => 'Total Cost is null or empty'
) )
) )
) ),
'create_guest_user' => array()
); );
public function validation_check($method_name, $parms) { public function validation_check($method_name, $parms) {
......
...@@ -1400,7 +1400,7 @@ class Webservice_model extends CI_Model { ...@@ -1400,7 +1400,7 @@ class Webservice_model extends CI_Model {
INNER JOIN venue ON venue.id = events.venue_id INNER JOIN venue ON venue.id = events.venue_id
INNER JOIN translator_event ON translator_event.event_id = events.event_id INNER JOIN translator_event ON translator_event.event_id = events.event_id
WHERE booking.customer_id = '$user_id' AND booking.status IN(0, 1, 2) AND WHERE booking.customer_id = '$user_id' AND booking.status IN(0, 1, 2) AND
translator_event.language_code = '$lang' (translator_event.language_code='$lang' OR translator_event.language_code='EN')
GROUP BY booking.id GROUP BY booking.id
ORDER BY booking.id DESC ORDER BY booking.id DESC
LIMIT $page_limit, $per_page"; LIMIT $page_limit, $per_page";
...@@ -1511,7 +1511,7 @@ class Webservice_model extends CI_Model { ...@@ -1511,7 +1511,7 @@ class Webservice_model extends CI_Model {
LEFT JOIN customer ON customer.customer_id = booking.customer_id LEFT JOIN customer ON customer.customer_id = booking.customer_id
LEFT JOIN review ON review.event_id = booking.event_id LEFT JOIN review ON review.event_id = booking.event_id
WHERE booking.customer_id = '$user_id' AND booking.status='2' AND WHERE booking.customer_id = '$user_id' AND booking.status='2' AND
translator_event.language_code='$lang' (translator_event.language_code='$lang' OR translator_event.language_code='EN')
ORDER BY booking.id DESC LIMIT 1"; ORDER BY booking.id DESC LIMIT 1";
$result = $this->db->query($sql)->row_array(); $result = $this->db->query($sql)->row_array();
...@@ -2039,5 +2039,22 @@ class Webservice_model extends CI_Model { ...@@ -2039,5 +2039,22 @@ class Webservice_model extends CI_Model {
$this->image_lib->initialize($config); $this->image_lib->initialize($config);
$this->image_lib->resize(); $this->image_lib->resize();
} }
public function createGuestUser(){
$res = array('status'=>0,'message'=>'Something went wrong','code'=>'ER10');
$status = $this->db->insert('users',array('display_name'=>'Guest','user_type'=>'6'));
if(!$status || empty($guest_id = $this->db->insert_id())){
return $res;
}
$guestInfo = array('customer_id'=>$guest_id,'name'=>'Guest','phone_verified'=>'1');
$status = $this->db->insert('customer',$guestInfo);
if(!$status){
return $res;
}
$auth_token = md5(microtime().rand());
$this->generateAuth($guest_id,$auth_token);
return array('status'=>'success','data'=>array('auth_token'=>$auth_token));
}
} }
?> ?>
...@@ -83,7 +83,7 @@ ...@@ -83,7 +83,7 @@
<option selected disabled>Select Booking Status</option> <option selected disabled>Select Booking Status</option>
<option value="">All Bookings</option> <option value="">All Bookings</option>
<?php <?php
$status = array('2'=>'Completed','1'=>'Bookings','3'=>'Pending','0'=>'Cancelled','4'=>'Deleted'); $status = array('2'=>'Completed','1'=>'Bookings','3'=>'Pending','0'=>'Cancelled','4'=>'Deleted','5'=>'Payment Failed');
foreach ($status as $key => $stat) { foreach ($status as $key => $stat) {
echo '<option value="'.$key.'">'.$stat.'</option>'; echo '<option value="'.$key.'">'.$stat.'</option>';
} }
......
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