Merge branch 'test' into uat
This commit is contained in:
commit
e30491891c
@ -4563,6 +4563,10 @@ class ClientController extends AdminController
|
|||||||
// $this->loadLayout('tat_report_band_wise_list', $reportData);
|
// $this->loadLayout('tat_report_band_wise_list', $reportData);
|
||||||
// $data = $ticketModel->getTATReport(1);
|
// $data = $ticketModel->getTATReport(1);
|
||||||
|
|
||||||
|
|
||||||
|
// $empmodel = new EmployeeModel();
|
||||||
|
// $data = $empmodel->getEmployeePolicy(348);
|
||||||
|
// dd($data);
|
||||||
}
|
}
|
||||||
|
|
||||||
// -------------------------------------------------------------------------------------------------------
|
// -------------------------------------------------------------------------------------------------------
|
||||||
|
|||||||
@ -112,8 +112,10 @@ class RestAuthenticationController extends AdminController
|
|||||||
public function verifyEmployeeWithEmailId()
|
public function verifyEmployeeWithEmailId()
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
$email = $this->request->getJSON()->email;
|
|
||||||
|
|
||||||
|
$data = $this->request->getJSON();
|
||||||
|
|
||||||
|
$email = $data->email;
|
||||||
|
|
||||||
$employeeData = $this->employeeModel->select('
|
$employeeData = $this->employeeModel->select('
|
||||||
employees.relationship,
|
employees.relationship,
|
||||||
@ -136,10 +138,15 @@ class RestAuthenticationController extends AdminController
|
|||||||
|
|
||||||
$otp = random_int(100000, 999999);
|
$otp = random_int(100000, 999999);
|
||||||
|
|
||||||
$update = $this->employeeModel->where('email_corporate', $email)->where('relationship', 'Self')
|
$update = $this->employeeModel->where('email_corporate', $email)->where('relationship', 'self')
|
||||||
->where('is_active', 1)->set(array('otp' => $otp ))
|
->where('is_active', 1)->set(array('otp' => $otp ))
|
||||||
->update();
|
->update();
|
||||||
if ($update) {
|
|
||||||
|
if($update)
|
||||||
|
{
|
||||||
|
$data->otp = $otp;
|
||||||
|
$this->callThirdPartyAPI($data, 'updateEmpOTP');
|
||||||
|
|
||||||
|
|
||||||
$common = [
|
$common = [
|
||||||
'client_id' => $employeeData['client_id'],
|
'client_id' => $employeeData['client_id'],
|
||||||
|
|||||||
@ -149,7 +149,21 @@ class EmployeeModel extends Model
|
|||||||
{
|
{
|
||||||
|
|
||||||
return $this->db->table('employee_polices')
|
return $this->db->table('employee_polices')
|
||||||
->select(' policy_type.long_name as Policy_Name , client_policy.policy_terms as Policy_Terms, client_policy.client_id as ClientId, client_policy.policy_id as PolicyId,client_policy.id as ClientPolicyId, client_policy.open_for_enrollment as OpenForEnrollment,client_policy.disclaimer,client_policy.policy_type_id , employee_polices.tpa_id as tpa_id , employee_polices.rand_string as rand_string') // Select all columns from both tables
|
->select('
|
||||||
|
policy_type.long_name as Policy_Name ,
|
||||||
|
client_policy.policy_terms as Policy_Terms,
|
||||||
|
client_policy.client_id as ClientId,
|
||||||
|
client_policy.policy_id as PolicyId,
|
||||||
|
client_policy.id as ClientPolicyId,
|
||||||
|
CASE
|
||||||
|
WHEN client_policy.open_for_enrollment IS NULL THEN 0
|
||||||
|
ELSE client_policy.open_for_enrollment
|
||||||
|
END AS OpenForEnrollment,
|
||||||
|
client_policy.disclaimer,
|
||||||
|
client_policy.policy_type_id ,
|
||||||
|
employee_polices.tpa_id as tpa_id ,
|
||||||
|
employee_polices.rand_string as rand_string
|
||||||
|
', FALSE) // Select all columns from both tables
|
||||||
->join('client_policy', 'client_policy.id = employee_polices.client_policy_id')
|
->join('client_policy', 'client_policy.id = employee_polices.client_policy_id')
|
||||||
->join('policy_type', 'policy_type.id = client_policy.policy_type_id')
|
->join('policy_type', 'policy_type.id = client_policy.policy_type_id')
|
||||||
->where('client_policy.policy_status', 1)
|
->where('client_policy.policy_status', 1)
|
||||||
|
|||||||
@ -202,6 +202,7 @@ table.dataTable thead th {
|
|||||||
|
|
||||||
customDropdown.querySelectorAll('.dropdown-item').forEach(item => {
|
customDropdown.querySelectorAll('.dropdown-item').forEach(item => {
|
||||||
item.addEventListener('click', function(e) {
|
item.addEventListener('click', function(e) {
|
||||||
|
e.preventDefault();
|
||||||
const onclickAttr = this.getAttribute('onclick');
|
const onclickAttr = this.getAttribute('onclick');
|
||||||
if (onclickAttr) {
|
if (onclickAttr) {
|
||||||
eval(onclickAttr);
|
eval(onclickAttr);
|
||||||
|
|||||||
@ -264,8 +264,21 @@ function init() {
|
|||||||
|
|
||||||
const customDropdown = document.createElement('div');
|
const customDropdown = document.createElement('div');
|
||||||
customDropdown.className = 'custom-dropdown-menu';
|
customDropdown.className = 'custom-dropdown-menu';
|
||||||
|
|
||||||
|
// Clone original dropdown items while moving onclick handlers to data attributes
|
||||||
|
const originalItems = originalDropdown.querySelectorAll('.dropdown-item');
|
||||||
customDropdown.innerHTML = originalDropdown.innerHTML;
|
customDropdown.innerHTML = originalDropdown.innerHTML;
|
||||||
|
|
||||||
|
// Transfer onclick handlers to data attributes
|
||||||
|
customDropdown.querySelectorAll('.dropdown-item').forEach((item, index) => {
|
||||||
|
const originalItem = originalItems[index];
|
||||||
|
const originalOnclick = originalItem.getAttribute('onclick');
|
||||||
|
if (originalOnclick) {
|
||||||
|
item.setAttribute('data-onclick', originalOnclick);
|
||||||
|
item.removeAttribute('onclick'); // Remove original handler
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
return customDropdown;
|
return customDropdown;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -287,7 +300,10 @@ function init() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function handleItemClick(e, item) {
|
function handleItemClick(e, item) {
|
||||||
const onclickAttr = item.getAttribute('onclick');
|
e.preventDefault();
|
||||||
|
|
||||||
|
// Execute the stored onclick handler
|
||||||
|
const onclickAttr = item.getAttribute('data-onclick');
|
||||||
if (onclickAttr) {
|
if (onclickAttr) {
|
||||||
eval(onclickAttr);
|
eval(onclickAttr);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -420,17 +420,21 @@ document.addEventListener("DOMContentLoaded", function () {
|
|||||||
|
|
||||||
// Create custom dropdown
|
// Create custom dropdown
|
||||||
function createCustomDropdown(row) {
|
function createCustomDropdown(row) {
|
||||||
// Get the original dropdown items
|
|
||||||
const originalDropdown = row.querySelector('.dropdown-menu');
|
const originalDropdown = row.querySelector('.dropdown-menu');
|
||||||
if (!originalDropdown) return null;
|
if (!originalDropdown) return null;
|
||||||
|
|
||||||
// Create new dropdown with proper background and spacing
|
|
||||||
const customDropdown = document.createElement('div');
|
const customDropdown = document.createElement('div');
|
||||||
customDropdown.className = 'custom-dropdown-menu';
|
customDropdown.className = 'custom-dropdown-menu';
|
||||||
|
|
||||||
// Copy inner content while maintaining icon alignment
|
|
||||||
customDropdown.innerHTML = originalDropdown.innerHTML;
|
customDropdown.innerHTML = originalDropdown.innerHTML;
|
||||||
|
|
||||||
|
// Remove inline onclick handlers and store them in data attributes
|
||||||
|
const originalItems = originalDropdown.querySelectorAll('.dropdown-item');
|
||||||
|
customDropdown.querySelectorAll('.dropdown-item').forEach((item, index) => {
|
||||||
|
const originalOnclick = originalItems[index].getAttribute('onclick');
|
||||||
|
item.removeAttribute('onclick'); // Remove the inline handler
|
||||||
|
item.setAttribute('data-onclick', originalOnclick); // Store in data attribute
|
||||||
|
});
|
||||||
|
|
||||||
return customDropdown;
|
return customDropdown;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -444,45 +448,34 @@ document.addEventListener("DOMContentLoaded", function () {
|
|||||||
document.body.appendChild(customDropdown);
|
document.body.appendChild(customDropdown);
|
||||||
|
|
||||||
row.addEventListener("click", function(event) {
|
row.addEventListener("click", function(event) {
|
||||||
// Ignore clicks on the first column (td:first-child)
|
// Ignore clicks on the first column
|
||||||
if (event.target.closest('td:first-child')) {
|
if (event.target.closest('td:first-child')) return;
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Hide any active dropdown
|
if (activeDropdown) activeDropdown.style.display = 'none';
|
||||||
if (activeDropdown) {
|
|
||||||
activeDropdown.style.display = 'none';
|
|
||||||
}
|
|
||||||
|
|
||||||
// Get click position
|
|
||||||
const rect = event.target.getBoundingClientRect();
|
const rect = event.target.getBoundingClientRect();
|
||||||
|
|
||||||
// Position the dropdown with some offset
|
|
||||||
customDropdown.style.display = 'block';
|
customDropdown.style.display = 'block';
|
||||||
customDropdown.style.position = 'fixed';
|
customDropdown.style.position = 'fixed';
|
||||||
customDropdown.style.left = `${rect.left}px`;
|
customDropdown.style.left = `${rect.left}px`;
|
||||||
customDropdown.style.top = `${rect.bottom + 5}px`; // Add 5px gap
|
customDropdown.style.top = `${rect.bottom + 5}px`;
|
||||||
|
|
||||||
// Set as active dropdown
|
|
||||||
activeDropdown = customDropdown;
|
activeDropdown = customDropdown;
|
||||||
|
|
||||||
event.stopPropagation();
|
event.stopPropagation();
|
||||||
});
|
});
|
||||||
|
|
||||||
// Preserve click handlers and add auto-close
|
// Handle custom dropdown clicks
|
||||||
customDropdown.querySelectorAll('.dropdown-item').forEach(item => {
|
customDropdown.querySelectorAll('.dropdown-item').forEach(item => {
|
||||||
item.addEventListener('click', function(e) {
|
item.addEventListener('click', function(e) {
|
||||||
const onclickAttr = this.getAttribute('onclick');
|
e.preventDefault();
|
||||||
if (onclickAttr) {
|
|
||||||
eval(onclickAttr);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
// Execute the original onclick from data attribute
|
||||||
|
const onclickAttr = this.getAttribute('data-onclick');
|
||||||
|
if (onclickAttr) eval(onclickAttr);
|
||||||
|
|
||||||
|
// Handle href navigation
|
||||||
const href = this.getAttribute('href');
|
const href = this.getAttribute('href');
|
||||||
if (href && href !== '#') {
|
if (href && href !== '#') window.location.href = href;
|
||||||
window.location.href = href;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Close the dropdown after handling the click
|
|
||||||
if (activeDropdown) {
|
if (activeDropdown) {
|
||||||
activeDropdown.style.display = 'none';
|
activeDropdown.style.display = 'none';
|
||||||
activeDropdown = null;
|
activeDropdown = null;
|
||||||
@ -493,7 +486,7 @@ document.addEventListener("DOMContentLoaded", function () {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
// Close dropdown when clicking outside
|
// Close dropdown on outside click
|
||||||
document.addEventListener("click", function() {
|
document.addEventListener("click", function() {
|
||||||
if (activeDropdown) {
|
if (activeDropdown) {
|
||||||
activeDropdown.style.display = 'none';
|
activeDropdown.style.display = 'none';
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user