Commit 38a7606f by Jansa Jose

delete bookings

parent f681c733
......@@ -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,17 +483,8 @@ public function fb_login_post(){
public function add_users_car_post(){
$postdata = file_get_contents("php://input");
$request = json_decode($postdata,true);
if($request) {
......@@ -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,14 +508,8 @@ 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) {
/////////////////////////duration and time calculation//////////////////////////
$from = $request['source'];
$remFrom = str_replace(',', '', $from); //Remove Commas
......@@ -608,13 +568,12 @@ public function fb_login_post(){
}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);
}
......@@ -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;
......@@ -650,7 +607,6 @@ public function fb_login_post(){
$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;
......@@ -658,10 +614,8 @@ public function fb_login_post(){
$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'=>'');
......@@ -672,11 +626,6 @@ public function fb_login_post(){
}
}
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);
}
}
// 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,13 +2060,6 @@ public function goverment_upload_post(){
// }
public function update_carphoto_post(){
// print json_encode(array('status' => 'error','data'=>$_FILES));
......@@ -2989,6 +2921,35 @@ 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";
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment