Commit 32eb1a35 by Jansa Jose

remove unwanted spaces

parent 59bb4dce
......@@ -7,12 +7,10 @@ class Bookings extends CI_Controller {
parent::__construct();
date_default_timezone_set("Asia/Kolkata");
$this->load->model('Booking_model');
if(!$this->session->userdata('logged_in')) {
redirect(base_url('Login'));
}
}
public function listBookings($mechanic_id = ''){
if(!empty($mechanic_id)){
$mechanic_id = (!is_numeric($mechanic_id))?decode_param($mechanic_id):$mechanic_id;
......@@ -28,31 +26,25 @@ class Bookings extends CI_Controller {
} else {
$mechanic_id = $this->session->userdata('id');
}
$template['page'] = 'Bookings/list-booking';
$template['pTitle'] = "View Bookings";
$template['pDescription'] = "View and Manage Bookings";
$template['menu'] = "Bookings Management";
$template['smenu'] = "View Bookings";
$template['mechanic_id'] = ($this->session->userdata('user_type')==1 &&
empty($mechanic_id))?'':$mechanic_id;
$template['mechanic_data'] = $mechanic_data;
$template['bookingData'] = $this->Booking_model->getMechBookings($mechanic_id,'','0,1,3,4');
//pr($template['bookingData']);
$this->load->view('template',$template);
}
public function changeBookingStatus($booking_id = '', $status = '', $mechanic_id = ''){
$flashMsg = array('message'=>'Something went wrong, please try again..!','class'=>'error');
$mechanic_id = ($this->session->userdata('user_type') == 1 && !empty($mechanic_id))?$mechanic_id:'';
if(empty($booking_id) || $status == ''){
$this->session->set_flashdata('message',$flashMsg);
redirect(base_url('Bookings/listBookings/'.$mechanic_id));
}
$booking_id = decode_param($booking_id);
$status = $this->Booking_model->changeStatus($booking_id,$status);
if(!$status){
......@@ -70,7 +62,6 @@ class Bookings extends CI_Controller {
$booking_id = decode_param($_POST['booking_id']);
$mechanic_id = ($this->session->userdata('user_type')==2)?$this->session->userdata('id'):'';
$bookingData = $this->Booking_model->getMechBookings($mechanic_id,$booking_id,'0,1,3,4');
if(!empty($bookingData)){
$return_arr['status'] = 1;
$return_arr['data'] = $bookingData;
......@@ -82,11 +73,9 @@ class Bookings extends CI_Controller {
public function insertCustomQuote(){
$return_arr = array('status'=>'error');
parse_str($_POST['data'], $output);
if(!isset($output) || empty($output)){
echo json_encode($return_arr);exit;
}
$return_arr = $this->Booking_model->insertCustomQuote($output);
echo json_encode($return_arr);exit;
}
......@@ -112,13 +101,11 @@ class Bookings extends CI_Controller {
if(empty($bookingData)){
return;
}
$header = array('Booking ID','Name','Current Milage','Service Free','Scheduled Date','Scheduled Time','Customer Phone','Customer Mail','Car Name','Car Model','Car Model Year','Car Location','Selected Issue','Status','Mechanic Name');
$file = 'bookData_'.time().'.csv';
$fpoint = fopen('php://memory', 'w');
fputcsv($fpoint, $header, ',');
foreach($bookingData AS $mechanic){
$new = array();
$bookData = $this->Booking_model->getMechBookings($mechanic_id,$mechanic->booking_id,'0,1,3,4');
......@@ -134,7 +121,6 @@ class Bookings extends CI_Controller {
case '4': $status = 'Cancelled';break;
case '5': $status = 'Payment Processing';break;
}
$data = array();
$data[] = $mechanic->booking_id;
$data[] = $bookData->custFirstName.' '.$mechanic->custLastName;
......@@ -153,7 +139,6 @@ class Bookings extends CI_Controller {
if($bookData->status == '1'){
$data[] = $bookData->mechanic_data[0]->first_name.' '.$bookData->mechanic_data[0]->last_name;
}
fputcsv($fpoint, $data, ',');
}
fseek($fpoint, 0);
......
......@@ -19,7 +19,6 @@ class Brand extends CI_Controller {
$template['pDescription'] = "Add Brand";
$template['menu'] = "Brand Management";
$template['smenu'] = "View Brands";
$template['brand_data'] = $this->Brand_model->getbrand();
$this->load->view('template',$template);
}
......@@ -30,7 +29,6 @@ class Brand extends CI_Controller {
$template['smenu'] = 'View brands';
$template['pTitle'] = "View brands";
$template['pDescription'] = "View and Manage brands";
$template['brand_data'] = $this->Brand_model->getbrand('',1);
$this->load->view('template',$template);
}
......@@ -60,7 +58,6 @@ class Brand extends CI_Controller {
$err = 1;
$errMsg = 'Provide a brand Name';
}
if($err == 0){
$config = set_upload_service("assets/uploads/brands");
$this->load->library('upload');
......@@ -74,13 +71,11 @@ class Brand extends CI_Controller {
$_POST['brand_logo'] = $config['upload_path']."/".$upload_data['file_name'];
}
}
if($err == 1){
$flashMsg['message'] = $errMsg;
$this->session->set_flashdata('message',$flashMsg);
redirect(base_url('Brand/addbrand'));
}
$status = $this->Brand_model->addbrand($_POST);
if($status == 1){
$flashMsg =array('message'=>'Successfully Updated brand Details..!','class'=>'success');
......@@ -98,13 +93,11 @@ class Brand extends CI_Controller {
$this->session->set_flashdata('message',$flashMsg);
redirect(base_url('Brand/viewBrand'));
}
$template['page'] = 'Brand/addBrand';
$template['menu'] = 'brand Management';
$template['smenu'] = 'Edit brand';
$template['pTitle'] = "Edit brand";
$template['pDescription'] = "Update brand Data";
$template['brand_id'] = encode_param($brand_id);
$template['brand_data'] = $this->Brand_model->getbrand($brand_id,1);
$this->load->view('template',$template);
......@@ -126,7 +119,6 @@ class Brand extends CI_Controller {
$err = 1;
$errMsg = 'Provide a brand Name';
}
if($err == 0){
$config = set_upload_service("assets/uploads/brands");
$this->load->library('upload');
......@@ -137,13 +129,11 @@ class Brand extends CI_Controller {
$_POST['brand_logo'] = $config['upload_path']."/".$upload_data['file_name'];
}
}
if($err == 1){
$flashMsg['message'] = $errMsg;
$this->session->set_flashdata('message',$flashMsg);
redirect(base_url('Brand/addbrand'));
}
$status = $this->Brand_model->updateBrand(decode_param($brand_id),$_POST);
if($status == 1){
$flashMsg =array('message'=>'Successfully Updated brand Details..!','class'=>'success');
......
......@@ -8,11 +8,9 @@ class Customer extends CI_Controller {
date_default_timezone_set("Asia/Kolkata");
$this->load->model('Customer_model');
$this->load->model('Vehicle_model');
if(!$this->session->userdata('logged_in')) {
redirect(base_url('Login'));
}
if($this->session->userdata['user_type'] != 1){
redirect(base_url());
}
......@@ -20,10 +18,8 @@ class Customer extends CI_Controller {
public function addCustomerUser(){
$template['page'] = 'Customer/add-customer-user';
$template['pTitle'] = "Add New Customer";
$template['pDescription'] = "Create New Customer";
$template['menu'] = "Customer Management";
$template['smenu'] = "Add Customer";
$template['veh_data']['make'] = $this->Vehicle_model->getVehBrand('',1);
......@@ -33,13 +29,10 @@ class Customer extends CI_Controller {
public function listCustomerUsers(){
$template['page'] = 'Customer/list-customer-users';
$template['pTitle'] = "View Customers";
$template['pDescription'] = "View and Manage Customers";
$template['menu'] = "Customer Management";
$template['smenu'] = "View Customers";
$template['customerData'] = $this->Customer_model->getCustomer();
$this->load->view('template',$template);
}
......@@ -101,7 +94,6 @@ class Customer extends CI_Controller {
}
$saved_vehicles = (!empty($_POST['saved_vehicles']))?implode(',',$_POST['saved_vehicles']):'';
unset($_POST['saved_vehicles']);
$status = $this->Customer_model->createCustomer($_POST,$saved_vehicles);
if($status == 1){
$flashMsg['class'] = 'success';
......@@ -121,7 +113,6 @@ class Customer extends CI_Controller {
public function calculateAge($birthDate = ''){
if(empty($birthDate))
return;
$birthDate = explode("/", $birthDate);
$age = (date("md", date("U", mktime(0, 0, 0, $birthDate[0], $birthDate[1], $birthDate[2]))) > date("md")
? ((date("Y") - $birthDate[2]) - 1)
......@@ -163,21 +154,16 @@ class Customer extends CI_Controller {
$this->session->set_flashdata('message',$flashMsg);
redirect(base_url('Customer/listCustomerUsers'));
}
$template['page'] = 'Customer/add-customer-user';
$template['menu'] = "Customer Management";
$template['smenu'] = "Edit Customer";
$template['pDescription'] = "Edit Customer Details";
$template['pTitle'] = "Edit Customer";
$template['customer_id'] = $customer_id;
$template['veh_data']['make'] = $this->Vehicle_model->getVehBrand('',1);
$template['veh_data']['model'] = $this->Vehicle_model->getVehModel('',1);
$customer_id = decode_param($customer_id);
$template['customer_data']=$this->Customer_model->getCustomer(array('customer_id'=>$customer_id));
$template['customer_data'] = $this->Customer_model->getCustomer(array('customer_id'=>$customer_id));
$this->load->view('template',$template);
}
......@@ -188,7 +174,6 @@ class Customer extends CI_Controller {
redirect(base_url('Customer/listCustomerUsers'));
}
$customerIdDec = decode_param($customer_id);
$err = 0;
$errMsg = '';
if(!isset($_POST) || empty($_POST)){
......@@ -219,7 +204,6 @@ class Customer extends CI_Controller {
$err = 1;
$errMsg = 'Provide an Address';
}
if($err == 1){
$flashMsg['message'] = $errMsg;
$this->session->set_flashdata('message',$flashMsg);
......@@ -235,7 +219,6 @@ class Customer extends CI_Controller {
}
$saved_vehicles = (!empty($_POST['saved_vehicles']))?implode(',',$_POST['saved_vehicles']):'';
unset($_POST['saved_vehicles']);
$status = $this->Customer_model->updateCustomer($customerIdDec,$_POST,$saved_vehicles);
if($status == 1){
$flashMsg['class'] = 'success';
......@@ -254,19 +237,15 @@ class Customer extends CI_Controller {
public function exportCustomerData(){
$custData = $this->Customer_model->getCustomer();
if(empty($custData)){
return;
}
$header = array('ID','Name','Phone','Email','Address','Date Of Birth','Status','Cars');
$file = 'custData_'.time().'.csv';
$fpoint = fopen('php://memory', 'w');
fputcsv($fpoint, $header, ',');
foreach($custData AS $customer){
$carData = $this->Customer_model->getCustomer(array('customer_id'=>$customer->customer_id));
$cars = '';
$data = array();
if(!empty($carData->vehicle_data)){
......@@ -283,7 +262,6 @@ class Customer extends CI_Controller {
$data[] = $customer->date_of_birth;
$data[] = ($customer->status == 1)?'Active':'De-active';
$data[] = $cars;
fputcsv($fpoint, $data, ',');
}
fseek($fpoint, 0);
......
......@@ -17,7 +17,6 @@ class Dashboard extends CI_Controller {
$template['page'] = 'Dashboard/Dashboard';
$template['page_desc'] = "Control Panel";
$template['page_title'] = "Dashboard";
$template['bookingCount'] = $this->Dashboard_model->getBookingCount();
$template['shopCount'] = $this->Dashboard_model->getMechShpCount();
$template['completeBukngCnt'] = $this->Dashboard_model->getCompletedBookingCount();
......@@ -27,7 +26,6 @@ class Dashboard extends CI_Controller {
$template['customerCount'] = $this->Dashboard_model->getCustomerCount();
$template['productCount'] = $this->Dashboard_model->getProductCount();
$template['productSold'] = $this->Dashboard_model->getProductSoldCount();
$this->load->view('template',$template);
}
......
......@@ -7,7 +7,6 @@ class ImportData extends CI_Controller {
parent::__construct();
date_default_timezone_set("Asia/Kolkata");
$this->load->model('Import_model');
if(!$this->session->userdata('logged_in')) {
redirect(base_url('Login'));
}
......@@ -20,8 +19,7 @@ class ImportData extends CI_Controller {
$template['pTitle'] = "Import Data";
$template['import_id'] = '';
$template['pDescription'] = "Import Data";
$this->load->view('template',$template);
$this->load->view('template',$template);
}
public function importCsvData(){
......@@ -30,13 +28,11 @@ class ImportData extends CI_Controller {
$this->session->set_flashdata('message', $flashMsg);
redirect(base_url('ImportData/import_data'));
}
if(!isset($_FILES) || empty($_FILES)){
$flashMsg = array('message'=>'Select a File to Upload','class'=>'error');
$this->session->set_flashdata('message', $flashMsg);
redirect(base_url('ImportData/import_data'));
}
if($_POST['import_id'] == '1'){
$this->addMechanics($_FILES);
}else if($_POST['import_id'] == '2'){
......@@ -50,7 +46,6 @@ class ImportData extends CI_Controller {
$this->load->model('Mechanic_model');
if(isset($files) && !empty($files)){
$filename = $files["file"]["tmp_name"];
if(pathinfo($files["file"]['name'], PATHINFO_EXTENSION) == "csv"){
$count = 0;
$respMsg = '';
......@@ -65,7 +60,6 @@ class ImportData extends CI_Controller {
if($count == 1){
continue;
}
if($err == 0 && (!isset($mechData[0]) || empty($mechData[0]))){
$err = 1;
$errMsg = 'Provide a First Name';
......@@ -109,19 +103,16 @@ class ImportData extends CI_Controller {
$err = 1;
$errMsg = 'Provide proper Working Hours';
}
$fnLocation = getLocationLatLng($mechData[9]);
if(empty($fnLocation)){
$err = 1;
$errMsg = 'Provide a Valid Functional Area';
}
if($err == 1){
$respError++;
$respMsg .= '<br>ERROR : Row-'.($count-1).', '.$errMsg;
continue;
}
$mechData[2] = md5($mechData[2]);
$new = array(
'first_name'=>$mechData[0],
......@@ -180,10 +171,8 @@ class ImportData extends CI_Controller {
public function addCustomers($files=array()){
$this->load->model('Customer_model');
if(isset($files) && !empty($files)){
$filename=$files["file"]["tmp_name"];
if(pathinfo($files["file"]['name'], PATHINFO_EXTENSION) =="csv"){
$count = 0;
$respMsg = '';
......@@ -198,7 +187,6 @@ class ImportData extends CI_Controller {
if($count == 1){
continue;
}
if($err == 0 && (!isset($custData[0]) || empty($custData[0]))){
$err = 1;
$errMsg = 'Provide a First Name';
......@@ -227,13 +215,11 @@ class ImportData extends CI_Controller {
$err = 1;
$errMsg = 'Provide an Address';
}
if($err == 1){
$respError++;
$respMsg .= '<br>ERROR : Row-'.($count-1).', '.$errMsg;
continue;
}
$custData[6] = md5($custData[6]);
$new = array(
'first_name'=>$custData[0],
......@@ -246,7 +232,6 @@ class ImportData extends CI_Controller {
'profile_image'=>'',
);
$status = $this->Customer_model->createCustomer($new);
if($status == 1){
$respSuccess++;
}else if($status == 2){
......@@ -257,11 +242,9 @@ class ImportData extends CI_Controller {
$respMsg .= '<br>ERROR : Row-'.($count-1).', Phone Number already in use. ';
}
}
if($count > 0){
$respMsg = "Successfully Uploaded File with, ".
$respSuccess.": Success & ".$respError.": Errors.<br>".$respMsg;
$flashMsg = array('message'=>$respMsg,'class'=>($respError==$count-1)?'error':'success');
$this->session->set_flashdata('message', $flashMsg);
redirect(base_url('ImportData/import_data'));
......@@ -275,10 +258,8 @@ class ImportData extends CI_Controller {
}
public function addProduct($files =array()){
if(isset($files) && !empty($files)){
$filename=$files["file"]["tmp_name"];
if(pathinfo($files["file"]['name'], PATHINFO_EXTENSION) =="csv"){
$count = 0;
$respMsg = '';
......@@ -293,7 +274,6 @@ class ImportData extends CI_Controller {
if($count == 1){
continue;
}
if($err == 0 && (!isset($prdData[0]) || empty($prdData[0]))){
$err = 1;
$errMsg = 'Provide a Product Name';
......@@ -334,13 +314,11 @@ class ImportData extends CI_Controller {
$err = 1;
$errMsg = 'About Produt';
}
if($err == 1){
$respError++;
$respMsg .= '<br>ERROR : Row-'.($count-1).', '.$errMsg;
continue;
}
$brand_id = $this->Import_model->checkBrand($prdData[1]);
$cardetail_id = $this->Import_model->checkCardetails($prdData[5],$prdData[6],$prdData[7]);
$new = array(
......@@ -364,7 +342,6 @@ class ImportData extends CI_Controller {
if($count > 0){
$respMsg = "Successfully Uploaded File with, ".
$respSuccess.": Success & ".$respError.": Errors.<br>".$respMsg;
$flashMsg = array('message'=>$respMsg,'class'=>($respError==$count-1)?'error':'success');
$this->session->set_flashdata('message', $flashMsg);
redirect(base_url('ImportData/import_data'));
......@@ -376,7 +353,5 @@ class ImportData extends CI_Controller {
}
}
}
}
......@@ -7,7 +7,6 @@ class Issue extends CI_Controller {
parent::__construct();
date_default_timezone_set("Asia/Kolkata");
$this->load->model('Issue_model');
if(!$this->session->userdata('logged_in')) {
redirect(base_url());
}
......@@ -19,7 +18,6 @@ class Issue extends CI_Controller {
$template['smenu'] = 'Add Issue';
$template['pTitle'] = "Add Issue";
$template['pDescription'] = "Create New Issue";
$this->load->view('template',$template);
}
......@@ -29,7 +27,6 @@ class Issue extends CI_Controller {
$template['smenu'] = 'View Issues';
$template['pTitle'] = "View Issues";
$template['pDescription'] = "View and Manage Issues";
$template['issue_data'] = $this->Issue_model->getIssues('',1);
$this->load->view('template',$template);
}
......@@ -90,7 +87,6 @@ class Issue extends CI_Controller {
if($err == 0){
$typ = 0;
$insertSubTyp = array();
for ($typ = 0; $typ < count($_POST['issue_category']); $typ++) {
if(!isset($_POST['issue_category'][$typ]) ||
!isset($_POST['default_description'][$typ]) ||
......@@ -104,7 +100,6 @@ class Issue extends CI_Controller {
$_FILES['file']['size'] = $files['issue_cat_image']['size'][$typ];
$_FILES['file']['error'] = $files['issue_cat_image']['error'][$typ];
$_FILES['file']['tmp_name'] = $files['issue_cat_image']['tmp_name'][$typ];
if(!$this->upload->do_upload('file')){
$err = 1;
$errMsg = $this->upload->display_errors();
......@@ -112,7 +107,6 @@ class Issue extends CI_Controller {
}
$imgData = $this->upload->data();
$image_name = "assets/uploads/services/".$imgData['file_name'];
$insertSubTyp[] = array('issue_category' => $_POST['issue_category'][$typ],
'issue_cat_image' => $image_name,'status'=>'1',
'default_service_fee' => $_POST['default_service_fee'][$typ],
......@@ -121,7 +115,6 @@ class Issue extends CI_Controller {
unset($_POST['issue_category']);
unset($_POST['default_service_fee']);
unset($_POST['default_description']);
if($this->upload->do_upload('issue_image')){
$imgData = $this->upload->data();
$_POST['issue_image'] = "assets/uploads/services/".$imgData['file_name'];
......@@ -153,13 +146,11 @@ class Issue extends CI_Controller {
$this->session->set_flashdata('message',$flashMsg);
redirect(base_url('Issue/viewIssues'));
}
$template['page'] = 'Issue/issueForm';
$template['menu'] = 'Issue Management';
$template['smenu'] = 'Edit Issue';
$template['pTitle'] = "Edit Issue";
$template['pDescription'] = "Update Issue Data";
$template['issue_id'] = encode_param($issue_id);
$template['issue_data'] = $this->Issue_model->getIssueDetails($issue_id,1);
if(empty($template['issue_data'])){
......@@ -174,7 +165,6 @@ class Issue extends CI_Controller {
$errMsg = 'Something went wrong, please try again..!';
$this->load->library('upload',set_upload_service("assets/uploads/services"));
$flashMsg = array('message'=>'Something went wrong, please try again..!','class'=>'error');
if(empty($issue_id) || !is_numeric($issue_id = decode_param($issue_id))){
$this->session->set_flashdata('message',$flashMsg);
redirect(base_url('Issue/viewIssues'));
......@@ -186,7 +176,6 @@ class Issue extends CI_Controller {
$err = 1;
$errMsg = 'Provide Issue Short Discription';
}
$insertSubTyp = array();
$updateSubTyp = array();
$issue_data = array('issue'=>$_POST['issue']);
......@@ -218,7 +207,6 @@ class Issue extends CI_Controller {
}
}
}
if(isset($_POST['issue_category']) && count($_POST['issue_category']) > 0 &&
isset($_POST['default_description']) && count($_POST['default_description']) > 0 &&
isset($_POST['default_service_fee']) && count($_POST['default_service_fee']) > 0 &&
......@@ -229,9 +217,7 @@ class Issue extends CI_Controller {
count($_POST['issue_category']) == count($_FILES['issue_cat_image']['name'])){
$typ = 0;
$files = $_FILES;
for ($typ = 0; $typ < count($_POST['issue_category']); $typ++) {
if(!isset($_POST['issue_category'][$typ]) ||
!isset($_POST['default_description'][$typ]) ||
!isset($_POST['default_service_fee'][$typ]) ||
......@@ -245,13 +231,11 @@ class Issue extends CI_Controller {
$_FILES['file']['size'] = $files['issue_cat_image']['size'][$typ];
$_FILES['file']['error'] = $files['issue_cat_image']['error'][$typ];
$_FILES['file']['tmp_name'] = $files['issue_cat_image']['tmp_name'][$typ];
if(!$this->upload->do_upload('file')){
continue;
}
$imgData = $this->upload->data();
$image_name = "assets/uploads/services/".$imgData['file_name'];
$insertSubTyp[] = array('issue_category' => $_POST['issue_category'][$typ],
'issue_cat_image' => $image_name,'status'=>'1',
'default_service_fee' => $_POST['default_service_fee'][$typ],
......@@ -259,20 +243,17 @@ class Issue extends CI_Controller {
'issue_id'=>$issue_id);
}
}
if(isset($_FILES['issue_image']) && !empty($_FILES['issue_image']['name']) &&
$this->upload->do_upload('issue_image')){
$imgData = $this->upload->data();
$issue_data['issue_image'] = "assets/uploads/services/".$imgData['file_name'];
}
}
if($err == 1){
$flashMsg['message'] = $errMsg;
$this->session->set_flashdata('message',$flashMsg);
redirect(base_url('Issue/editIssue/'.encode_param($issue_id)));
}
$status = $this->Issue_model->updateIssue($issue_id,$issue_data,$updateSubTyp,$insertSubTyp);
if($status == 1){
$flashMsg =array('message'=>'Successfully Updated Issue Details..!','class'=>'success');
......@@ -288,13 +269,11 @@ class Issue extends CI_Controller {
if($this->session->userdata('user_type') == 1){
redirect(base_url('Issue/viewIssues'));
}
$template['page'] = 'Issue/issueMapping';
$template['menu'] = 'Issue Management';
$template['smenu'] = 'Issue Mapping';
$template['pTitle'] = "Issue Mapping";
$template['pDescription'] = "Creating Custom Issues";
$mechanic_id = $this->session->userdata('id');
$template['issue_data'] = $this->Issue_model->getUnMappedIssues($mechanic_id,1);
$template['mechanic_id'] = encode_param($mechanic_id);
......@@ -324,7 +303,6 @@ class Issue extends CI_Controller {
$this->session->set_flashdata('message', $flashMsg);
redirect(base_url('Issue/issueMapping'));
}
$status = $this->Issue_model->addMechIssue($custom_issue);
if($status == 1){
$flashMsg =array('message'=>'Successfully Created..!','class'=>'success');
......@@ -357,7 +335,6 @@ class Issue extends CI_Controller {
$template['smenu'] = 'Manage Mapped Issues';
$template['pTitle'] = "Manage Mapped Issues";
$template['pDescription'] = "View and Manage Mapped Issues";
$template['mechanic_id'] = $mechanic_id;
$template['mechanic_data'] = $mechanic_data;
$template['mechanicIssueData'] = $this->Issue_model->getMechanicIssues($mechanic_id,'',1);
......@@ -392,12 +369,10 @@ class Issue extends CI_Controller {
$template['smenu'] = 'Edit Mechanic Issue';
$template['pTitle'] = "Edit Mechanic Issue Management";
$template['pDescription'] = "Update Custom Mechanic Issue Data";
$template['issue_id'] = encode_param($issue_id);
$template['mechanic_id'] = encode_param($mechanic_id);
$template['issue_data'] = $this->Issue_model->getIssues('',1);
$template['mechanicIssueData'] = $this->Issue_model->getMechanicIssues($mechanic_id,$issue_id,1);
if(empty($template['mechanicIssueData']) || !isset($template['mechanicIssueData'][$issue_id])){
$this->session->set_flashdata('message',$flashMsg);
redirect(base_url('Issue/viewMappedIssues/'.encode_param($mechanic_id)));
......@@ -425,7 +400,6 @@ class Issue extends CI_Controller {
$this->session->set_flashdata('message', $flashMsg);
redirect(base_url($editPage));
}
$status = $this->Issue_model->updateMechIssue($_POST['mechanic_id'],$_POST['issue_id'],$custom_issue);
if($status == 1){
$flashMsg =array('message'=>'Successfully Created..!','class'=>'success');
......@@ -436,7 +410,6 @@ class Issue extends CI_Controller {
redirect($editPage);
}
}
function getIssueDetails(){
$resArr = array('status'=>0);
......@@ -445,11 +418,9 @@ class Issue extends CI_Controller {
echo json_encode($resArr);exit;
}
$issue_data = $this->Issue_model->getIssueDetails($issue_id);
if(empty($issue_data)){
echo json_encode($resArr);exit;
}
$resArr['status'] = 1;
$resArr['data'] = $issue_data;
echo json_encode($resArr);exit;
......@@ -459,7 +430,6 @@ class Issue extends CI_Controller {
if(empty($mapping_data) || $mapping_type == ''){
return 0;
}
$custData = array();
foreach($mapping_data['issue_cat_ids'] AS $type_ids) {
$issArr = array('issue_id'=>$mapping_data['issue_id'],
......@@ -468,7 +438,6 @@ class Issue extends CI_Controller {
if($mapping_type == 1 &&
isset($mapping_data['default_service_fee_'.$type_ids]) &&
isset($mapping_data['default_description_'.$type_ids])){
$issArr['custom_description'] = $mapping_data['default_description_'.$type_ids];
$issArr['custom_service_fee'] = $mapping_data['default_service_fee_'.$type_ids];
}
......
......@@ -9,7 +9,6 @@ class Login extends CI_Controller {
$this->load->helper(array('form'));
$this->load->model('login_model');
$this->load->helper('security');
if($this->session->userdata('logged_in')) {
redirect(base_url());
}
......@@ -21,7 +20,6 @@ class Login extends CI_Controller {
$this->load->library('form_validation');
$this->form_validation->set_rules('username','Username','trim|required');
$this->form_validation->set_rules('password','Password','trim|required|callback_checkUsrLogin');
if($this->form_validation->run() == TRUE) {
redirect(base_url());
}
......@@ -32,7 +30,6 @@ class Login extends CI_Controller {
function checkUsrLogin($password) {
$username = $this->input->post('username');
$result = $this->login_model->login($username, md5($password));
if($result && !empty($result)) {
$this->session->set_userdata('id',$result->id);
$this->session->set_userdata('user',$result);
......
......@@ -7,7 +7,6 @@ class Mailtemplate extends CI_Controller {
parent::__construct();
date_default_timezone_set("Asia/Riyadh");
$this->load->model('Mailtemplate_model');
if(!$this->session->userdata('logged_in')) {
redirect(base_url('Login'));
}
......@@ -20,14 +19,12 @@ class Mailtemplate extends CI_Controller {
}
public function index() {
$template['page'] = 'Notification/notification';
$template['menu'] = "Notification Templates";
$template['smenu'] = "Change Notification Templates";
$template['pTitle'] = "Notification Templates";
$template['page_head'] = "Notification Templates";
$template['pDescription'] = "Change Notification Templates";
$template['notificationData'] = $this->Mailtemplate_model->getNotifData();
$this->load->view('template',$template);
}
......@@ -39,7 +36,6 @@ class Mailtemplate extends CI_Controller {
$this->session->set_flashdata('message',$flashMsg);
redirect(base_url($url));
}
if(!isset($_POST['customer_registration_mail']) || empty($_POST['customer_registration_mail'])){
unset($_POST['customer_registration_mail']);
}
......@@ -55,7 +51,6 @@ class Mailtemplate extends CI_Controller {
if(!isset($_POST['invoice_template']) || empty($_POST['invoice_template'])){
unset($_POST['invoice_template']);
}
$status = $this->Mailtemplate_model->updateNotif($_POST);
if($status){
$flashMsg['class'] = 'success';
......
......@@ -7,7 +7,6 @@ class Mechanic extends CI_Controller {
parent::__construct();
date_default_timezone_set("Asia/Kolkata");
$this->load->model('Mechanic_model');
if(!$this->session->userdata('logged_in')) {
redirect(base_url());
}
......@@ -21,21 +20,18 @@ class Mechanic extends CI_Controller {
$template['smenu'] = 'Add Mechanic';
$template['pTitle'] = "Add Mechanic";
$template['pDescription'] = "Create New Mechanic";
$template['shop_data'] = $this->Shop_model->getShop();
$this->load->view('template',$template);
}
public function viewMechanics(){
$this->load->model('Shop_model');
$template['page'] = 'Mechanic/viewMechanic';
$template['menu'] = 'Mechanic Management';
$template['smenu'] = 'View Mechanics';
$template['pTitle'] = "View Mechanics";
$template['pDescription'] = "View and Manage Mechanics";
$template['page_head'] = "Mechanic Management";
$template['user_data'] = $this->Mechanic_model->getMechanic('',1);
$this->load->view('template',$template);
}
......@@ -48,11 +44,9 @@ class Mechanic extends CI_Controller {
}
$view_all = (isset($_POST['view_all']) && $_POST['view_all'] == 1)?1:0;
$mechData = $this->Mechanic_model->getMechanic($mechanic_id,$view_all);
if(empty($mechData)){
echo json_encode($resArr);exit;
}
$resArr['status'] = 1;
$resArr['data'] = $mechData;
echo json_encode($resArr);exit;
......@@ -122,13 +116,11 @@ class Mechanic extends CI_Controller {
$err = 1;
$errMsg = 'Provide proper Working Hours';
}
$fnLocation = getLocationLatLng($_POST['location']);
if(empty($fnLocation)){
$err = 1;
$errMsg = 'Provide a Valid Functional Area';
}
if($err == 0){
$config = set_upload_service("assets/uploads/services");
$this->load->library('upload');
......@@ -141,7 +133,6 @@ class Mechanic extends CI_Controller {
$upload_data = $this->upload->data();
$_POST['profile_image'] = $config['upload_path']."/".$upload_data['file_name'];
}
$_POST['licence'] = '';
$config = set_upload_service("assets/uploads/services");
$this->load->library('upload');
......@@ -160,7 +151,6 @@ class Mechanic extends CI_Controller {
$_POST['password'] = md5($_POST['password']);
$_POST['location_lat'] = $fnLocation['lat'];
$_POST['location_lng'] = $fnLocation['lng'];
$status = $this->Mechanic_model->addMechanic($_POST);
if($status == 1){
$flashMsg =array('message'=>'Successfully Updated User Details..!','class'=>'success');
......@@ -191,13 +181,11 @@ class Mechanic extends CI_Controller {
redirect(base_url('Mechanic/viewMechanics'));
}
$this->load->model('Shop_model');
$template['page'] = 'Mechanic/mechanicForm';
$template['menu'] = 'Mechanic Management';
$template['smenu'] = 'Edit Mechanic';
$template['pTitle'] = "Edit Mechanics";
$template['pDescription'] = "Update Mechanic Data";
$template['user_data'] = $this->Mechanic_model->getMechanic($mechanic_id,1);
$template['mechanic_id'] = encode_param($mechanic_id);
$this->load->view('template',$template);
......@@ -248,13 +236,11 @@ class Mechanic extends CI_Controller {
$err = 1;
$errMsg = 'Provide proper Working Hours';
}
$fnLocation = getLocationLatLng($_POST['location']);
if(empty($fnLocation)){
$err = 1;
$errMsg = 'Provide a Valid Functional Area';
}
if($err == 0){
$config = set_upload_service("assets/uploads/services");
$this->load->library('upload');
......@@ -264,7 +250,6 @@ class Mechanic extends CI_Controller {
$upload_data = $this->upload->data();
$_POST['profile_image'] = $config['upload_path']."/".$upload_data['file_name'];
}
$config = set_upload_service("assets/uploads/services");
$this->load->library('upload');
$config['file_name'] = time()."_".$_FILES['licence']['name'];
......@@ -279,7 +264,6 @@ class Mechanic extends CI_Controller {
$this->session->set_flashdata('message',$flashMsg);
redirect(base_url('Mechanic/editMechanics/'.$mechanic_id));
}
$_POST['location_lat'] = $fnLocation['lat'];
$_POST['location_lng'] = $fnLocation['lng'];
$status = $this->Mechanic_model->updateMechanic(decode_param($mechanic_id),$_POST);
......@@ -312,13 +296,10 @@ class Mechanic extends CI_Controller {
}
$header = array('ID','Username','Name','Phone','Email','Address','City','State','Licence Number','Licence Exp Date','Start Time','End Time','Status','Shop Id','Shop Name','Shop Address',
'Shop Phone','Shop Email');
$file = 'mechData_'.time().'.csv';
$fpoint = fopen('php://memory', 'w');
fputcsv($fpoint, $header, ',');
foreach($mechData AS $mechanic){
$data = array();
$data[] = $mechanic->mechanic_id;
$data[] = $mechanic->username;
......
......@@ -7,21 +7,17 @@ class Orders extends CI_Controller {
parent::__construct();
date_default_timezone_set("Asia/Kolkata");
$this->load->model('Order_model');
if(!$this->session->userdata('logged_in')) {
redirect(base_url('Login'));
}
}
public function listOrders(){
$template['page'] = 'Orders/list_orders';
$template['pTitle'] = "View Orders";
$template['pDescription'] = "View and Manage Orders";
$template['menu'] = "Order Management";
$template['smenu'] = "View Orders";
$template['orderData'] = $this->Order_model->getOrders();
$this->load->view('template',$template);
}
......@@ -34,7 +30,6 @@ class Orders extends CI_Controller {
$order_id = decode_param($_POST['order_id']);
$return_arr['order_data'] = $this->Order_model->getOrderDetails($order_id);
$return_arr['product_image'] = $this->Order_model->getProductImage($order_id);
if(!empty($return_arr)){
$return_arr['status'] = 1;
echo json_encode($return_arr);exit;
......@@ -49,7 +44,6 @@ class Orders extends CI_Controller {
echo json_encode($return_arr);exit;
}
$status = $this->Order_model->changeOrderStatus($_POST);
$return_arr['status'] = $status;
echo json_encode($return_arr);exit;
}
......@@ -59,17 +53,13 @@ class Orders extends CI_Controller {
if(empty($orderData)){
return;
}
$header = array('Order ID','Name','Product Name','Brand Name','Short Description','Quantity','Amount','Status','Expected Delivery','Delivered');
$file = 'orderData_'.time().'.csv';
$fpoint = fopen('php://memory', 'w');
fputcsv($fpoint, $header, ',');
foreach($orderData AS $order){
$new = array();
$odrData = $this->Order_model->getOrderDetails($order->order_id);
$data = array();
$data[] = $odrData->format_order_id;
$data[] = $odrData->customer_name;
......
......@@ -9,7 +9,6 @@ class Product extends CI_Controller {
$this->load->model('Brand_model');
$this->load->model('Product_model');
$this->load->model('Vehicle_model');
if(!$this->session->userdata('logged_in')) {
redirect(base_url('Login'));
}
......@@ -22,7 +21,6 @@ class Product extends CI_Controller {
$template['menu'] = "Product Management";
$template['smenu'] = "View Product";
$template['brand_id'] = '';
$template['product_data'] = $this->Product_model->getProduct();
$template['veh_data']['make'] = $this->Vehicle_model->getVehBrand('',1);
$template['veh_data']['model'] = $this->Vehicle_model->getVehModel('',1);
......@@ -36,7 +34,6 @@ class Product extends CI_Controller {
$template['smenu'] = 'View Product';
$template['pTitle'] = "View Product";
$template['pDescription'] = "View and Manage Product";
$mechanic_id = ($this->session->userdata['user_type']==2)?$this->session->userdata['id']:'';
$template['product_data'] = $this->Product_model->getProduct('',1,$mechanic_id);
$this->load->view('template',$template);
......@@ -82,14 +79,12 @@ class Product extends CI_Controller {
$err = 1;
$errMsg = 'Provide a Amount';
}
if($err == 1){
$flashMsg['message'] = $errMsg;
$this->session->set_flashdata('message',$flashMsg);
redirect(base_url('Product/addproduct'));
}
$_POST['created_by']=($this->session->userdata['user_type']==2)?$this->session->userdata['id']:0;
$product_id = $this->Product_model->addProduct($_POST);
if($product_id){
$evtMediaData = array();
......@@ -103,7 +98,6 @@ class Product extends CI_Controller {
$_FILES['file']['size'] = $files['product_image']['size'][$typ];
$_FILES['file']['error'] = $files['product_image']['error'][$typ];
$_FILES['file']['tmp_name'] = $files['product_image']['tmp_name'][$typ];
$config['file_name'] = time()."_".$_FILES['file']['name'];
$this->upload->initialize($config);
if($this->upload->do_upload('file')){
......@@ -132,20 +126,17 @@ class Product extends CI_Controller {
$this->session->set_flashdata('message',$flashMsg);
redirect(base_url('Product/viewProducts'));
}
$template['page'] = 'Product/addproduct';
$template['menu'] = 'Brand Management';
$template['smenu'] = 'Edit brand';
$template['pTitle'] = "Edit brand";
$template['pDescription'] = "Update brand Data";
$template['product_id'] = encode_param($product_id);
$template['brand_data'] = $this->Brand_model->getbrand('',1);
$template['product_data'] = $this->Product_model->getProduct($product_id);
$template['veh_data']['make'] = $this->Vehicle_model->getVehBrand('',1);
$template['product_image'] = $this->Product_model->getProductImage($product_id);
$template['brand_id'] = $template['product_data']->brand_id;
$this->load->view('template',$template);
}
......@@ -180,7 +171,6 @@ class Product extends CI_Controller {
$err = 1;
$errMsg = 'Provide a Amount';
}
if($err == 1){
$flashMsg['message'] = $errMsg;
$this->session->set_flashdata('message',$flashMsg);
......@@ -202,7 +192,6 @@ class Product extends CI_Controller {
$_FILES['file']['size'] = $files['product_image']['size'][$typ];
$_FILES['file']['error'] = $files['product_image']['error'][$typ];
$_FILES['file']['tmp_name'] = $files['product_image']['tmp_name'][$typ];
$config['file_name'] = time()."_".$_FILES['file']['name'];
$this->upload->initialize($config);
if($this->upload->do_upload('file')){
......@@ -214,8 +203,6 @@ class Product extends CI_Controller {
}
$status = $this->Product_model->updateProductImage(decode_param($product_id),$evtMediaData,$existingImages);
}
}
if($status || $product){
$flashMsg =array('message'=>'Successfully Updated brand Details..!','class'=>'success');
$this->session->set_flashdata('message', $flashMsg);
......@@ -235,7 +222,6 @@ class Product extends CI_Controller {
$product_id = decode_param($_POST['product_id']);
$return_arr['product_data'] = $this->Product_model->getProduct($product_id);
$return_arr['product_image'] = $this->Product_model->getProductImage($product_id);
if(!empty($return_arr)){
$return_arr['status'] = 1;
echo json_encode($return_arr);exit;
......@@ -250,16 +236,13 @@ class Product extends CI_Controller {
if(empty($productData)){
return;
}
$header = array('Product ID','Product Name','Brand Name','Short Description','Part ID','Vehicle Model','Amount','Status');
$file = 'productData_'.time().'.csv';
$fpoint = fopen('php://memory', 'w');
fputcsv($fpoint, $header, ',');
foreach($productData AS $product){
$data = array();
$status = 'Active';
$status = 'Active';
switch ($product->status) {
case '0': $status = 'Inactive';break;
case '1': $status = 'Active ';break;
......
......@@ -8,7 +8,6 @@ class Settings extends CI_Controller {
date_default_timezone_set("Asia/Kolkata");
$this->load->model('Settings_model');
$this->load->model('Dashboard_model');
if(!$this->session->userdata('logged_in')) {
redirect(base_url('Login'));
}
......@@ -23,13 +22,10 @@ class Settings extends CI_Controller {
public function index() {
$template['page'] = 'Settings/viewSettings';
$template['menu'] = "Site Settings";
$template['sub_menu'] = "Change Settings";
$template['page_desc'] = "Edit or View Settings";
$template['page_title'] = "Settings";
$template['data'] = $this->Settings_model->settings_viewing();
$this->load->view('template',$template);
}
......@@ -60,13 +56,10 @@ class Settings extends CI_Controller {
$_POST['fav_icon'] = $config['upload_path']."/".$upload_data['file_name'];
}
}
$status = $this->Settings_model->update_settings($_POST);
if($status){
$flashMsg['class'] = 'success';
$flashMsg['message'] = 'Settings Successfully Updated..!';
$settings = $this->Settings_model->settings_viewing();
if(!empty($settings)){
$this->session->set_userdata('settings', $settings);
......@@ -75,6 +68,5 @@ class Settings extends CI_Controller {
$this->session->set_flashdata('message',$flashMsg);
redirect(base_url('Settings'));
}
}
?>
\ No newline at end of file
......@@ -7,7 +7,6 @@ class Shop extends CI_Controller {
parent::__construct();
date_default_timezone_set("Asia/Kolkata");
$this->load->model('Shop_model');
if(!$this->session->userdata('logged_in')) {
redirect(base_url());
}
......@@ -19,7 +18,6 @@ class Shop extends CI_Controller {
$template['smenu'] = 'Add Shop';
$template['pTitle'] = "Add Shop";
$template['pDescription'] = "Create New Shop";
$template['shop_data'] = $this->Shop_model->getShop();
$this->load->view('template',$template);
}
......@@ -30,7 +28,6 @@ class Shop extends CI_Controller {
$template['smenu'] = 'View Shops';
$template['pTitle'] = "View Shops";
$template['pDescription'] = "View and Manage Shops";
$template['shop_data'] = $this->Shop_model->getShop('',1);
$this->load->view('template',$template);
}
......@@ -69,13 +66,11 @@ class Shop extends CI_Controller {
$err = 1;
$errMsg = 'Provide an Address';
}
if($err == 1){
$flashMsg['message'] = $errMsg;
$this->session->set_flashdata('message',$flashMsg);
redirect(base_url('Shop/addShop'));
}
$status = $this->Shop_model->addShop($_POST);
if($status == 1){
$flashMsg =array('message'=>'Successfully Updated Shop Details..!','class'=>'success');
......@@ -93,13 +88,11 @@ class Shop extends CI_Controller {
$this->session->set_flashdata('message',$flashMsg);
redirect(base_url('Shop/viewShops'));
}
$template['page'] = 'Shop/shopForm';
$template['menu'] = 'Shop Management';
$template['smenu'] = 'Edit Shop';
$template['pTitle'] = "Edit Shop";
$template['pDescription'] = "Update Shop Data";
$template['shop_id'] = encode_param($shop_id);
$template['shop_data'] = $this->Shop_model->getShop($shop_id,1);
$this->load->view('template',$template);
......@@ -130,13 +123,11 @@ class Shop extends CI_Controller {
$err = 1;
$errMsg = 'Provide an Address';
}
if($err == 1){
$flashMsg['message'] = $errMsg;
$this->session->set_flashdata('message',$flashMsg);
redirect(base_url('Shop/addShop'));
}
$status = $this->Shop_model->updateShop(decode_param($shop_id),$_POST);
if($status == 1){
$flashMsg =array('message'=>'Successfully Updated Shop Details..!','class'=>'success');
......
......@@ -8,7 +8,6 @@ class User extends CI_Controller {
date_default_timezone_set("Asia/Kolkata");
$this->load->model('User_model');
$this->load->model('Dashboard_model');
if(!$this->session->userdata('logged_in')) {
redirect(base_url('Login'));
}
......@@ -19,11 +18,10 @@ class User extends CI_Controller {
redirect(base_url());
}
$template['shop_data'] = '';
if($this->session->userdata('user_type') == 2 && isset($this->session->userdata['mechanic_data'])
if($this->session->userdata('user_type') == 2 && isset($this->session->userdata['mechanic_data'])
&& !empty($this->session->userdata['mechanic_data'])){
$this->load->model('Shop_model');
$mechanic_data = $this->session->userdata['mechanic_data'];
if(!empty($mechanic_data->shop_id)){
$template['shop_data'] = $this->Shop_model->getShop($mechanic_data->shop_id);
}
......@@ -40,7 +38,6 @@ class User extends CI_Controller {
$this->load->model('Shop_model');
$user_id = $this->session->userdata('id');
$user_type = $this->session->userdata('user_type');
$template['page'] = 'User/editProfile';
$template['menu'] = "Profile";
$template['smenu'] = "Edit Profile";
......@@ -48,7 +45,6 @@ class User extends CI_Controller {
$template['pDescription'] = "Edit User Profile";
$template['shop_data'] = $this->Shop_model->getShop();
$template['user_data'] = $this->User_model->getUserData();
if(empty($template['user_data'])){
redirect(base_url());
}
......@@ -59,43 +55,33 @@ class User extends CI_Controller {
$user_id = $this->session->userdata('id');
$user_type = $this->session->userdata('user_type');
$flashMsg = array('message'=>'Something went wrong, please try again..!','class'=>'error');
if(empty($user_id)){
$this->session->set_flashdata('message',$flashMsg);
redirect(base_url('User/editProfile'));
}
if(isset($_FILES['profile_image']) && !empty($_FILES['profile_image'])){
$config = set_upload_service("assets/uploads/services");
$this->load->library('upload');
$new_name = time()."_".$_FILES['profile_image']['name'];
$config['file_name'] = $new_name;
$this->upload->initialize($config);
if($this->upload->do_upload('profile_image')){
$upload_data = $this->upload->data();
$_POST['profile_image'] = $config['upload_path']."/".$upload_data['file_name'];
}
}
if(isset($_FILES['licence']) && !empty($_FILES['licence'])){
$config = set_upload_service("assets/uploads/services");
$this->load->library('upload');
$new_name = time()."_".$_FILES['licence']['name'];
$config['file_name'] = $new_name;
$this->upload->initialize($config);
if($this->upload->do_upload('licence')){
$upload_data = $this->upload->data();
$_POST['licence'] = $config['upload_path']."/".$upload_data['file_name'];
}
}
if((isset($_POST['password']) || isset($_POST['cPassword'])) &&
(!empty($_POST['password']) || !empty($_POST['cPassword']))){
if($_POST['password'] != $_POST['cPassword']){
......
......@@ -7,7 +7,6 @@ class Vehicle extends CI_Controller {
parent::__construct();
date_default_timezone_set("Asia/Kolkata");
$this->load->model('Vehicle_model');
if(!$this->session->userdata('logged_in')) {
redirect(base_url());
}
......@@ -15,9 +14,7 @@ class Vehicle extends CI_Controller {
public function vehicleSearch(){
$return_arr = array('status'=>'0');
if(!isset($_POST) || empty($_POST) || !isset($_POST['searchType']) ||
empty($_POST['searchType']) || !isset($_POST['vehLocation']) ||
empty($vehLocation = $_POST['vehLocation'])){
if(!isset($_POST) || empty($_POST) || !isset($_POST['searchType']) || empty($_POST['searchType']) || !isset($_POST['vehLocation']) || empty($vehLocation = $_POST['vehLocation'])){
echo json_encode($return_arr);exit;
}
$vehTrim = $vehEngine = '';
......@@ -27,14 +24,11 @@ class Vehicle extends CI_Controller {
if(isset($_POST['vehEngine']) && !empty($_POST['vehEngine'])){
$vehEngine = $_POST['vehEngine'];
}
$url = "";
$searchType = $_POST['searchType'];
$vehicle_data = array('car_location'=>$vehLocation);
$this->load->model('Settings_model');
$settings = $this->Settings_model->settings_viewing();
if($searchType == 1 &&
isset($_POST['vehYear']) && !empty($_POST['vehYear']) &&
isset($_POST['vehModel']) && !empty($_POST['vehModel']) &&
......@@ -42,18 +36,14 @@ class Vehicle extends CI_Controller {
$vehicle_data['car_maker'] = $_POST['vehMaker'];
$vehicle_data['car_model'] = $_POST['vehModel'];
$vehicle_data['car_model_year'] = $_POST['vehYear'];
$url = "https://specifications.vinaudit.com/v3/selections?format=json&key=".
urlencode($settings['vin_audit_api'])."&id=".urlencode($_POST['vehYear'])."_".
urlencode($_POST['vehMaker'])."_".urlencode($_POST['vehModel']);
}
else
if($searchType == 2 && isset($_POST['vehVin']) && !empty($_POST['vehVin'])){
else if($searchType == 2 && isset($_POST['vehVin']) && !empty($_POST['vehVin'])){
$vehicle_data['car_vin'] = $_POST['vehVin'];
$url = "https://specifications.vinaudit.com/v3/specifications?format=json&key=".urlencode($settings['vin_audit_api'])."&vin=".urlencode($_POST['vehVin']);
}
if(!empty($url)){
$vehData=file_get_contents($url);
if(empty($vehData) || empty($vehData = json_decode($vehData,true))){
......@@ -70,23 +60,19 @@ class Vehicle extends CI_Controller {
$return_arr['status'] = 3;
echo json_encode($return_arr);exit;
}
if($searchType == 2){
$vehDetails['vehicle'] = $vehData['attributes']['year'].' '.
$vehData['attributes']['make'].' '.
$vehData['attributes']['model'].' '.
$vehData['attributes']['trim'];
$vehDetails['year'] = $vehData['attributes']['year'];
$vehDetails['make'] = $vehData['attributes']['make'];
$vehDetails['trim'] = $vehData['attributes']['trim'];
$vehDetails['model'] = $vehData['attributes']['model'];
$vehDetails['engine'] = $vehData['attributes']['engine'];
$vehicle_data['car_maker'] = $vehDetails['make'];
$vehicle_data['car_model'] = $vehDetails['model'];
$vehicle_data['car_model_year'] = $vehDetails['year'];
} else if($searchType == 1){
$vehSele = $vehData['selections'];
$vehDetails['year'] = $vehSele['years'][0]['name'];
......@@ -94,20 +80,16 @@ class Vehicle extends CI_Controller {
$vehDetails['model'] = $vehSele['years'][0]['makes'][0]['models'][0]['name'];
$vehDetails['vehicle'] = $vehDetails['year'].' '.$vehDetails['make'].' '.
$vehDetails['model'].' '.$vehTrim;
$vehDetails['trim'] = $vehTrim;
$vehDetails['engine'] = $vehEngine;
$vehicle_data['car_maker'] = $vehDetails['make'];
$vehicle_data['car_model'] = $vehDetails['model'];
$vehicle_data['car_model_year'] = $vehDetails['year'];
}
$vehicle_data['car_name'] = $vehDetails['vehicle'];
$vehicle_data['car_loc_lat'] = $lat_lng['lat'];
$vehicle_data['car_loc_lng'] = $lat_lng['lng'];
$vehicle_data['vehicle_data'] = json_encode($vehDetails);
$car_id = $this->Vehicle_model->addVehicle($vehicle_data);
if(!empty($car_id)){
$return_arr['status'] = '1';
......@@ -130,7 +112,6 @@ class Vehicle extends CI_Controller {
echo json_encode($return_arr); exit;
}
public function addVehBrand(){
$template['page'] = 'Vehicles/addBrand';
$template['pTitle'] = "Add Vehicle Brand";
......@@ -138,7 +119,6 @@ class Vehicle extends CI_Controller {
$template['menu'] = "Vehicle Brand Management";
$template['smenu'] = "View Brand";
$template['brand_id'] = '';
$template['vehBrand_data'] = $this->Vehicle_model->getVehBrand('',1);
$this->load->view('template',$template);
}
......@@ -149,7 +129,6 @@ class Vehicle extends CI_Controller {
$template['smenu'] = 'View Vehicles Brand ';
$template['pTitle'] = "View Vehicles Brand ";
$template['pDescription'] = "View and Manage Vehicles Brands";
$template['vehBrand_data'] = $this->Vehicle_model->getVehBrand('',1);
$this->load->view('template',$template);
}
......@@ -179,13 +158,11 @@ class Vehicle extends CI_Controller {
$err = 1;
$errMsg = 'Vehicle Brand is Required';
}
if($err == 1){
$flashMsg['message'] = $errMsg;
$this->session->set_flashdata('message',$flashMsg);
redirect(base_url('Vehicle/addVehBrand'));
}
$brand_id = $this->Vehicle_model->addBrand($_POST);
if($brand_id != '0'){
$flashMsg =array('message'=>'Successfully Updated Brand..!','class'=>'success');
......@@ -204,16 +181,13 @@ class Vehicle extends CI_Controller {
$this->session->set_flashdata('message',$flashMsg);
redirect(base_url('Vehicle/viewVehBrand'));
}
$template['page'] = 'Vehicles/addBrand';
$template['menu'] = 'Brand Management';
$template['smenu'] = 'Edit brand';
$template['pTitle'] = "Edit brand";
$template['pDescription'] = "Update brand Name";
$template['brand_id'] = encode_param($brand_id);
$template['vehBrand_data'] = $this->Vehicle_model->getVehBrand($brand_id,1);
$this->load->view('template',$template);
}
......@@ -233,7 +207,6 @@ class Vehicle extends CI_Controller {
$err = 1;
$errMsg = 'Vehicle Brand is Required';
}
if($err == 1){
$flashMsg['message'] = $errMsg;
$this->session->set_flashdata('message',$flashMsg);
......@@ -257,7 +230,6 @@ class Vehicle extends CI_Controller {
$template['menu'] = "Vehicle Model Management";
$template['smenu'] = "View Model";
$template['model_id'] = '';
$template['vehBrand_data'] = $this->Vehicle_model->getVehBrand('',1);
$template['vehModel_data'] = $this->Vehicle_model->getVehModel('',1);
$this->load->view('template',$template);
......@@ -269,7 +241,6 @@ class Vehicle extends CI_Controller {
$template['smenu'] = 'View Vehicles Model ';
$template['pTitle'] = "View Vehicles Model ";
$template['pDescription'] = "View and Manage Vehicles Models";
$template['vehModel_data'] = $this->Vehicle_model->getVehModel('',1);
$this->load->view('template',$template);
}
......@@ -302,13 +273,11 @@ class Vehicle extends CI_Controller {
$err = 1;
$errMsg = 'Vehicle Model is Required';
}
if($err == 1){
$flashMsg['message'] = $errMsg;
$this->session->set_flashdata('message',$flashMsg);
redirect(base_url('Vehicle/addVehModel'));
}
$model_id = $this->Vehicle_model->addModel($_POST);
if($model_id != '0'){
$flashMsg =array('message'=>'Successfully Updated Vehicle Model..!','class'=>'success');
......@@ -327,18 +296,14 @@ class Vehicle extends CI_Controller {
$this->session->set_flashdata('message',$flashMsg);
redirect(base_url('Vehicle/viewVehModel'));
}
$template['page'] = 'Vehicles/addModel';
$template['menu'] = 'Model Management';
$template['smenu'] = 'Edit Model';
$template['pTitle'] = "Edit Model";
$template['pDescription'] = "Update Model Name";
$template['model_id'] = encode_param($model_id);
$template['vehBrand_data'] = $this->Vehicle_model->getVehBrand('',1);
$template['vehModel_data'] = $this->Vehicle_model->getVehModel($model_id,1);
//pr($template['vehModel_data']);
$this->load->view('template',$template);
}
......@@ -361,7 +326,6 @@ class Vehicle extends CI_Controller {
$err = 1;
$errMsg = 'Vehicle Model is Required';
}
if($err == 1){
$flashMsg['message'] = $errMsg;
$this->session->set_flashdata('message',$flashMsg);
......@@ -377,7 +341,6 @@ class Vehicle extends CI_Controller {
redirect(base_url('Vehicle/editVehModel/'.$model_id));
}
}
public function getVehModel(){
$return_arr = array('status'=>'0');
......
......@@ -35,7 +35,6 @@
}
define("PAYSTACK_SECRET_KEY", "sk_test_36658e3260b1d1668b563e6d8268e46ad6da3273");
}
// customer_login
public function customer_login(){
header('Content-type: application/json');
......@@ -69,7 +68,6 @@
}
echo json_encode($respArr); exit;
}
// customer_forgot_password
public function customer_forgot_password(){
header('Content-type: application/json');
......@@ -98,7 +96,6 @@
}
echo json_encode($respArr); exit;
}
// customer_registration
public function customer_registration(){
header('Content-type: application/json');
......@@ -674,7 +671,7 @@
'status' => 'success',
'message'=>'success',
'data' => array(
'services' => $bookDataList['data']
'services_data' => $bookDataList['data']
),
'meta' => array(
'total_pages' => $totalPages,
......@@ -688,7 +685,7 @@
'status' => 'error',
'message'=>'No data',
'data' => array(
'services' => []
'services_data' => []
),
'meta' => array(
'total_pages' => $totalPages,
......
......@@ -15,9 +15,7 @@ class Booking_model extends CI_Model {
return 0;
}
$vehData = $postData['vechile_info'];
//$vehName = $this->db->get_where('vehicles_brand',array('veh_brand_id'=>$vehData['maker']))->row();
$car_name = $vehData['modelYear'].' '.$vehData['maker'].' '.$vehData['modelName'];
$vehJson = array('vehicle' => $car_name,
'attributes' => array(
'Year' => $vehData['modelYear'],
......@@ -31,18 +29,15 @@ class Booking_model extends CI_Model {
if(isset($vehData['lastMaintanceDate']) && !empty($vehData['lastMaintanceDate'])){
$last_date = $vehData['lastMaintanceDate'];
}
$last_maintanence_date ='';
if(isset($vehData['maintanenceInterval']) && !empty($vehData['maintanenceInterval'])){
$last_maintanence_date = $vehData['maintanenceInterval'];
}
$last_id = '';
if(isset($postData['customer_vehicle_id']) && !empty($postData['customer_vehicle_id'])){
$last_id = $postData['customer_vehicle_id'];
$this->db->update('customer_vehicle',array('last_maintenance_date'=>$last_date,'maintanence_interval'=>$last_maintanence_date),array('customer_veh_id'=>$postData['customer_vehicle_id']));
}
$insert_array = array('customer_id' => $postData['customer_id'],
'car_name' => $car_name,
'car_model' => $vehData['modelName'],
......@@ -55,7 +50,6 @@ class Booking_model extends CI_Model {
'last_maintenance_date'=> $last_date,
'maintanence_interval' => (int)$last_maintanence_date,
'status' => '3');
$selected_issues = array();
foreach($postData['selected_issues'] AS $selIssue){
$selected_issues[] = array('issue' => $selIssue['issue'],
......@@ -67,11 +61,9 @@ class Booking_model extends CI_Model {
$this->db->insert('customer_vehicle',$insert_array);
$last_id = $this->db->insert_id();
}
$book_data = array('cost' => $postData['cost'],
'mileage' => $vehData['milage'],
'customer_id' => $postData['customer_id'],
//'mechanic_id' => $postData['mechanic_id'],
'scheduled_date' => $postData['schedule_date']['date'],
'scheduled_time' => $postData['schedule_date']['time'],
'issues_selected' => json_encode($selected_issues),
......@@ -107,7 +99,6 @@ class Booking_model extends CI_Model {
}
$cond = "BK.customer_id='".$postData['customer_id']."' ";
$cond .= (!empty($status))?"AND BK.status IN (".$status.") ":'';
$sql = "SELECT BK.booking_id,BK.customer_id,BK.customer_veh_id,BK.scheduled_date,
BK.scheduled_time,BK.cost,BK.is_multiple,BK.status,VEH.car_name,VEH.car_maker,
VEH.car_model,VEH.car_model_year,BK.status
......@@ -119,7 +110,6 @@ class Booking_model extends CI_Model {
if(empty($bookData)){
return 0;
}
$bookDetails = array();
$bookData = $bookData->result();
foreach($bookData AS $book) {
......@@ -142,15 +132,12 @@ class Booking_model extends CI_Model {
MR.mechanic_id=BK.mechanic_id AND MR.status='1'
WHERE AU.status='1' AND BK.mechanic_id='$mech_value->mechanic_id' AND
BK.booking_id='$book->booking_id'");
if(!empty($mechanic_data)){
$mechData = $mechanic_data->row();
$mechData->custom_service_quote = json_decode($mechData->custom_service_quote);
$book->mechanic_data[] = $mechData;
$sTime = strtotime($book->scheduled_date.' '.$book->scheduled_time);
$cTime = strtotime('+1 hour');
if($cTime >= $sTime){
$book->status = '4';
}
......@@ -166,18 +153,15 @@ class Booking_model extends CI_Model {
if(empty($customer_id) || empty($booking_id) || $status == ''){
return 0;
}
$status = $this->db->update('bookings',
array('status'=>$status),
array('customer_id'=>$customer_id,'booking_id'=>$booking_id));
$this->db->select('customer_vehicle.car_name,bookings.scheduled_date,bookings.scheduled_time,customers.email');
$this->db->from('bookings');
$this->db->join('customer_vehicle','customer_vehicle.customer_veh_id = bookings.customer_veh_id');
$this->db->join('customers','customers.customer_id = bookings.customer_id');
$this->db->where('bookings.booking_id',$booking_id);
$bookData = $this->db->get()->row();
$subject = "DcarFixxers, Cancel Booking";
$email_id = $bookData->email;
$message = "<html>
......@@ -185,13 +169,11 @@ class Booking_model extends CI_Model {
Hi,\n\r Welcome to DcarFixxers. \r\n Your booking for the vehicle ".$bookData->car_name." on date ".$bookData->scheduled_date." at ".$bookData->scheduled_time." is Cancelled.
</body>
</html>";
$template = getNotifTemplate();
if(isset($template['cancel_booking']) && !empty($template['cancel_booking'])){
$message = str_replace(array('{:car_name}','{:book_date}'),array($bookData->car_name,$bookData->scheduled_date),$template['cancel_booking']);
}
send_mail($subject,$email_id,$message);
return $status;
}
......@@ -199,11 +181,9 @@ class Booking_model extends CI_Model {
if($this->session->userdata('user_type') != 1 && empty($mechanic_id)){
return 0;
}
$cond = " BK.status IN (".$status.") ";
$cond .= (!empty($booking_id))?" AND BK.booking_id='".$booking_id."' ":"";
$cond .= (!empty($mechanic_id))?" AND MBK.mechanic_id='".$mechanic_id."' ":"";
$sql = "SELECT GROUP_CONCAT(DISTINCT(MBK.mechanic_id)) AS mechanic_ids,MBK.amount as cost,BK.booking_id,BK.customer_id,BK.customer_veh_id,BK.scheduled_date,BK.scheduled_time,BK.status,BK.mileage,BK.issues_selected,VEH.car_name,BK.custom_issue_data,VEH.car_model,VEH.car_maker,
VEH.car_model_year,VEH.car_vin,VEH.vehicle_data,BK.car_location,BK.car_loc_lat,BK.car_loc_lng,
CUST.first_name AS custFirstName,CUST.last_name AS custLastName,CUST.phone,CUST.email,CUST.address
......@@ -217,7 +197,6 @@ class Booking_model extends CI_Model {
AND CUSQTE.mechanic_id=MBK.mechanic_id)
WHERE $cond AND ADM.status='1' AND CUST.status='1'
GROUP BY BK.booking_id";
$bookData = $this->db->query($sql);
if(!empty($bookData)){
if(empty($booking_id)){
......@@ -245,7 +224,6 @@ class Booking_model extends CI_Model {
LEFT JOIN mechanic_rating MR ON
MR.mechanic_id=BK.mechanic_id AND MR.status='1'
WHERE AU.status='1' AND BK.mechanic_id='$mech_id' AND BK.booking_id='$booking_id'");
if(!empty($mechanic_data)){
$mechData = $mechanic_data->row();
$mechData->custom_service_quote = json_decode($mechData->custom_service_quote);
......@@ -254,7 +232,6 @@ class Booking_model extends CI_Model {
}
$bookData->mechanic_data = $bookedMechanics;
}
// pr($bookData);
return $bookData;
}
return 0;
......@@ -299,7 +276,6 @@ class Booking_model extends CI_Model {
$custData = array();$total=0;
$book_id = decode_param($data['booking_id']);
$mechanic_id = ($this->session->userdata('user_type')==2)?$this->session->userdata('id'):'';
unset($data['booking_id']);
for($i=0 ; $i < count($data['description']);$i++){
$custData[$i]['issue_id']=$data['issue_id'][$i];
......@@ -310,7 +286,6 @@ class Booking_model extends CI_Model {
$total += $data['amount'][$i];
}
$book_data = $this->db->get_where('custom_quote',array('booking_id'=>$book_id));
if(!empty($book_data) && $book_data->num_rows() > 0){
$this->db->update('custom_quote',array('custom_service_quote'=>json_encode($custData),'mechanic_id'=>$mechanic_id,'custom_amount'=>$total),array('booking_id'=>$book_id));
$res = array('status'=>'success');
......@@ -328,7 +303,6 @@ class Booking_model extends CI_Model {
$this->db->join('bookings','bookings.booking_id = custom_quote.booking_id');
$this->db->where('custom_quote.custom_id',$customid);
$custData = $this->db->get('custom_quote');
if(!empty($custData) && $custData->num_rows() > 0){
$custData = $custData->row_array();
return $custData;
......
......@@ -9,7 +9,6 @@ class Brand_model extends CI_Model {
if(empty($brand_data)){
return 0;
}
$status = $this->db->insert('product_brand',$brand_data);
return ($status)?1:0;
}
......@@ -17,7 +16,6 @@ class Brand_model extends CI_Model {
function getBrand($brand_id = '',$view_all = 0){
$cond = ($view_all != 0)?' status IN (0,1) ':' status IN (1) ';
$cond .= (!empty($brand_id))?" AND brand_id = '$brand_id'":"";
$result = $this->db->query("SELECT * FROM product_brand WHERE $cond");
if(empty($result)){
return;
......@@ -37,7 +35,6 @@ class Brand_model extends CI_Model {
if(empty($brand_id) || empty($brand_data)){
return 0;
}
$status = $this->db->update('product_brand',$brand_data,array('brand_id'=>$brand_id));
return ($status)?1:0;
}
......
......@@ -15,7 +15,6 @@ class Customer_model extends CI_Model {
array('status'=>'1','customer_id'=>$customer_data['customer_id']));
$veh_data = (!empty($veh_data))?$veh_data->result():'';
}
$result = $this->db->query("SELECT * FROM customers WHERE status IN (0,1) $cond");
if(empty($result)){
return;
......@@ -31,14 +30,12 @@ class Customer_model extends CI_Model {
function createCustomer($customer_data = array(), $saved_vehicles = array()){
if(empty($customer_data))
return 0;
if(isset($customer_data['email']) && !empty($customer_data['email'])){
$emailChk = $this->db->get_where('customers',array('email'=>$customer_data['email'],'status !='=>'2'));
if(!empty($emailChk) && $emailChk->num_rows() > 0){
return 2;
}
}
if(isset($customer_data['phone']) && !empty($customer_data['phone'])){
$phoneChk = $this->db->get_where('customers',array('phone'=>$customer_data['phone'],'status !='=>'2'));
if(!empty($phoneChk) && $phoneChk->num_rows() > 0){
......@@ -50,10 +47,8 @@ class Customer_model extends CI_Model {
$this->db->query("UPDATE customer_vehicle SET status='1',customer_id='$cust_id'
WHERE customer_veh_id IN ($saved_vehicles)");
}
$subject = "Profile Activation";
$email_id = $customer_data['email'];
//$reset_link = 'https://projects.nuvento.com/admin/Api/verifyMail/'.$unique_id;
$message = "<html>
<body>
Hi,\n\r Welcome to DcarFixxers. \r\n Your account for the Username ".$email_id." is now Activated.
......@@ -66,14 +61,12 @@ class Customer_model extends CI_Model {
}
send_mail($subject,$email_id,$message);
$res = array('status'=>1,'data'=>'');
return ($status)?1:0;;
}
function updateCustomer($customer_id = '', $customer_data = array(), $saved_vehicles = array()){
if(empty($customer_id) || empty($customer_data))
return 0;
$emailChk = $this->db->get_where('customers',array('email'=>$customer_data['email'],
'customer_id !='=>$customer_id,
'status !='=>'2'));
......@@ -86,14 +79,11 @@ class Customer_model extends CI_Model {
if(!empty($phoneChk) && $phoneChk->num_rows() > 0){
return 3;
}
$status = $this->db->update('customers',$customer_data,array('customer_id'=>$customer_id));
if($status && !empty($saved_vehicles)){
$this->db->query("UPDATE customer_vehicle SET status='1',customer_id='$customer_id'
WHERE customer_veh_id IN ($saved_vehicles)");
}
return ($status)?1:0;;
}
......@@ -115,7 +105,6 @@ class Customer_model extends CI_Model {
$respArr['status'] = 2;
return $respArr;
}
$result = $this->db->get_where('customers',array('email'=>$userLogData['email'],
'password'=>$userLogData['password'],
'status'=>'1'));
......@@ -137,11 +126,9 @@ class Customer_model extends CI_Model {
$respArr['status'] = 2;
return $respArr;
}
$mail_id = $custData->email;
$cust_id = $custData->customer_id;
$unique_id = generate_unique();
$status = $this->db->insert('forgot_password_link',array('user_type'=>'1','user_id'=>$cust_id,
'token'=>$unique_id));
if($status){
......
......@@ -101,12 +101,10 @@ class Dashboard_model extends CI_Model {
INNER JOIN `transaction` AS `TRANS` ON (`TRANS`.`booking_id` = `ORDS`.`order_id`)
WHERE `TRANS`.`payment_for`='2' AND `TRANS`.`status` = '1'
GROUP BY SUBSTRING_INDEX(TRANS.datetime,'-',1)");
$result = array();
if(empty($query) || $query->num_rows < 0 || empty($query = $query->result_array())){
return $result;
}
foreach($query as $value){
$result[] = array('y'=>$value['year'],'item1'=>$value['count']);
}
......@@ -120,17 +118,14 @@ class Dashboard_model extends CI_Model {
INNER JOIN `transaction` AS `TRANS` ON (`TRANS`.`booking_id` = `BUK`.`booking_id`)
WHERE `TRANS`.`payment_for`='1' AND `TRANS`.`status` = '1'
GROUP BY SUBSTRING_INDEX(TRANS.datetime,'-',1)");
$result = array();
if(empty($query) || $query->num_rows < 0 || empty($query = $query->result_array())){
return $result;
}
foreach($query as $value){
$result[] = array('y'=>$value['year'],'item1'=>$value['count']);
}
return json_encode($result);
}
}
?>
\ No newline at end of file
......@@ -20,13 +20,11 @@ class Import_model extends CI_Model {
$this->db->insert('vehicles_brand',array('maker'=>$brand));
$brandData['veh_brand_id'] = $this->db->insert_id();
}
$modelData = $this->db->get_where('vehicles_model',array('veh_brand_id'=>$brandData['veh_brand_id'],'model'=>$model));
if(empty($modelData) || $modelData->num_rows < 0 || empty($modelData = $modelData->row_array())){
$this->db->insert('vehicles_model',array('veh_brand_id'=>$brandData['veh_brand_id'],'model'=>$model));
$modelData['veh_modal_id'] = $this->db->insert_id();
}
$carData = $this->db->get_where('cardetails',array('year'=>$year,'veh_modal_id'=>$modelData['veh_modal_id']));
if(empty($carData) || $carData->num_rows < 0 || empty($carData = $carData->row_array())){
$this->db->insert('cardetails',array('year'=>$year,'veh_modal_id'=>$modelData['veh_modal_id']));
......
......@@ -8,13 +8,10 @@ class Issue_model extends CI_Model {
public function addIssue($issue_data = array(), $issueTyp = array()){
if(empty($issue_data) || empty($issueTyp))
return 0;
$status = $this->db->insert('issues',$issue_data);
if(!$status)
return 0;
$issue_id = $this->db->insert_id();
foreach ($issueTyp AS $key => $value) {
$issueTyp[$key]['issue_id'] = $issue_id;
}
......@@ -25,7 +22,6 @@ class Issue_model extends CI_Model {
function getIssues($issue_id = '',$view_all = 0){
$cond = ($view_all != 0)?' ISS.status IN (0,1) ':' ISS.status IN (1) ';
$cond .= (!empty($issue_id))?" AND ISS.issue_id = '$issue_id' ":"";
$result = $this->db->query("SELECT ISS.*,IC.issue_cat_id FROM issues AS ISS
LEFT JOIN issues_category AS IC ON
(ISS.issue_id=IC.issue_id AND IC.status='1')
......@@ -41,9 +37,7 @@ class Issue_model extends CI_Model {
if(empty($mechanic_id)){
return 0;
}
$cond = ($view_all != 0)?' status IN (0,1) ':' status IN (1) ';
$result = $this->db->query("SELECT * FROM issues
WHERE $cond AND issue_id NOT IN
(SELECT issue_id FROM mechanic_issues
......@@ -57,7 +51,6 @@ class Issue_model extends CI_Model {
function getIssueDetails($issue_id = '',$view_all = 0){
$cond = ($view_all != 0)?' status IN (0,1) ':' status IN (1) ';
$cond .= (!empty($issue_id))?" AND issue_id = '$issue_id' ":"";
$result = $this->db->query("SELECT * FROM issues WHERE $cond");
if(empty($result)){
return;
......@@ -94,7 +87,6 @@ class Issue_model extends CI_Model {
return 0;
}
$status = $this->db->update('issues',$issue_data,array('issue_id'=>$issue_id));
$scat_ids = array();
if(!empty($updateSubTyp)){
foreach ($updateSubTyp AS $scat_id => $scat_data) {
......@@ -107,7 +99,6 @@ class Issue_model extends CI_Model {
}
$this->db->where('issue_id',$issue_id);
$this->db->delete('issues_category');
if(!empty($insertSubTyp)){
$this->db->insert_batch('issues_category',$insertSubTyp);
}
......@@ -128,18 +119,15 @@ class Issue_model extends CI_Model {
}
$cond = ($view_all != 0)?' MI.status IN (0,1) ':' MI.status IN (1) ';
$cond .= (!empty($issue_id))?" AND MI.issue_id = '$issue_id' ":"";
$sql = "SELECT MI.issue_id,MI.issue_cat_id,MI.mechanic_id,MI.custom_description,MI.custom_service_fee,
MI.status,ISS.issue,ISS.issue_image
$sql = "SELECT MI.issue_id,MI.issue_cat_id,MI.mechanic_id,MI.custom_description,
MI.custom_service_fee, MI.status,ISS.issue,ISS.issue_image
FROM mechanic_issues AS MI
INNER JOIN issues AS ISS ON (ISS.issue_id=MI.issue_id)
WHERE MI.mechanic_id='$mechanic_id' AND ISS.status='1' AND $cond
GROUP BY MI.issue_id,MI.issue_cat_id";
$mechIssueData = $this->db->query($sql);
if(empty($mechIssueData) || empty($mechIssueData = $mechIssueData->result_array()))
return 0;
$cstFlag = 0;
$customIssues = array();
foreach ($mechIssueData AS $mechIsssue) {
......@@ -152,9 +140,7 @@ class Issue_model extends CI_Model {
'status'=>$mechIsssue['status'],
'custom_enable'=>'0');
}
if(!empty($issCat_id = $mechIsssue['issue_cat_id'])){
$sIssData = $this->db->get_where('issues_category',array('issue_cat_id'=>$issCat_id));
if(empty($sIssData) || empty($sIssData = $sIssData->row_array())){
continue;
......@@ -163,7 +149,6 @@ class Issue_model extends CI_Model {
$subIssueDtls['service_fee'] = $sIssData['default_service_fee'];
$subIssueDtls['issue_category'] = $sIssData['issue_category'];
$subIssueDtls['issue_cat_image'] = $sIssData['issue_cat_image'];
if(!empty($mechIsssue['custom_description'])){
$cstFlag = 1;
$subIssueDtls['description'] = $mechIsssue['custom_description'];
......@@ -172,7 +157,6 @@ class Issue_model extends CI_Model {
$cstFlag = 1;
$subIssueDtls['service_fee'] = $mechIsssue['custom_service_fee'];
}
$customIssues[$issue_id]['sub_issue'][$issCat_id] = $subIssueDtls;
$customIssues[$issue_id]['custom_enable'] = $cstFlag;
}
......@@ -194,48 +178,37 @@ class Issue_model extends CI_Model {
if(empty($mechanic_id) || empty($issue_id) || empty($custom_issue)){
return 0;
}
$status = $this->db->delete('mechanic_issues',array('mechanic_id'=>$mechanic_id,'issue_id'=>$issue_id));
if(!$status){
return ($status)?1:0;
}
return $this->addMechIssue($custom_issue);
}
function getGeneralIssues($issue_id = '', $view_all = '0'){
$cond = ($view_all != 0)?' ISS.status IN (0,1) ':' ISS.status IN (1) ';
$cond .= (!empty($issue_id))?" AND ISS.issue_id='".$issue_id."' ":'';
$sql = "SELECT ISS.*, IC.*
FROM issues AS ISS
LEFT JOIN issues_category AS IC ON (IC.issue_id=ISS.issue_id AND IC.status='1')
WHERE ".$cond;
if(empty($issueData = $this->db->query($sql)) || empty($issueData = $issueData->result_array()))
return 0;
$genIssueData = array();
foreach($issueData AS $issueData){
$issue_id = $issueData['issue_id'];
if(!isset($genIssueData[$issue_id])){
$iData = array('issue'=>$issueData['issue'],'issue_id'=>$issue_id,
'issue_image'=>$issueData['issue_image']);
$genIssueData[$issue_id] = $iData;
$genIssueData[$issue_id] = $iData;
}
if(isset($issueData['issue_cat_id']) && !empty($issueData['issue_cat_id'])){
$sIssueId = $issueData['issue_cat_id'];
$isData = array('issue_cat_id'=>$issueData['issue_cat_id'],
'issue_category'=>$issueData['issue_category'],
'issue_cat_image'=>$issueData['issue_cat_image'],
'default_service_fee'=>$issueData['default_service_fee'],
'default_description'=>$issueData['default_description']);
$genIssueData[$issue_id]['sub_categories'][] = $isData;
}
}
......@@ -245,7 +218,6 @@ class Issue_model extends CI_Model {
$respArr[] = $value;
}
}
return $respArr;
}
}
......
......@@ -11,7 +11,6 @@ class Login_model extends CI_Model {
array('username'=>$username,
'password'=>$password,
'status'=>'1'));
if($query->num_rows() > 0 && !empty($query)){
$result = $query->row();
$result->mechanic_data = '';
......@@ -19,11 +18,9 @@ class Login_model extends CI_Model {
if($result->user_type == 2){
$this->load->model('Mechanic_model');
$result->mechanic_data = $this->Mechanic_model->getMechanic($result->id);
if(!empty($result->mechanic_data->shop_id)){
$this->load->model('Shop_model');
$shop_data = $this->Shop_model->getShop($result->mechanic_data->shop_id);
if(!empty($shop_data)){
$result->mechanic_shop_data = $shop_data;
}
......
......@@ -6,7 +6,6 @@ class Mailtemplate_model extends CI_Model {
public function getCMSdata(){
$cmsData = $this->db->query("SELECT * FROM privacy_policy");
if(!empty($cmsData)){
return $cmsData->row();
}
......@@ -23,7 +22,6 @@ class Mailtemplate_model extends CI_Model {
public function getNotifData(){
$notifData = $this->db->query("SELECT * FROM notification_templates");
if(!empty($notifData)){
return $notifData->row();
}
......
......@@ -13,19 +13,16 @@ class Mechanic_model extends CI_Model {
WHERE AU.status!='2' AND
AU.username='".$mechanic_data['username']."'");
if(!empty($userIdChk) && $userIdChk->num_rows() > 0) return 4;
$emailChk = $this->db->query("SELECT * FROM mechanic AS MECH
INNER JOIN admin_users AS AU ON (AU.id = MECH.mechanic_id)
WHERE AU.status!='2' AND
MECH.email_id='".$mechanic_data['email_id']."'");
if(!empty($emailChk) && $emailChk->num_rows() > 0) return 2;
$phoneChk = $this->db->query("SELECT * FROM mechanic AS MECH
INNER JOIN admin_users AS AU ON (AU.id = MECH.mechanic_id)
WHERE AU.status!='2' AND
MECH.phone='".$mechanic_data['phone']."'");
if(!empty($phoneChk) && $phoneChk->num_rows() > 0) return 3;
$status = $this->db->insert('admin_users',
array('username'=>$mechanic_data['username'],
'password'=>$mechanic_data['password'],
......@@ -61,7 +58,6 @@ class Mechanic_model extends CI_Model {
$cond = (!empty($mechanic_id))?" MECH.mechanic_id = '".$mechanic_id."' ":"";
$cond .= (!empty($cond))?" AND ":$cond;
$cond .= (!empty($view_all))?" ADMN.status IN (0,1) ":" ADMN.status IN (1) ";
$sql = "SELECT ADMN.username,ADMN.user_type,TRIM(CONCAT(MECH.first_name,' ' ,IFNULL(MECH.last_name,''))) as display_name,ADMN.profile_image,ADMN.status,
MSH.shop_name, MSH.address AS shop_address, MSH.phone AS shop_phone,
MSH.email_id AS shop_email, MECH.*
......@@ -69,7 +65,6 @@ class Mechanic_model extends CI_Model {
INNER JOIN admin_users AS ADMN ON (ADMN.id = MECH.mechanic_id)
LEFT JOIN mechanic_shop AS MSH ON (MSH.shop_id = MECH.shop_id AND MSH.status = '1')
WHERE ".$cond;
$result = $this->db->query($sql);
if(empty($result)){
return;
......@@ -85,40 +80,36 @@ class Mechanic_model extends CI_Model {
WHERE AU.status!='2' AND AU.id!='".$mechanic_id."' AND
AU.username='".$mechanic_data['username']."'");
if(!empty($userIdChk) && $userIdChk->num_rows() > 0) { return 4; }
$emailChk = $this->db->query("SELECT * FROM mechanic AS MECH
INNER JOIN admin_users AS AU ON (AU.id = MECH.mechanic_id)
WHERE AU.status!='2' AND AU.id!='".$mechanic_id."' AND
MECH.email_id='".$mechanic_data['email_id']."'");
if(!empty($emailChk) && $emailChk->num_rows() > 0) { return 2; }
$phoneChk = $this->db->query("SELECT * FROM mechanic AS MECH
INNER JOIN admin_users AS AU ON (AU.id = MECH.mechanic_id)
WHERE AU.status!='2' AND AU.id!='".$mechanic_id."' AND
MECH.phone='".$mechanic_data['phone']."'");
if(!empty($phoneChk) && $phoneChk->num_rows() > 0) { return 3; }
$admUpdateArr = array('username'=>$mechanic_data['username'],
'display_name'=>$mechanic_data['display_name']);
if(isset($mechanic_data['profile_image']) && !empty($mechanic_data['profile_image']))
$admUpdateArr['profile_image'] = $mechanic_data['profile_image'];
$status = $this->db->update('admin_users',$admUpdateArr,array('id'=>$mechanic_id));
if(!$status) { return 0; }
$upMecArr = array('city'=>$mechanic_data['city'],'first_name'=>$mechanic_data['first_name'],
'state'=>$mechanic_data['state'],
'shop_id'=>(!empty($mechanic_data['shop_id']) ? $mechanic_data['shop_id'] : '0'),
'address'=>$mechanic_data['address'],'email_id'=>$mechanic_data['email_id'],
'last_name'=>$mechanic_data['last_name'],'phone'=>$mechanic_data['phone'],
'location'=>$mechanic_data['location'],
'end_time'=>$mechanic_data['end_time'],
'start_time'=>$mechanic_data['start_time'],
'location_lat'=>$mechanic_data['location_lat'],
'location_lng'=>$mechanic_data['location_lng'],
'licence_number'=>$mechanic_data['licence_number'],
'licence_exp_date'=>$mechanic_data['licence_exp_date']);
$upMecArr = array(
'city'=>$mechanic_data['city'],'first_name'=>$mechanic_data['first_name'],
'state'=>$mechanic_data['state'],
'shop_id'=>(!empty($mechanic_data['shop_id']) ? $mechanic_data['shop_id'] : '0'),
'address'=>$mechanic_data['address'],'email_id'=>$mechanic_data['email_id'],
'last_name'=>$mechanic_data['last_name'],'phone'=>$mechanic_data['phone'],
'location'=>$mechanic_data['location'],
'end_time'=>$mechanic_data['end_time'],
'start_time'=>$mechanic_data['start_time'],
'location_lat'=>$mechanic_data['location_lat'],
'location_lng'=>$mechanic_data['location_lng'],
'licence_number'=>$mechanic_data['licence_number'],
'licence_exp_date'=>$mechanic_data['licence_exp_date']);
if(isset($mechanic_data['licence']) && !empty($mechanic_data['licence']))
$upMecArr['licence'] = $mechanic_data['licence'];
......
<div class="content-wrapper">
<section class="content-header">
<h1>
<?= $pTitle ?>
<small><?= $pDescription ?></small>
<?= $pTitle ?><small><?= $pDescription ?></small>
</h1>
<ol class="breadcrumb">
<li><a href="<?= base_url() ?>"><i class="fa fa-star-o" aria-hidden="true"></i>Home</a></li>
......@@ -21,7 +20,6 @@
</div>
<?php } ?>
</div>
<div class="col-sm-12">
<div class="box box-warning">
<div class="box-header with-border">
......@@ -42,12 +40,11 @@
<div class="col-sm-12">
<div class="form-group">
<label>Choose a Mechanic</label>
<select name="mechanic_id" class="form-control required" data-parsley-trigger="change"
onchange="changeMechanic()" dmClick="0" required>
<select name="mechanic_id" class="form-control required" data-parsley-trigger="change" onchange="changeMechanic()" dmClick="0" required>
<?php if($this->session->userdata['user_type'] == 1){?>
<option>View All</option>
<option>View All</option>
<?php }else{ ?>
<option selected disabled>Select Mechanic</option>
<option selected disabled>Select Mechanic</option>
<?php }
if(!empty($mechanic_data)){
foreach ($mechanic_data as $mechanic) {
......@@ -76,7 +73,6 @@
<tr>
<th class="hidden">ID</th>
<th width="18%;">Car Name</th>
<!-- <th width="12%;">Mechanic</th> -->
<th width="12%;">Customer</th>
<th width="15%;">Scheduled Date</th>
<th width="11%;">Service Fee</th>
......@@ -118,8 +114,6 @@
<button class="btn btn-sm btn-primary" booking_id="<?= encode_param($bookData->booking_id) ?>" id="showBookinDetails">
<i class="fa fa-fw fa-edit"></i>View Quote
</button>
<?php if($this->session->userdata['user_type'] == 1){
if($bookData->status == 0 || $bookData->status == 1){ ?>
<a class="btn btn-sm btn-success" style="background-color:#ac2925" href="<?= base_url("Bookings/changeBookingStatus/".encode_param($bookData->booking_id)."/4/".encode_param($mechanic_id)) ?>">
......@@ -165,7 +159,7 @@
</div>
</div>
</div>
<?php } ?>
<?php } ?>
</div>
</section>
</div>
\ No newline at end of file
<div class="content-wrapper">
<section class="content-header">
<h1>
<?= $pTitle ?>
<small><?= $pDescription ?></small>
<?= $pTitle ?><small><?= $pDescription ?></small>
</h1>
<ol class="breadcrumb">
<li><a href="<?= base_url() ?>"><i class="fa fa-star-o" aria-hidden="true"></i>Home</a></li>
......@@ -46,8 +45,7 @@
<img id="brand_image" src="<?= (isset($brand_data->brand_logo))?base_url($brand_data->brand_logo):'' ?>" onerror="this.src='<?=base_url("assets/images/no_image.png")?>';" height="75" width="75" />
</div>
<div class="col-md-9" style="padding-top: 25px;">
<input name="brand_logo" type="file" accept="image/*"
onchange="setImg(this,'brand_image');" />
<input name="brand_logo" type="file" accept="image/*" onchange="setImg(this,'brand_image');" />
</div>
</div>
</div>
......
<div class="content-wrapper" >
<!-- Content Header (Page header) -->
<section class="content-header">
<h1>
<?= $pTitle ?>
<small><?= $pDescription ?></small>
<?= $pTitle ?><small><?= $pDescription ?></small>
</h1>
<ol class="breadcrumb">
<li><a href="<?= base_url() ?>"><i class="fa fa-star-o" aria-hidden="true"></i>Home</a></li>
......@@ -11,15 +9,14 @@
<li class="active"><?= $smenu ?></li>
</ol>
</section>
<!-- Main content -->
<section class="content">
<div class="row">
<div class="col-md-12">
<?php if($this->session->flashdata('message')) {
$flashdata = $this->session->flashdata('message'); ?>
<div class="alert alert-<?= $flashdata['class'] ?>">
<button class="close" data-dismiss="alert" type="button">×</button>
<?= $flashdata['message'] ?>
<button class="close" data-dismiss="alert" type="button">×</button>
<?= $flashdata['message'] ?>
</div>
<?php } ?>
</div>
......@@ -41,10 +38,10 @@
<th width="150px;">Brand Image</th>
<th width="100px;">Status</th>
<th width="300px;">Action</th>
</tr>
</tr>
</thead>
<tbody>
<?php
<?php
if(!empty($brand_data)){
foreach($brand_data as $brand) { ?>
<tr>
......@@ -63,16 +60,7 @@
href="<?= base_url("Brand/changeStatus/".encode_param($brand->brand_id))."/2" ?>"
onClick="return doconfirm()">
<i class="fa fa-fw fa-trash"></i>Delete
</a>
<!-- <?php if($brand->status == 1){ ?>
<a class="btn btn-sm btn-success" style="background-color:#ac2925" href="<?= base_url("Brand/changeStatus/".encode_param($brand->brand_id))."/0" ?>">
<i class="fa fa-cog"></i> De-activate
</a>
<?php } else { ?>
<a class="btn btn-sm btn-success" href="<?= base_url("Brand/changeStatus/".encode_param($brand->brand_id))."/1" ?>">
<i class="fa fa-cog"></i> Activate
</a>
<?php } ?> -->
</a>
</td>
</tr>
<?php } } ?>
......
<div class="content-wrapper">
<section class="content-header">
<h1>
<?= $pTitle ?>
<small><?= $pDescription ?></small>
<?= $pTitle ?><small><?= $pDescription ?></small>
</h1>
<ol class="breadcrumb">
<li><a href="<?= base_url() ?>"><i class="fa fa-star-o" aria-hidden="true"></i>Home</a></li>
......@@ -196,7 +195,6 @@
id="loc_search_1" input="search_params" placeholder="Enter Vehicle Location" required>
</div>
</div>
<div class="col-md-12 padTop10">
<div class="col-md-6">
<label>Engine</label>
......
<div class="content-wrapper">
<!-- Content Header (Page header) -->
<section class="content-header">
<h1> <?= $page_title ?>
<small><?= $page_desc ?></small>
......
......@@ -40,7 +40,6 @@
</select>
</div>
</div>
<div class="col-md-6 hide" id="import_file">
<div class="form-group">
<label>Import File</label>
......@@ -52,7 +51,6 @@
</div>
</div>
</div>
</div>
<div class="col-md-12">
<div class="box-footer textCenterAlign">
......
<div class="content-wrapper">
<section class="content-header">
<h1>
<?= $pTitle ?>
<small><?= $pDescription ?></small>
<?= $pTitle ?><small><?= $pDescription ?></small>
</h1>
<ol class="breadcrumb">
<li><a href="<?= base_url() ?>"><i class="fa fa-star-o" aria-hidden="true"></i>Home</a></li>
......@@ -154,7 +153,6 @@
</section>
</div>
<!-- ADD SUB ITEM HTML -->
<div id="subIssueAdd" class="hide">
......@@ -182,8 +180,7 @@
<img class="small-icon" id="issue_cat_image_{:count}" src="" onerror="this.src='<?=base_url("assets/images/no_image.png")?>';" />
</div>
<div class="col-md-8" style="padding-top: 12px;">
<input name="issue_cat_image[]" type="file" accept="image/*"
onchange="setImg(this,'issue_cat_image_{:count}');" required />
<input name="issue_cat_image[]" type="file" accept="image/*" onchange="setImg(this,'issue_cat_image_{:count}');" required />
</div>
</div>
</div>
\ No newline at end of file
......@@ -79,7 +79,6 @@
<div class="col-md-12 padBottom10">
<label>Issue Sub Type Details</label>
</div>
<div id="subTypeDtlsCntrData">
<?php
$disabled = 'disabled';
......@@ -91,33 +90,32 @@
$txtAreaCls = '';
}
if($edit && !empty($mechanicIssueData['sub_issue'])) {
foreach($mechanicIssueData['sub_issue'] AS $issue_cat_id => $sub_issue) { ?>
<div class="col-md-12">
<div class="col-md-1"></div>
<div class="col-md-1 marginTop5">
<i class="fa fa-arrow-circle-right fav-add-icon"></i>
foreach($mechanicIssueData['sub_issue'] AS $issue_cat_id => $sub_issue) { ?>
<div class="col-md-12">
<div class="col-md-1"></div>
<div class="col-md-1 marginTop5">
<i class="fa fa-arrow-circle-right fav-add-icon"></i>
</div>
<div class="col-md-2">
<label><?= $sub_issue['issue_category'] ?></label>
</div>
<div class="col-md-2 marginBottom-10">
<img class="small-icon" src="<?= base_url($sub_issue['issue_cat_image']) ?>"
onerror="this.src='<?= base_url('assets/images/no_image_text.png') ?>';" />
</div>
<div class="col-md-4 marginBottom-10">
<textarea name="default_description_<?= $issue_cat_id ?>" <?= $disabled ?> required class="custom-textarea-style <?= $txtAreaCls ?>"><?= $sub_issue['description'] ?></textarea>
</div>
<div class="col-md-2">
Service Fee :
<input name="default_service_fee_<?= $issue_cat_id ?>" <?= $disabled ?> required data-parsley-pattern="^[0-9\ . \/]+$" class="custom-input-style <?= $inputCls ?>" maxlength="6" value="<?= $sub_issue['service_fee'] ?>">
</div>
</div>
<div class="col-md-2">
<label><?= $sub_issue['issue_category'] ?></label>
</div>
<div class="col-md-2 marginBottom-10">
<img class="small-icon" src="<?= base_url($sub_issue['issue_cat_image']) ?>"
onerror="this.src='<?= base_url('assets/images/no_image_text.png') ?>';" />
</div>
<div class="col-md-4 marginBottom-10">
<textarea name="default_description_<?= $issue_cat_id ?>" <?= $disabled ?> required class="custom-textarea-style <?= $txtAreaCls ?>"><?= $sub_issue['description'] ?></textarea>
</div>
<div class="col-md-2">
Service Fee :
<input name="default_service_fee_<?= $issue_cat_id ?>" <?= $disabled ?> required data-parsley-pattern="^[0-9\ . \/]+$" class="custom-input-style <?= $inputCls ?>" maxlength="6" value="<?= $sub_issue['service_fee'] ?>">
</div>
</div>
<input type="hidden" name="issue_cat_ids[]" value="<?= $issue_cat_id ?>">
<input type="hidden" name="issue_cat_ids[]" value="<?= $issue_cat_id ?>">
<?php } } ?>
</div>
</div>
</div>
<div class="col-md-12 marginTop10">
<div class="box-footer textCenterAlign">
<button type="submit" class="btn btn-primary">Submit</button>
......
<div class="content-wrapper" >
<!-- Content Header (Page header) -->
<section class="content-header">
<h1>
<?= $pTitle ?>
<small><?= $pDescription ?></small>
<?= $pTitle ?><small><?= $pDescription ?></small>
</h1>
<ol class="breadcrumb">
<li><a href="<?= base_url() ?>"><i class="fa fa-star-o" aria-hidden="true"></i>Home</a></li>
......@@ -11,15 +9,14 @@
<li class="active"><?= $smenu ?></li>
</ol>
</section>
<!-- Main content -->
<section class="content">
<div class="row">
<div class="col-md-12">
<?php if($this->session->flashdata('message')) {
$flashdata = $this->session->flashdata('message'); ?>
<div class="alert alert-<?= $flashdata['class'] ?>">
<button class="close" data-dismiss="alert" type="button">×</button>
<?= $flashdata['message'] ?>
<button class="close" data-dismiss="alert" type="button">×</button>
<?= $flashdata['message'] ?>
</div>
<?php } ?>
</div>
......@@ -56,8 +53,7 @@
<th class="center"><?= ($issue->status == 1)?'Active':'De-activate' ?></th>
<td class="center float-right">
<?php if(!empty($issue->issue_cat_id)){ ?>
<a class="btn btn-sm btn-info cpoint"
onclick="viewIssueDetls('<?= encode_param($issue->issue_id) ?>');">
<a class="btn btn-sm btn-info cpoint" onclick="viewIssueDetls('<?= encode_param($issue->issue_id) ?>');">
<i class="fa fa-fw fa-eye"></i>View Issue Sub Categories
</a>
<?php } ?>
......
......@@ -3,9 +3,7 @@
?>
<div class="content-wrapper">
<section class="content-header">
<h1>
<?= $pTitle ?>
<small><?= $pDescription ?></small>
<h1><?= $pTitle ?><small><?= $pDescription ?></small>
</h1>
<ol class="breadcrumb">
<li><a href="<?= base_url() ?>"><i class="fa fa-star-o" aria-hidden="true"></i>Home</a></li>
......
<div class="content-wrapper">
<section class="content-header">
<h1>
<?= $pTitle ?>
<small><?= $pDescription ?></small>
</h1>
<h1><?= $pTitle ?><small><?= $pDescription ?></small></h1>
<ol class="breadcrumb">
<li><a href="<?= base_url() ?>"><i class="fa fa-star-o" aria-hidden="true"></i>Home</a></li>
<li><?= $menu ?></li>
......@@ -28,7 +25,6 @@
<div class="box-body">
<form role="form" action="<?= base_url($url) ?>" method="post"
class="validate" data-parsley-validate="" enctype="multipart/form-data">
<!-- Basic Details -->
<div class="col-md-12">
<div class="box-header with-border padUnset">
<h3 class="box-title">Basic Details</h3>
......@@ -69,7 +65,6 @@
</div>
</div>
</div>
<!-- Mechanic Data -->
<div class="col-md-12">
<div class="box-header with-border padUnset">
<h3 class="box-title">Personal Details</h3>
......@@ -150,7 +145,6 @@
value="<?= (isset($user_data->phone))?$user_data->phone:'' ?>" name="phone" placeholder="Enter Phone Number" >
<span class="glyphicon form-control-feedback"></span>
</div>
<div class="form-group" style="display:inline-flex;">
<div style="width:250px;" class="clockpicker" data-autoclose="true">
<label>Working Hours</label>
......@@ -160,17 +154,14 @@
id="start_time" autocomplete="off" >
<span class="glyphicon form-control-feedback"></span>
</div>
<div style="width:250px;padding-left:10px;padding-top:25px;"
class="clockpicker" data-autoclose="true">
<div style="width:250px;padding-left:10px;padding-top:25px;" class="clockpicker" data-autoclose="true">
<input type="text" class="form-control required" data-parsley-trigger="change"
data-parsley-minlength="2" required="" placeholder="Work End Time" autocomplete="off"
data-parsley-minlength="2" required="" placeholder="Work End Time" autocomplete="off"
value="<?= (isset($user_data->end_time))?$user_data->end_time:'' ?>" id="end_time"
name="end_time">
<span class="glyphicon form-control-feedback"></span>
</div>
</div>
<div class="form-group">
<label>Licence Number</label>
<input type="text" class="form-control" data-parsley-trigger="change"
......@@ -196,8 +187,7 @@
<img id="licence_image" src="<?= (isset($user_data->licence))?base_url($user_data->licence):'' ?>" onerror="this.src='<?=base_url("assets/images/no_image.png")?>';" height="75" width="75" />
</div>
<div class="col-md-9" style="padding-top: 25px;">
<input name="licence" type="file" accept="image/*"
onchange="setImg(this,'licence_image');" />
<input name="licence" type="file" accept="image/*" onchange="setImg(this,'licence_image');" />
</div>
</div>
</div>
......
<div class="content-wrapper" >
<!-- Content Header (Page header) -->
<section class="content-header">
<h1>
<?= $pTitle ?>
<small><?= $pDescription ?></small>
<h1><?= $pTitle ?><small><?= $pDescription ?></small>
</h1>
<ol class="breadcrumb">
<li><a href="<?= base_url() ?>"><i class="fa fa-star-o" aria-hidden="true"></i>Home</a></li>
......@@ -11,7 +8,6 @@
<li class="active"><?= $smenu ?></li>
</ol>
</section>
<!-- Main content -->
<section class="content">
<div class="row">
<div class="col-md-12">
......
<div class="content-wrapper">
<section class="content-header">
<h1>
<?= $pTitle ?>
<small><?= $pDescription ?></small>
<h1><?= $pTitle ?><small><?= $pDescription ?></small>
</h1>
<ol class="breadcrumb">
<li><a href="<?= base_url() ?>"><i class="fa fa-star-o" aria-hidden="true"></i>Home</a></li>
......@@ -38,7 +36,6 @@
<textarea id="rich_editor_2" type="text" class="ip_reg_form_input form-control reset-form-custom" placeholder="Registration Mail" name="customer_registration_mail" style="height:108px;" data-parsley-trigger="change"><?= $notificationData->customer_registration_mail ?></textarea>
</div>
</div>
<div class="col-sm-6">
<div class="form-group">
<label>Cancel Booking</label>
......@@ -47,7 +44,6 @@
</div>
</div>
</div>
<div class="col-sm-12">
<div class="col-sm-6">
<div class="form-group">
......@@ -56,7 +52,6 @@
<textarea id="rich_editor_4" type="text" class="ip_reg_form_input form-control reset-form-custom" placeholder="Checker Activation Mail" name="mechanic_activation_mail" style="height:108px;" data-parsley-trigger="change"><?= $notificationData->mechanic_activation_mail ?></textarea>
</div>
</div>
<div class="col-sm-6">
<div class="form-group">
<label>Success Booking</label>
......@@ -66,8 +61,6 @@
</div>
</div>
</div>
<div class="col-sm-12">
<div class="col-sm-6">
<div class="form-group">
......@@ -76,7 +69,6 @@
<textarea id="rich_editor_6" type="text" class="ip_reg_form_input form-control reset-form-custom" placeholder="Invoice Template" name="invoice_template" style="height:108px;" data-parsley-trigger="change"><?= $notificationData->invoice_template ?></textarea>
</div>
</div>
</div>
<div class="col-sm-12">
<div class="col-md-6">
......
<div class="content-wrapper">
<section class="content-header">
<h1>
<?= $pTitle ?>
<small><?= $pDescription ?></small>
<h1><?= $pTitle ?><small><?= $pDescription ?></small>
</h1>
<ol class="breadcrumb">
<li><a href="<?= base_url() ?>"><i class="fa fa-star-o" aria-hidden="true"></i>Home</a></li>
......
<div class="content-wrapper">
<section class="content-header">
<h1>
<?= $pTitle ?>
<small><?= $pDescription ?></small>
<h1><?= $pTitle ?><small><?= $pDescription ?></small>
</h1>
<ol class="breadcrumb">
<li><a href="<?= base_url() ?>"><i class="fa fa-star-o" aria-hidden="true"></i>Home</a></li>
......@@ -28,7 +26,6 @@
<div class="box-body">
<form name="productAddForm" role="form" action="<?= base_url($url) ?>" method="post"
class="validate" data-parsley-validate="" enctype="multipart/form-data">
<!-- Basic Details -->
<div class="col-md-12">
<div class="box-header with-border padUnset">
<h3 class="box-title">Basic Details</h3>
......@@ -56,7 +53,6 @@
data-parsley-pattern="^[a-zA-Z0-9\ . _ @ \/]+$" placeholder="Enter Short Description"><?= (isset($product_data->short_description))?$product_data->short_description:'' ?></textarea>
<span class="glyphicon form-control-feedback"></span>
</div>
<div class="form-group">
<label>Part ID</label>
<input type="text" class="form-control" data-parsley-trigger="change" data-parsley-minlength="2" name="part_id"
......@@ -79,7 +75,6 @@
<span class="glyphicon form-control-feedback"></span>
</div>
</div>
<!-- Mechanic Data -->
<div class="col-md-12">
<div class="box-header with-border padUnset">
<h3 class="box-title">Product Details</h3>
......@@ -96,12 +91,11 @@
<div class="dropZoneContainer" id="multiImageCntr_<?= $count ?>">
<input type="hidden" name="existingImages[]" value="<?= $photos['id'] ?>">
<div id="multiImageClose_<?= $count ?>" class="close_custom cpoint"
onclick="removeImage('<?= $count ?>');">&times;</div>
onclick="removeImage('<?= $count ?>');">&times;</div>
<input disabled type="file" name="product_image[]" class="multiFileUpload"
accept="image/*" onchange="setMultiImg(this,jQuery(this));"
count="<?= $count ?>" />
accept="image/*" onchange="setMultiImg(this,jQuery(this));" count="<?= $count ?>" />
<img class="multiDropZoneOverlay" id="multiImageImg_<?= $count ?>"
src="<?= base_url($photos['image']) ?>" onerror="this.src='<?=base_url("assets/images/add-image.png")?>';" />
src="<?= base_url($photos['image']) ?>" onerror="this.src='<?=base_url("assets/images/add-image.png")?>';" />
</div>
<?php
$count += 1;
......@@ -110,139 +104,138 @@
?>
<div class="dropZoneContainer" id="multiImageCntr_<?= $count ?>">
<div id="multiImageClose_<?= $count ?>" class="close_custom cpoint hide"
onclick="removeImage('<?= $count ?>');">&times;</div>
onclick="removeImage('<?= $count ?>');">&times;</div>
<input type="file" name="product_image[]" class="multiFileUpload" accept="image/*"
onchange="setMultiImg(this,jQuery(this));" count="<?= $count ?>" />
onchange="setMultiImg(this,jQuery(this));" count="<?= $count ?>" />
<img class="multiDropZoneOverlay" id="multiImageImg_<?= $count ?>"
src="<?=base_url("assets/images/add-image.png")?>" />
src="<?=base_url("assets/images/add-image.png")?>" />
</div>
</div>
</div>
</div>
<div class="col-md-12">
<div class="form-group">
<div class="row">
<div class="col-md-12">
<div class="box-header with-border padUnset">
<h3 class="box-title">Product Details</h3>
<div class="form-group">
<div class="row">
<div class="col-md-12">
<div class="box-header with-border padUnset">
<h3 class="box-title">Product Details</h3>
</div>
</div>
</div>
</div>
</div>
<div class="form-group">
<div class="row">
<div class="col-md-3">
<label>Vehicle Model Year</label>
<select name="vehYear" class="form-control" input="search_params"
data-parsley-trigger="change">
<option selected disabled value="">Choose Vehicle Model Year</option>
<?php
for($year=date('Y'); $year>=1950; $year--){
$cond = (isset($product_data) && isset($product_data->year) &&
!empty($product_data->year) &&
$product_data->year == $year)?'selected':'';
echo '<option '.$cond.' value="'.$year.'">'.$year.'</option>';
}
?>
</select>
</div>
<div class="col-md-4">
<label>Vehicle Make</label>
<select name="vehMake" class="form-control" data-parsley-trigger="change" id="veh_make">
<option selected disabled value="">Choose Vehicle Make</option>
<?php
foreach ($veh_data['make'] as $key => $value) {
$cond = (isset($product_data) && isset($product_data->veh_brand_id) &&
!empty($product_data->veh_brand_id) &&
$product_data->veh_brand_id == $value->veh_brand_id)?'selected':'';
echo '<option '.$cond.' maker="'.$value->veh_brand_id.'" value="'.$value->veh_brand_id.'">'.$value->maker.'</option>';
}
?>
</select>
</div>
<div class="col-md-4">
<label>Vehicle Model</label>
<select name="vehModel" class="form-control" data-parsley-trigger="change" id="veh_model">
<option selected="" disabled="" value="">Choose Vehicle Model</option>
<?php
if((isset($product_id) || !empty($product_id))){
foreach ($veh_data['model'] as $key => $value) {
$cond = (isset($product_data) && isset($product_data->veh_modal_id) &&
!empty($product_data->veh_modal_id) &&
$product_data->veh_modal_id == $value->veh_modal_id)?'selected':'';
echo '<option '.$cond.' value="'.$value->veh_modal_id.'">'.$value->model.' '.$value->trim.' '.$value->engine.'</option>';
<div class="form-group">
<div class="row">
<div class="col-md-3">
<label>Vehicle Model Year</label>
<select name="vehYear" class="form-control" input="search_params"
data-parsley-trigger="change">
<option selected disabled value="">Choose Vehicle Model Year</option>
<?php
for($year=date('Y'); $year>=1950; $year--){
$cond = (isset($product_data) && isset($product_data->year) &&
!empty($product_data->year) &&
$product_data->year == $year)?'selected':'';
echo '<option '.$cond.' value="'.$year.'">'.$year.'</option>';
}
}
?>
</select>
</div>
<div class="col-md-1">
<div class="col-md-1">
<div class="row" style="margin-top: 28px !important;">
<div class="col-md-6"></div>
<div class="col-md-6">
?>
</select>
</div>
<div class="col-md-4">
<label>Vehicle Make</label>
<select name="vehMake" class="form-control" data-parsley-trigger="change" id="veh_make">
<option selected disabled value="">Choose Vehicle Make</option>
<?php
foreach ($veh_data['make'] as $key => $value) {
$cond = (isset($product_data) && isset($product_data->veh_brand_id) &&
!empty($product_data->veh_brand_id) &&
$product_data->veh_brand_id == $value->veh_brand_id)?'selected':'';
echo '<option '.$cond.' maker="'.$value->veh_brand_id.'" value="'.$value->veh_brand_id.'">'.$value->maker.'</option>';
}
?>
</select>
</div>
<div class="col-md-4">
<label>Vehicle Model</label>
<select name="vehModel" class="form-control" data-parsley-trigger="change" id="veh_model">
<option selected="" disabled="" value="">Choose Vehicle Model</option>
<?php
$tot = (isset($product_data->carData) && !empty($product_data->carData))?count($product_data->carData):'0';
$count=0;
if((isset($product_id) || !empty($product_id))){
foreach ($veh_data['model'] as $key => $value) {
$cond = (isset($product_data) && isset($product_data->veh_modal_id) &&
!empty($product_data->veh_modal_id) &&
$product_data->veh_modal_id == $value->veh_modal_id)?'selected':'';
echo '<option '.$cond.' value="'.$value->veh_modal_id.'">'.$value->model.' '.$value->trim.' '.$value->engine.'</option>';
}
}
?>
<i class="fa fa-plus-circle cpoint fav-add-icon" id="addPrdtCar" count="<?= $tot?>"></i>
</select>
</div>
<div class="col-md-1">
<div class="col-md-1">
<div class="row" style="margin-top: 28px !important;">
<div class="col-md-6"></div>
<div class="col-md-6">
<?php
$tot = (isset($product_data->carData) && !empty($product_data->carData))?count($product_data->carData):'0';
$count=0;
?>
<i class="fa fa-plus-circle cpoint fav-add-icon" id="addPrdtCar" count="<?= $tot?>"></i>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="">
<div class="<?php (isset($product_data->carData) && !empty($product_data->carData))?'':'hide'?>" id="addCarResult">
<?php
if(isset($product_data->carData) && !empty($product_data->carData)){
$count = 0;
foreach ($product_data->carData as $key => $value) {
?>
<div id="add_result_<?= $key+1; ?>" class="col-md-6 form-group">
<span class="disp-block" style="border:1px solid #e2e2e2;padding: 12px;">
<?php
$carName = $value->year.' '.$value->maker.' '.$value->model;
$carName .= (!empty($value->trim))?' '.$value->trim:'';
$carName .= (!empty($value->engine))?', '.$value->engine:'';
echo $carName;
?>
<div class="float-right">
<div class="float-right margin-all" style="margin-top:0px;">
<i class="fa fa-fw fa-close cpoint" onclick="removeProduct(<?= $key+1 ?>)"></i>
</div>
</div>
<div class="row">
<div class="">
<div class="<?php (isset($product_data->carData) && !empty($product_data->carData))?'':'hide'?>" id="addCarResult">
<?php
if(isset($product_data->carData) && !empty($product_data->carData)){
$count = 0;
foreach ($product_data->carData as $key => $value) {
?>
<div id="add_result_<?= $key+1; ?>" class="col-md-6 form-group">
<span class="disp-block" style="border:1px solid #e2e2e2;padding: 12px;">
<?php
$carName = $value->year.' '.$value->maker.' '.$value->model;
$carName .= (!empty($value->trim))?' '.$value->trim:'';
$carName .= (!empty($value->engine))?', '.$value->engine:'';
echo $carName;
?>
<div class="float-right">
<div class="float-right margin-all" style="margin-top:0px;">
<i class="fa fa-fw fa-close cpoint" onclick="removeProduct(<?= $key+1 ?>)"></i>
</div>
</div>
</div>
<input type="hidden" value="<?= $value->year ?>" name="prdVehYear[]">
<input type="hidden" value="<?= $value->veh_modal_id ?>" name="prdVehModel[]">
</span>
<input type="hidden" value="<?= $value->year ?>" name="prdVehYear[]">
<input type="hidden" value="<?= $value->veh_modal_id ?>" name="prdVehModel[]">
</span>
</div>
<?php
} }
?>
</div>
<?php
} }
?>
</div>
</div>
<div class="row">
<div class="col-md-6 padTop20">
<div class="form-group">
<label>Product Description</label>
<textarea id="rich_editor" type="text" class="ip_reg_form_input form-control reset-form-custom" placeholder="Product Description" name="description"
style="height:108px;" data-parsley-trigger="change" data-parsley-minlength="2"><?= (isset($product_data->description))?$product_data->description:'' ?></textarea>
</div>
</div>
<div class="row">
<div class="col-md-6 padTop20">
<div class="form-group">
<label>Product Description</label>
<textarea id="rich_editor" type="text" class="ip_reg_form_input form-control reset-form-custom" placeholder="Product Description" name="description"
style="height:108px;" data-parsley-trigger="change" data-parsley-minlength="2"><?= (isset($product_data->description))?$product_data->description:'' ?></textarea>
</div>
</div>
<div class="col-md-6 padTop20">
<div class="form-group">
<label>About</label>
<textarea id="rich_editor1" type="text" class="ip_reg_form_input form-control reset-form-custom" placeholder="About" name="about"
style="height:108px;" data-parsley-trigger="change" data-parsley-minlength="2"><?= (isset($product_data->about))?$product_data->about:'' ?></textarea>
<div class="col-md-6 padTop20">
<div class="form-group">
<label>About</label>
<textarea id="rich_editor1" type="text" class="ip_reg_form_input form-control reset-form-custom" placeholder="About" name="about"
style="height:108px;" data-parsley-trigger="change" data-parsley-minlength="2"><?= (isset($product_data->about))?$product_data->about:'' ?></textarea>
</div>
</div>
</div>
</div>
</div>
<div class="col-md-12">
<div class="box-footer textCenterAlign">
<button id="addProductButton" type="submit" class="btn btn-primary">Submit</button>
......@@ -256,14 +249,10 @@
</div>
</section>
</div>
<div id="multipleImageInput" class="hide">
<div class="dropZoneContainer" id="multiImageCntr_{:count}" count="{:count}">
<div id="multiImageClose_{:count}" class="close_custom hide" onclick="removeImage('{:count}');">&times;</div>
<input id="event_image_{:count}" type="file" name="product_image[]" class="multiFileUpload" accept="image/*"
onchange="setMultiImg(this,jQuery(this));" count="{:count}" />
<img class="multiDropZoneOverlay" id="multiImageImg_{:count}" src=""
onerror="this.src='<?=base_url("assets/images/add-image.png")?>';" />
<input id="event_image_{:count}" type="file" name="product_image[]" class="multiFileUpload" accept="image/*" onchange="setMultiImg(this,jQuery(this));" count="{:count}" />
<img class="multiDropZoneOverlay" id="multiImageImg_{:count}" src="" onerror="this.src='<?=base_url("assets/images/add-image.png")?>';" />
</div>
</div>
\ No newline at end of file
<div class="content-wrapper" >
<!-- Content Header (Page header) -->
<section class="content-header">
<h1>
<?= $pTitle ?>
......@@ -11,7 +10,6 @@
<li class="active"><?= $smenu ?></li>
</ol>
</section>
<!-- Main content -->
<section class="content">
<div class="row">
<div class="col-md-12">
......@@ -29,9 +27,9 @@
<div class="col-md-6"><h3 class="box-title">Brand List</h3></div>
<div class="col-md-6" align="right">
<?php if(!empty($product_data)){ ?>
<a class="btn btn-sm btn-success" href="<?= base_url('Product/exportProductData')?>">Generate Report</a>
<a class="btn btn-sm btn-success" href="<?= base_url('Product/exportProductData')?>">Generate Report</a>
<?php } ?>
<a class="btn btn-sm btn-primary" href="<?= base_url('Product/addProduct')?>">Add New Product</a>
<a class="btn btn-sm btn-primary" href="<?= base_url('Product/addProduct')?>">Add New Product</a>
<a class="btn btn-sm btn-primary" href="<?= base_url() ?>">Back</a>
</div>
</div>
......@@ -60,17 +58,13 @@
<th class="center"><?= $product->amount ?></th>
<th class="center"><?= ($product->status == 1)?'Active':'De-activate' ?></th>
<td class="center">
<a class="btn btn-sm btn-info" id="viewProductDetails"
product_id="<?= encode_param($product->product_id) ?>">
<i class="fa fa-fw fa-eye"></i>View
<a class="btn btn-sm btn-info" id="viewProductDetails" product_id="<?= encode_param($product->product_id) ?>">
<i class="fa fa-fw fa-eye"></i>View
</a>
<a class="btn btn-sm btn-primary"
href="<?= base_url('Product/editproduct/'.encode_param($product->product_id)) ?>">
<a class="btn btn-sm btn-primary" href="<?= base_url('Product/editproduct/'.encode_param($product->product_id)) ?>">
<i class="fa fa-fw fa-edit"></i>Edit
</a>
<a class="btn btn-sm btn-danger"
href="<?= base_url("Product/changeStatus/".encode_param($product->product_id))."/2" ?>"
onClick="return doconfirm()">
<a class="btn btn-sm btn-danger" href="<?= base_url("Product/changeStatus/".encode_param($product->product_id))."/2" ?>" onClick="return doconfirm()">
<i class="fa fa-fw fa-trash"></i>Delete
</a>
</td>
......
<div class="content-wrapper">
<section class="content-header">
<h1>
<?= $page_title ?>
<small><?= $page_desc ?></small>
</h1>
<h1><?= $page_title ?><small><?= $page_desc ?></small></h1>
<ol class="breadcrumb">
<li><a href="<?= base_url() ?>"><i class="fa fa-star-o" aria-hidden="true"></i>Home</a></li>
<li><?= $menu ?></li>
......@@ -34,25 +31,24 @@
<form method="post" class="validate" role="form" action="<?= base_url().'Settings/change_settings'?>" enctype="multipart/form-data" data-parsley-validate="">
<div class="box-body">
<div class="row">
<div class="form-group col-xs-4">
<label>Site Title</label>
<input type="text" name="title" class="form-control required" placeholder="Enter Site Title" value="<?= $data['title'] ?>">
</div>
<div class="form-group col-xs-3">
<div class="form-group col-xs-3">
<label>Title Short</label>
<input type="text" name="title_short" class="form-control required" placeholder="Enter Site Title" value="<?= $data['title_short'] ?>">
</div>
<div class="form-group col-xs-5">
<label>Site Logo</label>
<div class="col-md-12">
<div class="col-md-3">
<img id="site_logo" src="<?= base_url($data['site_logo']) ?>" onerror="this.src='<?=base_url("assets/images/no_image.png")?>';" height="75" width="75">
</div>
<div class="col-md-9" style="padding-top: 25px;">
<input name="site_logo" type="file" accept="image/*" onchange="setImg(this,'site_logo');" />
</div>
<label>Site Logo</label>
<div class="col-md-12">
<div class="col-md-3">
<img id="site_logo" src="<?= base_url($data['site_logo']) ?>" onerror="this.src='<?=base_url("assets/images/no_image.png")?>';" height="75" width="75">
</div>
<div class="col-md-9" style="padding-top: 25px;">
<input name="site_logo" type="file" accept="image/*" onchange="setImg(this,'site_logo');" />
</div>
</div>
</div>
</div>
<div class="row">
......@@ -64,17 +60,16 @@
<label>Currency</label>
<input type="text" name="currency" class="form-control required" placeholder="Enter SMTP Password" value="<?= $data['currency'] ?>">
</div>
<div class="form-group col-xs-5">
<label>Favicon Icon</label>
<div class="col-md-12">
<div class="col-md-3">
<img id="fav_icon_image" src="<?= base_url($data['fav_icon']) ?>" onerror="this.src='<?=base_url("assets/images/no_image.png")?>';" height="75" width="75">
</div>
<div class="col-md-9" style="padding-top: 25px;">
<input name="fav_icon" type="file" accept="image/*" onchange="setImg(this,'fav_icon_image');" />
</div>
<label>Favicon Icon</label>
<div class="col-md-12">
<div class="col-md-3">
<img id="fav_icon_image" src="<?= base_url($data['fav_icon']) ?>" onerror="this.src='<?=base_url("assets/images/no_image.png")?>';" height="75" width="75">
</div>
<div class="col-md-9" style="padding-top: 25px;">
<input name="fav_icon" type="file" accept="image/*" onchange="setImg(this,'fav_icon_image');" />
</div>
</div>
</div>
</div>
<div class="row">
......
<div class="content-wrapper">
<section class="content-header">
<h1>
<?= $pTitle ?>
<small><?= $pDescription ?></small>
</h1>
<h1><?= $pTitle ?><small><?= $pDescription ?></small></h1>
<ol class="breadcrumb">
<li><a href="<?= base_url() ?>"><i class="fa fa-star-o" aria-hidden="true"></i>Home</a></li>
<li><?= $menu ?></li>
......
<div class="content-wrapper" >
<!-- Content Header (Page header) -->
<section class="content-header">
<h1>
<?= $pTitle ?>
<small><?= $pDescription ?></small>
</h1>
<h1><?= $pTitle ?><small><?= $pDescription ?></small></h1>
<ol class="breadcrumb">
<li><a href="<?= base_url() ?>"><i class="fa fa-star-o" aria-hidden="true"></i>Home</a></li>
<li><?= $menu ?></li>
<li class="active"><?= $smenu ?></li>
</ol>
</section>
<!-- Main content -->
<section class="content">
<div class="row">
<div class="col-md-12">
......@@ -30,7 +25,7 @@
<div class="col-md-6" align="right">
<a class="btn btn-sm btn-primary" href="<?= base_url('Shop/addShop') ?>">Add New Shop</a>
<a class="btn btn-sm btn-primary" href="<?= base_url() ?>">Back</a>
</div>
</div>
</div>
<div class="box-body">
<table id="mechanicUsers" class="table table-bordered table-striped datatable ">
......@@ -43,7 +38,7 @@
<th width="250px;">Address</th>
<th width="100px;">Status</th>
<th width="300px;">Action</th>
</tr>
</tr>
</thead>
<tbody>
<?php
......@@ -57,13 +52,10 @@
<th class="center"><?= $shop->address ?></th>
<th class="center"><?= ($shop->status == 1)?'Active':'De-activate' ?></th>
<td class="center">
<a class="btn btn-sm btn-primary"
href="<?= base_url('Shop/editShop/'.encode_param($shop->shop_id)) ?>">
<a class="btn btn-sm btn-primary" href="<?= base_url('Shop/editShop/'.encode_param($shop->shop_id)) ?>">
<i class="fa fa-fw fa-edit"></i>Edit
</a>
<a class="btn btn-sm btn-danger"
href="<?= base_url("Shop/changeStatus/".encode_param($shop->shop_id))."/2" ?>"
onClick="return doconfirm()">
<a class="btn btn-sm btn-danger" href="<?= base_url("Shop/changeStatus/".encode_param($shop->shop_id))."/2" ?>" onClick="return doconfirm()">
<i class="fa fa-fw fa-trash"></i>Delete
</a>
<?php if($shop->status == 1){ ?>
......
<!-- POP-UP VIEW MODAL END -->
<div class="modal fade" id="popup_modal" role="dialog">
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">&times;</button>
<h4 class="modal-title" id="modal_header"></h4>
</div>
<div class="modal-body col-md-12" id="modal_content" style="border-bottom:1px solid #e5e5e5;">
<!-- POP-UP VIEW MODAL CONTENT -->
</div>
<div class="modal-footer">
<div>&nbsp;</div>
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
<!-- POP-UP VIEW MODAL END -->
<footer class="main-footer">
<div class="pull-right hidden-xs">
<b>Version</b> 1.0
<div class="modal fade" id="popup_modal" role="dialog">
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">&times;</button>
<h4 class="modal-title" id="modal_header"></h4>
</div>
<div class="modal-body col-md-12" id="modal_content" style="border-bottom:1px solid #e5e5e5;"></div>
<div class="modal-footer">
<div>&nbsp;</div>
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
</div>
</div>
<strong>Copyright &copy; <?= date('Y')?> - <?= date('Y')+1?> <a href="#">CarFixxers</a>.</strong> All rights reserved.
</footer>
\ No newline at end of file
</div>
</div>
<footer class="main-footer">
<div class="pull-right hidden-xs">
<b>Version</b> 1.0
</div>
<strong>Copyright &copy; <?= date('Y')?> - <?= date('Y')+1?> <a href="#">CarFixxers</a>.</strong> All rights reserved.
</footer>
\ No newline at end of file
......@@ -44,7 +44,6 @@
</div>
</nav>
</header>
<div id="errModal" class="modal fade" role="dialog">
<div class="modal-dialog">
<div class="modal-content">
......
......@@ -7,9 +7,7 @@
<title><?= $settings['title_short'] ?></title>
<link rel="icon" href="<?= base_url($settings['fav_icon'])?>" type="image/x-icon"/>
<link rel="shortcut icon" href="<?= base_url($settings['fav_icon']) ?>" type="image/x-icon"/>
<meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
<link rel="stylesheet" href="<?= base_url('assets/css/bootstrap.min.css') ?>">
<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css" rel="stylesheet">
<link rel="stylesheet" href="https://code.ionicframework.com/ionicons/2.0.1/css/ionicons.min.css">
......@@ -23,6 +21,5 @@
<link rel="stylesheet" href="<?= base_url('assets/css/bootstrap-datepicker3.css') ?>">
<link rel="stylesheet" href="<?= base_url('assets/css/clockpicker.css') ?>" type="text/css" >
<link rel="stylesheet" href="<?= base_url('assets/css/morris.css')?>">
<script src="<?= base_url('assets/js/jQuery-2.1.4.min.js') ?>"></script>
</head>
\ No newline at end of file
<!-- Left side column. contains the logo and sidebar -->
<aside class="main-sidebar">
<!-- sidebar: style can be found in sidebar.less -->
<aside class="main-sidebar">
<section class="sidebar">
<!-- Sidebar user panel -->
<div class="user-panel">
<div class="pull-left image">
<img src="<?=base_url($this->session->userdata('profile_pic'))?>" onerror="this.src='<?=base_url("assets/images/user_avatar.jpg")?>'" class="user-image left-sid" alt="User Image">
</div>
<div class="pull-left info">
<p><?php echo $this->session->userdata('logged_in_admin')['username']; ?></p>
<a href="#"><i class="fa fa-circle text-success"></i> Online</a>
</div>
</div>
<ul class="sidebar-menu">
<li><a href="<?= base_url('Dashboard') ?>"><i class="fa fa-wrench" aria-hidden="true">
</i><span>Dashboard</span></a>
......@@ -22,7 +16,7 @@
<li class="treeview">
<a href="#">
<i class="fa fa-bars" aria-hidden="true"></i>
<span>Auto Service Centers</span>
<span>Auto Service Centers</span>
<i class="fa fa-angle-left pull-right"></i>
</a>
<ul class="treeview-menu">
......@@ -43,7 +37,7 @@
<li class="treeview">
<a href="#">
<i class="fa fa-bars" aria-hidden="true"></i>
<span>Services</span>
<span>Services</span>
<i class="fa fa-angle-left pull-right"></i>
</a>
<ul class="treeview-menu">
......@@ -177,7 +171,6 @@
</li>
</ul>
</li>
<li class="treeview">
<a href="#">
<i class="fa fa-bars" aria-hidden="true"></i>
......@@ -206,6 +199,5 @@
</li>
<?php } ?>
</ul>
</section>
<!-- /.sidebar -->
</section>
</aside>
<div class="content-wrapper">
<section class="content-header">
<h1>
<?= $pTitle ?>
<small><?= $pDescription ?></small>
</h1>
<h1><?= $pTitle ?><small><?= $pDescription ?></small></h1>
<ol class="breadcrumb">
<li><a href="<?= base_url() ?>"><i class="fa fa-star-o" aria-hidden="true"></i>Home</a></li>
<li><?= $menu ?></li>
......@@ -26,7 +23,6 @@
<div class="box box-warning">
<div class="box-body">
<form role="form" action="<?=base_url('User/updateUser')?>" method="post" class="validate" data-parsley-validate="" enctype="multipart/form-data">
<!-- Basic Details -->
<div class="col-md-12">
<div class="box-header with-border padUnset">
<h3 class="box-title">Basic Details</h3>
......@@ -40,7 +36,6 @@
value="<?= $user_data->display_name ?>" placeholder="Enter Display Name">
<span class="glyphicon form-control-feedback"></span>
</div>
<div class="form-group">
<label>User Name</label>
<input type="text" class="form-control required" data-parsley-trigger="change"
......@@ -63,13 +58,10 @@
</div>
</div>
</div>
<?php
if(isset($user_data->mechanic_data) && !empty($user_data->mechanic_data)){
$mechanic_data = $user_data->mechanic_data;
?>
<!-- Mechanic Data -->
<div class="col-md-12">
<div class="box-header with-border padUnset">
<h3 class="box-title">Personal Details</h3>
......@@ -165,7 +157,6 @@
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label>Licence Proof Image</label>
<div class="col-md-12" style="padding-bottom:10px;">
......@@ -173,15 +164,12 @@
<img id="licence_image" src="<?= base_url($mechanic_data->licence) ?>" onerror="this.src='<?=base_url("assets/images/no_image.png")?>';" height="75" width="75" />
</div>
<div class="col-md-9" style="padding-top: 25px;">
<input name="licence" type="file" accept="image/*"
onchange="setImg(this,'licence_image');" />
<input name="licence" type="file" accept="image/*" onchange="setImg(this,'licence_image');" />
</div>
</div>
</div>
</div>
<?php } ?>
<!-- Change Password -->
<div class="col-md-12">
<div class="box-header with-border padUnset">
<h3 class="box-title">Change Password</h3>
......
<?php
$user_data = $this->session->userdata['user'];
?>
<div class="content-wrapper">
<section class="content-header">
<h1>
<?= $pTitle ?>
<small><?= $pDescription ?></small>
</h1>
<h1><?= $pTitle ?><small><?= $pDescription ?></small></h1>
<ol class="breadcrumb">
<li><a href="<?= base_url() ?>"><i class="fa fa-star-o" aria-hidden="true"></i>Home</a></li>
<li><?= $menu ?></li>
<li class="active"><?= $smenu ?></li>
<li><a href="<?= base_url() ?>"><i class="fa fa-star-o" aria-hidden="true"></i>Home</a></li>
<li><?= $menu ?></li>
<li class="active"><?= $smenu ?></li>
</ol>
</section>
<section class="content">
<div class="row">
<div class="col-md-12">
<?php
if($this->session->flashdata('message')) {
$flashdata = $this->session->flashdata('message'); ?>
<div class="alert alert-<?= $flashdata['class'] ?>">
<button class="close" data-dismiss="alert" type="button">×</button>
<?= $flashdata['message'] ?>
</div>
<?php } ?>
</div>
<div class="col-md-12">
<div class="box box-warning">
<div class="box-header with-border">
<div class="col-md-6"><h3 class="box-title">Admin Details</h3></div>
<div class="col-md-6" align="right">
<a class="btn btn-sm btn-primary" href="<?= base_url('User/editProfile') ?>">Edit</a>
<a class="btn btn-sm btn-primary" href="<?= base_url() ?>">Back</a>
</div>
</div>
<div class="box-body">
<section class="content">
<div class="row">
<div class="col-md-12">
<div class="col-md-2">
<div class="form-group has-feedback">
<img src="<?= base_url($user_data->profile_image) ?>" class="cpoint"
onclick="viewImageModal('Profile Image','<?= base_url($user_data->profile_image) ?>');"
onerror="this.src='<?=base_url("assets/images/user_avatar.jpg")?>';" height="100" width="100" />
</div>
</div>
<div class="col-md-5">
<div class="row">
<div class="col-md-5"><span>Display Name </span></div>
<div class="col-md-7">
<span>:</span>
<label class="padLeft20">
<?= $user_data->display_name ?>
</label>
</div>
</div>
<div class="row">
<div class="col-md-5"><span>User Name </span></div>
<div class="col-md-7">
<span>:</span>
<label class="padLeft20">
<?= $user_data->username ?>
</label>
</div>
</div>
<?php
if($this->session->userdata('user_type') == 2 &&
isset($this->session->userdata['mechanic_data']) &&
!empty($this->session->userdata['mechanic_data'])){
$mechanic_data = $this->session->userdata['user']->mechanic_data; ?>
<div class="row padTop20">
<div class="col-md-5"><span>First Name </span></div>
<div class="col-md-7">
<span>:</span>
<label class="padLeft20">
<?= $mechanic_data->first_name ?>
</label>
</div>
</div>
<div class="row">
<div class="col-md-5"><span>Last Name </span></div>
<div class="col-md-7">
<span>:</span>
<label class="padLeft20">
<?= $mechanic_data->last_name ?>
</label>
</div>
</div>
<div class="row">
<div class="col-md-5"><span>Phone Number </span></div>
<div class="col-md-7">
<span>:</span>
<label class="padLeft20">
<?= $mechanic_data->phone ?>
</label>
</div>
</div>
<div class="row">
<div class="col-md-5"><span>Email ID </span></div>
<div class="col-md-7">
<span>:</span>
<label class="padLeft20">
<?= $mechanic_data->email_id ?>
</label>
</div>
</div>
<div class="row">
<div class="col-md-5"><span>Address </span></div>
<div class="col-md-7">
<span>:</span>
<label class="padLeft20">
<?= $mechanic_data->address ?>
</label>
</div>
</div>
<div class="row">
<div class="col-md-5"><span>City </span></div>
<div class="col-md-7">
<span>:</span>
<label class="padLeft20">
<?= $mechanic_data->city ?>
</label>
</div>
<?php
if($this->session->flashdata('message')) {
$flashdata = $this->session->flashdata('message'); ?>
<div class="alert alert-<?= $flashdata['class'] ?>">
<button class="close" data-dismiss="alert" type="button">×</button>
<?= $flashdata['message'] ?>
</div>
<div class="row">
<div class="col-md-5"><span>State </span></div>
<div class="col-md-7">
<span>:</span>
<label class="padLeft20">
<?= $mechanic_data->state ?>
</label>
<?php } ?>
</div>
<div class="col-md-12">
<div class="box box-warning">
<div class="box-header with-border">
<div class="col-md-6"><h3 class="box-title">Admin Details</h3></div>
<div class="col-md-6" align="right">
<a class="btn btn-sm btn-primary" href="<?= base_url('User/editProfile') ?>">Edit</a>
<a class="btn btn-sm btn-primary" href="<?= base_url() ?>">Back</a>
</div>
</div>
<?php
if(isset($this->session->userdata['mechanic_shop_data']) &&
!empty($this->session->userdata['mechanic_shop_data'])){
$shop_data = $this->session->userdata['mechanic_shop_data'];
?>
<div class="row padTop20">
<div class="col-md-5"><span>Shop Name </span></div>
<div class="col-md-7">
<span>:</span>
<label class="padLeft20">
<?= $shop_data->shop_name ?>
</label>
</div>
</div>
<div class="row">
<div class="col-md-5"><span>Shop Address </span></div>
<div class="col-md-7">
<span>:</span>
<label class="padLeft20">
<?= $shop_data->address ?>
</label>
</div>
</div>
<div class="row">
<div class="col-md-5"><span>Shop Phone </span></div>
<div class="col-md-7">
<span>:</span>
<label class="padLeft20">
<?= $shop_data->phone ?>
</label>
<div class="box-body">
<div class="col-md-12">
<div class="col-md-2">
<div class="form-group has-feedback">
<img src="<?= base_url($user_data->profile_image) ?>" class="cpoint" onclick="viewImageModal('Profile Image','<?= base_url($user_data->profile_image) ?>');"
onerror="this.src='<?=base_url("assets/images/user_avatar.jpg")?>';" height="100" width="100" />
</div>
</div>
</div>
<div class="row">
<div class="col-md-5"><span>Shop Email </span></div>
<div class="col-md-7">
<span>:</span>
<label class="padLeft20">
<?= $shop_data->email_id ?>
</label>
<div class="col-md-5">
<div class="row">
<div class="col-md-5"><span>Display Name </span></div>
<div class="col-md-7">
<span>:</span>
<label class="padLeft20">
<?= $user_data->display_name ?>
</label>
</div>
</div>
<div class="row">
<div class="col-md-5"><span>User Name </span></div>
<div class="col-md-7">
<span>:</span>
<label class="padLeft20">
<?= $user_data->username ?>
</label>
</div>
</div>
<?php
if($this->session->userdata('user_type') == 2 &&
isset($this->session->userdata['mechanic_data']) &&
!empty($this->session->userdata['mechanic_data'])){
$mechanic_data = $this->session->userdata['user']->mechanic_data; ?>
<div class="row padTop20">
<div class="col-md-5"><span>First Name </span></div>
<div class="col-md-7">
<span>:</span>
<label class="padLeft20">
<?= $mechanic_data->first_name ?>
</label>
</div>
</div>
<div class="row">
<div class="col-md-5"><span>Last Name </span></div>
<div class="col-md-7">
<span>:</span>
<label class="padLeft20">
<?= $mechanic_data->last_name ?>
</label>
</div>
</div>
<div class="row">
<div class="col-md-5"><span>Phone Number </span></div>
<div class="col-md-7">
<span>:</span>
<label class="padLeft20">
<?= $mechanic_data->phone ?>
</label>
</div>
</div>
<div class="row">
<div class="col-md-5"><span>Email ID </span></div>
<div class="col-md-7">
<span>:</span>
<label class="padLeft20">
<?= $mechanic_data->email_id ?>
</label>
</div>
</div>
<div class="row">
<div class="col-md-5"><span>Address </span></div>
<div class="col-md-7">
<span>:</span>
<label class="padLeft20">
<?= $mechanic_data->address ?>
</label>
</div>
</div>
<div class="row">
<div class="col-md-5"><span>City </span></div>
<div class="col-md-7">
<span>:</span>
<label class="padLeft20">
<?= $mechanic_data->city ?>
</label>
</div>
</div>
<div class="row">
<div class="col-md-5"><span>State </span></div>
<div class="col-md-7">
<span>:</span>
<label class="padLeft20">
<?= $mechanic_data->state ?>
</label>
</div>
</div>
<?php
if(isset($this->session->userdata['mechanic_shop_data']) &&
!empty($this->session->userdata['mechanic_shop_data'])){
$shop_data = $this->session->userdata['mechanic_shop_data'];
?>
<div class="row padTop20">
<div class="col-md-5"><span>Shop Name </span></div>
<div class="col-md-7">
<span>:</span>
<label class="padLeft20">
<?= $shop_data->shop_name ?>
</label>
</div>
</div>
<div class="row">
<div class="col-md-5"><span>Shop Address </span></div>
<div class="col-md-7">
<span>:</span>
<label class="padLeft20">
<?= $shop_data->address ?>
</label>
</div>
</div>
<div class="row">
<div class="col-md-5"><span>Shop Phone </span></div>
<div class="col-md-7">
<span>:</span>
<label class="padLeft20">
<?= $shop_data->phone ?>
</label>
</div>
</div>
<div class="row">
<div class="col-md-5"><span>Shop Email </span></div>
<div class="col-md-7">
<span>:</span>
<label class="padLeft20">
<?= $shop_data->email_id ?>
</label>
</div>
</div>
<?php } ?>
</div>
<div class="col-md-5">
<div class="row">
<div class="col-md-5"><span>Licence Number </span></div>
<div class="col-md-7">
<span>:</span>
<label class="padLeft20">
<?= $mechanic_data->licence_number ?>
</label>
</div>
</div>
<div class="row">
<div class="col-md-5"><span>Licence Exp. Date </span></div>
<div class="col-md-7">
<span>:</span>
<label class="padLeft20">
<?= $mechanic_data->licence_exp_date ?>
</label>
</div>
</div>
<div class="row">
<div class="col-md-5">
<span>Licence </span>
</div>
<div class="col-md-12">
<img src="<?= base_url($mechanic_data->licence) ?>"
onclick="viewImageModal('Licence Image','<?= base_url($mechanic_data->licence) ?>');" onerror="this.src='<?=base_url("assets/images/no_image.png")?>';" class="cpoint" alt="Licence Image" height="200px" width="auto" style="padding-left: 20%;">
</div>
</div>
</div>
<?php } else { ?>
</div>
</div>
<?php } ?>
</div>
<div class="col-md-5">
<div class="row">
<div class="col-md-5"><span>Licence Number </span></div>
<div class="col-md-7">
<span>:</span>
<label class="padLeft20">
<?= $mechanic_data->licence_number ?>
</label>
</div>
</div>
<div class="row">
<div class="col-md-5"><span>Licence Exp. Date </span></div>
<div class="col-md-7">
<span>:</span>
<label class="padLeft20">
<?= $mechanic_data->licence_exp_date ?>
</label>
</div>
</div>
<div class="row">
<div class="col-md-5">
<span>Licence </span>
</div>
<div class="col-md-12">
<img src="<?= base_url($mechanic_data->licence) ?>"
onclick="viewImageModal('Licence Image','<?= base_url($mechanic_data->licence) ?>');"
onerror="this.src='<?=base_url("assets/images/no_image.png")?>';"
class="cpoint" alt="Licence Image" height="200px" width="auto"
style="padding-left: 20%;">
</div>
</div>
</div>
<?php } else { ?>
<?php } ?>
</div>
<?php } ?>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</section>
</div>
\ No newline at end of file
<div class="content-wrapper">
<section class="content-header">
<h1>
<?= $pTitle ?>
<small><?= $pDescription ?></small>
</h1>
<h1><?= $pTitle ?><small><?= $pDescription ?></small></h1>
<ol class="breadcrumb">
<li><a href="<?= base_url() ?>"><i class="fa fa-star-o" aria-hidden="true"></i>Home</a></li>
<li><?= $menu ?></li>
......@@ -26,8 +23,7 @@
<div class="col-md-12">
<div class="box box-warning">
<div class="box-body">
<form role="form" action="<?= base_url($url) ?>" method="post"
class="validate" data-parsley-validate="" enctype="multipart/form-data">
<form role="form" action="<?= base_url($url) ?>" method="post" class="validate" data-parsley-validate="" enctype="multipart/form-data">
<div class="col-md-6">
<div class="form-group">
<label>Brand Name</label>
......
<div class="content-wrapper">
<section class="content-header">
<h1>
<?= $pTitle ?>
<small><?= $pDescription ?></small>
</h1>
<h1><?= $pTitle ?><small><?= $pDescription ?></small></h1>
<ol class="breadcrumb">
<li><a href="<?= base_url() ?>"><i class="fa fa-star-o" aria-hidden="true"></i>Home</a></li>
<li><?= $menu ?></li>
......@@ -51,7 +48,7 @@
<label>Model Name</label>
<input type="text" class="form-control required" data-parsley-trigger="change"
data-parsley-minlength="2" data-parsley-pattern="^[a-zA-Z0-9\ . _ - ' \/]+$"
name="model" required="" value="<?= (isset($vehModel_data->model))?$vehModel_data->model:'' ?>"placeholder="Enter Vehicle Model">
name="model" required="" value="<?= (isset($vehModel_data->model))?$vehModel_data->model:'' ?>" placeholder="Enter Vehicle Model">
<span class="glyphicon form-control-feedback"></span>
</div>
</div>
......
<div class="content-wrapper" >
<section class="content-header">
<h1>
<?= $pTitle ?>
<small><?= $pDescription ?></small>
</h1>
<h1><?= $pTitle ?><small><?= $pDescription ?></small></h1>
<ol class="breadcrumb">
<li><a href="<?= base_url() ?>"><i class="fa fa-star-o" aria-hidden="true"></i>Home</a></li>
<li><?= $menu ?></li>
......@@ -49,13 +46,10 @@
<th class="center"><?= $brand->maker ?></th>
<th class="center"><?= ($brand->status == 1)?'Active':'De-activate' ?></th>
<td class="center">
<a class="btn btn-sm btn-primary"
href="<?= base_url('Vehicle/editVehBrand/'.encode_param($brand->veh_brand_id)) ?>">
<a class="btn btn-sm btn-primary" href="<?= base_url('Vehicle/editVehBrand/'.encode_param($brand->veh_brand_id)) ?>">
<i class="fa fa-fw fa-edit"></i>Edit
</a>
<a class="btn btn-sm btn-danger"
href="<?= base_url("Vehicle/changeVehicleStatus/".encode_param($brand->veh_brand_id))."/2" ?>"
onClick="return doconfirm()">
<a class="btn btn-sm btn-danger" href="<?= base_url("Vehicle/changeVehicleStatus/".encode_param($brand->veh_brand_id))."/2" ?>" onClick="return doconfirm()">
<i class="fa fa-fw fa-trash"></i>Delete
</a> <?php if($brand->status == 1){ ?>
<a class="btn btn-sm btn-success" style="background-color:#ac2925" href="<?= base_url("Vehicle/changeVehicleStatus/".encode_param($brand->veh_brand_id))."/0" ?>">
......
<div class="content-wrapper" >
<section class="content-header">
<h1>
<?= $pTitle ?>
<small><?= $pDescription ?></small>
</h1>
<h1><?= $pTitle ?><small><?= $pDescription ?></small></h1>
<ol class="breadcrumb">
<li><a href="<?= base_url() ?>"><i class="fa fa-star-o" aria-hidden="true"></i>Home</a></li>
<li><?= $menu ?></li>
......@@ -16,8 +13,8 @@
<?php if($this->session->flashdata('message')) {
$flashdata = $this->session->flashdata('message'); ?>
<div class="alert alert-<?= $flashdata['class'] ?>">
<button class="close" data-dismiss="alert" type="button">×</button>
<?= $flashdata['message'] ?>
<button class="close" data-dismiss="alert" type="button">×</button>
<?= $flashdata['message'] ?>
</div>
<?php } ?>
</div>
......@@ -41,7 +38,7 @@
<th width="150px;">Engine</th>
<th width="100px;">Status</th>
<th width="300px;">Action</th>
</tr>
</tr>
</thead>
<tbody>
<?php
......@@ -55,12 +52,10 @@
<th class="center"><?= $model->engine ?></th>
<th class="center"><?= ($model->status == 1)?'Active':'De-activate' ?></th>
<td class="center">
<a class="btn btn-sm btn-primary"
href="<?= base_url('Vehicle/editVehModel/'.encode_param($model->veh_modal_id)) ?>">
<a class="btn btn-sm btn-primary" href="<?= base_url('Vehicle/editVehModel/'.encode_param($model->veh_modal_id)) ?>">
<i class="fa fa-fw fa-edit"></i>Edit
</a>
<a class="btn btn-sm btn-danger"
href="<?= base_url("Vehicle/changeModelStatus/".encode_param($model->veh_modal_id))."/2" ?>"
<a class="btn btn-sm btn-danger" href="<?= base_url("Vehicle/changeModelStatus/".encode_param($model->veh_modal_id))."/2" ?>"
onClick="return doconfirm()">
<i class="fa fa-fw fa-trash"></i>Delete
</a>
......
<!DOCTYPE html>
<html>
<?php
$this->load->view('Templates/header-script');
$this->load->view('Templates/header-script');
?>
<body class="hold-transition <?php echo $this->config->item("theme_color"); ?> sidebar-mini">
<div class="wrapper">
<?php
$this->load->view('Templates/header-menu');
//$this->load->view('Templates/left-menu');
$this->load->view('Templates/left-menu');
$this->load->view($page);
$this->load->view('Templates/footer');
?>
$this->load->view('Templates/header-menu');
$this->load->view('Templates/left-menu');
$this->load->view($page);
$this->load->view('Templates/footer');
?>
</div>
<?php
$this->load->view('Templates/footer-script');
$this->load->view('Templates/footer-script');
?>
</body>
</html>
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