Commit b5cdd9e4 by Jansa Jose

Merge branch 'master' into 'dev_production'

booking summary See merge request !16
parents 3cd8d630 7128c223
...@@ -534,7 +534,7 @@ ...@@ -534,7 +534,7 @@
/*********************************************************************************/ /*********************************************************************************/
/************************************Mobile API's*********************************/ /************************************Mobile API's*********************************/
//Mobile Number Availability
public function mobile_number_availability(){ public function mobile_number_availability(){
header('Content-type: application/json'); header('Content-type: application/json');
...@@ -554,7 +554,8 @@ ...@@ -554,7 +554,8 @@
} }
echo json_encode($respArr);exit; echo json_encode($respArr);exit;
} }
//User Login
public function user_login(){ public function user_login(){
header('Content-type: application/json'); header('Content-type: application/json');
...@@ -594,7 +595,7 @@ ...@@ -594,7 +595,7 @@
echo json_encode($respArr); exit; echo json_encode($respArr); exit;
} }
// customer_registration // customer_registration
public function user_registration(){ public function user_registration(){
header('Content-type: application/json'); header('Content-type: application/json');
...@@ -657,7 +658,8 @@ ...@@ -657,7 +658,8 @@
} }
echo json_encode($respArr); exit; echo json_encode($respArr); exit;
} }
//Get Booked Services
public function get_booked_services(){ public function get_booked_services(){
header('Content-type: application/json'); header('Content-type: application/json');
$headers = apache_request_headers(); $headers = apache_request_headers();
...@@ -676,7 +678,8 @@ ...@@ -676,7 +678,8 @@
$bookData = $this->Webservice_model->getBookedService($authRes['data']['customer_id']); $bookData = $this->Webservice_model->getBookedService($authRes['data']['customer_id']);
echo json_encode($bookData);exit; echo json_encode($bookData);exit;
} }
//Add Vehicle Details
public function add_vehicle_details(){ public function add_vehicle_details(){
header('Content-type: application/json'); header('Content-type: application/json');
$headers = apache_request_headers(); $headers = apache_request_headers();
...@@ -746,7 +749,8 @@ ...@@ -746,7 +749,8 @@
$respData = $this->Webservice_model->addVehicleDetails($postData,$authRes['data']['customer_id']); $respData = $this->Webservice_model->addVehicleDetails($postData,$authRes['data']['customer_id']);
echo json_encode($respData);exit; echo json_encode($respData);exit;
} }
//Get Services
public function get_services(){ public function get_services(){
header('Content-type: application/json'); header('Content-type: application/json');
$headers = apache_request_headers(); $headers = apache_request_headers();
...@@ -822,7 +826,8 @@ ...@@ -822,7 +826,8 @@
} }
echo json_encode($respArr);exit; echo json_encode($respArr);exit;
} }
//Get Vehicle Details
public function get_vehicle_details(){ public function get_vehicle_details(){
header('Content-type: application/json'); header('Content-type: application/json');
$headers = apache_request_headers(); $headers = apache_request_headers();
...@@ -872,6 +877,7 @@ ...@@ -872,6 +877,7 @@
echo json_encode($respArr);exit; echo json_encode($respArr);exit;
} }
//Search Sub Services
public function search_sub_services(){ public function search_sub_services(){
header('Content-type: application/json'); header('Content-type: application/json');
$headers = apache_request_headers(); $headers = apache_request_headers();
...@@ -951,7 +957,8 @@ ...@@ -951,7 +957,8 @@
} }
echo json_encode($respArr);exit; echo json_encode($respArr);exit;
} }
//Book Service
public function book_service(){ public function book_service(){
header('Content-type: application/json'); header('Content-type: application/json');
$headers = apache_request_headers(); $headers = apache_request_headers();
...@@ -1009,6 +1016,7 @@ ...@@ -1009,6 +1016,7 @@
} }
//Get Booking Summary
public function get_booking_summary(){ public function get_booking_summary(){
header('Content-type: application/json'); header('Content-type: application/json');
$headers = apache_request_headers(); $headers = apache_request_headers();
...@@ -1030,7 +1038,8 @@ ...@@ -1030,7 +1038,8 @@
$res = $this->Webservice_model->get_booking_summary($postData); $res = $this->Webservice_model->get_booking_summary($postData);
echo json_encode($res);exit; echo json_encode($res);exit;
} }
//Get Mechanics
public function get_mechanics(){ public function get_mechanics(){
header('Content-type: application/json'); header('Content-type: application/json');
$headers = apache_request_headers(); $headers = apache_request_headers();
...@@ -1126,7 +1135,8 @@ ...@@ -1126,7 +1135,8 @@
} }
echo json_encode($respArr);exit; echo json_encode($respArr);exit;
} }
//Add Service Details
public function add_service_details(){ public function add_service_details(){
header('Content-type: application/json'); header('Content-type: application/json');
$headers = apache_request_headers(); $headers = apache_request_headers();
...@@ -1208,6 +1218,7 @@ ...@@ -1208,6 +1218,7 @@
echo json_encode($addServiceDetails);exit(); echo json_encode($addServiceDetails);exit();
} }
//Remove Booking
public function remove_booking(){ public function remove_booking(){
header('Content-type:application/json'); header('Content-type:application/json');
$headers = apache_request_headers(); $headers = apache_request_headers();
...@@ -1229,6 +1240,7 @@ ...@@ -1229,6 +1240,7 @@
echo json_encode($removed); echo json_encode($removed);
} }
//Get Service
public function get_service(){ public function get_service(){
header('Content-type:application/json'); header('Content-type:application/json');
$headers = apache_request_headers(); $headers = apache_request_headers();
......
...@@ -308,22 +308,26 @@ class Webservice_model extends CI_Model { ...@@ -308,22 +308,26 @@ class Webservice_model extends CI_Model {
unset($mechanic_data['vehicle_data']); unset($mechanic_data['vehicle_data']);
$mechanic_data['services'] = json_decode($mechanic_data['issues_selected']); $mechanic_data['services'] = json_decode($mechanic_data['issues_selected']);
foreach($mechanic_data['services'] as $key => $value){ if(!empty($mechanic_data['services'])){
$sql = "SELECT IC.*, MI.custom_description, MI.custom_service_fee foreach($mechanic_data['services'] as $key => $value){
FROM issues_category AS IC $sql = "SELECT IC.*, MI.custom_description, MI.custom_service_fee
LEFT JOIN mechanic_issues AS MI ON (MI.issue_cat_id=IC.issue_cat_id AND FROM issues_category AS IC
MI.mechanic_id='".$mechanic_data['mechanic_id']."' AND MI.status='1') LEFT JOIN mechanic_issues AS MI ON (MI.issue_cat_id=IC.issue_cat_id AND
WHERE IC.status='1' AND IC.issue_cat_id='".$value->sub_issue_id."'"; MI.mechanic_id='".$mechanic_data['mechanic_id']."' AND MI.status='1')
$issue_data = $this->db->query($sql)->row(); WHERE IC.status='1' AND IC.issue_cat_id='".$value->sub_issue_id."'";
if(empty($issue_data)){ $issue_data = $this->db->query($sql)->row();
if($issue_data->custom_description != '' && $issue_data->custom_service_fee != ''){ if(!empty($issue_data)){
$mechanic_data['services'][$key]->description = $issue_data->custom_description; if($issue_data->custom_description != '' && $issue_data->custom_service_fee != ''){
$mechanic_data['services'][$key]->service_fee = $issue_data->custom_service_fee; $mechanic_data['services'][$key]->description = $issue_data->custom_description;
}else{ $mechanic_data['services'][$key]->service_fee = $issue_data->custom_service_fee;
$mechanic_data['services'][$key]->description = $issue_data->default_description; }else{
$mechanic_data['services'][$key]->service_fee = $issue_data->default_service_fee; $mechanic_data['services'][$key]->description = $issue_data->default_description;
$mechanic_data['services'][$key]->service_fee = $issue_data->default_service_fee;
}
} }
} }
}else{
$mechanic_data['services'] = [];
} }
unset($mechanic_data['issues_selected']); unset($mechanic_data['issues_selected']);
......
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