Commit 486d8dd4 by Jansa Jose

forgot password

parent 1ed94e03
......@@ -78,13 +78,9 @@ public function getBookedService($postData = array(),$start = '',$per_page = '',
$where['BUK.booking_id'] = $postData['service_id'];
}
if($type == 1){
//$where['BUK.scheduled_date'] = date('Y-m-d');
$this->db->where('BUK.scheduled_date >=', date('Y-m-d'));
$this->db->order_by('BUK.scheduled_date','ASC');
}
// else if($type == 2){
// $where['BUK.scheduled_date'] = date("Y-m-d", strtotime('tomorrow'));
// }
$this->db->select("BUK.scheduled_date as date,BUK.scheduled_time as time,BUK.booking_id as service_id,BUK.status,CSTVEH.car_name,BUK.mileage,BUK.issues_selected,BUK.custom_issue_data,BUK.service_type as type,MCHBUK.amount,BUK.cost,TRIM(CONCAT(CUST.first_name,' ' ,IFNULL(CUST.last_name,''))) as customer_name,CUST.phone as phone_number,CSTVEH.vehicle_data,CSTVEH.car_loc_lat as cust_lat,CSTVEH.car_loc_lng as cust_lng,CSTVEH.car_location as cust_address");
$this->db->from('bookings as BUK');
......@@ -104,10 +100,8 @@ public function getBookedService($postData = array(),$start = '',$per_page = '',
foreach ($bookData as $key => $value) {
$issues_selected = json_decode($value['issues_selected']);
$custom_issue_data = json_decode($value['custom_issue_data']);
$bookData[$key]['trim'] = json_decode($value['vehicle_data'])->trim;
$bookData[$key]['engine_no'] = json_decode($value['vehicle_data'])->engine;
$bookData[$key]['service_image'] = (isset($custom_issue_data->optionalImages))?$custom_issue_data->optionalImages:[];
$bookData[$key]['service_message'] = (isset($custom_issue_data->optionlaDescription))?$custom_issue_data->optionlaDescription:'';
$bookData[$key]['total_amount'] = ($value['type'] == '1')?$value['amount']:$value['cost'];
......@@ -116,10 +110,10 @@ public function getBookedService($postData = array(),$start = '',$per_page = '',
$new = array();
foreach ($issues_selected as $issue_key => $issue_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='".$postData['mechanic_id']."' AND MI.status='1')
WHERE IC.status='1' AND IC.issue_cat_id='".$issue_value->sub_issue_id."'";
FROM issues_category AS IC
LEFT JOIN mechanic_issues AS MI ON (MI.issue_cat_id=IC.issue_cat_id
AND MI.mechanic_id='".$postData['mechanic_id']."' AND MI.status='1')
WHERE IC.status='1' AND IC.issue_cat_id='".$issue_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 != ''){
......@@ -154,7 +148,10 @@ public function mechanic_logout($mechanic_id){
public function forgot_password($username){
$respArr = array('status'=>'error');
$result = $this->db->query("SELECT MCH.phone as phone_number,AU.username as user_name FROM admin_users AS AU INNER JOIN mechanic AS MCH ON MCH.mechanic_id = AU.id WHERE AU.username LIKE '$username'");
$result = $this->db->query("SELECT MCH.phone AS phone_number,AU.username AS user_name
FROM admin_users AS AU
INNER JOIN mechanic AS MCH ON MCH.mechanic_id = AU.id
WHERE AU.username LIKE '$username'");
if(empty($result) || $result->num_rows() < 0 || empty($result = $result->row())){
$respArr['message'] = "Username Doesnot Exist";
return $respArr;
......@@ -167,7 +164,8 @@ public function forgot_password($username){
public function change_password($postData = array()){
$respArr = array('status'=>'error');
$result = $this->db->query("SELECT * FROM admin_users WHERE username LIKE '".$postData['user_name']."'");
$result = $this->db->query("SELECT * FROM admin_users
WHERE username LIKE '".$postData['user_name']."'");
if(empty($result) || $result->num_rows() < 0 || empty($result = $result->row())){
$respArr['message'] = "Username doesnot Exist";
return $respArr;
......
......@@ -725,8 +725,8 @@ class Webservice_model extends CI_Model {
$this->db->query("UPDATE orders JOIN transaction ON transaction.booking_id = orders.order_id SET orders.status = $odr_status WHERE transaction.bulk_bkng_unqId = '".$bookData->bulk_bkng_unqId."'");
}else if($payfor == '1'){
$this->db->query("UPDATE bookings
JOIN transaction ON transaction.booking_id=bookings.booking_id
SET bookings.status = $status WHERE transaction.id = $transId");
JOIN transaction ON transaction.booking_id=bookings.booking_id
SET bookings.status = $status WHERE transaction.id = $transId");
}
return 1;
}
......@@ -866,10 +866,11 @@ class Webservice_model extends CI_Model {
}else{
$respArr['data']->reviews['data'] = [];
$respArr['data']->reviews['meta'] = array(
'total_pages' => $totalPages,
'total' => $total,
'current_page' => ($page == 0)?1:$page,
'per_page' => $per_page);
'total_pages' => $totalPages,
'total' => $total,
'current_page' => ($page == 0)?1:$page,
'per_page' => $per_page
);
}
}
return $respArr;
......@@ -1580,6 +1581,7 @@ class Webservice_model extends CI_Model {
$respArr['message'] = "success";
$respArr['data']['phone_number'] = $custData['phone'];
$respArr['data']['email'] = $custData['email'];
$respArr['data']['country_code'] = $custData['country_code'];
}
return $respArr;
}
......
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