Commit a831ad8a by Tobin

daily commit 10-12-2018

parent 0dd5561b
...@@ -20,11 +20,11 @@ class Customer extends CI_Controller { ...@@ -20,11 +20,11 @@ class Customer extends CI_Controller {
public function addCustomerUser(){ public function addCustomerUser(){
$template['page'] = 'Customer/add-customer-user'; $template['page'] = 'Customer/add-customer-user';
$template['pTitle'] = "Add New Patient"; $template['pTitle'] = "Add New Customer";
$template['pDescription'] = "Create New Patient"; $template['pDescription'] = "Create New Customer";
$template['menu'] = "Patient Management"; $template['menu'] = "Customer Management";
$template['smenu'] = "Add Patient"; $template['smenu'] = "Add Customer";
$this->load->view('template',$template); $this->load->view('template',$template);
} }
...@@ -78,7 +78,6 @@ class Customer extends CI_Controller { ...@@ -78,7 +78,6 @@ class Customer extends CI_Controller {
$err = 1; $err = 1;
$errMsg = 'Provide Profile Picture'; $errMsg = 'Provide Profile Picture';
} }
$_POST['age'] = '';
$_POST['profile_image'] = ''; $_POST['profile_image'] = '';
if($err == 0){ if($err == 0){
$config = set_upload_service("assets/uploads/services"); $config = set_upload_service("assets/uploads/services");
...@@ -93,11 +92,11 @@ class Customer extends CI_Controller { ...@@ -93,11 +92,11 @@ class Customer extends CI_Controller {
$_POST['profile_image'] = $config['upload_path']."/".$upload_data['file_name']; $_POST['profile_image'] = $config['upload_path']."/".$upload_data['file_name'];
} }
$_POST['age'] = $this->calculateAge($_POST['date_of_birth']); // $_POST['age'] = $this->calculateAge($_POST['date_of_birth']);
if($_POST['age'] < 0){ // if($_POST['age'] < 0){
$err = 1; // $err = 1;
$errMsg = 'Provide a valid date of birth'; // $errMsg = 'Provide a valid date of birth';
} // }
} }
if($err == 1){ if($err == 1){
$flashMsg['message'] = $errMsg; $flashMsg['message'] = $errMsg;
...@@ -168,11 +167,11 @@ class Customer extends CI_Controller { ...@@ -168,11 +167,11 @@ class Customer extends CI_Controller {
$template['page'] = 'Customer/add-customer-user'; $template['page'] = 'Customer/add-customer-user';
$template['menu'] = "Patient Management"; $template['menu'] = "Customer Management";
$template['smenu'] = "Edit Patient"; $template['smenu'] = "Edit Customer";
$template['pDescription'] = "Edit Patient Details"; $template['pDescription'] = "Edit Customer Details";
$template['pTitle'] = "Edit Patient"; $template['pTitle'] = "Edit Customer";
$template['customer_id'] = $customer_id; $template['customer_id'] = $customer_id;
$customer_id = decode_param($customer_id); $customer_id = decode_param($customer_id);
...@@ -220,14 +219,6 @@ class Customer extends CI_Controller { ...@@ -220,14 +219,6 @@ class Customer extends CI_Controller {
$errMsg = 'Provide an Address'; $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){ if($err == 1){
$flashMsg['message'] = $errMsg; $flashMsg['message'] = $errMsg;
$this->session->set_flashdata('message',$flashMsg); $this->session->set_flashdata('message',$flashMsg);
......
...@@ -78,7 +78,7 @@ class Issue extends CI_Controller { ...@@ -78,7 +78,7 @@ class Issue extends CI_Controller {
} }
} }
public function editIssue($issue_id){ public function editIssue($issue_id = ''){
$flashMsg = array('message'=>'Something went wrong, please try again..!','class'=>'error'); $flashMsg = array('message'=>'Something went wrong, please try again..!','class'=>'error');
if(empty($issue_id) || !is_numeric($issue_id = decode_param($issue_id))){ if(empty($issue_id) || !is_numeric($issue_id = decode_param($issue_id))){
$this->session->set_flashdata('message',$flashMsg); $this->session->set_flashdata('message',$flashMsg);
...@@ -231,5 +231,75 @@ class Issue extends CI_Controller { ...@@ -231,5 +231,75 @@ class Issue extends CI_Controller {
} }
redirect(base_url('Issue/viewMappedIssues/'.encode_param($mechanic_id))); redirect(base_url('Issue/viewMappedIssues/'.encode_param($mechanic_id)));
} }
public function editMechanicIssues($mechanic_id = '',$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)) ||
empty($mechanic_id) || !is_numeric($mechanic_id = decode_param($mechanic_id))){
$this->session->set_flashdata('message',$flashMsg);
redirect(base_url('Issue/viewMappedIssues'));
}
$template['page'] = 'Issue/issueMapping';
$template['menu'] = 'Issue Management';
$template['smenu'] = 'Edit Mechanic Issue';
$template['pTitle'] = "Edit Mechanic Issue Management";
$template['pDescription'] = "Update Custom Mechanic Issue Data";
$template['issue_id'] = $issue_id;
$template['mechanic_id'] = $mechanic_id;
$template['issue_data'] = $this->Issue_model->getIssue('',1);
$template['mechanicIssueData'] = $this->Issue_model->getMechanicIssues($mechanic_id,$issue_id);
if(empty($template['mechanicIssueData'])){
$this->session->set_flashdata('message',$flashMsg);
redirect(base_url('Issue/viewMappedIssues/'.encode_param($mechanic_id)));
}
$this->load->view('template',$template);
}
public function updateMechIssue($mechanic_id = '',$issue_id = ''){
$err = 0;
$errMsg = '';
$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)));
}
$url = base_url('Issue/editMechanicIssues/'.encode_param($mechanic_id).'/'.encode_param($issue_id));
if(!isset($_POST) || empty($_POST)){
$this->session->set_flashdata('message',$flashMsg);
redirect($url);
}
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($url);
}
$status = $this->Issue_model->updateMechIssue($mechanic_id,$issue_id,$_POST);
if($status == 1){
$flashMsg =array('message'=>'Successfully Updated..!','class'=>'success');
$this->session->set_flashdata('message', $flashMsg);
redirect(base_url('Issue/viewMappedIssues/'.encode_param($mechanic_id)));
} else {
$this->session->set_flashdata('message', $flashMsg);
redirect($url);
}
}
} }
?> ?>
\ No newline at end of file
...@@ -40,7 +40,6 @@ class Settings extends CI_Controller { ...@@ -40,7 +40,6 @@ class Settings extends CI_Controller {
$this->session->set_flashdata('message',$flashMsg); $this->session->set_flashdata('message',$flashMsg);
redirect(base_url('Settings')); redirect(base_url('Settings'));
} }
if(isset($_FILES['site_logo']) && !empty($_FILES['site_logo'])){ if(isset($_FILES['site_logo']) && !empty($_FILES['site_logo'])){
$config = set_upload_service("assets/uploads/services"); $config = set_upload_service("assets/uploads/services");
$this->load->library('upload'); $this->load->library('upload');
......
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class Vechicle extends CI_Controller {
public function __construct() {
parent::__construct();
date_default_timezone_set("Asia/Kolkata");
// $this->load->model('Vechicle_model');
if(!$this->session->userdata('logged_in')) {
redirect(base_url());
}
}
public function vechicleSearch(){
pr($_POST);
$return_arr = array('status'=>'0');
if(!isset($_POST) || empty($_POST) || !isset($_POST['searchType']) || empty($_POST['searchType'])){
echo json_encode($return_arr);exit;
}
$searchType = $_POST['searchType'];
if($searchType == 1 &&
isset($_POST['vehYear']) && !empty($_POST['vehYear']) &&
isset($_POST['vehModel']) && !empty($_POST['vehModel']) &&
isset($_POST['vehMaker']) && !empty($_POST['vehMaker'])){
$return_arr['status'] = 1;
$return_arr['customer_data'] = $customer_data;
}
else if($searchType == 2 && isset($_POST['vehVin']) && !empty($_POST['vehVin'])){
$return_arr['status'] = 1;
$return_arr['customer_data'] = $customer_data;
}
echo json_encode($return_arr);exit;
}
}
?>
\ No newline at end of file
...@@ -50,22 +50,25 @@ class Issue_model extends CI_Model { ...@@ -50,22 +50,25 @@ class Issue_model extends CI_Model {
return ($status)?1:0; return ($status)?1:0;
} }
function getMechanicIssues($mechanic_id = ''){ function getMechanicIssues($mechanic_id = '',$iisue_id = '',$view_all = 0){
if(empty($mechanic_id)){ if(empty($mechanic_id)){
return 0; return 0;
} }
$view = ($view_all == 0)?'0,1':'1';
$cond = (!empty($issue_id))?" AND ISSUE.issue_id = '$issue_id' ":"";
$sql = "SELECT ISSUE.*,MECH.*,M_ISSUE.* $sql = "SELECT ISSUE.*,MECH.*,M_ISSUE.*
FROM mechanic_issues AS M_ISSUE FROM mechanic_issues AS M_ISSUE
INNER JOIN issues AS ISSUE ON (ISSUE.issue_id = M_ISSUE.issue_id) 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 mechanic AS MECH ON (MECH.mechanic_id = M_ISSUE.mechanic_id)
INNER JOIN admin_users AS ADMIN ON (ADMIN.id = MECH.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 WHERE M_ISSUE.mechanic_id='$mechanic_id' $cond AND
ADMIN.status IN (0,1) AND M_ISSUE.status IN (0,1)"; ISSUE.status IN ($view) AND M_ISSUE.status IN ($view) AND ADMIN.status IN (0,1)";
$result = $this->db->query($sql); $result = $this->db->query($sql);
if(empty($result)) if(empty($result))
return; return;
return $result->result(); return (!empty($mechanic_id) && !empty($iisue_id))?$result->row():$result->result();
} }
function changeMappedIssueStatus($mechanic_id = '', $issue_id = '', $status = '0'){ function changeMappedIssueStatus($mechanic_id = '', $issue_id = '', $status = '0'){
...@@ -78,5 +81,15 @@ class Issue_model extends CI_Model { ...@@ -78,5 +81,15 @@ class Issue_model extends CI_Model {
return $status; return $status;
} }
function updateMechIssue($mechanic_id = '', $issue_id = '', $issueMechData = array()){
if(empty($mechanic_id) || empty($issue_id) || empty($issueMechData)){
return 0;
}
$status = $this->db->update('mechanic_issues',
$issueMechData,
array('mechanic_id'=>$mechanic_id,'issue_id'=>$issue_id));
return ($status)?1:0;
}
} }
?> ?>
\ No newline at end of file
...@@ -20,7 +20,6 @@ class Settings_model extends CI_Model { ...@@ -20,7 +20,6 @@ class Settings_model extends CI_Model {
public function update_settings($data){ public function update_settings($data){
$result = $this->db->update('setting', $data); $result = $this->db->update('setting', $data);
return $result; return $result;
} }
......
...@@ -30,22 +30,22 @@ ...@@ -30,22 +30,22 @@
<div class="box-header with-border"> <div class="box-header with-border">
<h3 class="box-title">Personal Details</h3> <h3 class="box-title">Personal Details</h3>
</div> </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="box-body">
<form id="createCustomerForm" role="form" action="<?=base_url($redirectUrl)?>" method="post" class="validate" data-parsley-validate="" enctype="multipart/form-data">
<div class="col-md-12"> <div class="col-md-12">
<div class="col-md-6"> <div class="col-md-6">
<div class="form-group has-feedback"> <div class="form-group has-feedback">
<label>First Name</label> <label>First Name</label>
<input type="text" class="form-control required" data-parsley-trigger="change" <input type="text" class="form-control required" data-parsley-trigger="change"
data-parsley-minlength="2" data-parsley-pattern="^[a-zA-Z\ . ! @ # $ % ^ & * () + = , \/]+$" data-parsley-minlength="2" data-parsley-pattern="^[a-zA-Z\ . ! @ # $ % ^ & * () + = , \/]+$"
required="" name="first_name" placeholder="Enter Patient First Name" required="" name="first_name" placeholder="Enter First Name"
value="<?= (isset($customer_data) && isset($customer_data->first_name))?$customer_data->first_name:'' ?>"> value="<?= (isset($customer_data) && isset($customer_data->first_name))?$customer_data->first_name:'' ?>">
<span class="glyphicon form-control-feedback"></span> <span class="glyphicon form-control-feedback"></span>
</div> </div>
<div class="form-group has-feedback"> <div class="form-group has-feedback">
<label>Email</label> <label>Email</label>
<input type="email" class="form-control required" data-parsley-trigger="change" <input type="email" class="form-control required" data-parsley-trigger="change"
data-parsley-minlength="2" required="" name="email" placeholder="Enter Patient Email" data-parsley-minlength="2" required="" name="email" placeholder="Enter Email"
value="<?= (isset($customer_data) && isset($customer_data->email))?$customer_data->email:'' ?>"> value="<?= (isset($customer_data) && isset($customer_data->email))?$customer_data->email:'' ?>">
<span class="glyphicon form-control-feedback"></span> <span class="glyphicon form-control-feedback"></span>
</div> </div>
...@@ -61,7 +61,7 @@ ...@@ -61,7 +61,7 @@
<div class="form-group has-feedback"> <div class="form-group has-feedback">
<label>Address</label> <label>Address</label>
<textarea class="form-control required" data-parsley-trigger="change" <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> data-parsley-minlength="2" required="" name="address" placeholder="Enter Address"><?= (isset($customer_data) && isset($customer_data->address))?trim($customer_data->address):'' ?></textarea>
<span class="glyphicon form-control-feedback"></span> <span class="glyphicon form-control-feedback"></span>
</div> </div>
</div> </div>
...@@ -69,19 +69,19 @@ ...@@ -69,19 +69,19 @@
<div class="form-group has-feedback"> <div class="form-group has-feedback">
<label>Last Name</label> <label>Last Name</label>
<input type="text" class="form-control required" data-parsley-trigger="change" <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" data-parsley-minlength="2" data-parsley-pattern="^[a-zA-Z\ . ! @ # $ % ^ & * () + = , \/]+$" required="" name="last_name" placeholder="Enter Last Name"
value="<?= (isset($customer_data) && isset($customer_data->last_name))?$customer_data->last_name:'' ?>"> value="<?= (isset($customer_data) && isset($customer_data->last_name))?$customer_data->last_name:'' ?>">
<span class="glyphicon form-control-feedback"></span> <span class="glyphicon form-control-feedback"></span>
</div> </div>
<div class="form-group has-feedback"> <div class="form-group has-feedback">
<label>Phone</label> <label>Phone</label>
<input type="number" class="form-control required" data-parsley-trigger="change" <input type="number" class="form-control required" data-parsley-trigger="change"
data-parsley-minlength="2" required="" name="phone" placeholder="Enter Patient Phone" data-parsley-minlength="2" required="" name="phone" placeholder="Enter Phone"
value="<?= (isset($customer_data) && isset($customer_data->phone))?$customer_data->phone:'' ?>"> value="<?= (isset($customer_data) && isset($customer_data->phone))?$customer_data->phone:'' ?>">
<span class="glyphicon form-control-feedback"></span> <span class="glyphicon form-control-feedback"></span>
</div> </div>
<div class="form-group"> <div class="form-group">
<label for="exampleInputEmail1">Profile Picture</label> <label>Profile Picture</label>
<div class="col-md-12"> <div class="col-md-12">
<div class="col-md-3"> <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" /> <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" />
...@@ -95,32 +95,94 @@ ...@@ -95,32 +95,94 @@
</div> </div>
</div> </div>
</div> </div>
<!-- Vehicle Details START -->
<br> <br>
<div class="box-header with-border"> <div class="box-header with-border">
<h3 class="box-title">Vehicle Details</h3> <h3 class="box-title">Vehicle Details</h3>
</div> </div>
<br> <br>
<div class="col-md-12"> <div class="col-md-12">
<div class="col-md-3">
<label>
<input type="radio" name="search_key_type" value='1' checked>
<span class="padAll-20">Vechile Details</span>
</label>
</div>
<div class="col-md-9">
<label>
<input type="radio" name="search_key_type" value='2'>
<span class="padAll-20">VIN Number</span>
</label>
</div>
</div>
</form>
<form name="vechile_add" data-parsley-validate="" required>
<!-- Search Box START -->
<div class="col-md-12 padAll-20">
<div class="col-md-8">
<!-- Vehicle Details Search START -->
<div id="searchTyp_1">
<div class="col-md-12">
<div class="col-md-12">
<label>Vehicle Model</label>
<input type="text" class="form-control required" name="vehModel"
placeholder="Enter Vehicle Model" required="">
</div>
</div>
<div class="col-md-12 padTop10">
<div class="col-md-6"> <div class="col-md-6">
<div class="form-group has-feedback"> <label>Vehicle Maker</label>
<label>First Name</label> <input type="text" class="form-control required" name="vehMaker"
<input type="text" class="form-control required" data-parsley-trigger="change" placeholder="Enter Vehicle Maker" required>
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 class="col-md-6">
<label>Year of Manufactured</label>
<select name="vehYear" class="form-control required"
data-parsley-trigger="change" required="">
<option selected disabled value="">Choose Vehicle Purchase Year</option>
<?php
for($year=date('Y'); $year>=1950; $year--){
$cond = (isset($vehicle_data) && isset($vehicle_data->model) &&
!empty($vehicle_data->model) &&
$vehicle_data->model == $year)?'selected':'';
echo '<option '.$cond.' value="'.$year.'">'.$year.'</option>';
}
?>
</select>
</div> </div>
</div> </div>
</div>
<!-- Vehicle Details Search END -->
<!-- Vehicle Vin Search START -->
<div id="searchTyp_2" class="hide">
<div class="col-md-12">
<div class="col-md-12">
<label>Vehicle VIN Number</label>
<input type="text" class="form-control" name="vehVin"
placeholder="Enter Vehicle VIN Number">
</div>
</div>
</div>
<!-- Vehicle Vin Search END -->
</div>
<!-- Search Box END -->
<div class="col-md-4">
<button id="searchVechile" type="submit" class="btn btn-info" style="margin-top:22px;">
Search
</button>
</div>
</div>
<!-- Vehicle Details END -->
</form>
<div class="col-md-12"> <div class="col-md-12">
<div class="box-footer"> <div class="box-footer">
<div style="text-align: center;"> <div style="text-align: center;">
<button type="submit" class="btn btn-primary">Submit</button> <button id="createCustomerSubmit" type="submit" class="btn btn-primary">Submit</button>
</div>
</div> </div>
</div> </div>
</div> </div>
</form>
</div> </div>
</div> </div>
</div> </div>
......
...@@ -23,6 +23,13 @@ ...@@ -23,6 +23,13 @@
</div> </div>
<div class="col-xs-12"> <div class="col-xs-12">
<div class="box box-warning"> <div class="box box-warning">
<div class="box-header with-border">
<div class="col-md-6"><h3 class="box-title">Customers List</h3></div>
<div class="col-md-6" align="right">
<a class="btn btn-sm btn-primary" href="<?= base_url('Customer/addCustomerUser')?>">Add New Customer</a>
<a class="btn btn-sm btn-primary" href="<?= base_url() ?>">Back</a>
</div>
</div>
<div class="box-body"> <div class="box-body">
<table id="driverTable" class="table table-bordered table-striped datatable "> <table id="driverTable" class="table table-bordered table-striped datatable ">
<thead> <thead>
...@@ -31,7 +38,7 @@ ...@@ -31,7 +38,7 @@
<th width="150px;">Name</th> <th width="150px;">Name</th>
<th width="100px;">Phone</th> <th width="100px;">Phone</th>
<th width="150px;">Email ID</th> <th width="150px;">Email ID</th>
<th width="50px;">Age</th> <th width="150px;">Address</th>
<th width="150px;">Date Of Birth</th> <th width="150px;">Date Of Birth</th>
<th width="50px;">Status</th> <th width="50px;">Status</th>
<th width="500px;">Action</th> <th width="500px;">Action</th>
...@@ -47,7 +54,7 @@ ...@@ -47,7 +54,7 @@
<td class="center"><?= $customer->first_name.' '.$customer->last_name ?></th> <td class="center"><?= $customer->first_name.' '.$customer->last_name ?></th>
<td class="center"><?= $customer->phone ?></th> <td class="center"><?= $customer->phone ?></th>
<td class="center"><?= $customer->email ?></th> <td class="center"><?= $customer->email ?></th>
<td class="center"><?= $customer->age ?></th> <td class="center"><?= $customer->address ?></th>
<td class="center"><?= $customer->date_of_birth ?></th> <td class="center"><?= $customer->date_of_birth ?></th>
<td class="center"><?= ($customer->status == '1')?'Active':'Inactive'?></td> <td class="center"><?= ($customer->status == '1')?'Active':'Inactive'?></td>
<td class="center"> <td class="center">
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
<div class="row"> <div class="row">
<div class="col-md-12"> <div class="col-md-12">
<?php <?php
$url = (!isset($mechIssueId)||empty($mechIssueId))?'Issue/createMechIssue':'Issue/updateMechIssue/'.$mechIssueId; $url = (!isset($mechanic_id)||empty($mechanic_id)||!isset($issue_id)||empty($issue_id))?'Issue/createMechIssue':'Issue/updateMechIssue/'.encode_param($mechanic_id).'/'.encode_param($issue_id);
if($this->session->flashdata('message')) { if($this->session->flashdata('message')) {
$flashdata = $this->session->flashdata('message'); ?> $flashdata = $this->session->flashdata('message'); ?>
<div class="alert alert-<?= $flashdata['class'] ?>"> <div class="alert alert-<?= $flashdata['class'] ?>">
...@@ -37,7 +37,7 @@ ...@@ -37,7 +37,7 @@
<?php <?php
if(!empty($issue_data)){ if(!empty($issue_data)){
foreach ($issue_data as $issue) { foreach ($issue_data as $issue) {
$select = (isset($issue->issue_id) && $issue->issue_id != $issue->issue_id) $select = (isset($issue->issue_id) && $issue->issue_id == $issue_id)
?' selected ':''; ?' selected ':'';
echo'<option '.$select.' value="'.$issue->issue_id.'">'.$issue->issue.'</option>'; echo'<option '.$select.' value="'.$issue->issue_id.'">'.$issue->issue.'</option>';
} }
...@@ -47,7 +47,7 @@ ...@@ -47,7 +47,7 @@
<div class="form-group"> <div class="form-group">
<label>Custom Service Fee</label> <label>Custom Service Fee</label>
<input type="text" class="form-control required" data-parsley-trigger="change" <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:'' ?>"> data-parsley-minlength="2" data-parsley-pattern="^[0-9\ , . \/]+$" required="" name="service_fee" placeholder="Custom Service Fee" value="<?= (isset($mechanicIssueData) && isset($mechanicIssueData->service_fee))?$mechanicIssueData->service_fee:'' ?>">
<span class="glyphicon form-control-feedback"></span> <span class="glyphicon form-control-feedback"></span>
</div> </div>
</div> </div>
...@@ -55,7 +55,7 @@ ...@@ -55,7 +55,7 @@
<div class="form-group"> <div class="form-group">
<label>Custom Repair Description</label> <label>Custom Repair Description</label>
<textarea class="form-control required" data-parsley-trigger="change" <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> data-parsley-minlength="2" required="" name="issue_description" style="height: 80px;" placeholder="Custom Repair Description"><?= (isset($mechanicIssueData) && isset($mechanicIssueData->issue_description))?trim($mechanicIssueData->issue_description):'' ?></textarea>
<span class="glyphicon form-control-feedback"></span> <span class="glyphicon form-control-feedback"></span>
</div> </div>
</div> </div>
...@@ -64,7 +64,7 @@ ...@@ -64,7 +64,7 @@
<div class="col-md-12"> <div class="col-md-12">
<div class="box-footer textCenterAlign"> <div class="box-footer textCenterAlign">
<button type="submit" class="btn btn-primary">Submit</button> <button type="submit" class="btn btn-primary">Submit</button>
<a href="<?= base_url('Issue/viewIssues') ?>" class="btn btn-primary">Cancel</a> <a href="<?= base_url('Issue/viewMappedIssues/'.encode_param($mechanic_id)) ?>" class="btn btn-primary">Cancel</a>
</div> </div>
</div> </div>
</form> </form>
......
...@@ -26,8 +26,14 @@ ...@@ -26,8 +26,14 @@
<div class="col-sm-12"> <div class="col-sm-12">
<div class="box box-warning"> <div class="box box-warning">
<div class="box-header with-border"> <div class="box-header with-border">
<div class="col-md-6">
<h3 class="box-title">Mapped Issues Management</h3> <h3 class="box-title">Mapped Issues Management</h3>
</div> </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"> <div class="box-body">
<form id="chooseMechForm" role="form" action="<?=base_url('Issue/viewMappedIssues')?>" <form id="chooseMechForm" role="form" action="<?=base_url('Issue/viewMappedIssues')?>"
method="post" class="validate" data-parsley-validate="" enctype="multipart/form-data"> method="post" class="validate" data-parsley-validate="" enctype="multipart/form-data">
...@@ -86,11 +92,11 @@ ...@@ -86,11 +92,11 @@
<th class="center"><?= ($customData->status == 1)?'Active':'De-activate' ?></th> <th class="center"><?= ($customData->status == 1)?'Active':'De-activate' ?></th>
<td class="center"> <td class="center">
<a class="btn btn-sm btn-primary" <a class="btn btn-sm btn-primary"
href="<?= base_url('Issue/editIssue/'.encode_param($customData->issue_id)) ?>"> href="<?= base_url('Issue/editMechanicIssues/'.encode_param($customData->mechanic_id).'/'.encode_param($customData->issue_id).'/2') ?>">
<i class="fa fa-fw fa-trash"></i>Edit <i class="fa fa-fw fa-trash"></i>Edit
</a> </a>
<a class="btn btn-sm btn-danger" <a class="btn btn-sm btn-danger"
href="<?= base_url("Issue/changeStatus/".encode_param($customData->issue_id))."/2" ?>" href="<?= base_url("Issue/changeMappedIssueStatus/".encode_param($customData->mechanic_id)."/".encode_param($customData->issue_id)."/2") ?>"
onClick="return doconfirm()"> onClick="return doconfirm()">
<i class="fa fa-fw fa-trash"></i>Delete <i class="fa fa-fw fa-trash"></i>Delete
</a> </a>
......
...@@ -24,7 +24,12 @@ ...@@ -24,7 +24,12 @@
<div class="col-md-12"> <div class="col-md-12">
<div class="box box-warning"> <div class="box box-warning">
<div class="box-header with-border"> <div class="box-header with-border">
<h3 class="box-title">Edit Driver Details</h3> <div class="col-md-6">
<h3 class="box-title">Edit Basic Site Details</h3>
</div>
<div class="col-md-6" align="right">
<a class="btn btn-sm btn-primary" href="<?= base_url() ?>">Back</a>
</div>
</div> </div>
<form method="post" class="validate" role="form" action="<?= base_url().'Settings/change_settings'?>" enctype="multipart/form-data" data-parsley-validate=""> <form method="post" class="validate" role="form" action="<?= base_url().'Settings/change_settings'?>" enctype="multipart/form-data" data-parsley-validate="">
<div class="box-body"> <div class="box-body">
...@@ -86,6 +91,16 @@ ...@@ -86,6 +91,16 @@
<input type="text" name="google_api_key" class="form-control required" placeholder="Enter Google API" value="<?= $data['google_api_key'] ?>"> <input type="text" name="google_api_key" class="form-control required" placeholder="Enter Google API" value="<?= $data['google_api_key'] ?>">
</div> </div>
</div> </div>
<div class="row">
<div class="form-group col-xs-4">
<label>Vin Audit URL</label>
<input type="text" name="vin_audit_url" class="form-control required" placeholder="Enter Vin Audit URL" value="<?= $data['vin_audit_url'] ?>">
</div>
<div class="form-group col-xs-3">
<label>Vin Audit API</label>
<input type="text" name="vin_audit_api" class="form-control required" placeholder="Enter Vin Audit API" value="<?= $data['vin_audit_api'] ?>">
</div>
</div>
</div> </div>
<div class="box-footer" style="padding-left:46%"> <div class="box-footer" style="padding-left:46%">
<button type="submit" class="btn btn-info">Update</button> <button type="submit" class="btn btn-info">Update</button>
......
...@@ -56,15 +56,15 @@ ...@@ -56,15 +56,15 @@
</li> </li>
<?php } ?> <?php } ?>
<li> <li>
<a href="<?= base_url('Issue/viewMappedIssues') ?>"> <a href="<?= base_url('Issue/viewIssues') ?>">
<i class="fa fa-circle-o text-aqua"></i> <i class="fa fa-circle-o text-aqua"></i>
Manage Mapped Issues Manage General Issues
</a> </a>
</li> </li>
<li> <li>
<a href="<?= base_url('Issue/viewIssues') ?>"> <a href="<?= base_url('Issue/viewMappedIssues') ?>">
<i class="fa fa-circle-o text-aqua"></i> <i class="fa fa-circle-o text-aqua"></i>
Manage Common Issues Manage Mechanic Issues
</a> </a>
</li> </li>
</ul> </ul>
...@@ -91,7 +91,6 @@ ...@@ -91,7 +91,6 @@
</li> </li>
</ul> </ul>
</li> </li>
<?php } ?>
<li class="treeview"> <li class="treeview">
<a href="#"> <a href="#">
<i class="fa fa-bars" aria-hidden="true"></i> <i class="fa fa-bars" aria-hidden="true"></i>
...@@ -113,7 +112,6 @@ ...@@ -113,7 +112,6 @@
</li> </li>
</ul> </ul>
</li> </li>
<?php if($this->session->userdata['user_type'] == 1){ ?>
<li><a href="<?= base_url('Settings') ?>"> <li><a href="<?= base_url('Settings') ?>">
<i class="fa fa-wrench" aria-hidden="true"> <i class="fa fa-wrench" aria-hidden="true">
</i><span>Settings</span></a> </i><span>Settings</span></a>
......
...@@ -335,3 +335,11 @@ ...@@ -335,3 +335,11 @@
.textCenterAlign { .textCenterAlign {
text-align:center; text-align:center;
} }
.padAll-20 {
padding: 10px;
}
.padAll-20 {
padding: 20px;
}
\ No newline at end of file
...@@ -233,3 +233,96 @@ jQuery('[id="viewMechanic"]').on('click',function() { ...@@ -233,3 +233,96 @@ jQuery('[id="viewMechanic"]').on('click',function() {
function changeMechanic(){ function changeMechanic(){
jQuery('[id="chooseMechForm"]').submit(); jQuery('[id="chooseMechForm"]').submit();
} }
jQuery('[name="search_key_type"]').on('change',function() {
var searchTypId = jQuery(this).val();
if(searchTypId == '' || searchTypId == null || searchTypId == 'null' ||
searchTypId == undefined || searchTypId == 'undefined'){
return false;
}
jQuery('[id^="searchTyp_"]').addClass('hide');
jQuery('[id="searchTyp_'+searchTypId+'"]').removeClass('hide');
jQuery('[id^="searchTyp_"]').find('input').each(function (index,element) {
jQuery(this).val('');
jQuery(this).removeAttr('required');
jQuery(this).removeClass('required');
});
jQuery('[id="searchTyp_'+searchTypId+'"]').find('input').each(function (index,element) {
jQuery(this).attr('required','');
jQuery(this).addClass('required');
});
});
jQuery('[id="createCustomerSubmit"]').on('click',function() {
jQuery('[id="createCustomerForm"]').submit();
});
jQuery('[id="searchVechile"]').on('click',function() {
event.preventDefault();
var searchTypId = jQuery('[name="search_key_type"]').val(),
passArr = {'searchType':'','vehModel':'','vehMaker':'','vehYear':'','vehVin':''};
if(searchTypId == '' || searchTypId == null || searchTypId == 'null' || searchTypId == undefined || searchTypId == 'undefined'){
modalTrigger('Vechile Search Failed','Vechile Search Failed Failed. Provide proper data and try again..!');
return false;
}
var vehVin = jQuery('[name="vehVin"]').val(),
vehYear = jQuery('[name="vehYear"]').val(),
vehModel = jQuery('[name="vehModel"]').val(),
vehMaker = jQuery('[name="vehMaker"]').val();
if((searchTypId == 1 &&
(vehYear == '' || vehYear == null || vehYear == 'null' || vehYear == undefined || vehYear == 'undefined' ||
vehModel == '' || vehModel == null || vehModel == 'null' || vehModel == undefined || vehModel == 'undefined' ||
vehMaker == '' || vehMaker == null || vehMaker == 'null' || vehMaker == undefined || vehMaker == 'undefined')
) ||
(searchTypId == 2 &&
(vehVin == '' || vehVin == null || vehVin == 'null' || vehVin == undefined || vehVin == 'undefined')
)
){
modalTrigger('Vechile Search Failed','Vechile Search Failed Failed. Provide proper data and try again..!');
return false;
}
passArr.vehVin = vehVin;
passArr.vehYear = vehYear;
passArr.vehModel = vehModel;
passArr.vehMaker = vehMaker;
passArr.searchType = searchTypId;
jQuery.ajax({
url : base_url+"Vehicle/vechicleSearch",
type : 'POST',
data : passArr,
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'] != '1'){
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] = ' -- ';
}
});
remModalLoader();
},
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...!');
}
});
});
\ No newline at end of file
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