CHANGE_CSS_ADD : AADHAVAN

This commit is contained in:
aadhavan valli 2024-05-04 09:16:03 +05:30
parent c8d877f52b
commit db91ef6d39
25 changed files with 231 additions and 133 deletions

View File

@ -111,6 +111,7 @@ $routes->post("add_vehicle", "Vehicle::add_vehicle");
$routes->get("new_vehicle/(:any)", "Vehicle::new_vehicle/$1"); $routes->get("new_vehicle/(:any)", "Vehicle::new_vehicle/$1");
$routes->get("delete_vehicle/(:any)", "Vehicle::delete_vehicle/$1"); $routes->get("delete_vehicle/(:any)", "Vehicle::delete_vehicle/$1");
$routes->post("get_models_vehicle", "Vehicle::get_models"); $routes->post("get_models_vehicle", "Vehicle::get_models");
$routes->post("checkRegisterNo", "Vehicle::checkRegisterNo");
//end Vehicle //end Vehicle

View File

@ -42,6 +42,7 @@ class Make extends BaseController
]; ];
if (!$make_id) { if (!$make_id) {
try { try {
$data['business_id'] = $this->session->get('logged_user_business_id');
$inserted = $BikemakeModel->insert($data); $inserted = $BikemakeModel->insert($data);
} catch (\CodeIgniter\Database\Exceptions\DatabaseException $e) { } catch (\CodeIgniter\Database\Exceptions\DatabaseException $e) {

View File

@ -153,4 +153,17 @@ class Vehicle extends BaseController
return $this->response->setJSON($formatted_models); return $this->response->setJSON($formatted_models);
} }
public function checkRegisterNo(){
// if(!$this->session->has('logged_user')) { return redirect()->to(base_url()); }
$VehicleModel = new VehicleModel();
$reg_no = $this->request->getPost('register_number');
$register_find = $VehicleModel->where('reg_no',$reg_no)->first();
return json_encode($register_find);
}
} }

View File

@ -8,7 +8,7 @@
<ol class="breadcrumb m-0"> <ol class="breadcrumb m-0">
<li class=""> <li class="">
<a href="#" data-toggle="modal" data-target="#bike_model_login-modal_1" class="btn btn-primary waves-effect" onclick="clearDetials(this)"> <a href="#" data-toggle="modal" data-target="#bike_model_login-modal_1" class="btn btn-primary waves-effect" onclick="clearDetials(this)">
<i class="ri-add-line"></i> Add Model
</a> </a>
</li> </li>
</ol> </ol>

View File

@ -7,7 +7,7 @@
<div class="page-title-right"> <div class="page-title-right">
<ol class="breadcrumb m-0"> <ol class="breadcrumb m-0">
<li class=""> <a href="#" data-toggle="modal" data-target="#bike_make_login-modal" class="btn btn-primary waves-effect"> <li class=""> <a href="#" data-toggle="modal" data-target="#bike_make_login-modal" class="btn btn-primary waves-effect">
<i class="ri-add-line"></i> Add Branch
</a> </a>
</li> </li>
<!-- <li class="breadcrumb-item"><a href="javascript: void(0);">Tables</a></li> <!-- <li class="breadcrumb-item"><a href="javascript: void(0);">Tables</a></li>

View File

@ -6,7 +6,7 @@
<h4 class="page-title">Business List</h4> <h4 class="page-title">Business List</h4>
<div class="page-title-right"> <div class="page-title-right">
<ol class="breadcrumb m-0"> <ol class="breadcrumb m-0">
<li class=""> <a href="<?= base_url() . "new_business/0"; ?>" class="btn btn-primary waves-effect"> <i class="ri-add-line"></i></a> <li class=""> <a href="<?= base_url() . "new_business/0"; ?>" class="btn btn-primary waves-effect">Add Business</a>
</li> </li>
<!-- <li class="breadcrumb-item"><a href="javascript: void(0);">Tables</a></li> <!-- <li class="breadcrumb-item"><a href="javascript: void(0);">Tables</a></li>
<li class="breadcrumb-item active">Datatables</li> --> <li class="breadcrumb-item active">Datatables</li> -->

View File

@ -6,7 +6,7 @@
<h4 class="page-title">Clilent List</h4> <h4 class="page-title">Clilent List</h4>
<div class="page-title-right"> <div class="page-title-right">
<ol class="breadcrumb m-0"> <ol class="breadcrumb m-0">
<li class=""> <a href="<?= base_url() . "new_client/0"; ?>" class="btn btn-primary waves-effect"> <i class="ri-add-line"></i></a> <li class=""> <a href="<?= base_url() . "new_client/0"; ?>" class="btn btn-primary waves-effect"> Add Client</a>
</li> </li>
</ol> </ol>

View File

@ -6,7 +6,7 @@
<h4 class="page-title">Complaints List</h4> <h4 class="page-title">Complaints List</h4>
<div class="page-title-right"> <div class="page-title-right">
<ol class="breadcrumb m-0"> <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)"> Add Complaint</a></li>
</ol> </ol>
</div> </div>
</div> </div>

