Merge branch 'dev' of bitbucket.org:jubilian/nhance into dev

This commit is contained in:
VENKATESHWARAN 2026-03-19 09:39:31 +05:30
commit a0dcec3de7
5 changed files with 62 additions and 61 deletions

View File

@ -487,10 +487,6 @@ class LeadsController extends BaseController
// print_r($rules); die;
if ((int) $this->request->getPost('lead_form_type') === 2) {
$rules['client_type'] = [
'rules' => 'required',
'errors' => ['required' => 'Client Type is required'],
];
$rules['policy_type_id'] = [
'rules' => 'required',
'errors' => ['required' => 'Policy Type is required'],

View File

@ -202,52 +202,53 @@ class UserController extends AdminController
// ];
// $this->bookStack->createEditUser($bookStackData);
// if ($insert) {
// $teamData['user_id'] = $insert;
// foreach ($teams as $value) {
// $teamData['team_id'] = $value;
// $teamData['created_by'] = get_session_userid();
// $this->userTeamsModel->insert($teamData);
// }
if ($insert) {
// $db = \Config\Database::connect();
// $tableName = 'hdz_staff';
$teamData['user_id'] = $insert;
foreach ($teams as $value) {
$teamData['team_id'] = $value;
$teamData['created_by'] = get_session_userid();
$this->userTeamsModel->insert($teamData);
}
// $db = \Config\Database::connect();
// $tableName = 'hdz_staff';
// // Set default values
// $admin = 0;
// $acm = 0;
// $acm_id = null;
// // Set default values
// $admin = 0;
// $acm = 0;
// $acm_id = null;
// if ($userData['role'] == 3) {
// $admin = 0;
// $acm = 1;
// $acm_id = $insert;
// } else if (in_array($userData['role'], [1, 5])) {
// $admin = 1;
// $acm = 0;
// $acm_id = null;
// }
// if ($userData['role'] == 3) {
// $admin = 0;
// $acm = 1;
// $acm_id = $insert;
// } else if (in_array($userData['role'], [1, 5])) {
// $admin = 1;
// $acm = 0;
// $acm_id = null;
// }
// $password = '12345678'; // Default password
// $hashedPassword = password_hash($password, PASSWORD_DEFAULT);
// $password = '12345678'; // Default password
// $hashedPassword = password_hash($password, PASSWORD_DEFAULT);
// $hdz_staff = [
// 'emp_code' => $userData['emp_code'],
// 'fullname' => $userData['first_name'],
// 'username' => strtolower($userData['first_name']),
// 'email' => $userData['email'],
// 'admin' => $admin,
// 'acm' => $acm,
// 'acm_id' => $acm_id,
// 'registration' => time(),
// 'password' => $hashedPassword,
// 'active' => 1,
// 'department' => 'a:7:{i:0;s:1:"1";i:1;s:1:"2";i:2;s:1:"5";i:3;s:1:"3";i:4;s:1:"9";i:5;s:1:"4";i:6;s:2:"10";}',
// ];
// $hdz_staff = [
// 'emp_code' => $userData['emp_code'],
// 'fullname' => $userData['first_name'],
// 'username' => strtolower($userData['first_name']),
// 'email' => $userData['email'],
// 'admin' => $admin,
// 'acm' => $acm,
// 'acm_id' => $acm_id,
// 'registration' => time(),
// 'password' => $hashedPassword,
// 'active' => 1,
// 'department' => 'a:7:{i:0;s:1:"1";i:1;s:1:"2";i:2;s:1:"5";i:3;s:1:"3";i:4;s:1:"9";i:5;s:1:"4";i:6;s:2:"10";}',
// ];
// $db->table($tableName)->insert($hdz_staff);
// $db->table($tableName)->insert($hdz_staff);
// }
}
}
$this->myLogger->logme('error', 'User create Successfully created by id {data}', ['data' => get_session_userid()]);
return redirect()->to(base_url('/user/list'));
@ -400,17 +401,17 @@ class UserController extends AdminController
// $this->bookStack->createEditUser($bookStackData,$existingData);
// if ($update) {
if ($update) {
// if ($teams) {
// $this->userTeamsModel->where('user_id', $id)->delete();
// $teamData['user_id'] = $id;
// foreach ($teams as $value) {
// $teamData['team_id'] = $value;
// $teamData['created_by'] = get_session_userid();
// $this->userTeamsModel->insert($teamData);
// }
// }
if ($teams) {
$this->userTeamsModel->where('user_id', $id)->delete();
$teamData['user_id'] = $id;
foreach ($teams as $value) {
$teamData['team_id'] = $value;
$teamData['created_by'] = get_session_userid();
$this->userTeamsModel->insert($teamData);
}
}
// $db = \Config\Database::connect();
// $tableName = 'hdz_staff';
@ -461,7 +462,7 @@ class UserController extends AdminController
// $db->table($tableName)->insert($hdz_staff);
// }
// }
}
return redirect()->to(base_url('/user/list'));
}

