Commit 1eafe3ad by Tobin

dc

parent 416d4fef
......@@ -235,6 +235,7 @@ class Webservices extends CI_Controller {
$postData = $_POST;
$optionalData = array('optionlaDescription'=>'','optionalImages'=>array(),'optionalVideos'=>array());
$respArr = array('status'=>'0','message'=>'Something went wrong.');
if(empty($postData) || empty($postData = json_decode($postData['data'],true)) ||
!isset($postData['cost']) || empty($postData['cost']) ||
!isset($postData['customer_id']) || empty($postData['customer_id']) ||
......@@ -245,6 +246,7 @@ class Webservices extends CI_Controller {
!isset($postData['selected_issues']) || empty($postData['selected_issues'])){
echo json_encode($respArr);exit;
}
$optionalData['optionlaDescription'] = (isset($postData['optionalDescription']) &&
!empty($postData['optionalDescription']))?
$postData['optionalDescription']:'';
......
......@@ -14,6 +14,7 @@ class Booking_model extends CI_Model {
!isset($postData['selected_issues']) || empty($postData['selected_issues'])){
return 0;
}
$vehData = $postData['vechile_info'];
$car_name = $vehData['modelYear'].' '.$vehData['maker'].' '.$vehData['modelName'];
......@@ -78,8 +79,8 @@ class Booking_model extends CI_Model {
BK.scheduled_time,BK.cost,BK.status,MECH.first_name,MECH.last_name,VEH.car_name,
BK.status
FROM bookings AS BK
INNER JOIN mechanic AS MECH ON (MECH.mechanic_id AND BK.mechanic_id)
INNER JOIN customer_vehicle AS VEH ON (VEH.customer_veh_id AND BK.customer_veh_id)
INNER JOIN mechanic AS MECH ON (MECH.mechanic_id = BK.mechanic_id)
INNER JOIN customer_vehicle AS VEH ON (VEH.customer_veh_id = BK.customer_veh_id)
WHERE $cond
GROUP BY BK.booking_id";
......@@ -120,10 +121,10 @@ class Booking_model extends CI_Model {
CUST.first_name AS custFirstName,CUST.last_name AS custLastName,CUST.phone,
CUST.email,CUST.address,CUST.profile_image,CUST.date_of_birth
FROM bookings AS BK
INNER JOIN mechanic AS MECH ON (MECH.mechanic_id AND BK.mechanic_id)
INNER JOIN customers AS CUST ON (CUST.customer_id AND BK.customer_id)
INNER JOIN admin_users AS ADM ON (ADM.id AND BK.mechanic_id)
INNER JOIN customer_vehicle AS VEH ON (VEH.customer_veh_id AND BK.customer_veh_id)
INNER JOIN mechanic AS MECH ON (MECH.mechanic_id=BK.mechanic_id)
INNER JOIN customers AS CUST ON (CUST.customer_id=BK.customer_id)
INNER JOIN admin_users AS ADM ON (ADM.id=BK.mechanic_id)
INNER JOIN customer_vehicle AS VEH ON (VEH.customer_veh_id=BK.customer_veh_id)
WHERE $cond AND ADM.status='1' AND CUST.status='1'
GROUP BY BK.booking_id";
......
......@@ -808,13 +808,16 @@ jQuery('[id="showBookinDetails"]').on('click',function() {
}
if(optional_data != ''){
optionalHtml = '<div class="col-md-12">'+
'<div class="row"><label>Additional Information</label></div>'+
'<div class="row">'+
'<div class="col-md-2">Issue Details</div>'+
'<div class="col-md-1">:</div>'+
'<div class="col-md-9"><label>'+optional_data['optionlaDescription']+'</label></div>'+
'</div>';
optionalHtml = '<br><div class="col-md-12">'+
'<div class="row"><label>Additional Information</label></div>';
if(optional_data['optionlaDescription'] != ''){
optionalHtml += '<div class="row">'+
'<div class="col-md-2">Issue Details</div>'+
'<div class="col-md-1">:</div>'+
'<div class="col-md-9"><p>'+optional_data['optionlaDescription']+'</p></div>'+
'</div>';
}
if(optional_data['optionalImages'] != ''){
optionalHtml += '<div class="row">'+
......@@ -826,8 +829,9 @@ jQuery('[id="showBookinDetails"]').on('click',function() {
imgCount += 1;
optionalHtml += '<img id="optionalImage_'+imgCount+'" src="'+base_url+image+'" height="100" width="100" /> ';
});
optionalHtml += '</div></div>';
optionalHtml += '</div>';
}
optionalHtml += '</div>';
}
html = '<div class="col-xs-12">'+
......
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