View File

@ -158,17 +158,17 @@
<td style="border: 1px solid black;"> <td style="border: 1px solid black;">
<?= $serialNumber++; ?> <?= $serialNumber++; ?>
</td> </td>
<td style="border-right: 0.5px solid black;"><?= $item->product_name ?></td> <td style="border: 0.5px solid black;"><?= $item->product_name ?></td>
<td style="border-right: 0.5px solid black;"> <?php echo number_format($amountWithoutTax, 2, '.', ','); ?></td> <td style="border: 0.5px solid black;"> <?php echo number_format($amountWithoutTax, 2, '.', ','); ?></td>
<td style="border-right: 0.5px solid black;"><?= $item->qty ?></td> <td style="border: 0.5px solid black;"><?= $item->qty ?></td>
<td style="border-right: 0.5px solid black;"></td> <td style="border: 0.5px solid black;"></td>
<td style="border-right: 0.5px solid black;"><?= $item->tax ?>%</td> <td style="border: 0.5px solid black;"><?= $item->tax ?>%</td>
<td style="border-right: 0.5px solid black;"><?php echo $value_tax /2;?> <td style="border: 0.5px solid black;"><?php echo $value_tax /2;?>
</td> </td>
<td style="border-right: 0.5px solid black;"><?php echo $value_tax /2;?> <td style="border: 0.5px solid black;"><?php echo $value_tax /2;?>
</td> </td>
<td style="border: 0.5px solid black;"><?php echo $value_tax;?></td> <td style="border: 0.5px solid black;"><?php echo $value_tax;?></td>
<td style="border-right: 0.5px solid black;"><?= $item->amount ?></td> <td style="border: 0.5px solid black;"><?= $item->amount ?></td>
</tr> </tr>
<?php endforeach; ?> <?php endforeach; ?>
<tr> <tr>

View File

