FIX_LIVE_ISSUES
This commit is contained in:
parent
c3e0b7b1fd
commit
f5750d08c0
@ -1280,8 +1280,13 @@ class TicketController extends BaseController
|
|||||||
'rules' => 'permit_empty|numeric',
|
'rules' => 'permit_empty|numeric',
|
||||||
'errors' => ['numeric' => 'Claim Amount must contain only numbers.']
|
'errors' => ['numeric' => 'Claim Amount must contain only numbers.']
|
||||||
],
|
],
|
||||||
'pod_no' => ['label' => 'POD No','rules' => 'permit_empty','errors' => []],
|
'pod_no' => [
|
||||||
|
'label' => 'POD No',
|
||||||
|
'rules' => 'permit_empty|regex_match[/^[a-zA-Z0-9 \/_-]+$/]',
|
||||||
|
'errors' => [
|
||||||
|
'regex_match' => 'The {field} may only contain letters, numbers, spaces, slashes, underscores, and hyphens.',
|
||||||
|
]
|
||||||
|
],
|
||||||
// --- ADDITIONAL / CONDITIONAL FIELDS ---
|
// --- ADDITIONAL / CONDITIONAL FIELDS ---
|
||||||
'claim_number' => ['label' => 'Claim Number','rules' => 'permit_empty|alpha_numeric_punct','errors' => ['alpha_numeric_punct' => 'Invalid Claim Number.']],
|
'claim_number' => ['label' => 'Claim Number','rules' => 'permit_empty|alpha_numeric_punct','errors' => ['alpha_numeric_punct' => 'Invalid Claim Number.']],
|
||||||
'denial_date' => ['label' => 'Denial Date','rules' => 'permit_empty|regex_match[/^\d{2}\/\d{2}\/\d{4}$/]','errors' => ['regex_match' => 'Denial Date must be dd/mm/yyyy.']],
|
'denial_date' => ['label' => 'Denial Date','rules' => 'permit_empty|regex_match[/^\d{2}\/\d{2}\/\d{4}$/]','errors' => ['regex_match' => 'Denial Date must be dd/mm/yyyy.']],
|
||||||
@ -1633,7 +1638,13 @@ class TicketController extends BaseController
|
|||||||
'rules' => 'permit_empty|numeric',
|
'rules' => 'permit_empty|numeric',
|
||||||
'errors' => ['numeric' => 'Claim Amount must contain only numbers.']
|
'errors' => ['numeric' => 'Claim Amount must contain only numbers.']
|
||||||
],
|
],
|
||||||
'pod_no' => ['label' => 'POD No','rules' => 'permit_empty','errors' => []],
|
'pod_no' => [
|
||||||
|
'label' => 'POD No',
|
||||||
|
'rules' => 'permit_empty|regex_match[/^[a-zA-Z0-9 \/_-]+$/]',
|
||||||
|
'errors' => [
|
||||||
|
'regex_match' => 'The {field} may only contain letters, numbers, spaces, slashes, underscores, and hyphens.',
|
||||||
|
]
|
||||||
|
],
|
||||||
|
|
||||||
// --- ADDITIONAL / CONDITIONAL FIELDS ---
|
// --- ADDITIONAL / CONDITIONAL FIELDS ---
|
||||||
'claim_number' => ['label' => 'Claim Number','rules' => 'permit_empty|alpha_numeric_punct','errors' => ['alpha_numeric_punct' => 'Invalid Claim Number.']],
|
'claim_number' => ['label' => 'Claim Number','rules' => 'permit_empty|alpha_numeric_punct','errors' => ['alpha_numeric_punct' => 'Invalid Claim Number.']],
|
||||||
|
|||||||
@ -192,59 +192,59 @@ class UserController extends AdminController
|
|||||||
|
|
||||||
$insert = $this->userModel->insert($userData);
|
$insert = $this->userModel->insert($userData);
|
||||||
|
|
||||||
$bookStackData = [
|
// $bookStackData = [
|
||||||
'name' => $userData['first_name'],
|
// 'name' => $userData['first_name'],
|
||||||
'email' => $userData['email'],
|
// 'email' => $userData['email'],
|
||||||
|
|
||||||
];
|
// ];
|
||||||
$this->bookStack->createEditUser($bookStackData);
|
// $this->bookStack->createEditUser($bookStackData);
|
||||||
|
|
||||||
if ($insert) {
|
// if ($insert) {
|
||||||
$teamData['user_id'] = $insert;
|
// $teamData['user_id'] = $insert;
|
||||||
foreach ($teams as $value) {
|
// foreach ($teams as $value) {
|
||||||
$teamData['team_id'] = $value;
|
// $teamData['team_id'] = $value;
|
||||||
$teamData['created_by'] = get_session_userid();
|
// $teamData['created_by'] = get_session_userid();
|
||||||
$this->userTeamsModel->insert($teamData);
|
// $this->userTeamsModel->insert($teamData);
|
||||||
}
|
// }
|
||||||
|
|
||||||
$db = \Config\Database::connect();
|
// $db = \Config\Database::connect();
|
||||||
$tableName = 'hdz_staff';
|
// $tableName = 'hdz_staff';
|
||||||
|
|
||||||
// Set default values
|
// // Set default values
|
||||||
$admin = 0;
|
// $admin = 0;
|
||||||
$acm = 0;
|
// $acm = 0;
|
||||||
$acm_id = null;
|
// $acm_id = null;
|
||||||
|
|
||||||
if ($userData['role'] == 3) {
|
// if ($userData['role'] == 3) {
|
||||||
$admin = 0;
|
// $admin = 0;
|
||||||
$acm = 1;
|
// $acm = 1;
|
||||||
$acm_id = $insert;
|
// $acm_id = $insert;
|
||||||
} else if (in_array($userData['role'], [1, 5])) {
|
// } else if (in_array($userData['role'], [1, 5])) {
|
||||||
$admin = 1;
|
// $admin = 1;
|
||||||
$acm = 0;
|
// $acm = 0;
|
||||||
$acm_id = null;
|
// $acm_id = null;
|
||||||
}
|
// }
|
||||||
|
|
||||||
$password = '12345678'; // Default password
|
// $password = '12345678'; // Default password
|
||||||
$hashedPassword = password_hash($password, PASSWORD_DEFAULT);
|
// $hashedPassword = password_hash($password, PASSWORD_DEFAULT);
|
||||||
|
|
||||||
$hdz_staff = [
|
// $hdz_staff = [
|
||||||
'emp_code' => $userData['emp_code'],
|
// 'emp_code' => $userData['emp_code'],
|
||||||
'fullname' => $userData['first_name'],
|
// 'fullname' => $userData['first_name'],
|
||||||
'username' => strtolower($userData['first_name']),
|
// 'username' => strtolower($userData['first_name']),
|
||||||
'email' => $userData['email'],
|
// 'email' => $userData['email'],
|
||||||
'admin' => $admin,
|
// 'admin' => $admin,
|
||||||
'acm' => $acm,
|
// 'acm' => $acm,
|
||||||
'acm_id' => $acm_id,
|
// 'acm_id' => $acm_id,
|
||||||
'registration' => time(),
|
// 'registration' => time(),
|
||||||
'password' => $hashedPassword,
|
// 'password' => $hashedPassword,
|
||||||
'active' => 1,
|
// '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";}',
|
// '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()]);
|
$this->myLogger->logme('error', 'User create Successfully created by id {data}', ['data' => get_session_userid()]);
|
||||||
return redirect()->to(base_url('/user/list'));
|
return redirect()->to(base_url('/user/list'));
|
||||||
@ -384,76 +384,76 @@ class UserController extends AdminController
|
|||||||
$userData['updated_by'] = get_session_userid();
|
$userData['updated_by'] = get_session_userid();
|
||||||
$update = $this->userModel->where('id', $id)->set($userData)->update();
|
$update = $this->userModel->where('id', $id)->set($userData)->update();
|
||||||
|
|
||||||
$bookStackData = [
|
// $bookStackData = [
|
||||||
'name' => $userData['first_name'],
|
// 'name' => $userData['first_name'],
|
||||||
'email' => $userData['email'],
|
// 'email' => $userData['email'],
|
||||||
];
|
// ];
|
||||||
|
|
||||||
$this->bookStack->createEditUser($bookStackData,$existingData);
|
// $this->bookStack->createEditUser($bookStackData,$existingData);
|
||||||
|
|
||||||
|
|
||||||
if ($update) {
|
// if ($update) {
|
||||||
|
|
||||||
if ($teams) {
|
// if ($teams) {
|
||||||
$this->userTeamsModel->where('user_id', $id)->delete();
|
// $this->userTeamsModel->where('user_id', $id)->delete();
|
||||||
$teamData['user_id'] = $id;
|
// $teamData['user_id'] = $id;
|
||||||
foreach ($teams as $value) {
|
// foreach ($teams as $value) {
|
||||||
$teamData['team_id'] = $value;
|
// $teamData['team_id'] = $value;
|
||||||
$teamData['created_by'] = get_session_userid();
|
// $teamData['created_by'] = get_session_userid();
|
||||||
$this->userTeamsModel->insert($teamData);
|
// $this->userTeamsModel->insert($teamData);
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
|
||||||
$db = \Config\Database::connect();
|
// $db = \Config\Database::connect();
|
||||||
$tableName = 'hdz_staff';
|
// $tableName = 'hdz_staff';
|
||||||
|
|
||||||
$hdz_staff = [
|
// $hdz_staff = [
|
||||||
'emp_code' => $userData['emp_code'],
|
// 'emp_code' => $userData['emp_code'],
|
||||||
'fullname' => $userData['first_name'],
|
// 'fullname' => $userData['first_name'],
|
||||||
'username' => strtolower($userData['first_name']),
|
// 'username' => strtolower($userData['first_name']),
|
||||||
'email' => $userData['email'],
|
// 'email' => $userData['email'],
|
||||||
'registration' => time(),
|
// 'registration' => time(),
|
||||||
'active' => 1,
|
// '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";}',
|
// '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";}',
|
||||||
];
|
// ];
|
||||||
|
|
||||||
if ($userData['role'] == 3) {
|
// if ($userData['role'] == 3) {
|
||||||
$hdz_staff['admin'] = 0;
|
// $hdz_staff['admin'] = 0;
|
||||||
$hdz_staff['acm'] = 1;
|
// $hdz_staff['acm'] = 1;
|
||||||
$hdz_staff['acm_id'] = $id;
|
// $hdz_staff['acm_id'] = $id;
|
||||||
} elseif (in_array($userData['role'], [1, 5])) {
|
// } elseif (in_array($userData['role'], [1, 5])) {
|
||||||
$hdz_staff['admin'] = 1;
|
// $hdz_staff['admin'] = 1;
|
||||||
$hdz_staff['acm'] = 0;
|
// $hdz_staff['acm'] = 0;
|
||||||
$hdz_staff['acm_id'] = null;
|
// $hdz_staff['acm_id'] = null;
|
||||||
} else {
|
// } else {
|
||||||
|
|
||||||
return redirect()->to(base_url('/user/list'));
|
// return redirect()->to(base_url('/user/list'));
|
||||||
}
|
// }
|
||||||
|
|
||||||
// Check if staff data exists
|
// // Check if staff data exists
|
||||||
$staffData = $db->table($tableName)
|
// $staffData = $db->table($tableName)
|
||||||
// ->where('emp_code', $userData['emp_code'])
|
// // ->where('emp_code', $userData['emp_code'])
|
||||||
->where('email', $userData['email'])
|
// ->where('email', $userData['email'])
|
||||||
->get()->getResult();
|
// ->get()->getResult();
|
||||||
|
|
||||||
if (!empty($staffData)) {
|
// if (!empty($staffData)) {
|
||||||
|
|
||||||
// Update existing record
|
// // Update existing record
|
||||||
$db->table($tableName)
|
// $db->table($tableName)
|
||||||
// ->where('emp_code', $userData['emp_code'])
|
// // ->where('emp_code', $userData['emp_code'])
|
||||||
->where('email', $userData['email'])
|
// ->where('email', $userData['email'])
|
||||||
->set($hdz_staff)->update();
|
// ->set($hdz_staff)->update();
|
||||||
|
|
||||||
} else {
|
// } else {
|
||||||
|
|
||||||
$password = '12345678'; // Default password
|
// $password = '12345678'; // Default password
|
||||||
$hdz_staff['password'] = password_hash($password, PASSWORD_DEFAULT);
|
// $hdz_staff['password'] = password_hash($password, PASSWORD_DEFAULT);
|
||||||
|
|
||||||
// Insert new record
|
// // Insert new record
|
||||||
$db->table($tableName)->insert($hdz_staff);
|
// $db->table($tableName)->insert($hdz_staff);
|
||||||
}
|
// }
|
||||||
|
|
||||||
}
|
// }
|
||||||
|
|
||||||
return redirect()->to(base_url('/user/list'));
|
return redirect()->to(base_url('/user/list'));
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2330,13 +2330,13 @@ body[data-sidebar-size="condensed"] .footer {
|
|||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
<li class="li-seperate" id="user-manual-li">
|
<!-- <li class="li-seperate" id="user-manual-li">
|
||||||
<a id="user_manual" href="<?= base_url("autobookstackLogin") ?>" class="waves-effect img-inactive" target="_blank" rel="noopener noreferrer">
|
<a id="user_manual" href="<?= base_url("autobookstackLogin") ?>" class="waves-effect img-inactive" target="_blank" rel="noopener noreferrer">
|
||||||
<img
|
<img
|
||||||
src="<?= base_url() . "public"; ?>/assets/images/user_manual_sb.png" alt="Logo" height="20">
|
src="<?= base_url() . "public"; ?>/assets/images/user_manual_sb.png" alt="Logo" height="20">
|
||||||
<span>User Manual</span>
|
<span>User Manual</span>
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li> -->
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<!-- End Sidebar -->
|
<!-- End Sidebar -->
|
||||||
|
|||||||
@ -346,10 +346,7 @@
|
|||||||
|
|
||||||
<div class="form-group col-md-3">
|
<div class="form-group col-md-3">
|
||||||
<label class="label-font-size" id="pod_no_label_1" for="pod_no">POD No with Courier Name <span id="pod_no_label_1_span" class="text-danger"></span></label>
|
<label class="label-font-size" id="pod_no_label_1" for="pod_no">POD No with Courier Name <span id="pod_no_label_1_span" class="text-danger"></span></label>
|
||||||
<input type="text" class="form-control" id="pod_no" placeholder="Enter POD NO"
|
<input type="text" class="form-control" id="pod_no" placeholder="Enter POD NO" value="<?= isset($ticket_data['pod_no']) ? $ticket_data['pod_no'] : '' ?>" name="pod_no">
|
||||||
value="<?= isset($ticket_data['pod_no']) ? $ticket_data['pod_no'] : '' ?>"
|
|
||||||
oninput="this.value = this.value.replace(/[^0-9]/g, '');"
|
|
||||||
name="pod_no">
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user