@@ -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: '', // 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: '', // 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");
- }
});
diff --git a/app/Views/jobs_list.php b/app/Views/jobs_list.php
index f7b065f..75f7d46 100644
--- a/app/Views/jobs_list.php
+++ b/app/Views/jobs_list.php
@@ -16,7 +16,7 @@
- - " class="btn btn-primary waves-effect"> Add New
+
- " class="btn btn-primary waves-effect"> Add Job Card
diff --git a/app/Views/make_list.php b/app/Views/make_list.php
index df79eda..0ff4d76 100644
--- a/app/Views/make_list.php
+++ b/app/Views/make_list.php
@@ -9,7 +9,7 @@
-
-
+ Add Make
@@ -217,14 +217,14 @@
row += '
';
// Check the isactive status and set the icon color accordingly
- row += '';
+ row += '';
- row +='';
- row +='';
+ row +='';
+ row +='';
if (item.isactive == 1) {
- row += '';
+ row += '';
} else if (item.isactive == 0) {
- row += '';
+ row += '';
}
row += ' | | ';
@@ -298,14 +298,14 @@
row += '
';
// Check the isactive status and set the icon color accordingly
- row += '';
+ row += '';
- row +='';
- row +='';
+ row +='';
+ row +='';
if (item.isactive == 1) {
- row += '';
+ row += '';
} else if (item.isactive == 0) {
- row += '';
+ row += '';
}
row += ' | | ';
diff --git a/app/Views/manufacturer_list.php b/app/Views/manufacturer_list.php
index b594ed7..6bf2244 100644
--- a/app/Views/manufacturer_list.php
+++ b/app/Views/manufacturer_list.php
@@ -8,9 +8,7 @@
@@ -36,10 +34,10 @@
|
|
-
+
" class="view-list-button" title="Model List" style="margin-left: 16px;">
-
+
|
diff --git a/app/Views/product_list.php b/app/Views/product_list.php
index e681c3f..39d5324 100644
--- a/app/Views/product_list.php
+++ b/app/Views/product_list.php
@@ -7,7 +7,7 @@
- - " class="btn btn-primary waves-effect"> Add New
+
- " class="btn btn-primary waves-effect"> Add Product
@@ -32,7 +32,7 @@
| SKU Id |
Product Name |
- Manufacturer Name |
+
Category |
Unit Price |
Qty in Stock |
@@ -48,7 +48,7 @@
| = $value['sku_id']; ?> |
= $value['product_name']; ?> |
- = $value['manufacturer_name']; ?> |
+
= $value['product_category']; ?> |
= number_format($value['unit_price']); ?> |
= $value['qty_stock']; ?> |
@@ -58,9 +58,9 @@
" class="edit-button">
+ class="ri-pencil-line" style="font-size:20px;">
"
- class="delete-button">
+ class="delete-button">
|
diff --git a/app/Views/purchase_list.php b/app/Views/purchase_list.php
index 66f0dad..292a227 100644
--- a/app/Views/purchase_list.php
+++ b/app/Views/purchase_list.php
@@ -27,7 +27,7 @@
Purchase Order List
diff --git a/app/Views/return_list.php b/app/Views/return_list.php
index 3b6e683..6094a1a 100644
--- a/app/Views/return_list.php
+++ b/app/Views/return_list.php
@@ -27,7 +27,7 @@
Purchase Return List
diff --git a/app/Views/sales_list.php b/app/Views/sales_list.php
index d1a1d63..5a68dbc 100644
--- a/app/Views/sales_list.php
+++ b/app/Views/sales_list.php
@@ -28,7 +28,7 @@
Sales Order List
- - " class="btn btn-primary waves-effect"> Add New
+
- " class="btn btn-primary waves-effect"> Add Sale Order
diff --git a/app/Views/sales_order_form.php b/app/Views/sales_order_form.php
index b2463fa..78f858a 100644
--- a/app/Views/sales_order_form.php
+++ b/app/Views/sales_order_form.php
@@ -30,7 +30,7 @@
= isset($sales['vehicle_id']) ? '' : '
' ?>
diff --git a/app/Views/user_list.php b/app/Views/user_list.php
index 5cd3557..736d81f 100644
--- a/app/Views/user_list.php
+++ b/app/Views/user_list.php
@@ -7,7 +7,7 @@
-
- " class="btn btn-primary waves-effect" >
+ " class="btn btn-primary waves-effect" >Add User
diff --git a/app/Views/user_list_super_admin.php b/app/Views/user_list_super_admin.php
index 2fb3149..fed0fb4 100644
--- a/app/Views/user_list_super_admin.php
+++ b/app/Views/user_list_super_admin.php
@@ -40,8 +40,8 @@
= $value['mobile_no']; ?> |
= $roleModel->getRoleNameById($value['role']); ?> |
- " class="edit-button">
- " class="delete-button">
+ " class="edit-button">
+ " class="delete-button">
|
diff --git a/app/Views/vehicle_form.php b/app/Views/vehicle_form.php
index fed7418..5fc5f7d 100644
--- a/app/Views/vehicle_form.php
+++ b/app/Views/vehicle_form.php
@@ -18,7 +18,7 @@
@@ -440,6 +440,42 @@ $('#saveModelBtn').click(function() {
}
});
+
+
+
+
+