diff --git a/app/Controllers/ClientController.php b/app/Controllers/ClientController.php index ceb81ef8..5439e64e 100644 --- a/app/Controllers/ClientController.php +++ b/app/Controllers/ClientController.php @@ -2994,7 +2994,9 @@ class ClientController extends AdminController $update = $this->policyPremium2Model ->where('rack_rate_name', $rack_rate_name) ->where('client_policy_id', $client_policy_id) - ->set($data)->update(); + ->where('is_active',1) + ->set($data) + ->update(); $affectedRows = $this->policyPremium2Model->affectedRows(); diff --git a/app/Controllers/MasterController.php b/app/Controllers/MasterController.php index 7e0144fd..842dd047 100644 --- a/app/Controllers/MasterController.php +++ b/app/Controllers/MasterController.php @@ -264,6 +264,10 @@ class MasterController extends AdminController $data['addition_add_day'] = 1; } + if($this->request->getPost('deletion_add_day')){ + $data['deletion_add_day'] = 1; + } + $data['created_by'] = get_session_userid(); $data['insurer_logo'] = $file_name; @@ -342,6 +346,12 @@ class MasterController extends AdminController $data['addition_add_day'] = 0; } + if($this->request->getPost('deletion_add_day')){ + $data['deletion_add_day'] = 1; + }else{ + $data['deletion_add_day'] = 0; + } + $update = $this->insurerModel->update($id,$data); if($update){ echo json_encode(array("status" => true , 'data' => $data)); diff --git a/app/Controllers/UserController.php b/app/Controllers/UserController.php index d3bd04aa..53d35bf1 100644 --- a/app/Controllers/UserController.php +++ b/app/Controllers/UserController.php @@ -35,7 +35,7 @@ class UserController extends AdminController public function list() { - $data['headerData'] = 'User List'; + $data['page_name'] = 'User'; $this->myLogger->logme('error','User list function called'); $data['UserList'] = $this->userModel->getUserList(); // echo '
';
@@ -47,54 +47,60 @@ class UserController extends AdminController
 
 
     public function create()
-    {    
-        $this->myLogger->logme('error','User create function called');
-         $teams = $this->request->getPost('team'); 
-         
+    {
+        $this->myLogger->logme('error', 'User create function called');
+        $teams = $this->request->getPost('team');
+
         //if this is get method return to user creation page
-        if(!$this->request->getPost()){
+        if (!$this->request->getPost()) {
             return redirect()->to(base_url('/user/list'));
-        }else{
-    
+        } else {
+
             $userData = $this->request->getPost();
             $userData['created_by'] =  get_session_userid();
             $temp_team = $userData['team'];
             unset($userData['team']);
             $insert = $this->userModel->insert($userData);
-            if($insert){
-                $db = \Config\Database::connect();
-                $tableName = 'hdz_staff'; 
 
-                if($userData['role'] == 1){
+            if ($insert) {
+
+                if ($userData['role'] == 3) {
+
+                    $db = \Config\Database::connect();
+                    $tableName = 'hdz_staff';
                     $admin = 1;
-                }else{
-                    $admin = 0;
-                }
-                foreach ($temp_team as $key => $value) {
-                    $team = $this->teamModel->where('id' , $value)->first();
-                    if($team['name'] == 'Claims'){
-                        $hdz_staff = [
-                            'emp_code' => $userData['emp_code'],
-                            'fullname' => $userData['first_name'],
-                            'username' => strtolower($userData['first_name']),
-                            'email' => $userData['email'],
-                            'admin' => $admin,
-                            'registration' => time(),
-                        ];
-        
-                        $db->table($tableName)->insert($hdz_staff);
-                    }
-                } 
 
-               $teamData['user_id'] = $insert ;
-               foreach ($teams as $value) {
-                    $teamData['team_id'] = $value;
-                    $teamData['created_by'] =  get_session_userid();
-                    $this->userTeamsModel->insert($teamData);
+                    $password = '12345678'; //Default password
+                    $hashedPassword = password_hash($password, PASSWORD_DEFAULT);
+
+                    foreach ($temp_team as $key => $value) {
+                        $team = $this->teamModel->where('id', $value)->first();
+                        if ($team['name'] == 'Claims') {
+                            $hdz_staff = [
+                                'emp_code' => $userData['emp_code'],
+                                'fullname' => $userData['first_name'],
+                                'username' => strtolower($userData['first_name']),
+                                'email' => $userData['email'],
+                                'admin' => $admin,
+                                'registration' => time(),
+                                'password' => $hashedPassword,
+                                'active' => 1,
+                            ];
+
+                            $db->table($tableName)->insert($hdz_staff);
+                        }
+                    }
+
+                    $teamData['user_id'] = $insert;
+                    foreach ($teams as $value) {
+                        $teamData['team_id'] = $value;
+                        $teamData['created_by'] =  get_session_userid();
+                        $this->userTeamsModel->insert($teamData);
+                    }
                 }
             }
         }
-        $this->myLogger->logme('error','User create Successfully created by id {data}', ['data' =>  get_session_userid()]);
+        $this->myLogger->logme('error', 'User create Successfully created by id {data}', ['data' =>  get_session_userid()]);
         return redirect()->to(base_url('/user/list'));
     }
 
@@ -110,65 +116,65 @@ class UserController extends AdminController
     }
 
     public function edit()
-    {   
-        $teams = $this->request->getPost('team'); 
+    {
+        $teams = $this->request->getPost('team');
 
-        if(!$this->request->getPost()){
+        if (!$this->request->getPost()) {
             return redirect()->to(base_url('/user/list'));
-        }else{
+        } else {
             $id = $this->request->getPost('PrimaryKey');
             $userData = $this->request->getPost();
             unset($userData['csrf_test_name']);
             unset($userData['PrimaryKey']);
-            // unset($userData['first_name']);
 
             // Update data in the 'users' table based on the $id
             $userData['updated_by'] =  get_session_userid();
-            $update = $this->userModel->where('id', $id )->set($userData)->update();
+            $update = $this->userModel->where('id', $id)->set($userData)->update();
 
-            if($update){
+            if ($update) {
 
-                $db = \Config\Database::connect();
-                $tableName = 'hdz_staff'; 
+                if ($userData['role'] == 3) {
 
-                if($userData['role'] == 1){
+                    $db = \Config\Database::connect();
+                    $tableName = 'hdz_staff';
                     $admin = 1;
-                }else{
-                    $admin = 0;
-                }
 
-                foreach ($userData['team'] as $key => $value) {
-                    if($value == 2){
-                        $hdz_staff = [
-                            'emp_code' => $userData['emp_code'],
-                            'fullname' => $userData['first_name'],
-                            'username' => strtolower($userData['first_name']),
-                            'email' => $userData['email'],
-                            'admin' => $admin,
-                        ];
-        
+                    foreach ($userData['team'] as $key => $value) {
+                        if ($value == 2) {
 
-                        $db->table($tableName)->where('emp_code', $userData['emp_code'])
-                                              ->where('email', $userData['email'])
-                                              ->set($hdz_staff)
-                                              ->update();
+                            $hdz_staff = [
+                                'emp_code' => $userData['emp_code'],
+                                'fullname' => $userData['first_name'],
+                                'username' => strtolower($userData['first_name']),
+                                'email' => $userData['email'],
+                                'admin' => $admin,
+                                'registration' => time(),
+                                'active' => 1,
+                            ];
+
+
+                            $db->table($tableName)->where('emp_code', $userData['emp_code'])
+                                ->where('email', $userData['email'])
+                                ->set($hdz_staff)
+                                ->update();
+                        }
                     }
-                } 
 
+                    $this->userTeamsModel->where('user_id', $id)->delete();
 
-                $this->userTeamsModel->where('user_id', $id)->delete();
-                if($teams){
-                    $teamData['user_id'] = $id ;
-                    foreach ($teams as $value) {
-                         $teamData['team_id'] = $value;
-                         $teamData['created_by'] =  get_session_userid();
-                         $this->userTeamsModel->insert($teamData);
-                     }
+                    if ($teams) {
+                        $teamData['user_id'] = $id;
+                        foreach ($teams as $value) {
+                            $teamData['team_id'] = $value;
+                            $teamData['created_by'] =  get_session_userid();
+                            $this->userTeamsModel->insert($teamData);
+                        }
+                    }
                 }
-             }
+            }
+
             return redirect()->to(base_url('/user/list'));
         }
-        
     }
 
     public function deactive($id = null)
diff --git a/app/Models/ClientPolicyModel.php b/app/Models/ClientPolicyModel.php
index 506b6605..e66bfc88 100644
--- a/app/Models/ClientPolicyModel.php
+++ b/app/Models/ClientPolicyModel.php
@@ -22,7 +22,6 @@ class ClientPolicyModel extends Model
         "reminder_date",
         "open_date",
         "close_date",
-        "close_date",
         "insured",
         "no_of_employees",
         "no_of_lives",
diff --git a/app/Views/client_policy.php b/app/Views/client_policy.php
index f57c5dea..347ce14a 100644
--- a/app/Views/client_policy.php
+++ b/app/Views/client_policy.php
@@ -145,15 +145,15 @@
                             
                             
- +
- +
- +
-
- - - - +
SNO
+ + + - - - - + + + + - - - - + + + - - - - - - - - - - - - - - - + - - Name/code + + + + + + + + + + + + + + $employee) { ?> + + - - - - - - + + + + - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
SNOClient/BranchClient/Branch BranchBranch Employee codeName/codePolicy nameInsurer
name
TPA IDRisk IDPolicy
status
(₹)Sum Insured(₹)Premium - (₹)Pro Rata
Premium
(₹)GST -
Policy nameInsurer nameTPA IDRisk IDPolicy status(₹)Sum Insured(₹)Premium(₹)Pro Rata
Premium
(₹)GST
- - + ' . $employee['status'] . ''; + break; + case 'active': + echo '' . $employee['status'] . ''; + break; + case 'inactive': + echo '' . $employee['status'] . ''; + break; + case 'expired': + echo '' . $employee['status'] . ''; + break; + case 'enrolled': + echo '' . $employee['status'] . ''; + break; + default: + echo $employee['status']; + break; + } + ?> +
( - ) - - ' . $employee['status'] . ''; - } elseif ($employee['status'] == 'active') { - echo '' . $employee['status'] . ''; - } elseif ($employee['status'] == 'inactive') { - echo '' . $employee['status'] . ''; - }elseif ($employee['status'] == 'expired') { - echo '' . $employee['status'] . ''; - }elseif ($employee['status'] == 'enrolled') { - echo '' . $employee['status'] . ''; - }else{ - echo $employee['status']; - } - ?> -
Total
-
+ + + + + + + + + + + + + Total + + + + + - - - - - - - - - - \ No newline at end of file diff --git a/app/Views/insurer_basic_info.php b/app/Views/insurer_basic_info.php index 1ab97fc8..80cf1599 100644 --- a/app/Views/insurer_basic_info.php +++ b/app/Views/insurer_basic_info.php @@ -84,12 +84,20 @@ input:checked + .slider:before { -
+
- + +
+ +
+ +
@@ -199,6 +207,8 @@ input:checked + .slider:before { setTimeout(function(){ window.location.href = '' + res.data.id }, 100) + }else{ + window.location.reload(); } }, diff --git a/app/Views/layout/footer.php b/app/Views/layout/footer.php index 0f5877ea..5e85921b 100644 --- a/app/Views/layout/footer.php +++ b/app/Views/layout/footer.php @@ -813,7 +813,8 @@ diff --git a/app/Views/policy_grid.php b/app/Views/policy_grid.php index d4c963fc..809992cc 100644 --- a/app/Views/policy_grid.php +++ b/app/Views/policy_grid.php @@ -31,6 +31,32 @@ } */ + +