Commit c87c96e9 by Tobin

dc

parent ac99572b
......@@ -659,6 +659,11 @@ class Api extends CI_Controller {
}
}
public function addCard(){
pr($_POST);
}
/*================ START : Checker API ================*/
public function checker_bookingDetails(){
......
......@@ -12,7 +12,7 @@ class Booking extends CI_Controller {
redirect(base_url());
}
}
public function viewBookings(){
$template['page'] = 'Booking/viewBooking';
$template['menu'] = 'Booking Management';
......
......@@ -21,7 +21,5 @@ class Dashboard extends CI_Controller {
$this->load->view('template',$template);
}
}
?>
......@@ -570,5 +570,15 @@ class Webservice extends CI_Controller {
$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 {
public function login($data){
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
AS image,customer.gender,users.id AS userId,customer.profile_city AS city,customer.dob,customer.email_verified');
$this->db->where('users.status',1);
......
......@@ -95,7 +95,7 @@ class Booking_model extends CI_Model {
$end_date = date('Y-m-d',strtotime(trim($where_cond['end_date']).' 23:59'));
$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 .= " BOK.status = '".$where_cond['status']."' ";
......@@ -145,4 +145,4 @@ class Booking_model extends CI_Model {
return $reportData;
}
}
?>
\ No newline at end of file
?>
......@@ -5,10 +5,11 @@ class Country_model extends CI_Model {
}
public function getCountryData($country_id='',$view=''){
$cond = (!empty($view))?" status IN ($view) ":" status != '2' ";
$cond .= (!empty($country_id))?" AND country_id='$country_id' ":"";
$countryData = $this->db->query("SELECT * FROM country WHERE $cond");
$cond = (!empty($view))?" CTRY.status IN ($view) ":" CTRY.status != '2' ";
$cond .= (!empty($country_id))?" AND CTRY.country_id='$country_id' ":"";
$sql = "SELECT CTRY.* FROM country AS CTRY WHERE $cond";
$countryData = $this->db->query($sql);
if(!empty($countryData)){
return (empty($country_id))?$countryData->result():$countryData->row();
}
......@@ -35,8 +36,7 @@ class Country_model extends CI_Model {
if(empty($country_id)){
return 0;
}
$status = $this->db->update('country',array('status'=>$status),
array('country_id'=>$country_id));
$status = $this->db->update('country',array('status'=>$status),array('country_id'=>$country_id));
return $status;
}
......@@ -52,4 +52,4 @@ class Country_model extends CI_Model {
return (!empty($locality_id))?$locData->row():$locData->result();
}
}
?>
\ No newline at end of file
?>
......@@ -209,7 +209,7 @@ class Event_model extends CI_Model {
if(empty($event_id) || empty($eventData)){
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);
return $status;
}
......@@ -263,4 +263,4 @@ class Event_model extends CI_Model {
return $status;
}
}
?>
\ No newline at end of file
?>
......@@ -168,7 +168,8 @@ class Validation_app_model extends CI_Model {
'message' => 'Total Cost is null or empty'
)
)
)
),
'create_guest_user' => array()
);
public function validation_check($method_name, $parms) {
......
......@@ -1400,7 +1400,7 @@ class Webservice_model extends CI_Model {
INNER JOIN venue ON venue.id = events.venue_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
translator_event.language_code = '$lang'
(translator_event.language_code='$lang' OR translator_event.language_code='EN')
GROUP BY booking.id
ORDER BY booking.id DESC
LIMIT $page_limit, $per_page";
......@@ -1511,7 +1511,7 @@ class Webservice_model extends CI_Model {
LEFT JOIN customer ON customer.customer_id = booking.customer_id
LEFT JOIN review ON review.event_id = booking.event_id
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";
$result = $this->db->query($sql)->row_array();
......@@ -2039,5 +2039,22 @@ class Webservice_model extends CI_Model {
$this->image_lib->initialize($config);
$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 @@
<option selected disabled>Select Booking Status</option>
<option value="">All Bookings</option>
<?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) {
echo '<option value="'.$key.'">'.$stat.'</option>';
}
......@@ -258,4 +258,4 @@
jQuery(document).ready(function(){
jQuery('<?= $defFields ?>').prop("checked", true).parent().closest('div').addClass('disable-block');
});
</script>
\ No newline at end of file
</script>
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