@ -240,15 +240,15 @@ p {
<?= $serialNumber++; ?> <?= $serialNumber++; ?>
</td> </td>
<td style="border-right: 0.5px solid black;"><?= $item['product_name'] ?></td> <td style="border: 0.5px solid black;"><?= $item['product_name'] ?></td>
<td style="border-right: 0.5px solid black;"><?php echo isset($item['custom_amount']) ? $item['custom_amount'] : $item['amount'] ?></td> <td style="border: 0.5px solid black;"><?php echo isset($item['custom_amount']) ? $item['custom_amount'] : $item['amount'] ?></td>
<td style="border-right: 0.5px solid black;"><?= $item['qty'] ?></td> <td style="border: 0.5px solid black;"><?= $item['qty'] ?></td>
<td style="border-right: 0.5px solid black;">nos</td> <td style="border: 0.5px solid black;">nos</td>
<td style="border-right: 0.5px solid black;"><?= $item['tax'] ?>%</td> <td style="border: 0.5px solid black;"><?= $item['tax'] ?>%</td>
<td style="border-right: 0.5px solid black;"><?php echo isset($item['custom_tax']) ? $item['custom_tax'] : ($item['amount'] * ($item['tax'] / 2) / 100) ?></td> <td style="border: 0.5px solid black;"><?php echo isset($item['custom_tax']) ? $item['custom_tax'] : ($item['amount'] * ($item['tax'] / 2) / 100) ?></td>
<td style="border-right: 0.5px solid black;"><?php echo isset($item['custom_tax']) ? $item['custom_tax'] : ($item['amount'] * ($item['tax'] / 2) / 100) ?></td> <td style="border: 0.5px solid black;"><?php echo isset($item['custom_tax']) ? $item['custom_tax'] : ($item['amount'] * ($item['tax'] / 2) / 100) ?></td>
<td style="border: 0.5px solid black;"><?php echo isset($item['custom_tax']) ? $item['custom_tax'] : ($item['amount'] * $item['tax'] / 100) ?></td> <td style="border: 0.5px solid black;"><?php echo isset($item['custom_tax']) ? $item['custom_tax'] : ($item['amount'] * $item['tax'] / 100) ?></td>
<td style="border-right: 0.5px solid black;"><?php echo isset($item['custom_total']) ? $item['custom_total'] : ($item['amount'] + ($item['amount'] * $item['tax'] / 100) ) ?></td> <td style="border: 0.5px solid black;"><?php echo isset($item['custom_total']) ? $item['custom_total'] : ($item['amount'] + ($item['amount'] * $item['tax'] / 100) ) ?></td>
</tr> </tr>
<?php endforeach; ?> <?php endforeach; ?>

View File

@ -29,7 +29,7 @@
<label for="inputEmail4" class="col-form-label">Vehicle<span class="text-danger">*</span></label> <label for="inputEmail4" class="col-form-label">Vehicle<span class="text-danger">*</span></label>
<?= isset($sales['vehicle_id']) ? '' : '<i type="button" class="fe-plus-circle" id="addVehicleModalButton" style="font-size: 18px;" data-toggle="modal" data-target="#addVehicleModal" title="Add Client"></i>' ?> <?= isset($sales['vehicle_id']) ? '' : '<i type="button" class="fe-plus-circle" id="addVehicleModalButton" style="font-size: 18px;" data-toggle="modal" data-target="#addVehicleModal" title="Add Client"></i>' ?>
<select class="form-control vehicle-select SelExample" name="vehicle_id" id="vehicle_name" <?= isset($sales['vehicle_id']) ? 'readonly' : 'required' ?>> <select class="form-control vehicle-select SelExample" name="vehicle_id" id="vehicle_name" <?= isset($sales['vehicle_id']) ? 'readonly' : 'required="true"' ?>>
<?= isset($sales['vehicle_id']) ? '' : '<option value="">Select a vehicle</option>' ?> <?= isset($sales['vehicle_id']) ? '' : '<option value="">Select a vehicle</option>' ?>
<?php foreach ($vehicle as $value) : ?> <?php foreach ($vehicle as $value) : ?>
@ -204,7 +204,7 @@
</button> </button>
</div> </div>
<div class="modal-body"> <div class="modal-body">
<form > <form id="job_card_add_vehicle">
<div class="form-row"> <div class="form-row">
<div class="form-group col-md-6"> <div class="form-group col-md-6">
<!-- <div class="form-group"> --> <!-- <div class="form-group"> -->
@ -648,11 +648,15 @@ $(document).ready(async function() {
$(document).ready(function() { $(document).ready(function() {
$('#submit-btn').click(function(event) { $('#submit-btn').click(function(event) {
// Prevent the default form submission var isValid = $('#form-submit')[0].checkValidity();
event.preventDefault();
data_contruction_for_save();
$("#delete_items").val(JSON.stringify(delete_items_id)); // event.preventDefault();
$('#form-submit').submit(); if (isValid) {
data_contruction_for_save();
$("#delete_items").val(JSON.stringify(delete_items_id));
$('#form-submit').submit();
}
}); });
}); });
@ -1243,45 +1247,69 @@ $(document).ready(async function() {
var ifStatementCondition = "createclientName !== '' && createclientMobile !== '' && createclientType !== '' && reg_no !== '' && model !== '' && make !== ''"; var ifStatementCondition = "createclientName !== '' && createclientMobile !== '' && createclientType !== '' && reg_no !== '' && model !== '' && make !== ''";
} }
console.log(ifStatementCondition);
if( eval(ifStatementCondition) ){ if (reg_no) {
$.ajax({
url: '<?= base_url("checkRegisterNo") ?>', // URL to your controller method for fetching models
type: 'POST',
dataType: 'json',
data: { register_number: reg_no },
success: function(response) {
if (response) {
$('#reg_no').val("");
toastr.warning("Register Number Already Added!");
}else{
if( eval(ifStatementCondition) ){
// Send AJAX request to save the client // Send AJAX request to save the client
$.ajax({ $.ajax({
url: '<?php echo base_url().'save_vehicle'?>', // URL to your save_client method url: '<?php echo base_url().'save_vehicle'?>', // URL to your save_client method
method: 'POST', method: 'POST',
data: { data: {
client_id: clientName, client_id: clientName,
mobile_no: clientMobile, mobile_no: clientMobile,
reg_no:reg_no, reg_no:reg_no,
model:model, model:model,
make:make, make:make,
createclientName:createclientName, createclientName:createclientName,
createclientMobile:createclientMobile, createclientMobile:createclientMobile,
createclientType:createclientType, createclientType:createclientType,
formType:formType, formType:formType,
}, },
success: function(response) { success: function(response) {
if (response.success) { if (response.success) {
$('#addVehicleModal').modal('hide'); $('#addVehicleModal').modal('hide');
toastr.success("Vehicle saved successfully!"); toastr.success("Vehicle saved successfully!");
window.location.reload(); window.location.reload();
} else {
toastr.warning("Failed to save vehicle. Please try again");
}
},
error: function(xhr, status, error) {
console.error('Error occurred while saving vehicle:', error);
toastr.warning("Failed to save vehicle. Please try again");
}
});
}else{
toastr.warning("Please Fill All Data");
}
}
},
error: function(xhr, status, error) {
console.error(error); // Log any errors to the console
}
});
} else {
toastr.warning("Failed to save vehicle. Please try again");
}
},
error: function(xhr, status, error) {
console.error('Error occurred while saving vehicle:', error);
toastr.warning("Failed to save vehicle. Please try again");
} }
});
}else{
toastr.warning("Please Fill All Data");
}
}); });

View File

