CHNAGE_MAKE_EDIT : AADHAVAN
This commit is contained in:
parent
9da2c550b9
commit
0332f2c2dd
@ -117,62 +117,73 @@ $routes->get('dashboard', 'Users::dashboard');
|
||||
|
||||
|
||||
|
||||
//---------------------- Make And Model | Service | Manufacturer | Inventory->Purchase | Complaint
|
||||
// Make
|
||||
$routes->get('make_index', 'Make::index');
|
||||
$routes->post('create_make', 'Make::create_make');
|
||||
|
||||
// Model
|
||||
$routes->get('bike_model_index/(:any)', 'Model::index/$1');
|
||||
$routes->post('create_model', 'Model::create_model');
|
||||
$routes->post('status_model', 'Model::status_model');
|
||||
|
||||
|
||||
// Service
|
||||
|
||||
$routes->get('service_index', 'Service::service_index');
|
||||
$routes->get("new_service/(:any)", "Service::new_service/$1");
|
||||
$routes->post("add_service", "Service::add_service");
|
||||
$routes->post("get_models_service", "Service::get_models");
|
||||
$routes->get("delete_service/(:any)", "Service::delete_service/$1");
|
||||
|
||||
|
||||
|
||||
//Spare manufacturer
|
||||
|
||||
$routes->get('spare_manufacturer_index', 'Manufacturer::index');
|
||||
$routes->post('create_manufacturer', 'Manufacturer::create_manufacturer');
|
||||
//---------------------- Make And Model | Service | Manufacturer | Inventory->Purchase
|
||||
//---------------------- Reorder Level | Return Order | Complaint
|
||||
|
||||
// Make //
|
||||
$routes->get('make_index', 'Make::index');
|
||||
$routes->post('create_make/(:any)', 'Make::create_make/$1');
|
||||
// Make End's //
|
||||
|
||||
|
||||
// Purchase
|
||||
// Model //
|
||||
$routes->get('bike_model_index/(:any)', 'Model::index/$1');
|
||||
$routes->post('create_model', 'Model::create_model');
|
||||
$routes->post('status_model', 'Model::status_model');
|
||||
// Model End's//
|
||||
|
||||
|
||||
// Service //
|
||||
$routes->get('service_index', 'Service::service_index');
|
||||
$routes->get("new_service/(:any)", "Service::new_service/$1");
|
||||
$routes->post("add_service", "Service::add_service");
|
||||
$routes->post("get_models_service", "Service::get_models");
|
||||
$routes->get("delete_service/(:any)", "Service::delete_service/$1");
|
||||
// Service End's//
|
||||
|
||||
|
||||
//Spare manufacturer//
|
||||
$routes->get('spare_manufacturer_index', 'Manufacturer::index');
|
||||
$routes->post('create_manufacturer', 'Manufacturer::create_manufacturer');
|
||||
//Spare manufacturer End's//
|
||||
|
||||
|
||||
// Purchase//
|
||||
$routes->get('purchase_index', 'Purchase::purchase_index');
|
||||
$routes->get("new_purchase/(:any)", "Purchase::new_purchase/$1");
|
||||
$routes->get('get_vendor/(:any)', 'Purchase::get_vendor/$1');
|
||||
$routes->post("add_purchase", "Purchase::add_purchase");
|
||||
$routes->get("delete_purchase/(:any)", "Purchase::delete_purchase/$1");
|
||||
$routes->post("getVendorProducts", "Purchase::getVendorProducts");
|
||||
$routes->post("delete_purchase_product", "Purchase::delete_purchase_product");
|
||||
$routes->get("download_purchase_invoice/(:any)", "Purchase::download_purchase_invoice/$1");
|
||||
$routes->get("reorder_purchase/(:any)", "Purchase::reorder_purchase/$1");
|
||||
// Purchase End's//
|
||||
|
||||
$routes->get('purchase_index', 'Purchase::purchase_index');
|
||||
$routes->get("new_purchase/(:any)", "Purchase::new_purchase/$1");
|
||||
$routes->get('get_vendor/(:any)', 'Purchase::get_vendor/$1');
|
||||
$routes->post("add_purchase", "Purchase::add_purchase");
|
||||
$routes->get("delete_purchase/(:any)", "Purchase::delete_purchase/$1");
|
||||
$routes->post("getVendorProducts", "Purchase::getVendorProducts");
|
||||
$routes->post("delete_purchase_product", "Purchase::delete_purchase_product");
|
||||
$routes->get("download_purchase_invoice/(:any)", "Purchase::download_purchase_invoice/$1");
|
||||
$routes->get("reorder_purchase/(:any)", "Purchase::reorder_purchase/$1");
|
||||
|
||||
// Reorder Level//
|
||||
$routes->get('reorder_level_index', 'Reorderlevel::reorder_level_index');
|
||||
$routes->get('rise_order/(:any)', 'Reorderlevel::rise_order/$1');
|
||||
$routes->get('reorder_level_index', 'Reorderlevel::reorder_level_index');
|
||||
$routes->get('rise_order/(:any)', 'Reorderlevel::rise_order/$1');
|
||||
// Reorder Level//
|
||||
|
||||
|
||||
// Return Order//
|
||||
$routes->get('return_order_index', 'ReturnOrder::return_order_index');
|
||||
$routes->get('return_order', 'ReturnOrder::return_order');
|
||||
$routes->get("new_return/(:any)", "ReturnOrder::new_return/$1");
|
||||
$routes->post("add_return_purchase", "ReturnOrder::add_return_purchase");
|
||||
$routes->get('get_vendor/(:any)', 'Purchase::get_vendor/$1');
|
||||
|
||||
$routes->get('edit_return_order/(:any)', 'ReturnOrder::edit_return_order/$1');
|
||||
|
||||
$routes->get('return_order_index', 'ReturnOrder::return_order_index');
|
||||
$routes->get('return_order', 'ReturnOrder::return_order');
|
||||
$routes->get("new_return/(:any)", "ReturnOrder::new_return/$1");
|
||||
$routes->post("add_return_purchase", "ReturnOrder::add_return_purchase");
|
||||
$routes->get('get_vendor/(:any)', 'Purchase::get_vendor/$1');
|
||||
$routes->get('edit_return_order/(:any)', 'ReturnOrder::edit_return_order/$1');
|
||||
// Return Order End's//
|
||||
|
||||
|
||||
// Complaint
|
||||
$routes->get('complaint_index', 'Complaint::complaint_index');
|
||||
$routes->post('create_complaint/(:any)', 'Complaint::create_complaint/$1');
|
||||
$routes->get('edit_complaint/(:any)', 'Complaint::edit_complaint/$1');
|
||||
$routes->get("delete_complaint/(:any)", "Complaint::delete_complaint/$1");
|
||||
$routes->get('complaint_index', 'Complaint::complaint_index');
|
||||
$routes->post('create_complaint/(:any)', 'Complaint::create_complaint/$1');
|
||||
$routes->get('edit_complaint/(:any)', 'Complaint::edit_complaint/$1');
|
||||
$routes->get("delete_complaint/(:any)", "Complaint::delete_complaint/$1");
|
||||
// Complaint End's//
|
||||
|
||||
@ -5,33 +5,26 @@ namespace App\Controllers;
|
||||
use App\Models\ComplaintModel;
|
||||
use CodeIgniter\API\ResponseTrait;
|
||||
|
||||
|
||||
|
||||
class Complaint extends BaseController
|
||||
{
|
||||
|
||||
public $session;
|
||||
use ResponseTrait;
|
||||
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
|
||||
$this->session = session();
|
||||
|
||||
$this->session = session();
|
||||
}
|
||||
|
||||
public function complaint_index()
|
||||
{
|
||||
if(!$this->session->has('logged_user')) { return redirect()->to(base_url()); }
|
||||
|
||||
$ComplaintModel = new ComplaintModel();
|
||||
$complaint = $ComplaintModel->findAll();
|
||||
|
||||
$data['complaint']=$complaint;
|
||||
return view('complaint_list',$data);
|
||||
}
|
||||
|
||||
|
||||
public function create_complaint($complaint_id)
|
||||
{
|
||||
if(!$this->session->has('logged_user')) { return redirect()->to(base_url()); }
|
||||
@ -65,39 +58,31 @@ class Complaint extends BaseController
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
public function edit_complaint($complaint_id)
|
||||
{
|
||||
|
||||
$data['page_name']= 'Edit Complaint';
|
||||
|
||||
$complaintModel = new ComplaintModel();
|
||||
|
||||
$complaint = $complaintModel->where('complaint_id',$complaint_id)->findAll();
|
||||
$data['complaint']=$complaint;
|
||||
|
||||
$data['page_name']= 'Edit Complaint';
|
||||
$data['complaint']=$complaint;
|
||||
return json_encode($data);
|
||||
}
|
||||
|
||||
|
||||
|
||||
public function delete_complaint($complaint_id)
|
||||
{
|
||||
|
||||
if (!empty($complaint_id)) {
|
||||
$ComplaintModel = new ComplaintModel();
|
||||
$data['isactive'] = 0;
|
||||
|
||||
if ($ComplaintModel->update($complaint_id, $data)) {
|
||||
// Return success response
|
||||
return redirect()->to('complaint_index');
|
||||
if (!empty($complaint_id)) {
|
||||
$ComplaintModel = new ComplaintModel();
|
||||
$data['isactive'] = 0;
|
||||
|
||||
if ($ComplaintModel->update($complaint_id, $data)) {
|
||||
// Return success response
|
||||
return redirect()->to('complaint_index');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Return error response if deletion fails
|
||||
return $this->response->setJSON(['success' => false]);
|
||||
}
|
||||
|
||||
// Return error response if deletion fails
|
||||
return $this->response->setJSON(['success' => false]);
|
||||
}
|
||||
}
|
||||
?>
|
||||
@ -31,7 +31,7 @@ class Make extends BaseController
|
||||
|
||||
|
||||
|
||||
public function create_make()
|
||||
public function create_make($make_id)
|
||||
{
|
||||
try {
|
||||
$make_name = $this->request->getPost('makename');
|
||||
@ -39,13 +39,24 @@ class Make extends BaseController
|
||||
$data = [
|
||||
'make' => $make_name
|
||||
];
|
||||
$inserted = $BikemakeModel->insert($data);
|
||||
if ($inserted) {
|
||||
$result = $data;
|
||||
return $this->respond(['status' => 'success','code' => 200,'data' => $result],200);
|
||||
} else {
|
||||
$result = "No Match's";
|
||||
return $this->respond(['status' => 'failed','code' => 404,'data' => $result],404);
|
||||
if (!$make_id) {
|
||||
$inserted = $BikemakeModel->insert($data);
|
||||
if ($inserted) {
|
||||
$result = $data;
|
||||
return $this->respond(['status' => 'success','code' => 200,'data' => $result],200);
|
||||
} else {
|
||||
$result = "No Match's";
|
||||
return $this->respond(['status' => 'failed','code' => 404,'data' => $result],404);
|
||||
}
|
||||
}else{
|
||||
$updated = $BikemakeModel->update($make_id,$data);
|
||||
if ($updated) {
|
||||
$result = $data;
|
||||
return $this->respond(['status' => 'success','code' => 200,'data' => $result],200);
|
||||
} else {
|
||||
$result = "No Match's";
|
||||
return $this->respond(['status' => 'failed','code' => 404,'data' => $result],404);
|
||||
}
|
||||
}
|
||||
} catch (\Exception $e) {
|
||||
return $this->respond(['status' => 'failed','code' => 500,'data' => $e],500);
|
||||
|
||||
@ -21,7 +21,6 @@
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<!-- <h4 class="header-title">Business List</h4> -->
|
||||
|
||||
<table id="datatable-buttons" class="table table-striped dt-responsive nowrap w-100" style="width:100% !important;text-align: center;width: 100%;">
|
||||
<thead>
|
||||
<tr>
|
||||
@ -30,7 +29,6 @@
|
||||
<th>Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
<?php foreach ($model as $item): ?>
|
||||
<tr>
|
||||
@ -55,9 +53,7 @@
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
</div> <!-- end table-responsive-->
|
||||
|
||||
</div>
|
||||
</div> <!-- end card -->
|
||||
</div> <!-- end col -->
|
||||
@ -65,36 +61,35 @@
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- Start Bike Model Create Pop-UP -->
|
||||
<div id="bike_model_login-modal_1" class="modal fade" tabindex="-1" role="dialog" aria-hidden="true">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-body">
|
||||
<div class="text-center mt-2 mb-4">
|
||||
<h4 id="form_add_edit">Add Models</h4>
|
||||
<!-- Start Bike Model Create Pop-UP -->
|
||||
<div id="bike_model_login-modal_1" class="modal fade" tabindex="-1" role="dialog" aria-hidden="true">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-body">
|
||||
<div class="text-center mt-2 mb-4">
|
||||
<h4 id="form_add_edit">Add Models</h4>
|
||||
</div>
|
||||
|
||||
<form id="model_form_data" class="px-3">
|
||||
|
||||
<div class="form-group">
|
||||
<input class="form-control" type="text" id="make_id" required="" value="<?php echo $make_id; ?>" placeholder="Make Name...." style="display:none;">
|
||||
<label for="makename">Make Name </label>
|
||||
<input class="form-control" type="text" id="makename" required="" value="<?php echo $make_name; ?>" placeholder="Make Name...." disabled>
|
||||
<label for="modelname">Model Name </label>
|
||||
<input class="form-control" type="text" id="modelname" required="" placeholder="Model Name....">
|
||||
</div>
|
||||
|
||||
<form id="model_form_data" class="px-3">
|
||||
<div class="form-group text-center">
|
||||
<button class="btn btn-rounded btn-primary" type="submit" onclick="submitModels(this)">Submit</button>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<input class="form-control" type="text" id="make_id" required="" value="<?php echo $make_id; ?>" placeholder="Make Name...." style="display:none;">
|
||||
<label for="makename">Make Name </label>
|
||||
<input class="form-control" type="text" id="makename" required="" value="<?php echo $make_name; ?>" placeholder="Make Name...." disabled>
|
||||
<label for="modelname">Model Name </label>
|
||||
<input class="form-control" type="text" id="modelname" required="" placeholder="Model Name....">
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<div class="form-group text-center">
|
||||
<button class="btn btn-rounded btn-primary" type="submit" onclick="submitModels(this)">Submit</button>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
|
||||
</div>
|
||||
</div><!-- /.modal-content -->
|
||||
</div><!-- /.modal-dialog -->
|
||||
</div><!-- /.modal -->
|
||||
</div>
|
||||
</div><!-- /.modal-content -->
|
||||
</div><!-- /.modal-dialog -->
|
||||
</div><!-- /.modal -->
|
||||
<!-- End Bike Model Create Pop-UP -->
|
||||
<?php include('layout/footer.php'); ?>
|
||||
|
||||
|
||||
@ -1,13 +1,12 @@
|
||||
<?php include('layout/header.php'); ?>
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="page-title-box page-title-box-alt">
|
||||
<h4 class="page-title">Complaints List</h4>
|
||||
<div class="page-title-right">
|
||||
<ol class="breadcrumb m-0">
|
||||
<li class=""> <a href="#" data-toggle="modal" data-target="#complaint-add-modal" class="btn btn-primary waves-effect" onclick="clearDetials(this)"> <i class="ri-add-line"></i></a>
|
||||
</li>
|
||||
<li class=""> <a href="#" data-toggle="modal" data-target="#complaint-add-modal" class="btn btn-primary waves-effect" onclick="clearDetials(this)"> <i class="ri-add-line"></i></a></li>
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
@ -17,8 +16,7 @@
|
||||
<div class="col-lg-12">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<table id="datatable-buttons" class="table table-striped dt-responsive nowrap w-100"
|
||||
style="width:100% !important;">
|
||||
<table id="datatable-buttons" class="table table-striped dt-responsive nowrap w-100" style="width:100% !important;">
|
||||
<thead>
|
||||
<tr>
|
||||
<th> Name</th>
|
||||
@ -30,72 +28,60 @@
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach ($complaint as $value) : ?>
|
||||
<tr>
|
||||
<td><?= $value['name']; ?></td>
|
||||
<td><?= $value['labour_charge']; ?></td>
|
||||
<td>
|
||||
<?php if($value['isactive'] == 1): ?>
|
||||
<span style="color:green">Active</span>
|
||||
<?php else: ?>
|
||||
<span style="color:red">Inactive</span>
|
||||
<?php endif; ?>
|
||||
</td>
|
||||
<td>
|
||||
<a data-toggle="modal" data-target="#complaint-add-modal" data-value="<?php echo $value['complaint_id']; ?>" onclick="editComplaint(this)" class="delete-button"><i class="ri-pencil-line" style="font-size: 20px;"></i></a>
|
||||
<a href="<?= "delete_complaint/" . $value['complaint_id']; ?>" class="delete-button"><i class="ri-delete-bin-line" style="font-size: 20px;"></i></a>
|
||||
|
||||
</td>
|
||||
|
||||
<tr>
|
||||
<td><?= $value['name']; ?></td>
|
||||
<td><?= $value['labour_charge']; ?></td>
|
||||
<td>
|
||||
<?php if($value['isactive'] == 1): ?>
|
||||
<span style="color:green">Active</span>
|
||||
<?php else: ?>
|
||||
<span style="color:red">Inactive</span>
|
||||
<?php endif; ?>
|
||||
</td>
|
||||
<td>
|
||||
<a data-toggle="modal" data-target="#complaint-add-modal" data-value="<?php echo $value['complaint_id']; ?>" onclick="editComplaint(this)" class="delete-button"><i class="ri-pencil-line" style="font-size: 20px;"></i></a>
|
||||
<a href="<?= "delete_complaint/" . $value['complaint_id']; ?>" class="delete-button"><i class="ri-delete-bin-line" style="font-size: 20px;"></i></a>
|
||||
</td>
|
||||
<?php endforeach; ?>
|
||||
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div> <!-- end table-responsive-->
|
||||
|
||||
</div>
|
||||
</div> <!-- end card -->
|
||||
</div> <!-- end col -->
|
||||
</div>
|
||||
|
||||
<div id="complaint-add-modal" class="modal fade" tabindex="-1" role="dialog" aria-hidden="true">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-body">
|
||||
<div class="text-center mt-2 mb-4">
|
||||
<h4 id="form_add_edit">Add Complaint</h4>
|
||||
</div>
|
||||
|
||||
<form id="model_form_data" class="px-3">
|
||||
|
||||
<div class="form-group">
|
||||
<label for="name">Name </label>
|
||||
<input class="form-control" type="text" id="complaint_id" hidden>
|
||||
<input class="form-control" type="text" id="name" required="" placeholder="Name....">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="labour_charge">Labour Charge </label>
|
||||
<input class="form-control" type="text" id="labour_charge" required="" placeholder="Labour Charge....">
|
||||
</div>
|
||||
|
||||
<div class="form-group text-center">
|
||||
<button class="btn btn-rounded btn-primary" type="submit" onclick="submitComplaint(this)">Submit</button>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
|
||||
<!-- /.modal -->
|
||||
<div id="complaint-add-modal" class="modal fade" tabindex="-1" role="dialog" aria-hidden="true">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-body">
|
||||
<div class="text-center mt-2 mb-4">
|
||||
<h4 id="form_add_edit">Add Complaint</h4>
|
||||
</div>
|
||||
</div><!-- /.modal-content -->
|
||||
</div><!-- /.modal-dialog -->
|
||||
</div><!-- /.modal -->
|
||||
<form id="model_form_data" class="px-3">
|
||||
<div class="form-group">
|
||||
<label for="name">Name </label>
|
||||
<input class="form-control" type="text" id="complaint_id" hidden>
|
||||
<input class="form-control" type="text" id="name" required="" placeholder="Name....">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="labour_charge">Labour Charge </label>
|
||||
<input class="form-control" type="text" id="labour_charge" required="" placeholder="Labour Charge....">
|
||||
</div>
|
||||
<div class="form-group text-center">
|
||||
<button class="btn btn-rounded btn-primary" type="submit" onclick="submitComplaint(this)">Submit</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div><!-- /.modal-content -->
|
||||
</div><!-- /.modal-dialog -->
|
||||
</div><!-- /.modal -->
|
||||
<?php include('layout/footer.php'); ?>
|
||||
|
||||
|
||||
<script>
|
||||
|
||||
|
||||
function submitComplaint(params) {
|
||||
|
||||
if (!$('#name').val() || !$('#labour_charge').val()) {
|
||||
return false;
|
||||
}
|
||||
@ -103,13 +89,10 @@
|
||||
name: $('#name').val(),
|
||||
labour_charge: $('#labour_charge').val(),
|
||||
};
|
||||
|
||||
var complaint_id = $('#complaint_id').val();
|
||||
|
||||
if (!complaint_id) {
|
||||
complaint_id = 0;
|
||||
}
|
||||
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
url: '<?php echo base_url()."create_complaint/"?>' + complaint_id,
|
||||
@ -129,12 +112,8 @@
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
function editComplaint(params) {
|
||||
|
||||
var complaint_id = $(params).data('value');
|
||||
|
||||
$.ajax({
|
||||
type: 'GET',
|
||||
url: '<?php echo base_url()."edit_complaint/"?>' + complaint_id,
|
||||
@ -156,6 +135,6 @@
|
||||
|
||||
function clearDetials(params) {
|
||||
$('#form_add_edit').text('Add Complaint');
|
||||
|
||||
}
|
||||
|
||||
</script>
|
||||
@ -1,6 +1,6 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<title>Mechanic</title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
@ -34,7 +34,7 @@
|
||||
<tr>
|
||||
<td class="make"><?php echo $item['make']; ?></td>
|
||||
<td>
|
||||
<a data-toggle="modal" data-target="#bike_make_login-modal" value="<?php echo $item['make_id']; ?>" class="edit-button" onclick="editMake(this)"><i class="ri-pencil-line"></i></a>
|
||||
<a data-toggle="modal" data-target="#bike_make_login-modal" data-value="<?php echo $item['make_id']; ?>" class="edit-button" onclick="editMake(this)"><i class="ri-pencil-line"></i></a>
|
||||
|
||||
<a href="#" data-toggle="modal" data-target="#bike_model_login-modal" style="margin-left: 12px;" class="add-button" title="Add" data-id="<?php echo $item['make_id']; ?>" data-value="<?php echo $item['make']; ?>" onclick="setMakeName(this)">
|
||||
<i class="ri-add-line icon-large"></i>
|
||||
@ -66,6 +66,7 @@
|
||||
|
||||
<div class="form-group">
|
||||
<label for="makename">Make Name </label>
|
||||
<input type="text" id="edit_make_id" hidden>
|
||||
<input class="form-control" type="text" id="bike_make_name" required="" placeholder="Make Name....">
|
||||
</div>
|
||||
|
||||
@ -155,9 +156,15 @@
|
||||
makename: $('#bike_make_name').val()
|
||||
};
|
||||
|
||||
var edit_make_id = $('#edit_make_id').val();
|
||||
|
||||
if (!edit_make_id) {
|
||||
edit_make_id =0;
|
||||
}
|
||||
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
url: 'create_make',
|
||||
url: 'create_make/'+edit_make_id,
|
||||
data: formData,
|
||||
dataType: 'json',
|
||||
success: function(response) {
|
||||
@ -174,6 +181,8 @@
|
||||
|
||||
|
||||
function editMake(params) {
|
||||
|
||||
$('#edit_make_id').val($(params).data('value'));
|
||||
$('#form_add_edit').text('Edit Bike Make');
|
||||
|
||||
var full_div = $(params).parent().parent()[0];
|
||||
|
||||
@ -6,9 +6,7 @@
|
||||
<h4 class="page-title">Vehicle List</h4>
|
||||
<div class="page-title-right">
|
||||
<ol class="breadcrumb m-0">
|
||||
<li class=""> <a href="<?= base_url() . "new_vehicle/0"; ?>" class="btn btn-primary waves-effect"> <i class="ri-add-line"></i></a>
|
||||
</li>
|
||||
|
||||
<li class=""> <a href="<?= base_url() . "new_vehicle/0"; ?>" class="btn btn-primary waves-effect"> <i class="ri-add-line"></i></a></li>
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
@ -19,15 +17,9 @@
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<!-- <h4 class="header-title">Business List</h4> -->
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<table id="datatable-buttons" class="table table-striped dt-responsive nowrap w-100"
|
||||
style="width:100% !important;">
|
||||
<thead>
|
||||
|
||||
<tr>
|
||||
<th>Reg No</th>
|
||||
<th>Make & Model</th>
|
||||
@ -39,7 +31,6 @@
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
|
||||
<tbody>
|
||||
<?php foreach ($vehicle as $value) :
|
||||
if ($value['isactive'] == 1) : ?>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user