Commit 0dd5561b by Tobin

daily commit 07-12-2018

parent df7229ee
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class Customer extends CI_Controller {
public function __construct() {
parent::__construct();
date_default_timezone_set("Asia/Kolkata");
$this->load->model('Customer_model');
if(!$this->session->userdata('logged_in')) {
redirect(base_url('Login'));
}
if($this->session->userdata['user_type'] != 1){
redirect(base_url());
}
}
public function addCustomerUser(){
$template['page'] = 'Customer/add-customer-user';
$template['pTitle'] = "Add New Patient";
$template['pDescription'] = "Create New Patient";
$template['menu'] = "Patient Management";
$template['smenu'] = "Add Patient";
$this->load->view('template',$template);
}
public function listCustomerUsers(){
$template['page'] = 'Customer/list-customer-users';
$template['pTitle'] = "View Customers";
$template['pDescription'] = "View and Manage Customers";
$template['menu'] = "Customer Management";
$template['smenu'] = "View Customers";
$template['customerData'] = $this->Customer_model->getCustomer();
$this->load->view('template',$template);
}
public function createCustomer(){
$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('Customer/addCustomerUser'));
}
if($err == 0 && (!isset($_POST['first_name']) || empty($_POST['first_name']))){
$err = 1;
$errMsg = 'Provide a First Name';
}
else if($err == 0 && (!isset($_POST['last_name']) || empty($_POST['last_name']))){
$err = 1;
$errMsg = 'Provide a Last Name';
}
else if($err == 0 && (!isset($_POST['phone']) || empty($_POST['phone']))){
$err = 1;
$errMsg = 'Provide a Phone Number';
}
else if($err == 0 && (!isset($_POST['email']) || empty($_POST['email']))){
$err = 1;
$errMsg = 'Provide an Email ID';
}
else if($err == 0 && (!isset($_POST['date_of_birth']) || empty($_POST['date_of_birth']))){
$err = 1;
$errMsg = 'Provide Date Of Birth';
}
else if($err == 0 && (!isset($_POST['address']) || empty($_POST['address']))){
$err = 1;
$errMsg = 'Provide an Address';
}
else if($err == 0 && (!isset($_FILES['profile_image']) || empty($_FILES['profile_image']))){
$err = 1;
$errMsg = 'Provide Profile Picture';
}
$_POST['age'] = '';
$_POST['profile_image'] = '';
if($err == 0){
$config = set_upload_service("assets/uploads/services");
$this->load->library('upload');
$config['file_name'] = time()."_".$_FILES['profile_image']['name'];
$this->upload->initialize($config);
if(!$this->upload->do_upload('profile_image')){
$err = 1;
$errMsg = $this->upload->display_errors();
}else{
$upload_data = $this->upload->data();
$_POST['profile_image'] = $config['upload_path']."/".$upload_data['file_name'];
}
$_POST['age'] = $this->calculateAge($_POST['date_of_birth']);
if($_POST['age'] < 0){
$err = 1;
$errMsg = 'Provide a valid date of birth';
}
}
if($err == 1){
$flashMsg['message'] = $errMsg;
$this->session->set_flashdata('message',$flashMsg);
redirect(base_url('Customer/addCustomerUser'));
}
$status = $this->Customer_model->createCustomer($_POST);
if($status == 1){
$flashMsg['class'] = 'success';
$flashMsg['message'] = 'User Created';
$this->session->set_flashdata('message',$flashMsg);
redirect(base_url('Customer/listCustomerUsers'));
}else if($status == 2){
$flashMsg['message'] = 'Email ID already in use.';
}else if($status == 3){
$flashMsg['message'] = 'Phone Number already in use.';
}
$this->session->set_flashdata('message',$flashMsg);
redirect(base_url('Customer/addCustomerUser'));
}
public function calculateAge($birthDate = ''){
if(empty($birthDate))
return;
$birthDate = explode("/", $birthDate);
$age = (date("md", date("U", mktime(0, 0, 0, $birthDate[0], $birthDate[1], $birthDate[2]))) > date("md")
? ((date("Y") - $birthDate[2]) - 1)
: (date("Y") - $birthDate[2]));
return $age;
}
public function getCustomerData(){
$return_arr = array('status'=>'0');
if(!isset($_POST) || empty($_POST) || !isset($_POST['customer_id']) || empty($_POST['customer_id'])){
echo json_encode($return_arr);exit;
}
$customer_id = decode_param($_POST['customer_id']);
$customer_data = $this->Customer_model->getCustomer(array('customer_id'=>$customer_id));
if(!empty($customer_data)){
$return_arr['status'] = 1;
$return_arr['customer_data'] = $customer_data;
}
echo json_encode($return_arr);exit;
}
function changeStatus($customer_id = '',$status = '1'){
$flashMsg = array('message'=>'Something went wrong, please try again..!','class'=>'error');
if(empty($customer_id)){
$this->session->set_flashdata('message',$flashMsg);
redirect(base_url('Customer/listCustomerUsers'));
}
$customer_id = decode_param($customer_id);
$status = $this->Customer_model->changeStatus($customer_id,$status);
if(!$status){
$this->session->set_flashdata('message',$flashMsg);
}
redirect(base_url('Customer/listCustomerUsers'));
}
function editCustomer($customer_id = ''){
$flashMsg = array('message'=>'Something went wrong, please try again..!','class'=>'error');
if(empty($customer_id)){
$this->session->set_flashdata('message',$flashMsg);
redirect(base_url('Customer/listCustomerUsers'));
}
$template['page'] = 'Customer/add-customer-user';
$template['menu'] = "Patient Management";
$template['smenu'] = "Edit Patient";
$template['pDescription'] = "Edit Patient Details";
$template['pTitle'] = "Edit Patient";
$template['customer_id'] = $customer_id;
$customer_id = decode_param($customer_id);
$template['customer_data'] = $this->Customer_model->getCustomer(array('customer_id'=>$customer_id));
$this->load->view('template',$template);
}
function updateCustomer($customer_id = ''){
$flashMsg = array('message'=>'Something went wrong, please try again..!','class'=>'error');
if(empty($customer_id)){
$this->session->set_flashdata('message',$flashMsg);
redirect(base_url('Customer/listCustomerUsers'));
}
$customerIdDec = decode_param($customer_id);
$err = 0;
$errMsg = '';
if(!isset($_POST) || empty($_POST)){
$this->session->set_flashdata('message',$flashMsg);
redirect(base_url('Customer/addCustomerUser'));
}
if($err == 0 && (!isset($_POST['first_name']) || empty($_POST['first_name']))){
$err = 1;
$errMsg = 'Provide a First Name';
}
else if($err == 0 && (!isset($_POST['last_name']) || empty($_POST['last_name']))){
$err = 1;
$errMsg = 'Provide a Last Name';
}
else if($err == 0 && (!isset($_POST['phone']) || empty($_POST['phone']))){
$err = 1;
$errMsg = 'Provide a Phone Number';
}
else if($err == 0 && (!isset($_POST['email']) || empty($_POST['email']))){
$err = 1;
$errMsg = 'Provide an Email ID';
}
else if($err == 0 && (!isset($_POST['date_of_birth']) || empty($_POST['date_of_birth']))){
$err = 1;
$errMsg = 'Provide Date Of Birth';
}
else if($err == 0 && (!isset($_POST['address']) || empty($_POST['address']))){
$err = 1;
$errMsg = 'Provide an Address';
}
if($err == 0){
$_POST['age'] = $this->calculateAge($_POST['date_of_birth']);
if($_POST['age'] < 0){
$err = 1;
$errMsg = 'Provide a valid date of birth';
}
}
if($err == 1){
$flashMsg['message'] = $errMsg;
$this->session->set_flashdata('message',$flashMsg);
redirect(base_url('Customer/editCustomer/'.$customer_id));
}
$config = set_upload_service("assets/uploads/services");
$this->load->library('upload');
$config['file_name'] = time()."_".$_FILES['profile_image']['name'];
$this->upload->initialize($config);
if($this->upload->do_upload('profile_image')){
$upload_data = $this->upload->data();
$_POST['profile_image'] = $config['upload_path']."/".$upload_data['file_name'];
}
$status = $this->Customer_model->updateCustomer($customerIdDec,$_POST);
if($status == 1){
$flashMsg['class'] = 'success';
$flashMsg['message'] = 'User Details Updated';
$this->session->set_flashdata('message',$flashMsg);
redirect(base_url('Customer/listCustomerUsers'));
}else if($status == 2){
$flashMsg['message'] = 'Email ID already in use.';
}else if($status == 3){
$flashMsg['message'] = 'Phone Number already in use.';
}
$this->session->set_flashdata('message',$flashMsg);
redirect(base_url('Customer/editCustomer/'.$customer_id));
}
}
?>
\ No newline at end of file
<?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 {
$this->load->helper('security');
if($this->session->userdata('logged_in')) {
redirect(base_url(HOME_PAGE));
redirect(base_url());
}
}
......@@ -39,10 +39,11 @@ class Login extends CI_Controller {
$this->session->set_userdata('logged_in','1');
$this->session->set_userdata('user_type',$result->user_type);
$this->session->set_userdata('mechanic_data',$result->mechanic_data);
$this->session->set_userdata('mechanic_shop_data',$result->mechanic_shop_data);
return TRUE;
}
else {
$this->form_validation->set_message('check_database', 'Invalid username or password');
$this->form_validation->set_message('checkUsrLogin', 'Invalid username or password');
return FALSE;
}
}
......
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class Mechanic extends CI_Controller {
public function __construct() {
parent::__construct();
date_default_timezone_set("Asia/Kolkata");
$this->load->model('Mechanic_model');
if(!$this->session->userdata('logged_in')) {
redirect(base_url());
}
}
public function addMechanic(){
$this->load->model('Shop_model');
$template['page'] = 'Mechanic/mechanicForm';
$template['menu'] = 'Mechanic Management';
$template['smenu'] = 'Add Mechanic';
$template['pTitle'] = "Add Mechanic";
$template['pDescription'] = "Create New Mechanic";
$template['shop_data'] = $this->Shop_model->getShop();
$this->load->view('template',$template);
}
public function viewMechanics(){
$this->load->model('Shop_model');
$template['page'] = 'Mechanic/viewMechanic';
$template['menu'] = 'Mechanic Management';
$template['smenu'] = 'View Mechanics';
$template['pTitle'] = "View Mechanics";
$template['pDescription'] = "View and Manage Mechanics";
$template['page_head'] = "Mechanic Management";
$template['user_data'] = $this->Mechanic_model->getMechanic('',1);
$this->load->view('template',$template);
}
public function getMechanicData(){
$resArr = array('status'=>0);
if(!isset($_POST)||empty($_POST)||!isset($_POST['mechanic_id'])||empty($_POST['mechanic_id']) ||
!is_numeric($mechanic_id = decode_param($_POST['mechanic_id']))){
echo json_encode($resArr);exit;
}
$mechData = $this->Mechanic_model->getMechanic($mechanic_id);
if(empty($mechData)){
echo json_encode($resArr);exit;
}
$resArr['status'] = 1;
$resArr['data'] = $mechData;
echo json_encode($resArr);exit;
}
function changeStatus($mechanic_id = '',$status = '1'){
$flashMsg = array('message'=>'Something went wrong, please try again..!','class'=>'error');
if(empty($mechanic_id) || !is_numeric($mechanic_id = decode_param($mechanic_id))){
$this->session->set_flashdata('message',$flashMsg);
redirect(base_url('Mechanic/viewMechanics'));
}
$status = $this->Mechanic_model->changeStatus($mechanic_id,$status);
if(!$status){
$this->session->set_flashdata('message',$flashMsg);
}
redirect(base_url('Mechanic/viewMechanics'));
}
public function createMechanic(){
$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('Mechanic/addMechanic'));
}
if($err == 0 && (!isset($_POST['first_name']) || empty($_POST['first_name']))){
$err = 1;
$errMsg = 'Provide a First Name';
}else if($err == 0 && (!isset($_POST['last_name']) || empty($_POST['last_name']))){
$err = 1;
$errMsg = 'Provide a Last Name';
}else if($err == 0 && (!isset($_POST['password']) || empty($_POST['password']))){
$err = 1;
$errMsg = 'Provide a Password';
}else if($err == 0 && (!isset($_POST['phone']) || empty($_POST['phone']))){
$err = 1;
$errMsg = 'Provide a Phone Number';
}else if($err == 0 && (!isset($_POST['email_id']) || empty($_POST['email_id']))){
$err = 1;
$errMsg = 'Provide an Email ID';
}else if($err == 0 && (!isset($_POST['display_name']) || empty($_POST['display_name']))){
$err = 1;
$errMsg = 'Provide a Display Name';
}else if($err == 0 && (!isset($_FILES['profile_image']) || empty($_FILES['profile_image']))){
$err = 1;
$errMsg = 'Provide a Profile Photo';
}else if($err == 0 && (!isset($_POST['city']) || empty($_POST['city']))){
$err = 1;
$errMsg = 'Provide a city';
}else if($err == 0 && (!isset($_POST['state']) || empty($_POST['state']))){
$err = 1;
$errMsg = 'Provide a state';
}else if($err == 0 && (!isset($_POST['address']) || empty($_POST['address']))){
$err = 1;
$errMsg = 'Provide an address';
}
if($err == 0){
$config = set_upload_service("assets/uploads/services");
$this->load->library('upload');
$config['file_name'] = time()."_".$_FILES['profile_image']['name'];
$this->upload->initialize($config);
if(!$this->upload->do_upload('profile_image')){
$err = 1;
$errMsg = $this->upload->display_errors();
}else{
$upload_data = $this->upload->data();
$_POST['profile_image'] = $config['upload_path']."/".$upload_data['file_name'];
}
$_POST['licence'] = '';
$config = set_upload_service("assets/uploads/services");
$this->load->library('upload');
$config['file_name'] = time()."_".$_FILES['licence']['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($err == 1){
$flashMsg['message'] = $errMsg;
$this->session->set_flashdata('message',$flashMsg);
redirect(base_url('Mechanic/addMechanic'));
}
$_POST['password'] = md5($_POST['password']);
$status = $this->Mechanic_model->addMechanic($_POST);
if($status == 1){
$flashMsg =array('message'=>'Successfully Updated User Details..!','class'=>'success');
$this->session->set_flashdata('message', $flashMsg);
redirect(base_url('Mechanic/viewMechanics'));
} else if($status == 2){
$flashMsg = array('message'=>'Email ID alrady exist..!','class'=>'error');
$this->session->set_flashdata('message', $flashMsg);
redirect(base_url('Mechanic/addMechanic'));
} else if($status == 3){
$flashMsg = array('message'=>'Phone Number alrady exist..!','class'=>'error');
$this->session->set_flashdata('message', $flashMsg);
redirect(base_url('Mechanic/addMechanic'));
} else if($status == 4){
$flashMsg = array('message'=>'User Name alrady exist..!','class'=>'error');
$this->session->set_flashdata('message', $flashMsg);
redirect(base_url('Mechanic/addMechanic'));
} else {
$this->session->set_flashdata('message', $flashMsg);
redirect(base_url('Mechanic/addMechanic'));
}
}
public function editMechanics($mechanic_id){
$flashMsg = array('message'=>'Something went wrong, please try again..!','class'=>'error');
if(empty($mechanic_id) || !is_numeric($mechanic_id = decode_param($mechanic_id))){
$this->session->set_flashdata('message',$flashMsg);
redirect(base_url('Mechanic/viewMechanics'));
}
$this->load->model('Shop_model');
$template['page'] = 'Mechanic/mechanicForm';
$template['menu'] = 'Mechanic Management';
$template['smenu'] = 'Edit Mechanic';
$template['pTitle'] = "Edit Mechanics";
$template['pDescription'] = "Update Mechanic Data";
$template['user_data'] = $this->Mechanic_model->getMechanic($mechanic_id,1);
$template['mechanic_id'] = encode_param($mechanic_id);
$this->load->view('template',$template);
}
public function updateMechanic($mechanic_id = ''){
$err = 0;
$errMsg = '';
$flashMsg = array('message'=>'Something went wrong, please try again..!','class'=>'error');
if(empty($mechanic_id)||!isset($_POST)||empty($_POST)||!is_numeric(decode_param($mechanic_id))){
$this->session->set_flashdata('message',$flashMsg);
redirect(base_url('Mechanic/viewMechanics'));
}
if($err == 0 && (!isset($_POST['first_name']) || empty($_POST['first_name']))){
$err = 1;
$errMsg = 'Provide a First Name';
}else if($err == 0 && (!isset($_POST['last_name']) || empty($_POST['last_name']))){
$err = 1;
$errMsg = 'Provide a Last Name';
}else if($err == 0 && (!isset($_POST['phone']) || empty($_POST['phone']))){
$err = 1;
$errMsg = 'Provide a Phone Number';
}else if($err == 0 && (!isset($_POST['email_id']) || empty($_POST['email_id']))){
$err = 1;
$errMsg = 'Provide an Email ID';
}else if($err == 0 && (!isset($_POST['display_name']) || empty($_POST['display_name']))){
$err = 1;
$errMsg = 'Provide a Display Name';
}else if($err == 0 && (!isset($_POST['city']) || empty($_POST['city']))){
$err = 1;
$errMsg = 'Provide a city';
}else if($err == 0 && (!isset($_POST['state']) || empty($_POST['state']))){
$err = 1;
$errMsg = 'Provide a state';
}else if($err == 0 && (!isset($_POST['address']) || empty($_POST['address']))){
$err = 1;
$errMsg = 'Provide your address';
}
if($err == 0){
$config = set_upload_service("assets/uploads/services");
$this->load->library('upload');
$config['file_name'] = time()."_".$_FILES['profile_image']['name'];
$this->upload->initialize($config);
if($this->upload->do_upload('profile_image')){
$upload_data = $this->upload->data();
$_POST['profile_image'] = $config['upload_path']."/".$upload_data['file_name'];
}
$config = set_upload_service("assets/uploads/services");
$this->load->library('upload');
$config['file_name'] = time()."_".$_FILES['licence']['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($err == 1){
$flashMsg['message'] = $errMsg;
$this->session->set_flashdata('message',$flashMsg);
redirect(base_url('Mechanic/addMechanic'));
}
$status = $this->Mechanic_model->updateMechanic(decode_param($mechanic_id),$_POST);
if($status == 1){
$flashMsg =array('message'=>'Successfully Updated User Details..!','class'=>'success');
$this->session->set_flashdata('message', $flashMsg);
redirect(base_url('Mechanic/viewMechanics'));
} else if($status == 2){
$flashMsg = array('message'=>'Email ID alrady exist..!','class'=>'error');
$this->session->set_flashdata('message', $flashMsg);
redirect(base_url('Mechanic/editMechanics/'.$mechanic_id));
} else if($status == 3){
$flashMsg = array('message'=>'Phone Number alrady exist..!','class'=>'error');
$this->session->set_flashdata('message', $flashMsg);
redirect(base_url('Mechanic/editMechanics/'.$mechanic_id));
} else if($status == 4){
$flashMsg = array('message'=>'User Name alrady exist..!','class'=>'error');
$this->session->set_flashdata('message', $flashMsg);
redirect(base_url('Mechanic/editMechanics/'.$mechanic_id));
} else {
$this->session->set_flashdata('message', $flashMsg);
redirect(base_url('Mechanic/editMechanics/'.$mechanic_id));
}
}
}
?>
\ No newline at end of file
<?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 {
}
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_desc'] = "Edit Profile";
$template['page_title'] = "Edit Profile";
$template['user_data'] = $this->User_model->getUserData();
$template['menu'] = "Profile";
$template['smenu'] = "Edit Profile";
$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);
}
......@@ -55,7 +65,8 @@ class User extends CI_Controller {
$this->session->set_flashdata('message',$flashMsg);
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");
$this->load->library('upload');
......@@ -68,7 +79,23 @@ class User extends CI_Controller {
$upload_data = $this->upload->data();
$_POST['profile_image'] = $config['upload_path']."/".$upload_data['file_name'];
}
}
if(isset($_FILES['licence']) && !empty($_FILES['licence'])){
$config = set_upload_service("assets/uploads/services");
$this->load->library('upload');
$new_name = time()."_".$_FILES['licence']['name'];
$config['file_name'] = $new_name;
$this->upload->initialize($config);
if($this->upload->do_upload('licence')){
$upload_data = $this->upload->data();
$_POST['licence'] = $config['upload_path']."/".$upload_data['file_name'];
}
}
if((isset($_POST['password']) || isset($_POST['cPassword'])) &&
(!empty($_POST['password']) || !empty($_POST['cPassword']))){
if($_POST['password'] != $_POST['cPassword']){
......@@ -84,53 +111,66 @@ class User extends CI_Controller {
unset($_POST['password']);
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');
$this->session->set_flashdata('message', $flashMsg);
redirect(base_url('User/editProfile'));
} else if (!isset($_POST['email_id']) || empty($_POST['email_id'])){
$flashMsg = array('message'=>'Provide a valid Email ID..!','class'=>'error');
} else if (!isset($_POST['username']) || empty($_POST['username'])){
$flashMsg = array('message'=>'Provide a valid Username..!','class'=>'error');
$this->session->set_flashdata('message', $flashMsg);
redirect(base_url('User/editProfile'));
}
if ($user_type == 2){
if (!isset($_POST['address']) || empty($_POST['address'])){
$flashMsg = array('message'=>'Provide a valid Address..!','class'=>'error');
if (!isset($_POST['first_name']) || empty($_POST['first_name'])){
$flashMsg = array('message'=>'Provide a First Name..!','class'=>'error');
$this->session->set_flashdata('message', $flashMsg);
redirect(base_url('User/editProfile'));
} else if (!isset($_POST['fax']) || empty($_POST['fax'])){
$flashMsg = array('message'=>'Provide a valid Fax Number..!','class'=>'error');
} else if (!isset($_POST['last_name']) || empty($_POST['last_name'])){
$flashMsg = array('message'=>'Provide a valid Last Name..!','class'=>'error');
$this->session->set_flashdata('message', $flashMsg);
redirect(base_url('User/editProfile'));
} else if (!isset($_POST['phone']) || empty($_POST['phone'])){
$flashMsg = array('message'=>'Provide a valid Phone Number..!','class'=>'error');
$this->session->set_flashdata('message', $flashMsg);
redirect(base_url('User/editProfile'));
} else if (!isset($_POST['company_contact']) || empty($_POST['company_contact'])){
$flashMsg = array('message'=>'Provide a valid Contact Number..!','class'=>'error');
$this->session->set_flashdata('message', $flashMsg);
redirect(base_url('User/editProfile'));
} else if (!isset($_POST['company_info']) || empty($_POST['company_info'])){
$flashMsg = array('message'=>'Provide a valid Contact Info..!','class'=>'error');
} else if (!isset($_POST['email_id']) || empty($_POST['email_id'])){
$flashMsg = array('message'=>'Provide a valid Email ID..!','class'=>'error');
$this->session->set_flashdata('message', $flashMsg);
redirect(base_url('User/editProfile'));
} else if (!isset($_POST['address']) || empty($_POST['address'])){
$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);
redirect(base_url('User/editProfile'));
}
}
$status = $this->User_model->updateUser($user_id,$user_type,$_POST);
if($status == 1){
if(isset($_POST['profile_image']) && !empty($_POST['profile_image'])){
$this->session->set_userdata('profile_pic',$_POST['profile_image']);
}
$flashMsg =array('message'=>'Successfully Upadated User Details..!','class'=>'success');
$this->session->set_flashdata('message', $flashMsg);
redirect(base_url('User/viewProfile'));
$flashMsg =array('message'=>'Successfully Updated User Details..!','class'=>'success');
$this->session->set_flashdata('message', $flashMsg);
redirect(base_url('User/viewProfile'));
} else if($status == 2){
$flashMsg = array('message'=>'Email ID alrady exist..!','class'=>'error');
$this->session->set_flashdata('message', $flashMsg);
redirect(base_url('User/editProfile'));
$flashMsg = array('message'=>'Email ID alrady exist..!','class'=>'error');
$this->session->set_flashdata('message', $flashMsg);
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 {
$this->session->set_flashdata('message', $flashMsg);
redirect(base_url('User/editProfile'));
$this->session->set_flashdata('message', $flashMsg);
redirect(base_url('User/editProfile'));
}
}
}
......
<?php
function set_upload_all_files($path){
function set_upload_service($path){
$config = array();
$config['upload_path'] = $path;
$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 {
array('username'=>$username,
'password'=>$password,
'status'=>'1'));
if(!empty($query)){
if($query->num_rows() > 0 && !empty($query)){
$result = $query->row();
$result->mechanic_data = '';
$result->mechanic_shop_data = '';
if($result->user_type == 2){
$query = $this->db->get_where('mechanic',array('mechanic_id'=>$result->id));
$result->mechanic_data = (!empty($query))?$query->row():'';
$this->load->model('Mechanic_model');
$result->mechanic_data = $this->Mechanic_model->getMechanic($result->id);
if(!empty($result->mechanic_data->shop_id)){
$this->load->model('Shop_model');
$shop_data = $this->Shop_model->getShop($result->mechanic_data->shop_id);
if(!empty($shop_data)){
$result->mechanic_shop_data = $shop_data;
}
}
}
} else {
$result = 0;
......
......@@ -6,37 +6,65 @@ class Mechanic_model extends CI_Model {
}
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;
}
$emailChk = $this->db->get_where('drivers',array('email_id'=>$mechanic_data['email_id'],'status !='=>'2'));
if(!empty($emailChk) && $emailChk->num_rows() > 0){
return 2;
}
$phoneChk = $this->db->get_where('drivers',array('phone'=>$mechanic_data['phone'],'status !='=>'2'));
if(!empty($phoneChk) && $phoneChk->num_rows() > 0){
return 3;
}
$status = $this->db->insert('drivers',$mechanic_data);
return ($status)?1:0;
$mechamic_id = $this->db->insert_id();
$status = $this->db->insert('mechanic',
array('mechanic_id'=>$mechamic_id,
'city'=>$mechanic_data['city'],
'phone'=>$mechanic_data['phone'],
'state'=>$mechanic_data['state'],
'shop_id'=>$mechanic_data['shop_id'],
'address'=>$mechanic_data['address'],
'licence'=>$mechanic_data['licence'],
'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 = ''){
$cond = '';
$user_id = $this->session->userdata('id');
if($this->session->userdata('user_type') != 1){
$cond = " AND CMP.company_id = '$user_id'";
}
$cond .= (!empty($mechanic_id))?" AND DRV.driver_id = '$mechanic_id'":"";
function getMechanic($mechanic_id = '', $view_all = 0){
$cond = (!empty($mechanic_id))?" MECH.mechanic_id = '".$mechanic_id."' ":"";
$cond .= (!empty($cond))?" AND ":$cond;
$cond .= (!empty($view_all))?" ADMN.status IN (0,1) ":" ADMN.status IN (1) ";
$sql = "SELECT ADMN.username,ADMN.user_type,ADMN.display_name,ADMN.profile_image,ADMN.status,
MSH.shop_name, MSH.address AS shop_address, MSH.phone AS shop_phone,
MSH.email_id AS shop_email, MECH.*
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);
if(empty($result)){
return;
......@@ -44,42 +72,55 @@ class Mechanic_model extends CI_Model {
return (empty($mechanic_id))?$result->result():$result->row();
}
function changeStatus($mechanic_id = '', $status = '0'){
if(empty($mechanic_id)){
function updateMechanic($mechanic_id = '', $mechanic_data = array()){
if(empty($mechanic_id) || empty($mechanic_data))
return 0;
}
$status = $this->db->update('drivers',array('status'=>$status), array('driver_id'=>$mechanic_id));
$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.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;
}
function updateMechanic($mechanic_id = '', $mechanic_data = array()){
if(empty($mechanic_id) || empty($mechanic_data)){
function changeStatus($mechanic_id = '', $status = '0'){
if(empty($mechanic_id)){
return 0;
}
$emailChk = $this->db->get_where('drivers',array('email_id'=>$mechanic_data['email_id'],'status !='=>'2','driver_id != '=>$mechanic_id));
if(!empty($emailChk) && $emailChk->num_rows() > 0){
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;
$status = $this->db->update('admin_users',array('status'=>$status),array('id'=>$mechanic_id));
return $status;
}
}
?>
\ No newline at end of file
......@@ -5,22 +5,14 @@ class Shop_model extends CI_Model {
parent::_construct();
}
// public function addShop($shop_data = array()){
// if(empty($shop_data)){
// return 0;
// }
// $emailChk = $this->db->get_where('mechanic_shop',
// array('broker_email'=>$shop_data['broker_email'],'status !='=>'2'));
// if(!empty($emailChk) && $emailChk->num_rows() > 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;
// }
public function addShop($shop_data = array()){
if(empty($shop_data)){
return 0;
}
$status = $this->db->insert('mechanic_shop',$shop_data);
return ($status)?1:0;
}
function getShop($shop_id = '',$view_all = 0){
$cond = ($view_all != 0)?' status IN (0,1) ':' status IN (1) ';
......@@ -33,29 +25,22 @@ class Shop_model extends CI_Model {
return (empty($shop_id))?$result->result():$result->row();
}
// function changeStatus($shop_id = '', $status = '0'){
// if(empty($shop_id)){
// return 0;
// }
// $status = $this->db->update('mechanic_shop',array('status'=>$status), array('broker_id'=>$shop_id));
// return $status;
// }
function changeStatus($shop_id = '', $status = '0'){
if(empty($shop_id)){
return 0;
}
$status = $this->db->update('mechanic_shop',array('status'=>$status), array('shop_id'=>$shop_id));
return $status;
}
// function updateShop($shop_id = '', $shop_data = array()){
// if(empty($shop_id) || empty($shop_data)){
// 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){
// return 2;
// }
// $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;
// }
function updateShop($shop_id = '', $shop_data = array()){
if(empty($shop_id) || empty($shop_data)){
return 0;
}
$status = $this->db->update('mechanic_shop',$shop_data,array('shop_id'=>$shop_id));
return ($status)?1:0;
}
}
?>
\ No newline at end of file
......@@ -6,33 +6,61 @@ class User_model extends CI_Model {
parent::_construct();
}
function getUserData(){
$user_id = $this->session->userdata('id');
$user_type = $this->session->userdata('user_type');
if($user_type == 1){
$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);
}
function getUserData($user_id = '', $user_type = ''){
$user_id = (empty($user_id))?$this->session->userdata('id'):$user_id;
$user_type = (empty($user_type))?$this->session->userdata('user_type'):$user_type;
$result = $this->db->get_where('admin_users',array('status'=>'1','id'=>$user_id));
if(empty($result)){
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()){
if(empty($user_id) || empty($user_type) || empty($user_data)){
return 0;
}
$emailChk = $this->db->get_where('admin_users',array('username'=>$user_data['email_id'],'id !='=>$user_id,'status !='=>'2'));
if(!empty($emailChk) && $emailChk->num_rows() > 0){
return 2;
$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.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'])){
$admUpArr['profile_image'] = $user_data['profile_image'];
}
......@@ -40,10 +68,28 @@ class User_model extends CI_Model {
$admUpArr['password'] = $user_data['password'];
}
$status = $this->db->update('admin_users',$admUpArr,array('id'=>$user_id));
if($status && $user_type == 2){
$company_federal_id = (isset($user_data['company_federal_id']) && !empty($user_data['company_federal_id']))?$user_data['company_federal_id']:'';
$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(!$status){
return 0;
}
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;
}
}
......
<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 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-body">
<table id="driverTable" class="table table-bordered table-striped datatable ">
<thead>
<tr>
<th class="hidden">ID</th>
<th width="150px;">Name</th>
<th width="100px;">Phone</th>
<th width="150px;">Email ID</th>
<th width="50px;">Age</th>
<th width="150px;">Date Of Birth</th>
<th width="50px;">Status</th>
<th width="500px;">Action</th>
</tr>
</thead>
<tbody>
<?php
if(!empty($customerData)){
foreach($customerData as $customer) {
?>
<tr>
<th class="hidden"><?= $customer->customer_id ?></th>
<td class="center"><?= $customer->first_name.' '.$customer->last_name ?></th>
<td class="center"><?= $customer->phone ?></th>
<td class="center"><?= $customer->email ?></th>
<td class="center"><?= $customer->age ?></th>
<td class="center"><?= $customer->date_of_birth ?></th>
<td class="center"><?= ($customer->status == '1')?'Active':'Inactive'?></td>
<td class="center">
<a class="btn btn-sm btn-primary" id="viewCustomer" customer_id="<?= encode_param($customer->customer_id) ?>">
<i class="fa fa-fw fa-edit"></i>View
</a>
<a class="btn btn-sm btn-danger"
href="<?= base_url('Customer/editCustomer/'.encode_param($customer->customer_id)) ?>">
<i class="fa fa-fw fa-trash"></i>Edit
</a>
<a class="btn btn-sm btn-danger"
href="<?= base_url("Customer/changeStatus/".encode_param($customer->customer_id))."/2" ?>"
onClick="return doconfirm()">
<i class="fa fa-fw fa-trash"></i>Delete
</a>
<?php if($customer->status == 1){ ?>
<a class="btn btn-sm btn-success" style="background-color:#ac2925" href="<?= base_url("Customer/changeStatus/".encode_param($customer->customer_id))."/0" ?>">
<i class="fa fa-cog"></i> De-activate
</a>
<?php } else { ?>
<a class="btn btn-sm btn-success" href="<?= base_url("Customer/changeStatus/".encode_param($customer->customer_id))."/1" ?>">
<i class="fa fa-cog"></i> Activate
</a>
<?php } ?>
</td>
</tr>
<?php
}
}?>
</tbody>
</table>
</div>
</div>
</section>
</div>
<script type="text/javascript">
jQuery('[id="viewCustomer"]').on('click',function() {
markCalBak(jQuery(this).attr('customer_id'));
});
function markCalBak(customer_id){
if(customer_id=='' || customer_id==undefined || customer_id=='undefined' || customer_id==null || customer_id=='null'){
return true;
}
modalTrigger('Patient Details','');
addModalLoader();
jQuery.ajax({
url : base_url+"Customer/getCustomerData",
type : 'POST',
data : {'customer_id':customer_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 customer_data = resp_data['customer_data'];
// Direct HTML
var html = '<div class="col-xs-12">'+
'<div class="col-md-2"> '+
'<div class="form-group has-feedback"> '+
'<img id="customerProfileImg" src="'+base_url+customer_data['profile_image']+'"'+
'height="100" width="100" /> '+
'</div> '+
'</div> '+
'<div class="col-md-5"> '+
'<div class="form-group has-feedback"> '+
'<span style="padding-right: 38px;">First Name </span> : '+
'<label style="padding-left: 10px;">'+
customer_data['first_name']+
'</label> '+
'</div> '+
'<div class="form-group has-feedback"> '+
'<span style="padding-right: 68px;">Email </span> : '+
'<label style="padding-left: 10px;">'+
customer_data['email']+
'</label> '+
'</div> '+
'<div class="form-group has-feedback"> '+
'<span style="padding-right: 55px;">Address </span> : '+
'<label style="padding-left: 10px;">'+
customer_data['address']+
'</label> '+
'</div> '+
'<div class="form-group has-feedback"> '+
'<span style="padding-right: 80px;">Age </span> : '+
'<label style="padding-left: 10px;">'+
customer_data['age']+
'</label> '+
'</div> '+
'<div class="form-group has-feedback"> '+
'<span style="padding-right: 79px;">SSN </span> : '+
'<label style="padding-left: 10px;">'+
customer_data['ssn']+
'</label> '+
'</div> '+
'<div class="form-group has-feedback"> '+
'<span style="padding-right: 68px;">Issuer </span> : '+
'<label style="padding-left: 10px;">'+
customer_data['issuer']+
'</label> '+
'</div> '+
'<div class="form-group has-feedback"> '+
'<span style="padding-right: 39px;">Member ID </span> : '+
'<label style="padding-left: 10px;">'+
customer_data['member_id']+
'</label> '+
'</div> '+
'</div> '+
'<div class="col-md-5"> '+
'<div class="form-group has-feedback"> '+
'<span style="padding-right: 56px;">Last Name </span> : '+
'<label style="padding-left: 10px;">'+
customer_data['last_name']+
'</label> '+
'</div> '+
'<div class="form-group has-feedback"> '+
'<span style="padding-right: 80px;">Phone </span> : '+
'<label style="padding-left: 10px;">'+
customer_data['phone']+
'</label> '+
'</div> '+
'<div class="form-group has-feedback"> '+
'<span style="padding-right: 43px;">Date Of Dirth </span> : '+
'<label style="padding-left: 10px;">'+
customer_data['date_of_birth']+
'</label> '+
'</div> '+
'<div class="form-group has-feedback"> '+
'<span style="padding-right: 25px;">Alternate Phone </span> : '+
'<label style="padding-left: 10px;">'+
customer_data['alt_phone']+
'</label> '+
'</div> '+
'<div class="form-group has-feedback"> '+
'<span style="padding-right: 96px;">GRP </span> : '+
'<label style="padding-left: 10px;">'+
customer_data['grp']+
'</label> '+
'</div> '+
'<div class="form-group has-feedback"> '+
'<span style="padding-right: 11px;">Insurance Provider </span> : '+
'<label style="padding-left: 10px;">'+
customer_data['insurance_provider']+
'</label> '+
'</div> '+
'<div class="form-group has-feedback"> '+
'<span style="padding-right: 34px;">Group Number </span> : '+
'<label style="padding-left: 10px;">'+
customer_data['group_number']+
'</label> '+
'</div> '+
'</div> '+
'</div>';
// Dymanic Drawing
// var html = '', bodyHtml = '', profPic = '';
// profPic = '<div class="col-md-2"> '+
// '<div class="form-group has-feedback"> '+
// '<img id="customerProfileImg" src="'+base_url+customer_data['profile_image']+'" '+
// 'height="100" width="100" /> '+
// '</div> '+
// '</div>';
// bodyHtml += '<div class="col-md-10">';
// jQuery.each(customer_data, function(key,value) {
// if(key == 'customer_id' || key == 'status'){
// return true;
// }
// key = key.replace(/_/g,' ').toUpperCase();
// value = (value==''||value==null||value=='null'||value==undefined||value=='undefined')?'--':value;
// value = value;
// bodyHtml += '<div class="col-md-3">'+key+'</div>'+
// '<div class="col-md-1"><span>:</span></div>'+
// '<div class="col-md-6">'+value+'</div>';
// });
// bodyHtml += '</div>';
// html = '<div class="col-xs-12">'+profPic+bodyHtml+'</div>';
remModalLoader();
jQuery('[id="modal_content"]').html(html);
jQuery('[id="customerProfileImg"]').error(function() {
jQuery('[id="customerProfileImg"]').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...!');
}
});
}
</script>
\ 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">
<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($mechanic_id) || empty($mechanic_id))?'Mechanic/createMechanic':'Mechanic/updateMechanic/'.$mechanic_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">
<!-- Basic Details -->
<div class="col-md-12">
<div class="box-header with-border padUnset">
<h3 class="box-title">Basic Details</h3>
</div><br>
</div>
<div class="col-md-6">
<div class="form-group">
<label>Display Name</label>
<input type="text" class="form-control required" data-parsley-trigger="change"
data-parsley-minlength="2" name="display_name" required=""
placeholder="Enter Display Name" value="<?= (isset($user_data->display_name))?$user_data->display_name:'' ?>">
<span class="glyphicon form-control-feedback"></span>
</div>
<div class="form-group">
<label>User Name</label>
<input type="text" class="form-control required" data-parsley-trigger="change"
data-parsley-minlength="2" name="username" required="" value="<?= (isset($user_data->username))?$user_data->username:'' ?>"
data-parsley-pattern="^[a-zA-Z0-9\ . _ @ \/]+$" placeholder="Enter User Name">
<span class="glyphicon form-control-feedback"></span>
</div>
<?php if(!isset($mechanic_id)){ ?>
<div class="form-group">
<label>Password</label>
<input type="password" class="form-control required" name="password" placeholder="Password" required="">
<span class="glyphicon form-control-feedback"></span>
</div>
<?php } ?>
</div>
<div class="col-md-6">
<div class="form-group">
<label>Profile Picture</label>
<div class="col-md-12" style="padding-bottom:10px;">
<div class="col-md-3">
<img id="image_id" src="<?= (isset($user_data->profile_image))?base_url($user_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/*" onchange="setImg(this,'image_id');" />
</div>
</div>
</div>
</div>
<!-- Mechanic Data -->
<div class="col-md-12">
<div class="box-header with-border padUnset">
<h3 class="box-title">Personal Details</h3>
</div><br>
</div>
<div class="col-md-6">
<div class="form-group">
<label>First 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="first_name" required="" value="<?= (isset($user_data->first_name))?$user_data->first_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($user_data->email_id))?$user_data->email_id:'' ?>">
<span class="glyphicon form-control-feedback"></span>
</div>
<div class="form-group">
<label>Address</label>
<input 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"
value="<?= (isset($user_data->address))?$user_data->address:'' ?>">
<span class="glyphicon form-control-feedback"></span>
</div>
<div class="form-group">
<label>City</label>
<input type="text" class="form-control required" data-parsley-trigger="change"
data-parsley-minlength="2" data-parsley-pattern="^[a-zA-Z0-9\ , - . _ ' \/]+$"
required="" name="city" placeholder="Enter City" value="<?= (isset($user_data->city))?$user_data->city:'' ?>">
<span class="glyphicon form-control-feedback"></span>
</div>
<div class="form-group">
<label>State</label>
<input type="text" class="form-control required" data-parsley-trigger="change"
data-parsley-minlength="2" data-parsley-pattern="^[a-zA-Z\ - ' \/]+$"
required="" name="state" placeholder="Enter email ID" value="<?= (isset($user_data->state))?$user_data->state:'' ?>">
<span class="glyphicon form-control-feedback"></span>
</div>
<?php if(!empty($shop_data)){ ?>
<div class="form-group">
<label>Workshop</label>
<select name="shop_id" class="form-control" placeholder="Select Workshop">
<option selected value="0">Choose a Workshop</option>
<?php
foreach ($shop_data as $shop) {
$select = (isset($user_data->shop_id) && $user_data->shop_id == $shop->shop_id)?'selected':'';
echo '<option '.$select.' value="'.$shop->shop_id.'">'.
$shop->shop_name.
'</option>';
}
?>
</select>
</div>
<?php } ?>
</div>
<div class="col-md-6">
<div class="form-group">
<label>Last Name</label>
<input type="text" class="form-control required" data-parsley-trigger="change"
data-parsley-minlength="2" name="last_name" required=""
data-parsley-pattern="^[a-zA-Z0-9\ . _ @ \/]+$" placeholder="Enter Last Name"
value="<?= (isset($user_data->last_name))?$user_data->last_name:'' ?>">
<span class="glyphicon form-control-feedback"></span>
</div>
<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($user_data->phone))?$user_data->phone:'' ?>" name="phone" placeholder="Enter Phone Number" >
<span class="glyphicon form-control-feedback"></span>
</div>
<div class="form-group">
<label>Licence Number</label>
<input type="text" class="form-control" data-parsley-trigger="change"
data-parsley-minlength="2" name="licence_number" data-parsley-pattern="^[a-zA-Z0-9\ , - . _ \/]+$" placeholder="Enter Licence Number" value="<?= (isset($user_data->licence_number))?$user_data->licence_number:'' ?>">
<span class="glyphicon form-control-feedback"></span>
</div>
<div class="form-group">
<label>Licence Exp Date</label>
<div class="input-group date" data-provide="datepicker">
<input id="date" type="text" class="form-control" data-parsley-trigger="change" data-parsley-minlength="2" name="licence_exp_date" placeholder="Pick Licence Expiry Date" autocomplete="off" value="<?= (isset($user_data->licence_exp_date))?$user_data->licence_exp_date:'' ?>">
<div class="input-group-addon">
<i class="fa fa-calendar"></i>
</div>
</div>
<span class="glyphicon form-control-feedback"></span>
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label>Licence Proof Image</label>
<div class="col-md-12" style="padding-bottom:10px;">
<div class="col-md-3">
<img id="licence_image" src="<?= (isset($user_data->licence))?base_url($user_data->licence):'' ?>" onerror="this.src='<?=base_url("assets/images/no_image.png")?>';" height="75" width="75" />
</div>
<div class="col-md-9" style="padding-top: 25px;">
<input name="licence" type="file" accept="image/*"
onchange="setImg(this,'licence_image');" />
</div>
</div>
</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('Mechanic/viewMechanics') ?>" 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">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 @@
<li class="treeview">
<a href="#">
<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>
</a>
<ul class="treeview-menu">
<li>
<a href="<?= base_url('Driver/add_driver') ?>">
<a href="<?= base_url('Shop/addShop') ?>">
<i class="fa fa-circle-o text-aqua"></i>
Add Driver
Add Mechanic Shop
</a>
</li>
<li>
<a href="<?= base_url('Driver/driver_list') ?>">
<a href="<?= base_url('Shop/viewShops') ?>">
<i class="fa fa-circle-o text-aqua"></i>
View Driver
</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
View Mechanic Shops
</a>
</li>
</ul>
......@@ -66,133 +43,81 @@
<li class="treeview">
<a href="#">
<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>
</a>
<ul class="treeview-menu">
<?php if($this->session->userdata['user_type'] != 1){ ?>
<li>
<a href="<?= base_url('Company/add_company') ?>">
<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') ?>">
<a href="<?= base_url('Issue/issueMapping') ?>">
<i class="fa fa-circle-o text-aqua"></i>
Create Offer
Issue Mapping
</a>
</li>
<?php } ?>
<li>
<a href="<?= base_url('Company/manager_offers') ?>">
<a href="<?= base_url('Issue/viewMappedIssues') ?>">
<i class="fa fa-circle-o text-aqua"></i>
Manage Offers
Manage Mapped Issues
</a>
</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>
Veiw Activation Packs
Manage Common Issues
</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>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 } ?>
<li class="treeview">
<a href="#">
<i class="fa fa-bars" aria-hidden="true"></i>
<span>Broker 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>
<span>Customer Management</span>
<i class="fa fa-angle-left pull-right"></i>
</a>
<ul class="treeview-menu">
<li>
<a href="<?= base_url('Vehicle/add_vehicle') ?>">
<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') ?>">
<a href="<?= base_url('Customer/addCustomerUser') ?>">
<i class="fa fa-circle-o text-aqua"></i>
View Rides
Add Customer
</a>
</li>
<li>
<a href="<?= base_url('Ride/import_ride') ?>">
<a href="<?= base_url('Customer/listCustomerUsers') ?>">
<i class="fa fa-circle-o text-aqua"></i>
Import Rides
View Customers
</a>
</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>
</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){ ?>
<li><a href="<?= base_url('Settings') ?>">
<i class="fa fa-wrench" aria-hidden="true">
</i><span>Settings</span></a>
</li>
<li><a href="<?= base_url('Settings') ?>">
<i class="fa fa-wrench" aria-hidden="true">
</i><span>Settings</span></a>
</li>
<?php } ?>
</ul>
</section>
......
<div class="content-wrapper">
<section class="content-header">
<h1>
<?= $page_title ?>
<small><?= $page_desc ?></small>
</h1>
<ol class="breadcrumb">
<li><a href="<?= base_url() ?>"><i class="fa fa-star-o" aria-hidden="true"></i>Home</a></li>
<li>Driver</li>
<li class="active">Edit Driver</li>
</ol>
</section>
<section class="content">
<div class="row">
<div class="col-md-12">
<?php
if($this->session->flashdata('message')) {
$flashdata = $this->session->flashdata('message'); ?>
<div class="alert alert-<?= $flashdata['class'] ?>">
<button class="close" data-dismiss="alert" type="button">×</button>
<?= $flashdata['message'] ?>
</div>
<?php } ?>
</div>
<div class="col-md-12">
<div class="box box-warning">
<div class="box-header with-border">
<div class="col-md-6">
<h3 class="box-title">Admin Details</h3>
</div>
<div class="col-md-6" align="right">
<a class="btn btn-sm btn-primary" href="<?= base_url('User/viewProfile') ?>">Back</a>
</div>
</div>
<div class="box-body">
<form role="form" action="<?=base_url('User/updateUser')?>" method="post" class="validate" data-parsley-validate="" enctype="multipart/form-data">
<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">
<div class="col-md-6">
<div class="form-group has-feedback">
<label for="exampleInputEmail1">Display 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="company_name" value="<?= $user_data->display_name ?>" placeholder="Enter Company Name">
<span class="glyphicon form-control-feedback"></span>
</div>
<div class="form-group has-feedback">
<label for="exampleInputEmail1">Email</label>
<input type="text" class="form-control required" data-parsley-trigger="change"
data-parsley-minlength="2" required="" name="email_id" placeholder="Enter User Name" value="<?= $user_data->username ?>">
<span class="glyphicon form-control-feedback"></span>
</div>
<?php if($this->session->userdata('user_type') == 2){ ?>
<div class="form-group has-feedback">
<label for="exampleInputEmail1">Address</label>
<textarea class="ip_reg_form_input form-control reset-form-custom required" placeholder="Enter Company Address" name="address" data-parsley-trigger="change" data-parsley-minlength="2" required=""><?= $user_data->company_name ?></textarea>
<span class="glyphicon form-control-feedback"></span>
</div>
<div class="form-group has-feedback">
<label for="exampleInputEmail1">Company Federal ID</label>
<input type="text" class="form-control" data-parsley-trigger="change"
data-parsley-minlength="2" name="company_federal_id" placeholder="Enter Company Federal ID" value="<?= $user_data->company_federal_id ?>">
<span class="glyphicon form-control-feedback"></span>
</div>
<div class="form-group has-feedback">
<label for="exampleInputEmail1">Fax</label>
<input type="number" class="form-control required" data-parsley-trigger="change"
data-parsley-minlength="2" required="" name="fax" placeholder="Enter Fax Number" value="<?= $user_data->fax ?>">
<span class="glyphicon form-control-feedback"></span>
</div>
<?php } ?>
</div>
<div class="col-md-6">
<div class="form-group">
<label for="exampleInputEmail1">Profile Picture</label>
<div class="col-md-12" style="padding-bottom:10px;">
<div class="col-md-3">
<img id="image_id" src="<?= base_url($user_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/*" onchange="setImg(this,'image_id');" />
</div>
</div>
</div>
<?php if($this->session->userdata('user_type') == 2){ ?>
<div class="form-group">
<label for="exampleInputEmail1">Phone</label>
<input type="number" class="form-control required" data-parsley-trigger="change"
data-parsley-minlength="2" required="" name="phone" placeholder="Enter Phone Number" value="<?= $user_data->phone ?>">
<span class="glyphicon form-control-feedback"></span>
</div>
<div class="form-group has-feedback">
<label for="exampleInputEmail1">Company Contact</label>
<input type="number" class="form-control required" data-parsley-trigger="change"
data-parsley-minlength="2" required="" name="company_contact" placeholder="Enter Company Contact Number" value="<?= $user_data->company_contact ?>">
<span class="glyphicon form-control-feedback"></span>
<?php
if($this->session->flashdata('message')) {
$flashdata = $this->session->flashdata('message'); ?>
<div class="alert alert-<?= $flashdata['class'] ?>">
<button class="close" data-dismiss="alert" type="button">×</button>
<?= $flashdata['message'] ?>
</div>
<div class="form-group has-feedback">
<label for="exampleInputEmail1">Contact Person Information</label>
<input type="text" class="form-control required" data-parsley-trigger="change"
data-parsley-minlength="2" required="" name="company_info" placeholder="Enter Contact Person Info" value="<?= $user_data->company_info ?>">
<span class="glyphicon form-control-feedback"></span>
</div>
<?php } ?>
</div>
<?php } ?>
</div>
<!-- Change Password -->
<div class="col-md-12" style="padding-top:10px;">
<div class="box-header with-border">
<h3 class="box-title">Change Password</h3>
</div><br>
<div class="col-md-6">
<div class="form-group has-feedback">
<label for="exampleInputEmail1">New Password</label>
<input type="password" class="form-control" name="password" placeholder="New Password" >
<span class="glyphicon form-control-feedback"></span>
</div>
</div>
<div class="col-md-6">
<div class="form-group has-feedback">
<label for="exampleInputEmail1">Confirm Password</label>
<input type="password" class="form-control" name="cPassword" placeholder="Confirm Password" >
<span class="glyphicon form-control-feedback"></span>
<div class="col-md-12">
<div class="box box-warning">
<div class="box-body">
<form role="form" action="<?=base_url('User/updateUser')?>" method="post" class="validate" data-parsley-validate="" enctype="multipart/form-data">
<!-- Basic Details -->
<div class="col-md-12">
<div class="box-header with-border padUnset">
<h3 class="box-title">Basic Details</h3>
</div><br>
</div>
<div class="col-md-6">
<div class="form-group">
<label>Display Name</label>
<input type="text" class="form-control required" data-parsley-trigger="change"
data-parsley-minlength="2" name="display_name" required=""
value="<?= $user_data->display_name ?>" placeholder="Enter Display Name">
<span class="glyphicon form-control-feedback"></span>
</div>
<div class="form-group">
<label>User Name</label>
<input type="text" class="form-control required" data-parsley-trigger="change"
data-parsley-minlength="2" name="username" required=""
data-parsley-pattern="^[a-zA-Z0-9\ . _ @ \/]+$"
value="<?= $user_data->username ?>" placeholder="Enter User Name">
<span class="glyphicon form-control-feedback"></span>
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label>Profile Picture</label>
<div class="col-md-12" style="padding-bottom:10px;">
<div class="col-md-3">
<img id="image_id" src="<?= base_url($user_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/*" onchange="setImg(this,'image_id');" />
</div>
</div>
</div>
</div>
<?php
if(isset($user_data->mechanic_data) && !empty($user_data->mechanic_data)){
$mechanic_data = $user_data->mechanic_data;
?>
<!-- Mechanic Data -->
<div class="col-md-12">
<div class="box-header with-border padUnset">
<h3 class="box-title">Personal Details</h3>
</div><br>
</div>
<div class="col-md-6">
<div class="form-group">
<label>First 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="first_name" required="" value="<?= $mechanic_data->first_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="<?= $mechanic_data->email_id ?>" >
<span class="glyphicon form-control-feedback"></span>
</div>
<div class="form-group">
<label>Address</label>
<input 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"
value="<?= $mechanic_data->address ?>" >
<span class="glyphicon form-control-feedback"></span>
</div>
<div class="form-group">
<label>City</label>
<input type="text" class="form-control required" data-parsley-trigger="change"
data-parsley-minlength="2" data-parsley-pattern="^[a-zA-Z0-9\ , - . _ ' \/]+$"
required="" name="city" placeholder="Enter City" value="<?= $mechanic_data->city ?>" >
<span class="glyphicon form-control-feedback"></span>
</div>
<div class="form-group">
<label>State</label>
<input type="text" class="form-control required" data-parsley-trigger="change"
data-parsley-minlength="2" data-parsley-pattern="^[a-zA-Z\ - ' \/]+$"
required="" name="state" placeholder="Enter email ID"
value="<?= $mechanic_data->state ?>" >
<span class="glyphicon form-control-feedback"></span>
</div>
<?php if(!empty($shop_data)){ ?>
<div class="form-group">
<label>Workshop</label>
<select name="store" class="form-control" placeholder="Select Workshop">
<option selected value="0">Choose a Workshop</option>
<?php
foreach ($shop_data as $shop) {
$select = ($mechanic_data->shop_id == $shop->shop_id)?'selected':'';
echo '<option '.$select.' value="'.$shop->shop_id.'">'.
$shop->shop_name.
'</option>';
}
?>
</select>
</div>
<?php } ?>
</div>
<div class="col-md-6">
<div class="form-group">
<label>Last Name</label>
<input type="text" class="form-control required" data-parsley-trigger="change"
data-parsley-minlength="2" name="last_name" required=""
data-parsley-pattern="^[a-zA-Z0-9\ . _ @ \/]+$"
value="<?= $mechanic_data->last_name ?>" placeholder="Enter Last Name">
<span class="glyphicon form-control-feedback"></span>
</div>
<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="" name="phone" placeholder="Enter Phone Number" value="<?= $mechanic_data->phone ?>" >
<span class="glyphicon form-control-feedback"></span>
</div>
<div class="form-group">
<label>Licence Number</label>
<input type="text" class="form-control" data-parsley-trigger="change"
data-parsley-minlength="2" name="licence_number" data-parsley-pattern="^[a-zA-Z0-9\ # - . _ \/]+$" placeholder="Enter Licence Number"
value="<?= $mechanic_data->licence_number ?>" >
<span class="glyphicon form-control-feedback"></span>
</div>
<div class="form-group">
<label>Licence Exp Date</label>
<div class="input-group date" data-provide="datepicker">
<input id="date" type="text" class="form-control" data-parsley-trigger="change" data-parsley-minlength="2" name="licence_exp_date" placeholder="Pick Licence Expiry Date" autocomplete="off" value="<?= $mechanic_data->licence_exp_date ?>">
<div class="input-group-addon">
<i class="fa fa-calendar"></i>
</div>
</div>
<span class="glyphicon form-control-feedback"></span>
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label>Licence Proof Image</label>
<div class="col-md-12" style="padding-bottom:10px;">
<div class="col-md-3">
<img id="licence_image" src="<?= base_url($mechanic_data->licence) ?>" onerror="this.src='<?=base_url("assets/images/no_image.png")?>';" height="75" width="75" />
</div>
<div class="col-md-9" style="padding-top: 25px;">
<input name="licence" type="file" accept="image/*"
onchange="setImg(this,'licence_image');" />
</div>
</div>
</div>
</div>
<?php } ?>
<!-- Change Password -->
<div class="col-md-12">
<div class="box-header with-border padUnset">
<h3 class="box-title">Change Password</h3>
</div><br>
</div>
<div class="col-md-6">
<div class="form-group">
<label>New Password</label>
<input type="password" class="form-control" name="password" placeholder="New Password">
<span class="glyphicon form-control-feedback"></span>
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label>Confirm Password</label>
<input type="password" class="form-control" name="cPassword" placeholder="Confirm Password">
<span class="glyphicon form-control-feedback"></span>
</div>
</div>
<div class="col-md-12">
<div class="box-footer" style="padding-left:46%;">
<button type="submit" class="btn btn-primary">Submit</button>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
<div class="col-md-12">
<div class="box-footer" style="padding-left:46%;">
<button type="submit" class="btn btn-primary">Submit</button>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
</section>
</div>
</section>
</div>
\ No newline at end of file
......@@ -49,7 +49,7 @@
<div class="col-md-5"><span>Display Name </span></div>
<div class="col-md-7">
<span>:</span>
<label style="padding-left:20px;">
<label class="padLeft20">
<?= $user_data->display_name ?>
</label>
</div>
......@@ -58,21 +58,22 @@
<div class="col-md-5"><span>User Name </span></div>
<div class="col-md-7">
<span>:</span>
<label style="padding-left:20px;">
<label class="padLeft20">
<?= $user_data->username ?>
</label>
</div>
</div>
<?php
if($this->session->userdata('user_type') == 2 && isset($this->session->userdata['mechanic_data'])
&& !empty($this->session->userdata['mechanic_data'])){
$mechanic_data = $this->session->userdata['mechanic_data']; ?>
if($this->session->userdata('user_type') == 2 &&
isset($this->session->userdata['mechanic_data']) &&
!empty($this->session->userdata['mechanic_data'])){
$mechanic_data = $this->session->userdata['user']->mechanic_data; ?>
<div class="row" style="padding-top:20px;">
<div class="row padTop20">
<div class="col-md-5"><span>First Name </span></div>
<div class="col-md-7">
<span>:</span>
<label style="padding-left:20px;">
<label class="padLeft20">
<?= $mechanic_data->first_name ?>
</label>
</div>
......@@ -82,7 +83,7 @@
<div class="col-md-5"><span>Last Name </span></div>
<div class="col-md-7">
<span>:</span>
<label style="padding-left:20px;">
<label class="padLeft20">
<?= $mechanic_data->last_name ?>
</label>
</div>
......@@ -92,7 +93,7 @@
<div class="col-md-5"><span>Phone Number </span></div>
<div class="col-md-7">
<span>:</span>
<label style="padding-left:20px;">
<label class="padLeft20">
<?= $mechanic_data->phone ?>
</label>
</div>
......@@ -102,7 +103,7 @@
<div class="col-md-5"><span>Email ID </span></div>
<div class="col-md-7">
<span>:</span>
<label style="padding-left:20px;">
<label class="padLeft20">
<?= $mechanic_data->email_id ?>
</label>
</div>
......@@ -112,7 +113,7 @@
<div class="col-md-5"><span>Address </span></div>
<div class="col-md-7">
<span>:</span>
<label style="padding-left:20px;">
<label class="padLeft20">
<?= $mechanic_data->address ?>
</label>
</div>
......@@ -122,7 +123,7 @@
<div class="col-md-5"><span>City </span></div>
<div class="col-md-7">
<span>:</span>
<label style="padding-left:20px;">
<label class="padLeft20">
<?= $mechanic_data->city ?>
</label>
</div>
......@@ -132,11 +133,57 @@
<div class="col-md-5"><span>State </span></div>
<div class="col-md-7">
<span>:</span>
<label style="padding-left:20px;">
<label class="padLeft20">
<?= $mechanic_data->state ?>
</label>
</div>
</div>
<?php
if(isset($this->session->userdata['mechanic_shop_data']) &&
!empty($this->session->userdata['mechanic_shop_data'])){
$shop_data = $this->session->userdata['mechanic_shop_data'];
?>
<div class="row padTop20">
<div class="col-md-5"><span>Shop Name </span></div>
<div class="col-md-7">
<span>:</span>
<label class="padLeft20">
<?= $shop_data->shop_name ?>
</label>
</div>
</div>
<div class="row">
<div class="col-md-5"><span>Shop Address </span></div>
<div class="col-md-7">
<span>:</span>
<label class="padLeft20">
<?= $shop_data->address ?>
</label>
</div>
</div>
<div class="row">
<div class="col-md-5"><span>Shop Phone </span></div>
<div class="col-md-7">
<span>:</span>
<label class="padLeft20">
<?= $shop_data->phone ?>
</label>
</div>
</div>
<div class="row">
<div class="col-md-5"><span>Shop Email </span></div>
<div class="col-md-7">
<span>:</span>
<label class="padLeft20">
<?= $shop_data->email_id ?>
</label>
</div>
</div>
<?php } ?>
</div>
<div class="col-md-5">
......@@ -144,7 +191,7 @@
<div class="col-md-5"><span>Licence Number </span></div>
<div class="col-md-7">
<span>:</span>
<label style="padding-left:20px;">
<label class="padLeft20">
<?= $mechanic_data->licence_number ?>
</label>
</div>
......@@ -154,7 +201,7 @@
<div class="col-md-5"><span>Licence Exp. Date </span></div>
<div class="col-md-7">
<span>:</span>
<label style="padding-left:20px;">
<label class="padLeft20">
<?= $mechanic_data->licence_exp_date ?>
</label>
</div>
......@@ -168,13 +215,11 @@
<img src="<?= base_url($mechanic_data->licence) ?>"
onclick="viewImageModal('Licence Image','<?= base_url($mechanic_data->licence) ?>');"
onerror="this.src='<?=base_url("assets/images/no_image.png")?>';"
class="img-circle cpoint" alt="Licence Image" height="200px" width="auto"
style="float:right;">
class="cpoint" alt="Licence Image" height="200px" width="auto"
style="padding-left: 20%;">
</div>
</div>
</div>
<?php } else { ?>
</div>
<?php } ?>
......
......@@ -306,4 +306,32 @@
.disable-block {
pointer-events: none;
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){
'</div>';
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 @@
-- https://www.phpmyadmin.net/
--
-- 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
-- PHP Version: 7.2.8
......@@ -43,8 +43,10 @@ CREATE TABLE `admin_users` (
--
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),
(2, 'mechanic', '202cb962ac59075b964b07152d234b70', 2, 'Mechanic', '', 1);
(1, 'admin', '202cb962ac59075b964b07152d234b70', 1, 'Super Admin User', 'assets/uploads/services/1543990056_1523012120_default.png', 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` (
-- --------------------------------------------------------
--
-- 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`
--
......@@ -79,7 +106,6 @@ CREATE TABLE `mechanic` (
`last_name` varchar(50) NOT NULL,
`email_id` varchar(250) NOT NULL,
`phone` varchar(15) NOT NULL,
`profile_image` varchar(500) NOT NULL,
`address` varchar(250) DEFAULT NULL,
`city` varchar(200) DEFAULT NULL,
`state` varchar(200) DEFAULT NULL,
......@@ -94,8 +120,35 @@ CREATE 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
(1, 2, 0, 'Tobin', 'Thomas', '[email protected]', '9995559194', '', 'Techware Software Solution', 'Ernakulam', 'Kerala', '', '6556596695', '85469415265', NULL, NULL);
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', '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` (
`status` tinyint(3) NOT NULL DEFAULT '1'
) 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`
ADD PRIMARY KEY (`customer_id`);
--
-- Indexes for table `issues`
--
ALTER TABLE `issues`
ADD PRIMARY KEY (`issue_id`);
--
-- Indexes for table `mechanic`
--
ALTER TABLE `mechanic`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `mechanic_issues`
--
ALTER TABLE `mechanic_issues`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `mechanic_shop`
--
ALTER TABLE `mechanic_shop`
......@@ -181,7 +254,7 @@ ALTER TABLE `setting`
-- AUTO_INCREMENT for 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`
......@@ -190,16 +263,28 @@ ALTER TABLE `customers`
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`
--
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`
--
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`
......
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