Commit f3910b99 by Jansa Jose

changes in pos and admin and garage quote

parent e6bc2ab4
......@@ -68,6 +68,8 @@ class Pos_booking extends CI_Controller {
$status = "<button type='button' class='btn btn-success'>Completed</button>";
} else if ($r->status == 0) {
$status = "<button type='button' class='btn btn-danger'>Cancelled</button>";
} else if ($r->status == 5) {
$status = "<button type='button' class='btn btn-warning'>Assign to Express</button>";
} else if ($r->status == 1) {
$status = "<button type='button' class='btn btn-secondary'>New Booking</button>";
}
......
......@@ -15,8 +15,6 @@ class Pos_response extends CI_Controller {
}
public function responce($request_id){
$template['page'] = 'Pos_response/list';
$template['menu'] = 'Pos Response Management';
......@@ -65,7 +63,7 @@ class Pos_response extends CI_Controller {
if(!$requestData){
echo json_encode($respArr); exit;
}
echo json_encode(array('status'=>'success'));exit;
echo json_encode(array('status'=>'success'));exit;
}
......
......@@ -116,24 +116,36 @@ public function Garage_ResponseData($request_id){
function approve_quote($data){
if(!isset($data)){
return 0;
}
if(!isset($data)){
return 0;
}
$responce_id=$data['responce_id'];
$count = count($responce_id);
$req_id= $data['req_id'];
for($i=0;$i<$count;$i++){
$status = $this->db->update('garage_response',array('status'=>'1'),array('id'=>$responce_id[$i]));
}
$accept = $this->db->update('garage_request',array('status'=>'4'),array('id'=>$req_id));
return $status;
for($i=0;$i<$count;$i++){
$status = $this->db->update('garage_response',array('status'=>'1'),array('id'=>$responce_id[$i]));
}
$accept = $this->db->update('garage_request',array('status'=>'4'),array('id'=>$req_id));
$cust_data = $this->db->query("SELECT CUST.name,CUST.email_id FROM garage_request AS GAREQ INNER JOIN customer AS CUST ON CUST.cust_id = GAREQ.cust_id WHERE GAREQ.id=".$req_id)->row_array() ;
$this->db->select("garage_response.*, garage_request.requirement,GROUP_CONCAT( DISTINCT sub_services.sub_services SEPARATOR ', ') as service_name,garage.garage_code,garage.name as garage_name,garage.email as garage_email,garage.phone_no as garage_phone1,garage.altered_no as garage_phone2,garage.address as garage_address");
$this->db->from('garage_response');
$this->db->join('garage', 'garage.garage_id = garage_response.garage_id','left');
$this->db->join('garage_request', 'garage_request.id = garage_response.req_id','left');
$this->db->join("sub_services","find_in_set(sub_services.id,garage_request.subservice_ids)<> 0","left",false);
$this->db->where('garage_response.status','1');
$this->db->where('garage_response.req_id',$req_id);
$this->db->group_by('garage_response.id');
$gar_data = $this->db->get()->result_array();
$to =isset($cust_data['email_id']) && !empty($cust_data['email_id'])?$cust_data['email_id']:'';
$sender_email = "[email protected]";
$data['name']=$cust_data['name'];
$data['email']=$cust_data['email_id'];
$data['postData']=$gar_data;
$mail_head = "Your Garage Request Best Offers";
$mail_status = send_custom_email($sender_email,$mail_head,$to,'Garage Request Details', $this->load->view('template/mail_template/garage_quotes', $data,TRUE),'');
return $status;
}
}
?>
\ No newline at end of file
......@@ -36,7 +36,7 @@ class Pos_response_model extends CI_Model {
public function updatePosMargin($postData = array()){
$settings = getSettings();
$total = ($postData['total'] * $settings['VAT'])/100;
$total = $postData['total'] - (($postData['total'] * $settings['VAT'])/100);
if($this->db->update('pos_response',array('margin'=>$postData['margin'],'total'=>$total),array('id'=>$postData['respId']))){
return true;
}
......@@ -61,10 +61,6 @@ class Pos_response_model extends CI_Model {
}
}
function changeStatus($Pos_response_id = '', $status = '0'){
if(empty($Pos_response_id)){
......@@ -72,7 +68,6 @@ class Pos_response_model extends CI_Model {
}
$status = $this->db->update('users',array('status'=>$status),array('profile_id'=>$Pos_response_id,'user_type'=>'1'));
//echo $this->db->last_query();exit;
return $status;
}
......
......@@ -167,7 +167,7 @@
<th>Phone Number</th>
<th>Cost</th>
<th>Margin</th>
<th>VAT</th>
<th>VAT(%)</th>
<th>Total</th>
<th>Edit</th>
<th>Select</th>
......
<!DOCTYPE html>
<html>
<head>
<title>ALLO</title>
<style>
.pin_container{
background: #a8a8a84a;
border:1px dashed #e7e7e7;
padding:10px;
margin-top:20px;
}
.pin_container_1{
background: #a8a8a8;
border:1px dashed #e7e7e7;
padding:10px;
margin-top:20px;
}
</style>
</head>
<body>
<table align="center" border="0" cellpadding="0" cellspacing="0" width="100%" height="100%" style="border-collapse: collapse; background-color: #e8e8e8;border-collapse: collapse;margin: 0;padding: 0;">
<tbody style="border: 1px solid #00000017;border-radius: 95px;">
<tr>
<td align="center" valign="top" style="padding: 0 10px;">
<table cellpadding="0" cellspacing="0" border="0" align="center" width="100%" style="border-collapse: collapse; font-family:'Roboto',sans-serif;font-size: 32px;font-weight: bold;color: #3392ea; max-width: 600px;">
<tbody>
<tr>
</tr>
</tbody>
</table>
<table align="center" bgcolor="#ffffff" border="0" cellpadding="0" cellspacing="0" width="100%" style="border-collapse: collapse; background-color: #ffffff; border-collapse: collapse;width: 100%;max-width: 900px; border-radius: 8px;">
<tbody>
<tr>
<td align="center" style="padding: 0px; text-align: center;">
<table cellpadding="0" cellspacing="0" width="100%" align="center" style="border-collapse: collapse;">
<tbody>
<tr>
<td align="left" style="padding: 25px;">
<h3 style="margin: 0; text-align: center; padding: 0 0 10px; font-weight: normal; font-weight: normal; font-size: 26px; color: #bb4825; line-height: 32px; font-family:'Roboto',sans-serif; "> <strong>Hi <?php echo ($name);?></strong>, Offers For You.</h3>
<h2 style="color: #555555; font-weight: bold; margin: 0; padding: 0 0 10px; line-height: 25px; font-size: 15px; font-family:'Roboto',sans-serif; border-bottom: 1px dashed #ccc; " align="center"></h2>
<div style="border-bottom: 1px dashed #ccc; padding: 10px 0; line-height: 160%; font-size: 15px;">
<div style="color: #555555; line-height: 160%;font-family:'Roboto',sans-serif;">
<center>
<div class="pin_container_1">
Following Your Services( <b><?php echo $postData[0]['service_name'] ;?></b> ) and Requirment ( <b><?php echo $postData[0]['requirement'] ;?></b> ), We are Pleased to send you our Best Offers
</div>
</center>
</div>
</div>
<div style="border-bottom: 1px dashed #ccc; padding: 10px 0; line-height: 160%; font-size: 15px;">
<div style="color: #555555; line-height: 160%;font-family:'Roboto',sans-serif;">
<center>
<h3 style="color: midnightblue;">
<strong> GARAGE DETAILS</strong>
</h3>
<div class="pin_container">
<table cellpadding="10" cellspacing="5" width="100%" border="0" style="border-collapse: collapse;">
<thead>
<tr>
<th>Garage Code</th>
<th>Garage Name</th>
<th>Phone Number</th>
<th>Quote Type</th>
<th>Labour Cost</th>
<th>Parts Cost</th>
<th>Margin</th>
<th>Total</th>
</tr>
</thead>
<?php foreach ($postData as $key => $value) {
if($value['quote_type'] == '1'){
$quoteType = 'Base';
}else if($value['quote_type'] == '2'){
$quoteType = 'Medium';
}else if($value['quote_type'] == '3'){
$quoteType = 'Premium';
}
?>
<tbody>
<tr>
<td><?= $value['garage_code'] ?></td>
<td><?= $value['garage_name'] ?></td>
<td><?= $value['garage_phone1'].' / '. $value['garage_phone2']?></td>
<td><?= $quoteType ?></td>
<td><?= $value['labour_cost'] ?></td>
<td><?= $value['parts_cost'] ?></td>
<td><?= $value['margin'] ?></td>
<td><?= $value['total'] ?></td>
<tr>
</tbody>
<?php } ?>
</table>
</div>
</center><br>
</div>
</div>
<table cellpadding="0" cellspacing="0" width="100%" border="0" style="border-collapse: collapse;">
<tbody>
<tr>
<td align="center" style="padding: 25px 0;">
<p style="color: #555555; font-size: 16px; line-height: 140%; margin: 0; padding: 0;">
<span style="font-size: 14px;font-family:'Roboto',sans-serif;">If you got any questions for us, drop us a not at <a href="http://www.xxxx.co.uk/" style="text-decoration: none; color: #3392ea;" target="_blank" rel="noopener">http://www.xxxx.co.uk/</a> or call us on (123) 456-7890 . </span>
</p>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<table cellpadding="0" cellspacing="0" width="100%" style="border-collapse: collapse; max-width: 600px;" align="center">
<tbody>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</body>
</html>
\ No newline at end of file
......@@ -87,63 +87,64 @@ public function get_all_Pos_booking() {
$status = "<button type='button' class='btn btn-secondary'>New Booking</button>";
}
array_push($data, array(
$r->cust_id,
$r->book_id,
$r->customer_name,
$r->customer_phone,
$r->cost,
(isset($r->est_delivery) && !empty($r->est_delivery))?$r->est_delivery:'--',
$status,
$action
));
}
array_push($data, array(
$r->cust_id,
$r->book_id,
// $r->customer_name,
// $r->customer_phone,
$r->unique_name,
$r->cost,
(isset($r->est_delivery) && !empty($r->est_delivery))?$r->est_delivery:'--',
$status,
$action
));
}
echo json_encode(array('recordsFiltered' => $filtered, 'recordsTotal' => $recordsTotal, 'data' => $data));
}
public function getbookDetails(){
$resArr = array('status'=>"error");
if(!isset($_POST)||empty($_POST)||!isset($_POST['bookId'])||empty($_POST['bookId'])){
echo json_encode($resArr);exit;
}
if(!isset($_POST)||empty($_POST)||!isset($_POST['bookId'])||empty($_POST['bookId'])){
echo json_encode($resArr);exit;
}
$posData = $this->Pos_booking_model->getbookdetails($_POST['bookId']);
$posData = $this->Pos_booking_model->getbookdetails($_POST['bookId']);
if(empty($posData)){
echo json_encode($resArr);exit;
}
$resArr['status'] = 1;
$resArr['data'] = $posData;
if(empty($posData)){
echo json_encode($resArr);exit;
}
$resArr['status'] = 1;
$resArr['data'] = $posData;
echo json_encode($resArr);exit;
}
public function changeOrderStatus(){
$resArr = array('status'=>"error");
if(!isset($_POST)||empty($_POST)||!isset($_POST['bookingId'])||empty($_POST['bookingId']) || !isset($_POST['status'])||empty($_POST['status']) || !isset($_POST['expected_date'])||empty($_POST['expected_date'])){
echo json_encode($resArr);exit;
}
$posData = $this->Pos_booking_model->changeOrderStatus($_POST);
if(empty($posData)){
echo json_encode($resArr);exit;
}
$resArr['status'] = 1;
if(!isset($_POST)||empty($_POST)||!isset($_POST['bookingId'])||empty($_POST['bookingId']) || !isset($_POST['status'])||empty($_POST['status']) || !isset($_POST['expected_date'])||empty($_POST['expected_date'])){
echo json_encode($resArr);exit;
}
$posData = $this->Pos_booking_model->changeOrderStatus($_POST);
if(empty($posData)){
echo json_encode($resArr);exit;
}
$resArr['status'] = 1;
echo json_encode($resArr);exit;
}
public function getExpressDetails(){
$resArr = array('status'=>"error");
if(!isset($_POST)||empty($_POST)||!isset($_POST['bookId'])||empty($_POST['bookId'])){
echo json_encode($resArr);exit;
}
$posData = $this->Pos_booking_model->getExpressDetails($_POST['bookId']);
if(empty($posData)){
echo json_encode($resArr);exit;
}
$resArr['status'] = "success";
$resArr['data'] = $posData;
if(!isset($_POST)||empty($_POST)||!isset($_POST['bookId'])||empty($_POST['bookId'])){
echo json_encode($resArr);exit;
}
$posData = $this->Pos_booking_model->getExpressDetails($_POST['bookId']);
if(empty($posData)){
echo json_encode($resArr);exit;
}
$resArr['status'] = "success";
$resArr['data'] = $posData;
echo json_encode($resArr);exit;
}
......
......@@ -130,8 +130,8 @@ public function get_all_Pos_request() {
array_push($data, array(
$r->id,
$r->posReq_id,
$r->customer_name,
$r->customer_phone,
// $r->customer_name,
// $r->customer_phone,
$r->unique_name,
$status,
$action
......
......@@ -51,8 +51,9 @@
<tr>
<th>No</th>
<th>Booking ID</th>
<th>Customer Name</th>
<th>Customer PhoneNo</th>
<!-- <th>Customer Name</th>
<th>Customer PhoneNo</th> -->
<th>Product Name</th>
<th>Cost</th>
<th>Delivery Date</th>
<th>Status</th>
......@@ -91,14 +92,12 @@
jQuery('[id="modal_content"]').html('Something went wrong, please try again later...!');
return false;
}
var resp_data = jQuery.parseJSON(resp);
if(resp_data['status'] == '0'){
remModalLoader();
jQuery('[id="modal_content"]').html('Something went wrong, Please try again later...!');
return false;
}
var issueHtml = '';
issueHtml += '<form id="customQuote" role="form" method="post">'+
'<div class="col-md-12" style="padding-top:10px">'+
......@@ -120,37 +119,37 @@
'</div>'+
'</div>'+
'</div>'+
'<div class="col-md-12" style="padding-top:20px;">'+
'<div class="row"><label><b>Customer Details</b></label></div>'+
'<div class="row">'+
'<div class="col-md-6">'+
'<div class="row">'+
'<div class="col-md-6">Customer Name</div>'+
'<div class="col-md-1">:</div>'+
'<div class="col-md-4"><label>'+resp_data['data'].customer_name+'</label></div>'+
'</div> '+
'<div class="row"> '+
'<div class="col-md-6">Customer Ph No</div>'+
'<div class="col-md-1">:</div>'+
'<div class="col-md-4"><label>'+resp_data['data'].phone_no+'</label></div> '+
'</div> '+
'</div>'+
'<div class="col-md-6">'+
'<div class="row"> '+
'<div class="col-md-6">Customer Location</div>'+
'<div class="col-md-1">:</div>'+
'<div class="col-md-4"><label>'+resp_data['data'].area+'</label></div> '+
'</div> '+
'</div>'+
'<div class="col-md-12">'+
'<div class="row"> '+
'<div class="col-md-3">Customer Address</div>'+
'<div class="col-md-1">:</div>'+
'<div class="col-md-8"><label>'+resp_data['data'].name+', '+resp_data['data'].house_no+', '+resp_data['data'].area+', '+resp_data['data'].city+', '+resp_data['data'].district+', '+resp_data['data'].country+'</label></div> '+
'</div> '+
'</div>'+
'</div>'+
'</div> '+
// '<div class="col-md-12" style="padding-top:20px;">'+
// '<div class="row"><label><b>Customer Details</b></label></div>'+
// '<div class="row">'+
// '<div class="col-md-6">'+
// '<div class="row">'+
// '<div class="col-md-6">Customer Name</div>'+
// '<div class="col-md-1">:</div>'+
// '<div class="col-md-4"><label>'+resp_data['data'].customer_name+'</label></div>'+
// '</div> '+
// '<div class="row"> '+
// '<div class="col-md-6">Customer Ph No</div>'+
// '<div class="col-md-1">:</div>'+
// '<div class="col-md-4"><label>'+resp_data['data'].phone_no+'</label></div> '+
// '</div> '+
// '</div>'+
// '<div class="col-md-6">'+
// '<div class="row"> '+
// '<div class="col-md-6">Customer Location</div>'+
// '<div class="col-md-1">:</div>'+
// '<div class="col-md-4"><label>'+resp_data['data'].area+'</label></div> '+
// '</div> '+
// '</div>'+
// '<div class="col-md-12">'+
// '<div class="row"> '+
// '<div class="col-md-3">Customer Address</div>'+
// '<div class="col-md-1">:</div>'+
// '<div class="col-md-8"><label>'+resp_data['data'].name+', '+resp_data['data'].house_no+', '+resp_data['data'].area+', '+resp_data['data'].city+', '+resp_data['data'].district+', '+resp_data['data'].country+'</label></div> '+
// '</div> '+
// '</div>'+
// '</div>'+
// '</div> '+
'<div class="col-md-12" style="padding-top:20px;">'+
'<div class="row"><label><b>Vehicle Details</b></label></div>'+
'<div class="row">'+
......@@ -329,7 +328,6 @@ function changeOrderStatus(e){
jQuery('[id="modal_content"]').html('Something went wrong, please try again later...!');
return false;
}
var resp_data = jQuery.parseJSON(resp);
console.log(resp_data);
if(resp_data['status'] == 'error'){
......@@ -337,7 +335,6 @@ function changeOrderStatus(e){
jQuery('[id="modal_content"]').html('Something went wrong, Please try again later...!');
return false;
}
var issueHtml = '';
issueHtml += '<form id="customQuote" role="form" method="post">'+
'<div class="col-md-12" style="padding-top:10px">'+
......
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