diff --git a/app/Config/Routes.php b/app/Config/Routes.php index a9a60254..33b7f8ca 100755 --- a/app/Config/Routes.php +++ b/app/Config/Routes.php @@ -122,9 +122,8 @@ $routes->get('addconfig', 'Configurationctrl::addconfig'); $routes->post('configurationctrl/saveconfig', 'Configurationctrl::saveconfig'); $routes->get('configurationctrl/editconfig', 'Configurationctrl::editconfig'); $routes->post('configurationctrl/updateconfig', 'Configurationctrl::updateconfig'); - - - +$routes->get('configurationctrl/deleteConfig','configurationctrl::deleteConfig'); +$routes->get('configurationctrl/reActivateConfig','configurationctrl::reActivateConfig'); // Department Master Routes $routes->get('departmentListing', 'Department::index'); diff --git a/app/Controllers/Configurationctrl.php b/app/Controllers/Configurationctrl.php index 51a7b3eb..36562da7 100755 --- a/app/Controllers/Configurationctrl.php +++ b/app/Controllers/Configurationctrl.php @@ -41,11 +41,7 @@ class Configurationctrl extends BaseController $data['searchText'] = $searchText; - //$count = $this->configmodel->departmentListingCount($searchText); - - //$returns = $this->paginationCompress ( "configlisting/", $count, 20 ); - - $data['userRecords'] = $this->configmodel->configlisting(); + $data['userRecords'] = $this->configmodel->Configlisting(); $this->global['pageTitle'] = 'Config Listing'; @@ -130,4 +126,37 @@ class Configurationctrl extends BaseController } return redirect()->route('configlisting'); } + + + function deleteConfig(){ + + $ConfigID = $this->request->getVar('ConfigID'); + $result = $this->configmodel->updateconfig(['isActive' => 0],$ConfigID); + + if ($result > 0) { + $this->session->setFlashdata('success', 'Configuration Deleted successfully!'); + } else { + $this->session->setFlashdata('error', 'Configuration Record Not Deleted!'); + } + + return redirect()->route('configlisting'); + + } + + function reActivateConfig(){ + + $ConfigID = $this->request->getVar('ConfigID'); + $result = $this->configmodel->updateconfig(['isActive' => 1],$ConfigID); + + if ($result > 0) { + $this->session->setFlashdata('success', 'Configuration Re Activated successfully!'); + } else { + $this->session->setFlashdata('error', 'Configuration Record Not Re Activated!'); + } + + return redirect()->route('configlisting'); + + } + + } diff --git a/app/Models/Config_model.php b/app/Models/Config_model.php index 9c04ea8c..3243ef8f 100755 --- a/app/Models/Config_model.php +++ b/app/Models/Config_model.php @@ -17,8 +17,7 @@ class Config_model extends Model function Configlisting() { $builder = $this->db->table('t_configmaster as Config') - ->select('Config.Config_ID, Config.ConfigName ,Config.Comments,Config.CreatedDate') - + ->select('Config.Config_ID, Config.ConfigName ,Config.Comments,Config.CreatedDate,Config.isActive') // ->join('t_configdetails as Con','Con.Config_ID=Config.Config_ID') ->orderBy('Config.CreatedDate', 'desc'); //->orderBy('hourlyid','desc'); diff --git a/app/Views/configlisting.php b/app/Views/configlisting.php index 01a8faac..f6d3fe16 100755 --- a/app/Views/configlisting.php +++ b/app/Views/configlisting.php @@ -64,111 +64,158 @@
-
+
-
- -
- Add New Configuration -
- +
+
+ Add New Configuration
-
- getFlashdata('error'); - if ($error) { - ?> -
- - getFlashdata('error'); ?> +
- - getFlashdata('success'); - if ($success) { - ?> -
- - getFlashdata('success'); ?> -
- - -
-
-
-
- - - - - - - - - -
-
-
- - - - - - - - - - - - - - CreatedDate)) == "30-11--0001") { - $cdate = '00-00-0000'; - } else { - $cdate = date('d-m-Y', strtotime($record->CreatedDate)); - } ?> - - - - - - - - - - - - - - - -
Create DateConfiguration IDConfiguration NameDescriptionAction
Config_ID ?>ConfigName ?>Comments ?> -     - -
-
-
-
-
-
+ getFlashdata('error'); + if ($error) { + ?> +
+ + getFlashdata('error'); ?> +
+ + getFlashdata('success'); + if ($success) { + ?> +
+ + getFlashdata('success'); ?> +
+ + +
+
+
+
+ + + + + + + + + + + +
+
+ + +
+ +
+ + + +
+
+
+ + + + + + + + + + + + + + " + style="isActive == 0) { + echo "display:none"; + } ?>"> + CreatedDate)) == "30-11--0001") { + $cdate = '00-00-0000'; + } else { + $cdate = date('d-m-Y', strtotime($record->CreatedDate)); + } ?> + + + + + + + + + + + +
Create DateConfiguration IDConfiguration NameDescriptionStatusAction
Config_ID ?>ConfigName ?>Comments ?> isActive == 1 ? 'Active' : 'InActive'; ?> + isActive == 0) { ?> + + + + + + + + + + + +    + + + + + + +
+
+
+
+
+ + + @@ -178,25 +225,25 @@ + + + \ No newline at end of file diff --git a/app/Views/departmentListing.php b/app/Views/departmentListing.php index 76eae769..bd6b4184 100755 --- a/app/Views/departmentListing.php +++ b/app/Views/departmentListing.php @@ -139,9 +139,11 @@ if (!empty($userRecords)) { foreach ($userRecords as $record) { ?> - IsActive == 0) { echo "deactivatedRow"; - } ?>" style="IsActive == 0) { + } ?>" + style="IsActive == 0) { echo "display:none"; } ?>"> @@ -163,7 +165,8 @@ href="DEPCode ?>" data-toggle="tooltip" title="DEPCode ?> - Click here to Re activate Department Details"> + class="fas fa-key"> + @@ -171,7 +174,7 @@ href="DEPCode ?>" data-toggle="tooltip" title="DEPCode ?> - Click here to View Department Details"> + class="fas fa-edit">    @@ -180,7 +183,8 @@ href="DEPCode ?>" data-toggle="tooltip" title="DEPCode ?> - Click here to Delete Department Details"> + class="fas fa-trash"> +