delete bookings
Showing
... | ... | @@ -138,7 +138,7 @@ header('Content-Type: text/html; charset=utf-8'); |
} | ||
##################################### Facebook Login ####################################################### | ||
##################################### Facebook Login ################################################# | ||
public function google_login_post(){ | ||
// 'fb_login');die(); | ||
... | ... | @@ -159,7 +159,7 @@ header('Content-Type: text/html; charset=utf-8'); |
} | ||
public function get_cars_details_post(){ | ||
public function get_cars_details_post(){ | ||
$postdata = file_get_contents("php://input"); | ||
$request = json_decode($postdata,true); | ||
$result = $this->Webservice_model->get_cars_details($request); | ||
... | ... | @@ -190,9 +190,7 @@ public function fb_login_post(){ |
} | ||
##################################### Forgot password ####################################################### | ||
##################################### Forgot password ############################################### | ||
public function forgot_password_post() { | ||
... | ... | @@ -215,9 +213,7 @@ public function fb_login_post(){ |
} | ||
##################################### Change password ####################################################### | ||
##################################### Change password ################################################ | ||
public function change_password_post(){ | ||
... | ... | @@ -245,11 +241,7 @@ public function fb_login_post(){ |
##################################### Biography Update ####################################################### | ||
##################################### Biography Update ################################################ | ||
public function update_biography_post(){ | ||
... | ... | @@ -275,16 +267,7 @@ public function fb_login_post(){ |
} | ||
##################################### Profile Update ####################################################### | ||
##################################### Profile Update ############################################### | ||
public function update_profile_post(){ | ||
... | ... | @@ -311,14 +294,7 @@ public function fb_login_post(){ |
##################################### Profile Pic upadate ####################################################### | ||
##################################### Profile Pic upadate ########################################### | ||
... | ... | @@ -450,7 +426,7 @@ public function fb_login_post(){ |
} | ||
############################################################################## | ||
################################################################################################### | ||
public function get_users_car_list_post(){ | ||
... | ... | @@ -507,20 +483,11 @@ public function fb_login_post(){ |
public function add_users_car_post(){ | ||
public function add_users_car_post(){ | ||
$postdata = file_get_contents("php://input"); | ||
$request = json_decode($postdata,true); | ||
if($request) { | ||
$postdata = file_get_contents("php://input"); | ||
$request = json_decode($postdata,true); | ||
if($request) { | ||
$result = $this->Webservice_model->add_users_car($request); | ||
if($result){ | ||
... | ... | @@ -534,7 +501,6 @@ public function fb_login_post(){ |
} else { | ||
print json_encode(array('status' => 'error','message'=>'Something Went wrong','data'=>'')); | ||
} | ||
} | ||
////****************14-08-2017************************//// | ||
... | ... | @@ -542,80 +508,73 @@ public function fb_login_post(){ |
public function offer_ride_post(){ | ||
$postdata = file_get_contents("php://input"); | ||
$request = json_decode($postdata,true); | ||
/*$request = (array) json_decode(file_get_contents("php://input"));*/ | ||
//print_r($request);exit; | ||
if($request) { | ||
if($request) { | ||
/////////////////////////duration and time calculation////////////////////////// | ||
$from = $request['source']; | ||
$remFrom = str_replace(',', '', $from); //Remove Commas | ||
$from = urlencode($remFrom); | ||
$to = $request['destination']; | ||
$remTo = str_replace(',', '', $to); //Remove Commas | ||
$to = urlencode($remTo); | ||
$data = file_get_contents("https://maps.googleapis.com/maps/api/distancematrix/json?&key=AIzaSyA30TEywZIiq6dv6l-JKezQWrEnLeoCiTc&origins=$from&destinations=$to&language=en-EN&sensor=false"); | ||
$data = json_decode($data, true); | ||
if($data['rows'][0]['elements'][0]['status']=='ZERO_RESULTS'){ | ||
$response=array('status' => 'error','message'=>'No Routes Found!!!'); | ||
}else{ | ||
$time = $data['rows'][0]['elements'][0]['duration']['text']; //Text for String and Value for INT | ||
$distance = $data['rows'][0]['elements'][0]['distance']['text'];//Text for String and Value for INT | ||
$settings= $this->Webservice_model->getkm_charge(); | ||
$kmcharge=$distance *($settings->kmcharge); | ||
$km_price = $this->Webservice_model->getrate($request['user_id']); | ||
//$data['avg_rate']=round($km_price,'3'); | ||
if($request['round_trip']!=0){ | ||
$date=$request['rtrn_time']; | ||
$totaltime=date("H:i:s ", strtotime("$date + $time")); | ||
$request['reached_time_rtrn']=$totaltime; | ||
/////////////////////////duration and time calculation////////////////////////// | ||
$from = $request['source']; | ||
$remFrom = str_replace(',', '', $from); //Remove Commas | ||
$from = urlencode($remFrom); | ||
$to = $request['destination']; | ||
$remTo = str_replace(',', '', $to); //Remove Commas | ||
$to = urlencode($remTo); | ||
$data = file_get_contents("https://maps.googleapis.com/maps/api/distancematrix/json?&key=AIzaSyA30TEywZIiq6dv6l-JKezQWrEnLeoCiTc&origins=$from&destinations=$to&language=en-EN&sensor=false"); | ||
$data = json_decode($data, true); | ||
if($data['rows'][0]['elements'][0]['status']=='ZERO_RESULTS'){ | ||
$response=array('status' => 'error','message'=>'No Routes Found!!!'); | ||
} | ||
$date=$request['detour_time']; | ||
}else{ | ||
$time = $data['rows'][0]['elements'][0]['duration']['text']; //Text for String and Value for INT | ||
$distance = $data['rows'][0]['elements'][0]['distance']['text'];//Text for String and Value for INT | ||
$settings= $this->Webservice_model->getkm_charge(); | ||
$kmcharge=$distance *($settings->kmcharge); | ||
$km_price = $this->Webservice_model->getrate($request['user_id']); | ||
//$data['avg_rate']=round($km_price,'3'); | ||
if($request['round_trip']!=0){ | ||
$date=$request['rtrn_time']; | ||
$totaltime=date("H:i:s ", strtotime("$date + $time")); | ||
$request['reached_time']=$totaltime; | ||
///////////////////////////////////////////////////////////////////////////////////////// | ||
$cardetails= $this->Webservice_model->car_offer_select($request['user_id']); | ||
if($cardetails){ | ||
if($request['round_trip']== true){ | ||
$result1 = $this->Webservice_model->offer_departure($request); | ||
$dep_id= $result1; | ||
$result2 = $this->Webservice_model->offer_return($request); | ||
$rtrn_id=$result2; | ||
$roundtripdata=array($dep_id,$rtrn_id); | ||
$check='round'; | ||
if($result1 && $result2){ | ||
$response=array('status' => 'success','data'=>$roundtripdata,'check'=>$check,'km_price'=>$kmcharge); | ||
}else{ | ||
$response=array('status' => 'error','message'=>'Error Occured','data'=>''); | ||
} | ||
}else{ | ||
$result = $this->Webservice_model->offer_departure($request); | ||
$data=array($result); | ||
$check=''; | ||
if($result){ | ||
$response=array('status' => 'success','message'=>'','data'=>$data,'check'=>$check,'km_price'=>$kmcharge); | ||
$request['reached_time_rtrn']=$totaltime; | ||
} | ||
$date=$request['detour_time']; | ||
$totaltime=date("H:i:s ", strtotime("$date + $time")); | ||
$request['reached_time']=$totaltime; | ||
///////////////////////////////////////////////////////////////////////////////////////// | ||
$cardetails= $this->Webservice_model->car_offer_select($request['user_id']); | ||
if($cardetails){ | ||
if($request['round_trip']== true){ | ||
$result1 = $this->Webservice_model->offer_departure($request); | ||
$dep_id= $result1; | ||
$result2 = $this->Webservice_model->offer_return($request); | ||
$rtrn_id=$result2; | ||
$roundtripdata=array($dep_id,$rtrn_id); | ||
$check='round'; | ||
if($result1 && $result2){ | ||
$response=array('status' => 'success','data'=>$roundtripdata,'check'=>$check,'km_price'=>$kmcharge); | ||
}else{ | ||
$response=array('status' => 'error','message'=>'Error Occured','data'=>''); | ||
} | ||
} | ||
}else{ | ||
$response=array('status' => 'carerror','message'=>'No car Found!!! Please Add car','data'=>''); | ||
}} | ||
$result = $this->Webservice_model->offer_departure($request); | ||
$data=array($result); | ||
$check=''; | ||
if($result){ | ||
$response=array('status' => 'success','message'=>'','data'=>$data,'check'=>$check,'km_price'=>$kmcharge); | ||
}else{ | ||
$response=array('status' => 'error','message'=>'Error Occured','data'=>''); | ||
} | ||
} | ||
}else{ | ||
$response=array('status' => 'carerror','message'=>'No car Found!!! Please Add car','data'=>''); | ||
}else { | ||
$response=array('status' => 'error','message'=>'Error Occured','data'=>''); | ||
} | ||
// $response) | ||
print json_encode($response); | ||
} | ||
}else { | ||
$response=array('status' => 'error','message'=>'Error Occured','data'=>''); | ||
} | ||
print json_encode($response); | ||
} | ||
public function offer_ride_update_post(){ | ||
... | ... | @@ -627,8 +586,6 @@ public function fb_login_post(){ |
$ride_list = $request['insert_id']; | ||
$i = 0; | ||
foreach($ride_list as $ride_id){ | ||
++$i; | ||
$request['ride_id'] = $ride_id; | ||
... | ... | @@ -644,39 +601,31 @@ public function fb_login_post(){ |
$carexist= $this->Webservice_model->car_exist($request,$i); | ||
//echo $this->db->last_query(); | ||
// $carexist); | ||
if($carexist){ | ||
$response=array('status' => 'error','message'=>'No car Available','data'=>''); | ||
}else{ | ||
$result = $this->Webservice_model->offer_update($request); | ||
if($result){ | ||
$check_notification=$this->Webservice_model->check_notification_updates($result->users_id); | ||
// var_dump() | ||
if($check_notification){ | ||
$subject="Offerride"; | ||
$user_id =$result->users_id; | ||
$page= 'confirm_mails/confirm_mail_offer'; | ||
$this->email_send($result,$subject,$user_id, $page); | ||
} | ||
$result_ride = $this->Webservice_model->result_ride($result); | ||
// var_dump($result_ride); | ||
if($result_ride){ | ||
$res = $this->send_alert($result_ride); | ||
// var_dump($res); | ||
$response=array('status' => 'success','message'=>'Ride Offered successfully','data'=>''); | ||
} else { | ||
$response=array('status' => 'error','message'=>'Something Went Wrong','data'=>''); | ||
} | ||
} else { | ||
$response=array('status' => 'error','message'=>'Something Went Wrong','data'=>''); | ||
} | ||
if($carexist){ | ||
$response=array('status' => 'error','message'=>'No car Available','data'=>''); | ||
}else{ | ||
$result = $this->Webservice_model->offer_update($request); | ||
if($result){ | ||
$check_notification=$this->Webservice_model->check_notification_updates($result->users_id); | ||
if($check_notification){ | ||
$subject="Offerride"; | ||
$user_id =$result->users_id; | ||
$page= 'confirm_mails/confirm_mail_offer'; | ||
$this->email_send($result,$subject,$user_id, $page); | ||
} | ||
$result_ride = $this->Webservice_model->result_ride($result); | ||
if($result_ride){ | ||
$res = $this->send_alert($result_ride); | ||
$response=array('status' => 'success','message'=>'Ride Offered successfully','data'=>''); | ||
} else { | ||
$response=array('status' => 'error','message'=>'Something Went Wrong','data'=>''); | ||
} | ||
} else { | ||
$response=array('status' => 'error','message'=>'Something Went Wrong','data'=>''); | ||
} | ||
} | ||
} | ||
} | ||
print json_encode($response); | ||
... | ... | @@ -718,11 +667,6 @@ public function fb_login_post(){ |
} | ||
public function send_alert($result){ | ||
// $result); | ||
/* $result); | ||
die(); | ||
$new=array(); | ||
if($result){*/ | ||
foreach($result as $key => $value){ | ||
$id = $key; | ||
... | ... | @@ -740,35 +684,10 @@ public function fb_login_post(){ |
//die; | ||
$include_player_ids = array($rs->player_id); | ||
$res= $this->send_Message($content,$headings,$include_player_ids,$result,$type,$id); | ||
$return = $res; | ||
// $return = json_encode($return); | ||
// print($return); | ||
$return = $res; | ||
} | ||
} | ||
// print("\n\nJSON received:\n"); | ||
// print("\n"); | ||
/*}else{ | ||
$response=array('status' => 'error','message'=>'Something Went Wrong','data'=>''); | ||
print json_encode($response); | ||
}*/ | ||
} | ||
public function list_offer_ride_post(){ | ||
... | ... | @@ -1817,6 +1736,26 @@ public function goverment_upload_post(){ |
} | ||
public function deletebooking_post(){ | ||
$postdata = file_get_contents("php://input"); | ||
$request = json_decode($postdata); | ||
if($request){ | ||
$result=$this->Webservice_model->deletebooking($request); | ||
if($result){ | ||
$response=array('status' => 'success','data'=>$result); | ||
}else{ | ||
$response=array('status' => 'error'); | ||
} | ||
}else{ | ||
$response=array('status' => 'error','message'=>'Something Went wrong'); | ||
} | ||
print json_encode($response); | ||
} | ||
################################################################################################# | ||
public function email_send($data,$subject,$user_id,$page) { | ||
... | ... | @@ -2121,43 +2060,36 @@ public function goverment_upload_post(){ |
// } | ||
public function update_carphoto_post(){ | ||
// print json_encode(array('status' => 'error','data'=>$_FILES)); | ||
// die(); | ||
if(is_uploaded_file($_FILES['file']['tmp_name'])){ | ||
$uploads_dir = './assets/uploads/profile_pic/'; | ||
$tmp_name = $_FILES['file']['tmp_name']; | ||
$pic_name = $_FILES['file']['name']; | ||
$pic_name = str_replace(' ', '_', mt_rand().$pic_name); | ||
move_uploaded_file($tmp_name, $uploads_dir.$pic_name); | ||
$request = $_POST; | ||
//$request['image'] = $uploads_dir.$pic_name; | ||
$request['file'] = base_url().$uploads_dir.$pic_name; | ||
//$request['file'] = $uploads_dir.$pic_name; | ||
$result = $this->Webservice_model->carphoto_uploads($request); | ||
if($result){ | ||
print json_encode(array('status' => 'success','message'=>'Car Photo Updated Succesfully','data'=>$result)); | ||
public function update_carphoto_post(){ | ||
// print json_encode(array('status' => 'error','data'=>$_FILES)); | ||
// die(); | ||
if(is_uploaded_file($_FILES['file']['tmp_name'])){ | ||
$uploads_dir = './assets/uploads/profile_pic/'; | ||
$tmp_name = $_FILES['file']['tmp_name']; | ||
$pic_name = $_FILES['file']['name']; | ||
$pic_name = str_replace(' ', '_', mt_rand().$pic_name); | ||
move_uploaded_file($tmp_name, $uploads_dir.$pic_name); | ||
$request = $_POST; | ||
//$request['image'] = $uploads_dir.$pic_name; | ||
$request['file'] = base_url().$uploads_dir.$pic_name; | ||
//$request['file'] = $uploads_dir.$pic_name; | ||
$result = $this->Webservice_model->carphoto_uploads($request); | ||
if($result){ | ||
print json_encode(array('status' => 'success','message'=>'Car Photo Updated Succesfully','data'=>$result)); | ||
} else { | ||
print json_encode(array('status' => 'error','data'=>'')); | ||
} | ||
} else { | ||
print json_encode(array('status' => 'error','message'=>'Something Went wrrong')); | ||
print json_encode(array('status' => 'error','data'=>'')); | ||
} | ||
} else { | ||
print json_encode(array('status' => 'error','message'=>'Something Went wrrong')); | ||
} | ||
} | ||
... | ... | @@ -2988,7 +2920,36 @@ public function end_ride_update_post(){ |
/********send mail ***************/ | ||
public function mailsendfun(){ | ||
$this->load->library('email'); | ||
$config = Array( | ||
'protocol' => 'smtp', | ||
'smtp_host' => 'smtp.sendgrid.net', | ||
'smtp_port' => 25, | ||
'smtp_user' => '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', // change it to yours | ||
'smtp_pass' => 'Golden_123', // change it to yours | ||
'smtp_timeout'=>20, | ||
'mailtype' => 'html', | ||
'charset' => 'utf-8', | ||
'wordwrap' => TRUE | ||
); | ||
$this->email->initialize($config);// add this line | ||
$subject = 'New Mail'; | ||
//$name= $data->name; | ||
//$mailTemplate=$data->message; | ||
//$this->email->set_newline("\r\n"); | ||
$this->email->from('[email protected]'); | ||
$this->email->to('[email protected]'); | ||
$this->email->subject("Verify Your Email"); | ||
$this->email->message("Success"); | ||
$this->email->send(); | ||
// echo $this->email->print_debugger(); | ||
return "EmailSend"; | ||
} | ||
... | ... |
This source diff could not be displayed because it is too large.
You can
view the blob
instead.
Please
register
or
sign in
to comment