Commit 7128c223 by Jansa Jose

booking summary

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