@ -16,7 +16,7 @@
<h4 class="page-title">Job Card List</h4> <h4 class="page-title">Job Card List</h4>
<div class="page-title-right"> <div class="page-title-right">
<ol class="breadcrumb m-0"> <ol class="breadcrumb m-0">
<li class=""> <a href="<?= base_url() . "new_jobcard/0"; ?>" class="btn btn-primary waves-effect"> Add New<i class="ri-add-line"></i></a> <li class=""> <a href="<?= base_url() . "new_jobcard/0"; ?>" class="btn btn-primary waves-effect"> Add Job Card</a>
</li> </li>
</ol> </ol>

View File

@ -9,7 +9,7 @@
<ol class="breadcrumb m-0"> <ol class="breadcrumb m-0">
<li class=""> <li class="">
<a href="#" data-toggle="modal" data-target="#bike_make_login-modal" class="btn btn-primary waves-effect" onclick="clearDetials(this)"> <a href="#" data-toggle="modal" data-target="#bike_make_login-modal" class="btn btn-primary waves-effect" onclick="clearDetials(this)">
<i class="ri-add-line"></i> Add Make
</a> </a>
</li> </li>
</ol> </ol>
@ -217,14 +217,14 @@
row += '</td><td>'; row += '</td><td>';
// Check the isactive status and set the icon color accordingly // Check the isactive status and set the icon color accordingly
row += '<a data-toggle="modal" data-target="#bike_make_login-modal" data-value="'+ item.make_id +'" class="edit-button" onclick="editMake(this)"><i class="ri-pencil-line"></i></a>'; row += '<a data-toggle="modal" data-target="#bike_make_login-modal" data-value="'+ item.make_id +'" class="edit-button" onclick="editMake(this)"><i class="ri-pencil-line" style="font-size:20px;"></i></a>';
row +='<a href="#" data-toggle="modal" data-target="#bike_model_login-modal" style="margin-left: 12px;" class="add-button" title="Add" data-id="'+ item.make_id+'" data-value="' +item.make+'" onclick="setMakeName(this)"><i class="ri-add-line icon-large"></i></a>'; row +='<a href="#" data-toggle="modal" data-target="#bike_model_login-modal" style="margin-left: 12px;" class="add-button" title="Add" data-id="'+ item.make_id+'" data-value="' +item.make+'" onclick="setMakeName(this)"><i class="ri-add-line icon-large" style="font-size:20px;"></i></a>';
row +='<a href="bike_model_index/' +item.make_id+'" class="view-list-button" title="Model List" style="margin-left: 12px;"><i class="ri-list-check-2 icon-large"></i></a>'; row +='<a href="bike_model_index/' +item.make_id+'" class="view-list-button" title="Model List" style="margin-left: 12px;"><i class="ri-list-check-2 icon-large" style="font-size:20px;"></i></a>';
if (item.isactive == 1) { if (item.isactive == 1) {
row += '<a style="color:red; margin-left:12px;" data-id="' + item.make_id + '" data-isactive="' + item.isactive + '" title="Deactivate" onclick="statusChange(this)"><i class="fa fa-bicycle"></i><i class="fa fa-times" style="font-size: x-small;"></i></a>'; row += '<a style="color:red; margin-left:12px;" data-id="' + item.make_id + '" data-isactive="' + item.isactive + '" title="Deactivate" onclick="statusChange(this)"><i class="fa fa-bicycle" style="font-size:20px;"></i><i class="fa fa-times" style="font-size: x-small;" style="font-size:20px;"></i></a>';
} else if (item.isactive == 0) { } else if (item.isactive == 0) {
row += '<a style="color:green; margin-left:12px;" data-id="' + item.make_id + '" data-isactive="' + item.isactive + '" title="Activate" onclick="statusChange(this)"><i class="fa fa-bicycle"></i></a>'; row += '<a style="color:green; margin-left:12px;" data-id="' + item.make_id + '" data-isactive="' + item.isactive + '" title="Activate" onclick="statusChange(this)"><i class="fa fa-bicycle" style="font-size:20px;"></i></a>';
} }
row += '</td><td></td></tr>'; row += '</td><td></td></tr>';
@ -298,14 +298,14 @@
row += '</td><td>'; row += '</td><td>';
// Check the isactive status and set the icon color accordingly // Check the isactive status and set the icon color accordingly
row += '<a data-toggle="modal" data-target="#bike_make_login-modal" data-value="'+ item.make_id +'" class="edit-button" onclick="editMake(this)"><i class="ri-pencil-line"></i></a>'; row += '<a data-toggle="modal" data-target="#bike_make_login-modal" data-value="'+ item.make_id +'" class="edit-button" onclick="editMake(this)"><i class="ri-pencil-line" style="font-size:20px;"></i></a>';
row +='<a href="#" data-toggle="modal" data-target="#bike_model_login-modal" style="margin-left: 12px;" class="add-button" title="Add" data-id="'+ item.make_id+'" data-value="' +item.make+'" onclick="setMakeName(this)"><i class="ri-add-line icon-large"></i></a>'; row +='<a href="#" data-toggle="modal" data-target="#bike_model_login-modal" style="margin-left: 12px;" class="add-button" title="Add" data-id="'+ item.make_id+'" data-value="' +item.make+'" onclick="setMakeName(this)"><i class="ri-add-line icon-large" style="font-size:20px;"></i></a>';
row +='<a href="bike_model_index/' +item.make_id+'" class="view-list-button" title="Model List" style="margin-left: 12px;"><i class="ri-list-check-2 icon-large"></i></a>'; row +='<a href="bike_model_index/' +item.make_id+'" class="view-list-button" title="Model List" style="margin-left: 12px;"><i class="ri-list-check-2 icon-large" style="font-size:20px;"></i></a>';
if (item.isactive == 1) { if (item.isactive == 1) {
row += '<a style="color:red; margin-left:12px;" data-id="' + item.make_id + '" data-isactive="' + item.isactive + '" title="Deactivate" onclick="statusChange(this)"><i class="fa fa-bicycle"></i><i class="fa fa-times" style="font-size: x-small;"></i></a>'; row += '<a style="color:red; margin-left:12px;" data-id="' + item.make_id + '" data-isactive="' + item.isactive + '" title="Deactivate" onclick="statusChange(this)"><i class="fa fa-bicycle"></i><i class="fa fa-times" style="font-size: x-small;" style="font-size:20px;"></i></a>';
} else if (item.isactive == 0) { } else if (item.isactive == 0) {
row += '<a style="color:green; margin-left:12px;" data-id="' + item.make_id + '" data-isactive="' + item.isactive + '" title="Activate" onclick="statusChange(this)"><i class="fa fa-bicycle"></i></a>'; row += '<a style="color:green; margin-left:12px;" data-id="' + item.make_id + '" data-isactive="' + item.isactive + '" title="Activate" onclick="statusChange(this)"><i class="fa fa-bicycle" style="font-size:20px;"></i></a>';
} }
row += '</td><td></td></tr>'; row += '</td><td></td></tr>';

