Commit 0dd5561b by Tobin

daily commit 07-12-2018

parent df7229ee
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class Issue extends CI_Controller {
public function __construct() {
parent::__construct();
date_default_timezone_set("Asia/Kolkata");
$this->load->model('Issue_model');
if(!$this->session->userdata('logged_in')) {
redirect(base_url());
}
}
public function addIssue(){
$template['page'] = 'Issue/issueForm';
$template['menu'] = 'Issue Management';
$template['smenu'] = 'Add Issue';
$template['pTitle'] = "Add Issue";
$template['pDescription'] = "Create New Issue";
$template['issue_data'] = $this->Issue_model->getIssue();
$this->load->view('template',$template);
}
public function viewIssues(){
$template['page'] = 'Issue/viewIssues';
$template['menu'] = 'Issue Management';
$template['smenu'] = 'View Issues';
$template['pTitle'] = "View Issues";
$template['pDescription'] = "View and Manage Issues";
$template['issue_data'] = $this->Issue_model->getIssue('',1);
$this->load->view('template',$template);
}
function changeStatus($issue_id = '',$status = '1'){
$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'));
}
$status = $this->Issue_model->changeStatus($issue_id,$status);
if(!$status){
$this->session->set_flashdata('message',$flashMsg);
}
redirect(base_url('Issue/viewIssues'));
}
public function createIssue(){
$err = 0;
$errMsg = '';
$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('Issue/addIssue'));
}
if($err == 0 && (!isset($_POST['issue']) || empty($_POST['issue']))){
$err = 1;
$errMsg = 'Provide Issue Short Discription';
}
if($err == 1){
$flashMsg['message'] = $errMsg;
$this->session->set_flashdata('message',$flashMsg);
redirect(base_url('Issue/addIssue'));
}
$status = $this->Issue_model->addIssue($_POST);
if($status == 1){
$flashMsg =array('message'=>'Successfully Updated Issue Details..!','class'=>'success');
$this->session->set_flashdata('message', $flashMsg);
redirect(base_url('Issue/viewIssues'));
} else {
$this->session->set_flashdata('message', $flashMsg);
redirect(base_url('Issue/addIssue'));
}
}
public function editIssue($issue_id){
$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'));
}
$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->getIssue($issue_id,1);
if(empty($template['issue_data'])){
$this->session->set_flashdata('message',$flashMsg);
redirect(base_url('Issue/viewIssues'));
}
$this->load->view('template',$template);
}
public function updateIssue($issue_id = ''){
$err = 0;
$errMsg = '';
$flashMsg = array('message'=>'Something went wrong, please try again..!','class'=>'error');
if(empty($issue_id) || !isset($_POST) || empty($_POST) || !is_numeric(decode_param($issue_id))){
$this->session->set_flashdata('message',$flashMsg);
redirect(base_url('Issue/viewIssues'));
}
if(!isset($_POST) || empty($_POST)){
$this->session->set_flashdata('message',$flashMsg);
redirect(base_url('Issue/addIssue'));
}
if($err == 0 && (!isset($_POST['issue']) || empty($_POST['issue']))){
$err = 1;
$errMsg = 'Provide a Issue Short Discription';
}
if($err == 1){
$flashMsg['message'] = $errMsg;
$this->session->set_flashdata('message',$flashMsg);
redirect(base_url('Issue/addIssue'));
}
$status = $this->Issue_model->updateIssue(decode_param($issue_id),$_POST);
if($status == 1){
$flashMsg =array('message'=>'Successfully Updated Issue Details..!','class'=>'success');
$this->session->set_flashdata('message', $flashMsg);
redirect(base_url('Issue/viewIssues'));
} else {
$this->session->set_flashdata('message', $flashMsg);
redirect(base_url('Issue/editIssue/'.$issue_id));
}
}
public function issueMapping(){
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 Couston Issues";
$template['issue_data'] = $this->Issue_model->getIssue('',1);
$template['mechanic_id'] = encode_param($this->session->userdata('id'));
if(empty($template['issue_data'])){
$this->session->set_flashdata('message',$flashMsg);
redirect(base_url('Issue/viewIssues'));
}
$this->load->view('template',$template);
}
public function createMechIssue(){
$err = 0;
$errMsg = '';
$flashMsg = array('message'=>'Something went wrong, please try again..!','class'=>'error');
if(!isset($_POST) || empty($_POST) || !isset($_POST['mechanic_id']) ||
empty(($_POST['mechanic_id'])) ||
!is_numeric($_POST['mechanic_id'] = decode_param($_POST['mechanic_id']))){
$this->session->set_flashdata('message',$flashMsg);
redirect(base_url('Issue/issueMapping'));
}
if($err == 0 && (!isset($_POST['issue_id']) || empty($_POST['issue_id']))){
$err = 1;
$errMsg = 'Choose as Issue';
}
else if($err == 0 && (!isset($_POST['service_fee']) || empty($_POST['service_fee']))){
$err = 1;
$errMsg = 'Provide a Service Cost';
}
else if($err == 0 && (!isset($_POST['issue_description']) || empty($_POST['issue_description']))){
$err = 1;
$errMsg = 'Provide a Brief Discription About Service';
}
if($err == 1){
$flashMsg['message'] = $errMsg;
$this->session->set_flashdata('message',$flashMsg);
redirect(base_url('Issue/issueMapping'));
}
$status = $this->Issue_model->addMechIssue($_POST);
if($status == 1){
$flashMsg =array('message'=>'Successfully Created..!','class'=>'success');
$this->session->set_flashdata('message', $flashMsg);
redirect(base_url('Issue/viewMappedIssues'));
} else {
$this->session->set_flashdata('message', $flashMsg);
redirect(base_url('Issue/issueMapping'));
}
}
function viewMappedIssues($mechanic_id = ''){
if(isset($_POST['mechanic_id']) && !empty($_POST['mechanic_id'])){
$mechanic_id = $_POST['mechanic_id'];
}
$mechanic_id = (!is_numeric($mechanic_id = decode_param($mechanic_id)))?'':$mechanic_id;
$template['page'] = 'Issue/viewMappedIssues';
$template['menu'] = 'Issue Management';
$template['smenu'] = 'Manage Mapped Issues';
$template['pTitle'] = "Manage Mapped Issues";
$template['pDescription'] = "View and Manage Mapped Issues";
$template['mechanic_data'] = '';
if($this->session->userdata('user_type') == 1){
$this->load->model('Mechanic_model');
$template['mechanic_data'] = $this->Mechanic_model->getMechanic('',1);
} else {
$mechanic_id = $this->session->userdata('id');
}
$template['mechanicIssueData'] = $this->Issue_model->getMechanicIssues($mechanic_id);
$template['mechanic_id'] = $mechanic_id;
$this->load->view('template',$template);
}
function changeMappedIssueStatus($mechanic_id = '',$issue_id = '',$status = '1'){
$flashMsg = array('message'=>'Something went wrong, please try again..!','class'=>'error');
if(empty($issue_id) || !is_numeric($issue_id = decode_param($issue_id)) ||
empty($mechanic_id) || !is_numeric($mechanic_id = decode_param($mechanic_id))){
$this->session->set_flashdata('message',$flashMsg);
redirect(base_url('Issue/viewMappedIssues/'.encode_param($mechanic_id)));
}
$status = $this->Issue_model->changeMappedIssueStatus($mechanic_id,$issue_id,$status);
if(!$status){
$this->session->set_flashdata('message',$flashMsg);
}
redirect(base_url('Issue/viewMappedIssues/'.encode_param($mechanic_id)));
}
}
?>
\ No newline at end of file
...@@ -11,7 +11,7 @@ class Login extends CI_Controller { ...@@ -11,7 +11,7 @@ class Login extends CI_Controller {
$this->load->helper('security'); $this->load->helper('security');
if($this->session->userdata('logged_in')) { if($this->session->userdata('logged_in')) {
redirect(base_url(HOME_PAGE)); redirect(base_url());
} }
} }
...@@ -39,10 +39,11 @@ class Login extends CI_Controller { ...@@ -39,10 +39,11 @@ class Login extends CI_Controller {
$this->session->set_userdata('logged_in','1'); $this->session->set_userdata('logged_in','1');
$this->session->set_userdata('user_type',$result->user_type); $this->session->set_userdata('user_type',$result->user_type);
$this->session->set_userdata('mechanic_data',$result->mechanic_data); $this->session->set_userdata('mechanic_data',$result->mechanic_data);
$this->session->set_userdata('mechanic_shop_data',$result->mechanic_shop_data);
return TRUE; return TRUE;
} }
else { else {
$this->form_validation->set_message('check_database', 'Invalid username or password'); $this->form_validation->set_message('checkUsrLogin', 'Invalid username or password');
return FALSE; return FALSE;
} }
} }
......
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class Shop extends CI_Controller {
public function __construct() {
parent::__construct();
date_default_timezone_set("Asia/Kolkata");
$this->load->model('Shop_model');
if(!$this->session->userdata('logged_in')) {
redirect(base_url());
}
}
public function addShop(){
$template['page'] = 'Shop/shopForm';
$template['menu'] = 'Shop Management';
$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);
}
public function viewShops(){
$template['page'] = 'Shop/viewShops';
$template['menu'] = 'Shop Management';
$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);
}
function changeStatus($shop_id = '',$status = '1'){
$flashMsg = array('message'=>'Something went wrong, please try again..!','class'=>'error');
if(empty($shop_id) || !is_numeric($shop_id = decode_param($shop_id))){
$this->session->set_flashdata('message',$flashMsg);
redirect(base_url('Shop/viewShops'));
}
$status = $this->Shop_model->changeStatus($shop_id,$status);
if(!$status){
$this->session->set_flashdata('message',$flashMsg);
}
redirect(base_url('Shop/viewShops'));
}
public function createShop(){
$err = 0;
$errMsg = '';
$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('Shop/addShop'));
}
if($err == 0 && (!isset($_POST['shop_name']) || empty($_POST['shop_name']))){
$err = 1;
$errMsg = 'Provide a Shop Name';
}else if($err == 0 && (!isset($_POST['email_id']) || empty($_POST['email_id']))){
$err = 1;
$errMsg = 'Provide a Email ID';
}else if($err == 0 && (!isset($_POST['phone']) || empty($_POST['phone']))){
$err = 1;
$errMsg = 'Provide a Phone Number';
}else if($err == 0 && (!isset($_POST['address']) || empty($_POST['address']))){
$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');
$this->session->set_flashdata('message', $flashMsg);
redirect(base_url('Shop/viewShops'));
} else {
$this->session->set_flashdata('message', $flashMsg);
redirect(base_url('Shop/addShop'));
}
}
public function editShop($shop_id){
$flashMsg = array('message'=>'Something went wrong, please try again..!','class'=>'error');
if(empty($shop_id) || !is_numeric($shop_id = decode_param($shop_id))){
$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);
}
public function updateShop($shop_id = ''){
$err = 0;
$errMsg = '';
$flashMsg = array('message'=>'Something went wrong, please try again..!','class'=>'error');
if(empty($shop_id) || !isset($_POST) || empty($_POST) || !is_numeric(decode_param($shop_id))){
$this->session->set_flashdata('message',$flashMsg);
redirect(base_url('Shop/viewShops'));
}
if(!isset($_POST) || empty($_POST)){
$this->session->set_flashdata('message',$flashMsg);
redirect(base_url('Shop/addShop'));
}
if($err == 0 && (!isset($_POST['shop_name']) || empty($_POST['shop_name']))){
$err = 1;
$errMsg = 'Provide a Shop Name';
}else if($err == 0 && (!isset($_POST['email_id']) || empty($_POST['email_id']))){
$err = 1;
$errMsg = 'Provide a Email ID';
}else if($err == 0 && (!isset($_POST['phone']) || empty($_POST['phone']))){
$err = 1;
$errMsg = 'Provide a Phone Number';
}else if($err == 0 && (!isset($_POST['address']) || empty($_POST['address']))){
$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');
$this->session->set_flashdata('message', $flashMsg);
redirect(base_url('Shop/viewShops'));
} else {
$this->session->set_flashdata('message', $flashMsg);
redirect(base_url('Shop/editShop/'.$shop_id));
}
}
}
?>
\ No newline at end of file
...@@ -37,11 +37,21 @@ class User extends CI_Controller { ...@@ -37,11 +37,21 @@ class User extends CI_Controller {
} }
public function editProfile() { public function editProfile() {
$this->load->model('Shop_model');
$user_id = $this->session->userdata('id');
$user_type = $this->session->userdata('user_type');
$template['page'] = 'User/editProfile'; $template['page'] = 'User/editProfile';
$template['page_desc'] = "Edit Profile"; $template['menu'] = "Profile";
$template['page_title'] = "Edit Profile"; $template['smenu'] = "Edit Profile";
$template['user_data'] = $this->User_model->getUserData(); $template['pTitle'] = "Edit Profile";
$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());
}
$this->load->view('template',$template); $this->load->view('template',$template);
} }
...@@ -55,7 +65,8 @@ class User extends CI_Controller { ...@@ -55,7 +65,8 @@ class User extends CI_Controller {
$this->session->set_flashdata('message',$flashMsg); $this->session->set_flashdata('message',$flashMsg);
redirect(base_url('User/editProfile')); redirect(base_url('User/editProfile'));
} }
if(isset($_FILES['profile_image']) && !empty($_FILES['profile_image'])){
if(isset($_FILES['profile_image']) && !empty($_FILES['profile_image'])){
$config = set_upload_service("assets/uploads/services"); $config = set_upload_service("assets/uploads/services");
$this->load->library('upload'); $this->load->library('upload');
...@@ -68,7 +79,23 @@ class User extends CI_Controller { ...@@ -68,7 +79,23 @@ class User extends CI_Controller {
$upload_data = $this->upload->data(); $upload_data = $this->upload->data();
$_POST['profile_image'] = $config['upload_path']."/".$upload_data['file_name']; $_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'])) && if((isset($_POST['password']) || isset($_POST['cPassword'])) &&
(!empty($_POST['password']) || !empty($_POST['cPassword']))){ (!empty($_POST['password']) || !empty($_POST['cPassword']))){
if($_POST['password'] != $_POST['cPassword']){ if($_POST['password'] != $_POST['cPassword']){
...@@ -84,53 +111,66 @@ class User extends CI_Controller { ...@@ -84,53 +111,66 @@ class User extends CI_Controller {
unset($_POST['password']); unset($_POST['password']);
unset($_POST['cPassword']); unset($_POST['cPassword']);
} }
if(!isset($_POST['company_name']) || empty($_POST['company_name'])){ if(!isset($_POST['display_name']) || empty($_POST['display_name'])){
$flashMsg = array('message'=>'Provide a valid Display Name..!','class'=>'error'); $flashMsg = array('message'=>'Provide a valid Display Name..!','class'=>'error');
$this->session->set_flashdata('message', $flashMsg); $this->session->set_flashdata('message', $flashMsg);
redirect(base_url('User/editProfile')); redirect(base_url('User/editProfile'));
} else if (!isset($_POST['email_id']) || empty($_POST['email_id'])){ } else if (!isset($_POST['username']) || empty($_POST['username'])){
$flashMsg = array('message'=>'Provide a valid Email ID..!','class'=>'error'); $flashMsg = array('message'=>'Provide a valid Username..!','class'=>'error');
$this->session->set_flashdata('message', $flashMsg); $this->session->set_flashdata('message', $flashMsg);
redirect(base_url('User/editProfile')); redirect(base_url('User/editProfile'));
} }
if ($user_type == 2){ if ($user_type == 2){
if (!isset($_POST['address']) || empty($_POST['address'])){ if (!isset($_POST['first_name']) || empty($_POST['first_name'])){
$flashMsg = array('message'=>'Provide a valid Address..!','class'=>'error'); $flashMsg = array('message'=>'Provide a First Name..!','class'=>'error');
$this->session->set_flashdata('message', $flashMsg); $this->session->set_flashdata('message', $flashMsg);
redirect(base_url('User/editProfile')); redirect(base_url('User/editProfile'));
} else if (!isset($_POST['fax']) || empty($_POST['fax'])){ } else if (!isset($_POST['last_name']) || empty($_POST['last_name'])){
$flashMsg = array('message'=>'Provide a valid Fax Number..!','class'=>'error'); $flashMsg = array('message'=>'Provide a valid Last Name..!','class'=>'error');
$this->session->set_flashdata('message', $flashMsg); $this->session->set_flashdata('message', $flashMsg);
redirect(base_url('User/editProfile')); redirect(base_url('User/editProfile'));
} else if (!isset($_POST['phone']) || empty($_POST['phone'])){ } else if (!isset($_POST['phone']) || empty($_POST['phone'])){
$flashMsg = array('message'=>'Provide a valid Phone Number..!','class'=>'error'); $flashMsg = array('message'=>'Provide a valid Phone Number..!','class'=>'error');
$this->session->set_flashdata('message', $flashMsg); $this->session->set_flashdata('message', $flashMsg);
redirect(base_url('User/editProfile')); redirect(base_url('User/editProfile'));
} else if (!isset($_POST['company_contact']) || empty($_POST['company_contact'])){ } else if (!isset($_POST['email_id']) || empty($_POST['email_id'])){
$flashMsg = array('message'=>'Provide a valid Contact Number..!','class'=>'error'); $flashMsg = array('message'=>'Provide a valid Email ID..!','class'=>'error');
$this->session->set_flashdata('message', $flashMsg); $this->session->set_flashdata('message', $flashMsg);
redirect(base_url('User/editProfile')); redirect(base_url('User/editProfile'));
} else if (!isset($_POST['company_info']) || empty($_POST['company_info'])){ } else if (!isset($_POST['address']) || empty($_POST['address'])){
$flashMsg = array('message'=>'Provide a valid Contact Info..!','class'=>'error'); $flashMsg = array('message'=>'Provide a valid Address..!','class'=>'error');
$this->session->set_flashdata('message', $flashMsg);
redirect(base_url('User/editProfile'));
} else if (!isset($_POST['city']) || empty($_POST['city'])){
$flashMsg = array('message'=>'Provide a valid City..!','class'=>'error');
$this->session->set_flashdata('message', $flashMsg);
redirect(base_url('User/editProfile'));
} else if (!isset($_POST['state']) || empty($_POST['state'])){
$flashMsg = array('message'=>'Provide a valid State..!','class'=>'error');
$this->session->set_flashdata('message', $flashMsg); $this->session->set_flashdata('message', $flashMsg);
redirect(base_url('User/editProfile')); redirect(base_url('User/editProfile'));
} }
} }
$status = $this->User_model->updateUser($user_id,$user_type,$_POST); $status = $this->User_model->updateUser($user_id,$user_type,$_POST);
if($status == 1){ if($status == 1){
if(isset($_POST['profile_image']) && !empty($_POST['profile_image'])){ $flashMsg =array('message'=>'Successfully Updated User Details..!','class'=>'success');
$this->session->set_userdata('profile_pic',$_POST['profile_image']); $this->session->set_flashdata('message', $flashMsg);
} redirect(base_url('User/viewProfile'));
$flashMsg =array('message'=>'Successfully Upadated User Details..!','class'=>'success');
$this->session->set_flashdata('message', $flashMsg);
redirect(base_url('User/viewProfile'));
} else if($status == 2){ } else if($status == 2){
$flashMsg = array('message'=>'Email ID alrady exist..!','class'=>'error'); $flashMsg = array('message'=>'Email ID alrady exist..!','class'=>'error');
$this->session->set_flashdata('message', $flashMsg); $this->session->set_flashdata('message', $flashMsg);
redirect(base_url('User/editProfile')); redirect(base_url('User/editProfile'));
} else if($status == 3){
$flashMsg = array('message'=>'Phone Number alrady exist..!','class'=>'error');
$this->session->set_flashdata('message', $flashMsg);
redirect(base_url('User/editProfile'));
} else if($status == 4){
$flashMsg = array('message'=>'User Name alrady exist..!','class'=>'error');
$this->session->set_flashdata('message', $flashMsg);
redirect(base_url('User/editProfile'));
} else { } else {
$this->session->set_flashdata('message', $flashMsg); $this->session->set_flashdata('message', $flashMsg);
redirect(base_url('User/editProfile')); redirect(base_url('User/editProfile'));
} }
} }
} }
......
<?php <?php
function set_upload_all_files($path){ function set_upload_service($path){
$config = array(); $config = array();
$config['upload_path'] = $path; $config['upload_path'] = $path;
$config['allowed_types'] = '*'; $config['allowed_types'] = '*';
......
<?php
class Customer_model extends CI_Model {
public function _consruct(){
parent::_construct();
}
function getCustomer($customer_data = array()){
$cond = (isset($customer_data['phone']) && !empty($customer_data['phone']))?
" AND phone LIKE '%".trim($customer_data['phone'])."'":"";
$cond .= (!empty($customer_data['customer_id']))?
" AND customer_id = '".trim($customer_data['customer_id'])."'":"";
$result = $this->db->query("SELECT * FROM customers WHERE status IN (0,1) $cond");
if(empty($result)){
return;
}
return (empty($customer_data))?$result->result():$result->row();
}
function createCustomer($customer_data = 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){
return 3;
}
}
$status = $this->db->insert('customers',$customer_data);
return ($status)?1:0;;
}
function updateCustomer($customer_id = '', $customer_data = 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'));
if(!empty($emailChk) && $emailChk->num_rows() > 0){
return 2;
}
$phoneChk = $this->db->get_where('customers',array('phone'=>$customer_data['phone'],
'customer_id !='=>$customer_id,
'status !='=>'2'));
if(!empty($phoneChk) && $phoneChk->num_rows() > 0){
return 3;
}
$status = $this->db->update('customers',$customer_data,array('customer_id'=>$customer_id));
return ($status)?1:0;;
}
function changeStatus($customer_id = '', $status = '0'){
if(empty($customer_id)){
return 0;
}
$status = $this->db->update('customers',array('status'=>$status), array('customer_id'=>$customer_id));
return $status;
}
}
?>
\ No newline at end of file
<?php
class Issue_model extends CI_Model {
public function _consruct(){
parent::_construct();
}
public function addIssue($issue_data = array()){
if(empty($issue_data)){
return 0;
}
$status = $this->db->insert('issues',$issue_data);
return ($status)?1:0;
}
function getIssue($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;
}
return (empty($issue_id))?$result->result():$result->row();
}
function changeStatus($issue_id = '', $status = '0'){
if(empty($issue_id)){
return 0;
}
$status = $this->db->update('issues',array('status'=>$status), array('issue_id'=>$issue_id));
return $status;
}
function updateIssue($issue_id = '', $issue_data = array()){
if(empty($issue_id) || empty($issue_data)){
return 0;
}
$status = $this->db->update('issues',$issue_data,array('issue_id'=>$issue_id));
return ($status)?1:0;
}
function addMechIssue($issueMechData = array()){
if(empty($issueMechData)){
return 0;
}
$status = $this->db->insert('mechanic_issues',$issueMechData);
return ($status)?1:0;
}
function getMechanicIssues($mechanic_id = ''){
if(empty($mechanic_id)){
return 0;
}
$sql = "SELECT ISSUE.*,MECH.*,M_ISSUE.*
FROM mechanic_issues AS M_ISSUE
INNER JOIN issues AS ISSUE ON (ISSUE.issue_id = M_ISSUE.issue_id)
INNER JOIN mechanic AS MECH ON (MECH.mechanic_id = M_ISSUE.mechanic_id)
INNER JOIN admin_users AS ADMIN ON (ADMIN.id = MECH.mechanic_id)
WHERE M_ISSUE.mechanic_id='$mechanic_id' AND ISSUE.status IN (0,1) AND
ADMIN.status IN (0,1) AND M_ISSUE.status IN (0,1)";
$result = $this->db->query($sql);
if(empty($result))
return;
return $result->result();
}
function changeMappedIssueStatus($mechanic_id = '', $issue_id = '', $status = '0'){
if(empty($mechanic_id) || empty($issue_id)){
return 0;
}
$status = $this->db->update('mechanic_issues',
array('status'=>$status),
array('issue_id'=>$issue_id,'mechanic_id'=>$mechanic_id));
return $status;
}
}
?>
\ No newline at end of file
...@@ -11,12 +11,23 @@ class Login_model extends CI_Model { ...@@ -11,12 +11,23 @@ class Login_model extends CI_Model {
array('username'=>$username, array('username'=>$username,
'password'=>$password, 'password'=>$password,
'status'=>'1')); 'status'=>'1'));
if(!empty($query)){
if($query->num_rows() > 0 && !empty($query)){
$result = $query->row(); $result = $query->row();
$result->mechanic_data = ''; $result->mechanic_data = '';
$result->mechanic_shop_data = '';
if($result->user_type == 2){ if($result->user_type == 2){
$query = $this->db->get_where('mechanic',array('mechanic_id'=>$result->id)); $this->load->model('Mechanic_model');
$result->mechanic_data = (!empty($query))?$query->row():''; $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;
}
}
} }
} else { } else {
$result = 0; $result = 0;
......
...@@ -6,37 +6,65 @@ class Mechanic_model extends CI_Model { ...@@ -6,37 +6,65 @@ class Mechanic_model extends CI_Model {
} }
public function addMechanic($mechanic_data = array()){ public function addMechanic($mechanic_data = array()){
if(empty($mechanic_data)){ if(empty($mechanic_data))
return 0;
$userIdChk = $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.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'],
'display_name'=>$mechanic_data['display_name'],
'profile_image'=>$mechanic_data['profile_image'],
'user_type'=>'2','status'=>'1'));
if(!$status){
return 0; return 0;
} }
$emailChk = $this->db->get_where('drivers',array('email_id'=>$mechanic_data['email_id'],'status !='=>'2')); $mechamic_id = $this->db->insert_id();
if(!empty($emailChk) && $emailChk->num_rows() > 0){ $status = $this->db->insert('mechanic',
return 2; array('mechanic_id'=>$mechamic_id,
} 'city'=>$mechanic_data['city'],
$phoneChk = $this->db->get_where('drivers',array('phone'=>$mechanic_data['phone'],'status !='=>'2')); 'phone'=>$mechanic_data['phone'],
if(!empty($phoneChk) && $phoneChk->num_rows() > 0){ 'state'=>$mechanic_data['state'],
return 3; 'shop_id'=>$mechanic_data['shop_id'],
} 'address'=>$mechanic_data['address'],
$status = $this->db->insert('drivers',$mechanic_data); 'licence'=>$mechanic_data['licence'],
return ($status)?1:0; 'email_id'=>$mechanic_data['email_id'],
'last_name'=>$mechanic_data['last_name'],
'first_name'=>$mechanic_data['first_name'],
'licence_number'=>$mechanic_data['licence_number'],
'licence_exp_date'=>$mechanic_data['licence_exp_date']));
return $status;
} }
function getMechanic($mechanic_id = ''){ function getMechanic($mechanic_id = '', $view_all = 0){
$cond = ''; $cond = (!empty($mechanic_id))?" MECH.mechanic_id = '".$mechanic_id."' ":"";
$user_id = $this->session->userdata('id'); $cond .= (!empty($cond))?" AND ":$cond;
if($this->session->userdata('user_type') != 1){ $cond .= (!empty($view_all))?" ADMN.status IN (0,1) ":" ADMN.status IN (1) ";
$cond = " AND CMP.company_id = '$user_id'";
} $sql = "SELECT ADMN.username,ADMN.user_type,ADMN.display_name,ADMN.profile_image,ADMN.status,
$cond .= (!empty($mechanic_id))?" AND DRV.driver_id = '$mechanic_id'":""; MSH.shop_name, MSH.address AS shop_address, MSH.phone AS shop_phone,
MSH.email_id AS shop_email, MECH.*
FROM mechanic AS MECH
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;
$sql = "SELECT DRV.*, CMP.company_name, VH.vehicle_type, VHS.vehicle_model, VHS.vehicle_reg_no,
VHS.vehicle_reg_image, VHS.model
FROM drivers AS DRV
INNER JOIN company AS CMP ON (CMP.company_id = DRV.company_id)
INNER JOIN admin_users AS AU ON (AU.id = CMP.company_id)
LEFT JOIN vehicles AS VHS ON (VHS.vehicle_id = DRV.vehicle)
LEFT JOIN vehicle_types AS VH ON (VH.vehicle_id = DRV.vehicle_id)
WHERE DRV.status IN (0,1) AND AU.status = '1' $cond";
$result = $this->db->query($sql); $result = $this->db->query($sql);
if(empty($result)){ if(empty($result)){
return; return;
...@@ -44,42 +72,55 @@ class Mechanic_model extends CI_Model { ...@@ -44,42 +72,55 @@ class Mechanic_model extends CI_Model {
return (empty($mechanic_id))?$result->result():$result->row(); return (empty($mechanic_id))?$result->result():$result->row();
} }
function changeStatus($mechanic_id = '', $status = '0'){ function updateMechanic($mechanic_id = '', $mechanic_data = array()){
if(empty($mechanic_id)){ if(empty($mechanic_id) || empty($mechanic_data))
return 0; return 0;
} $userIdChk = $this->db->query("SELECT * FROM mechanic AS MECH
$status = $this->db->update('drivers',array('status'=>$status), array('driver_id'=>$mechanic_id)); INNER JOIN admin_users AS AU ON (AU.id = MECH.mechanic_id)
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'=>$mechanic_data['shop_id'],
'address'=>$mechanic_data['address'],'email_id'=>$mechanic_data['email_id'],
'last_name'=>$mechanic_data['last_name'],'phone'=>$mechanic_data['phone'],
'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'];
$status = $this->db->update('mechanic',$upMecArr,array('mechanic_id'=>$mechanic_id));
return $status; return $status;
} }
function updateMechanic($mechanic_id = '', $mechanic_data = array()){ function changeStatus($mechanic_id = '', $status = '0'){
if(empty($mechanic_id) || empty($mechanic_data)){ if(empty($mechanic_id)){
return 0; return 0;
} }
$emailChk = $this->db->get_where('drivers',array('email_id'=>$mechanic_data['email_id'],'status !='=>'2','driver_id != '=>$mechanic_id)); $status = $this->db->update('admin_users',array('status'=>$status),array('id'=>$mechanic_id));
if(!empty($emailChk) && $emailChk->num_rows() > 0){ return $status;
return 2;
}
$phoneChk = $this->db->get_where('drivers',array('phone'=>$mechanic_data['phone'],'status !='=>'2','driver_id != '=>$mechanic_id));
if(!empty($phoneChk) && $phoneChk->num_rows() > 0){
return 3;
}
$upArr = array('first_name'=>$mechanic_data['first_name'],'last_name'=>$mechanic_data['last_name'],'email_id'=>$mechanic_data['email_id'],'phone'=>$mechanic_data['phone'],'city'=>$mechanic_data['city'],'state'=>$mechanic_data['state'],'address'=>$mechanic_data['address'],'licence_exp_date'=>$mechanic_data['licence_exp_date'],'licence_number'=>$mechanic_data['licence_number'],'vehicle'=>$mechanic_data['vehicle']);
if(!empty($mechanic_data['profile_image'])){
$upArr['profile_image'] = $mechanic_data['profile_image'];
}
if(!empty($mechanic_data['licence'])){
$upArr['licence'] = $mechanic_data['licence'];
}
if(!empty($mechanic_data['company_id'])){
$upArr['company_id'] = $mechanic_data['company_id'];
}
if(!empty($mechanic_data['vehicle_id'])){
$upArr['vehicle_id'] = $mechanic_data['vehicle_id'];
}
$status = $this->db->update('drivers', $upArr, array('driver_id'=>$mechanic_id));
return ($status)?1:0;
} }
} }
?> ?>
\ No newline at end of file
...@@ -5,22 +5,14 @@ class Shop_model extends CI_Model { ...@@ -5,22 +5,14 @@ class Shop_model extends CI_Model {
parent::_construct(); parent::_construct();
} }
// public function addShop($shop_data = array()){ public function addShop($shop_data = array()){
// if(empty($shop_data)){ if(empty($shop_data)){
// return 0; return 0;
// } }
// $emailChk = $this->db->get_where('mechanic_shop',
// array('broker_email'=>$shop_data['broker_email'],'status !='=>'2')); $status = $this->db->insert('mechanic_shop',$shop_data);
// if(!empty($emailChk) && $emailChk->num_rows() > 0){ return ($status)?1:0;
// return 2; }
// }
// $phoneChk = $this->db->get_where('mechanic_shop',array('broker_phone'=>$shop_data['broker_phone'],'status !='=>'2'));
// if(!empty($phoneChk) && $phoneChk->num_rows() > 0){
// return 3;
// }
// $status = $this->db->insert('mechanic_shop',$shop_data);
// return ($status)?1:0;
// }
function getShop($shop_id = '',$view_all = 0){ function getShop($shop_id = '',$view_all = 0){
$cond = ($view_all != 0)?' status IN (0,1) ':' status IN (1) '; $cond = ($view_all != 0)?' status IN (0,1) ':' status IN (1) ';
...@@ -33,29 +25,22 @@ class Shop_model extends CI_Model { ...@@ -33,29 +25,22 @@ class Shop_model extends CI_Model {
return (empty($shop_id))?$result->result():$result->row(); return (empty($shop_id))?$result->result():$result->row();
} }
// function changeStatus($shop_id = '', $status = '0'){ function changeStatus($shop_id = '', $status = '0'){
// if(empty($shop_id)){ if(empty($shop_id)){
// return 0; return 0;
// } }
// $status = $this->db->update('mechanic_shop',array('status'=>$status), array('broker_id'=>$shop_id)); $status = $this->db->update('mechanic_shop',array('status'=>$status), array('shop_id'=>$shop_id));
// return $status; return $status;
// } }
// function updateShop($shop_id = '', $shop_data = array()){ function updateShop($shop_id = '', $shop_data = array()){
// if(empty($shop_id) || empty($shop_data)){ if(empty($shop_id) || empty($shop_data)){
// return 0; return 0;
// } }
// $emailChk = $this->db->get_where('mechanic_shop',array('broker_email'=>$shop_data['broker_email'],'status !='=>'2','broker_id !='=>$shop_id));
// if(!empty($emailChk) && $emailChk->num_rows() > 0){ $status = $this->db->update('mechanic_shop',$shop_data,array('shop_id'=>$shop_id));
// return 2; return ($status)?1:0;
// } }
// $phoneChk = $this->db->get_where('mechanic_shop',array('broker_phone'=>$shop_data['broker_phone'],'status !='=>'2','broker_id !='=>$shop_id));
// if(!empty($phoneChk) && $phoneChk->num_rows() > 0){
// return 3;
// }
// $status = $this->db->update('mechanic_shop',$shop_data,array('broker_id'=>$shop_id));
// return ($status)?1:0;
// }
} }
?> ?>
\ No newline at end of file
...@@ -6,33 +6,61 @@ class User_model extends CI_Model { ...@@ -6,33 +6,61 @@ class User_model extends CI_Model {
parent::_construct(); parent::_construct();
} }
function getUserData(){ function getUserData($user_id = '', $user_type = ''){
$user_id = $this->session->userdata('id'); $user_id = (empty($user_id))?$this->session->userdata('id'):$user_id;
$user_type = $this->session->userdata('user_type'); $user_type = (empty($user_type))?$this->session->userdata('user_type'):$user_type;
if($user_type == 1){
$result = $this->db->get_where('admin_users',array('status'=>'1','id'=>$user_id)); $result = $this->db->get_where('admin_users',array('status'=>'1','id'=>$user_id));
} else {
$sql = "SELECT AU.*, CMP.*
FROM admin_users AS AU
INNER JOIN company AS CMP ON (CMP.company_id = AU.id)
WHERE AU.status = '1' AND AU.id = '".$user_id."'";
$result = $this->db->query($sql);
}
if(empty($result)){ if(empty($result)){
return 0; return 0;
} }
return $result->row(); $result = $result->row();
$result->mechanic_data = '';
$result->mechanic_shop_data = '';
if($user_type == 2){
$this->load->model('Mechanic_model');
$result->mechanic_data = $this->Mechanic_model->getMechanic($user_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;
}
}
}
return $result;
} }
function updateUser($user_id = '',$user_type = '',$user_data = array()){ function updateUser($user_id = '',$user_type = '',$user_data = array()){
if(empty($user_id) || empty($user_type) || empty($user_data)){ if(empty($user_id) || empty($user_type) || empty($user_data)){
return 0; return 0;
} }
$emailChk = $this->db->get_where('admin_users',array('username'=>$user_data['email_id'],'id !='=>$user_id,'status !='=>'2')); $userIdChk = $this->db->query("SELECT * FROM mechanic AS MECH
if(!empty($emailChk) && $emailChk->num_rows() > 0){ INNER JOIN admin_users AS AU ON (AU.id = MECH.mechanic_id)
return 2; WHERE AU.status!='2' AND AU.id!='".$user_id."' AND
AU.username='".$mechanic_data['username']."'");
if(!empty($userIdChk) && $userIdChk->num_rows() > 0){
return 4;
} }
$admUpArr = array('username'=>$user_data['email_id'],'display_name'=>$user_data['company_name']); if($user_type == 2){
$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!='".$user_id."' AND
MECH.email_id='".$user_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!='".$user_id."' AND
MECH.phone='".$user_data['phone']."'");
if(!empty($phoneChk) && $phoneChk->num_rows() > 0){
return 3;
}
}
$admUpArr = array('username'=>$user_data['username'],'display_name'=>$user_data['display_name']);
if(!empty($user_data['profile_image'])){ if(!empty($user_data['profile_image'])){
$admUpArr['profile_image'] = $user_data['profile_image']; $admUpArr['profile_image'] = $user_data['profile_image'];
} }
...@@ -40,10 +68,28 @@ class User_model extends CI_Model { ...@@ -40,10 +68,28 @@ class User_model extends CI_Model {
$admUpArr['password'] = $user_data['password']; $admUpArr['password'] = $user_data['password'];
} }
$status = $this->db->update('admin_users',$admUpArr,array('id'=>$user_id)); $status = $this->db->update('admin_users',$admUpArr,array('id'=>$user_id));
if($status && $user_type == 2){ if(!$status){
$company_federal_id = (isset($user_data['company_federal_id']) && !empty($user_data['company_federal_id']))?$user_data['company_federal_id']:''; return 0;
$status = $this->db->update('company',array('company_name'=>$user_data['company_name'],'address'=>$user_data['address'],'phone'=>$user_data['phone'],'fax'=>$user_data['fax'],'email_id'=>$user_data['email_id'],'company_contact'=>$user_data['company_contact'],'company_info'=>$user_data['company_info'],'company_federal_id'=>$company_federal_id), array('company_id'=>$user_id)); }
if($user_type == 2){
$insertArr = array('first_name'=>$user_data['first_name'],'email_id'=>$user_data['email_id'],
'address'=>$user_data['address'],'city'=>$user_data['city'],
'state'=>$user_data['state'],'shop_id'=>$user_data['store'],
'last_name'=>$user_data['last_name'],'phone'=>$user_data['phone'],
'licence_number'=>$user_data['licence_number'],
'licence_exp_date'=>$user_data['licence_exp_date']);
if(!empty($user_data['licence'])){
$insertArr['licence'] = $user_data['licence'];
}
$status = $this->db->update('mechanic', $insertArr, array('mechanic_id'=>$user_id));
} }
$usrData = $this->getUserData($user_id,$user_type);
if(!empty($usrData)){
$this->session->set_userdata('user',$usrData);
$this->session->set_userdata('mechanic_data',$usrData->mechanic_data);
$this->session->set_userdata('mechanic_shop_data',$usrData->mechanic_shop_data);
}
return $status; return $status;
} }
} }
......
<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
$redirectUrl = (isset($customer_id) && !empty($customer_id))
?'Customer/updateCustomer/'.$customer_id
:'Customer/createCustomer';
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">
<h3 class="box-title">Personal Details</h3>
</div>
<form role="form" action="<?=base_url($redirectUrl)?>" method="post" class="validate" data-parsley-validate="" enctype="multipart/form-data">
<div class="box-body">
<div class="col-md-12">
<div class="col-md-6">
<div class="form-group has-feedback">
<label>First Name</label>
<input type="text" class="form-control required" data-parsley-trigger="change"
data-parsley-minlength="2" data-parsley-pattern="^[a-zA-Z\ . ! @ # $ % ^ & * () + = , \/]+$"
required="" name="first_name" placeholder="Enter Patient First Name"
value="<?= (isset($customer_data) && isset($customer_data->first_name))?$customer_data->first_name:'' ?>">
<span class="glyphicon form-control-feedback"></span>
</div>
<div class="form-group has-feedback">
<label>Email</label>
<input type="email" class="form-control required" data-parsley-trigger="change"
data-parsley-minlength="2" required="" name="email" placeholder="Enter Patient Email"
value="<?= (isset($customer_data) && isset($customer_data->email))?$customer_data->email:'' ?>">
<span class="glyphicon form-control-feedback"></span>
</div>
<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:'' ?>">
<div class="input-group-addon">
<i class="fa fa-calendar"></i>
</div>
</div>
</div>
<div class="form-group has-feedback">
<label>Address</label>
<textarea class="form-control required" data-parsley-trigger="change"
data-parsley-minlength="2" required="" name="address" placeholder="Enter Patient Address"><?= (isset($customer_data) && isset($customer_data->address))?trim($customer_data->address):'' ?></textarea>
<span class="glyphicon form-control-feedback"></span>
</div>
</div>
<div class="col-md-6">
<div class="form-group has-feedback">
<label>Last Name</label>
<input type="text" class="form-control required" data-parsley-trigger="change"
data-parsley-minlength="2" data-parsley-pattern="^[a-zA-Z\ . ! @ # $ % ^ & * () + = , \/]+$" required="" name="last_name" placeholder="Enter Patient Last Name"
value="<?= (isset($customer_data) && isset($customer_data->last_name))?$customer_data->last_name:'' ?>">
<span class="glyphicon form-control-feedback"></span>
</div>
<div class="form-group has-feedback">
<label>Phone</label>
<input type="number" class="form-control required" data-parsley-trigger="change"
data-parsley-minlength="2" required="" name="phone" placeholder="Enter Patient Phone"
value="<?= (isset($customer_data) && isset($customer_data->phone))?$customer_data->phone:'' ?>">
<span class="glyphicon form-control-feedback"></span>
</div>
<div class="form-group">
<label for="exampleInputEmail1">Profile Picture</label>
<div class="col-md-12">
<div class="col-md-3">
<img id="profile_image" src="<?= (isset($customer_data) && isset($customer_data->profile_image))?base_url($customer_data->profile_image):'' ?>" onerror="this.src='<?=base_url("assets/images/user_avatar.jpg")?>'" height="75" width="75" />
</div>
<div class="col-md-9" style="padding-top: 25px;">
<input name="profile_image" type="file" accept="image/*"
class="<?= (isset($customer_id) && !empty($customer_id))?'':'required' ?>"
onchange="setImg(this,'profile_image')" />
</div>
</div>
</div>
</div>
</div>
<br>
<div class="box-header with-border">
<h3 class="box-title">Vehicle Details</h3>
</div>
<br>
<div class="col-md-12">
<div class="col-md-6">
<div class="form-group has-feedback">
<label>First Name</label>
<input type="text" class="form-control required" data-parsley-trigger="change"
data-parsley-minlength="2" data-parsley-pattern="^[a-zA-Z\ . ! @ # $ % ^ & * () + = , \/]+$"
required="" name="first_name" placeholder="Enter Patient First Name"
value="<?= (isset($customer_data) && isset($customer_data->first_name))?$customer_data->first_name:'' ?>">
<span class="glyphicon form-control-feedback"></span>
</div>
</div>
</div>
<div class="col-md-12">
<div class="box-footer">
<div style="text-align: center;">
<button type="submit" class="btn btn-primary">Submit</button>
</div>
</div>
</div>
</form>
</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($issue_id) || empty($issue_id))?'Issue/createIssue':'Issue/updateIssue/'.$issue_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-12">
<div class="form-group">
<label>Issue Shot Discription</label>
<input type="text" class="form-control required" data-parsley-trigger="change"
data-parsley-minlength="2" name="issue" required="" value="<?= (isset($issue_data->issue))?$issue_data->issue:'' ?>"placeholder="Issue Shot Discription">
<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('Issue/viewIssues') ?>" 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($mechIssueId)||empty($mechIssueId))?'Issue/createMechIssue':'Issue/updateMechIssue/'.$mechIssueId;
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-12">
<div class="col-md-6">
<div class="form-group">
<label>General Issue</label>
<select name="issue_id" class="form-control required" placeholder="Select General Issue" required="">
<option selected disabled>Choose an Issue Type</option>
<?php
if(!empty($issue_data)){
foreach ($issue_data as $issue) {
$select = (isset($issue->issue_id) && $issue->issue_id != $issue->issue_id)
?' selected ':'';
echo'<option '.$select.' value="'.$issue->issue_id.'">'.$issue->issue.'</option>';
}
} ?>
</select>
</div>
<div class="form-group">
<label>Custom Service Fee</label>
<input type="text" class="form-control required" data-parsley-trigger="change"
data-parsley-minlength="2" data-parsley-pattern="^[0-9\ , . \/]+$" required="" name="service_fee" placeholder="Custom Service Fee" value="<?= (isset($customer_data) && isset($customer_data->service_fee))?$customer_data->service_fee:'' ?>">
<span class="glyphicon form-control-feedback"></span>
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label>Custom Repair Description</label>
<textarea class="form-control required" data-parsley-trigger="change"
data-parsley-minlength="2" required="" name="issue_description" style="height: 80px;" placeholder="Custom Repair Description"><?= (isset($issue_data) && isset($issue_data->issue_description))?trim($issue_data->issue_description):'' ?></textarea>
<span class="glyphicon form-control-feedback"></span>
</div>
</div>
</div>
<input type="hidden" name="mechanic_id" value="<?= $mechanic_id ?>" >
<div class="col-md-12">
<div class="box-footer textCenterAlign">
<button type="submit" class="btn btn-primary">Submit</button>
<a href="<?= base_url('Issue/viewIssues') ?>" 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" >
<!-- Content Header (Page header) -->
<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>
<!-- 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'] ?>
</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">Issues List</h3></div>
<div class="col-md-6" align="right">
<a class="btn btn-sm btn-primary" href="<?= base_url('Issue/addIssue') ?>">Add New General Issue</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="50px">ID</th>
<th width="600px;">Issue Shot Discription</th>
<th width="100px;">Status</th>
<th width="300px;">Action</th>
</tr>
</thead>
<tbody>
<?php
if(!empty($issue_data)){
foreach($issue_data as $issue) { ?>
<tr>
<th class="center"><?= $issue->issue_id ?></th>
<th class="center"><?= $issue->issue ?></th>
<th class="center"><?= ($issue->status == 1)?'Active':'De-activate' ?></th>
<td class="center">
<a class="btn btn-sm btn-primary"
href="<?= base_url('Issue/editIssue/'.encode_param($issue->issue_id)) ?>">
<i class="fa fa-fw fa-trash"></i>Edit
</a>
<a class="btn btn-sm btn-danger"
href="<?= base_url("Issue/changeStatus/".encode_param($issue->issue_id))."/2" ?>"
onClick="return doconfirm()">
<i class="fa fa-fw fa-trash"></i>Delete
</a>
<?php if($issue->status == 1){ ?>
<a class="btn btn-sm btn-success" style="background-color:#ac2925" href="<?= base_url("Issue/changeStatus/".encode_param($issue->issue_id))."/0" ?>">
<i class="fa fa-cog"></i> De-activate
</a>
<?php } else { ?>
<a class="btn btn-sm btn-success" href="<?= base_url("Issue/changeStatus/".encode_param($issue->issue_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-sm-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>
<?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">
<h3 class="box-title">Mapped Issues Management</h3>
</div>
<div class="box-body">
<form id="chooseMechForm" role="form" action="<?=base_url('Issue/viewMappedIssues')?>"
method="post" class="validate" data-parsley-validate="" enctype="multipart/form-data">
<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>
<option selected disabled>Select Mechanic</option>
<?php
if(!empty($mechanic_data)){
foreach ($mechanic_data as $mechanic) {
$chkFlg = ($mechanic_id == $mechanic->mechanic_id)?'selected':'';
echo '<option value="'.encode_param($mechanic->mechanic_id).'" '.$chkFlg.'>
'.$mechanic->first_name.' '.$mechanic->last_name.
'</option>';
}
}
?>
</select>
</div>
</div>
</form>
</div>
</div>
</div>
<?php } ?>
<?php
if($this->session->userdata['user_type'] != 1 || ($this->session->userdata['user_type'] == 1 && !empty($mechanic_id))){ ?>
<div class="col-xs-12">
<div class="box box-warning">
<div class="box-body">
<table id="mechanicUsers" class="table table-bordered table-striped datatable ">
<thead>
<tr>
<th class="hidden">ID</th>
<th width="80px;">Mechanic Name</th>
<th width="250px;">Issue Shot Discription</th>
<th width="250px;">Mechanic Custom Discription</th>
<th width="50px;">Fee</th>
<th width="50px;">Status</th>
<th width="250px;">Action</th>
</tr>
</thead>
<tbody>
<?php
if(!empty($mechanicIssueData)){
foreach($mechanicIssueData as $customData) { ?>
<tr>
<th class="hidden"><?= $customData->issue_id ?></th>
<th class="center"><?= $customData->first_name.' '.$customData->first_name ?></th>
<th class="center"><?= $customData->issue ?></th>
<th class="center"><?= $customData->issue_description ?></th>
<th class="center"><?= $customData->service_fee ?></th>
<th class="center"><?= ($customData->status == 1)?'Active':'De-activate' ?></th>
<td class="center">
<a class="btn btn-sm btn-primary"
href="<?= base_url('Issue/editIssue/'.encode_param($customData->issue_id)) ?>">
<i class="fa fa-fw fa-trash"></i>Edit
</a>
<a class="btn btn-sm btn-danger"
href="<?= base_url("Issue/changeStatus/".encode_param($customData->issue_id))."/2" ?>"
onClick="return doconfirm()">
<i class="fa fa-fw fa-trash"></i>Delete
</a>
<?php if($customData->status == 1){ ?>
<a class="btn btn-sm btn-success" style="background-color:#ac2925" href="<?= base_url("Issue/changeMappedIssueStatus/".encode_param($customData->mechanic_id)."/".encode_param($customData->issue_id)."/0") ?>">
<i class="fa fa-cog"></i> De-activate
</a>
<?php } else { ?>
<a class="btn btn-sm btn-success" href="<?= base_url("Issue/changeMappedIssueStatus/".encode_param($customData->mechanic_id)."/".encode_param($customData->issue_id)."/1") ?>">
<i class="fa fa-cog"></i> Activate
</a>
<?php } ?>
</td>
</tr>
<?php } } ?>
</tbody>
</table>
</div>
</div>
</div>
<?php } ?>
</div>
</section>
</div>
\ No newline at end of file
<div class="content-wrapper" >
<!-- Content Header (Page header) -->
<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>
<!-- 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'] ?>
</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">Mechanics List</h3></div>
<div class="col-md-6" align="right">
<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>
</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;">Display Name</th>
<th width="150px;">User Name</th>
<th width="150px;">Email_id</th>
<th width="100px;">Phone</th>
<th width="100px;">Status</th>
<th width="500px;">Action</th>
</tr>
</thead>
<tbody>
<?php
if(!empty($user_data)){
foreach($user_data as $user) { ?>
<tr>
<th class="hidden"><?= $user->mechanic_id ?></th>
<th class="center"><?= $user->display_name ?></th>
<th class="center"><?= $user->username ?></th>
<th class="center"><?= $user->email_id ?></th>
<th class="center"><?= $user->phone ?></th>
<th class="center"><?= ($user->status == 1)?'Active':'De-activate' ?></th>
<td class="center">
<a class="btn btn-sm btn-primary" id="viewMechanic" mechanic_id="<?= encode_param($user->mechanic_id) ?>">
<i class="fa fa-fw fa-edit"></i>View
</a>
<a class="btn btn-sm btn-info"
href="<?= base_url('Mechanic/editMechanics/'.encode_param($user->mechanic_id)) ?>">
<i class="fa fa-fw fa-trash"></i>Edit
</a>
<a class="btn btn-sm btn-danger"
href="<?= base_url("Mechanic/changeStatus/".encode_param($user->mechanic_id))."/2" ?>"
onClick="return doconfirm()">
<i class="fa fa-fw fa-trash"></i>Delete
</a>
<?php if($user->status == 1){ ?>
<a class="btn btn-sm btn-success" style="background-color:#ac2925" href="<?= base_url("Mechanic/changeStatus/".encode_param($user->mechanic_id))."/0" ?>">
<i class="fa fa-cog"></i> De-activate
</a>
<?php } else { ?>
<a class="btn btn-sm btn-success" href="<?= base_url("Mechanic/changeStatus/".encode_param($user->mechanic_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
$url = (!isset($shop_id) || empty($shop_id))?'Shop/createShop':'Shop/updateShop/'.$shop_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>Shop 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="shop_name" required="" value="<?= (isset($shop_data->shop_name))?$shop_data->shop_name:'' ?>"placeholder="Enter First Name">
<span class="glyphicon form-control-feedback"></span>
</div>
<div class="form-group">
<label>Email</label>
<input type="email" class="form-control required" data-parsley-trigger="change"
data-parsley-minlength="2" required="" name="email_id" placeholder="Enter email ID" value="<?= (isset($shop_data->email_id))?$shop_data->email_id:'' ?>">
<span class="glyphicon form-control-feedback"></span>
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label>Phone</label>
<input type="text" class="form-control required" data-parsley-trigger="change"
data-parsley-minlength="2" data-parsley-pattern="^[0-9\ , - + \/]+$" required=""
value="<?= (isset($shop_data->phone))?$shop_data->phone:'' ?>" name="phone" placeholder="Enter Phone Number" >
<span class="glyphicon form-control-feedback"></span>
</div>
<div class="form-group">
<label>Address</label>
<textarea type="text" class="form-control required" data-parsley-trigger="change"
data-parsley-pattern="^[a-zA-Z0-9\ , # - . _ @ \/]+$" required=""
data-parsley-minlength="2" name="address" placeholder="Enter Address"><?= (isset($shop_data->address))?$shop_data->address:'' ?></textarea>
<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('Shop/viewShops') ?>" 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" >
<!-- Content Header (Page header) -->
<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>
<!-- 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'] ?>
</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">Shops List</h3></div>
<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 class="box-body">
<table id="mechanicUsers" class="table table-bordered table-striped datatable ">
<thead>
<tr>
<th class="hidden">ID</th>
<th width="150px;">Shop Name</th>
<th width="150px;">Phone</th>
<th width="150px;">Email ID</th>
<th width="250px;">Address</th>
<th width="100px;">Status</th>
<th width="300px;">Action</th>
</tr>
</thead>
<tbody>
<?php
if(!empty($shop_data)){
foreach($shop_data as $shop) { ?>
<tr>
<th class="hidden"><?= $shop->shop_id ?></th>
<th class="center"><?= $shop->shop_name ?></th>
<th class="center"><?= $shop->phone ?></th>
<th class="center"><?= $shop->email_id ?></th>
<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)) ?>">
<i class="fa fa-fw fa-trash"></i>Edit
</a>
<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){ ?>
<a class="btn btn-sm btn-success" style="background-color:#ac2925" href="<?= base_url("Shop/changeStatus/".encode_param($shop->shop_id))."/0" ?>">
<i class="fa fa-cog"></i> De-activate
</a>
<?php } else { ?>
<a class="btn btn-sm btn-success" href="<?= base_url("Shop/changeStatus/".encode_param($shop->shop_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
...@@ -22,43 +22,20 @@ ...@@ -22,43 +22,20 @@
<li class="treeview"> <li class="treeview">
<a href="#"> <a href="#">
<i class="fa fa-bars" aria-hidden="true"></i> <i class="fa fa-bars" aria-hidden="true"></i>
<span>Driver Management</span> <span>Shop Management</span>
<i class="fa fa-angle-left pull-right"></i> <i class="fa fa-angle-left pull-right"></i>
</a> </a>
<ul class="treeview-menu"> <ul class="treeview-menu">
<li> <li>
<a href="<?= base_url('Driver/add_driver') ?>"> <a href="<?= base_url('Shop/addShop') ?>">
<i class="fa fa-circle-o text-aqua"></i> <i class="fa fa-circle-o text-aqua"></i>
Add Driver Add Mechanic Shop
</a> </a>
</li> </li>
<li> <li>
<a href="<?= base_url('Driver/driver_list') ?>"> <a href="<?= base_url('Shop/viewShops') ?>">
<i class="fa fa-circle-o text-aqua"></i> <i class="fa fa-circle-o text-aqua"></i>
View Driver View Mechanic Shops
</a>
</li>
</ul>
</li>
<?php if($this->session->userdata['user_type'] == 1){ ?>
<li class="treeview">
<a href="#">
<i class="fa fa-bars" aria-hidden="true"></i>
<span>Patient Management</span>
<i class="fa fa-angle-left pull-right"></i>
</a>
<ul class="treeview-menu">
<li>
<a href="<?= base_url('Customer/addCustomerUser') ?>">
<i class="fa fa-circle-o text-aqua"></i>
Add Patient
</a>
</li>
<li>
<a href="<?= base_url('Customer/listCustomerUsers') ?>">
<i class="fa fa-circle-o text-aqua"></i>
View Patient
</a> </a>
</li> </li>
</ul> </ul>
...@@ -66,133 +43,81 @@ ...@@ -66,133 +43,81 @@
<li class="treeview"> <li class="treeview">
<a href="#"> <a href="#">
<i class="fa fa-bars" aria-hidden="true"></i> <i class="fa fa-bars" aria-hidden="true"></i>
<span>Company Management</span> <span>Issue Management</span>
<i class="fa fa-angle-left pull-right"></i> <i class="fa fa-angle-left pull-right"></i>
</a> </a>
<ul class="treeview-menu"> <ul class="treeview-menu">
<?php if($this->session->userdata['user_type'] != 1){ ?>
<li> <li>
<a href="<?= base_url('Company/add_company') ?>"> <a href="<?= base_url('Issue/issueMapping') ?>">
<i class="fa fa-circle-o text-aqua"></i>
Add Company
</a>
</li>
<li>
<a href="<?= base_url('Company/company_list') ?>">
<i class="fa fa-circle-o text-aqua"></i>
View Company
</a>
</li>
<li>
<a href="<?= base_url('Company/create_offer') ?>">
<i class="fa fa-circle-o text-aqua"></i> <i class="fa fa-circle-o text-aqua"></i>
Create Offer Issue Mapping
</a> </a>
</li> </li>
<?php } ?>
<li> <li>
<a href="<?= base_url('Company/manager_offers') ?>"> <a href="<?= base_url('Issue/viewMappedIssues') ?>">
<i class="fa fa-circle-o text-aqua"></i> <i class="fa fa-circle-o text-aqua"></i>
Manage Offers Manage Mapped Issues
</a> </a>
</li> </li>
<li> <li>
<a href="<?= base_url('Company/manager_offers/3') ?>"> <a href="<?= base_url('Issue/viewIssues') ?>">
<i class="fa fa-circle-o text-aqua"></i> <i class="fa fa-circle-o text-aqua"></i>
Veiw Activation Packs Manage Common Issues
</a> </a>
</li> </li>
</ul> </ul>
</li> </li>
<?php if($this->session->userdata['user_type'] == 1){ ?>
<li class="treeview">
<a href="#">
<i class="fa fa-bars" aria-hidden="true"></i>
<span>Mechanic Management</span>
<i class="fa fa-angle-left pull-right"></i>
</a>
<ul class="treeview-menu">
<li>
<a href="<?= base_url('Mechanic/addMechanic') ?>">
<i class="fa fa-circle-o text-aqua"></i>
Add Mechanic
</a>
</li>
<li>
<a href="<?= base_url('Mechanic/viewMechanics') ?>">
<i class="fa fa-circle-o text-aqua"></i>
View Mechanics
</a>
</li>
</ul>
</li>
<?php } ?> <?php } ?>
<li class="treeview"> <li class="treeview">
<a href="#"> <a href="#">
<i class="fa fa-bars" aria-hidden="true"></i> <i class="fa fa-bars" aria-hidden="true"></i>
<span>Broker Management</span> <span>Customer Management</span>
<i class="fa fa-angle-left pull-right"></i>
</a>
<ul class="treeview-menu">
<li>
<a href="<?= base_url('Broker/add_broker') ?>">
<i class="fa fa-circle-o text-aqua"></i>
Add Broker
</a>
</li>
<li>
<a href="<?= base_url('Broker/view_brokers') ?>">
<i class="fa fa-circle-o text-aqua"></i>
View Brokers
</a>
</li>
</ul>
</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> <i class="fa fa-angle-left pull-right"></i>
</a> </a>
<ul class="treeview-menu"> <ul class="treeview-menu">
<li> <li>
<a href="<?= base_url('Vehicle/add_vehicle') ?>"> <a href="<?= base_url('Customer/addCustomerUser') ?>">
<i class="fa fa-circle-o text-aqua"></i>
Add Vehicle
</a>
</li>
<li>
<a href="<?= base_url('Vehicle/view_vehicles') ?>">
<i class="fa fa-circle-o text-aqua"></i>
View Vehicle
</a>
</li>
<li>
<a href="<?= base_url('Vehicle/view_vehicle_types') ?>">
<i class="fa fa-circle-o text-aqua"></i>
Manage Vehicle Types
</a>
</li>
</ul>
</li>
<li class="treeview">
<a href="#">
<i class="fa fa-bars" aria-hidden="true"></i>
<span>Ride Management</span>
<i class="fa fa-angle-left pull-right"></i>
</a>
<ul class="treeview-menu">
<li>
<a href="<?= base_url('Ride/view_rides') ?>">
<i class="fa fa-circle-o text-aqua"></i> <i class="fa fa-circle-o text-aqua"></i>
View Rides Add Customer
</a> </a>
</li> </li>
<li> <li>
<a href="<?= base_url('Ride/import_ride') ?>"> <a href="<?= base_url('Customer/listCustomerUsers') ?>">
<i class="fa fa-circle-o text-aqua"></i> <i class="fa fa-circle-o text-aqua"></i>
Import Rides View Customers
</a> </a>
</li> </li>
<?php if($this->session->userdata['user_type'] != 1){ ?>
<li>
<a href="<?= base_url('Ride/scheduled_rides') ?>">
<i class="fa fa-circle-o text-aqua"></i>
Scheduled Rides
</a>
</li>
<?php } ?>
</ul> </ul>
</li> </li>
<li><a href="<?= base_url('Payment/getPayDetails') ?>">
<i class="fa fa-wrench" aria-hidden="true">
</i><span>Transaction Management</span></a>
</li>
<li><a href="<?= base_url('Report/generate') ?>">
<i class="fa fa-wrench" aria-hidden="true">
</i><span>Report Generation</span></a>
</li>
<?php if($this->session->userdata['user_type'] == 1){ ?> <?php if($this->session->userdata['user_type'] == 1){ ?>
<li><a href="<?= base_url('Settings') ?>"> <li><a href="<?= base_url('Settings') ?>">
<i class="fa fa-wrench" aria-hidden="true"> <i class="fa fa-wrench" aria-hidden="true">
</i><span>Settings</span></a> </i><span>Settings</span></a>
</li> </li>
<?php } ?> <?php } ?>
</ul> </ul>
</section> </section>
......
...@@ -49,7 +49,7 @@ ...@@ -49,7 +49,7 @@
<div class="col-md-5"><span>Display Name </span></div> <div class="col-md-5"><span>Display Name </span></div>
<div class="col-md-7"> <div class="col-md-7">
<span>:</span> <span>:</span>
<label style="padding-left:20px;"> <label class="padLeft20">
<?= $user_data->display_name ?> <?= $user_data->display_name ?>
</label> </label>
</div> </div>
...@@ -58,21 +58,22 @@ ...@@ -58,21 +58,22 @@
<div class="col-md-5"><span>User Name </span></div> <div class="col-md-5"><span>User Name </span></div>
<div class="col-md-7"> <div class="col-md-7">
<span>:</span> <span>:</span>
<label style="padding-left:20px;"> <label class="padLeft20">
<?= $user_data->username ?> <?= $user_data->username ?>
</label> </label>
</div> </div>
</div> </div>
<?php <?php
if($this->session->userdata('user_type') == 2 && isset($this->session->userdata['mechanic_data']) if($this->session->userdata('user_type') == 2 &&
&& !empty($this->session->userdata['mechanic_data'])){ isset($this->session->userdata['mechanic_data']) &&
$mechanic_data = $this->session->userdata['mechanic_data']; ?> !empty($this->session->userdata['mechanic_data'])){
$mechanic_data = $this->session->userdata['user']->mechanic_data; ?>
<div class="row" style="padding-top:20px;"> <div class="row padTop20">
<div class="col-md-5"><span>First Name </span></div> <div class="col-md-5"><span>First Name </span></div>
<div class="col-md-7"> <div class="col-md-7">
<span>:</span> <span>:</span>
<label style="padding-left:20px;"> <label class="padLeft20">
<?= $mechanic_data->first_name ?> <?= $mechanic_data->first_name ?>
</label> </label>
</div> </div>
...@@ -82,7 +83,7 @@ ...@@ -82,7 +83,7 @@
<div class="col-md-5"><span>Last Name </span></div> <div class="col-md-5"><span>Last Name </span></div>
<div class="col-md-7"> <div class="col-md-7">
<span>:</span> <span>:</span>
<label style="padding-left:20px;"> <label class="padLeft20">
<?= $mechanic_data->last_name ?> <?= $mechanic_data->last_name ?>
</label> </label>
</div> </div>
...@@ -92,7 +93,7 @@ ...@@ -92,7 +93,7 @@
<div class="col-md-5"><span>Phone Number </span></div> <div class="col-md-5"><span>Phone Number </span></div>
<div class="col-md-7"> <div class="col-md-7">
<span>:</span> <span>:</span>
<label style="padding-left:20px;"> <label class="padLeft20">
<?= $mechanic_data->phone ?> <?= $mechanic_data->phone ?>
</label> </label>
</div> </div>
...@@ -102,7 +103,7 @@ ...@@ -102,7 +103,7 @@
<div class="col-md-5"><span>Email ID </span></div> <div class="col-md-5"><span>Email ID </span></div>
<div class="col-md-7"> <div class="col-md-7">
<span>:</span> <span>:</span>
<label style="padding-left:20px;"> <label class="padLeft20">
<?= $mechanic_data->email_id ?> <?= $mechanic_data->email_id ?>
</label> </label>
</div> </div>
...@@ -112,7 +113,7 @@ ...@@ -112,7 +113,7 @@
<div class="col-md-5"><span>Address </span></div> <div class="col-md-5"><span>Address </span></div>
<div class="col-md-7"> <div class="col-md-7">
<span>:</span> <span>:</span>
<label style="padding-left:20px;"> <label class="padLeft20">
<?= $mechanic_data->address ?> <?= $mechanic_data->address ?>
</label> </label>
</div> </div>
...@@ -122,7 +123,7 @@ ...@@ -122,7 +123,7 @@
<div class="col-md-5"><span>City </span></div> <div class="col-md-5"><span>City </span></div>
<div class="col-md-7"> <div class="col-md-7">
<span>:</span> <span>:</span>
<label style="padding-left:20px;"> <label class="padLeft20">
<?= $mechanic_data->city ?> <?= $mechanic_data->city ?>
</label> </label>
</div> </div>
...@@ -132,11 +133,57 @@ ...@@ -132,11 +133,57 @@
<div class="col-md-5"><span>State </span></div> <div class="col-md-5"><span>State </span></div>
<div class="col-md-7"> <div class="col-md-7">
<span>:</span> <span>:</span>
<label style="padding-left:20px;"> <label class="padLeft20">
<?= $mechanic_data->state ?> <?= $mechanic_data->state ?>
</label> </label>
</div> </div>
</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>
<div class="col-md-5"> <div class="col-md-5">
...@@ -144,7 +191,7 @@ ...@@ -144,7 +191,7 @@
<div class="col-md-5"><span>Licence Number </span></div> <div class="col-md-5"><span>Licence Number </span></div>
<div class="col-md-7"> <div class="col-md-7">
<span>:</span> <span>:</span>
<label style="padding-left:20px;"> <label class="padLeft20">
<?= $mechanic_data->licence_number ?> <?= $mechanic_data->licence_number ?>
</label> </label>
</div> </div>
...@@ -154,7 +201,7 @@ ...@@ -154,7 +201,7 @@
<div class="col-md-5"><span>Licence Exp. Date </span></div> <div class="col-md-5"><span>Licence Exp. Date </span></div>
<div class="col-md-7"> <div class="col-md-7">
<span>:</span> <span>:</span>
<label style="padding-left:20px;"> <label class="padLeft20">
<?= $mechanic_data->licence_exp_date ?> <?= $mechanic_data->licence_exp_date ?>
</label> </label>
</div> </div>
...@@ -168,13 +215,11 @@ ...@@ -168,13 +215,11 @@
<img src="<?= base_url($mechanic_data->licence) ?>" <img src="<?= base_url($mechanic_data->licence) ?>"
onclick="viewImageModal('Licence Image','<?= base_url($mechanic_data->licence) ?>');" onclick="viewImageModal('Licence Image','<?= base_url($mechanic_data->licence) ?>');"
onerror="this.src='<?=base_url("assets/images/no_image.png")?>';" onerror="this.src='<?=base_url("assets/images/no_image.png")?>';"
class="img-circle cpoint" alt="Licence Image" height="200px" width="auto" class="cpoint" alt="Licence Image" height="200px" width="auto"
style="float:right;"> style="padding-left: 20%;">
</div> </div>
</div> </div>
</div> </div>
<?php } else { ?> <?php } else { ?>
</div> </div>
<?php } ?> <?php } ?>
......
...@@ -306,4 +306,32 @@ ...@@ -306,4 +306,32 @@
.disable-block { .disable-block {
pointer-events: none; pointer-events: none;
opacity: 0.5; opacity: 0.5;
}
.padTop20 {
padding-top:20px !important;
}
.padTop10 {
padding-top:10px !important;
}
.padRight20 {
padding-right:20px !important;
}
.padLeft20 {
padding-left:20px !important;
}
.padUnset {
padding-left: unset !important;
}
.dispInLine {
display: inline-block !important;
}
.textCenterAlign {
text-align:center;
} }
\ No newline at end of file
...@@ -72,3 +72,164 @@ function viewImageModal(title,img_src){ ...@@ -72,3 +72,164 @@ function viewImageModal(title,img_src){
'</div>'; '</div>';
modalTrigger(title,body_html); modalTrigger(title,body_html);
} }
jQuery('[id="viewMechanic"]').on('click',function() {
var mechanic_id = jQuery(this).attr('mechanic_id');
if(mechanic_id=='' || mechanic_id==undefined || mechanic_id=='undefined' || mechanic_id==null || mechanic_id=='null'){
return true;
}
modalTrigger('Mechanic Details','');
addModalLoader();
jQuery.ajax({
url : base_url+"Mechanic/getMechanicData",
type : 'POST',
data : {'mechanic_id':mechanic_id},
success: function(resp){
if(resp == '' || resp == undefined || resp == 'undefined' || resp == null || resp == 'null'){
remModalLoader();
jQuery('[id="modal_content"]').html('Something went wrong, please try again later...!');
return false;
}
var resp_data = jQuery.parseJSON(resp);
if(resp_data['status'] == '0'){
remModalLoader();
jQuery('[id="modal_content"]').html('Something went wrong, please try again later...!');
return false;
}
var mechanic_data = resp_data['data'];
jQuery.each(mechanic_data, function (index, value) {
if(value == '' || value == null || value == undefined || value == 'null' || value == 'undefined'){
mechanic_data[index] = ' -- ';
}
});
var shopHtml = '';
if(mechanic_data['shop_id'] != 0){
shopHtml = '<br><div class="row"><label>Shop Details</label></div>'+
'<div class="row">'+
'<div class="col-md-4">Shop Name</div>'+
'<div class="col-md-1">:</div>'+
'<div class="col-md-6"><label>'+mechanic_data['shop_name']+'</label></div>'+
'</div>'+
'<div class="row">'+
'<div class="col-md-4">Shop Phone</div>'+
'<div class="col-md-1">:</div>'+
'<div class="col-md-6"><label>'+mechanic_data['shop_phone']+'</label></div>'+
'</div>'+
'<div class="row">'+
'<div class="col-md-4">Shop Email</div>'+
'<div class="col-md-1">:</div>'+
'<div class="col-md-6"><label>'+mechanic_data['shop_email']+'</label></div>'+
'</div>'+
'<div class="row">'+
'<div class="col-md-4">Shop Address</div>'+
'<div class="col-md-1">:</div>'+
'<div class="col-md-6"><label>'+mechanic_data['shop_address']+'</label></div>'+
'</div>';
}
var html = '<div class="col-xs-12">'+
'<div class="col-md-2">'+
'<div class="row">'+
'<img id="driverProfileImg" src="'+base_url+mechanic_data['profile_image']+'" height="100" width="100" />'+
'</div>'+
'</div>'+
'<div class="col-md-5">'+
'<div class="row"><label>Basic Details</label></div>'+
'<div class="row">'+
'<div class="col-md-4">Display Name</div>'+
'<div class="col-md-1">:</div>'+
'<div class="col-md-6"><label>'+ mechanic_data['display_name']+'</label></div>'+
'</div> '+
'<div class="row">'+
'<div class="col-md-4">User Name</div>'+
'<div class="col-md-1">:</div>'+
'<div class="col-md-6"><label>'+ mechanic_data['username']+'</label></div>'+
'</div> '+
'<div class="row">'+
'<div class="col-md-4">First Name</div>'+
'<div class="col-md-1">:</div>'+
'<div class="col-md-6"><label>'+mechanic_data['first_name']+'</label></div>'+
'</div> '+
'<div class="row">'+
'<div class="col-md-4">Last Name</div>'+
'<div class="col-md-1">:</div>'+
'<div class="col-md-6"><label>'+mechanic_data['last_name']+'</label></div>'+
'</div> '+
'<div class="row"> '+
'<div class="col-md-4">Email ID</div>'+
'<div class="col-md-1">:</div>'+
'<div class="col-md-6"><label>'+mechanic_data['email_id']+'</label></div>'+
'</div> '+
'<div class="row"> '+
'<div class="col-md-4">Phone</div>'+
'<div class="col-md-1">:</div>'+
'<div class="col-md-6"><label>'+mechanic_data['phone']+'</label></div> '+
'</div> '+
'<div class="row"> '+
'<div class="col-md-4">Address</div>'+
'<div class="col-md-1">:</div>'+
'<div class="col-md-6"><label>'+mechanic_data['address']+'</label></div> '+
'</div> '+
'<div class="row"> '+
'<div class="col-md-4">City</div>'+
'<div class="col-md-1">:</div>'+
'<div class="col-md-6"><label>'+mechanic_data['city']+'</label></div> '+
'</div> '+
'<div class="row"> '+
'<div class="col-md-4">State</div>'+
'<div class="col-md-1">:</div>'+
'<div class="col-md-6"><label>'+mechanic_data['state']+'</label></div> '+
'</div> '+
shopHtml+
'</div> '+
'<div class="col-md-5"> '+
'<div class="row"><label>Licence Details</label></div>'+
'<div class="row"> '+
'<div class="col-md-4">Licence No.</div>'+
'<div class="col-md-1">:</div>'+
'<div class="col-md-6"><label>'+mechanic_data['licence_number']+' </label></div>'+
'</div> '+
'<div class="row"> '+
'<div class="col-md-4">Licence Expiry</div>'+
'<div class="col-md-1">:</div>'+
'<div class="col-md-6"><label>'+mechanic_data['licence_exp_date']+'</label></div>'+
'</div> '+
'<div class="row"> '+
'<div class="col-md-4">Licence Proof</div>'+
'<div class="col-md-1">:</div>'+
'<div class="col-md-5" style="text-align:center;"> '+
'<img id="driverLicenceImg" src="'+base_url+mechanic_data['licence']+'"'+
'style="margin-top:10px;max-width:205px;height:auto;max-height:130px;" />'+
'</div> '+
'</div> '+
'</div> '+
'</div>';
remModalLoader();
jQuery('[id="modal_content"]').html(html);
jQuery('[id="driverLicenceImg"]').error(function() {
jQuery('[id="driverLicenceImg"]').attr('src',base_url+'assets/images/no_image.png');
});
jQuery('[id="driverProfileImg"]').error(function() {
jQuery('[id="driverProfileImg"]').attr('src',base_url+'assets/images/user_avatar.jpg');
});
},
fail: function(xhr, textStatus, errorThrown){
remModalLoader();
jQuery('[id="modal_content"]').html('Something went wrong, please try again later...!');
},
error: function (ajaxContext) {
remModalLoader();
jQuery('[id="modal_content"]').html('Something went wrong, please try again later...!');
}
});
});
function changeMechanic(){
jQuery('[id="chooseMechForm"]').submit();
}
\ No newline at end of file
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
-- https://www.phpmyadmin.net/ -- https://www.phpmyadmin.net/
-- --
-- Host: db -- Host: db
-- Generation Time: Dec 04, 2018 at 12:41 PM -- Generation Time: Dec 07, 2018 at 12:37 PM
-- Server version: 5.6.41 -- Server version: 5.6.41
-- PHP Version: 7.2.8 -- PHP Version: 7.2.8
...@@ -43,8 +43,10 @@ CREATE TABLE `admin_users` ( ...@@ -43,8 +43,10 @@ CREATE TABLE `admin_users` (
-- --
INSERT INTO `admin_users` (`id`, `username`, `password`, `user_type`, `display_name`, `profile_image`, `status`) VALUES INSERT INTO `admin_users` (`id`, `username`, `password`, `user_type`, `display_name`, `profile_image`, `status`) VALUES
(1, 'admin', '202cb962ac59075b964b07152d234b70', 1, 'Super Admin', 'assets/uploads/services/1542079854_234858854male.jpg', 1), (1, 'admin', '202cb962ac59075b964b07152d234b70', 1, 'Super Admin User', 'assets/uploads/services/1543990056_1523012120_default.png', 1),
(2, 'mechanic', '202cb962ac59075b964b07152d234b70', 2, 'Mechanic', '', 1); (2, 'mechanic', '202cb962ac59075b964b07152d234b70', 2, 'Mechanic', 'assets/uploads/services/1544088354_car1.jpg', 1),
(11, 'cfghbfchdrfg', '97a4aa7bfb0e20d7b9813ffe99f91fd4', 2, 'lnoik', 'assets/uploads/services/1544013534_images.jpg', 0),
(12, 'admin123', '202cb962ac59075b964b07152d234b70', 2, 'Super Admin', 'assets/uploads/services/1544091403_Himalayan.jpg', 1);
-- -------------------------------------------------------- -- --------------------------------------------------------
...@@ -68,6 +70,31 @@ CREATE TABLE `customers` ( ...@@ -68,6 +70,31 @@ CREATE TABLE `customers` (
-- -------------------------------------------------------- -- --------------------------------------------------------
-- --
-- Table structure for table `issues`
--
CREATE TABLE `issues` (
`issue_id` int(11) NOT NULL,
`issue` varchar(500) NOT NULL,
`status` tinyint(3) NOT NULL DEFAULT '1'
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `issues`
--
INSERT INTO `issues` (`issue_id`, `issue`, `status`) VALUES
(1, 'Oil Change and General Service (Free Water Service).', 2),
(2, 'Wheel Alignment and General Service (Free Water Service)', 1),
(3, 'General Water Service and Periodic General Check up', 1),
(4, 'Water Service (With polishing)', 1),
(5, 'Water Service (Without polishing)', 1),
(6, 'Oil Change and General Service (Free Water Service and Polishing).', 1),
(7, 'Oil Change and General Service (Free Water Service and Polishing).', 1);
-- --------------------------------------------------------
--
-- Table structure for table `mechanic` -- Table structure for table `mechanic`
-- --
...@@ -79,7 +106,6 @@ CREATE TABLE `mechanic` ( ...@@ -79,7 +106,6 @@ CREATE TABLE `mechanic` (
`last_name` varchar(50) NOT NULL, `last_name` varchar(50) NOT NULL,
`email_id` varchar(250) NOT NULL, `email_id` varchar(250) NOT NULL,
`phone` varchar(15) NOT NULL, `phone` varchar(15) NOT NULL,
`profile_image` varchar(500) NOT NULL,
`address` varchar(250) DEFAULT NULL, `address` varchar(250) DEFAULT NULL,
`city` varchar(200) DEFAULT NULL, `city` varchar(200) DEFAULT NULL,
`state` varchar(200) DEFAULT NULL, `state` varchar(200) DEFAULT NULL,
...@@ -94,8 +120,35 @@ CREATE TABLE `mechanic` ( ...@@ -94,8 +120,35 @@ CREATE TABLE `mechanic` (
-- Dumping data for table `mechanic` -- Dumping data for table `mechanic`
-- --
INSERT INTO `mechanic` (`id`, `mechanic_id`, `shop_id`, `first_name`, `last_name`, `email_id`, `phone`, `profile_image`, `address`, `city`, `state`, `licence`, `licence_number`, `licence_exp_date`, `location_lat`, `location_lng`) VALUES INSERT INTO `mechanic` (`id`, `mechanic_id`, `shop_id`, `first_name`, `last_name`, `email_id`, `phone`, `address`, `city`, `state`, `licence`, `licence_number`, `licence_exp_date`, `location_lat`, `location_lng`) VALUES
(1, 2, 0, 'Tobin', 'Thomas', '[email protected]', '9995559194', '', 'Techware Software Solution', 'Ernakulam', 'Kerala', '', '6556596695', '85469415265', NULL, NULL); (1, 2, 0, 'Tobin', 'Thomas', '[email protected]', '9995559194', 'Techware Software Solution', 'Ernakulam', 'Kerala', 'assets/uploads/services/1544088274_1523012036_hj.jpg', '', '', NULL, NULL),
(5, 11, 0, 'kjo', 'kjo', '[email protected]', '34653456344456', 'Techware', 'Aiea', 'Hawaii', 'assets/uploads/services/1544091718_sniper.jpg', 'dfrgdersgt', '12/13/2018', NULL, NULL),
(6, 12, 0, 'Driver', 'john', '[email protected]', '9995551234', 'Techware', 'Aiea', 'Hawaii', 'assets/uploads/services/1544091568_1523012036_hj.jpg', 'LI00051545', '12/25/2018', NULL, NULL);
-- --------------------------------------------------------
--
-- Table structure for table `mechanic_issues`
--
CREATE TABLE `mechanic_issues` (
`id` int(11) NOT NULL,
`issue_id` int(11) DEFAULT NULL,
`mechanic_id` int(11) DEFAULT NULL,
`issue_description` longtext,
`service_fee` double NOT NULL DEFAULT '0',
`status` tinyint(3) NOT NULL DEFAULT '1'
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `mechanic_issues`
--
INSERT INTO `mechanic_issues` (`id`, `issue_id`, `mechanic_id`, `issue_description`, `service_fee`, `status`) VALUES
(1, 1, 12, 'sert', 435345, 0),
(2, 2, 2, 'fghdrftyhudsrxfytuh we e4rtwe4t we5tywer5 we5twer tew4rte etewt aw4raew w3rw3e w3r4wer fghdrftyhudsrxfytuh we e4rtwe4t we5tywer5 we5twer tew4rte etewt aw4raew w3rw3e w3r4wer fghdrftyhudsrxfytuh we e4rtwe4t we5tywer5 we5twer tew4rte etewt aw4raew w3rw3e w3r4wer fghdrftyhudsrxfytuh we e4rtwe4t we5tywer5 we5twer tew4rte etewt aw4raew w3rw3e w3r4wer fghdrftyhudsrxfytuh we e4rtwe4t we5tywer5 we5twer tew4rte etewt aw4raew w3rw3e w3r4wer ', 435345, 0),
(3, 1, 2, 'edrte ew4te ew5ter e354trs5 edrte ew4te ew5ter e354trs5 edrte ew4te ew5ter e354trs5 edrte ew4te ew5ter e354trs5 ', 435345, 0),
(4, 1, 2, 'edrte ew4te ew5ter e354trs5 edrte ew4te ew5ter e354trs5 edrte ew4te ew5ter e354trs5 edrte ew4te ew5ter e354trs5 ', 435345, 0);
-- -------------------------------------------------------- -- --------------------------------------------------------
...@@ -112,6 +165,14 @@ CREATE TABLE `mechanic_shop` ( ...@@ -112,6 +165,14 @@ CREATE TABLE `mechanic_shop` (
`status` tinyint(3) NOT NULL DEFAULT '1' `status` tinyint(3) NOT NULL DEFAULT '1'
) ENGINE=InnoDB DEFAULT CHARSET=latin1; ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `mechanic_shop`
--
INSERT INTO `mechanic_shop` (`shop_id`, `shop_name`, `address`, `phone`, `email_id`, `status`) VALUES
(1, 'Mechanic Shop', 'Kakkanad', '9995559194', '[email protected]', 1),
(2, 'New Shop 1', 'Techware', '9995559194', '[email protected]', 0);
-- -------------------------------------------------------- -- --------------------------------------------------------
-- --
...@@ -156,12 +217,24 @@ ALTER TABLE `customers` ...@@ -156,12 +217,24 @@ ALTER TABLE `customers`
ADD PRIMARY KEY (`customer_id`); ADD PRIMARY KEY (`customer_id`);
-- --
-- Indexes for table `issues`
--
ALTER TABLE `issues`
ADD PRIMARY KEY (`issue_id`);
--
-- Indexes for table `mechanic` -- Indexes for table `mechanic`
-- --
ALTER TABLE `mechanic` ALTER TABLE `mechanic`
ADD PRIMARY KEY (`id`); ADD PRIMARY KEY (`id`);
-- --
-- Indexes for table `mechanic_issues`
--
ALTER TABLE `mechanic_issues`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `mechanic_shop` -- Indexes for table `mechanic_shop`
-- --
ALTER TABLE `mechanic_shop` ALTER TABLE `mechanic_shop`
...@@ -181,7 +254,7 @@ ALTER TABLE `setting` ...@@ -181,7 +254,7 @@ ALTER TABLE `setting`
-- AUTO_INCREMENT for table `admin_users` -- AUTO_INCREMENT for table `admin_users`
-- --
ALTER TABLE `admin_users` ALTER TABLE `admin_users`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3; MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=13;
-- --
-- AUTO_INCREMENT for table `customers` -- AUTO_INCREMENT for table `customers`
...@@ -190,16 +263,28 @@ ALTER TABLE `customers` ...@@ -190,16 +263,28 @@ ALTER TABLE `customers`
MODIFY `customer_id` int(20) NOT NULL AUTO_INCREMENT; MODIFY `customer_id` int(20) NOT NULL AUTO_INCREMENT;
-- --
-- AUTO_INCREMENT for table `issues`
--
ALTER TABLE `issues`
MODIFY `issue_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=8;
--
-- AUTO_INCREMENT for table `mechanic` -- AUTO_INCREMENT for table `mechanic`
-- --
ALTER TABLE `mechanic` ALTER TABLE `mechanic`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2; MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=7;
--
-- AUTO_INCREMENT for table `mechanic_issues`
--
ALTER TABLE `mechanic_issues`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5;
-- --
-- AUTO_INCREMENT for table `mechanic_shop` -- AUTO_INCREMENT for table `mechanic_shop`
-- --
ALTER TABLE `mechanic_shop` ALTER TABLE `mechanic_shop`
MODIFY `shop_id` int(11) NOT NULL AUTO_INCREMENT; MODIFY `shop_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;
-- --
-- AUTO_INCREMENT for table `setting` -- AUTO_INCREMENT for table `setting`
......
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