View File

@ -302,13 +302,13 @@
</div>
<div class="form-group col-md-4">
<label for="client_branch">Branch Name<span class="text-danger">*</span></label>
<label for="branch_name">Branch Name<span class="text-danger">*</span></label>
<input type="text" class="form-control" id="branch_name" name="branch_name"
placeholder="Enter Branch Name" required>
</div>
<div class="form-group col-md-4">
<label for="client_branch">Branch Code<span class="text-danger">*</span></label>
<label for="branch_code">Branch Code<span class="text-danger">*</span></label>
<input type="text" class="form-control" id="branch_code" name="branch_code"
placeholder="Enter Branch Code" required>
</div>
@ -321,7 +321,7 @@
</div>
<div class="form-group col-md-4 freshFields">
<label for="client_branch">Contact Person Name<span class="text-danger">*</span></label>
<label for="contact_person_name">Contact Person Name<span class="text-danger">*</span></label>
<input type="text" class="form-control" id="contact_person_name" name="contact_person_name"
placeholder="Enter Contact Name" required>
</div>
@ -401,7 +401,7 @@
</div>
<div class="form-group col-md-4">
<label for="">Next Reminder Date<span class="text-danger"></span></label>
<label for="next_reminder_date">Next Reminder Date<span class="text-danger"></span></label>
<div class="input-icon">
<input type="text" class="form-control" id="next_reminder_date" name="next_reminder_date" placeholder="DD/MM/YYYY">
<i class="mdi mdi-calendar-blank-outline additional-icon"></i>
@ -1243,7 +1243,7 @@
</div>
<div class="form-group col-md-4">
<label for="">Date of Commencement <span class="text-danger">*</span></label>
<label for="policy_start_date">Date of Commencement <span class="text-danger">*</span></label>
<div class="input-icon">
<input type="text" class="form-control policy_start_date" id="policy_start_date_${increment}" name="policy_start_date[]" placeholder="Enter DOC" onchange="calculatePolicyMetrics(this)">
<i class="mdi mdi-calendar-blank-outline additional-icon"></i>
@ -1252,7 +1252,7 @@
</div>
<div class="form-group col-md-4">
<label for="">Date of Expiry <span class="text-danger">*</span></label>
<label for="policy_end_date">Date of Expiry <span class="text-danger">*</span></label>
<div class="input-icon">
<input type="text" class="form-control policy_end_date" id="policy_end_date_${increment}" name="policy_end_date[]" placeholder="Enter DOE">
<i class="mdi mdi-calendar-blank-outline additional-icon"></i>

View File

@ -244,6 +244,10 @@
appendClients(res.clients, res.client_id);
appendBranch(res.branches, res.branch_id);
$('#client_name').val($('#client_name_for_modal').val());
$('#client_short_name').val($('#client_short_name_for_modal').val());
$('#contact_person_name').val(res.data.name);
$('#gst').val(res.data.gst);
$('#branch_name').val(res.data.branch_name);
$('#branch_code').val(res.data.branch_code);

View File

@ -6,7 +6,7 @@
<div class="form-row renewalCalculation">
<div class="form-group col-md-3 renewalFields" style="display: none;">
<label for="incurred_claim_date">Incurred Claim Date<span class="text-danger"></span></label>
<label for="incurred_claim_date">Incurred Claim Date<span class="text-danger">*</span></label>
<input value="<?= isset($lead_edit_data['incurred_claims_date']) ? $lead_edit_data['incurred_claims_date'] : '' ?>" type="text" class="form-control incurred_claim" id="incurred_claim_date<?= $increment ?>"
name="incurred_claim_date[]" placeholder="Enter DOE" oninput="calculatePolicyMetrics(this)">
</div>