View File

@ -8,9 +8,7 @@
<div class="page-title-right"> <div class="page-title-right">
<ol class="breadcrumb m-0"> <ol class="breadcrumb m-0">
<li class=""> <li class="">
<a href="#" data-toggle="modal" data-target="#manufacturer_login-modal" class="btn btn-primary waves-effect" onclick="clearDetials(this)"> <a href="#" data-toggle="modal" data-target="#manufacturer_login-modal" class="btn btn-primary waves-effect" onclick="clearDetials(this)"> Add Manufacturer</a>
<i class="ri-add-line"></i>
</a>
</li> </li>
</ol> </ol>
</div> </div>
@ -36,10 +34,10 @@
<td class="manufacturer_name"><?php echo $item['manufacturer_name']; ?></td> <td class="manufacturer_name"><?php echo $item['manufacturer_name']; ?></td>
<td class="quality"><?php echo $item['quality']; ?></td> <td class="quality"><?php echo $item['quality']; ?></td>
<td> <td>
<a data-toggle="modal" data-target="#manufacturer_login-modal" data-value="<?php echo $item['manufacturer_id']; ?>" class="edit-button" onclick="editManufacturer(this)"><i class="ri-pencil-line"></i></a> <a data-toggle="modal" data-target="#manufacturer_login-modal" data-value="<?php echo $item['manufacturer_id']; ?>" class="edit-button" onclick="editManufacturer(this)"><i class="ri-pencil-line" style="font-size:20px;"></i></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<a href="<?= "product_index/" . $item['manufacturer_id']; ?>" class="view-list-button" title="Model List" style="margin-left: 16px;"> <a href="<?= "product_index/" . $item['manufacturer_id']; ?>" class="view-list-button" title="Model List" style="margin-left: 16px;">
<i class="ri-list-check-2 icon-large"></i> <i class="ri-list-check-2 icon-large" style="font-size:20px;"></i>
</a> </a>
</td> </td>
</tr> </tr>

View File

