From dd515fafb69b62d55dc1ffc09d09e59d412e8890 Mon Sep 17 00:00:00 2001 From: vadivelJ96 Date: Fri, 22 Nov 2024 11:15:28 +0530 Subject: [PATCH] changes in master details-4 vadivel J 21-11-2024 --- app/Config/Routes.php | 1 + app/Controllers/FactoryMachineController.php | 21 +- app/Views/departmentListing.php | 21 +- app/Views/factoryMachineMasterDetails.php | 220 ++++++++++++------- 4 files changed, 183 insertions(+), 80 deletions(-) diff --git a/app/Config/Routes.php b/app/Config/Routes.php index 55454ddb..41f1409e 100755 --- a/app/Config/Routes.php +++ b/app/Config/Routes.php @@ -420,6 +420,7 @@ $routes->get('readFactoryMachineMasterDetails', 'FactoryMachineController::readF $routes->get('readFactoryMachineMasterDetailsById', 'FactoryMachineController::readFactoryMachineMasterDetailsById'); $routes->post('updateFactoryMachineMasterDetails', 'FactoryMachineController::updateFactoryMachineMasterDetails'); $routes->get('deleteFactoryMachineMasterDetails', 'FactoryMachineController::deleteFactoryMachineMasterDetails'); +$routes->get('reActivateFactoryMachineMasterDetails', 'FactoryMachineController::reActivateFactoryMachineMasterDetails'); $routes->get('loadView_createFactoryMachineMasterDetail', 'FactoryMachineController::loadView_createFactoryMachineMasterDetail'); $routes->get('loadView_updateFactoryMachineMasterDetail', 'FactoryMachineController::loadView_updateFactoryMachineMasterDetail'); diff --git a/app/Controllers/FactoryMachineController.php b/app/Controllers/FactoryMachineController.php index 467da5bc..886423d6 100644 --- a/app/Controllers/FactoryMachineController.php +++ b/app/Controllers/FactoryMachineController.php @@ -82,7 +82,6 @@ class FactoryMachineController extends BaseController $this->global['pageTitle'] = 'Factory Machine Master Details'; $data['masterData'] = $this->factoryMachineMaster_model - ->where('is_active', 1) ->orderBy('created_at','DESC') ->findAll(); @@ -153,4 +152,24 @@ class FactoryMachineController extends BaseController } + public function reActivateFactoryMachineMasterDetails(){ + + $this->global['pageTitle'] = 'Re Activate Factory Machine Master Details'; + + $id = $this->request->getGet('id'); + + $data['is_active']=1; + + $updated = $this->factoryMachineMaster_model->update($id,$data); + + if ($updated) { + // Set flashdata for success message + return redirect()->to('/readFactoryMachineMasterDetails')->with('success', 'Re Activated Factory Machine Master Details'); + } else { + // Set flashdata for error message + return redirect()->back()->with('error', 'Failed to Re Activate machine details'); + } + + } + } diff --git a/app/Views/departmentListing.php b/app/Views/departmentListing.php index 632771e9..de826fd6 100755 --- a/app/Views/departmentListing.php +++ b/app/Views/departmentListing.php @@ -156,21 +156,26 @@ IsActive == 0) { ?> - -    - @@ -318,4 +323,14 @@ }); + function confirmDeleteDepartment(event){ + let result = confirm("Do You want to delete department ?"); + if(result){return;}else{event.preventDefault();} + } + + function confirmReActivateDepartment(event){ + let result = confirm("Do You want to Re activate deleted department ?"); + if(result){return;}else{event.preventDefault();} + } + \ No newline at end of file diff --git a/app/Views/factoryMachineMasterDetails.php b/app/Views/factoryMachineMasterDetails.php index 9bf3a053..ae6ca845 100644 --- a/app/Views/factoryMachineMasterDetails.php +++ b/app/Views/factoryMachineMasterDetails.php @@ -74,7 +74,7 @@
- getFlashdata('error'); if ($error) { @@ -89,17 +89,19 @@ ?> @@ -107,61 +109,95 @@
- + +
+
+
+ + +
+ +
+
- - - - - - - - - - - - - - - - - - + + " style=""> + + + + + + + + + +
Machine NameMachine TypeEnergy TypeAction
- - -     - - + - - -     - + + - - - - + + + + - - - -
Machine NameMachine TypeEnergy TypeAction
+ +
+ + + + + +     + + + + + + + +     + + + + + + +     + + + + + +
@@ -174,22 +210,22 @@ \ No newline at end of file