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("delete_vehicle/(:any)", "Vehicle::delete_vehicle/$1");
$routes->post("get_models_vehicle", "Vehicle::get_models");
$routes->post("checkRegisterNo", "Vehicle::checkRegisterNo");
//end Vehicle

View File

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

View File

@ -152,5 +152,18 @@ class Vehicle extends BaseController
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">
<li class="">
<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>
</li>
</ol>

View File

@ -7,7 +7,7 @@
<div class="page-title-right">
<ol class="breadcrumb m-0">
<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>
</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>
<div class="page-title-right">
<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 class="breadcrumb-item"><a href="javascript: void(0);">Tables</a></li>
<li class="breadcrumb-item active">Datatables</li> -->

View File

@ -6,7 +6,7 @@
<h4 class="page-title">Clilent List</h4>
<div class="page-title-right">
<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>
</ol>

View File

@ -6,7 +6,7 @@
<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)"> Add Complaint</a></li>
</ol>
</div>
</div>

View File

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

View File

@ -240,15 +240,15 @@ p {
<?= $serialNumber++; ?>
</td>
<td style="border-right: 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-right: 0.5px solid black;"><?= $item['qty'] ?></td>
<td style="border-right: 0.5px solid black;">nos</td>
<td style="border-right: 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-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;"><?= $item['product_name'] ?></td>
<td style="border: 0.5px solid black;"><?php echo isset($item['custom_amount']) ? $item['custom_amount'] : $item['amount'] ?></td>
<td style="border: 0.5px solid black;"><?= $item['qty'] ?></td>
<td style="border: 0.5px solid black;">nos</td>
<td style="border: 0.5px solid black;"><?= $item['tax'] ?>%</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'] / 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-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>
<?php endforeach; ?>

View File

@ -29,7 +29,7 @@
<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>' ?>
<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>' ?>
<?php foreach ($vehicle as $value) : ?>
@ -204,7 +204,7 @@
</button>
</div>
<div class="modal-body">
<form >
<form id="job_card_add_vehicle">
<div class="form-row">
<div class="form-group col-md-6">
<!-- <div class="form-group"> -->
@ -648,11 +648,15 @@ $(document).ready(async function() {
$(document).ready(function() {
$('#submit-btn').click(function(event) {
// Prevent the default form submission
event.preventDefault();
data_contruction_for_save();
$("#delete_items").val(JSON.stringify(delete_items_id));
$('#form-submit').submit();
var isValid = $('#form-submit')[0].checkValidity();
// event.preventDefault();
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 !== ''";
}
console.log(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
$.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");
}
}
},
error: function(xhr, status, error) {
console.error(error); // Log any errors to the console
}
});
}
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");
}
});

View File

@ -16,7 +16,7 @@
<h4 class="page-title">Job Card List</h4>
<div class="page-title-right">
<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>
</ol>

View File

@ -9,7 +9,7 @@
<ol class="breadcrumb m-0">
<li class="">
<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>
</li>
</ol>
@ -217,14 +217,14 @@
row += '</td><td>';
// 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="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="#" 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" style="font-size:20px;"></i></a>';
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) {
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>';
@ -298,14 +298,14 @@
row += '</td><td>';
// 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="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="#" 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" style="font-size:20px;"></i></a>';
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) {
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>';

View File

@ -8,9 +8,7 @@
<div class="page-title-right">
<ol class="breadcrumb m-0">
<li class="">
<a href="#" data-toggle="modal" data-target="#manufacturer_login-modal" class="btn btn-primary waves-effect" onclick="clearDetials(this)">
<i class="ri-add-line"></i>
</a>
<a href="#" data-toggle="modal" data-target="#manufacturer_login-modal" class="btn btn-primary waves-effect" onclick="clearDetials(this)"> Add Manufacturer</a>
</li>
</ol>
</div>
@ -36,10 +34,10 @@
<td class="manufacturer_name"><?php echo $item['manufacturer_name']; ?></td>
<td class="quality"><?php echo $item['quality']; ?></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;">
<i class="ri-list-check-2 icon-large"></i>
<i class="ri-list-check-2 icon-large" style="font-size:20px;"></i>
</a>
</td>
</tr>

View File

@ -7,7 +7,7 @@
<div class="page-title-right">
<ol class="breadcrumb m-0">
<?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>
<?php } ?>
</ol>
@ -32,7 +32,7 @@
<tr>
<th>SKU Id</th>
<th>Product Name</th>
<th>Manufacturer Name</th>
<!-- <th>Manufacturer Name</th> -->
<th>Category</th>
<th>Unit Price</th>
<th>Qty in Stock</th>
@ -48,7 +48,7 @@
<tr>
<td><?= $value['sku_id']; ?></td>
<td><?= $value['product_name']; ?></td>
<td><?= $value['manufacturer_name']; ?></td>
<td><?= $value['product_category']; ?></td>
<td><?= number_format($value['unit_price']); ?></td>
<td><?= $value['qty_stock']; ?></td>
@ -58,9 +58,9 @@
<?php if(!$manufacturer_id) { ?>
<td>
<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']; ?>"
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>
<?php } ?>
<?php endif?>

