Merge branch 'master' into 'dev_production'
Master
See merge request tobin/timeOut!1
Showing
application/models/Api_model.php
0 → 100644
<?php | |||
class Api_model extends CI_Model { | |||
public function _consruct(){ | |||
parent::_construct(); | |||
} | |||
public function login($data){ | |||
try{ | |||
$this->db->select('customer.name,customer.phone,customer.email,customer.profile_image AS image,customer.gender,users.id AS userId, customer.city'); | |||
$this->db->where('users.status',1); | |||
$this->db->where('users.password',md5($data['password'])); | |||
$this->db->where('customer.email',$data['email_id']); | |||
$this->db->from('users'); | |||
$this->db->join('customer','customer.customer_id = users.id'); | |||
$result = $this->db->get()->row(); | |||
if($result){ | |||
$result->auth_token = md5(microtime().rand()); | |||
$this->generateAuth($result->userId,$result->auth_token); | |||
$res = array('status'=>1,'data'=>$result); | |||
} else { | |||
$res = array('status'=>0,'message'=>'Invalid username / Password','code'=>'ER05'); | |||
} | |||
} catch(Exception $e) { | |||
$res = array('status'=>0,'message'=>'Ohh No!! Something went South!!','code'=>'ER06'); | |||
} | |||
return $res; | |||
} | |||
function generateAuth($userId,$auth_token) { | |||
$this->db->insert('customer_auth',array('user_id'=>$userId, 'auth_token'=>$auth_token)); | |||
} | |||
function register($data) { | |||
try{ | |||
$res_count = $this->db->where('email',$data['email_id'])->or_where('phone',$data['phone'])->get('customer')->row(); | |||
if(count($res_count) > 0) { | |||
if($res_count->email == $data['email_id'] && $res_count->phone == $data['phone']){ | |||
$res = array('status'=>0,'message'=>'Already have an account with email id and phone no. Please login','code'=>'ER12'); | |||
} else if($res_count->email == $data['email_id']){ | |||
$res = array('status'=>0,'message'=>'Email id already exists','code'=>'ER09'); | |||
} else if($res_count->phone == $data['phone']) { | |||
$res = array('status'=>0,'message'=>'Phone no already exists','code'=>'ER10'); | |||
} | |||
} else { | |||
$temp_password = $data['password']; | |||
$data['password'] = md5($data['password']); | |||
$user_data = array( | |||
'password'=>$data['password'], | |||
'display_name'=>'Customer', | |||
'user_type'=> 3 | |||
); | |||
$this->db->insert('users',$user_data); | |||
$id = $this->db->insert_id(); | |||
if($id) { | |||
$customer_data = array( | |||
'customer_id'=>$id, | |||
'phone'=>$data['phone'], | |||
'email'=>$data['email_id'] | |||
); | |||
$this->db->insert('customer', $customer_data); | |||
$subject = "New account created successfully"; | |||
$email_id = $data['email_id']; | |||
$message = "Hi,\n\r Welcome to TimeOut.\r\n Please use username: ".$email_id." and Password: ".$temp_password." for access your account"; | |||
$this->send_mail($subject,$email_id,$message); | |||
$this->db->select('customer.name,customer.phone,customer.email,customer.profile_image AS image,customer.gender,users.id AS userId, customer.city'); | |||
$this->db->where('users.id',$id); | |||
$this->db->from('users'); | |||
$this->db->join('customer','customer.customer_id = users.id'); | |||
$result = $this->db->get()->row(); | |||
if($result){ | |||
$result->auth_token = md5(microtime().rand()); | |||
$this->generateAuth($result->userId,$result->auth_token); | |||
$res = array('status'=>1,'data'=>$result); | |||
} else { | |||
$res = array('status'=>0,'message'=>'No record found','code'=>'ER13'); | |||
} | |||
} else { | |||
$res = array('status'=>0,'message'=>'Registration failed please try again','code'=>'ER11'); | |||
} | |||
} | |||
} catch(Exception $e) { | |||
$res = array('status'=>0,'message'=>'Ohh No!! Something went South!!','code'=>'ER06'); | |||
} | |||
return $res; | |||
} | |||
function send_mail($subject,$email,$message,$attach=null) { | |||
$ci =& get_instance(); | |||
$ci->load->library('email'); | |||
$ci->email->initialize(array( | |||
'protocol' => 'smtp', | |||
'smtp_host' => 'smtp.sendgrid.net', | |||
'smtp_user' => '[email protected]', | |||
'smtp_pass' => 'Golden_123', | |||
'smtp_port' => 587, | |||
'crlf' => "\r\n", | |||
'newline' => "\r\n" | |||
)); | |||
$ci->email->from('[email protected]', 'TimeOut'); | |||
$ci->email->to($email); | |||
$ci->email->cc('[email protected]'); | |||
$ci->email->subject($subject); | |||
$ci->email->message($message); | |||
if($attach!=null) { | |||
$ci->email->attach($attach); | |||
} | |||
return $ci->email->send(); | |||
} | |||
function forgot($data) { | |||
try{ | |||
$res_count = $this->db->where('email',$data['email_id'])->get('customer')->num_rows(); | |||
if($res_count > 0) { | |||
$unique_id = uniqid().time(); | |||
$this->db->where('email',$data['email_id'])->update('customer',array('reset_key'=>$unique_id)); | |||
$subject = "TimeOut: Forgot Password"; | |||
$url = 'http://techlabz.in/client/timeout/changepassword/'.$unique_id; | |||
$message = "Please use mentioned link for reset your password: ".$url; | |||
$email = $data['email_id']; | |||
$result = $this->send_mail($subject,$email,$message); | |||
if($result){ | |||
$res = array('status'=>1,'data'=>null); | |||
} else { | |||
$res = array('status'=>0,'message'=>'Please try again','code'=>'ER15'); | |||
} | |||
} else { | |||
$res = array('status'=>0,'message'=>'No account has been found in this email id','code'=>'ER14'); | |||
} | |||
} catch(Exception $e) { | |||
$res = array('status'=>0,'message'=>'Ohh No!! Something went South!!','code'=>'ER06'); | |||
} | |||
return $res; | |||
} | |||
function popular() { | |||
try { | |||
$rs = $this->db->select('id,name')->where('status',1)->get('region')->result(); | |||
if(count($rs) > 0) { | |||
$res = array('status'=>1,'data'=>$rs); | |||
} else { | |||
$res = array('status'=>0,'message'=>'No records found','code'=>'ER13'); | |||
} | |||
} catch(Exception $e) { | |||
$res = array('status'=>0,'message'=>'Ohh No!! Something went South!!','code'=>'ER06'); | |||
} | |||
return $res; | |||
} | |||
function category() { | |||
try { | |||
$rs = $this->db->select('cat_id,category,category_description,category_image')->where('status',1)->get('event_category')->result(); | |||
if(count($rs) > 0) { | |||
$res = array('status'=>1,'data'=>$rs); | |||
} else { | |||
$res = array('status'=>0,'message'=>'No records found','code'=>'ER13'); | |||
} | |||
} catch(Exception $e) { | |||
$res = array('status'=>0,'message'=>'Ohh No!! Something went South!!','code'=>'ER06'); | |||
} | |||
return $res; | |||
} | |||
function locality() { | |||
try { | |||
$rs = $this->db->select('id AS locality_id,venue_id,locality')->where('status',1)->get('locality')->result(); | |||
if(count($rs) > 0) { | |||
$res = array('status'=>1,'data'=>$rs); | |||
} else { | |||
$res = array('status'=>0,'message'=>'No records found','code'=>'ER13'); | |||
} | |||
} catch(Exception $e) { | |||
$res = array('status'=>0,'message'=>'Ohh No!! Something went South!!','code'=>'ER06'); | |||
} | |||
return $res; | |||
} | |||
function favourite($data) { | |||
try { | |||
$user_id = $this->auth_token_get($data['auth_token']); | |||
if($user_id > 0) { | |||
if($data['status'] == 1) { | |||
$post_data = array('user_id'=>$user_id, 'event_id'=>$data['event_id'], 'status'=>1); | |||
$count_rs = $this->db->where($post_data)->get('favourite')->num_rows(); | |||
if($count_rs > 0) { | |||
$res = array('status'=>0,'message'=>'Already submitted your Feedback','code'=>'ER21'); | |||
} else { | |||
$rs = $this->db->insert('favourite', $post_data); | |||
if($rs) { | |||
$res = array('status'=>1,'data'=>null); | |||
} else { | |||
$res = array('status'=>0,'message'=>'Feedback submission failed','code'=>'ER20'); | |||
} | |||
} | |||
} else { | |||
$where = array('user_id'=>$user_id, 'event_id'=>$data['event_id'], 'status'=>1); | |||
$rs = $this->db->where($where)->update('favourite', array('status'=>0)); | |||
if($rs) { | |||
$res = array('status'=>1,'data'=>null); | |||
} else { | |||
$res = array('status'=>0,'message'=>'Feedback submission failed','code'=>'ER20'); | |||
} | |||
} | |||
} else { | |||
$res = array('status'=>0,'message'=>'Invalid user','code'=>'ER19'); | |||
} | |||
} catch(Exception $e) { | |||
$res = array('status'=>0,'message'=>'Ohh No!! Something went South!!','code'=>'ER06'); | |||
} | |||
return $res; | |||
} | |||
function auth_token_get($token) { | |||
$rs = $this->db->select('user_id')->where('auth_token', $token)->get('customer_auth')->row(); | |||
if(count($rs) > 0) { | |||
return $rs->user_id; | |||
} else { | |||
return 0; | |||
} | |||
} | |||
function favouritelist($data) { | |||
try { | |||
$user_id = $this->auth_token_get($data['auth_token']); | |||
if($user_id > 0) { | |||
$where = array( | |||
'favourite.status'=>1, | |||
'favourite.user_id'=>$user_id, | |||
'events.status'=>1 | |||
); | |||
$result = $this->db->select('events.event_id, events.event_name,events.seat_pricing,events.custom_seat_layout,venue.layout,venue.layout_details, event_gallery.media_url,favourite.status AS fav_status')->where($where)->from('favourite')->join('events', 'events.event_id = favourite.event_id')->join('venue', 'venue.id = events.venue_id')->join('event_gallery', 'events.event_id = event_gallery.event_id AND event_gallery.media_type = 0', 'LEFT')->group_by('events.event_id')->get()->result(); | |||
if(count($result)>0){ | |||
$response = array(); | |||
foreach ($result as $rs) { | |||
if($rs->layout!=''){ | |||
if($rs->custom_seat_layout!=''){ | |||
$pricelist = json_decode($rs->custom_seat_layout, TRUE); | |||
$price = min(array_column($pricelist, 'price')); | |||
} else { | |||
$pricelist = json_decode($rs->layout_details, TRUE); | |||
$price = min(array_column($pricelist, 'price')); | |||
} | |||
} else { | |||
$pricelist = json_decode($rs->seat_pricing, TRUE); | |||
$price = $pricelist['price']; | |||
} | |||
$resData = array( | |||
'event_name'=>$rs->event_name, | |||
'media_url'=>$rs->media_url, | |||
'fav_status'=>$rs->fav_status, | |||
'price'=>$price, | |||
'event_id'=>$rs->event_id | |||
); | |||
array_push($response, $resData); | |||
} | |||
$res = array('status'=>1,'data'=>$response); | |||
} else { | |||
$res = array('status'=>0,'message'=>'No favourites yet!','code'=>'ER22'); | |||
} | |||
} else { | |||
$res = array('status'=>0,'message'=>'Invalid user','code'=>'ER19'); | |||
} | |||
} catch(Exception $e) { | |||
$res = array('status'=>0,'message'=>'Ohh No!! Something went South!!','code'=>'ER06'); | |||
} | |||
return $res; | |||
} | |||
function bookedlist($data) { | |||
try { | |||
$per_page = 10; | |||
$user_id = $this->auth_token_get($data['auth_token']); | |||
if($user_id > 0) { | |||
$count = $this->db->select('booking.id')->where('customer_id',$user_id)->get('booking')->num_rows(); | |||
if($count > 0) { | |||
if(isset($data['page'])) { | |||
$page = $data['page']; | |||
} else { | |||
$page = 1; | |||
} | |||
$page_limit = ($page - 1) * $per_page; | |||
if($count > $page_limit) { | |||
$result = $this->db->select('booking.id AS book_id,booking.event_id,booking.bookId AS bookingCode,booking.qrcode,booking.no_of_ticket,booking.amount,booking.status AS book_status,events.event_name,events.event_discription,event_gallery.media_url,venue.location')->where('customer_id',$user_id)->where('booking.status!=',3)->from('booking')->join('events','booking.event_id = events.event_id')->join('event_date_time','booking.event_date_id = event_date_time.id')->join('venue', 'venue.id = events.venue_id')->join('event_gallery', 'events.event_id = event_gallery.event_id AND event_gallery.media_type = 0', 'LEFT')->limit($per_page,$page_limit)->get()->result(); | |||
$meta = array('total_pages'=>ceil($count/$per_page), | |||
'total'=>$count, | |||
'current_page'=>$page, | |||
'per_page'=>$per_page | |||
); | |||
$response = array('data'=>$result,'meta'=>$meta); | |||
$res = array('status'=>1,'data'=>$response); | |||
} else { | |||
$res = array('status'=>0,'message'=>'No records found','code'=>'ER13'); | |||
} | |||
} else { | |||
$res = array('status'=>0,'message'=>'No records found','code'=>'ER13'); | |||
} | |||
} else { | |||
$res = array('status'=>0,'message'=>'Invalid user','code'=>'ER19'); | |||
} | |||
} catch(Exception $e) { | |||
$res = array('status'=>0,'message'=>'Ohh No!! Something went South!!','code'=>'ER06'); | |||
} | |||
return $res; | |||
} | |||
function bookingdetails($data) { | |||
try { | |||
$user_id = $this->auth_token_get($data['auth_token']); | |||
if($user_id > 0) { | |||
$result = $this->db->select('booking.id AS book_id,booking.event_id,booking.bookId AS bookingCode,booking.qrcode,booking.no_of_ticket,booking.amount,booking.status AS book_status,events.event_name,events.event_discription,event_gallery.media_url,venue.location,customer.name AS customer_name,customer.profile_image,venue.venue_name,venue.location_lat AS lat,venue.location_lng AS lng, booking.ticket_details')->where('booking.bookId',$data['bookingCode'])->from('booking')->join('events','booking.event_id = events.event_id')->join('event_date_time','booking.event_date_id = event_date_time.id')->join('venue', 'venue.id = events.venue_id')->join('event_gallery', 'events.event_id = event_gallery.event_id AND event_gallery.media_type = 0', 'LEFT')->join('customer','customer.customer_id = booking.customer_id')->get()->row(); | |||
if(count($result)>0){ | |||
$res = array('status'=>1,'data'=>$result); | |||
} else { | |||
$res = array('status'=>0,'message'=>'Invalid booking code','code'=>'ER24'); | |||
} | |||
} else { | |||
$res = array('status'=>0,'message'=>'Invalid user','code'=>'ER19'); | |||
} | |||
} catch(Exception $e) { | |||
$res = array('status'=>0,'message'=>'Ohh No!! Something went South!!','code'=>'ER06'); | |||
} | |||
return $res; | |||
} | |||
function cancel($data) { | |||
try { | |||
$user_id = $this->auth_token_get($data['auth_token']); | |||
if($user_id > 0) { | |||
$res_count = $this->db->where('bookId',$data['bookingCode'])->where('status',1)->get('booking')->num_rows(); | |||
if($res_count > 0) { | |||
$rs = $this->db->where('bookId',$data['bookingCode'])->update('booking',array('status'=>0)); | |||
if($rs) { | |||
$res = array('status'=>1,'data'=>null); | |||
} else { | |||
$res = array('status'=>0,'message'=>'Cancel submission failed','code'=>'ER25'); | |||
} | |||
} else { | |||
$res = array('status'=>0,'message'=>'Invalid booking code','code'=>'ER24'); | |||
} | |||
} else { | |||
$res = array('status'=>0,'message'=>'Invalid user','code'=>'ER19'); | |||
} | |||
} catch(Exception $e) { | |||
$res = array('status'=>0,'message'=>'Ohh No!! Something went South!!','code'=>'ER06'); | |||
} | |||
return $res; | |||
} | |||
function confirm($data) { | |||
try { | |||
$user_id = $this->auth_token_get($data['auth_token']); | |||
if($user_id > 0) { | |||
$res_count = $this->db->where('bookId',$data['bookingCode'])->get('booking')->num_rows(); | |||
if($res_count > 0) { | |||
$rs = $this->db->where('bookId',$data['bookingCode'])->update('booking',array('status'=>1)); | |||
if($rs) { | |||
$result = $this->db->select('booking.id AS book_id,booking.event_id,booking.bookId AS bookingCode,booking.qrcode,booking.no_of_ticket,booking.amount,booking.status AS book_status,events.event_name,events.event_discription,event_gallery.media_url,venue.location,customer.name AS customer_name,customer.profile_image,venue.venue_name,venue.location_lat AS lat,venue.location_lng AS lng, booking.ticket_details')->where('booking.bookId',$data['bookingCode'])->from('booking')->join('events','booking.event_id = events.event_id')->join('event_date_time','booking.event_date_id = event_date_time.id')->join('venue', 'venue.id = events.venue_id')->join('event_gallery', 'events.event_id = event_gallery.event_id AND event_gallery.media_type = 0', 'LEFT')->join('customer','customer.customer_id = booking.customer_id')->get()->row(); | |||
if(count($result)>0){ | |||
$res = array('status'=>1,'data'=>$result); | |||
} else { | |||
$res = array('status'=>0,'message'=>'Invalid booking code','code'=>'ER24'); | |||
} | |||
} else { | |||
$res = array('status'=>0,'message'=>'Confirm submission failed','code'=>'ER26'); | |||
} | |||
} else { | |||
$res = array('status'=>0,'message'=>'Invalid booking code','code'=>'ER24'); | |||
} | |||
} else { | |||
$res = array('status'=>0,'message'=>'Invalid user','code'=>'ER19'); | |||
} | |||
} catch(Exception $e) { | |||
$res = array('status'=>0,'message'=>'Ohh No!! Something went South!!','code'=>'ER06'); | |||
} | |||
return $res; | |||
} | |||
public function userinfo($data){ | |||
try{ | |||
$user_id = $this->auth_token_get($data['auth_token']); | |||
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->where('users.id',$user_id); | |||
$this->db->from('users'); | |||
$this->db->join('customer','customer.customer_id = users.id'); | |||
$result = $this->db->get()->row(); | |||
if($result){ | |||
$res = array('status'=>1,'data'=>$result); | |||
} else { | |||
$res = array('status'=>0,'message'=>'Invalid user','code'=>'ER19'); | |||
} | |||
} else { | |||
$res = array('status'=>0,'message'=>'Invalid user','code'=>'ER19'); | |||
} | |||
} catch(Exception $e) { | |||
$res = array('status'=>0,'message'=>'Ohh No!! Something went South!!','code'=>'ER06'); | |||
} | |||
return $res; | |||
} | |||
public function update_profile($data) { | |||
try{ | |||
$user_id = $this->auth_token_get($data['auth_token']); | |||
$img_error = 0; | |||
if($user_id > 0) { | |||
$post_data = $data; | |||
unset($post_data['file']); | |||
unset($post_data['auth_token']); | |||
if(isset($data['file'])){ | |||
$img=$data['file']['name']; | |||
$expbanner = explode('.',$img); | |||
$img_ext = strtolower($expbanner[1]); | |||
$rand = rand(10000,99999); | |||
$encname = time().$rand; | |||
if($img_ext=='png' || $img_ext=='jpeg' || $img_ext == 'jpg' || $img_ext == 'gif'){ | |||
$bannername = $encname.'.'.$img_ext; | |||
$imagePath="./assets/uploads/".$bannername; | |||
$post_data['profile_image'] = "assets/uploads/".$bannername; | |||
move_uploaded_file($data['file']["tmp_name"],$imagePath); | |||
$state = $this->db->where('customer_id',$user_id)->update('customer',$post_data); | |||
if($state){ | |||
$img_error = 1; | |||
} else { | |||
$res = array('status'=>0,'message'=>'Profile update failed','code'=>'ER32'); | |||
} | |||
} else { | |||
$res = array('status'=>0,'message'=>'Invalid Image type','code'=>'ER31'); | |||
} | |||
} else { | |||
$state = $this->db->where('customer_id',$user_id)->update('customer',$post_data); | |||
if($state){ | |||
$img_error = 1; | |||
} else { | |||
$res = array('status'=>0,'message'=>'Profile update failed','code'=>'ER32'); | |||
} | |||
} | |||
if($img_error == 1) { | |||
$this->db->select('customer.name,customer.phone,customer.email,customer.profile_image AS image,customer.gender,users.id AS userId, customer.city'); | |||
$this->db->where('users.id',$user_id); | |||
$this->db->from('users'); | |||
$this->db->join('customer','customer.customer_id = users.id'); | |||
$result = $this->db->get()->row(); | |||
if($result){ | |||
$res = array('status'=>1,'data'=>$result); | |||
} else { | |||
$res = array('status'=>0,'message'=>'Invalid user','code'=>'ER19'); | |||
} | |||
} | |||
} else { | |||
$res = array('status'=>0,'message'=>'Invalid user','code'=>'ER19'); | |||
} | |||
} | |||
catch(Exception $e) { | |||
$res = array('status'=>0,'message'=>'Ohh No!! Something went South!!','code'=>'ER06'); | |||
} | |||
return $res; | |||
} | |||
function tempbooking($data) { | |||
try{ | |||
$user_id = $this->auth_token_get($data['auth_token']); | |||
if($user_id > 0) { | |||
$post_data = $data; | |||
unset($post_data['auth_token']); | |||
$post_data['customer_id'] = $user_id; | |||
$post_data['ticket_details'] = json_encode($post_data['ticket_details']); | |||
$post_data['qrcode'] = $this->generateQR($post_data); | |||
$post_data['status'] = 3; | |||
$code = 'TO'; | |||
$ymd = date('ymd'); | |||
$squence = rand(1111,9999); | |||
$squence = str_pad($squence,4,0,STR_PAD_LEFT); | |||
$post_data['bookId'] = $code.$ymd.$squence; | |||
$rs = $this->db->insert('booking', $post_data); | |||
if($rs){ | |||
$res = array('status'=>1,'data'=>array('bookingCode'=>$post_data['bookId'])); | |||
} else { | |||
$res = array('status'=>0,'message'=>'Seat booking failed','code'=>'ER37'); | |||
} | |||
} else { | |||
$res = array('status'=>0,'message'=>'Invalid user','code'=>'ER19'); | |||
} | |||
} catch(Exception $e) { | |||
$res = array('status'=>0,'message'=>'Ohh No!! Something went South!!','code'=>'ER06'); | |||
} | |||
return $res; | |||
} | |||
function generateQR($data) { | |||
return 'https://www.barcodefaq.com/wp-content/uploads/2018/08/gs1-qrcode-fnc1.png'; | |||
} | |||
function recommend($data) { | |||
try { | |||
$per_page = 10; | |||
$user_id = $this->auth_token_get($data['auth_token']); | |||
if($user_id > 0) { | |||
$count = $this->db->query("SELECT events.event_id FROM events INNER JOIN event_date_time ON events.event_id = event_date_time.event_id AND event_date_time.date >= DATE_FORMAT(NOW(),'%Y-%m-%d') WHERE events.status = 1 GROUP BY events.event_id")->num_rows(); | |||
if($count > 0) { | |||
if(isset($data['page'])) { | |||
$page = $data['page']; | |||
} else { | |||
$page = 1; | |||
} | |||
$page_limit = ($page - 1) * $per_page; | |||
if($count > $page_limit) { | |||
$result = $this->db->query("SELECT events.event_id, AVG(review.rate) AS rate, MAX(booking.id) AS attendees, events.event_name,events.event_discription AS event_description,events.seat_pricing, events.custom_seat_layout, venue.layout, venue.layout_details,`event_gallery`.`media_url`,favourite.status AS fav_status, GROUP_CONCAT(DISTINCT tags.tag_name) AS tag FROM events INNER JOIN event_date_time ON events.event_id = event_date_time.event_id AND event_date_time.date >= DATE_FORMAT(NOW(),'%Y-%m-%d') INNER JOIN venue ON venue.id = events.venue_id LEFT JOIN `event_gallery` ON `events`.`event_id` = `event_gallery`.`event_id` AND `event_gallery`.`media_type` = 0 LEFT JOIN booking on booking.event_id = events.event_id LEFT JOIN favourite ON favourite.event_id = events.event_id AND favourite.user_id = ".$user_id." AND favourite.status = 1 LEFT JOIN event_tags ON events.event_id = event_tags.event_id LEFT JOIN tags on tags.tag_id = event_tags.tag_id LEFT JOIN review ON events.event_id = review.event_id WHERE events.status = 1 GROUP BY events.event_id ORDER BY attendees DESC LIMIT ". $page_limit.", ".$per_page)->result(); | |||
if(count($result)>0){ | |||
$resultData = array(); | |||
foreach ($result as $rs) { | |||
if($rs->layout!=''){ | |||
if($rs->custom_seat_layout!=''){ | |||
$pricelist = json_decode($rs->custom_seat_layout, TRUE); | |||
$price = min(array_column($pricelist, 'price')); | |||
} else { | |||
$pricelist = json_decode($rs->layout_details, TRUE); | |||
$price = min(array_column($pricelist, 'price')); | |||
} | |||
} else { | |||
$pricelist = json_decode($rs->seat_pricing, TRUE); | |||
$price = $pricelist['price']; | |||
} | |||
$tags = explode(',', $rs->tag); | |||
$resData = array( | |||
'event_name'=>$rs->event_name, | |||
'event_description'=>$rs->event_description, | |||
'media_url'=>$rs->media_url, | |||
'fav_status'=>$rs->fav_status, | |||
'price'=>$price, | |||
'event_id'=>$rs->event_id, | |||
'attendees'=>$rs->attendees, | |||
'rate'=>$rs->rate, | |||
'tag'=>$tags | |||
); | |||
array_push($resultData, $resData); | |||
} | |||
$meta = array('total_pages'=>ceil($count/$per_page), | |||
'total'=>$count, | |||
'current_page'=>$page, | |||
'per_page'=>$per_page | |||
); | |||
$response = array('data'=>$resultData,'meta'=>$meta); | |||
$res = array('status'=>1,'data'=>$response); | |||
} else { | |||
$res = array('status'=>0,'message'=>'No records found','code'=>'ER13'); | |||
} | |||
} else { | |||
$res = array('status'=>0,'message'=>'No records found','code'=>'ER13'); | |||
} | |||
} else { | |||
$res = array('status'=>0,'message'=>'No records found','code'=>'ER13'); | |||
} | |||
} else { | |||
$res = array('status'=>0,'message'=>'Invalid user','code'=>'ER19'); | |||
} | |||
} catch(Exception $e) { | |||
$res = array('status'=>0,'message'=>'Ohh No!! Something went South!!','code'=>'ER06'); | |||
} | |||
return $res; | |||
} | |||
function discover($data) { | |||
try { | |||
$user_id = $this->auth_token_get($data['auth_token']); | |||
if($user_id > 0) { | |||
$cat_id = $data['cat_id']; | |||
$category = $this->db->where('cat_id',$cat_id)->get('event_category')->row(); | |||
$result = $this->db->query("SELECT events.event_id, events.event_name,events.event_discription AS event_description,events.seat_pricing, events.custom_seat_layout, venue.layout, venue.layout_details,`event_gallery`.`media_url` FROM events INNER JOIN event_date_time ON events.event_id = event_date_time.event_id AND event_date_time.date >= DATE_FORMAT(NOW(),'%Y-%m-%d') INNER JOIN venue ON venue.id = events.venue_id LEFT JOIN `event_gallery` ON `events`.`event_id` = `event_gallery`.`event_id` AND `event_gallery`.`media_type` = 0 WHERE events.status = 1 AND events.category_id = ".$cat_id." GROUP BY events.event_id")->result(); | |||
if(count($result)>0){ | |||
$resultData = array(); | |||
foreach ($result as $rs) { | |||
if($rs->layout!=''){ | |||
if($rs->custom_seat_layout!=''){ | |||
$pricelist = json_decode($rs->custom_seat_layout, TRUE); | |||
$price = min(array_column($pricelist, 'price')); | |||
} else { | |||
$pricelist = json_decode($rs->layout_details, TRUE); | |||
$price = min(array_column($pricelist, 'price')); | |||
} | |||
} else { | |||
$pricelist = json_decode($rs->seat_pricing, TRUE); | |||
$price = $pricelist['price']; | |||
} | |||
$resData = array( | |||
'event_name'=>$rs->event_name, | |||
'event_description'=>$rs->event_description, | |||
'media_url'=>$rs->media_url, | |||
'price'=>$price, | |||
'event_id'=>$rs->event_id | |||
); | |||
array_push($resultData, $resData); | |||
} | |||
$category->data = $resultData; | |||
$res = array('status'=>1,'data'=>$category); | |||
} else { | |||
$res = array('status'=>0,'message'=>'No records found','code'=>'ER13'); | |||
} | |||
} else { | |||
$res = array('status'=>0,'message'=>'Invalid user','code'=>'ER19'); | |||
} | |||
} catch(Exception $e) { | |||
$res = array('status'=>0,'message'=>'Ohh No!! Something went South!!','code'=>'ER06'); | |||
} | |||
return $res; | |||
} | |||
function event($data) { | |||
try { | |||
$user_id = $this->auth_token_get($data['auth_token']); | |||
if($user_id > 0) { | |||
$event_id = $data['event_id']; | |||
$result = $this->db->query("SELECT events.event_id, AVG(review.rate) AS rate, MAX(booking.id) AS attendees, events.event_name,events.event_discription AS event_description,events.seat_pricing, events.custom_seat_layout, venue.layout, venue.layout_details,venue.venue_name,venue.venue_details,venue.location,venue.location_lat AS lat,venue.location_lng AS lng, GROUP_CONCAT(DISTINCT `event_gallery`.`media_url`) AS media_url,favourite.status AS fav_status, GROUP_CONCAT(DISTINCT tags.tag_name) AS tag, GROUP_CONCAT(DISTINCT CONCAT_WS('#',event_date_time.date,event_date_time.time)) AS date_time FROM events INNER JOIN event_date_time ON events.event_id = event_date_time.event_id INNER JOIN venue ON venue.id = events.venue_id LEFT JOIN `event_gallery` ON `events`.`event_id` = `event_gallery`.`event_id` AND `event_gallery`.`status` != 0 LEFT JOIN booking on booking.event_id = events.event_id LEFT JOIN favourite ON favourite.event_id = events.event_id AND favourite.user_id = ".$user_id." AND favourite.status = 1 LEFT JOIN event_tags ON events.event_id = event_tags.event_id LEFT JOIN tags on tags.tag_id = event_tags.tag_id LEFT JOIN review ON events.event_id = review.event_id WHERE events.event_id = ".$event_id." GROUP BY events.event_id, event_date_time.event_id")->result(); | |||
if(count($result)>0){ | |||
$resultData = array(); | |||
$event_layout = ''; | |||
foreach ($result as $rs) { | |||
if($rs->layout!=''){ | |||
if($rs->custom_seat_layout!=''){ | |||
$pricelist = json_decode($rs->custom_seat_layout, TRUE); | |||
$price = min(array_column($pricelist, 'price')); | |||
$event_layout = $rs->custom_seat_layout; | |||
} else { | |||
$pricelist = json_decode($rs->layout_details, TRUE); | |||
$price = min(array_column($pricelist, 'price')); | |||
$event_layout = $rs->layout_details; | |||
} | |||
} else { | |||
$pricelist = json_decode($rs->seat_pricing, TRUE); | |||
$price = $pricelist['price']; | |||
$event_layout = $rs->seat_pricing; | |||
} | |||
$dates = explode(',', $rs->date_time); | |||
$time_spec = array(); | |||
$latlng = array('lat'=>$rs->lat, 'lng'=>$rs->lng); | |||
foreach ($dates as $rss) { | |||
list($date,$time) = explode('#', $rss); | |||
$time_spec[$date][] = $time; | |||
} | |||
$tags = explode(',', $rs->tag); | |||
$media_url = explode(',', $rs->media_url); | |||
$resData = array( | |||
'event_id'=>$rs->event_id, | |||
'event_name'=>$rs->event_name, | |||
'event_description'=>$rs->event_description, | |||
'event_rate'=>$rs->rate, | |||
'event_attendees'=>$rs->attendees, | |||
'event_price'=>$price, | |||
'event_urls'=>$media_url, | |||
'event_tags'=>$tags, | |||
'event_layout_url'=>$rs->layout, | |||
'event_price_layout'=>$event_layout, | |||
'event_times'=>$time_spec, | |||
'fav_status'=>$rs->fav_status, | |||
'event_id'=>$rs->event_id, | |||
'venue_name'=>$rs->venue_name, | |||
'venue_details'=>$rs->venue_details, | |||
'venue_location'=>$rs->location, | |||
'latlng'=>$latlng | |||
); | |||
array_push($resultData, $resData); | |||
} | |||
$res = array('status'=>1,'data'=>$resultData); | |||
} else { | |||
$res = array('status'=>0,'message'=>'No records found','code'=>'ER13'); | |||
} | |||
} else { | |||
$res = array('status'=>0,'message'=>'Invalid user','code'=>'ER19'); | |||
} | |||
} catch(Exception $e) { | |||
$res = array('status'=>0,'message'=>'Ohh No!! Something went South!!','code'=>'ER06'); | |||
} | |||
return $res; | |||
} | |||
function search($data) { | |||
try { | |||
$per_page = 10; | |||
$user_id = $this->auth_token_get($data['auth_token']); | |||
if($user_id > 0) { | |||
$where = ''; | |||
if(isset($data['venue_id'])) { | |||
$where = ' AND events.venue_id='.$data['venue_id']; | |||
} | |||
if(isset($data['cat_id'])) { | |||
$where = ' AND events.category_id='.$data['cat_id']; | |||
} | |||
$case = "AND event_date_time.date >= DATE_FORMAT(NOW(),'%Y-%m-%d')"; | |||
if(isset($data['choose_date'])) { | |||
switch ($data['choose_date']) { | |||
case '1': | |||
$case = ""; | |||
break; | |||
case '2': | |||
$case = "AND event_date_time.date = DATE_FORMAT(NOW(),'%Y-%m-%d')"; | |||
break; | |||
case '3': | |||
$case = "AND event_date_time.date = DATE_FORMAT(NOW() + INTERVAL 1 DAY,'%Y-%m-%d')"; | |||
break; | |||
case '4': | |||
$first_day_of_the_week = 'Monday'; | |||
$start_of_the_week = strtotime("Last $first_day_of_the_week"); | |||
if ( strtolower(date('l')) === strtolower($first_day_of_the_week) ) | |||
{ | |||
$start_of_the_week = strtotime('today'); | |||
} | |||
$end_of_the_week = $start_of_the_week + (60 * 60 * 24 * 7) - 1; | |||
$date_format = 'Y-m-d'; | |||
$start_date = date($date_format, $start_of_the_week); | |||
$end_date = date($date_format, $end_of_the_week); | |||
$case = "AND event_date_time.date >= $start_date AND event_date_time.date <= $end_date"; | |||
break; | |||
case '5': | |||
$sunday = date( 'Y-m-d', strtotime( 'sunday this week')); | |||
$saturday = date( 'Y-m-d', strtotime( 'saturday this week')); | |||
$case = "AND event_date_time.date = $sunday OR event_date_time.date = $saturday"; | |||
case '5': | |||
$sunday = date( 'Y-m-d', strtotime( 'sunday this week')); | |||
$saturday = date( 'Y-m-d', strtotime( 'saturday this week')); | |||
$case = "AND event_date_time.date = $sunday OR event_date_time.date = $saturday"; | |||
default: | |||
$case = "AND event_date_time.date >= DATE_FORMAT(NOW(),'%Y-%m-%d')"; | |||
break; | |||
} | |||
$where = ' AND events.venue_id='.$data['venue_id']; | |||
} | |||
$count = $this->db->query("SELECT events.event_id FROM events INNER JOIN event_date_time ON events.event_id = event_date_time.event_id $case WHERE events.status = 1 $where GROUP BY events.event_id")->num_rows(); | |||
if($count > 0) { | |||
if(isset($data['page'])) { | |||
$page = $data['page']; | |||
} else { | |||
$page = 1; | |||
} | |||
$page_limit = ($page - 1) * $per_page; | |||
if($count > $page_limit) { | |||
$result = $this->db->query("SELECT events.event_id, AVG(review.rate) AS rate, MAX(booking.id) AS attendees, events.event_name,events.event_discription AS event_description,events.seat_pricing, events.custom_seat_layout, venue.layout, venue.layout_details,`event_gallery`.`media_url`,favourite.status AS fav_status, GROUP_CONCAT(DISTINCT tags.tag_name) AS tag FROM events INNER JOIN event_date_time ON events.event_id = event_date_time.event_id $case INNER JOIN venue ON venue.id = events.venue_id LEFT JOIN `event_gallery` ON `events`.`event_id` = `event_gallery`.`event_id` AND `event_gallery`.`media_type` = 0 LEFT JOIN booking on booking.event_id = events.event_id LEFT JOIN favourite ON favourite.event_id = events.event_id AND favourite.user_id = ".$user_id." AND favourite.status = 1 LEFT JOIN event_tags ON events.event_id = event_tags.event_id LEFT JOIN tags on tags.tag_id = event_tags.tag_id LEFT JOIN review ON events.event_id = review.event_id WHERE events.status = 1 $where GROUP BY events.event_id ORDER BY attendees DESC LIMIT ". $page_limit.", ".$per_page)->result(); | |||
if(count($result)>0){ | |||
$resultData = array(); | |||
foreach ($result as $rs) { | |||
if($rs->layout!=''){ | |||
if($rs->custom_seat_layout!=''){ | |||
$pricelist = json_decode($rs->custom_seat_layout, TRUE); | |||
$price = min(array_column($pricelist, 'price')); | |||
} else { | |||
$pricelist = json_decode($rs->layout_details, TRUE); | |||
$price = min(array_column($pricelist, 'price')); | |||
} | |||
} else { | |||
$pricelist = json_decode($rs->seat_pricing, TRUE); | |||
$price = $pricelist['price']; | |||
} | |||
$tags = explode(',', $rs->tag); | |||
$resData = array( | |||
'event_name'=>$rs->event_name, | |||
'event_description'=>$rs->event_description, | |||
'media_url'=>$rs->media_url, | |||
'fav_status'=>$rs->fav_status, | |||
'price'=>$price, | |||
'event_id'=>$rs->event_id, | |||
'attendees'=>$rs->attendees, | |||
'rate'=>$rs->rate, | |||
'tag'=>$tags | |||
); | |||
array_push($resultData, $resData); | |||
} | |||
$meta = array('total_pages'=>ceil($count/$per_page), | |||
'total'=>$count, | |||
'current_page'=>$page, | |||
'per_page'=>$per_page | |||
); | |||
$response = array('data'=>$resultData,'meta'=>$meta); | |||
$res = array('status'=>1,'data'=>$response); | |||
} else { | |||
$res = array('status'=>0,'message'=>'No records found','code'=>'ER13'); | |||
} | |||
} else { | |||
$res = array('status'=>0,'message'=>'No records found','code'=>'ER13'); | |||
} | |||
} else { | |||
$res = array('status'=>0,'message'=>'No records found','code'=>'ER13'); | |||
} | |||
} else { | |||
$res = array('status'=>0,'message'=>'Invalid user','code'=>'ER19'); | |||
} | |||
} catch(Exception $e) { | |||
$res = array('status'=>0,'message'=>'Ohh No!! Something went South!!','code'=>'ER06'); | |||
} | |||
return $res; | |||
} | |||
} | |||
?> | |||
\ No newline at end of file |
application/models/Validation_model.php
0 → 100644
This source diff could not be displayed because it is too large.
You can
view the blob
instead.
... | @@ -3,7 +3,7 @@ | ... | @@ -3,7 +3,7 @@ |
-- https://www.phpmyadmin.net/ | -- https://www.phpmyadmin.net/ | ||
-- | -- | ||
-- Host: db | -- Host: db | ||
-- Generation Time: Feb 08, 2019 at 01:02 PM | -- Generation Time: Feb 15, 2019 at 06:59 AM | ||
-- Server version: 5.6.41 | -- Server version: 5.6.41 | ||
-- PHP Version: 7.2.8 | -- PHP Version: 7.2.8 | ||
... | @@ -31,18 +31,44 @@ SET time_zone = "+00:00"; | ... | @@ -31,18 +31,44 @@ SET time_zone = "+00:00"; |
CREATE TABLE `booking` ( | CREATE TABLE `booking` ( | ||
`id` int(11) NOT NULL, | `id` int(11) NOT NULL, | ||
`event_id` int(11) NOT NULL, | `event_id` int(11) NOT NULL, | ||
`schedules_id` int(11) NOT NULL, | |||
`customer_id` int(11) NOT NULL COMMENT 'Guest - 0', | `customer_id` int(11) NOT NULL COMMENT 'Guest - 0', | ||
`bookId` varchar(45) DEFAULT NULL, | `bookId` varchar(45) DEFAULT NULL, | ||
`event_date_id` int(11) NOT NULL, | |||
`qrcode` varchar(100) DEFAULT NULL, | `qrcode` varchar(100) DEFAULT NULL, | ||
`no_of_ticket` int(11) DEFAULT NULL, | `no_of_ticket` int(11) DEFAULT NULL, | ||
`ticket_details` varchar(255) NOT NULL, | |||
`amount` double DEFAULT NULL, | `amount` double DEFAULT NULL, | ||
`email` varchar(50) DEFAULT NULL, | `email` varchar(50) DEFAULT NULL, | ||
`phone` varchar(25) DEFAULT NULL, | `phone` varchar(25) DEFAULT NULL, | ||
`reserved_by` int(11) DEFAULT '3' COMMENT '1 - SuperAdmin\n2 - Provider\n3 - Customer', | `reserved_by` int(11) DEFAULT '3' COMMENT '1 - SuperAdmin\n2 - Provider\n3 - Customer', | ||
`status` int(11) DEFAULT '1' COMMENT '0 - Cancelled, 1 - Booked, 2 - Completed' | `status` int(11) DEFAULT '1' COMMENT '0 - Cancelled, 1 - Booked, 2 - Completed, 3 - Pending' | ||
) ENGINE=InnoDB DEFAULT CHARSET=latin1; | ) ENGINE=InnoDB DEFAULT CHARSET=latin1; | ||
-- | |||
-- Dumping data for table `booking` | |||
-- | |||
INSERT INTO `booking` (`id`, `event_id`, `customer_id`, `bookId`, `event_date_id`, `qrcode`, `no_of_ticket`, `ticket_details`, `amount`, `email`, `phone`, `reserved_by`, `status`) VALUES | |||
(1, 3, 3, 'BKD123987', 18, 'https://www.barcodefaq.com/wp-content/uploads/2018/08/gs1-qrcode-fnc1.png', 4, '[{\"color\":\"Red\",\"price\":\"11\",\"no_ticket\":\"2\",\"total_price\":\"22\"}]', 250, '[email protected]', '9847586912', 3, 1), | |||
(2, 3, 3, 'BKD134568', 18, 'https://www.barcodefaq.com/wp-content/uploads/2018/08/gs1-qrcode-fnc1.png', 2, '{\"price\":\"250\",\"no_ticket\":\"2\",\"total_price\":\"500\"}', 125, '[email protected]', '9847586912', 3, 1), | |||
(3, 3, 3, 'BKD123415', 18, 'https://www.barcodefaq.com/wp-content/uploads/2018/08/gs1-qrcode-fnc1.png', 5, '', 300, '[email protected]', '9847586912', 3, 1), | |||
(4, 3, 3, 'BKD123468', 18, 'https://www.barcodefaq.com/wp-content/uploads/2018/08/gs1-qrcode-fnc1.png', 10, '', 100, '[email protected]', '9847586912', 3, 1), | |||
(5, 3, 3, 'BKD123456', 18, 'https://www.barcodefaq.com/wp-content/uploads/2018/08/gs1-qrcode-fnc1.png', 4, '', 250, '[email protected]', '9847586912', 3, 1), | |||
(6, 3, 3, 'BKD134568', 18, 'https://www.barcodefaq.com/wp-content/uploads/2018/08/gs1-qrcode-fnc1.png', 2, '', 125, '[email protected]', '9847586912', 3, 1), | |||
(7, 3, 3, 'BKD123415', 18, 'https://www.barcodefaq.com/wp-content/uploads/2018/08/gs1-qrcode-fnc1.png', 5, '', 300, '[email protected]', '9847586912', 3, 1), | |||
(8, 3, 3, 'BKD123468', 18, 'https://www.barcodefaq.com/wp-content/uploads/2018/08/gs1-qrcode-fnc1.png', 10, '', 100, '[email protected]', '9847586912', 3, 1), | |||
(9, 3, 3, 'BKD123456', 18, 'https://www.barcodefaq.com/wp-content/uploads/2018/08/gs1-qrcode-fnc1.png', 4, '', 250, '[email protected]', '9847586912', 3, 1), | |||
(10, 3, 3, 'BKD134568', 18, 'https://www.barcodefaq.com/wp-content/uploads/2018/08/gs1-qrcode-fnc1.png', 2, '', 125, '[email protected]', '9847586912', 3, 1), | |||
(11, 3, 3, 'BKD123415', 18, 'https://www.barcodefaq.com/wp-content/uploads/2018/08/gs1-qrcode-fnc1.png', 5, '', 300, '[email protected]', '9847586912', 3, 1), | |||
(12, 3, 3, 'BKD123468', 18, 'https://www.barcodefaq.com/wp-content/uploads/2018/08/gs1-qrcode-fnc1.png', 10, '', 100, '[email protected]', '9847586912', 3, 1), | |||
(13, 3, 3, 'BKD123456', 18, 'https://www.barcodefaq.com/wp-content/uploads/2018/08/gs1-qrcode-fnc1.png', 4, '', 250, '[email protected]', '9847586912', 3, 1), | |||
(14, 3, 3, 'BKD134568', 18, 'https://www.barcodefaq.com/wp-content/uploads/2018/08/gs1-qrcode-fnc1.png', 2, '', 125, '[email protected]', '9847586912', 3, 1), | |||
(15, 3, 3, 'BKD123415', 18, 'https://www.barcodefaq.com/wp-content/uploads/2018/08/gs1-qrcode-fnc1.png', 5, '', 300, '[email protected]', '9847586912', 3, 1), | |||
(16, 3, 3, 'BKD123468', 18, 'https://www.barcodefaq.com/wp-content/uploads/2018/08/gs1-qrcode-fnc1.png', 10, '', 100, '[email protected]', '9847586912', 3, 1), | |||
(17, 3, 3, 'TO1902149151', 18, 'https://www.barcodefaq.com/wp-content/uploads/2018/08/gs1-qrcode-fnc1.png', 5, '[{\"color\":\"Red\",\"price\":\"11\",\"no_ticket\":\"2\",\"total_price\":\"22\"}]', 250, NULL, NULL, 3, 3), | |||
(18, 3, 3, 'TO1902145194', 18, 'https://www.barcodefaq.com/wp-content/uploads/2018/08/gs1-qrcode-fnc1.png', 5, '[{\"color\":\"Red\",\"price\":\"11\",\"no_ticket\":\"2\",\"total_price\":\"22\"}]', 250, NULL, NULL, 3, 3), | |||
(19, 3, 3, 'TO1902149856', 18, 'https://www.barcodefaq.com/wp-content/uploads/2018/08/gs1-qrcode-fnc1.png', 5, '[{\"color\":\"Red\",\"price\":\"11\",\"no_ticket\":\"2\",\"total_price\":\"22\"}]', 250, NULL, NULL, 3, 3); | |||
-- -------------------------------------------------------- | -- -------------------------------------------------------- | ||
-- | -- | ||
... | @@ -55,6 +81,9 @@ CREATE TABLE `customer` ( | ... | @@ -55,6 +81,9 @@ CREATE TABLE `customer` ( |
`name` varchar(50) DEFAULT NULL, | `name` varchar(50) DEFAULT NULL, | ||
`phone` varchar(25) DEFAULT NULL, | `phone` varchar(25) DEFAULT NULL, | ||
`email` varchar(50) DEFAULT NULL, | `email` varchar(50) DEFAULT NULL, | ||
`gender` varchar(15) NOT NULL, | |||
`dob` varchar(50) NOT NULL, | |||
`city` varchar(255) NOT NULL, | |||
`reset_key` varchar(255) DEFAULT NULL, | `reset_key` varchar(255) DEFAULT NULL, | ||
`social_id` varchar(250) DEFAULT NULL, | `social_id` varchar(250) DEFAULT NULL, | ||
`profile_image` varchar(250) DEFAULT NULL | `profile_image` varchar(250) DEFAULT NULL | ||
... | @@ -64,27 +93,152 @@ CREATE TABLE `customer` ( | ... | @@ -64,27 +93,152 @@ CREATE TABLE `customer` ( |
-- Dumping data for table `customer` | -- Dumping data for table `customer` | ||
-- | -- | ||
INSERT INTO `customer` (`id`, `customer_id`, `name`, `phone`, `email`, `reset_key`, `social_id`, `profile_image`) VALUES | INSERT INTO `customer` (`id`, `customer_id`, `name`, `phone`, `email`, `gender`, `dob`, `city`, `reset_key`, `social_id`, `profile_image`) VALUES | ||
(1, 3, 'Customer User', '9995559194', '[email protected]', NULL, NULL, 'assets/uploads/services/1546851554_1523012036_hj.jpg'); | (1, 3, 'Tester', '9995559194', '[email protected]', '2', '31/07/1990', 'Tester City', NULL, NULL, 'assets/uploads/155016015727232.jpg'), | ||
(3, 5, NULL, '9995559194e', '[email protected]', '', '', '', NULL, NULL, NULL), | |||
(4, 6, NULL, '9999999998', '[email protected]', '', '', '', NULL, NULL, NULL), | |||
(5, 7, NULL, '1234567890', '[email protected]', '', '', '', '5c63ee6845d281550052968', NULL, NULL), | |||
(6, 8, NULL, '1234567891', '[email protected]', '', '', '', NULL, NULL, NULL), | |||
(7, 9, NULL, NULL, '[email protected]', '', '', '', NULL, NULL, NULL); | |||
-- -------------------------------------------------------- | -- -------------------------------------------------------- | ||
-- | -- | ||
-- Table structure for table `event` | -- Table structure for table `customer_auth` | ||
-- | -- | ||
CREATE TABLE `event` ( | CREATE TABLE `customer_auth` ( | ||
`id` int(11) NOT NULL, | `id` int(11) NOT NULL, | ||
`name` varchar(255) DEFAULT NULL, | `user_id` int(11) NOT NULL, | ||
`eventId` varchar(20) DEFAULT NULL, | `auth_token` varchar(255) NOT NULL, | ||
`venue_id` int(11) NOT NULL, | `sync_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP | ||
`image` varchar(255) DEFAULT NULL, | ) ENGINE=InnoDB DEFAULT CHARSET=latin1; | ||
`features` longtext, | |||
`addons` varchar(255) DEFAULT NULL, | -- | ||
`status` int(11) DEFAULT '1' COMMENT '1 - Active, 0 - Inactive', | -- Dumping data for table `customer_auth` | ||
`provider_id` int(11) NOT NULL | -- | ||
INSERT INTO `customer_auth` (`id`, `user_id`, `auth_token`, `sync_time`) VALUES | |||
(1, 3, 'ba436bc1b7881e14ee892b03210d5b54', '2019-02-12 13:44:16'), | |||
(2, 4, '75d49c8766fd4901491055086d1d8243', '2019-02-13 09:22:42'), | |||
(3, 4, '211d5241f4dec6974803ed373c935c2d', '2019-02-13 09:23:53'), | |||
(4, 3, '2591e63438bc954dfcd34931b363d455', '2019-02-13 09:24:27'), | |||
(5, 5, '7295010bd3934cb61acd8b44ec98da41', '2019-02-13 09:25:32'), | |||
(6, 6, '94ddb63001d2500d156c313488ae1562', '2019-02-13 09:26:15'), | |||
(7, 7, '34abdc1d3faad3ff72f907084ba53dbb', '2019-02-13 09:43:51'), | |||
(8, 8, '85ac1894e482c039cbc7bc102c01b869', '2019-02-13 09:44:42'), | |||
(9, 9, '1e914ac0f56d95fbe3c3d7e1151b7fd0', '2019-02-13 10:08:29'), | |||
(10, 3, 'fd7b647d239e59e7090e7b7e95877c34', '2019-02-13 10:54:23'), | |||
(11, 3, 'd4668b818afba5d6dee3dceed9fecafb', '2019-02-13 15:54:02'), | |||
(12, 3, 'cb6ca5d535652207197800979e3ddd4a', '2019-02-13 15:54:57'), | |||
(13, 3, '536b281d6ad31931818cc2b552dc2010', '2019-02-13 15:55:11'), | |||
(14, 3, '7591c952051a7b910ab75f56822191f2', '2019-02-14 14:20:10'), | |||
(15, 3, '33f6dc286585395be2c405cfb9674c07', '2019-02-14 14:22:46'), | |||
(16, 3, '11866cec9dc42a8be5fdac02a464bfe5', '2019-02-14 15:18:29'); | |||
-- -------------------------------------------------------- | |||
-- | |||
-- Table structure for table `events` | |||
-- | |||
CREATE TABLE `events` ( | |||
`event_id` int(11) NOT NULL, | |||
`venue_id` int(11) DEFAULT NULL, | |||
`category_id` int(11) DEFAULT NULL, | |||
`provider_id` int(11) DEFAULT NULL, | |||
`event_name` varchar(250) DEFAULT NULL, | |||
`event_discription` longtext, | |||
`seat_pricing` longtext, | |||
`custom_seat_layout` longtext, | |||
`status` tinyint(3) DEFAULT '1' | |||
) ENGINE=InnoDB DEFAULT CHARSET=latin1; | ) ENGINE=InnoDB DEFAULT CHARSET=latin1; | ||
-- | |||
-- Dumping data for table `events` | |||
-- | |||
INSERT INTO `events` (`event_id`, `venue_id`, `category_id`, `provider_id`, `event_name`, `event_discription`, `seat_pricing`, `custom_seat_layout`, `status`) VALUES | |||
(2, 3, 2, 1, 'dfrgdrfg', 'I have a name tag in the sidebar which should display single line and truncate if long text follow by triple dots (lorem ipsum...) and should show full text on hover.\r\n\r\nI am able to achieve this using css but my problem is when full text is displayed it overlaps the text below it. (Images attached)\r\n\r\nHTML', '{\"price\":null,\"price_details\":null}', '', 1), | |||
(3, 3, 1, 1, 'sdfg', 'dfgr', '{\"price\":\"\",\"price_details\":\"\"}', '[{\"color\":\"Red\",\"price\":\"11\"},{\"color\":\"Blue\",\"price\":\"256\"},{\"color\":\"Blue R\",\"price\":\"6385\"},{\"color\":\"Yellow\",\"price\":\"3258\"},{\"color\":\"Yellow Y\",\"price\":\"558\"}]', 1), | |||
(4, 3, 1, 1, '111', '1111', '{\"price\":\"\",\"price_details\":\"\"}', '', 1), | |||
(5, 2, 2, 1, 'szdf', 'I have a name tag in the sidebar which should display single line and truncate if long text follow by triple dots (lorem ipsum...) and should show full text on hover.\r\n\r\nI am able to achieve this using css but my problem is when full text is displayed it overlaps the text below it. (Images attached)\r\n\r\nHTML', '{\"price\":\"555\",\"price_details\":\"aaaaaaa aaaaa aaaa aaaaaaa aaaaa aaaa aaaaaaa aaaaa aaaa aaaaaaa aaaaa aaaa aaaaaaa aaaaa aaaa aaaaaaa aaaaa aaaa aaaaaaa aaaaa aaaa aaaaaaa aaaaa aaaa aaaaaaa aaaaa aaaa aaaaaaa aaaaa aaaa aaaaaaa aaaaa aaaa aaaaaaa aaaaa aaaa \"}', '', 1), | |||
(6, 3, 1, 1, 'New Event', 'sdfgdrf', '', '[{\"color\":\"Red\",\"price\":\"100\"},{\"color\":\"Blue\",\"price\":\"120\"},{\"color\":\"Blue R\",\"price\":\"130\"},{\"color\":\"Yellow\",\"price\":\"140\"},{\"color\":\"Yellow Y\",\"price\":\"150\"}]', 1); | |||
-- -------------------------------------------------------- | |||
-- | |||
-- Table structure for table `event_category` | |||
-- | |||
CREATE TABLE `event_category` ( | |||
`cat_id` int(11) NOT NULL, | |||
`category` varchar(250) DEFAULT NULL, | |||
`category_description` longtext, | |||
`category_image` varchar(250) DEFAULT NULL, | |||
`status` tinyint(3) NOT NULL DEFAULT '1' | |||
) ENGINE=InnoDB DEFAULT CHARSET=latin1; | |||
-- | |||
-- Dumping data for table `event_category` | |||
-- | |||
INSERT INTO `event_category` (`cat_id`, `category`, `category_description`, `category_image`, `status`) VALUES | |||
(1, 'Movies', 'Teste Description', 'assets/uploads/services/1550213061_giphy.gif', 1), | |||
(2, '11111', '1111111', 'assets/uploads/services/1550139949_giphy.gif', 1); | |||
-- -------------------------------------------------------- | |||
-- | |||
-- Table structure for table `event_date_time` | |||
-- | |||
CREATE TABLE `event_date_time` ( | |||
`id` int(11) NOT NULL, | |||
`event_id` int(11) DEFAULT NULL, | |||
`date` varchar(150) DEFAULT NULL, | |||
`time` varchar(150) DEFAULT NULL, | |||
`status` tinyint(3) DEFAULT '1' | |||
) ENGINE=InnoDB DEFAULT CHARSET=latin1; | |||
-- | |||
-- Dumping data for table `event_date_time` | |||
-- | |||
INSERT INTO `event_date_time` (`id`, `event_id`, `date`, `time`, `status`) VALUES | |||
(18, 3, '2019-02-18', '11:30', 1), | |||
(19, 3, '2019-02-15', '11:30', 1), | |||
(20, 4, '2019-02-16', '11:30', 1), | |||
(61, 3, '2019-02-16', '12:00', 1), | |||
(62, 3, '2019-02-16', '01:00', 1), | |||
(63, 5, '2019-01-01', '02:00', 1), | |||
(64, 5, '2019-01-01', '03:00', 1), | |||
(65, 5, '2019-02-14', '12:00', 1), | |||
(66, 5, '2019-02-15', '01:00', 1), | |||
(67, 5, '2019-01-02', '02:00', 1), | |||
(68, 5, '2019-01-02', '03:00', 1), | |||
(69, 5, '2019-01-03', '12:00', 1), | |||
(70, 5, '2019-01-03', '01:00', 1), | |||
(71, 5, '2019-01-03', '02:00', 1), | |||
(72, 5, '2019-01-03', '03:00', 1), | |||
(73, 5, '2019-01-04', '12:00', 1), | |||
(74, 5, '2019-01-04', '01:00', 1), | |||
(75, 5, '2019-01-04', '02:00', 1), | |||
(76, 5, '2019-01-04', '03:00', 1), | |||
(77, 5, '2019-01-05', '12:00', 1), | |||
(78, 5, '2019-01-05', '01:00', 1), | |||
(79, 5, '2019-01-05', '02:00', 1), | |||
(80, 5, '2019-01-05', '03:00', 1), | |||
(105, 6, '2019-02-06', '01:05', 1), | |||
(106, 2, '2019-02-05', '01:10', 1), | |||
(107, 2, '2019-02-05', '01:05', 1), | |||
(108, 2, '2019-02-05', '01:11', 1), | |||
(109, 2, '2019-02-05', '01:07', 1), | |||
(110, 2, '2019-02-05', '01:25', 1), | |||
(111, 2, '2019-02-05', '01:22', 1), | |||
(112, 2, '2019-02-05', '01:13', 1), | |||
(113, 2, '2019-02-05', '01:14', 1); | |||
-- -------------------------------------------------------- | -- -------------------------------------------------------- | ||
-- | -- | ||
... | @@ -93,11 +247,29 @@ CREATE TABLE `event` ( | ... | @@ -93,11 +247,29 @@ CREATE TABLE `event` ( |
CREATE TABLE `event_gallery` ( | CREATE TABLE `event_gallery` ( | ||
`id` int(11) NOT NULL, | `id` int(11) NOT NULL, | ||
`event_id` int(11) NOT NULL, | `event_id` int(11) DEFAULT NULL, | ||
`media` varchar(100) DEFAULT NULL, | `media_type` tinyint(3) DEFAULT NULL COMMENT '0=>Primary, 1 => Photos, 2 => Videos, 3 => Youtube Link', | ||
`media_url` varchar(100) DEFAULT NULL, | |||
`status` int(11) DEFAULT '1' COMMENT '1 - Active, 0 - Inactive' | `status` int(11) DEFAULT '1' COMMENT '1 - Active, 0 - Inactive' | ||
) ENGINE=InnoDB DEFAULT CHARSET=latin1; | ) ENGINE=InnoDB DEFAULT CHARSET=latin1; | ||
-- | |||
-- Dumping data for table `event_gallery` | |||
-- | |||
INSERT INTO `event_gallery` (`id`, `event_id`, `media_type`, `media_url`, `status`) VALUES | |||
(1, 3, 0, 'assets/uploads/services/giphy9.gif', 1), | |||
(2, 3, 1, 'assets/uploads/services/media-froala-description-0-2018-9-5-t-14-14-32.jpeg', 1), | |||
(3, 3, 1, 'assets/uploads/services/giphy9.gif', 1), | |||
(4, 3, 1, 'assets/uploads/services/giphy9.gif', 1), | |||
(5, 3, 1, 'assets/uploads/services/giphy9.gif', 1), | |||
(6, 3, 2, 'assets/uploads/services/media-froala-description-0-2018-9-5-t-14-14-32.jpeg', 1), | |||
(7, 3, 2, 'assets/uploads/services/giphy9.gif', 1), | |||
(8, 3, 3, 'assets/uploads/services/giphy9.gif', 1), | |||
(9, 3, 3, 'assets/uploads/services/giphy9.gif', 1), | |||
(19, 4, 1, 'assets/uploads/services/giphy14.gif', 1), | |||
(20, 5, 1, 'assets/uploads/services/media-froala-description-0-2018-9-5-t-14-14-328.jpeg', 1); | |||
-- -------------------------------------------------------- | -- -------------------------------------------------------- | ||
-- | -- | ||
... | @@ -111,21 +283,48 @@ CREATE TABLE `event_tags` ( | ... | @@ -111,21 +283,48 @@ CREATE TABLE `event_tags` ( |
`status` tinyint(3) NOT NULL DEFAULT '1' COMMENT '0 => Inactive 1 => Active 2 => Deleted' | `status` tinyint(3) NOT NULL DEFAULT '1' COMMENT '0 => Inactive 1 => Active 2 => Deleted' | ||
) ENGINE=InnoDB DEFAULT CHARSET=latin1; | ) ENGINE=InnoDB DEFAULT CHARSET=latin1; | ||
-- | |||
-- Dumping data for table `event_tags` | |||
-- | |||
INSERT INTO `event_tags` (`id`, `event_id`, `tag_id`, `status`) VALUES | |||
(1, 1, 2, 1), | |||
(2, 1, 3, 1), | |||
(5, 3, 3, 1), | |||
(6, 3, 4, 1), | |||
(124, 4, 6, 1), | |||
(125, 4, 2, 1), | |||
(139, 5, 2, 1), | |||
(140, 5, 3, 1), | |||
(141, 5, 4, 1), | |||
(144, 6, 3, 1), | |||
(145, 6, 4, 1), | |||
(146, 2, 2, 1), | |||
(147, 2, 3, 1); | |||
-- -------------------------------------------------------- | -- -------------------------------------------------------- | ||
-- | -- | ||
-- Table structure for table `event_venue` | -- Table structure for table `favourite` | ||
-- | -- | ||
CREATE TABLE `event_venue` ( | CREATE TABLE `favourite` ( | ||
`id` int(11) NOT NULL, | `id` int(11) NOT NULL, | ||
`user_id` int(11) NOT NULL, | |||
`event_id` int(11) NOT NULL, | `event_id` int(11) NOT NULL, | ||
`venue_id` int(11) NOT NULL, | `create_date` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, | ||
`class_id` int(11) NOT NULL, | `status` int(11) NOT NULL DEFAULT '1' | ||
`price` double DEFAULT NULL, | |||
`status` int(11) DEFAULT '1' COMMENT '1 - Active, 0 - Inactive' | |||
) ENGINE=InnoDB DEFAULT CHARSET=latin1; | ) ENGINE=InnoDB DEFAULT CHARSET=latin1; | ||
-- | |||
-- Dumping data for table `favourite` | |||
-- | |||
INSERT INTO `favourite` (`id`, `user_id`, `event_id`, `create_date`, `status`) VALUES | |||
(1, 3, 3, '2019-02-14 07:05:08', 0), | |||
(2, 3, 3, '2019-02-14 07:06:25', 0), | |||
(3, 3, 3, '2019-02-14 07:14:05', 1); | |||
-- -------------------------------------------------------- | -- -------------------------------------------------------- | ||
-- | -- | ||
... | @@ -144,7 +343,7 @@ CREATE TABLE `host_categories` ( | ... | @@ -144,7 +343,7 @@ CREATE TABLE `host_categories` ( |
-- | -- | ||
INSERT INTO `host_categories` (`host_cat_id`, `host_category`, `show_layout`, `status`) VALUES | INSERT INTO `host_categories` (`host_cat_id`, `host_category`, `show_layout`, `status`) VALUES | ||
(1, 'Stadium', 1, 0), | (1, 'Stadium', 1, 1), | ||
(2, 'Restaurant', 0, 1), | (2, 'Restaurant', 0, 1), | ||
(3, 'Movie Theater', 1, 1), | (3, 'Movie Theater', 1, 1), | ||
(4, 'Auditorium', 1, 1), | (4, 'Auditorium', 1, 1), | ||
... | @@ -155,6 +354,27 @@ INSERT INTO `host_categories` (`host_cat_id`, `host_category`, `show_layout`, `s | ... | @@ -155,6 +354,27 @@ INSERT INTO `host_categories` (`host_cat_id`, `host_category`, `show_layout`, `s |
-- -------------------------------------------------------- | -- -------------------------------------------------------- | ||
-- | -- | ||
-- Table structure for table `locality` | |||
-- | |||
CREATE TABLE `locality` ( | |||
`id` int(11) NOT NULL, | |||
`venue_id` int(11) NOT NULL, | |||
`locality` varchar(255) NOT NULL, | |||
`status` int(11) NOT NULL DEFAULT '1' | |||
) ENGINE=InnoDB DEFAULT CHARSET=latin1; | |||
-- | |||
-- Dumping data for table `locality` | |||
-- | |||
INSERT INTO `locality` (`id`, `venue_id`, `locality`, `status`) VALUES | |||
(1, 3, 'Kochi West', 1), | |||
(2, 3, 'Kochi North', 1); | |||
-- -------------------------------------------------------- | |||
-- | |||
-- Table structure for table `provider` | -- Table structure for table `provider` | ||
-- | -- | ||
... | @@ -172,7 +392,9 @@ CREATE TABLE `provider` ( | ... | @@ -172,7 +392,9 @@ CREATE TABLE `provider` ( |
-- | -- | ||
INSERT INTO `provider` (`id`, `provider_id`, `name`, `email`, `phone`, `profile_image`) VALUES | INSERT INTO `provider` (`id`, `provider_id`, `name`, `email`, `phone`, `profile_image`) VALUES | ||
(3, 2, 'Provider User', '[email protected]', '9995559194', 'assets/uploads/services/1546851554_1523012036_hj.jpg'); | (3, 2, 'Provider User', '[email protected]', '9995559194', 'assets/uploads/services/1546851554_1523012036_hj.jpg'), | ||
(4, 10, 'dertgfdsre', '[email protected]', '43534563453', 'assets/uploads/services/1550152192_image_(1).png'), | |||
(5, 11, 'sderfg', '[email protected]', '345345345', 'assets/uploads/services/1550152924_giphy.gif'); | |||
-- -------------------------------------------------------- | -- -------------------------------------------------------- | ||
... | @@ -183,6 +405,7 @@ INSERT INTO `provider` (`id`, `provider_id`, `name`, `email`, `phone`, `profile_ | ... | @@ -183,6 +405,7 @@ INSERT INTO `provider` (`id`, `provider_id`, `name`, `email`, `phone`, `profile_ |
CREATE TABLE `region` ( | CREATE TABLE `region` ( | ||
`id` int(11) NOT NULL, | `id` int(11) NOT NULL, | ||
`name` varchar(100) DEFAULT NULL, | `name` varchar(100) DEFAULT NULL, | ||
`region_icon` varchar(250) DEFAULT NULL, | |||
`status` int(11) DEFAULT '1' COMMENT '1 - Active, 0 - Inactive, 2 - Deleted' | `status` int(11) DEFAULT '1' COMMENT '1 - Active, 0 - Inactive, 2 - Deleted' | ||
) ENGINE=InnoDB DEFAULT CHARSET=latin1; | ) ENGINE=InnoDB DEFAULT CHARSET=latin1; | ||
... | @@ -190,12 +413,13 @@ CREATE TABLE `region` ( | ... | @@ -190,12 +413,13 @@ CREATE TABLE `region` ( |
-- Dumping data for table `region` | -- Dumping data for table `region` | ||
-- | -- | ||
INSERT INTO `region` (`id`, `name`, `status`) VALUES | INSERT INTO `region` (`id`, `name`, `region_icon`, `status`) VALUES | ||
(1, 'Kochi', 1), | (1, 'Kochi', 'assets/uploads/services/1550213170_media-froala-description-0-2018-9-5-t-14-14-321.jpeg', 1), | ||
(2, 'Kottayam', 1), | (2, 'Kottayam', NULL, 1), | ||
(3, 'Thrissur', 1), | (3, 'Thrissur', NULL, 1), | ||
(4, 'Bengaluru', 1), | (4, 'Bengaluru', NULL, 1), | ||
(5, 'ddrfgt', 2); | (5, 'ddrfgt', NULL, 2), | ||
(6, 'Thalayolaparambu', 'assets/uploads/services/1550212297_media-froala-description-0-2018-9-5-t-14-14-321.jpeg', 1); | |||
-- -------------------------------------------------------- | -- -------------------------------------------------------- | ||
... | @@ -216,23 +440,6 @@ CREATE TABLE `reservation` ( | ... | @@ -216,23 +440,6 @@ CREATE TABLE `reservation` ( |
-- -------------------------------------------------------- | -- -------------------------------------------------------- | ||
-- | -- | ||
-- Table structure for table `restaurant` | |||
-- | |||
CREATE TABLE `restaurant` ( | |||
`id` int(11) NOT NULL, | |||
`name` varchar(100) DEFAULT NULL, | |||
`location` varchar(100) DEFAULT NULL, | |||
`lat` varchar(45) DEFAULT NULL, | |||
`lng` varchar(45) DEFAULT NULL, | |||
`image` varchar(100) DEFAULT NULL, | |||
`no_seats` int(11) DEFAULT NULL, | |||
`status` int(11) DEFAULT '1' COMMENT '1 - Active, 0 - Inactive' | |||
) ENGINE=InnoDB DEFAULT CHARSET=latin1; | |||
-- -------------------------------------------------------- | |||
-- | |||
-- Table structure for table `review` | -- Table structure for table `review` | ||
-- | -- | ||
... | @@ -244,19 +451,12 @@ CREATE TABLE `review` ( | ... | @@ -244,19 +451,12 @@ CREATE TABLE `review` ( |
`feedback` longtext | `feedback` longtext | ||
) ENGINE=InnoDB DEFAULT CHARSET=latin1; | ) ENGINE=InnoDB DEFAULT CHARSET=latin1; | ||
-- -------------------------------------------------------- | |||
-- | -- | ||
-- Table structure for table `schedules` | -- Dumping data for table `review` | ||
-- | -- | ||
CREATE TABLE `schedules` ( | INSERT INTO `review` (`id`, `event_id`, `customer_id`, `rate`, `feedback`) VALUES | ||
`id` int(11) NOT NULL, | (1, 3, 3, 4, 'Teste'); | ||
`event_id` int(11) NOT NULL, | |||
`date` date DEFAULT NULL, | |||
`time` varchar(45) DEFAULT NULL, | |||
`status` int(11) DEFAULT '1' COMMENT '1 - Active, 0 - Inactive' | |||
) ENGINE=InnoDB DEFAULT CHARSET=latin1; | |||
-- -------------------------------------------------------- | -- -------------------------------------------------------- | ||
... | @@ -283,7 +483,7 @@ CREATE TABLE `setting` ( | ... | @@ -283,7 +483,7 @@ CREATE TABLE `setting` ( |
-- | -- | ||
INSERT INTO `setting` (`id`, `title`, `title_short`, `site_logo`, `fav_icon`, `country_flag`, `currency`, `smtp_host`, `smtp_username`, `smtp_password`, `google_api_key`) VALUES | INSERT INTO `setting` (`id`, `title`, `title_short`, `site_logo`, `fav_icon`, `country_flag`, `currency`, `smtp_host`, `smtp_username`, `smtp_password`, `google_api_key`) VALUES | ||
(1, 'Event - Time Out', 'TimeOut', 'assets/uploads/services/1549257477_Twitch_KingpinSkin_old2_HD.jpg', 'assets/uploads/services/1549257477_sniper.jpg', 'IN', 'USD', '[email protected]', 'AIzaSyC9JX3BZZfx2S6GQieC_PqjuJdUbZ7_wyM1', 'Golden_1234', 'AIzaSyCcc-YDSJyDpehNE6qfntfWpEQ4uS4aq6A'); | (1, 'Event - Time Out', 'TimeOut', 'assets/uploads/services/1549257477_Twitch_KingpinSkin_old2_HD.jpg', 'assets/uploads/services/1549257477_sniper.jpg', 'IN', 'INR', '[email protected]', 'AIzaSyC9JX3BZZfx2S6GQieC_PqjuJdUbZ7_wyM1', 'Golden_1234', 'AIzaSyCcc-YDSJyDpehNE6qfntfWpEQ4uS4aq6A'); | ||
-- -------------------------------------------------------- | -- -------------------------------------------------------- | ||
... | @@ -348,7 +548,9 @@ CREATE TABLE `users` ( | ... | @@ -348,7 +548,9 @@ CREATE TABLE `users` ( |
INSERT INTO `users` (`id`, `username`, `password`, `display_name`, `profile_image`, `user_type`, `status`) VALUES | INSERT INTO `users` (`id`, `username`, `password`, `display_name`, `profile_image`, `user_type`, `status`) VALUES | ||
(1, 'admin', '202cb962ac59075b964b07152d234b70', 'Super Admin', 'assets/uploads/services/1549281365_car_ac.jpg', 1, 1), | (1, 'admin', '202cb962ac59075b964b07152d234b70', 'Super Admin', 'assets/uploads/services/1549281365_car_ac.jpg', 1, 1), | ||
(2, 'provider', '202cb962ac59075b964b07152d234b70', 'Provide', 'assets/uploads/services/1549342442_Audi-r8.jpg', 2, 1), | (2, 'provider', '202cb962ac59075b964b07152d234b70', 'Provide', 'assets/uploads/services/1549342442_Audi-r8.jpg', 2, 1), | ||
(3, 'customer', '202cb962ac59075b964b07152d234b70', 'Customer', NULL, 3, 1); | (3, 'customer', 'e10adc3949ba59abbe56e057f20f883e', 'Customer', NULL, 3, 1), | ||
(10, 'xdcfg', '69879a49afe2a510237c11d0aa05a3fc', 'cdfgh', 'assets/uploads/services/1550152192_image_(1).png', 2, 1), | |||
(11, 'sedrftg', '38d7355701b6f3760ee49852904319c1', 'dfrgdr', 'assets/uploads/services/1550152924_giphy.gif', 2, 1); | |||
-- -------------------------------------------------------- | -- -------------------------------------------------------- | ||
... | @@ -375,22 +577,8 @@ CREATE TABLE `venue` ( | ... | @@ -375,22 +577,8 @@ CREATE TABLE `venue` ( |
-- | -- | ||
INSERT INTO `venue` (`id`, `venue_name`, `venue_details`, `region_id`, `host_cat_id`, `location`, `location_lat`, `location_lng`, `layout`, `layout_details`, `status`) VALUES | INSERT INTO `venue` (`id`, `venue_name`, `venue_details`, `region_id`, `host_cat_id`, `location`, `location_lat`, `location_lng`, `layout`, `layout_details`, `status`) VALUES | ||
(2, 'sdfcsd', 'cdgdhd', 4, 2, 'D-Wing, Western Express Highway, Miragaon, Mira Road East, Mira Bhayandar, Maharashtra, India', '19.285021', '72.880876', '', '', 1), | (2, 'Empire Restaurant - Church Street', 'Empire Restaurant - Church Street', 4, 2, 'D-Wing, Western Express Highway, Miragaon, Mira Road East, Mira Bhayandar, Maharashtra, India', '19.2746336', '72.8786044', '', '', 1), | ||
(3, 'sdfcsd', 'sdfgsderfg serfgser awerfa af aedfaswedrf asdfaedrf sdfgsderfg serfgser awerfa af aedfaswedrf asdfaedrf sdfgsderfg serfgser awerfa af aedfaswedrf asdfaedrf ', 4, 3, 'DF Block, Sector 1, Salt Lake City, Kolkata, West Bengal, India', '22.5908767', '88.4170614', 'assets/uploads/services/1549456988_media-froala-description-0-2018-9-5-t-14-14-32.jpeg', '[{\"color\":\"Red\",\"price\":\"150\"},{\"color\":\"Blue\",\"price\":\"500\"},{\"color\":\"Blue R\",\"price\":\"450\"},{\"color\":\"Yellow\",\"price\":\"650\"},{\"color\":\"Yellow Y\",\"price\":\"800\"}]', 1); | (3, 'PVR Koramangala', 'Cosmopolitan Koramangala is popular with young tech workers and students, due to the many IT companies and colleges in the area. Hip restaurants and rooftop bars cluster around 80 Feet Main Road, while the streets around Jyoti Nivas College are also known for trendy stores selling funky clothes and accessories. Upscale apartment complexes are interspersed with the commercial buildings on the tree-lined avenues.', 4, 3, 'DF Block, Sector 1, Salt Lake City, Kolkata, West Bengal, India', '22.5908767', '88.4170614', 'assets/uploads/services/1549456988_media-froala-description-0-2018-9-5-t-14-14-32.jpeg', '[{\"color\":\"Red\",\"price\":\"150\"},{\"color\":\"Blue\",\"price\":\"500\"},{\"color\":\"Blue R\",\"price\":\"450\"},{\"color\":\"Yellow\",\"price\":\"650\"},{\"color\":\"Yellow Y\",\"price\":\"800\"}]', 1); | ||
-- -------------------------------------------------------- | |||
-- | |||
-- Table structure for table `venue_class` | |||
-- | |||
CREATE TABLE `venue_class` ( | |||
`id` int(11) NOT NULL, | |||
`venue_id` int(11) NOT NULL, | |||
`event_id` int(11) DEFAULT NULL, | |||
`custom_layout_details` longtext, | |||
`status` int(11) DEFAULT '1' COMMENT '1 - Active, 0 - Inactive, 2 - Deleted' | |||
) ENGINE=InnoDB DEFAULT CHARSET=latin1; | |||
-- | -- | ||
-- Indexes for dumped tables | -- Indexes for dumped tables | ||
... | @@ -400,9 +588,8 @@ CREATE TABLE `venue_class` ( | ... | @@ -400,9 +588,8 @@ CREATE TABLE `venue_class` ( |
-- Indexes for table `booking` | -- Indexes for table `booking` | ||
-- | -- | ||
ALTER TABLE `booking` | ALTER TABLE `booking` | ||
ADD PRIMARY KEY (`id`,`event_id`,`schedules_id`,`customer_id`), | ADD PRIMARY KEY (`id`,`event_id`,`customer_id`), | ||
ADD KEY `fk_booking_event1_idx` (`event_id`), | ADD KEY `fk_booking_event1_idx` (`event_id`), | ||
ADD KEY `fk_booking_schedules1_idx` (`schedules_id`), | |||
ADD KEY `fk_booking_customer1_idx` (`customer_id`); | ADD KEY `fk_booking_customer1_idx` (`customer_id`); | ||
-- | -- | ||
... | @@ -412,27 +599,48 @@ ALTER TABLE `customer` | ... | @@ -412,27 +599,48 @@ ALTER TABLE `customer` |
ADD PRIMARY KEY (`id`); | ADD PRIMARY KEY (`id`); | ||
-- | -- | ||
-- Indexes for table `event` | -- Indexes for table `customer_auth` | ||
-- | -- | ||
ALTER TABLE `event` | ALTER TABLE `customer_auth` | ||
ADD PRIMARY KEY (`id`,`venue_id`,`provider_id`), | ADD PRIMARY KEY (`id`); | ||
ADD KEY `fk_event_venue_idx` (`venue_id`), | |||
ADD KEY `fk_event_provider1_idx` (`provider_id`); | -- | ||
-- Indexes for table `events` | |||
-- | |||
ALTER TABLE `events` | |||
ADD PRIMARY KEY (`event_id`); | |||
-- | |||
-- Indexes for table `event_category` | |||
-- | |||
ALTER TABLE `event_category` | |||
ADD PRIMARY KEY (`cat_id`); | |||
-- | |||
-- Indexes for table `event_date_time` | |||
-- | |||
ALTER TABLE `event_date_time` | |||
ADD PRIMARY KEY (`id`), | |||
ADD KEY `event_id` (`event_id`,`date`); | |||
-- | -- | ||
-- Indexes for table `event_gallery` | -- Indexes for table `event_gallery` | ||
-- | -- | ||
ALTER TABLE `event_gallery` | ALTER TABLE `event_gallery` | ||
ADD PRIMARY KEY (`id`,`event_id`), | ADD PRIMARY KEY (`id`) USING BTREE, | ||
ADD KEY `fk_event_gallery_event1_idx` (`event_id`); | ADD KEY `event_id` (`event_id`,`media_type`); | ||
-- | |||
-- Indexes for table `event_tags` | |||
-- | |||
ALTER TABLE `event_tags` | |||
ADD PRIMARY KEY (`id`); | |||
-- | -- | ||
-- Indexes for table `event_venue` | -- Indexes for table `favourite` | ||
-- | -- | ||
ALTER TABLE `event_venue` | ALTER TABLE `favourite` | ||
ADD PRIMARY KEY (`id`,`event_id`,`venue_id`,`class_id`), | ADD PRIMARY KEY (`id`); | ||
ADD KEY `fk_event_venue_event1_idx` (`event_id`,`venue_id`), | |||
ADD KEY `fk_event_venue_venue_class1_idx` (`class_id`); | |||
-- | -- | ||
-- Indexes for table `host_categories` | -- Indexes for table `host_categories` | ||
... | @@ -441,6 +649,12 @@ ALTER TABLE `host_categories` | ... | @@ -441,6 +649,12 @@ ALTER TABLE `host_categories` |
ADD PRIMARY KEY (`host_cat_id`); | ADD PRIMARY KEY (`host_cat_id`); | ||
-- | -- | ||
-- Indexes for table `locality` | |||
-- | |||
ALTER TABLE `locality` | |||
ADD PRIMARY KEY (`id`); | |||
-- | |||
-- Indexes for table `provider` | -- Indexes for table `provider` | ||
-- | -- | ||
ALTER TABLE `provider` | ALTER TABLE `provider` | ||
... | @@ -461,12 +675,6 @@ ALTER TABLE `reservation` | ... | @@ -461,12 +675,6 @@ ALTER TABLE `reservation` |
ADD KEY `fk_reservation_customer1_idx` (`customer_id`); | ADD KEY `fk_reservation_customer1_idx` (`customer_id`); | ||
-- | -- | ||
-- Indexes for table `restaurant` | |||
-- | |||
ALTER TABLE `restaurant` | |||
ADD PRIMARY KEY (`id`); | |||
-- | |||
-- Indexes for table `review` | -- Indexes for table `review` | ||
-- | -- | ||
ALTER TABLE `review` | ALTER TABLE `review` | ||
... | @@ -475,13 +683,6 @@ ALTER TABLE `review` | ... | @@ -475,13 +683,6 @@ ALTER TABLE `review` |
ADD KEY `fk_review_customer1_idx` (`customer_id`); | ADD KEY `fk_review_customer1_idx` (`customer_id`); | ||
-- | -- | ||
-- Indexes for table `schedules` | |||
-- | |||
ALTER TABLE `schedules` | |||
ADD PRIMARY KEY (`id`,`event_id`), | |||
ADD KEY `fk_schedules_event1_idx` (`event_id`); | |||
-- | |||
-- Indexes for table `setting` | -- Indexes for table `setting` | ||
-- | -- | ||
ALTER TABLE `setting` | ALTER TABLE `setting` | ||
... | @@ -514,12 +715,6 @@ ALTER TABLE `venue` | ... | @@ -514,12 +715,6 @@ ALTER TABLE `venue` |
ADD PRIMARY KEY (`id`); | ADD PRIMARY KEY (`id`); | ||
-- | -- | ||
-- Indexes for table `venue_class` | |||
-- | |||
ALTER TABLE `venue_class` | |||
ADD PRIMARY KEY (`id`,`venue_id`); | |||
-- | |||
-- AUTO_INCREMENT for dumped tables | -- AUTO_INCREMENT for dumped tables | ||
-- | -- | ||
... | @@ -527,31 +722,55 @@ ALTER TABLE `venue_class` | ... | @@ -527,31 +722,55 @@ ALTER TABLE `venue_class` |
-- AUTO_INCREMENT for table `booking` | -- AUTO_INCREMENT for table `booking` | ||
-- | -- | ||
ALTER TABLE `booking` | ALTER TABLE `booking` | ||
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT; | MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=20; | ||
-- | -- | ||
-- AUTO_INCREMENT for table `customer` | -- AUTO_INCREMENT for table `customer` | ||
-- | -- | ||
ALTER TABLE `customer` | ALTER TABLE `customer` | ||
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2; | MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=8; | ||
-- | -- | ||
-- AUTO_INCREMENT for table `event` | -- AUTO_INCREMENT for table `customer_auth` | ||
-- | -- | ||
ALTER TABLE `event` | ALTER TABLE `customer_auth` | ||
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT; | MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=17; | ||
-- | |||
-- AUTO_INCREMENT for table `events` | |||
-- | |||
ALTER TABLE `events` | |||
MODIFY `event_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=7; | |||
-- | |||
-- AUTO_INCREMENT for table `event_category` | |||
-- | |||
ALTER TABLE `event_category` | |||
MODIFY `cat_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3; | |||
-- | |||
-- AUTO_INCREMENT for table `event_date_time` | |||
-- | |||
ALTER TABLE `event_date_time` | |||
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=114; | |||
-- | -- | ||
-- AUTO_INCREMENT for table `event_gallery` | -- AUTO_INCREMENT for table `event_gallery` | ||
-- | -- | ||
ALTER TABLE `event_gallery` | ALTER TABLE `event_gallery` | ||
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT; | MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=21; | ||
-- | -- | ||
-- AUTO_INCREMENT for table `event_venue` | -- AUTO_INCREMENT for table `event_tags` | ||
-- | -- | ||
ALTER TABLE `event_venue` | ALTER TABLE `event_tags` | ||
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT; | MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=148; | ||
-- | |||
-- AUTO_INCREMENT for table `favourite` | |||
-- | |||
ALTER TABLE `favourite` | |||
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4; | |||
-- | -- | ||
-- AUTO_INCREMENT for table `host_categories` | -- AUTO_INCREMENT for table `host_categories` | ||
... | @@ -560,16 +779,22 @@ ALTER TABLE `host_categories` | ... | @@ -560,16 +779,22 @@ ALTER TABLE `host_categories` |
MODIFY `host_cat_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=8; | MODIFY `host_cat_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=8; | ||
-- | -- | ||
-- AUTO_INCREMENT for table `locality` | |||
-- | |||
ALTER TABLE `locality` | |||
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3; | |||
-- | |||
-- AUTO_INCREMENT for table `provider` | -- AUTO_INCREMENT for table `provider` | ||
-- | -- | ||
ALTER TABLE `provider` | ALTER TABLE `provider` | ||
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4; | MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6; | ||
-- | -- | ||
-- AUTO_INCREMENT for table `region` | -- AUTO_INCREMENT for table `region` | ||
-- | -- | ||
ALTER TABLE `region` | ALTER TABLE `region` | ||
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6; | MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=7; | ||
-- | -- | ||
-- AUTO_INCREMENT for table `reservation` | -- AUTO_INCREMENT for table `reservation` | ||
... | @@ -578,22 +803,10 @@ ALTER TABLE `reservation` | ... | @@ -578,22 +803,10 @@ ALTER TABLE `reservation` |
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT; | MODIFY `id` int(11) NOT NULL AUTO_INCREMENT; | ||
-- | -- | ||
-- AUTO_INCREMENT for table `restaurant` | |||
-- | |||
ALTER TABLE `restaurant` | |||
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT; | |||
-- | |||
-- AUTO_INCREMENT for table `review` | -- AUTO_INCREMENT for table `review` | ||
-- | -- | ||
ALTER TABLE `review` | ALTER TABLE `review` | ||
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT; | MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2; | ||
-- | |||
-- AUTO_INCREMENT for table `schedules` | |||
-- | |||
ALTER TABLE `schedules` | |||
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT; | |||
-- | -- | ||
-- AUTO_INCREMENT for table `tags` | -- AUTO_INCREMENT for table `tags` | ||
... | @@ -611,78 +824,13 @@ ALTER TABLE `transaction` | ... | @@ -611,78 +824,13 @@ ALTER TABLE `transaction` |
-- AUTO_INCREMENT for table `users` | -- AUTO_INCREMENT for table `users` | ||
-- | -- | ||
ALTER TABLE `users` | ALTER TABLE `users` | ||
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4; | MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=12; | ||
-- | -- | ||
-- AUTO_INCREMENT for table `venue` | -- AUTO_INCREMENT for table `venue` | ||
-- | -- | ||
ALTER TABLE `venue` | ALTER TABLE `venue` | ||
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4; | MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4; | ||
-- | |||
-- AUTO_INCREMENT for table `venue_class` | |||
-- | |||
ALTER TABLE `venue_class` | |||
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT; | |||
-- | |||
-- Constraints for dumped tables | |||
-- | |||
-- | |||
-- Constraints for table `booking` | |||
-- | |||
ALTER TABLE `booking` | |||
ADD CONSTRAINT `fk_booking_customer1` FOREIGN KEY (`customer_id`) REFERENCES `customer` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, | |||
ADD CONSTRAINT `fk_booking_event1` FOREIGN KEY (`event_id`) REFERENCES `event` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, | |||
ADD CONSTRAINT `fk_booking_schedules1` FOREIGN KEY (`schedules_id`) REFERENCES `schedules` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION; | |||
-- | |||
-- Constraints for table `event` | |||
-- | |||
ALTER TABLE `event` | |||
ADD CONSTRAINT `fk_event_provider1` FOREIGN KEY (`provider_id`) REFERENCES `provider` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, | |||
ADD CONSTRAINT `fk_event_venue` FOREIGN KEY (`venue_id`) REFERENCES `venue` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION; | |||
-- | |||
-- Constraints for table `event_gallery` | |||
-- | |||
ALTER TABLE `event_gallery` | |||
ADD CONSTRAINT `fk_event_gallery_event1` FOREIGN KEY (`event_id`) REFERENCES `event` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION; | |||
-- | |||
-- Constraints for table `event_venue` | |||
-- | |||
ALTER TABLE `event_venue` | |||
ADD CONSTRAINT `fk_event_venue_event1` FOREIGN KEY (`event_id`,`venue_id`) REFERENCES `event` (`id`, `venue_id`) ON DELETE NO ACTION ON UPDATE NO ACTION, | |||
ADD CONSTRAINT `fk_event_venue_venue_class1` FOREIGN KEY (`class_id`) REFERENCES `venue_class` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION; | |||
-- | |||
-- Constraints for table `reservation` | |||
-- | |||
ALTER TABLE `reservation` | |||
ADD CONSTRAINT `fk_reservation_customer1` FOREIGN KEY (`customer_id`) REFERENCES `customer` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, | |||
ADD CONSTRAINT `fk_reservation_restaurant1` FOREIGN KEY (`restaurant_id`) REFERENCES `restaurant` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION; | |||
-- | |||
-- Constraints for table `review` | |||
-- | |||
ALTER TABLE `review` | |||
ADD CONSTRAINT `fk_review_customer1` FOREIGN KEY (`customer_id`) REFERENCES `customer` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, | |||
ADD CONSTRAINT `fk_review_event1` FOREIGN KEY (`event_id`) REFERENCES `event` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION; | |||
-- | |||
-- Constraints for table `schedules` | |||
-- | |||
ALTER TABLE `schedules` | |||
ADD CONSTRAINT `fk_schedules_event1` FOREIGN KEY (`event_id`) REFERENCES `event` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION; | |||
-- | |||
-- Constraints for table `transaction` | |||
-- | |||
ALTER TABLE `transaction` | |||
ADD CONSTRAINT `fk_transaction_booking1` FOREIGN KEY (`booking_id`) REFERENCES `booking` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, | |||
ADD CONSTRAINT `fk_transaction_customer1` FOREIGN KEY (`customer_id`) REFERENCES `customer` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION; | |||
COMMIT; | COMMIT; | ||
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; | /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; | ||
... | ... |
Please
register
or
sign in
to comment