@ -7,7 +7,7 @@
<div class="page-title-right"> <div class="page-title-right">
<ol class="breadcrumb m-0"> <ol class="breadcrumb m-0">
<?php if(!$manufacturer_id) { ?> <?php if(!$manufacturer_id) { ?>
<li class=""> <a href="<?= base_url() . "new_product/0"; ?>" class="btn btn-primary waves-effect"> Add New<i class="ri-add-line"></i></a> <li class=""> <a href="<?= base_url() . "new_product/0"; ?>" class="btn btn-primary waves-effect"> Add Product</a>
</li> </li>
<?php } ?> <?php } ?>
</ol> </ol>
@ -32,7 +32,7 @@
<tr> <tr>
<th>SKU Id</th> <th>SKU Id</th>
<th>Product Name</th> <th>Product Name</th>
<th>Manufacturer Name</th> <!-- <th>Manufacturer Name</th> -->
<th>Category</th> <th>Category</th>
<th>Unit Price</th> <th>Unit Price</th>
<th>Qty in Stock</th> <th>Qty in Stock</th>
@ -48,7 +48,7 @@
<tr> <tr>
<td><?= $value['sku_id']; ?></td> <td><?= $value['sku_id']; ?></td>
<td><?= $value['product_name']; ?></td> <td><?= $value['product_name']; ?></td>
<td><?= $value['manufacturer_name']; ?></td>
<td><?= $value['product_category']; ?></td> <td><?= $value['product_category']; ?></td>
<td><?= number_format($value['unit_price']); ?></td> <td><?= number_format($value['unit_price']); ?></td>
<td><?= $value['qty_stock']; ?></td> <td><?= $value['qty_stock']; ?></td>
@ -58,9 +58,9 @@
<?php if(!$manufacturer_id) { ?> <?php if(!$manufacturer_id) { ?>
<td> <td>
<a href="<?= "new_product/" . $value['product_id']; ?>" class="edit-button"><i <a href="<?= "new_product/" . $value['product_id']; ?>" class="edit-button"><i
class="ri-pencil-line"></i></a> class="ri-pencil-line" style="font-size:20px;"></i></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<a href="<?= "delete_product/" . $value['product_id']; ?>" <a href="<?= "delete_product/" . $value['product_id']; ?>"
class="delete-button"><i class="ri-delete-bin-line"></i></a> class="delete-button"><i class="ri-delete-bin-line" style="font-size:20px;"></i></a>
</td> </td>
<?php } ?> <?php } ?>
<?php endif?> <?php endif?>

View File

@ -27,7 +27,7 @@
<h4 class="page-title">Purchase Order List </h4> <h4 class="page-title">Purchase Order List </h4>
<div class="page-title-right"> <div class="page-title-right">
<ol class="breadcrumb m-0"> <ol class="breadcrumb m-0">
<li class=""> <a href="<?= base_url() . "new_purchase/0"; ?>" class="btn btn-primary waves-effect"> Add New <i class="ri-add-line"></i></a> <li class=""> <a href="<?= base_url() . "new_purchase/0"; ?>" class="btn btn-primary waves-effect"> Add Purchase Order</a>
</li> </li>
</ol> </ol>
</div> </div>

View File

@ -27,7 +27,7 @@
<h4 class="page-title">Purchase Return List </h4> <h4 class="page-title">Purchase Return List </h4>
<div class="page-title-right"> <div class="page-title-right">
<ol class="breadcrumb m-0"> <ol class="breadcrumb m-0">
<li class=""> <a href="<?= base_url() . "return_order_index"; ?>" class="btn btn-primary waves-effect"> Add New <i class="ri-add-line"></i></a> <li class=""> <a href="<?= base_url() . "return_order_index"; ?>" class="btn btn-primary waves-effect"> Add Purchase Return</a>
</li> </li>
</ol> </ol>
</div> </div>

View File

@ -28,7 +28,7 @@
<h4 class="page-title">Sales Order List</h4> <h4 class="page-title">Sales Order List</h4>
<div class="page-title-right"> <div class="page-title-right">
<ol class="breadcrumb m-0"> <ol class="breadcrumb m-0">
<li class=""> <a href="<?= base_url() . "new_sale/0"; ?>" class="btn btn-primary waves-effect"> Add New <i class="ri-add-line"></i></a> <li class=""> <a href="<?= base_url() . "new_sale/0"; ?>" class="btn btn-primary waves-effect"> Add Sale Order </a>
</li> </li>
</ol> </ol>

View File