View File

@ -27,7 +27,7 @@
<h4 class="page-title">Purchase Order List </h4>
<div class="page-title-right">
<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>
</ol>
</div>

View File

@ -27,7 +27,7 @@
<h4 class="page-title">Purchase Return List </h4>
<div class="page-title-right">
<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>
</ol>
</div>

View File

@ -28,7 +28,7 @@
<h4 class="page-title">Sales Order List</h4>
<div class="page-title-right">
<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>
</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>' ?>
<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>' ?>
<?php foreach ($vehicle as $value) : ?>
@ -76,7 +76,7 @@
<?php else: ?>
<option>Select Status</option>
<option value>Select Status</option>
<option value="Paid" <?= $sales['status'] === 'Paid' ? 'selected' : '' ?>>Paid</option>
<option value="Cancelled" <?= $sales['status'] === 'Cancelled' ? 'selected' : '' ?>>Cancelled</option>
@ -802,44 +802,65 @@ $(document).ready(function() {
console.log(ifStatementCondition);
if (eval(ifStatementCondition)) {
// Send AJAX request to save the client
if (reg_no) {
$.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,
},
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.success) {
$('#addVehicleModal').modal('hide');
toastr.success("Vehicle saved successfully!");
window.location.reload();
if (response) {
$('#reg_no').val("");
toastr.warning("Register Number Already Added!");
}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) {
console.error('Error occurred while saving vehicle:', error);
toastr.warning("Failed to save vehicle. Please try again");
console.error(error); // Log any errors to the console
}
});
} else {
toastr.warning("Please Fill All Data");
}
});
});

View File

@ -6,7 +6,7 @@
<h4 class="page-title">Service List</h4>
<div class="page-title-right">
<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>
</ol>
</div>
@ -45,10 +45,10 @@
<td><?= $value['description']; ?></td>
<td>
<a href="<?= "new_service/" . $value['service_id']; ?>" class="edit-button">
<i class="ri-pencil-line"></i>
</a>
<i class="ri-pencil-line" style="font-size:20px;"></i>
</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<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>
</td>
</tr>

View File

@ -7,7 +7,7 @@
<div class="page-title-right">
<ol class="breadcrumb m-0">
<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 active">Datatables</li> -->
</ol>

View File

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

View File

@ -18,7 +18,7 @@
<div class="card">
<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>
<div class="form-row">
@ -112,7 +112,7 @@
</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>
</form>
</div>
@ -440,6 +440,42 @@ $('#saveModelBtn').click(function() {
}
});
</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>
.select2-container--default .select2-results__option--highlighted[aria-selected]{
color:#ffffff;

View File

@ -6,7 +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"> Add Vehicle</a></li>
</ol>
</div>
</div>

View File

@ -7,7 +7,7 @@
<div class="page-title-right">
<ol class="breadcrumb m-0">
<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 active">Datatables</li> -->
</ol>
@ -49,8 +49,8 @@
<td><?= $value['contact_person_mobile1']; ?></td>
<td><?= $value['category']; ?></td> <!-- Call the model method -->
<td>
<a href="<?= "new_vendor/" . $value['vendor_id']; ?>" class="edit-button"><i class="ri-pencil-line"></i></a>
<a href="<?= "delete_vendor/" . $value['vendor_id']; ?>" class="delete-button"><i class="ri-delete-bin-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" style="font-size:20px;"></i></a>
</td>
<?php endif?>