Commit f9f7a779 by Tobin

Merge branch 'master' into 'dev_production'

Master See merge request !51
parents 0d22429b f4f71a89
......@@ -98,7 +98,6 @@ class Bookings extends CI_Controller {
echo json_encode($return_arr);exit;
}
$custom_booking_id = decode_param($_POST['custom_id']);
// print_r($custom_booking_id);exit();
$CustData = $this->Booking_model->getCustomData($custom_booking_id);
if(!empty($CustData)){
$return_arr['status'] = 1;
......@@ -107,5 +106,60 @@ class Bookings extends CI_Controller {
}
echo json_encode($return_arr);exit;
}
public function exportBookingData($mechanic_id = ''){
$bookingData = $this->Booking_model->getMechBookings($mechanic_id,'','0,1,3,4');
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');
foreach (json_decode($bookData->issues_selected) as $key => $value) {
$new[] = $value->issue_category;
}
$status = 'Pending';
switch ($bookData->status) {
case '0': $status = 'Pending';break;
case '1': $status = 'Accepted ';break;
case '2': $status = 'Deleted';break;
case '3': $status = 'Completed';break;
case '4': $status = 'Cancelled';break;
case '5': $status = 'Payment Processing';break;
}
$data = array();
$data[] = $mechanic->booking_id;
$data[] = $bookData->custFirstName.' '.$mechanic->custLastName;
$data[] = $mechanic->mileage;
$data[] = $bookData->cost;
$data[] = $bookData->scheduled_date;
$data[] = $bookData->scheduled_time;
$data[] = $bookData->phone;
$data[] = $bookData->email;
$data[] = $bookData->car_model.' '.$bookData->car_maker.' '.$bookData->car_model_year;
$data[] = $bookData->car_maker;
$data[] = $bookData->car_model_year;
$data[] = $bookData->car_location;
$data[] = implode(',',$new);
$data[] = $status;
if($bookData->status == '1'){
$data[] = $bookData->mechanic_data[0]->first_name.' '.$bookData->mechanic_data[0]->last_name;
}
fputcsv($fpoint, $data, ',');
}
fseek($fpoint, 0);
header('Content-Type: application/csv');
header('Content-Disposition: attachement; filename="' . $file . '";');
fpassthru($fpoint);
}
}
?>
\ No newline at end of file
......@@ -155,6 +155,33 @@ class Brand extends CI_Controller {
}
}
// public function import_data(){
// $template['page'] = 'Brand/importdata';
// $template['menu'] = 'brand Management';
// $template['smenu'] = 'Edit brand';
// $template['pTitle'] = "Edit brand";
// $template['brand_id'] = '';
// $template['pDescription'] = "Update brand Data";
// $this->load->view('template',$template);
// }
// public function importCsvData(){
// $filename=$_FILES["brand_logo"]["name"];
// $ext=pathinfo($filename, PATHINFO_EXTENSION);
// if($ext=="csv")
// {
// $file = fopen($filename, "r");
// while (($emapData = fgetcsv($file, 10000, ",")) !== FALSE)
// {
// $sql = "INSERT into import(product_id,name,brand_name,short_description,part_id,vehicle_model,amount,status) values('$emapData[0]','$emapData[1]','$emapData[2]','$emapData[3]','$emapData[4]','$emapData[5]','$emapData[6]','$emapData[7]')";
// $this->db->query($sql);
// }
// fclose($file);
// echo "CSV File has been successfully Imported.";
// }
// }
}
?>
\ No newline at end of file
......@@ -7,6 +7,7 @@ class Customer extends CI_Controller {
parent::__construct();
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'));
......@@ -25,7 +26,8 @@ class Customer extends CI_Controller {
$template['menu'] = "Customer Management";
$template['smenu'] = "Add Customer";
$template['veh_data']['make'] = $this->Vehicle_model->getVehBrand('',1);
$template['veh_data']['model'] = $this->Vehicle_model->getVehModel('',1);
$this->load->view('template',$template);
}
......@@ -171,6 +173,8 @@ class Customer extends CI_Controller {
$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));
......@@ -248,5 +252,44 @@ class Customer extends CI_Controller {
redirect(base_url('Customer/editCustomer/'.$customer_id));
}
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)){
foreach($carData->vehicle_data AS $car){
$cars = $car->car_name.',';
$cars = trim($cars,',');
}
}
$data[] = $customer->customer_id;
$data[] = $customer->first_name.' '.$customer->last_name;
$data[] = $customer->phone;
$data[] = $customer->email;
$data[] = $customer->address;
$data[] = $customer->date_of_birth;
$data[] = ($customer->status == 1)?'Active':'De-active';
$data[] = $cars;
fputcsv($fpoint, $data, ',');
}
fseek($fpoint, 0);
header('Content-Type: application/csv');
header('Content-Disposition: attachement; filename="' . $file . '";');
fpassthru($fpoint);
}
}
?>
\ No newline at end of file
......@@ -304,5 +304,47 @@ class Mechanic extends CI_Controller {
redirect(base_url('Mechanic/editMechanics/'.$mechanic_id));
}
}
public function exportMechanicData(){
$mechData = $this->Mechanic_model->getMechanic();
if(empty($mechData)){
return;
}
$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;
$data[] = $mechanic->display_name;
$data[] = $mechanic->phone;
$data[] = $mechanic->email_id;
$data[] = $mechanic->address;
$data[] = $mechanic->city;
$data[] = $mechanic->state;
$data[] = $mechanic->licence_number;
$data[] = $mechanic->licence_exp_date;
$data[] = $mechanic->start_time;
$data[] = $mechanic->end_time;
$data[] = ($mechanic->status == 1)?'Active':'De-active';
$data[] = $mechanic->shop_id;
$data[] = $mechanic->shop_name;
$data[] = $mechanic->shop_address;
$data[] = $mechanic->shop_phone;
$data[] = $mechanic->shop_email;
fputcsv($fpoint, $data, ',');
}
fseek($fpoint, 0);
header('Content-Type: application/csv');
header('Content-Disposition: attachement; filename="' . $file . '";');
fpassthru($fpoint);
}
}
?>
\ No newline at end of file
......@@ -41,5 +41,56 @@ class Orders extends CI_Controller {
}
echo json_encode($return_arr);exit;
}
public function changeOrderStatus(){
$status = 0;
$return_arr = array('status'=>'0');
if(!isset($_POST) || empty($_POST) || !isset($_POST['order_id']) || empty($_POST['order_id']) || empty(decode_param($_POST['order_id']))){
echo json_encode($return_arr);exit;
}
$status = $this->Order_model->changeOrderStatus($_POST);
$return_arr['status'] = $status;
echo json_encode($return_arr);exit;
}
public function exportOrderData(){
$orderData = $this->Order_model->getOrders();
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;
$data[] = $odrData->product_name;
$data[] = $odrData->brand_name;
$data[] = $odrData->short_description;
$data[] = $odrData->quantity;
$data[] = $odrData->amount;
$data[] = $odrData->ord_status;
if($odrData->status == '2' || $odrData->status == '3' || $odrData->status == '4'){
$data[] = $odrData->expected_delivery;
}
if($odrData->status == '5' || $odrData->status == '6'){
$data[] = $odrData->delivered;
}
fputcsv($fpoint, $data, ',');
}
fseek($fpoint, 0);
header('Content-Type: application/csv');
header('Content-Disposition: attachement; filename="' . $file . '";');
fpassthru($fpoint);
}
}
?>
\ No newline at end of file
......@@ -8,6 +8,7 @@ class Product extends CI_Controller {
date_default_timezone_set("Asia/Kolkata");
$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'));
......@@ -23,6 +24,8 @@ class Product extends CI_Controller {
$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);
$template['brand_data'] = $this->Brand_model->getbrand('',1);
$this->load->view('template',$template);
}
......@@ -34,7 +37,8 @@ class Product extends CI_Controller {
$template['pTitle'] = "View Product";
$template['pDescription'] = "View and Manage Product";
$template['product_data'] = $this->Product_model->getProduct('',1);
$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);
}
......@@ -57,7 +61,7 @@ class Product extends CI_Controller {
$flashMsg = array('message'=>'Something went wrong, please try again..!','class'=>'error');
if(!isset($_POST) || empty($_POST)){
$this->session->set_flashdata('message',$flashMsg);
redirect(base_url('Product/addProduct'));
redirect(base_url('Product/addproduct'));
}
if($err == 0 && (!isset($_POST['brand_id']) || empty($_POST['brand_id']))){
$err = 1;
......@@ -91,8 +95,9 @@ class Product extends CI_Controller {
if($err == 1){
$flashMsg['message'] = $errMsg;
$this->session->set_flashdata('message',$flashMsg);
redirect(base_url('Product/addProduct'));
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){
......@@ -125,7 +130,7 @@ class Product extends CI_Controller {
redirect(base_url('Product/viewProducts'));
}else {
$this->session->set_flashdata('message', $flashMsg);
redirect(base_url('Product/addProduct'));
redirect(base_url('Product/addproduct'));
}
}
}
......@@ -137,7 +142,7 @@ class Product extends CI_Controller {
redirect(base_url('Product/viewProducts'));
}
$template['page'] = 'Product/addProduct';
$template['page'] = 'Product/addproduct';
$template['menu'] = 'Brand Management';
$template['smenu'] = 'Edit brand';
$template['pTitle'] = "Edit brand";
......@@ -146,6 +151,8 @@ class Product extends CI_Controller {
$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['veh_data']['model'] = $this->Vehicle_model->getVehModel('',1, $template['product_data']->veh_brand_id);
$template['product_image'] = $this->Product_model->getProductImage($product_id);
$template['brand_id'] = $template['product_data']->brand_id;
......@@ -162,7 +169,7 @@ class Product extends CI_Controller {
}
if(!isset($_POST) || empty($_POST)){
$this->session->set_flashdata('message',$flashMsg);
redirect(base_url('Product/addProduct'));
redirect(base_url('Product/addproduct'));
}
if($err == 0 && (!isset($_POST['brand_id']) || empty($_POST['brand_id']))){
$err = 1;
......@@ -196,7 +203,7 @@ class Product extends CI_Controller {
if($err == 1){
$flashMsg['message'] = $errMsg;
$this->session->set_flashdata('message',$flashMsg);
redirect(base_url('Product/addProduct'));
redirect(base_url('Product/addproduct'));
}
$existingImages = (isset($_POST['existingImages']) && !empty($_POST['existingImages']))?
$_POST['existingImages']:'';
......@@ -256,5 +263,41 @@ class Product extends CI_Controller {
}
public function exportProductData(){
$mechanic_id = ($this->session->userdata['user_type']==2)?$this->session->userdata['id']:'';
$productData = $this->Product_model->getProduct('',1,$mechanic_id);
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';
switch ($product->status) {
case '0': $status = 'Inactive';break;
case '1': $status = 'Active ';break;
case '2': $status = 'Deleted';break;
}
$data[] = $product->product_id;
$data[] = $product->product_name;
$data[] = $product->brand_name;
$data[] = $product->short_description;
$data[] = $product->part_id;
$data[] = $product->model;
$data[] = $product->amount;
$data[] = $status;
fputcsv($fpoint, $data, ',');
}
fseek($fpoint, 0);
header('Content-Type: application/csv');
header('Content-Disposition: attachement; filename="' . $file . '";');
fpassthru($fpoint);
}
}
?>
\ No newline at end of file
......@@ -15,6 +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,
......
......@@ -11,8 +11,8 @@ class Customer_model extends CI_Model {
$veh_data = array();
if(!empty($customer_data['customer_id'])){
$cond .= " AND customer_id = '".trim($customer_data['customer_id'])."'";
$veh_data = $this->db->get_where(
'customer_vehicle',array('status'=>'1','customer_id'=>$customer_data['customer_id']));
$veh_data = $this->db->get_where('customer_vehicle',
array('status'=>'1','customer_id'=>$customer_data['customer_id']));
$veh_data = (!empty($veh_data))?$veh_data->result():'';
}
......
......@@ -6,7 +6,8 @@ class Order_model extends CI_Model {
}
public function getOrders(){
$this->db->select("ORD.format_order_id,ORD.quantity,ORD.amount,ORD.status,PRD.product_name,TRIM(CONCAT(CUST.first_name,' ' ,IFNULL(CUST.last_name,''))) as customer_name,ORD.order_id");
$this->db->select("ORD.*,PRD.product_name,
TRIM(CONCAT(CUST.first_name,' ',IFNULL(CUST.last_name,''))) as customer_name");
$this->db->from('orders AS ORD');
$this->db->join('products AS PRD','PRD.product_id = ORD.product_id');
$this->db->join('customers AS CUST','CUST.customer_id = ORD.customer_id');
......@@ -20,7 +21,8 @@ class Order_model extends CI_Model {
if($order_id == ''){
return 0;
}
$result = $this->db->query("SELECT ORD.*,PRD.product_name,PRD.short_description,PRDB.brand_name,TRIM(CONCAT(CUST.first_name,' ' ,IFNULL(CUST.last_name,''))) as customer_name,
$result = $this->db->query("SELECT ORD.*,PRD.product_name,PRD.short_description,PRDB.brand_name,
TRIM(CONCAT(CUST.first_name,' ',IFNULL(CUST.last_name,''))) AS customer_name,
CASE WHEN ORD.status = 0 THEN 'Inactive'
WHEN ORD.status = 1 THEN 'Payment Processing'
WHEN ORD.status = 2 THEN 'Order Places'
......@@ -30,7 +32,7 @@ class Order_model extends CI_Model {
WHEN ORD.status = 6 THEN 'Returned'
WHEN ORD.status = 7 THEN 'Cancelled'
WHEN ORD.status = 8 THEN 'Deleted'
ELSE 'Payment Failed' END AS status
ELSE 'Payment Failed' END AS ord_status
FROM orders AS ORD
JOIN products AS PRD on PRD.product_id = ORD.product_id
JOIN product_brand AS PRDB on PRDB.brand_id = PRD.brand_id
......@@ -48,6 +50,23 @@ class Order_model extends CI_Model {
return (empty($result))?'':$result->result();
}
public function changeOrderStatus($data=array()){
$order_id = decode_param($data['order_id']);
if(empty($order_id) || $data['status'] == '' || empty($data['expected_date'])){
return 0;
}
if($data['status'] == '3' || $data['status'] == '4'){
$data['expected_delivery'] = $data['expected_date'];
}else if($data['status'] == '5'){
$data['delivered'] = $data['expected_date'];
}
unset($data['expected_date'],$data['order_id']);
$status = 0;
if($this->db->update('orders',$data,array('order_id'=>$order_id))){
$status = 1;
}
return $status;
}
}
?>
......@@ -9,27 +9,31 @@ class Product_model extends CI_Model {
if(empty($product_data)){
return 0;
}
$cardata = $this->db->get_where('cardetails',array('year'=>$product_data['vehYear'],'make'=>$product_data['vehMake'],'model'=>$product_data['vehModel']))->row();
if($cardata){
$product_data['cardetail_id'] = $cardata->id;
}else{
$this->db->insert('cardetails',array('year'=>$product_data['vehYear'],'make'=>$product_data['vehMake'],'model'=>$product_data['vehModel']));
$product_data['cardetail_id'] = $this->db->insert_id();
}
unset($product_data['vehYear']);
unset($product_data['vehMake']);
unset($product_data['vehModel']);
$cardata = $this->db->get_where('vehicles_model',array('veh_brand_id'=>$product_data['vehMake'],'veh_modal_id'=>$product_data['vehModel']))->row();
if(isset($product_data['cardetail_id']) && !empty($product_data['cardetail_id'])){
$this->db->update('cardetails',array('year'=>$product_data['vehYear'],' veh_modal_id'=>$cardata->veh_modal_id),array('id'=>$product_data['cardetail_id']));
}else{
$this->db->insert('cardetails',array('year'=>$product_data['vehYear'],' veh_modal_id'=>$cardata->veh_modal_id));
$product_data['cardetail_id'] = $this->db->insert_id();
}
unset($product_data['vehYear'],$product_data['vehMake'],$product_data['vehModel']);
$status = $this->db->insert('products',$product_data);
$last_id = $this->db->insert_id();
return $last_id;
}
function getProduct($product_id = '',$view_all = 0){
function getProduct($product_id = '',$view_all = 0,$mechanic_id = ''){
$cond = ($view_all != 0)?' products.status IN (0,1) ':' products.status IN (1) ';
$cond .= (!empty($product_id))?" AND products.product_id = '$product_id'":"";
$cond .= (!empty($mechanic_id))?" AND products.created_by = '$mechanic_id'":"";
$result = $this->db->query("SELECT cardetails.make,cardetails.year,cardetails.model,products.*,product_brand.brand_name FROM products join product_brand on product_brand.brand_id = products.brand_id join cardetails on cardetails.id = products.cardetail_id WHERE $cond");
$result = $this->db->query("SELECT cardetails.veh_modal_id,cardetails.year,vehicles_model.* ,products.*,product_brand.brand_name
FROM products
JOIN product_brand on product_brand.brand_id = products.brand_id
LEFT JOIN cardetails on cardetails.id = products.cardetail_id
LEFT JOIN vehicles_model on cardetails.veh_modal_id = vehicles_model.veh_modal_id
WHERE $cond");
if(empty($result)){
return;
}
......@@ -49,16 +53,14 @@ class Product_model extends CI_Model {
if(empty($product_id) || empty($product_data)){
return 0;
}
$cardata = $this->db->get_where('cardetails',array('year'=>$product_data['vehYear'],'make'=>$product_data['vehMake'],'model'=>$product_data['vehModel']))->row();
if($cardata){
$product_data['cardetail_id'] = $cardata->id;
}else{
$this->db->insert('cardetails',array('year'=>$product_data['vehYear'],'make'=>$product_data['vehMake'],'model'=>$product_data['vehModel']));
$product_data['cardetail_id'] = $this->db->insert_id();
}
unset($product_data['vehYear']);
unset($product_data['vehMake']);
unset($product_data['vehModel']);
$cardata = $this->db->get_where('vehicles_model',array('veh_brand_id'=>$product_data['vehMake'],'veh_modal_id'=>$product_data['vehModel']))->row();
if(isset($product_data['cardetail_id']) && !empty($product_data['cardetail_id'])){
$this->db->update('cardetails',array('year'=>$product_data['vehYear'],' veh_modal_id'=>$cardata->veh_modal_id),array('id'=>$product_data['cardetail_id']));
}else{
$this->db->insert('cardetails',array('year'=>$product_data['vehYear'],' veh_modal_id'=>$cardata->veh_modal_id));
$product_data['cardetail_id'] = $this->db->insert_id();
}
unset($product_data['vehYear'],$product_data['vehMake'],$product_data['vehModel']);
$status = $this->db->update('products',$product_data,array('product_id'=>$product_id));
return ($status)?1:0;
}
......@@ -88,7 +90,6 @@ class Product_model extends CI_Model {
return $status;
}
function getProductImage($product_id = ''){
if(empty($product_id)){
return 0;
......@@ -97,9 +98,5 @@ class Product_model extends CI_Model {
return $status;
}
function getVehdata(){
return $this->db->get_where('cardetails')->result_array();
}
}
?>
\ No newline at end of file
......@@ -55,5 +55,90 @@ class Vehicle_model extends CI_Model {
return $upStatus;
}
public function addBrand($veh_data = array()){
if(empty($veh_data)){
return 0;
}
$result = $this->db->get_where('vehicles_brand',array('vehicles_brand.maker'=>$veh_data['maker']))->row();
if($result){
return 0;
}
$status = $this->db->insert('vehicles_brand',$veh_data);
$last_id = $this->db->insert_id();
return $last_id;
}
function getVehBrand($veh_brand_id = '',$view_all = 0){
$cond = ($view_all != 0)?' vehicles_brand.status IN (0,1) ':' vehicles_brand.status IN (1) ';
$cond .= (!empty($veh_brand_id))?" AND vehicles_brand.veh_brand_id = '$veh_brand_id'":"";
$result = $this->db->query("SELECT * FROM vehicles_brand
WHERE $cond ORDER BY vehicles_brand.maker");
if(empty($result)){
return;
}
return (empty($veh_brand_id))?$result->result():$result->row();
}
function changeVehicleStatus($brand_id = '', $status = '0',$type=''){
if(empty($brand_id)){
return 0;
}
if($type == '2'){
$status = $this->db->update('vehicles_model',array('status'=>$status), array('veh_modal_id'=>$brand_id));
}else{
$status = $this->db->update('vehicles_brand',array('status'=>$status), array('veh_brand_id'=>$brand_id));
}
return $status;
}
function updateVehBrand($brand_id = '', $brand_data = array()){
if(empty($brand_id) || empty($brand_data)){
return 0;
}
$status = $this->db->update('vehicles_brand',$brand_data,array('veh_brand_id'=>$brand_id));
return ($status)?1:0;
}
function getVehModel($veh_model_id = '',$view_all = 0,$veh_brand_id=''){
$cond = ($view_all != 0)?' vehicles_model.status IN (0,1) ':' vehicles_model.status IN (1) ';
$cond .= (!empty($veh_model_id))?" AND vehicles_model.veh_modal_id = '$veh_model_id'":"";
$cond .= (!empty($veh_brand_id))?" AND vehicles_model.veh_brand_id = '$veh_brand_id'":"";
$result = $this->db->query("SELECT vehicles_model.*, vehicles_brand.maker
FROM vehicles_model
JOIN vehicles_brand ON vehicles_brand.veh_brand_id = vehicles_model.veh_brand_id
WHERE $cond ORDER BY vehicles_model.model");
if(empty($result)){
return;
}
if(isset($veh_brand_id) && !empty($veh_brand_id)){
return $result->result();
}
return (empty($veh_model_id))?$result->result():$result->row();
}
public function addModel($veh_data = array()){
if(empty($veh_data)){
return 0;
}
$result = $this->db->get_where('vehicles_model',array('vehicles_model.model'=>$veh_data['model'],'vehicles_model.veh_brand_id'=>$veh_data['veh_brand_id']))->row();
if($result){
return 0;
}
$status = $this->db->insert('vehicles_model',$veh_data);
$last_id = $this->db->insert_id();
return $last_id;
}
function updateVehModel($model_id = '', $model_data = array()){
if(empty($model_id) || empty($model_data)){
return 0;
}
$status = $this->db->update('vehicles_model',$model_data,array('veh_modal_id'=>$model_id));
return ($status)?1:0;
}
}
?>
\ No newline at end of file
......@@ -21,15 +21,21 @@
</div>
<?php } ?>
</div>
<?php if($this->session->userdata['user_type'] == 1 && !empty($mechanic_data)){ ?>
<div class="col-sm-12">
<div class="box box-warning">
<div class="box-header with-border">
<div class="col-md-6">
<h3 class="box-title">Booking Management</h3>
</div>
<div class="col-sm-12">
<div class="box box-warning">
<div class="box-header with-border">
<div class="col-md-6">
<h3 class="box-title">Booking Management</h3>
</div>
<div class="col-md-6" align="right">
<?php if(!empty($bookingData)){ ?>
<a class="btn btn-sm btn-success" href="<?= base_url('Bookings/exportBookingData/'.$mechanic_id) ?>">Generate Report</a>
<?php } ?>
<a class="btn btn-sm btn-primary" href="<?= base_url() ?>">Back</a>
</div>
</div>
<?php if($this->session->userdata['user_type'] == 1 && !empty($mechanic_data)){ ?>
<div class="box-body">
<form id="chooseMechForm" role="form" action="<?=base_url('Bookings/listBookings')?>"
method="post" class="validate" data-parsley-validate="" enctype="multipart/form-data">
......@@ -57,10 +63,11 @@
</div>
</form>
</div>
</div>
<?php } ?>
</div>
<?php }
if($this->session->userdata['user_type'] != 1 || ($this->session->userdata['user_type'] == 1)){ ?>
</div>
<?php
if($this->session->userdata['user_type'] != 1 || ($this->session->userdata['user_type'] == 1)){ ?>
<div class="col-xs-12">
<div class="box box-warning">
<div class="box-body">
......
......@@ -52,7 +52,7 @@
<div class="form-group has-feedback">
<label>Date Of Birth</label>
<div class="input-group date" data-provide="datepicker">
<input id="datepicker" type="text" class="form-control required" data-parsley-trigger="change" data-parsley-minlength="2" required="" name="date_of_birth" placeholder="Pick Date Of Birth" autocomplete="off" value="<?= (isset($customer_data) && isset($customer_data->date_of_birth))?$customer_data->date_of_birth:'' ?>">
<input id="datepicker" type="text" class="form-control required" data-parsley-trigger="change" data-parsley-minlength="2" required="" name="date_of_birth" placeholder="Pick Date Of Birth" autocomplete="off" value="<?= (isset($customer_data) && isset($customer_data->date_of_birth))?$customer_data->date_of_birth:'' ?>" style="z-index: 1;">
<div class="input-group-addon">
<i class="fa fa-calendar"></i>
</div>
......@@ -150,14 +150,36 @@
<div id="searchTyp_1">
<div class="col-md-12">
<div class="col-md-6">
<label>Vehicle Model</label>
<input type="text" class="form-control required" name="vehModel" input="search_params"
placeholder="Enter Vehicle Model" required="">
<label>Vehicle Maker</label>
<!-- <input type="text" class="form-control required" name="vehMaker" input="search_params" placeholder="Enter Vehicle Maker" required> -->
<select name="vehMaker" class="form-control required" data-parsley-trigger="change" required="" id="veh_make" input="search_params">
<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 maker="'.$value->veh_brand_id.'" value="'.$value->maker.'">'.$value->maker.'</option>';
}
?>
</select>
</div>
<div class="col-md-6">
<label>Vehicle Maker</label>
<input type="text" class="form-control required" name="vehMaker" input="search_params"
placeholder="Enter Vehicle Maker" required>
<label>Vehicle Model</label>
<!-- <input type="text" class="form-control required" name="vehModel" input="search_params" placeholder="Enter Vehicle Model" required=""> -->
<select name="vehModel" class="form-control required" data-parsley-trigger="change" required="" id="veh_model" input="search_params">
<option selected="" disabled="" value="">Choose Vehicle Model</option>
<?php
if((isset($customer_id) || !empty($customer_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 value="'.$value->model.'" model="'.$value->model.'">'.$value->model.'</option>';
}
}
?>
</select>
</div>
</div>
<div class="col-md-12 padTop10">
......
......@@ -26,6 +26,10 @@
<div class="box-header with-border">
<div class="col-md-6"><h3 class="box-title">Customers List</h3></div>
<div class="col-md-6" align="right">
<?php
if(!empty($customerData)){ ?>
<a class="btn btn-sm btn-success" href="<?= base_url('Customer/exportCustomerData')?>">Generate Report</a>
<?php } ?>
<a class="btn btn-sm btn-primary" href="<?= base_url('Customer/addCustomerUser')?>">Add New Customer</a>
<a class="btn btn-sm btn-primary" href="<?= base_url() ?>">Back</a>
</div>
......
......@@ -28,6 +28,10 @@
<div class="box-header with-border">
<div class="col-md-6"><h3 class="box-title">Mechanics List</h3></div>
<div class="col-md-6" align="right">
<?php
if(!empty($user_data)){ ?>
<a class="btn btn-sm btn-success" href="<?= base_url('Mechanic/exportMechanicData')?>">Generate Report</a>
<?php } ?>
<a class="btn btn-sm btn-primary" href="<?= base_url('Mechanic/addMechanic')?>">Add New Mechanic</a>
<a class="btn btn-sm btn-primary" href="<?= base_url() ?>">Back</a>
</div>
......
......@@ -22,19 +22,28 @@
<?php } ?>
</div>
<div class="col-xs-12">
<div class="box box-warning">
<div class="box box-warning">
<div class="box-header with-border">
<div class="col-md-6"><h3 class="box-title">Order List</h3></div>
<div class="col-md-6" align="right">
<?php if(!empty($orderData)){ ?>
<a class="btn btn-sm btn-success" href="<?= base_url('Orders/exportOrderData')?>">Generate Report</a>
<?php } ?>
<a class="btn btn-sm btn-primary" href="<?= base_url() ?>">Back</a>
</div>
</div>
<div class="box-body">
<table id="mechanicUsers" class="table table-bordered table-striped datatable ">
<thead>
<tr>
<th class="hidden">ID</th>
<th width="12%;">Order ID</th>
<th width="18%;">Product</th>
<th width="14%;">Customer</th>
<th width="22%;">Product</th>
<th width="15%;">Customer</th>
<th width="9%;">Quantity</th>
<th width="9%;">Amount</th>
<th width="18%;">Status</th>
<th width="20%;">Action</th>
<th width="17%;">Status</th>
<th width="16%;">Action</th>
</tr>
</thead>
<tbody>
......@@ -47,15 +56,18 @@
<th class="center"><?= $odrData->customer_name ?></th>
<th class="center"><?= $odrData->quantity ?></th>
<th class="center"><?= $odrData->amount ?></th>
<th class="center">
<th class="center" id="orderStatus_<?= encode_param($odrData->order_id) ?>">
<?php
switch($odrData->status){
case 0: echo 'Inactive'; break;
case 1: echo 'Payment Processing'; break;
case 2: echo 'Order Places'; break;
case 3: echo 'Order Packed'; break;
case 4: echo 'Order Shipped'; break;
case 5: echo 'Ordered Delivered'; break;
case 3: echo 'Order Packed <br>
(Deliver by '.$odrData->expected_delivery.')'; break;
case 4: echo 'Order Shipped <br>
(Deliver by '.$odrData->expected_delivery.')'; break;
case 5: echo 'Ordered Delivered <br>
(Deliver by '.$odrData->delivered.')'; break;
case 6: echo 'Returned'; break;
case 7: echo 'Cancelled'; break;
case 8: echo 'Deleted'; break;
......@@ -68,8 +80,9 @@
order_id="<?= encode_param($odrData->order_id) ?>">
<i class="fa fa-fw fa-eye"></i>View
</a>
<a class="btn btn-sm btn-success" id="changeOrderStatus" style="background-color:#ac2925" order_id="<?= encode_param($odrData->order_id) ?>"><i class="fa fa-cog"></i>Change Status</a>
<?php if($odrData->status == '2' || $odrData->status == '3' || $odrData->status == '4'){ ?>
<a class="btn btn-sm btn-success" order_status="<?= $odrData->status ?>" id="changeOrderStatus" style="background-color:#4CAF50;" order_id="<?= encode_param($odrData->order_id) ?>"><i class="fa fa-cog"></i>Status</a>
<?php } ?>
</td>
</tr>
<?php } }?>
......
......@@ -56,6 +56,13 @@
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"
placeholder="Enter Part ID" value="<?= (isset($product_data->part_id))?$product_data->part_id:'' ?>">
<span class="glyphicon form-control-feedback"></span>
</div>
</div>
<div class="col-md-6">
<div class="form-group">
......@@ -66,7 +73,7 @@
</div>
<div class="form-group">
<label>Amount</label>
<input type="text" class="form-control required" data-parsley-trigger="change"
<input type="number" class="form-control required" data-parsley-trigger="change"
data-parsley-minlength="2" name="amount" required="" value="<?= (isset($product_data->amount))?$product_data->amount:'' ?>"
data-parsley-pattern="^[0-9\ . \/]+$" placeholder="Enter Amount">
<span class="glyphicon form-control-feedback"></span>
......@@ -137,53 +144,38 @@
</div>
<div class="col-md-4">
<label>Vehicle Make</label>
<select name="vehMake" class="form-control required" input="search_params"
data-parsley-trigger="change" required="">
<select name="vehMake" class="form-control required" data-parsley-trigger="change" required="" id="veh_make">
<option selected disabled value="">Choose Vehicle Make</option>
<option <?= ($product_data->make == 'Toyota') ? 'selected' : ''?> value="Toyota">Toyota</option>
<option <?= ($product_data->make == 'Alto') ? 'selected' : ''?> value="Alto">Alto</option>
<option <?= ($product_data->make == 'Hyundai') ? 'selected' : ''?> value="Hyundai">Hyundai</option>
<option <?= ($product_data->make == 'Hyundai') ? 'selected' : ''?> value="Hyundai">Hyundai</option>
<option <?= ($product_data->make == 'Hyundai') ? 'selected' : ''?> value="Hyundai">Hyundai</option>
<option <?= ($product_data->make == 'Hyundai') ? 'selected' : ''?> value="Hyundai">Hyundai</option>
<option <?= ($product_data->make == 'Hyundai') ? 'selected' : ''?> value="Hyundai">Hyundai</option>
<option <?= ($product_data->make == 'Hyundai') ? 'selected' : ''?> value="Hyundai">Hyundai</option>
<option <?= ($product_data->make == 'Hyundai') ? 'selected' : ''?> value="Hyundai">Hyundai</option>
<option <?= ($product_data->make == 'Hyundai') ? 'selected' : ''?> value="Hyundai">Hyundai</option>
<option <?= ($product_data->make == 'Hyundai') ? 'selected' : ''?> value="Hyundai">Hyundai</option>
<option <?= ($product_data->make == 'Hyundai') ? 'selected' : ''?> value="Hyundai">Hyundai</option>
<option <?= ($product_data->make == 'Ford') ? 'selected' : ''?> value="Ford">Ford</option>
<option <?= ($product_data->make == 'Ford') ? 'selected' : ''?> value="Ford">Ford</option>
<option <?= ($product_data->make == 'Honda') ? 'selected' : ''?> value="Honda">Honda</option>
<option <?= ($product_data->make == 'Honda') ? 'selected' : ''?> value="Honda">Honda</option>
<option <?= ($product_data->make == 'Honda') ? 'selected' : ''?> value="Honda">Honda</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 required" input="search_params"
data-parsley-trigger="change" required="">
<select name="vehModel" class="form-control required" data-parsley-trigger="change" required="" id="veh_model">
<option selected="" disabled="" value="">Choose Vehicle Model</option>
<option <?= ($product_data->model == 'Corolla') ? 'selected' : ''?> value="Corolla">Corolla</option>
<option <?= ($product_data->model == '800') ? 'selected' : ''?> value="800">800</option>
<option <?= ($product_data->model == 'Eon') ? 'selected' : ''?>value="Eon">Eon</option>
<option <?= ($product_data->model == 'Eon') ? 'selected' : ''?> value="Eon">Eon</option>
<option <?= ($product_data->model == 'i10') ? 'selected' : ''?> value="i10">i10</option>
<option <?= ($product_data->model == 'i20') ? 'selected' : ''?> value="i20">i20</option>
<option <?= ($product_data->model == 'i10 Grand') ? 'selected' : ''?>value="i10 Grand">i10 Grand</option>
<option <?= ($product_data->model == 'i20 Grand') ? 'selected' : ''?> value="i20 Grand">i20 Grand</option>
<option <?= ($product_data->model == 'i10 Magna') ? 'selected' : ''?> value="i10 Magna">i10 Magna</option>
<option <?= ($product_data->model == 'i20 Magna') ? 'selected' : ''?> value="i20 Magna">i20 Magna</option>
<option <?= ($product_data->model == 'Sonata') ? 'selected' : ''?> value="Sonata">Sonata</option>
<option <?= ($product_data->model == 'Creta') ? 'selected' : ''?> value="Creta">Creta</option>
<option <?= ($product_data->model == 'Aspair') ? 'selected' : ''?> value="Aspair">Aspair</option>
<option <?= ($product_data->model == 'Eco-sport') ? 'selected' : ''?> value="Eco-sport">Eco-sport</option>
<option <?= ($product_data->model == 'City') ? 'selected' : ''?> value="City">City</option>
<option <?= ($product_data->model == 'Amaze') ? 'selected' : ''?> value="Amaze">Amaze</option>
<option <?= ($product_data->model == 'Sonata') ? 'selected' : ''?> value="Sonata">Sonata</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.'</option>';
}
}
?>
</select>
</div>
</div>
<input type="hidden" name="cardetail_id" value="<?= (isset($product_data->cardetail_id) && !empty($product_data->cardetail_id))?$product_data->cardetail_id:'' ?>" >
<div class="col-md-6 padTop20">
<div class="form-group">
......
......@@ -28,7 +28,9 @@
<div class="box-header with-border">
<div class="col-md-6"><h3 class="box-title">Brand List</h3></div>
<div class="col-md-6" align="right">
<a class="btn btn-sm btn-primary" href="<?= base_url('Brand/addBrand') ?>">Add New Products</a>
<?php if(!empty($product_data)){ ?>
<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() ?>">Back</a>
</div>
</div>
......
......@@ -122,15 +122,36 @@
<a href="<?= base_url('Mailtemplate') ?>"><i class="fa fa-book" aria-hidden="true">
</i><span>Mail Template</span></a>
</li>
<li class="treeview">
<a href="#">
<i class="fa fa-bars" aria-hidden="true"></i>
<span>Vehicle Management</span>
<i class="fa fa-angle-left pull-right"></i>
</a>
<ul class="treeview-menu">
<li>
<a href="<?= base_url('Vehicle/viewVehBrand') ?>">
<i class="fa fa-circle-o text-aqua"></i>
Vehicle Brand
</a>
</li>
<li>
<a href="<?= base_url('Vehicle/viewVehModel') ?>">
<i class="fa fa-circle-o text-aqua"></i>
Vehicle Models
</a>
</li>
</ul>
</li>
<li>
<a href="<?= base_url('Orders/listOrders') ?>"><i class="fa fa-book" aria-hidden="true">
</i><span>Order Management</span></a>
</li>
<?php } ?>
<li>
<a href="<?= base_url('Bookings/listBookings') ?>"><i class="fa fa-book" aria-hidden="true">
</i><span>Request Management</span></a>
</li>
<li>
<a href="<?= base_url('Orders/listOrders') ?>"><i class="fa fa-book" aria-hidden="true">
</i><span>Order Management</span></a>
</li>
<li class="treeview">
<a href="#">
<i class="fa fa-bars" aria-hidden="true"></i>
......
<div class="content-wrapper">
<section class="content-header">
<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>
<section class="content">
<div class="row">
<div class="col-md-12">
<?php
$url = (!isset($brand_id) || empty($brand_id))?'Vehicle/createbrand':'Vehicle/updateVehBrand/'.$brand_id;
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-body">
<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>
<input type="text" class="form-control required" data-parsley-trigger="change"
data-parsley-minlength="2" data-parsley-pattern="^[a-zA-Z0-9\ . _ - ' \/]+$"
name="maker" required="" value="<?= (isset($vehBrand_data->maker))?$vehBrand_data->maker:'' ?>"placeholder="Enter Vehicle Brand">
<span class="glyphicon form-control-feedback"></span>
</div>
</div>
<div class="col-md-12">
<div class="box-footer textCenterAlign">
<button type="submit" class="btn btn-primary">Submit</button>
<a href="<?= base_url('Vehicle/viewVehBrand') ?>" class="btn btn-primary">Cancel</a>
</div>
</div>
</form>
</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>
<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>
<section class="content">
<div class="row">
<div class="col-md-12">
<?php
$url = (!isset($model_id) || empty($model_id))?'Vehicle/createModel':'Vehicle/updateVehModel/'.$model_id;
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-body">
<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>Select Brand</label>
<select name="veh_brand_id" class="form-control required" placeholder="Select Brand" required="">
<option selected disabled>Choose a Brand</option>
<?php
foreach ($vehBrand_data as $brand) {
$select = (isset($vehModel_data->veh_brand_id) && $brand->veh_brand_id==
$vehModel_data->veh_brand_id)?'selected':'';
echo '<option '.$select.' value="'.$brand->veh_brand_id.'">'.
$brand->maker.
'</option>';
}
?>
</select>
<span class="glyphicon form-control-feedback"></span>
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<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">
<span class="glyphicon form-control-feedback"></span>
</div>
</div>
<div class="col-md-12">
<div class="box-footer textCenterAlign">
<button type="submit" class="btn btn-primary">Submit</button>
<a href="<?= base_url('Vehicle/viewVehModel') ?>" class="btn btn-primary">Cancel</a>
</div>
</div>
</form>
</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>
<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>
<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-xs-12">
<div class="box box-warning">
<div class="box-header with-border">
<div class="col-md-6"><h3 class="box-title">Brand List</h3></div>
<div class="col-md-6" align="right">
<a class="btn btn-sm btn-primary" href="<?= base_url('Vehicle/addVehBrand') ?>">Add Vehicle Brand</a>
<a class="btn btn-sm btn-primary" href="<?= base_url() ?>">Back</a>
</div>
</div>
<div class="box-body">
<table id="mechanicUsers" class="table table-bordered table-striped datatable ">
<thead>
<tr>
<th class="hidden">ID</th>
<th width="150px;">Brand Name</th>
<th width="100px;">Status</th>
<th width="300px;">Action</th>
</tr>
</thead>
<tbody>
<?php
if(!empty($vehBrand_data)){
foreach($vehBrand_data as $brand) { ?>
<tr>
<th class="hidden"><?= $brand->veh_brand_id ?></th>
<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)) ?>">
<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()">
<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" ?>">
<i class="fa fa-cog"></i> De-activate
</a>
<?php } else { ?>
<a class="btn btn-sm btn-success" href="<?= base_url("Vehicle/changeVehicleStatus/".encode_param($brand->veh_brand_id))."/1" ?>">
<i class="fa fa-cog"></i> Activate
</a>
<?php } ?>
</td>
</tr>
<?php } } ?>
</tbody>
</table>
</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>
<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>
<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-xs-12">
<div class="box box-warning">
<div class="box-header with-border">
<div class="col-md-6"><h3 class="box-title">Vehicle Model List</h3></div>
<div class="col-md-6" align="right">
<a class="btn btn-sm btn-primary" href="<?= base_url('Vehicle/addVehModel') ?>">Add Vehicle Model</a>
<a class="btn btn-sm btn-primary" href="<?= base_url() ?>">Back</a>
</div>
</div>
<div class="box-body">
<table id="mechanicUsers" class="table table-bordered table-striped datatable ">
<thead>
<tr>
<th class="hidden">ID</th>
<th width="150px;">Vehicle Brand</th>
<th width="150px;">Vehicle Model</th>
<th width="100px;">Status</th>
<th width="300px;">Action</th>
</tr>
</thead>
<tbody>
<?php
if(!empty($vehModel_data)){
foreach($vehModel_data as $model) { ?>
<tr>
<th class="hidden"><?= $model->veh_modal_id ?></th>
<th class="center"><?= $model->maker ?></th>
<th class="center"><?= $model->model ?></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)) ?>">
<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" ?>"
onClick="return doconfirm()">
<i class="fa fa-fw fa-trash"></i>Delete
</a>
<?php if($model->status == 1){ ?>
<a class="btn btn-sm btn-success" style="background-color:#ac2925" href="<?= base_url("Vehicle/changeModelStatus/".encode_param($model->veh_modal_id))."/0" ?>">
<i class="fa fa-cog"></i> De-activate
</a>
<?php } else { ?>
<a class="btn btn-sm btn-success" href="<?= base_url("Vehicle/changeModelStatus/".encode_param($model->veh_modal_id))."/1" ?>">
<i class="fa fa-cog"></i> Activate
</a>
<?php } ?>
</td>
</tr>
<?php } } ?>
</tbody>
</table>
</div>
</div>
</div>
</div>
</section>
</div>
\ No newline at end of file
......@@ -394,6 +394,9 @@
.float-right {
float: right;
}
.float-left {
float: left;
}
.disp-block {
display:block !important;
......
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