@ -30,7 +30,7 @@
<?= isset($sales['vehicle_id']) ? '' : '<i type="button" class="fe-plus-circle" id="addVehicleModalButton" style="font-size: 18px;" data-toggle="modal" data-target="#addVehicleModal" title="Add Client"></i>' ?> <?= isset($sales['vehicle_id']) ? '' : '<i type="button" class="fe-plus-circle" id="addVehicleModalButton" style="font-size: 18px;" data-toggle="modal" data-target="#addVehicleModal" title="Add Client"></i>' ?>
<select class="form-control vehicle-select SelExample" name="vehicle_id" id="vehicle_id" <select class="form-control vehicle-select SelExample" name="vehicle_id" id="vehicle_id"
<?= isset($sales['vehicle_id']) ? 'disabled' : 'required' ?>> <?= isset($sales['vehicle_id']) ? 'disabled' : 'required="true"' ?>>
<?= isset($sales['vehicle_id']) ? '' : '<option value="">Select a vehicle</option>' ?> <?= isset($sales['vehicle_id']) ? '' : '<option value="">Select a vehicle</option>' ?>
<?php foreach ($vehicle as $value) : ?> <?php foreach ($vehicle as $value) : ?>
@ -76,7 +76,7 @@
<?php else: ?> <?php else: ?>
<option>Select Status</option> <option value>Select Status</option>
<option value="Paid" <?= $sales['status'] === 'Paid' ? 'selected' : '' ?>>Paid</option> <option value="Paid" <?= $sales['status'] === 'Paid' ? 'selected' : '' ?>>Paid</option>
<option value="Cancelled" <?= $sales['status'] === 'Cancelled' ? 'selected' : '' ?>>Cancelled</option> <option value="Cancelled" <?= $sales['status'] === 'Cancelled' ? 'selected' : '' ?>>Cancelled</option>
@ -802,45 +802,66 @@ $(document).ready(function() {
console.log(ifStatementCondition); console.log(ifStatementCondition);
if (eval(ifStatementCondition)) { if (reg_no) {
// Send AJAX request to save the client
$.ajax({ $.ajax({
url: '<?php echo base_url().'save_vehicle'?>', // URL to your save_client method url: '<?= base_url("checkRegisterNo") ?>', // URL to your controller method for fetching models
method: 'POST', type: 'POST',
data: { dataType: 'json',
client_id: clientName, data: { register_number: reg_no },
mobile_no: clientMobile,
reg_no: reg_no,
model: model,
make: make,
createclientName: createclientName,
createclientMobile: createclientMobile,
createclientType: createclientType,
formType: formType,
},
success: function(response) { success: function(response) {
if (response.success) { if (response) {
$('#addVehicleModal').modal('hide'); $('#reg_no').val("");
toastr.success("Vehicle saved successfully!"); toastr.warning("Register Number Already Added!");
window.location.reload(); }else{
if (eval(ifStatementCondition)) {
// Send AJAX request to save the client
$.ajax({
url: '<?php echo base_url().'save_vehicle'?>', // URL to your save_client method
method: 'POST',
data: {
client_id: clientName,
mobile_no: clientMobile,
reg_no: reg_no,
model: model,
make: make,
createclientName: createclientName,
createclientMobile: createclientMobile,
createclientType: createclientType,
formType: formType,
},
success: function(response) {
if (response.success) {
$('#addVehicleModal').modal('hide');
toastr.success("Vehicle saved successfully!");
window.location.reload();
} else {
toastr.warning("Failed to save vehicle. Please try again");
}
},
error: function(xhr, status, error) {
console.error('Error occurred while saving vehicle:', error);
toastr.warning("Failed to save vehicle. Please try again");
}
});
} else {
toastr.warning("Please Fill All Data");
}
} else {
toastr.warning("Failed to save vehicle. Please try again");
} }
}, },
error: function(xhr, status, error) { error: function(xhr, status, error) {
console.error('Error occurred while saving vehicle:', error); console.error(error); // Log any errors to the console
toastr.warning("Failed to save vehicle. Please try again");
} }
}); });
} else {
toastr.warning("Please Fill All Data");
} }
}); });
}); });
</script> </script>

View File

@ -6,7 +6,7 @@
<h4 class="page-title">Service List</h4> <h4 class="page-title">Service List</h4>
<div class="page-title-right"> <div class="page-title-right">
<ol class="breadcrumb m-0"> <ol class="breadcrumb m-0">
<li class=""> <a href="<?= base_url() . "new_service/0"; ?>" class="btn btn-primary waves-effect"> <i class="ri-add-line"></i></a> <li class=""> <a href="<?= base_url() . "new_service/0"; ?>" class="btn btn-primary waves-effect">Add Service</a>
</li> </li>
</ol> </ol>
</div> </div>
@ -45,10 +45,10 @@
<td><?= $value['description']; ?></td> <td><?= $value['description']; ?></td>
<td> <td>
<a href="<?= "new_service/" . $value['service_id']; ?>" class="edit-button"> <a href="<?= "new_service/" . $value['service_id']; ?>" class="edit-button">
<i class="ri-pencil-line"></i> <i class="ri-pencil-line" style="font-size:20px;"></i>
</a> </a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<a href="<?= "delete_service/" . $value['service_id']; ?>" class="delete-button"> <a href="<?= "delete_service/" . $value['service_id']; ?>" class="delete-button">
<i class="ri-delete-bin-line"></i> <i class="ri-delete-bin-line" style="font-size:20px;"></i>
</a> </a>
</td> </td>
</tr> </tr>

View File

@ -7,7 +7,7 @@
<div class="page-title-right"> <div class="page-title-right">
<ol class="breadcrumb m-0"> <ol class="breadcrumb m-0">
<li class=""> <li class="">
<a href="<?= base_url() . "new_user/0"; ?>" class="btn btn-primary waves-effect" > <i class="ri-add-line"></i></a></li> <a href="<?= base_url() . "new_user/0"; ?>" class="btn btn-primary waves-effect" >Add User</a></li>
<!-- <li class="breadcrumb-item"><a href="javascript: void(0);">Tables</a></li> <!-- <li class="breadcrumb-item"><a href="javascript: void(0);">Tables</a></li>
<li class="breadcrumb-item active">Datatables</li> --> <li class="breadcrumb-item active">Datatables</li> -->
</ol> </ol>

