diff --git a/app/Config/Routes.php b/app/Config/Routes.php index 33b7f8ca..8ace46cf 100755 --- a/app/Config/Routes.php +++ b/app/Config/Routes.php @@ -120,10 +120,14 @@ $routes->post('companycontroller/bankdtl', 'Companycontroller::bankdtl'); $routes->get('configlisting', 'Configurationctrl::index'); $routes->get('addconfig', 'Configurationctrl::addconfig'); $routes->post('configurationctrl/saveconfig', 'Configurationctrl::saveconfig'); +$routes->post('configurationctrl/configValueCheck', 'Configurationctrl::configValueCheck'); +$routes->get('configurationctrl/deleteConfigValue', 'Configurationctrl::deleteConfigValue'); +$routes->get('configurationctrl/reActivateConfigValue', 'Configurationctrl::reActivateConfigValue'); $routes->get('configurationctrl/editconfig', 'Configurationctrl::editconfig'); $routes->post('configurationctrl/updateconfig', 'Configurationctrl::updateconfig'); -$routes->get('configurationctrl/deleteConfig','configurationctrl::deleteConfig'); -$routes->get('configurationctrl/reActivateConfig','configurationctrl::reActivateConfig'); +$routes->post('configurationctrl/configNameCheck', 'Configurationctrl::configNameCheck'); +$routes->get('configurationctrl/deleteConfig', 'configurationctrl::deleteConfig'); +$routes->get('configurationctrl/reActivateConfig', 'configurationctrl::reActivateConfig'); // Department Master Routes $routes->get('departmentListing', 'Department::index'); @@ -282,7 +286,7 @@ $routes->post('getCostCenterData', 'Inwardgateregister::getCostCenterData'); $routes->post('ViewIGRfile', 'Inwardgateregister::ViewIGRfile'); $routes->post('getAdditionalIGRFile', 'Inwardgateregister::getAdditionalIGRFile'); $routes->post('deleteAdditionalIGRFile', 'Inwardgateregister::deleteAdditionalIGRFile'); -$routes->get('download-files/(:segment)', 'Inwardgateregister::downloadFilesAsZip/$1'); +$routes->get('download-files/(:segment)', 'Inwardgateregister::downloadFilesAsZip/$1'); $routes->post('inwardgateregister/edituploadfile', 'Inwardgateregister::edituploadfile'); @@ -417,13 +421,13 @@ $routes->post('checkTransporter', 'Supplier::checkTransporter'); //Factory Machine Master Routes -$routes->post('createFactoryMachineMasterDetails' , 'FactoryMachineController::createFactoryMachineMasterDetails'); -$routes->get('readFactoryMachineMasterDetails' , 'FactoryMachineController::readFactoryMachineMasterDetails'); -$routes->get('readFactoryMachineMasterDetailsById ' ,'FactoryMachineController::readFactoryMachineMasterDetailsById'); -$routes->post('updateFactoryMachineMasterDetails ','FactoryMachineController::updateFactoryMachineMasterDetails'); -$routes->get('deleteFactoryMachineMasterDetails' , 'FactoryMachineController::deleteFactoryMachineMasterDetails'); +$routes->post('createFactoryMachineMasterDetails', 'FactoryMachineController::createFactoryMachineMasterDetails'); +$routes->get('readFactoryMachineMasterDetails', 'FactoryMachineController::readFactoryMachineMasterDetails'); +$routes->get('readFactoryMachineMasterDetailsById', 'FactoryMachineController::readFactoryMachineMasterDetailsById'); +$routes->post('updateFactoryMachineMasterDetails', 'FactoryMachineController::updateFactoryMachineMasterDetails'); +$routes->get('deleteFactoryMachineMasterDetails', 'FactoryMachineController::deleteFactoryMachineMasterDetails'); $routes->get('reActivateFactoryMachineMasterDetails', 'FactoryMachineController::reActivateFactoryMachineMasterDetails'); -$routes->post('checkMachineName' ,'FactoryMachineController::checkMachineName'); +$routes->post('checkMachineName', 'FactoryMachineController::checkMachineName'); $routes->get('loadView_createFactoryMachineMasterDetail', 'FactoryMachineController::loadView_createFactoryMachineMasterDetail'); $routes->get('loadView_updateFactoryMachineMasterDetail', 'FactoryMachineController::loadView_updateFactoryMachineMasterDetail'); diff --git a/app/Controllers/Configurationctrl.php b/app/Controllers/Configurationctrl.php index 36562da7..f4d5bbd8 100755 --- a/app/Controllers/Configurationctrl.php +++ b/app/Controllers/Configurationctrl.php @@ -105,6 +105,7 @@ class Configurationctrl extends BaseController $config = array('Config_ID' => $ConfigId, 'ConfigName' => $ConfigName, 'Comments' => $Comments); $result = $this->configmodel->updateconfig($config, $ConfigId); + $child_result = false ; for ($i = 1; $i <= $Rowcount; $i++) { $child_primary_key = $this->request->getPost('DbKey' . $i); @@ -158,5 +159,51 @@ class Configurationctrl extends BaseController } + public function configNameCheck(){ + + $data = $this->request->getPost(); + $configName = ($data['configName']); + + $result = $this->configmodel->configNameCheck($configName); + + return $this->response->setJSON($result); + + } + + public function configValueCheck(){ + + $data = $this->request->getPost(); + $configId = $data['configId']; + $configValue = $data['ConfigValue']; + + $result = $this->configmodel->configValueCheck($configId, $configValue); + + return $this->response->setJSON($result); + + } + + public function deleteConfigValue(){ + + $configId = $this->request->getVar('ConfigID'); + $configValue = $this->request->getVar('ConfigValue'); + + $result = $this->configmodel->deleteConfigValue($configId, $configValue); + + return redirect()->back(); + + + } + + public function reActivateConfigValue(){ + + $configId = $this->request->getVar('ConfigID'); + $configValue = $this->request->getVar('ConfigValue'); + + $result = $this->configmodel->reActivateConfigValue($configId, $configValue); + + return redirect()->back(); + } + + } diff --git a/app/Controllers/FactoryMachineController.php b/app/Controllers/FactoryMachineController.php index 1f2eb513..41784c63 100644 --- a/app/Controllers/FactoryMachineController.php +++ b/app/Controllers/FactoryMachineController.php @@ -31,6 +31,28 @@ class FactoryMachineController extends BaseController } + public function createFactoryMachineMasterDetails(){ + + $this->global['pageTitle'] = 'Edit Factory Machine Master Detail '; + + + $data=[ + 'machine_name'=> $this->request->getPost('machineName'), + 'machine_type'=> $this->request->getPost('machineType'), + 'energy_type' => $this->request->getPost('energyType'), + ]; + + $inserted = $this->factoryMachineMaster_model->insert($data); + + if ($inserted) { + // Set flashdata for success message + return redirect()->to('/readFactoryMachineMasterDetails')->with('success', 'Machine details created successfully'); + } else { + // Set flashdata for error message + return redirect()->back()->with('error', 'Failed to create machine details'); + } + + } public function loadView_createFactoryMachineMasterDetail(){ @@ -62,7 +84,7 @@ class FactoryMachineController extends BaseController $data['masterData'] = $this->factoryMachineMaster_model ->orderBy('created_at','DESC') - ->findAll(); + ->findAll(); return $this->loadViews("factoryMachineMasterDetails", $this->global, $data, NULL); @@ -92,7 +114,7 @@ class FactoryMachineController extends BaseController $postData=[ 'machine_name'=> $this->request->getPost('machineName'), 'machine_type'=> $this->request->getPost('machineType'), - 'energy_type' => $this->request->getPost('energyType'), + 'energy_type' => $this->request->getPost('energyType'), ]; $updated = $this->factoryMachineMaster_model->update($id,$postData); diff --git a/app/Models/Config_model.php b/app/Models/Config_model.php index 3243ef8f..1fddb1a9 100755 --- a/app/Models/Config_model.php +++ b/app/Models/Config_model.php @@ -177,4 +177,44 @@ class Config_model extends Model return $query->getResult(); } + + public function configNameCheck($configName){ + $builder = $this->db->table('t_configmaster') + ->where('ConfigName ', $configName); + $query = $builder->get(); + + // dd( $this->db->getLastQuery()); + + return $query->getResultArray(); + } + + public function configValueCheck($configId , $configValue){ + $builder = $this->db->table('t_configdetails') + ->where('Config_ID',$configId) + ->where('configValue ', $configValue); + $query = $builder->get(); + + // dd( $this->db->getLastQuery()); + + return $query->getResultArray(); + } + + public function deleteConfigValue($configId, $configValue){ + $builder = $this->db->table('t_configdetails') + ->where('Config_ID',$configId) + ->where('configValue ', $configValue) + ->update(['isActive'=> 0]); + $res = $this->db->affectedRows(); + return $res; + } + + public function reActivateConfigValue($configId, $configValue){ + $builder = $this->db->table('t_configdetails') + ->where('Config_ID',$configId) + ->where('configValue ', $configValue) + ->update(['isActive'=> 1]); + $res = $this->db->affectedRows(); + return $res; + } + } \ No newline at end of file diff --git a/app/Models/FactoryMachineModel.php b/app/Models/FactoryMachineModel.php index 1dfae473..9f41778f 100644 --- a/app/Models/FactoryMachineModel.php +++ b/app/Models/FactoryMachineModel.php @@ -29,7 +29,7 @@ class FactoryMachineModel extends Model protected $validationRules = [ 'machine_name' => 'required|max_length[255]', 'machine_type' => 'required|max_length[255]', - 'energy_type' => 'required|max_length[255]', + 'energy_type' => 'required|max_length[255]', ]; diff --git a/app/Views/addEmployeenew.php b/app/Views/addEmployeenew.php index 584c36fc..3e6464d8 100755 --- a/app/Views/addEmployeenew.php +++ b/app/Views/addEmployeenew.php @@ -314,10 +314,17 @@ $("#photo").src(""); } + + function capitalizeFirstLetter(word) { + if (!word) return ""; // Handle empty or undefined strings + return word.charAt(0).toUpperCase() + word.slice(1).toLowerCase(); + } + function ValidatePassport() { - var regsaid = /^[A-Z][1-9]\d\s?\d{4}[1-9]$/; - var passport = $("#passportno").val().trim(); + var regsaid =/^[A-Z][1-9]\d\s?\d{4}[1-9]$/; + + var passport = capitalizeFirstLetter($("#passportno").val().trim()); if (regsaid.test(passport) == false) { alert('You have entered invalid Passport.'); @@ -1042,7 +1049,6 @@
- + * 'configurationname', 'value' => set_value('configurationname'), 'id' => 'configurationname', 'class' => 'form-control', 'required' => 'true', 'maxlength' => '20'); echo form_input($data); ?> @@ -381,4 +381,75 @@ } }); + + + + + \ No newline at end of file diff --git a/app/Views/editEmployeenew.php b/app/Views/editEmployeenew.php index 287ec273..45017650 100755 --- a/app/Views/editEmployeenew.php +++ b/app/Views/editEmployeenew.php @@ -109,13 +109,13 @@ if (!empty($EmpDetails)) { } $isactive = $Emp->IsActive; - $ProfilePicPath=''; + $ProfilePicPath = ''; if (!empty($Emp->ProfilePic)) { - $ProfilePicPath = base_url().'public/uploads/images/' . $Emp->ProfilePic; + $ProfilePicPath = base_url() . 'public/uploads/images/' . $Emp->ProfilePic; } else { - $ProfilePicPath = base_url().'public/assets/dist/img/avatar.png'; + $ProfilePicPath = base_url() . 'public/assets/dist/img/avatar.png'; } $Reference_Name = $Emp->Reference_Name; $Reference_ContactNumber = $Emp->Reference_ContactNumber; @@ -202,9 +202,8 @@ if (!empty($EmpDetails)) {
-
+
@@ -213,8 +212,8 @@ if (!empty($EmpDetails)) {
your image + src="" alt="your image" + style="width: 139px;" /> @@ -239,8 +238,8 @@ if (!empty($EmpDetails)) { - + readonly> +
@@ -1004,34 +1003,33 @@ if (!empty($EmpDetails)) { maxlength="14" onchange="ValidateAadhar();" class="form-control" onkeypress="return isNumberKey(event)" required - value=""> + value="">
+ maxlength="255" class="form-control" value="Aadhar" + readonly>
+ if (!empty($aadharFile)) { ?>
- - - -
- -
- - + + + +
+ +
+ +
-
- +
+
- +
@@ -1042,33 +1040,32 @@ if (!empty($EmpDetails)) { onchange="validatePAN();" class="form-control" pattern="([a-zA-Z]){5}([0-9]){4}([a-zA-Z]){1}" title=" 5 character,4 Digit Numbers,1 character (ex:ABCDE1234A) " - onkeypress="return alpha(event);" - value="" - > + onkeypress="return alpha(event);" value="">
+ maxlength="255" class="form-control" value="PAN" + readonly>
- +
- - - -
- -
- - + + + +
+ +
+ +

- +
@@ -1077,36 +1074,35 @@ if (!empty($EmpDetails)) { + value="">
+ maxlength="255" class="form-control" value="Passport" + readonly>
- +
- - - -
- -
- - + + + + + +
+ +

- + @@ -1118,23 +1114,23 @@ if (!empty($EmpDetails)) { maxlength="255" class="form-control" value="Bank Passbook" readonly> - +
- - - -
- -
- - + + + + + +
+ +

- +
@@ -1143,25 +1139,25 @@ if (!empty($EmpDetails)) { + value="">
- +
- - - -
- -
- - + + + + + +
+ +

- + @@ -1211,8 +1207,8 @@ if (!empty($EmpDetails)) {
+ The last character should be any number from 1 to 9.">
@@ -1698,17 +1693,16 @@ if (!empty($EmpDetails)) { } function ValidatePassport() { - var regsaid = /^[A-Z][1-9]\d\s?\d{4}[1-9]$/ig; - var passport = $("#passportno").val().trim(); + var regsaid = /^[A-Z][1-9]\d\s?\d{4}[1-9]$/; + + var passport = capitalizeFirstLetter($("#passportno").val().trim()); + if (regsaid.test(passport) == false) { alert('You have entered invalid Passport.'); - alert(` The first character must be an uppercase alphabet. - The next two characters should be numbers, - with the first character ranging from 1 to 9 and the second character from 0 to 9. - It may include zero or one white space character. - The subsequent four characters can be any number from 0 to 9. - The last character should be any number from 1 to 9."`); - return; + alert(`The first character must be an uppercase alphabet. The next two characters should be numbers,with the first character ranging from 1 to 9 and the second character from 0 to 9. It may include zero or one white space character. The subsequent four characters can be any number from 0 to 9. The last character should be any number from 1 to 9."`); + return (false); + } else { + return true; } } @@ -2063,16 +2057,25 @@ if (!empty($EmpDetails)) { + + + + + + \ No newline at end of file diff --git a/app/Views/factoryMachineMasterDetails.php b/app/Views/factoryMachineMasterDetails.php index 2b9117c4..fe129dba 100644 --- a/app/Views/factoryMachineMasterDetails.php +++ b/app/Views/factoryMachineMasterDetails.php @@ -73,7 +73,7 @@
-
+
getFlashdata('error'); diff --git a/app/Views/factoryMachineMasterDetailsForm.php b/app/Views/factoryMachineMasterDetailsForm.php index 8f23830e..eec20a97 100644 --- a/app/Views/factoryMachineMasterDetailsForm.php +++ b/app/Views/factoryMachineMasterDetailsForm.php @@ -1,83 +1,91 @@ -
-
- -
- -
-
-
-

+
+ +
+ +
+
+
+

- -
-
-
- - -
-
-
-
+ +
+
+
+ + +
+
+
+
- +
* - +
* - +
- - - - - - - + + + + +
@@ -85,58 +93,60 @@ $energyType=$masterData['energy_type']??'';
-
+
-
- - -   - +
+ + +   +
- +
-
+
-
-
-
- -
- -
+
+
+
+ +
+ +