delete bookings
Showing
| ... | @@ -138,7 +138,7 @@ header('Content-Type: text/html; charset=utf-8'); | ... | @@ -138,7 +138,7 @@ header('Content-Type: text/html; charset=utf-8'); |
| } | } | ||
| ##################################### Facebook Login ####################################################### | ##################################### Facebook Login ################################################# | ||
| public function google_login_post(){ | public function google_login_post(){ | ||
| // 'fb_login');die(); | // 'fb_login');die(); | ||
| ... | @@ -159,7 +159,7 @@ header('Content-Type: text/html; charset=utf-8'); | ... | @@ -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"); | $postdata = file_get_contents("php://input"); | ||
| $request = json_decode($postdata,true); | $request = json_decode($postdata,true); | ||
| $result = $this->Webservice_model->get_cars_details($request); | $result = $this->Webservice_model->get_cars_details($request); | ||
| ... | @@ -190,9 +190,7 @@ public function fb_login_post(){ | ... | @@ -190,9 +190,7 @@ public function fb_login_post(){ |
| } | } | ||
| ##################################### Forgot password ############################################### | |||
| ##################################### Forgot password ####################################################### | |||
| public function forgot_password_post() { | public function forgot_password_post() { | ||
| ... | @@ -215,9 +213,7 @@ public function fb_login_post(){ | ... | @@ -215,9 +213,7 @@ public function fb_login_post(){ |
| } | } | ||
| ##################################### Change password ################################################ | |||
| ##################################### Change password ####################################################### | |||
| public function change_password_post(){ | public function change_password_post(){ | ||
| ... | @@ -245,11 +241,7 @@ public function fb_login_post(){ | ... | @@ -245,11 +241,7 @@ public function fb_login_post(){ |
| ##################################### Biography Update ################################################ | |||
| ##################################### Biography Update ####################################################### | |||
| public function update_biography_post(){ | public function update_biography_post(){ | ||
| ... | @@ -275,16 +267,7 @@ public function fb_login_post(){ | ... | @@ -275,16 +267,7 @@ public function fb_login_post(){ |
| } | } | ||
| ##################################### Profile Update ############################################### | |||
| ##################################### Profile Update ####################################################### | |||
| public function update_profile_post(){ | public function update_profile_post(){ | ||
| ... | @@ -311,14 +294,7 @@ public function fb_login_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(){ | ... | @@ -450,7 +426,7 @@ public function fb_login_post(){ |
| } | } | ||
| ############################################################################## | ################################################################################################### | ||
| public function get_users_car_list_post(){ | public function get_users_car_list_post(){ | ||
| ... | @@ -507,20 +483,11 @@ public function fb_login_post(){ | ... | @@ -507,20 +483,11 @@ public function fb_login_post(){ |
| public function add_users_car_post(){ | |||
| $postdata = file_get_contents("php://input"); | |||
| $request = json_decode($postdata,true); | |||
| if($request) { | |||
| public function add_users_car_post(){ | |||
| $postdata = file_get_contents("php://input"); | |||
| $request = json_decode($postdata,true); | |||
| if($request) { | |||
| $result = $this->Webservice_model->add_users_car($request); | $result = $this->Webservice_model->add_users_car($request); | ||
| if($result){ | if($result){ | ||
| ... | @@ -534,7 +501,6 @@ public function fb_login_post(){ | ... | @@ -534,7 +501,6 @@ public function fb_login_post(){ |
| } else { | } else { | ||
| print json_encode(array('status' => 'error','message'=>'Something Went wrong','data'=>'')); | print json_encode(array('status' => 'error','message'=>'Something Went wrong','data'=>'')); | ||
| } | } | ||
| } | } | ||
| ////****************14-08-2017************************//// | ////****************14-08-2017************************//// | ||
| ... | @@ -542,80 +508,73 @@ public function fb_login_post(){ | ... | @@ -542,80 +508,73 @@ public function fb_login_post(){ |
| public function offer_ride_post(){ | public function offer_ride_post(){ | ||
| $postdata = file_get_contents("php://input"); | $postdata = file_get_contents("php://input"); | ||
| $request = json_decode($postdata,true); | $request = json_decode($postdata,true); | ||
| /*$request = (array) json_decode(file_get_contents("php://input"));*/ | if($request) { | ||
| //print_r($request);exit; | |||
| if($request) { | |||
| /////////////////////////duration and time calculation////////////////////////// | /////////////////////////duration and time calculation////////////////////////// | ||
| $from = $request['source']; | $from = $request['source']; | ||
| $remFrom = str_replace(',', '', $from); //Remove Commas | $remFrom = str_replace(',', '', $from); //Remove Commas | ||
| $from = urlencode($remFrom); | $from = urlencode($remFrom); | ||
| $to = $request['destination']; | $to = $request['destination']; | ||
| $remTo = str_replace(',', '', $to); //Remove Commas | $remTo = str_replace(',', '', $to); //Remove Commas | ||
| $to = urlencode($remTo); | $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 = 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); | $data = json_decode($data, true); | ||
| if($data['rows'][0]['elements'][0]['status']=='ZERO_RESULTS'){ | if($data['rows'][0]['elements'][0]['status']=='ZERO_RESULTS'){ | ||
| $response=array('status' => 'error','message'=>'No Routes Found!!!'); | $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; | |||
| } | }else{ | ||
| $date=$request['detour_time']; | $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")); | $totaltime=date("H:i:s ", strtotime("$date + $time")); | ||
| $request['reached_time']=$totaltime; | $request['reached_time_rtrn']=$totaltime; | ||
| ///////////////////////////////////////////////////////////////////////////////////////// | |||
| $cardetails= $this->Webservice_model->car_offer_select($request['user_id']); | } | ||
| if($cardetails){ | $date=$request['detour_time']; | ||
| if($request['round_trip']== true){ | $totaltime=date("H:i:s ", strtotime("$date + $time")); | ||
| $result1 = $this->Webservice_model->offer_departure($request); | $request['reached_time']=$totaltime; | ||
| $dep_id= $result1; | ///////////////////////////////////////////////////////////////////////////////////////// | ||
| $result2 = $this->Webservice_model->offer_return($request); | $cardetails= $this->Webservice_model->car_offer_select($request['user_id']); | ||
| $rtrn_id=$result2; | if($cardetails){ | ||
| $roundtripdata=array($dep_id,$rtrn_id); | if($request['round_trip']== true){ | ||
| $check='round'; | $result1 = $this->Webservice_model->offer_departure($request); | ||
| if($result1 && $result2){ | $dep_id= $result1; | ||
| $response=array('status' => 'success','data'=>$roundtripdata,'check'=>$check,'km_price'=>$kmcharge); | $result2 = $this->Webservice_model->offer_return($request); | ||
| }else{ | $rtrn_id=$result2; | ||
| $response=array('status' => 'error','message'=>'Error Occured','data'=>''); | $roundtripdata=array($dep_id,$rtrn_id); | ||
| } | $check='round'; | ||
| }else{ | if($result1 && $result2){ | ||
| $result = $this->Webservice_model->offer_departure($request); | $response=array('status' => 'success','data'=>$roundtripdata,'check'=>$check,'km_price'=>$kmcharge); | ||
| $data=array($result); | |||
| $check=''; | |||
| if($result){ | |||
| $response=array('status' => 'success','message'=>'','data'=>$data,'check'=>$check,'km_price'=>$kmcharge); | |||
| }else{ | }else{ | ||
| $response=array('status' => 'error','message'=>'Error Occured','data'=>''); | $response=array('status' => 'error','message'=>'Error Occured','data'=>''); | ||
| } | } | ||
| } | |||
| }else{ | }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(){ | public function offer_ride_update_post(){ | ||
| ... | @@ -627,8 +586,6 @@ public function fb_login_post(){ | ... | @@ -627,8 +586,6 @@ public function fb_login_post(){ |
| $ride_list = $request['insert_id']; | $ride_list = $request['insert_id']; | ||
| $i = 0; | $i = 0; | ||
| foreach($ride_list as $ride_id){ | foreach($ride_list as $ride_id){ | ||
| ++$i; | ++$i; | ||
| $request['ride_id'] = $ride_id; | $request['ride_id'] = $ride_id; | ||
| ... | @@ -644,39 +601,31 @@ public function fb_login_post(){ | ... | @@ -644,39 +601,31 @@ public function fb_login_post(){ |
| $carexist= $this->Webservice_model->car_exist($request,$i); | $carexist= $this->Webservice_model->car_exist($request,$i); | ||
| //echo $this->db->last_query(); | //echo $this->db->last_query(); | ||
| // $carexist); | // $carexist); | ||
| if($carexist){ | if($carexist){ | ||
| $response=array('status' => 'error','message'=>'No car Available','data'=>''); | $response=array('status' => 'error','message'=>'No car Available','data'=>''); | ||
| }else{ | }else{ | ||
| $result = $this->Webservice_model->offer_update($request); | $result = $this->Webservice_model->offer_update($request); | ||
| if($result){ | if($result){ | ||
| $check_notification=$this->Webservice_model->check_notification_updates($result->users_id); | $check_notification=$this->Webservice_model->check_notification_updates($result->users_id); | ||
| // var_dump() | if($check_notification){ | ||
| if($check_notification){ | $subject="Offerride"; | ||
| $subject="Offerride"; | $user_id =$result->users_id; | ||
| $user_id =$result->users_id; | $page= 'confirm_mails/confirm_mail_offer'; | ||
| $page= 'confirm_mails/confirm_mail_offer'; | $this->email_send($result,$subject,$user_id, $page); | ||
| $this->email_send($result,$subject,$user_id, $page); | } | ||
| } | $result_ride = $this->Webservice_model->result_ride($result); | ||
| $result_ride = $this->Webservice_model->result_ride($result); | if($result_ride){ | ||
| // var_dump($result_ride); | $res = $this->send_alert($result_ride); | ||
| if($result_ride){ | $response=array('status' => 'success','message'=>'Ride Offered successfully','data'=>''); | ||
| $res = $this->send_alert($result_ride); | } else { | ||
| // var_dump($res); | $response=array('status' => 'error','message'=>'Something Went Wrong','data'=>''); | ||
| $response=array('status' => 'success','message'=>'Ride Offered successfully','data'=>''); | } | ||
| } else { | } else { | ||
| $response=array('status' => 'error','message'=>'Something Went Wrong','data'=>''); | $response=array('status' => 'error','message'=>'Something Went Wrong','data'=>''); | ||
| } | } | ||
| } else { | |||
| $response=array('status' => 'error','message'=>'Something Went Wrong','data'=>''); | |||
| } | |||
| } | } | ||
| } | } | ||
| print json_encode($response); | print json_encode($response); | ||
| ... | @@ -718,11 +667,6 @@ public function fb_login_post(){ | ... | @@ -718,11 +667,6 @@ public function fb_login_post(){ |
| } | } | ||
| public function send_alert($result){ | public function send_alert($result){ | ||
| // $result); | |||
| /* $result); | |||
| die(); | |||
| $new=array(); | |||
| if($result){*/ | |||
| foreach($result as $key => $value){ | foreach($result as $key => $value){ | ||
| $id = $key; | $id = $key; | ||
| ... | @@ -740,35 +684,10 @@ public function fb_login_post(){ | ... | @@ -740,35 +684,10 @@ public function fb_login_post(){ |
| //die; | //die; | ||
| $include_player_ids = array($rs->player_id); | $include_player_ids = array($rs->player_id); | ||
| $res= $this->send_Message($content,$headings,$include_player_ids,$result,$type,$id); | $res= $this->send_Message($content,$headings,$include_player_ids,$result,$type,$id); | ||
| $return = $res; | $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(){ | public function list_offer_ride_post(){ | ||
| ... | @@ -1817,6 +1736,26 @@ public function goverment_upload_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) { | public function email_send($data,$subject,$user_id,$page) { | ||
| ... | @@ -2121,43 +2060,36 @@ public function goverment_upload_post(){ | ... | @@ -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 { | } 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(){ | ... | @@ -2988,7 +2920,36 @@ public function end_ride_update_post(){ |
| /********send mail ***************/ | /********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