From 042e32839d6c5fb37b33cea4c9cfe2a447439d3e Mon Sep 17 00:00:00 2001 From: vadivelJ96 Date: Wed, 25 Dec 2024 13:16:07 +0530 Subject: [PATCH 1/8] stock module-3 vadivel J 25-12-2024 --- app/Views/CoatingMachineDetail.php | 433 ++++++++++++++++++++--------- 1 file changed, 299 insertions(+), 134 deletions(-) diff --git a/app/Views/CoatingMachineDetail.php b/app/Views/CoatingMachineDetail.php index be3771dc..95647f77 100644 --- a/app/Views/CoatingMachineDetail.php +++ b/app/Views/CoatingMachineDetail.php @@ -1,9 +1,22 @@ -
@@ -186,10 +198,17 @@
- +
+ + +
+ @@ -209,27 +228,27 @@
-
+
-
-
+
+
- - + + + + +
+ +
+ +
-
- -
- -
- -
- +
@@ -258,18 +277,19 @@ if (!empty($coatingMachineDetails)) { foreach ($coatingMachineDetails as $record) { - ?> + ?> format('d-m-Y'); - if ($dateInMonthDmYFormat === $currentDate) { echo 'style="background: #cef0ad;"';} - ?> - > + $dateInMonthDmYFormat = DateTime::createFromFormat('Y-m-d', $record['date'])->format('d-m-Y'); + if ($dateInMonthDmYFormat === $currentDate) { + echo 'style="background: #cef0ad;"'; + } + ?>> - format('d-m-Y'); - ?> + format('d-m-Y'); + ?> @@ -286,16 +306,16 @@ -     - -     @@ -305,7 +325,7 @@ - @@ -316,20 +336,20 @@
- -
- No Coating Machine Details present in this month -
- + +
+ No Coating Machine Details present in this month +
+ - - - - + + + - - + + + @@ -350,7 +370,7 @@ - + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
logoresico name
one one
one one
one one
one one
Production Batch Card
Customer NameDR Axion India Pvt.Ltd (PCS ROUGH) P.Batch NoMI | 12 | 19 | C
Date19/12/2024ShiftIIIBatch No123
OperatorKUMARANHelpersMURUGESAN
S.NoSandResin SolidHexamineWaterCatalyst Calcium StearatResin Mixing TimeHexamine Mixing TimeCatalyst Mixing TimeTS
SPEC200KG-300KG3KG-6KG450G-900G900G-1800G150G-300G60-120 SEC60-120 SEC180-300 SEC50-60 KG/CM2
13005.0007.301500230606018054.2
23005.0007.301500230606018052.4
+ +
+
+ + +
+
+
- + + + + + + + + + + + + + + + + @@ -702,20 +872,22 @@ function confirmDelete(event) { let result = confirm(` Do you Confirm to Delete the Coating Machine Detail?`); - if (result) { return result; } else { event.preventDefault(); } + if (result) { + return result; + } else { + event.preventDefault(); + } } - - @@ -723,16 +895,16 @@ \ No newline at end of file From f73a49bb4b6a1bdf27958252c9eb273170d2681e Mon Sep 17 00:00:00 2001 From: vadivelJ96 Date: Wed, 25 Dec 2024 19:46:18 +0530 Subject: [PATCH 2/8] stock module-2 vadivel J 25-12-2024 --- app/Controllers/Assetdetails.php | 3 +++ app/Controllers/CostCenter.php | 2 ++ app/Controllers/Supplier.php | 1 + app/Models/Assetdetails_model.php | 2 +- app/Models/Costcenter_model.php | 6 +++--- app/Views/addRawMaterial.php | 2 +- app/Views/addSupplier.php | 2 +- app/Views/addasset.php | 2 +- app/Views/addconfig.php | 2 +- app/Views/costListing.php | 2 +- app/Views/editOldasset.php | 2 +- app/Views/editRawmaterial.php | 2 +- app/Views/editSupplier.php | 2 +- app/Views/editconfig.php | 2 +- app/Views/transporterListing.php | 2 +- 15 files changed, 20 insertions(+), 14 deletions(-) diff --git a/app/Controllers/Assetdetails.php b/app/Controllers/Assetdetails.php index ddd3a208..d1b2977a 100755 --- a/app/Controllers/Assetdetails.php +++ b/app/Controllers/Assetdetails.php @@ -346,9 +346,12 @@ class Assetdetails extends BaseController function checkAssetName(){ $data = $this->request->getPost(); + $assetId = $data['assetId']??''; $assetName = str_replace(" ","",$data['assetName']) ; + $result = $this->assetdetails_model->checkAssetName($assetId,$assetName); + return $this->response->setJSON($result); } diff --git a/app/Controllers/CostCenter.php b/app/Controllers/CostCenter.php index c5825f51..d23a4a2d 100755 --- a/app/Controllers/CostCenter.php +++ b/app/Controllers/CostCenter.php @@ -140,6 +140,8 @@ class CostCenter extends BaseController $CostCenterId = $data['CostCenterId']; $CostCenterName = $data['CostCenterName']; + $CostCenterName = str_replace(' ', '', $CostCenterName); + $result = $this->costcenter_model->checkCostCenter( $CostCenterId,$CostCenterName); return $this->response->setJSON($result); diff --git a/app/Controllers/Supplier.php b/app/Controllers/Supplier.php index 2e0a5441..2dc8337f 100755 --- a/app/Controllers/Supplier.php +++ b/app/Controllers/Supplier.php @@ -478,6 +478,7 @@ class Supplier extends BaseController $data = $this->request->getPost(); $transporterId = $data['transporterid']??''; $transporterName = $data['transportername']; + $transporterName = str_replace(' ', '', $transporterName); $message = $this->supplier_model->checkTransporter($transporterId,$transporterName); return $this->response->setJSON($message); diff --git a/app/Models/Assetdetails_model.php b/app/Models/Assetdetails_model.php index 4cd4dee9..db2b81cf 100755 --- a/app/Models/Assetdetails_model.php +++ b/app/Models/Assetdetails_model.php @@ -278,7 +278,7 @@ class Assetdetails_model extends Model $builder = $builder->where('AssetCode !=', $assetId); } - $builder = $builder->where('REPLACE(AssetName , " ", "") ',$assetName); + $builder = $builder->where('REPLACE(AssetName, " ", "")',$assetName); $query = $builder->get(); diff --git a/app/Models/Costcenter_model.php b/app/Models/Costcenter_model.php index c23a0f47..01c6d783 100755 --- a/app/Models/Costcenter_model.php +++ b/app/Models/Costcenter_model.php @@ -429,18 +429,18 @@ where Dept.DEPCode not in return "Cost center $CostCenterCode deactivated successfully."; } - function checkCostCenter($CostCenterId,$CostCenterName){ + function checkCostCenter($CostCenterId,$CostCenterName){ $builder = $this->db->table('t_costcenter_master') ->select('CostCenterName,IsActive'); if(!empty($CostCenterId)){ $builder = $builder -> where('id !=' ,$CostCenterId); } - $builder = $builder->where('REPLACE(CostCenterName , " ", "") ',$CostCenterName); + $builder = $builder->where('REPLACE(CostCenterName," ", "")',$CostCenterName); $query = $builder->get(); return $query->getResult(); - + } diff --git a/app/Views/addRawMaterial.php b/app/Views/addRawMaterial.php index 89c0ed44..bce148fe 100755 --- a/app/Views/addRawMaterial.php +++ b/app/Views/addRawMaterial.php @@ -314,7 +314,7 @@ var count = data.length; if (count >= 1) { $('#loader').hide(); - if(data[0].IsActive == 1){ + if(data[0]?.IsActive == 1){ alert('Material name already existed ! '); }else{ alert('Material name already existing in the deleted section.!!'); diff --git a/app/Views/addSupplier.php b/app/Views/addSupplier.php index 077ebcf9..70d0f87d 100755 --- a/app/Views/addSupplier.php +++ b/app/Views/addSupplier.php @@ -274,7 +274,7 @@ var count = data?data.length:0; if (count >= 1) { $('#loader').hide(); - if(data[0].IsActive == 1){ + if(data[0]?.IsActive == 1){ alert('supplier already existed ! '); }else{ alert('supplier already existing in the deleted section..!! '); diff --git a/app/Views/addasset.php b/app/Views/addasset.php index 5a6c2770..2736f2cf 100755 --- a/app/Views/addasset.php +++ b/app/Views/addasset.php @@ -444,7 +444,7 @@ $.ajax({ data:{assetId,assetName}, success: function(data){ if(data && data.length>0){ - let IsActive = data[0].IsActive; + let IsActive = data[0]?.IsActive; if(IsActive == 1){ alert("Asset Name Exists..!!"); $('#AssetName').val(''); diff --git a/app/Views/addconfig.php b/app/Views/addconfig.php index b61ae06f..81a5f4e6 100755 --- a/app/Views/addconfig.php +++ b/app/Views/addconfig.php @@ -399,7 +399,7 @@ success: function (data) { if(data && data.length > 0){ - if(data[0].isActive == 1){ + if(data[0]?.isActive == 1){ alert("This Configuration Name is already present. kindly change it..!!"); $('#configurationname').val(''); return; diff --git a/app/Views/costListing.php b/app/Views/costListing.php index d2864f13..cc7011d1 100755 --- a/app/Views/costListing.php +++ b/app/Views/costListing.php @@ -231,7 +231,7 @@ }, success: function (data) { $('#loader').hide(); - let isactive =data[0].IsActive; + let isactive =data[0]?.IsActive; if (data && data.length > 0) { diff --git a/app/Views/editOldasset.php b/app/Views/editOldasset.php index f0cc7847..d8cf9059 100755 --- a/app/Views/editOldasset.php +++ b/app/Views/editOldasset.php @@ -439,7 +439,7 @@ if (!empty($assetList)) { data:{assetId,assetName}, success: function(data){ if(data && data.length>0){ - let IsActive = data[0].IsActive; + let IsActive = data[0]?.IsActive; if(IsActive == 1){ alert("Asset Name Exists..!!"); $('#AssetName').val(''); diff --git a/app/Views/editRawmaterial.php b/app/Views/editRawmaterial.php index abf8f109..6c741993 100755 --- a/app/Views/editRawmaterial.php +++ b/app/Views/editRawmaterial.php @@ -462,7 +462,7 @@ if ($total <= $reorder) { if (count >= 1) { $('#loader').hide(); - if(data[0].IsActive == 1){ + if(data[0]?.IsActive == 1){ alert('Material name already existed ! '); }else{ alert('Material name already existing in the deleted section.!!'); diff --git a/app/Views/editSupplier.php b/app/Views/editSupplier.php index 9d71f04b..a1d76407 100755 --- a/app/Views/editSupplier.php +++ b/app/Views/editSupplier.php @@ -612,7 +612,7 @@ if (!empty($supplier)) { var count = data.length; if (count >= 1) { $('#loader').hide(); - if(data[0].IsActive == 1){ + if(data[0]?.IsActive == 1){ alert('supplier already existed ! '); }else{ alert('supplier already existing in the deleted section..!! '); diff --git a/app/Views/editconfig.php b/app/Views/editconfig.php index b68609fe..7506a322 100755 --- a/app/Views/editconfig.php +++ b/app/Views/editconfig.php @@ -506,7 +506,7 @@ if (!empty($master)) { if (data && data.length > 0) { - if (data[0].isActive == 1) { + if (data[0]?.isActive == 1) { alert("This Configuration Name is already present. kindly change it..!!"); $('#ConfigName').val(''); return; diff --git a/app/Views/transporterListing.php b/app/Views/transporterListing.php index ec1bf08b..f78f3161 100755 --- a/app/Views/transporterListing.php +++ b/app/Views/transporterListing.php @@ -275,7 +275,7 @@ success: function (data) { if (data && data.length > 0) { - let isactive = data[0].isactive; + let isactive = data[0]?.isactive; if (isactive == 1 ) { alert(" Transporter with this Name Exists..!!"); } else { alert(" Transporter with this Name Existing in deleted section ..!!"); } From 9eb7c54b979ab570cbec3844c84d16e5cd468809 Mon Sep 17 00:00:00 2001 From: vadivelJ96 Date: Thu, 26 Dec 2024 10:08:13 +0530 Subject: [PATCH 3/8] stock module-3 vadivel J 26-12-2024 --- app/Views/addRawMaterial.php | 2 ++ app/Views/editRawmaterial.php | 1 + app/Views/editconfig.php | 2 +- 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/app/Views/addRawMaterial.php b/app/Views/addRawMaterial.php index bce148fe..f4d04b62 100755 --- a/app/Views/addRawMaterial.php +++ b/app/Views/addRawMaterial.php @@ -316,6 +316,8 @@ $('#loader').hide(); if(data[0]?.IsActive == 1){ alert('Material name already existed ! '); + $('#MaterialName').val(''); + }else{ alert('Material name already existing in the deleted section.!!'); } diff --git a/app/Views/editRawmaterial.php b/app/Views/editRawmaterial.php index 6c741993..43562a7a 100755 --- a/app/Views/editRawmaterial.php +++ b/app/Views/editRawmaterial.php @@ -464,6 +464,7 @@ if ($total <= $reorder) { $('#loader').hide(); if(data[0]?.IsActive == 1){ alert('Material name already existed ! '); + $('#MaterialName').val(''); }else{ alert('Material name already existing in the deleted section.!!'); } diff --git a/app/Views/editconfig.php b/app/Views/editconfig.php index 7506a322..bbec5608 100755 --- a/app/Views/editconfig.php +++ b/app/Views/editconfig.php @@ -61,7 +61,7 @@ if (!empty($master)) {
'form-horizontal', 'id' => 'editConfig'); - echo form_open(base_url() . 'configurationctrl/updateconfig', $attributes); ?> + echo form_open(base_url() . 'configurationctrl/updateconfig', $attributes);?>
From 3e46d6568f95bbfb7c35647191c4d3e566bf5154 Mon Sep 17 00:00:00 2001 From: vadivelJ96 Date: Thu, 26 Dec 2024 18:15:46 +0530 Subject: [PATCH 4/8] master module 4 vadivel J 26-12-2024 --- app/Models/Rawmaterialdetails_model.php | 1 + app/Views/addRawMaterial.php | 53 ++++++-- app/Views/addasset.php | 94 ++++++++----- app/Views/addconfig.php | 20 ++- app/Views/costListing.php | 11 ++ app/Views/editOldasset.php | 41 ++++-- app/Views/editRawmaterial.php | 26 +++- app/Views/editconfig.php | 125 ++++++++++-------- app/Views/factoryMachineMasterDetailsForm.php | 70 +++++++++- app/Views/rawmaterialListing.php | 2 +- app/Views/transporterListing.php | 18 ++- 11 files changed, 328 insertions(+), 133 deletions(-) diff --git a/app/Models/Rawmaterialdetails_model.php b/app/Models/Rawmaterialdetails_model.php index f55d0740..bafa376a 100755 --- a/app/Models/Rawmaterialdetails_model.php +++ b/app/Models/Rawmaterialdetails_model.php @@ -323,6 +323,7 @@ class Rawmaterialdetails_model extends Model $builder->where('REPLACE(MaterialName, " ", "")' , $materialName); $query = $builder->get(); + if ($query->getNumRows() > 0) { return $query->getResultArray(); } else { diff --git a/app/Views/addRawMaterial.php b/app/Views/addRawMaterial.php index f4d04b62..5204b22b 100755 --- a/app/Views/addRawMaterial.php +++ b/app/Views/addRawMaterial.php @@ -42,14 +42,14 @@
-
+
- +
@@ -137,7 +137,7 @@
- +
@@ -291,9 +291,18 @@ - $('#MaterialName').change(function() { + $('#addMaterialBtnId').click(function() { - var materialName = $('#MaterialName').val(); + + //validate + + let validation = Validate(); + + if(!validation){ + return false; + } + + var materialName = $('#MaterialName').val().trim(); var materialCode = ''; if(materialName == ''){ @@ -311,15 +320,19 @@ type: "POST", url: "materialExist", success: function(data) { - var count = data.length; - if (count >= 1) { + + if (data && data.length >= 1) { $('#loader').hide(); + if(data[0]?.IsActive == 1){ alert('Material name already existed ! '); $('#MaterialName').val(''); }else{ + alert('Material name already existing in the deleted section.!!'); + $('#MaterialName').val(''); + } @@ -330,11 +343,15 @@ }); - alert("'" + materialname + "' - related materials are , " + " \n \n" + related_name); - $("#MaterialName").val(''); - $("#MaterialName").focus(); - } else { + alert("'" + materialName + "' - related materials are , " + " \n \n" + related_name); + $("#MaterialName").val(''); + $("#MaterialName").focus(); + + + } else{ $('#loader').hide(); + + $('addMaterialForm').submit(); } }, @@ -350,6 +367,7 @@ }); function Validate() { + if ($("#MaterialName").val().length < 1) { alert('Please Enter MaterialName'); $("#MaterialName").focus(); @@ -371,6 +389,8 @@ $("#MaterialType").focus(); return false; } + + return true; } @@ -434,4 +454,15 @@ } + + + + \ No newline at end of file diff --git a/app/Views/addasset.php b/app/Views/addasset.php index 2736f2cf..4458c5e9 100755 --- a/app/Views/addasset.php +++ b/app/Views/addasset.php @@ -158,7 +158,7 @@
- +
@@ -383,8 +383,7 @@ } - - + return true; } @@ -431,43 +430,68 @@ return true; } - $('#AssetName').on('change',function(){ + $('#addAssetBtnId').on('click',function(){ -let assetName = $(this).val().trim(); -let assetId = $('#AssetCode').val() ?? ''; + let validation = validate(); -$('#loader').show(); + if(validation){ + + let assetName = $('#AssetName').val().trim(); + let assetId = $('#AssetCode').val() ?? ''; + + $('#loader').show(); + + $.ajax({ + type:'POST', + url:'assetdetails/checkAssetName', + data:{assetId,assetName}, + success: function(data){ + if(data && data.length>0){ + let IsActive = data[0]?.IsActive; + if(IsActive == 1){ + alert("Asset Name Exists..!!"); + $('#AssetName').val(''); + $('#AssetName').focus(); + }else{ + alert("Asset Name Existing in deleted section..!!"); + $('#AssetName').val(''); + $('#AssetName').focus(); + } + }else{ + $('#addAsset').submit(); + } + + + + }, + error: function(error){ + //error + console.error('error ocurred' + error); + }, + complete :function (){ + $('#loader').hide(); + console.log('ajax call completed..!!'); + } + }) -$.ajax({ - type:'POST', - url:'assetdetails/checkAssetName', - data:{assetId,assetName}, - success: function(data){ - if(data && data.length>0){ - let IsActive = data[0]?.IsActive; - if(IsActive == 1){ - alert("Asset Name Exists..!!"); - $('#AssetName').val(''); - $('#AssetName').focus(); - }else{ - alert("Asset Name Existing in deleted section..!!"); - $('#AssetName').val(''); - $('#AssetName').focus(); } - } - }, - error: function(error){ - //error - console.error('error ocurred' + error); - }, - complete :function (){ - $('#loader').hide(); - console.log('ajax call completed..!!'); - } -}) + else{ + return false; + } + + }); + + + + + + \ No newline at end of file diff --git a/app/Views/addconfig.php b/app/Views/addconfig.php index 81a5f4e6..a77a1c03 100755 --- a/app/Views/addconfig.php +++ b/app/Views/addconfig.php @@ -92,7 +92,7 @@
Cancel - +
@@ -388,7 +388,7 @@ + + + + \ No newline at end of file diff --git a/app/Views/costListing.php b/app/Views/costListing.php index cc7011d1..95306a3f 100755 --- a/app/Views/costListing.php +++ b/app/Views/costListing.php @@ -429,4 +429,15 @@ }); }); + + + + \ No newline at end of file diff --git a/app/Views/editOldasset.php b/app/Views/editOldasset.php index d8cf9059..35c903af 100755 --- a/app/Views/editOldasset.php +++ b/app/Views/editOldasset.php @@ -156,7 +156,7 @@ if (!empty($assetList)) {
-
+
@@ -272,7 +272,7 @@ if (!empty($assetList)) {
Cancel - +
@@ -426,7 +426,7 @@ if (!empty($assetList)) { - $('#AssetName').on('change',function(){ +$('#editAssetBtnId').on('click',function(){ let assetId = $('#AssetCode').val(); let assetName = $(this).val().trim(); @@ -438,18 +438,22 @@ if (!empty($assetList)) { url:'assetdetails/checkAssetName', data:{assetId,assetName}, success: function(data){ - if(data && data.length>0){ - let IsActive = data[0]?.IsActive; - if(IsActive == 1){ - alert("Asset Name Exists..!!"); - $('#AssetName').val(''); - $('#AssetName').focus(); + if(data && data.length>0){ + let IsActive = data[0]?.IsActive; + if(IsActive == 1){ + alert("Asset Name Exists..!!"); + $('#AssetName').val(''); + $('#AssetName').focus(); + }else{ + alert("Asset Name Existing in deleted section..!!"); + $('#AssetName').val(''); + $('#AssetName').focus(); + } }else{ - alert("Asset Name Existing in deleted section..!!"); - $('#AssetName').val(''); - $('#AssetName').focus(); + + $('#editAsset').submit(); + } - } }, error: function(error){ //error @@ -465,4 +469,15 @@ if (!empty($assetList)) { + + + + \ No newline at end of file diff --git a/app/Views/editRawmaterial.php b/app/Views/editRawmaterial.php index 43562a7a..7e92c24d 100755 --- a/app/Views/editRawmaterial.php +++ b/app/Views/editRawmaterial.php @@ -289,7 +289,7 @@ if ($total <= $reorder) { - +
@@ -438,7 +438,7 @@ if ($total <= $reorder) { return true; } - $('#MaterialName').change(function() { + $('#editRawMaterialBtnId').click(function(){ var materialName = $('#MaterialName').val(); var materialCode = $('#RMcode').val(); @@ -458,15 +458,15 @@ if ($total <= $reorder) { type: "POST", url: "materialExist", success: function(data) { - var count = data.length; - if (count >= 1) { + if (data && data.length >= 1) { $('#loader').hide(); if(data[0]?.IsActive == 1){ alert('Material name already existed ! '); $('#MaterialName').val(''); }else{ alert('Material name already existing in the deleted section.!!'); + $('#MaterialName').val(''); } var related_name = ""; $.each(data, function(i, obj) { @@ -475,12 +475,13 @@ if ($total <= $reorder) { }); - alert("'" + materialname + "' - related materials are , " + " \n \n" + related_name); + alert("'" + materialName + "' - related materials are , " + " \n \n" + related_name); $("#MaterialName").val(''); $("#MaterialName").focus(); } else { $('#loader').hide(); - // alert("empty data"); + console.log("working") + $('#editRawmaterial').submit(); } }, @@ -556,4 +557,15 @@ if ($total <= $reorder) { } - \ No newline at end of file + + + + \ No newline at end of file diff --git a/app/Views/editconfig.php b/app/Views/editconfig.php index bbec5608..ffbd6771 100755 --- a/app/Views/editconfig.php +++ b/app/Views/editconfig.php @@ -37,7 +37,7 @@ if (!empty($master)) { helper('form'); $error = session()->getFlashdata('error'); if ($error) { - ?> + ?>
getFlashdata('error'); ?> @@ -47,7 +47,7 @@ if (!empty($master)) { getFlashdata('success'); if ($success) { - ?> + ?>
getFlashdata('success'); ?> @@ -61,7 +61,7 @@ if (!empty($master)) {
'form-horizontal', 'id' => 'editConfig'); - echo form_open(base_url() . 'configurationctrl/updateconfig', $attributes);?> + echo form_open(base_url() . 'configurationctrl/updateconfig', $attributes); ?>
@@ -77,13 +77,13 @@ if (!empty($master)) { * 'ConfigName', 'value' => set_value('ConfigName', $ConfigName), 'id' => 'ConfigName', 'class' => 'form-control', 'required' => 'true', 'maxlength' => '20'); + $data = array('name' => 'ConfigName', 'value' => set_value('ConfigName', $ConfigName), 'id' => 'ConfigName', 'class' => 'form-control', 'required' => 'true', 'maxlength' => '30'); echo form_input($data); ?>
- + * 'Remarks', 'value' => set_value('Remarks', $Comments), 'id' => 'Remarks', 'class' => 'form-control', 'required' => 'true', 'maxlength' => '20'); @@ -95,8 +95,8 @@ if (!empty($master)) {
  Add - Configuration + class="btn btn-success">   + Configuration Value
@@ -134,7 +134,7 @@ if (!empty($master)) { $index = 0; foreach ($child as $con) { $index++; - ?> + ?> @@ -143,10 +143,10 @@ if (!empty($master)) { value="ConfigValue ?>"> " style="isActive == 0) { - echo "display:none"; - } ?>"> + echo "deactivatedRow"; + } ?>" style="isActive == 0) { + echo "display:none"; + } ?>"> ConfigValue; ?> @@ -168,8 +168,8 @@ if (!empty($master)) { title="Click here to Edit Config Value"> -       - +       + @@ -182,7 +182,7 @@ if (!empty($master)) { - @@ -194,7 +194,7 @@ if (!empty($master)) {
@@ -234,8 +234,7 @@ if (!empty($master)) {
@@ -330,13 +329,14 @@ if (!empty($master)) { + @@ -553,14 +556,14 @@ if (!empty($master)) { let headers = []; // Get table headers - $(`#configtable thead tr th`).each(function () { + $(`#configtable thead tr th`).each(function() { headers.push($(this).text().trim()); }); // Get table rows including hidden ones - $(`#configtable tbody tr`).each(function () { + $(`#configtable tbody tr`).each(function() { let row = {}; - $(this).find('td').each(function (index) { + $(this).find('td').each(function(index) { // Use the headers as keys for JSON let header = headers[index]; row[header] = $(this).text().trim(); @@ -570,19 +573,17 @@ if (!empty($master)) { } }); - return rows; + return rows; } + + + \ No newline at end of file diff --git a/app/Views/factoryMachineMasterDetailsForm.php b/app/Views/factoryMachineMasterDetailsForm.php index acf72a75..912f269f 100644 --- a/app/Views/factoryMachineMasterDetailsForm.php +++ b/app/Views/factoryMachineMasterDetailsForm.php @@ -54,10 +54,18 @@ $energyType = $masterData['energy_type'] ?? ''; -
" method="post" - class="form-label-left"> + + id="factoryFormId" + class="form-label-left"> + +
@@ -79,7 +87,7 @@ $energyType = $masterData['energy_type'] ?? ''; class="text-danger">* - +
@@ -256,9 +256,12 @@ return false; } + return true; + } - $('#supplierName').change(function() { + $('#addSupplierBtnId').click(function() { + var supplierName = $('#supplierName').val().trim(); var supplierId = $('#SupplierID').val(); @@ -287,18 +290,15 @@ alert("'" + suppliername + "' - related supplier are , " + " \n \n" + related_supplier); $("#supplierName").val(''); $("#supplierName").focus(); - } else { + } else { $('#loader').hide(); - //4Debug - // alert('This is New Supplier! '); + if (Validate()) { + $('#UpdateSupplier').submit(); + } } - //4Debug - //console.log(data); }, error: function(error) { - //4Debug - // alert("Error Occur"); $('#loader').hide(); console.error("Error" , error); } diff --git a/app/Views/editSupplier.php b/app/Views/editSupplier.php index a1d76407..063c539b 100755 --- a/app/Views/editSupplier.php +++ b/app/Views/editSupplier.php @@ -296,6 +296,7 @@ if (!empty($supplier)) {
+
@@ -530,7 +531,7 @@ if (!empty($supplier)) { - +
@@ -560,11 +561,7 @@ if (!empty($supplier)) { } function Validate() { - // if(!validatePAN()) - // { - // return false; - // $('#panno').focus(); - // } + if ($("#supplierName").val().length < 1) { alert('Please Enter Supplier Name'); $("#supplierName").focus(); @@ -585,17 +582,12 @@ if (!empty($supplier)) { return false; } - /* - if(!validateGST()) - { - $('#GSTNo').focus(); - return false; - }*/ + return true; } //Call to ajax existing PAN - $('#supplierName').change(function () { + $('#updateSupplierBtnId').click(function () { var supplierName = $('#supplierName').val().trim(); var supplierId = $('#SupplierID').val(); @@ -626,6 +618,9 @@ if (!empty($supplier)) { $("#supplierName").focus(); } else { $('#loader').hide(); + if (Validate()) { + $('#UpdateSupplier').submit(); + } } }, From abe5758e006bb756d6e1b1234f691613bb652718 Mon Sep 17 00:00:00 2001 From: vadivelJ96 Date: Fri, 27 Dec 2024 11:54:02 +0530 Subject: [PATCH 7/8] master module 3 vadivel J 27-12-2024 --- app/Views/addSupplier.php | 7 +++-- app/Views/adddepartment.php | 55 +++++------------------------------- app/Views/editSupplier.php | 3 +- app/Views/editdepartment.php | 9 +++--- 4 files changed, 17 insertions(+), 57 deletions(-) diff --git a/app/Views/addSupplier.php b/app/Views/addSupplier.php index 3e3b367f..7b7721ab 100755 --- a/app/Views/addSupplier.php +++ b/app/Views/addSupplier.php @@ -237,6 +237,7 @@ return false; } if (!getContactNumberValidation) { + alert('Please Enter Valid Contact Number'); $("#ContactNumber").focus(); return false; } @@ -252,6 +253,7 @@ } if (!validateEmail()) { + alert('Please Enter Valid Email Address'); $('#emailid').focus(); return false; } @@ -287,13 +289,12 @@ $.each(data, function(i, obj) { related_supplier += obj.SupplierID + " - " + obj.SupplierName + " - " + obj.Address + "\n"; }); - alert("'" + suppliername + "' - related supplier are , " + " \n \n" + related_supplier); - $("#supplierName").val(''); + alert("'" + supplierName + "' - related supplier are , " + " \n \n" + related_supplier); $("#supplierName").focus(); } else { $('#loader').hide(); if (Validate()) { - $('#UpdateSupplier').submit(); + $('#addsupplier').submit(); } } diff --git a/app/Views/adddepartment.php b/app/Views/adddepartment.php index 707b24e4..231cbad4 100755 --- a/app/Views/adddepartment.php +++ b/app/Views/adddepartment.php @@ -29,7 +29,7 @@
- +
@@ -64,7 +64,7 @@
- +
@@ -107,54 +107,11 @@
-