View File

@ -40,8 +40,8 @@
<td><?= $value['mobile_no']; ?></td> <td><?= $value['mobile_no']; ?></td>
<td><?= $roleModel->getRoleNameById($value['role']); ?></td> <!-- Call the model method --> <td><?= $roleModel->getRoleNameById($value['role']); ?></td> <!-- Call the model method -->
<td> <td>
<a href="<?= base_url("edit_user_super_admin/" . $value['user_id']) ?>" class="edit-button"><i class="ri-pencil-line"></i></a> <a href="<?= base_url("edit_user_super_admin/" . $value['user_id']) ?>" class="edit-button"><i class="ri-pencil-line" style="font-size:20px;"></i></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<a href="<?= "delete_user/" . $value['user_id']; ?>" class="delete-button"><i class="ri-delete-bin-line"></i></a> <a href="<?= "delete_user/" . $value['user_id']; ?>" class="delete-button"><i class="ri-delete-bin-line" style="font-size:20px;"></i></a>
</td> </td>
<?php endif?> <?php endif?>

View File

@ -18,7 +18,7 @@
<div class="card"> <div class="card">
<div class="card-body"> <div class="card-body">
<form action="<?= base_url() . "add_vehicle"; ?>" method="post"> <form id="vehicle_add_form_id" action="<?= base_url() . "add_vehicle"; ?>" method="post">
<h4 class="header-title">Vehicle Details :</h4> <h4 class="header-title">Vehicle Details :</h4>
<div class="form-row"> <div class="form-row">
@ -112,7 +112,7 @@
</div> </div>
</div> </div>
<button type="submit" class="btn btn-primary">Submit</button> <button id="form_submit_button" type="submit" class="btn btn-primary">Submit</button>
</div> </div>
</form> </form>
</div> </div>
@ -440,6 +440,42 @@ $('#saveModelBtn').click(function() {
} }
}); });
</script> </script>
<script>
$('#form_submit_button').click(function () {
// var isValid = $('#vehicle_add_form_id')[0].checkValidity();
var register_number = $('#regno').val();
if (register_number) {
$.ajax({
url: '<?= base_url("checkRegisterNo") ?>', // URL to your controller method for fetching models
type: 'POST',
dataType: 'json',
data: { register_number: register_number },
success: function(response) {
if (response) {
$('#regno').val("");
toastr.warning("Register Number Already Added!");
}
},
error: function(xhr, status, error) {
console.error(error); // Log any errors to the console
}
});
}
})
</script>
<style> <style>
.select2-container--default .select2-results__option--highlighted[aria-selected]{ .select2-container--default .select2-results__option--highlighted[aria-selected]{
color:#ffffff; color:#ffffff;

View File

@ -6,7 +6,7 @@
<h4 class="page-title">Vehicle List</h4> <h4 class="page-title">Vehicle List</h4>
<div class="page-title-right"> <div class="page-title-right">
<ol class="breadcrumb m-0"> <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"> Add Vehicle</a></li>
</ol> </ol>
</div> </div>
</div> </div>

View File

@ -7,7 +7,7 @@
<div class="page-title-right"> <div class="page-title-right">
<ol class="breadcrumb m-0"> <ol class="breadcrumb m-0">
<li class=""> <li class="">
<a href="<?= base_url() . "new_vendor/0"; ?>" class="btn btn-primary waves-effect" > <i class="ri-add-line"></i></a></li> <a href="<?= base_url() . "new_vendor/0"; ?>" class="btn btn-primary waves-effect" > Add Vendor</a></li>
<!-- <li class="breadcrumb-item"><a href="javascript: void(0);">Tables</a></li> <!-- <li class="breadcrumb-item"><a href="javascript: void(0);">Tables</a></li>
<li class="breadcrumb-item active">Datatables</li> --> <li class="breadcrumb-item active">Datatables</li> -->
</ol> </ol>
@ -49,8 +49,8 @@
<td><?= $value['contact_person_mobile1']; ?></td> <td><?= $value['contact_person_mobile1']; ?></td>
<td><?= $value['category']; ?></td> <!-- Call the model method --> <td><?= $value['category']; ?></td> <!-- Call the model method -->
<td> <td>
<a href="<?= "new_vendor/" . $value['vendor_id']; ?>" class="edit-button"><i class="ri-pencil-line"></i></a> <a href="<?= "new_vendor/" . $value['vendor_id']; ?>" class="edit-button"><i class="ri-pencil-line" style="font-size:20px;"></i></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<a href="<?= "delete_vendor/" . $value['vendor_id']; ?>" class="delete-button"><i class="ri-delete-bin-line"></i></a> <a href="<?= "delete_vendor/" . $value['vendor_id']; ?>" class="delete-button"><i class="ri-delete-bin-line" style="font-size:20px;"></i></a>
</td> </td>
<?php endif?> <?php endif?>