FEAT_CLAIM_DASH_SRI
This commit is contained in:
parent
305902eb12
commit
3b45817eb3
@ -72,6 +72,7 @@ $routes->group("/dashboard", ["filter" => "authMVC"], function ($routes) {
|
|||||||
$routes->get('get-notification', 'DashboardController::getDashboardNotifications');
|
$routes->get('get-notification', 'DashboardController::getDashboardNotifications');
|
||||||
$routes->get('acknowledge-notification/(:segment)', 'DashboardController::acknowledgeMessage/$1');
|
$routes->get('acknowledge-notification/(:segment)', 'DashboardController::acknowledgeMessage/$1');
|
||||||
$routes->get('get-pending-action', 'PendingActionsController::getPendingActions');
|
$routes->get('get-pending-action', 'PendingActionsController::getPendingActions');
|
||||||
|
$routes->post("prepareClaimSearchData","DashboardController::prepareClaimSearchData");
|
||||||
});
|
});
|
||||||
|
|
||||||
$routes->group("/client", ["filter" => "authMVC"], function ($routes) {
|
$routes->group("/client", ["filter" => "authMVC"], function ($routes) {
|
||||||
|
|||||||
@ -21,6 +21,10 @@ use App\Models\NotificationModel;
|
|||||||
use App\Models\EmployeePolicyModel;
|
use App\Models\EmployeePolicyModel;
|
||||||
use App\Controllers\PendingActionsContrller;
|
use App\Controllers\PendingActionsContrller;
|
||||||
use App\Controllers\EmpDataServiceController;
|
use App\Controllers\EmpDataServiceController;
|
||||||
|
use App\Models\TicketMasterModel;
|
||||||
|
use App\Models\LeadsModel;
|
||||||
|
use App\Models\TicketClaimStatusModel;
|
||||||
|
|
||||||
|
|
||||||
class DashboardController extends AdminController
|
class DashboardController extends AdminController
|
||||||
{
|
{
|
||||||
@ -33,8 +37,12 @@ class DashboardController extends AdminController
|
|||||||
protected $notificationModel;
|
protected $notificationModel;
|
||||||
protected $employeePolicyModel;
|
protected $employeePolicyModel;
|
||||||
protected $policyTransactionModel;
|
protected $policyTransactionModel;
|
||||||
|
protected $leadModel;
|
||||||
|
protected $ticketModel;
|
||||||
|
protected $ticketStatusModel;
|
||||||
protected $policyStatus;
|
protected $policyStatus;
|
||||||
protected $colorShades;
|
protected $colorShades;
|
||||||
|
protected $claimDashLimit;
|
||||||
|
|
||||||
protected $myLogger;
|
protected $myLogger;
|
||||||
|
|
||||||
@ -48,9 +56,76 @@ class DashboardController extends AdminController
|
|||||||
$this->employeePolicyModel = new EmployeePolicyModel();
|
$this->employeePolicyModel = new EmployeePolicyModel();
|
||||||
$this->clientModel = new ClientModel();
|
$this->clientModel = new ClientModel();
|
||||||
$this->policyTransactionModel = new PolicyTransactionModel();
|
$this->policyTransactionModel = new PolicyTransactionModel();
|
||||||
|
$this->ticketModel = new TicketMasterModel();
|
||||||
|
$this->leadModel = new LeadsModel();
|
||||||
|
$this->ticketStatusModel = new TicketClaimStatusModel();
|
||||||
|
|
||||||
$this->myLogger = \Config\Services::mylogger();
|
$this->myLogger = \Config\Services::mylogger();
|
||||||
|
|
||||||
|
$this->claimDashLimit = [
|
||||||
|
1 => [
|
||||||
|
'non_id' => 3,
|
||||||
|
'id_not_generated' => 3,
|
||||||
|
'cda' => 3,
|
||||||
|
'information_required' => 3,
|
||||||
|
'under_process' => 3,
|
||||||
|
'rejected' => 3,
|
||||||
|
'approved' => 3,
|
||||||
|
'payment_initiated' => 3,
|
||||||
|
'settled' => 3,
|
||||||
|
'closed' => 3,
|
||||||
|
'cancelled' => 3,
|
||||||
|
'returned' => 3
|
||||||
|
],
|
||||||
|
|
||||||
|
2 => [
|
||||||
|
'claim_intimation' => 3,
|
||||||
|
'intimation_to_insurer' => 3,
|
||||||
|
'client_pending' => 3,
|
||||||
|
'insurer_pending' => 3,
|
||||||
|
'investigation' => 3,
|
||||||
|
'approved' => 3,
|
||||||
|
'closed' => 3,
|
||||||
|
'not_covered' => 3,
|
||||||
|
'settled' => 3,
|
||||||
|
'coverage_check' => 3,
|
||||||
|
'cancelled' => 3,
|
||||||
|
'returned' => 3,
|
||||||
|
'rejected' => 3,
|
||||||
|
'dv_sent_to_insured' => 3
|
||||||
|
],
|
||||||
|
3 => [
|
||||||
|
'claim_intimation' => 3,
|
||||||
|
'intimation_to_insurer' => 3,
|
||||||
|
'client_pending' => 3,
|
||||||
|
'insurer_pending' => 3,
|
||||||
|
'investigation' => 3,
|
||||||
|
'approved' => 3,
|
||||||
|
'closed' => 3,
|
||||||
|
'not_covered' => 3,
|
||||||
|
'settled' => 3,
|
||||||
|
'coverage_check' => 3,
|
||||||
|
'cancelled' => 3,
|
||||||
|
'returned' => 3,
|
||||||
|
'rejected' => 3
|
||||||
|
],
|
||||||
|
4 => [
|
||||||
|
'claim_intimation' => 3,
|
||||||
|
'intimation_to_insurer' => 3,
|
||||||
|
'client_pending' => 3,
|
||||||
|
'insurer_pending' => 3,
|
||||||
|
'investigation' => 3,
|
||||||
|
'approved' => 3,
|
||||||
|
'closed' => 3,
|
||||||
|
'not_covered' => 3,
|
||||||
|
'settled' => 3,
|
||||||
|
'coverage_check' => 3,
|
||||||
|
'cancelled' => 3,
|
||||||
|
'returned' => 3,
|
||||||
|
'rejected' => 3
|
||||||
|
]
|
||||||
|
];
|
||||||
|
|
||||||
$this->policyStatus = [
|
$this->policyStatus = [
|
||||||
'under_process' => 'Under Process',
|
'under_process' => 'Under Process',
|
||||||
'client_pending' => 'Client Pending',
|
'client_pending' => 'Client Pending',
|
||||||
@ -92,7 +167,6 @@ class DashboardController extends AdminController
|
|||||||
'linear-gradient(45deg, #494f4f, #353d3d)' // SilverChalice shade 6
|
'linear-gradient(45deg, #494f4f, #353d3d)' // SilverChalice shade 6
|
||||||
]
|
]
|
||||||
];
|
];
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function dashboard()
|
public function dashboard()
|
||||||
@ -100,7 +174,7 @@ class DashboardController extends AdminController
|
|||||||
|
|
||||||
$data = [];
|
$data = [];
|
||||||
|
|
||||||
if (in_array(get_role_id(), [1,2,3,5]) || (in_array(MANAGEMENT_TEAM_ID, user_team()) || in_array(FINANCE_TEAM_ID, user_team()) || in_array(BUSINESS_TEAM_ID, user_team()))) {
|
if (in_array(get_role_id(), [1, 2, 3, 5]) || (in_array(MANAGEMENT_TEAM_ID, user_team()) || in_array(FINANCE_TEAM_ID, user_team()) || in_array(BUSINESS_TEAM_ID, user_team()))) {
|
||||||
|
|
||||||
$db = db_connect();
|
$db = db_connect();
|
||||||
$sql = "SELECT
|
$sql = "SELECT
|
||||||
@ -169,10 +243,11 @@ class DashboardController extends AdminController
|
|||||||
$data['financeTeamStatusData'] = $financeTeamStatusData;
|
$data['financeTeamStatusData'] = $financeTeamStatusData;
|
||||||
$data['policyStatus'] = $this->policyStatus;
|
$data['policyStatus'] = $this->policyStatus;
|
||||||
$data['colorShades'] = $this->colorShades;
|
$data['colorShades'] = $this->colorShades;
|
||||||
// print_r($data);die;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$data['claim_data'] = $this->getClaimData();
|
||||||
|
$data['lead_data'] = $this->getLeadData();
|
||||||
|
|
||||||
$data['page_name'] = 'Dashboard';
|
$data['page_name'] = 'Dashboard';
|
||||||
|
|
||||||
echo view('layout/header', $data);
|
echo view('layout/header', $data);
|
||||||
@ -180,6 +255,53 @@ class DashboardController extends AdminController
|
|||||||
echo view('layout/footer');
|
echo view('layout/footer');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getLeadData(){
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getClaimData()
|
||||||
|
{
|
||||||
|
|
||||||
|
$results = $this->ticketStatusModel
|
||||||
|
->select("ticket_type as ticket_type_id, claim_status")
|
||||||
|
->where("is_active", 1)
|
||||||
|
->findAll();
|
||||||
|
|
||||||
|
$claim_status = [];
|
||||||
|
|
||||||
|
foreach ($results as $row) {
|
||||||
|
if (empty($row['ticket_type_id']) || empty($row['claim_status'])) {
|
||||||
|
continue; // Skip if either value is empty
|
||||||
|
}
|
||||||
|
$typeId = $row['ticket_type_id'];
|
||||||
|
$status = $row['claim_status'];
|
||||||
|
|
||||||
|
// Initialize if not set
|
||||||
|
if (!isset($claim_status[$typeId])) {
|
||||||
|
$claim_status[$typeId] = [];
|
||||||
|
}
|
||||||
|
|
||||||
|
// Use associative array keys to mimic a set
|
||||||
|
$claim_status[$typeId][$status] = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Convert set-like structure to plain array
|
||||||
|
foreach ($claim_status as $typeId => $statuses) {
|
||||||
|
$claim_status[$typeId] = array_keys($statuses);
|
||||||
|
}
|
||||||
|
$data = $this->ticketModel->getDashData($claim_status, $this->claimDashLimit);
|
||||||
|
|
||||||
|
// dd($data);
|
||||||
|
// foreach ($data as $dat){
|
||||||
|
// foreach ($dat as $key => $value){
|
||||||
|
// echo($key . " => ". $value);
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// die();
|
||||||
|
return $data;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public function getDashboardNotifications()
|
public function getDashboardNotifications()
|
||||||
{
|
{
|
||||||
@ -243,7 +365,7 @@ class DashboardController extends AdminController
|
|||||||
}
|
}
|
||||||
|
|
||||||
$myLogger->logme('error', 'enrollment_status function completed');
|
$myLogger->logme('error', 'enrollment_status function completed');
|
||||||
$myLogger->logme('error', 'updated Open Enrollment Policy count : "'.count($openEnrollment).'" and Close Enrollment Policy count : "'.count($closeEnrollment).'"');
|
$myLogger->logme('error', 'updated Open Enrollment Policy count : "' . count($openEnrollment) . '" and Close Enrollment Policy count : "' . count($closeEnrollment) . '"');
|
||||||
|
|
||||||
return $this->respond([
|
return $this->respond([
|
||||||
'status' => true,
|
'status' => true,
|
||||||
@ -253,7 +375,6 @@ class DashboardController extends AdminController
|
|||||||
'open_policy_ids' => $openEnrollment,
|
'open_policy_ids' => $openEnrollment,
|
||||||
'close_policy_ids' => $closeEnrollment,
|
'close_policy_ids' => $closeEnrollment,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function sendCroneRemainderMail()
|
public function sendCroneRemainderMail()
|
||||||
@ -271,9 +392,9 @@ class DashboardController extends AdminController
|
|||||||
|
|
||||||
$myLogger->logme('error', 'sendCroneRemainderMail function completed');
|
$myLogger->logme('error', 'sendCroneRemainderMail function completed');
|
||||||
|
|
||||||
if($result){
|
if ($result) {
|
||||||
return json_encode(['status' => true, 'message' => 'Mail send successfully']);
|
return json_encode(['status' => true, 'message' => 'Mail send successfully']);
|
||||||
}else{
|
} else {
|
||||||
return json_encode(['status' => false, 'message' => 'There is no data to send']);
|
return json_encode(['status' => false, 'message' => 'There is no data to send']);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -285,29 +406,22 @@ class DashboardController extends AdminController
|
|||||||
|
|
||||||
$data = [];
|
$data = [];
|
||||||
|
|
||||||
if($type == 'insurer'){
|
if ($type == 'insurer') {
|
||||||
|
|
||||||
$data = $pendingActionsData['uhid'];
|
$data = $pendingActionsData['uhid'];
|
||||||
|
} else if ($type == 'TPA') {
|
||||||
}else if($type == 'TPA'){
|
|
||||||
$data = $pendingActionsData['tpa'];
|
$data = $pendingActionsData['tpa'];
|
||||||
|
} else if ($type == 'I') {
|
||||||
}else if($type == 'I'){
|
|
||||||
$data = $pendingActionsData['inception'];
|
$data = $pendingActionsData['inception'];
|
||||||
|
} else if ($type == 'D') {
|
||||||
}else if($type == 'D'){
|
|
||||||
$data = $pendingActionsData['deletion'];
|
$data = $pendingActionsData['deletion'];
|
||||||
|
} else if ($type == 'C') {
|
||||||
}else if($type == 'C'){
|
|
||||||
$data = $pendingActionsData['correction'];
|
$data = $pendingActionsData['correction'];
|
||||||
|
} else if ($type == 'SI') {
|
||||||
}else if($type == 'SI'){
|
|
||||||
$data = $pendingActionsData['si_enhancement'];
|
$data = $pendingActionsData['si_enhancement'];
|
||||||
|
} else if ($type == 'policy') {
|
||||||
}else if($type == 'policy'){
|
|
||||||
$data = $pendingActionsData['policy'];
|
$data = $pendingActionsData['policy'];
|
||||||
|
} else if ($type == 'ticket') {
|
||||||
}else if($type == 'ticket'){
|
|
||||||
$data = $pendingActionsData['uhid'];
|
$data = $pendingActionsData['uhid'];
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -421,7 +535,6 @@ class DashboardController extends AdminController
|
|||||||
$reminder_whole_mail[] = $mail_result;
|
$reminder_whole_mail[] = $mail_result;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
} else { // crone
|
} else { // crone
|
||||||
|
|
||||||
if (!empty($client_policy['reminder_date'])) {
|
if (!empty($client_policy['reminder_date'])) {
|
||||||
@ -511,15 +624,12 @@ class DashboardController extends AdminController
|
|||||||
// $this->myLogger->logme('error', 'Mail sent result: ' . json_encode($mail_result));
|
// $this->myLogger->logme('error', 'Mail sent result: ' . json_encode($mail_result));
|
||||||
$reminder_whole_mail[] = $mail_result;
|
$reminder_whole_mail[] = $mail_result;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
$this->myLogger->logme('error', "SEND REMAINDER CRONE --- Remainder date is empty()");
|
$this->myLogger->logme('error', "SEND REMAINDER CRONE --- Remainder date is empty()");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
$this->myLogger->logme('error', 'Notification setup not found or not enabled');
|
$this->myLogger->logme('error', 'Notification setup not found or not enabled');
|
||||||
@ -549,7 +659,7 @@ class DashboardController extends AdminController
|
|||||||
|
|
||||||
public function sendManualReminder($client_id, $client_branch_id, $client_policy_id = null)
|
public function sendManualReminder($client_id, $client_branch_id, $client_policy_id = null)
|
||||||
{
|
{
|
||||||
$this->myLogger->logme('error','Log Works');
|
$this->myLogger->logme('error', 'Log Works');
|
||||||
|
|
||||||
$this->myLogger->logme('error', "sendManualRemainder called with client_id: {$client_id}, client_branch_id: {$client_branch_id}");
|
$this->myLogger->logme('error', "sendManualRemainder called with client_id: {$client_id}, client_branch_id: {$client_branch_id}");
|
||||||
|
|
||||||
@ -560,8 +670,8 @@ class DashboardController extends AdminController
|
|||||||
|
|
||||||
if ($client_policy_data) {
|
if ($client_policy_data) {
|
||||||
$result = $this->sendRemainderMail($client_policy_data);
|
$result = $this->sendRemainderMail($client_policy_data);
|
||||||
log_message('error',json_encode($result));
|
log_message('error', json_encode($result));
|
||||||
$this->myLogger->logme('error',$result);
|
$this->myLogger->logme('error', $result);
|
||||||
$this->myLogger->logme('error', "Manual Remainder Mail sending result: " . ($result ? 'success' : 'failure'));
|
$this->myLogger->logme('error', "Manual Remainder Mail sending result: " . ($result ? 'success' : 'failure'));
|
||||||
|
|
||||||
if ($result) {
|
if ($result) {
|
||||||
@ -569,9 +679,8 @@ class DashboardController extends AdminController
|
|||||||
return $this->respond(['status' => true, 'code' => 200, 'message' => 'Mail sent successfully'], 200);
|
return $this->respond(['status' => true, 'code' => 200, 'message' => 'Mail sent successfully'], 200);
|
||||||
} else {
|
} else {
|
||||||
$this->myLogger->logme('error', 'Failed to send manual remainder mail, no data to send');
|
$this->myLogger->logme('error', 'Failed to send manual remainder mail, no data to send');
|
||||||
return $this->respond(['status' => false, 'code' => 200, 'message' => 'There is no data to send','message2' => 'Failed' ], 200);
|
return $this->respond(['status' => false, 'code' => 200, 'message' => 'There is no data to send', 'message2' => 'Failed'], 200);
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
$this->myLogger->logme('error', 'No policy data found to send');
|
$this->myLogger->logme('error', 'No policy data found to send');
|
||||||
return $this->respond(['status' => false, 'code' => 200, 'message' => 'There is no data to send', 'message2' => 'No policy data found to send'], 200);
|
return $this->respond(['status' => false, 'code' => 200, 'message' => 'There is no data to send', 'message2' => 'No policy data found to send'], 200);
|
||||||
@ -582,18 +691,16 @@ class DashboardController extends AdminController
|
|||||||
{
|
{
|
||||||
$this->myLogger->logme('error', "sendManualEcard called with client_id: {$client_id}, client_branch_id: {$client_branch_id}, policy id : {$policy_id}");
|
$this->myLogger->logme('error', "sendManualEcard called with client_id: {$client_id}, client_branch_id: {$client_branch_id}, policy id : {$policy_id}");
|
||||||
|
|
||||||
$notification = $this->notificationModel->where('client_id', $client_id)->where('template_name', 'member_ecard_mail')->first();
|
$notification = $this->notificationModel->where('client_id', $client_id)->where('template_name', 'member_ecard_mail')->first();
|
||||||
// print_r(($notification)); die;
|
// print_r(($notification)); die;
|
||||||
if($notification && $notification['enabled'] == 0 && $notification['mail_content'] == '')
|
if ($notification && $notification['enabled'] == 0 && $notification['mail_content'] == '') {
|
||||||
{
|
return $this->respond(['status' => false, 'code' => 400, 'message' => 'No template found', 'message2' => 'Failed'], 200);
|
||||||
return $this->respond(['status' => false, 'code' => 400, 'message' => 'No template found','message2' => 'Failed' ], 200);
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
$emp_data = $this->employeePolicyModel->getEmployeePolicyForEcard($policy_id);
|
$emp_data = $this->employeePolicyModel->getEmployeePolicyForEcard($policy_id);
|
||||||
if(count($emp_data) == 0)
|
if (count($emp_data) == 0) {
|
||||||
{
|
return $this->respond(['status' => false, 'code' => 400, 'message' => 'No employees found', 'message2' => 'Failed'], 200);
|
||||||
return $this->respond(['status' => false, 'code' => 400, 'message' => 'No employees found','message2' => 'Failed' ], 200);
|
|
||||||
}
|
}
|
||||||
$ids = array_column($emp_data, 'id');
|
$ids = array_column($emp_data, 'id');
|
||||||
// print_r(($ids)); die;
|
// print_r(($ids)); die;
|
||||||
@ -605,7 +712,6 @@ class DashboardController extends AdminController
|
|||||||
|
|
||||||
|
|
||||||
return $this->respond(['status' => true, 'code' => 200, 'message' => 'Mail Queued'], 200);
|
return $this->respond(['status' => true, 'code' => 200, 'message' => 'Mail Queued'], 200);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function data_construct_for_bds($data)
|
public function data_construct_for_bds($data)
|
||||||
@ -659,4 +765,21 @@ class DashboardController extends AdminController
|
|||||||
return $groupedData;
|
return $groupedData;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function prepareClaimSearchData(){
|
||||||
|
|
||||||
|
$received_data = $this->request->getPost();
|
||||||
|
$ticketTypeId = $received_data['ticketTypeId'];
|
||||||
|
$status = $received_data['status'];
|
||||||
|
|
||||||
|
$status = strtoupper($status);
|
||||||
|
$status = str_replace('_', ' ', $status);
|
||||||
|
|
||||||
|
$data = $this->ticketModel
|
||||||
|
->select("tcs.id as claim_status_id")
|
||||||
|
->join("ticket_claim_status tcs", "tcs.ticket_type = " . (int)$ticketTypeId)
|
||||||
|
->where("tcs.claim_status", $status)
|
||||||
|
->first();
|
||||||
|
$data['ticket_type_id'] = $ticketTypeId;
|
||||||
|
return $this->respond(['status' => "success","data" => $data],200);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -182,8 +182,18 @@ class TicketController extends BaseController
|
|||||||
} else {
|
} else {
|
||||||
|
|
||||||
$data['ticket_data'] = $this->ticketSearch();
|
$data['ticket_data'] = $this->ticketSearch();
|
||||||
$html = view('ticket_list', $data);
|
$isFromDashboard = $this->request->getPost("is_dashboard");
|
||||||
return $this->respond(['status' => true, 'html' => $html], 200);
|
|
||||||
|
if (isset($isFromDashboard) && !empty($isFromDashboard) && $isFromDashboard == 1) {
|
||||||
|
$data['page_name'] = "Claims";
|
||||||
|
$data['claim_status'] = $this->claimStatus->select('id,ticket_type,claim_status')->where('is_active', 1)->findAll();
|
||||||
|
$data['client_list'] = $this->clientModel->select('id,client_name')->where('is_active', 1)->findAll();
|
||||||
|
return $this->loadLayout('ticket_search', $data);
|
||||||
|
}else{
|
||||||
|
$html = view('ticket_list', $data);
|
||||||
|
return $this->respond(['status' => true, 'html' => $html], 200);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -260,10 +270,10 @@ class TicketController extends BaseController
|
|||||||
|
|
||||||
} else {
|
} else {
|
||||||
$search_data = $this->request->getPost();
|
$search_data = $this->request->getPost();
|
||||||
// print_r($search_data);
|
// print_r($search_data); die()
|
||||||
$where = [];
|
$where = [];
|
||||||
foreach ($search_data as $search_objects => $key) {
|
foreach ($search_data as $search_objects => $key) {
|
||||||
if ($key != null && $key != '' && $key != 0) {
|
if ($key != null && $key != '' && $key != 0 && $search_objects != 'is_dashboard') {
|
||||||
$where[$search_objects] = $key;
|
$where[$search_objects] = $key;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1361,7 +1361,10 @@ class PolicyTransactionModel extends Model
|
|||||||
|
|
||||||
$builder->orderBy('policy_transaction.id', 'desc');
|
$builder->orderBy('policy_transaction.id', 'desc');
|
||||||
|
|
||||||
return $builder->get()->getResultArray();
|
$returnData = $builder->get()->getResultArray();
|
||||||
|
|
||||||
|
|
||||||
|
return $returnData;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getFinanceReportList($start_date = 0, $end_date = 0, $client_id = 0, $insurer_id = 0, $policy_type_id = 0, $date_type = 0, $issuer = 0, $status = 0)
|
public function getFinanceReportList($start_date = 0, $end_date = 0, $client_id = 0, $insurer_id = 0, $policy_type_id = 0, $date_type = 0, $issuer = 0, $status = 0)
|
||||||
|
|||||||
@ -130,21 +130,21 @@ class TicketMasterModel extends Model
|
|||||||
public function getTemplateDataByTicketID($ticket_id)
|
public function getTemplateDataByTicketID($ticket_id)
|
||||||
{
|
{
|
||||||
$template_data = $this
|
$template_data = $this
|
||||||
->select("ticket_mail_template.*, CASE
|
->select("ticket_mail_template.*, CASE
|
||||||
WHEN employees.email_corporate IS NULL OR employees.email_corporate = ''
|
WHEN employees.email_corporate IS NULL OR employees.email_corporate = ''
|
||||||
THEN ticket_master.emp_mail
|
THEN ticket_master.emp_mail
|
||||||
ELSE employees.email_corporate
|
ELSE employees.email_corporate
|
||||||
END as emp_mail, ,ticket_master.claim_status_id")
|
END as emp_mail, ,ticket_master.claim_status_id")
|
||||||
->join('ticket_claim_status', 'ticket_master.claim_status_id = ticket_claim_status.id and ticket_claim_status.is_active = 1')
|
->join('ticket_claim_status', 'ticket_master.claim_status_id = ticket_claim_status.id and ticket_claim_status.is_active = 1')
|
||||||
->join('ticket_mail_template', '
|
->join('ticket_mail_template', '
|
||||||
ticket_claim_status.trigger_type = ticket_mail_template.trigger_type
|
ticket_claim_status.trigger_type = ticket_mail_template.trigger_type
|
||||||
and ticket_claim_status.ticket_type = ticket_mail_template.ticket_type
|
and ticket_claim_status.ticket_type = ticket_mail_template.ticket_type
|
||||||
and ticket_mail_template.is_active = 1')
|
and ticket_mail_template.is_active = 1')
|
||||||
->join('employees','employees.id = ticket_master.emp_id','left')
|
->join('employees', 'employees.id = ticket_master.emp_id', 'left')
|
||||||
->where('ticket_master.id', $ticket_id)
|
->where('ticket_master.id', $ticket_id)
|
||||||
->where('ticket_master.is_active', 1)
|
->where('ticket_master.is_active', 1)
|
||||||
->where('ticket_claim_status.is_active', 1)
|
->where('ticket_claim_status.is_active', 1)
|
||||||
->first();
|
->first();
|
||||||
|
|
||||||
return $template_data;
|
return $template_data;
|
||||||
}
|
}
|
||||||
@ -173,9 +173,9 @@ class TicketMasterModel extends Model
|
|||||||
->join('clients', 'ticket_master.client_id = clients.id', 'left')
|
->join('clients', 'ticket_master.client_id = clients.id', 'left')
|
||||||
->join('insurers', 'ticket_master.insurer_id = insurers.id', 'left')
|
->join('insurers', 'ticket_master.insurer_id = insurers.id', 'left')
|
||||||
->join('tpa', 'ticket_master.tpa_id = tpa.id', 'left')
|
->join('tpa', 'ticket_master.tpa_id = tpa.id', 'left')
|
||||||
->join('ticket_notes', 'ticket_master.id = ticket_notes.ticket_id and ticket_notes.is_active = 1 and ticket_notes.is_auto_query = 1','left')
|
->join('ticket_notes', 'ticket_master.id = ticket_notes.ticket_id and ticket_notes.is_active = 1 and ticket_notes.is_auto_query = 1', 'left')
|
||||||
->join('user_profiles', 'ticket_master.acm_id = user_profiles.id', 'left')
|
->join('user_profiles', 'ticket_master.acm_id = user_profiles.id', 'left')
|
||||||
->join('employees','employees.id = ticket_master.emp_id','left')
|
->join('employees', 'employees.id = ticket_master.emp_id', 'left')
|
||||||
->where('ticket_master.id', $ticket_id)
|
->where('ticket_master.id', $ticket_id)
|
||||||
->where('ticket_master.is_active', 1)
|
->where('ticket_master.is_active', 1)
|
||||||
->first();
|
->first();
|
||||||
@ -345,9 +345,9 @@ class TicketMasterModel extends Model
|
|||||||
}
|
}
|
||||||
$ticket_type_data_1 = "";
|
$ticket_type_data_1 = "";
|
||||||
$ticket_type_data_2 = "";
|
$ticket_type_data_2 = "";
|
||||||
if(!empty($ticket_type)){
|
if (!empty($ticket_type)) {
|
||||||
$ticket_type_data_1 = "AND ticket_type = $ticket_type";
|
$ticket_type_data_1 = "AND ticket_type = $ticket_type";
|
||||||
$ticket_type_data_2 = "WHERE tm.ticket_type_id = $ticket_type";
|
$ticket_type_data_2 = "WHERE tm.ticket_type_id = $ticket_type";
|
||||||
}
|
}
|
||||||
|
|
||||||
// Fetch claim statuses from the `ticket_claim_status` table
|
// Fetch claim statuses from the `ticket_claim_status` table
|
||||||
@ -488,8 +488,9 @@ class TicketMasterModel extends Model
|
|||||||
return $data;
|
return $data;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function tpaWiseReport($policy_type = null ,$start_date = null, $end_date = null){
|
public function tpaWiseReport($policy_type = null, $start_date = null, $end_date = null)
|
||||||
$ticket_type_data_1 = "";
|
{
|
||||||
|
$ticket_type_data_1 = "";
|
||||||
$ticket_type_data_2 = "";
|
$ticket_type_data_2 = "";
|
||||||
|
|
||||||
if (!empty($policy_type)) {
|
if (!empty($policy_type)) {
|
||||||
@ -511,8 +512,17 @@ class TicketMasterModel extends Model
|
|||||||
$dynamicSelect .= "
|
$dynamicSelect .= "
|
||||||
COUNT(CASE WHEN master.claim_status_id = {$status['id']} THEN master.id END) AS `{$status['claim_status']}`, ";
|
COUNT(CASE WHEN master.claim_status_id = {$status['id']} THEN master.id END) AS `{$status['claim_status']}`, ";
|
||||||
|
|
||||||
if (in_array($status['claim_status'], ['ID NOT GENERATED', 'NON ID', 'CDA', 'INFORMATION REQUIRED','UNDER PROCESS - CLAIM NO. UPDATION',
|
if (in_array($status['claim_status'], [
|
||||||
'UNDER PROCESS - INVESTIGATION STATUS','UNDER PROCESS - QUERY DOCUMENT RECEIVED','APPROVED','PAYMENT INITIATED'])) {
|
'ID NOT GENERATED',
|
||||||
|
'NON ID',
|
||||||
|
'CDA',
|
||||||
|
'INFORMATION REQUIRED',
|
||||||
|
'UNDER PROCESS - CLAIM NO. UPDATION',
|
||||||
|
'UNDER PROCESS - INVESTIGATION STATUS',
|
||||||
|
'UNDER PROCESS - QUERY DOCUMENT RECEIVED',
|
||||||
|
'APPROVED',
|
||||||
|
'PAYMENT INITIATED'
|
||||||
|
])) {
|
||||||
$dynamicTotal .= "COUNT(CASE WHEN master.claim_status_id = {$status['id']} THEN master.id END) + ";
|
$dynamicTotal .= "COUNT(CASE WHEN master.claim_status_id = {$status['id']} THEN master.id END) + ";
|
||||||
}
|
}
|
||||||
// Include in total count
|
// Include in total count
|
||||||
@ -553,47 +563,47 @@ class TicketMasterModel extends Model
|
|||||||
|
|
||||||
// print_rr($result);die();
|
// print_rr($result);die();
|
||||||
return $result;
|
return $result;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function accountManagerWiseReport($policy_type = null ,$start_date = null, $end_date = null){
|
public function accountManagerWiseReport($policy_type = null, $start_date = null, $end_date = null)
|
||||||
|
{
|
||||||
|
|
||||||
if ($policy_type == 1) {
|
if ($policy_type == 1) {
|
||||||
$ticket_type_data_1 = "";
|
$ticket_type_data_1 = "";
|
||||||
$ticket_type_data_2 = "";
|
$ticket_type_data_2 = "";
|
||||||
|
|
||||||
if (!empty($policy_type)) {
|
if (!empty($policy_type)) {
|
||||||
$ticket_type_data_1 = "AND ticket_type = $policy_type";
|
$ticket_type_data_1 = "AND ticket_type = $policy_type";
|
||||||
$ticket_type_data_2 = "AND master.ticket_type_id = $policy_type";
|
$ticket_type_data_2 = "AND master.ticket_type_id = $policy_type";
|
||||||
}
|
}
|
||||||
|
|
||||||
// Fetch claim statuses dynamically
|
// Fetch claim statuses dynamically
|
||||||
$statusQuery = "SELECT id, claim_status FROM ticket_claim_status WHERE is_active = 1 $ticket_type_data_1";
|
$statusQuery = "SELECT id, claim_status FROM ticket_claim_status WHERE is_active = 1 $ticket_type_data_1";
|
||||||
$statusResult = $this->db->query($statusQuery)->getResultArray();
|
$statusResult = $this->db->query($statusQuery)->getResultArray();
|
||||||
|
|
||||||
// Initialize dynamic query parts
|
// Initialize dynamic query parts
|
||||||
$dynamicSelect = '';
|
$dynamicSelect = '';
|
||||||
$dynamicTotal = '';
|
$dynamicTotal = '';
|
||||||
|
|
||||||
// Loop through each claim status and generate the CASE statements
|
// Loop through each claim status and generate the CASE statements
|
||||||
foreach ($statusResult as $status) {
|
foreach ($statusResult as $status) {
|
||||||
$dynamicSelect .= "
|
$dynamicSelect .= "
|
||||||
COUNT(CASE WHEN master.claim_status_id = {$status['id']} THEN master.id END) AS `{$status['claim_status']}`, ";
|
COUNT(CASE WHEN master.claim_status_id = {$status['id']} THEN master.id END) AS `{$status['claim_status']}`, ";
|
||||||
|
|
||||||
|
|
||||||
// Include in total count
|
// Include in total count
|
||||||
$dynamicTotal .= "COUNT(CASE WHEN master.claim_status_id = {$status['id']} THEN master.id END) + ";
|
$dynamicTotal .= "COUNT(CASE WHEN master.claim_status_id = {$status['id']} THEN master.id END) + ";
|
||||||
|
|
||||||
// Include only closed-related statuses in total2 count
|
// Include only closed-related statuses in total2 count
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Remove the trailing commas and `+` signs
|
// Remove the trailing commas and `+` signs
|
||||||
$dynamicSelect = rtrim($dynamicSelect, ', ');
|
$dynamicSelect = rtrim($dynamicSelect, ', ');
|
||||||
$dynamicTotal = rtrim($dynamicTotal, ' +');
|
$dynamicTotal = rtrim($dynamicTotal, ' +');
|
||||||
// print_rr($dynamicSelect);
|
// print_rr($dynamicSelect);
|
||||||
// Construct the final SQL query
|
// Construct the final SQL query
|
||||||
$sql = "
|
$sql = "
|
||||||
SELECT
|
SELECT
|
||||||
user_profiles.first_name AS ACM_NAME,
|
user_profiles.first_name AS ACM_NAME,
|
||||||
$dynamicSelect,
|
$dynamicSelect,
|
||||||
@ -614,9 +624,7 @@ class TicketMasterModel extends Model
|
|||||||
// dd($result);
|
// dd($result);
|
||||||
|
|
||||||
return $result;
|
return $result;
|
||||||
|
} else {
|
||||||
|
|
||||||
}else{
|
|
||||||
$ticket_type_data_1 = "";
|
$ticket_type_data_1 = "";
|
||||||
$ticket_type_data_2 = "";
|
$ticket_type_data_2 = "";
|
||||||
|
|
||||||
@ -639,8 +647,15 @@ class TicketMasterModel extends Model
|
|||||||
$dynamicSelect .= "
|
$dynamicSelect .= "
|
||||||
COUNT(CASE WHEN master.claim_status_id = {$status['id']} THEN master.id END) AS `{$status['claim_status']}`, ";
|
COUNT(CASE WHEN master.claim_status_id = {$status['id']} THEN master.id END) AS `{$status['claim_status']}`, ";
|
||||||
|
|
||||||
if (in_array($status['claim_status'], ['CLAIM INTIMATION', 'INTIMATION TO INSURER', 'CLIENT PENDING', 'INSURER PENDING','INVESTIGATION',
|
if (in_array($status['claim_status'], [
|
||||||
'APPROVED','ON HOLD'])) {
|
'CLAIM INTIMATION',
|
||||||
|
'INTIMATION TO INSURER',
|
||||||
|
'CLIENT PENDING',
|
||||||
|
'INSURER PENDING',
|
||||||
|
'INVESTIGATION',
|
||||||
|
'APPROVED',
|
||||||
|
'ON HOLD'
|
||||||
|
])) {
|
||||||
$dynamicTotal .= "COUNT(CASE WHEN master.claim_status_id = {$status['id']} THEN master.id END) + ";
|
$dynamicTotal .= "COUNT(CASE WHEN master.claim_status_id = {$status['id']} THEN master.id END) + ";
|
||||||
}
|
}
|
||||||
// Include in total count
|
// Include in total count
|
||||||
@ -706,5 +721,81 @@ class TicketMasterModel extends Model
|
|||||||
return $data;
|
return $data;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getDashData($claim_statuses, $limit)
|
||||||
|
{
|
||||||
|
$finalResults = [];
|
||||||
|
|
||||||
|
foreach ($claim_statuses as $typeId => $statuses) {
|
||||||
|
$builder = $this->db->table('ticket_master tm');
|
||||||
|
|
||||||
|
// Start with ticket_type_id in SELECT
|
||||||
|
$selects = ['tm.ticket_type_id'];
|
||||||
|
|
||||||
|
// Dynamically build status counts with COALESCE to handle missing values
|
||||||
|
foreach ($statuses as $status) {
|
||||||
|
$alias = strtolower($status);
|
||||||
|
$alias = str_replace(' ', '_', $alias);
|
||||||
|
$selects[] = "COALESCE(SUM(CASE WHEN tcs.claim_status = " . $this->db->escape($status) . " AND tm.ticket_type_id = {$typeId} THEN 1 ELSE 0 END), 0) AS `{$alias}`";
|
||||||
|
}
|
||||||
|
|
||||||
|
$builder->select(implode(',', $selects));
|
||||||
|
$builder->join('ticket_claim_status tcs', 'tm.claim_status_id = tcs.id', 'left');
|
||||||
|
|
||||||
|
// Subquery for latest status change, with LEFT JOIN to avoid missing ticket_type_id
|
||||||
|
$builder->join(
|
||||||
|
'(SELECT ticket_id, MAX(created_at) AS last_claim_status_change
|
||||||
|
FROM ticket_history
|
||||||
|
WHERE field_name = \'claim_status_id\'
|
||||||
|
GROUP BY ticket_id) th',
|
||||||
|
'tm.id = th.ticket_id',
|
||||||
|
'left'
|
||||||
|
);
|
||||||
|
|
||||||
|
// Set the date limit based on the status
|
||||||
|
foreach ($statuses as $status) {
|
||||||
|
$dateLimit = $limit[$typeId][$status] ?? 3;
|
||||||
|
$dateThreshold = date('Y-m-d H:i:s', strtotime("-{$dateLimit} days"));
|
||||||
|
|
||||||
|
$builder->groupStart()
|
||||||
|
->where('th.last_claim_status_change <=', $dateThreshold)
|
||||||
|
->orWhere('th.last_claim_status_change IS NULL')
|
||||||
|
->groupEnd();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
$builder->where('tm.ticket_type_id', $typeId);
|
||||||
|
$builder->where('tm.is_active', 1);
|
||||||
|
$builder->where('tm.claim_status_id is not null');
|
||||||
|
|
||||||
|
$builder->groupBy('tm.ticket_type_id');
|
||||||
|
|
||||||
|
$query = $builder->get();
|
||||||
|
$result = $query->getRowArray();
|
||||||
|
|
||||||
|
// Add Total count
|
||||||
|
$total = 0;
|
||||||
|
foreach ($result as $key => $res) {
|
||||||
|
// Ensure that ticket_type_id is excluded from the sum
|
||||||
|
if ($key !== 'ticket_type_id') {
|
||||||
|
$total += $res;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$result['total'] = $total;
|
||||||
|
|
||||||
|
// If no result, initialize an empty result for the ticket_type_id
|
||||||
|
if (!$result) {
|
||||||
|
$result = ['ticket_type_id' => $typeId, 'total' => 0];
|
||||||
|
foreach ($statuses as $status) {
|
||||||
|
$alias = strtolower($status);
|
||||||
|
$alias = str_replace(' ', '_', $alias);
|
||||||
|
$result[$alias] = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Add the result to the final array
|
||||||
|
$finalResults[$typeId] = $result;
|
||||||
|
}
|
||||||
|
|
||||||
|
return $finalResults;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -218,8 +218,27 @@
|
|||||||
|
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
|
|
||||||
|
<li class="nav-item">
|
||||||
|
<a href="#claims-dash-tab" data-toggle="tab" aria-expanded="true" class="nav-link px-3 py-2" id="claims_tab">
|
||||||
|
<span class="mr-1"><i class="fa fa-file-alt"></i> </span>
|
||||||
|
<span class="d-none d-sm-inline-block">Claims</span>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li class="nav-item">
|
||||||
|
<a href="#leads-dash-tab" data-toggle="tab" aria-expanded="true" class="nav-link px-3 py-2" id="leads_tab">
|
||||||
|
<span class="mr-1"><i class="fa fa-file-alt"></i> </span>
|
||||||
|
<span class="d-none d-sm-inline-block">Leads and Renewals</span>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
</ul>
|
</ul>
|
||||||
<div class="tab-content">
|
<div class="tab-content">
|
||||||
|
<?php include("claims_dash.php") ?>
|
||||||
|
<?php if(in_array(get_role_id(), [1,2,3,5]) || (get_role_id() == 4 && in_array(MANAGEMENT_TEAM_ID, user_team()) || in_array(FINANCE_TEAM_ID, user_team()) || in_array(BUSINESS_TEAM_ID, user_team()))) { ?>
|
||||||
|
<?php include('bds_dash.php'); ?>
|
||||||
|
<?php } ?>
|
||||||
|
<?php include("leads_dash.php") ?>
|
||||||
|
|
||||||
<?php if(in_array(get_role_id(), [1,2,3,5])) { ?>
|
<?php if(in_array(get_role_id(), [1,2,3,5])) { ?>
|
||||||
<?php include('endorsement_dash.php'); ?>
|
<?php include('endorsement_dash.php'); ?>
|
||||||
@ -230,6 +249,7 @@
|
|||||||
<?php include('bds_dash.php'); ?>
|
<?php include('bds_dash.php'); ?>
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- </div> -->
|
<!-- </div> -->
|
||||||
|
|||||||
304
app/Views/claims_dash.php
Normal file
304
app/Views/claims_dash.php
Normal file
@ -0,0 +1,304 @@
|
|||||||
|
<style>
|
||||||
|
body {
|
||||||
|
margin-top: 20px;
|
||||||
|
background: #FAFAFA;
|
||||||
|
}
|
||||||
|
|
||||||
|
.order-card {
|
||||||
|
color: #fff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.bg-c-blue {
|
||||||
|
background: linear-gradient(45deg, #4099ff, #73b4ff);
|
||||||
|
}
|
||||||
|
|
||||||
|
.bg-c-green {
|
||||||
|
background: linear-gradient(45deg, #2ed8b6, #59e0c5);
|
||||||
|
}
|
||||||
|
|
||||||
|
.bg-c-yellow {
|
||||||
|
background: linear-gradient(45deg, #FFB64D, #ffcb80);
|
||||||
|
}
|
||||||
|
|
||||||
|
.bg-c-pink {
|
||||||
|
background: linear-gradient(45deg, #FF5370, #ff869a);
|
||||||
|
}
|
||||||
|
|
||||||
|
.bg-c-red {
|
||||||
|
background: linear-gradient(45deg, #FF4E50, #F9D423);
|
||||||
|
}
|
||||||
|
|
||||||
|
.bg-c-purple {
|
||||||
|
background: linear-gradient(45deg, #9D50BB, #6E48AA);
|
||||||
|
}
|
||||||
|
|
||||||
|
.bg-c-orange {
|
||||||
|
background: linear-gradient(45deg, #F2994A, #F2C94C);
|
||||||
|
}
|
||||||
|
|
||||||
|
.bg-c-teal {
|
||||||
|
background: linear-gradient(45deg, #1ABC9C, #16A085);
|
||||||
|
}
|
||||||
|
|
||||||
|
.bg-c-cyan {
|
||||||
|
background: linear-gradient(45deg, #00C9FF, #92FE9D);
|
||||||
|
}
|
||||||
|
|
||||||
|
.bg-c-lime {
|
||||||
|
background: linear-gradient(45deg, #A8E063, #56AB2F);
|
||||||
|
}
|
||||||
|
|
||||||
|
.bg-c-indigo {
|
||||||
|
background: linear-gradient(45deg, #3F51B5, #5A55AE);
|
||||||
|
}
|
||||||
|
|
||||||
|
.bg-c-Pelorous {
|
||||||
|
background: linear-gradient(45deg, #00d6db, #00a8b5);
|
||||||
|
}
|
||||||
|
|
||||||
|
.bg-c-Pelorous2 {
|
||||||
|
background: linear-gradient(45deg, #02a8b5, #017f8b);
|
||||||
|
}
|
||||||
|
|
||||||
|
.bg-c-Pelorous3 {
|
||||||
|
background: linear-gradient(45deg, #098895, #046063);
|
||||||
|
}
|
||||||
|
|
||||||
|
.bg-c-Grenadier {
|
||||||
|
background: linear-gradient(45deg, #ff9d37, #ff7a10);
|
||||||
|
}
|
||||||
|
|
||||||
|
.bg-c-Grenadier2 {
|
||||||
|
background: linear-gradient(45deg, #ff8010, #ff4c00);
|
||||||
|
}
|
||||||
|
|
||||||
|
.bg-c-Grenadier3 {
|
||||||
|
background: linear-gradient(45deg, #f06306, #cc4b05);
|
||||||
|
}
|
||||||
|
|
||||||
|
.bg-c-SilverChalice {
|
||||||
|
background: linear-gradient(45deg, #a3a8a8, #8f9494);
|
||||||
|
}
|
||||||
|
|
||||||
|
.bg-c-SilverChalice2 {
|
||||||
|
background: linear-gradient(45deg, #7e8484, #686e6e);
|
||||||
|
}
|
||||||
|
|
||||||
|
.bg-c-SilverChalice3 {
|
||||||
|
background: linear-gradient(45deg, #5c6363, #434949);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
.card {
|
||||||
|
border-radius: 5px;
|
||||||
|
-webkit-box-shadow: 0 1px 2.94px 0.06px rgba(4, 26, 55, 0.16);
|
||||||
|
box-shadow: 0 1px 2.94px 0.06px rgba(4, 26, 55, 0.16);
|
||||||
|
border: none;
|
||||||
|
margin-bottom: 30px;
|
||||||
|
-webkit-transition: all 0.3s ease-in-out;
|
||||||
|
transition: all 0.3s ease-in-out;
|
||||||
|
}
|
||||||
|
|
||||||
|
.card .card-block {
|
||||||
|
padding-top: 10px;
|
||||||
|
padding-bottom: 10px;
|
||||||
|
padding-left: 25px;
|
||||||
|
padding-right: 25px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.order-card i {
|
||||||
|
font-size: 26px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.f-left {
|
||||||
|
float: left;
|
||||||
|
}
|
||||||
|
|
||||||
|
.f-right {
|
||||||
|
float: right;
|
||||||
|
}
|
||||||
|
|
||||||
|
.m-b-1 {
|
||||||
|
margin-top: 0;
|
||||||
|
margin-bottom: 5px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
||||||
|
<div class="tab-pane fade" id="claims-dash-tab">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-4 col-xl-3 claimTypeTile">
|
||||||
|
<div class="card bg-c-Pelorous order-card" onclick="hideAndShowTile(1,1)">
|
||||||
|
<div class="card-block">
|
||||||
|
<h6 class="m-b-20 font-15">GMC</h6>
|
||||||
|
<h2 class="text-right"><i class="mdi mdi-playlist-check f-left"></i><span><?= isset($claim_data[1]['total']) ? $claim_data[1]['total'] : '0' ?></span></h2>
|
||||||
|
<p class="m-b-1"> <span class="f-right"></span></p>
|
||||||
|
<p class="m-b-1"> <span class="f-right"></span></p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div class="col-md-4 col-xl-3 claimTypeTile">
|
||||||
|
<div class="card bg-c-Pelorous order-card" onclick="hideAndShowTile(1,2)">
|
||||||
|
<div class="card-block">
|
||||||
|
<h6 class="m-b-20 font-15">GPA</h6>
|
||||||
|
<h2 class="text-right"><i class="mdi mdi-playlist-check f-left"></i><span><?= isset($claim_data[2]['total']) ? $claim_data[2]['total'] : '0' ?></span></h2>
|
||||||
|
<p class="m-b-1"> <span class="f-right"></span></p>
|
||||||
|
<p class="m-b-1"> <span class="f-right"></span></p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="col-md-4 col-xl-3 claimTypeTile">
|
||||||
|
<div class="card bg-c-Pelorous order-card" onclick="hideAndShowTile(1,3)">
|
||||||
|
<div class="card-block">
|
||||||
|
<h6 class="m-b-20 font-15">EDLI</h6>
|
||||||
|
<h2 class="text-right"><i class="mdi mdi-playlist-check f-left"></i><span><?= isset($claim_data[3]['total']) ? $claim_data[3]['total'] : '0' ?></span></h2>
|
||||||
|
<p class="m-b-1"> <span class="f-right"></span></p>
|
||||||
|
<p class="m-b-1"> <span class="f-right"></span></p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="col-md-4 col-xl-3 claimTypeTile">
|
||||||
|
<div class="card bg-c-Pelorous order-card" onclick="hideAndShowTile(1,4)">
|
||||||
|
<div class="card-block">
|
||||||
|
<h6 class="m-b-20 font-15">GTLI</h6>
|
||||||
|
<h2 class="text-right"><i class="mdi mdi-playlist-check f-left"></i><span><?= isset($claim_data[4]['total']) ? $claim_data[4]['total'] : '0' ?></span></h2>
|
||||||
|
<p class="m-b-1"> <span class="f-right"></span></p>
|
||||||
|
<p class="m-b-1"> <span class="f-right"></span></p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="goBack">
|
||||||
|
<a href="#" onclick="hideAndShowTile('2')">show all pending Tile<br></a>
|
||||||
|
</div>
|
||||||
|
<div class="row">
|
||||||
|
<?php
|
||||||
|
$colorSetCount = count($colorShades); // Number of color sets
|
||||||
|
$shadeCount = count($colorShades[0]); // Number of shades per set
|
||||||
|
$index = 0;
|
||||||
|
?>
|
||||||
|
|
||||||
|
<?php foreach ($claim_data as $ticketTypeId => $statuses) : ?>
|
||||||
|
<?php
|
||||||
|
// Initialize color set and shade indexes
|
||||||
|
$colorSetIndex = floor($index / $shadeCount) % $colorSetCount; // Reset color set after each set
|
||||||
|
$shadeIndex = $index % $shadeCount; // Cycle through shades within the set
|
||||||
|
|
||||||
|
// Get the background color for the current tile
|
||||||
|
$bgColor = $colorShades[$colorSetIndex][$shadeIndex];
|
||||||
|
?>
|
||||||
|
|
||||||
|
<?php foreach ($statuses as $status => $count) : ?>
|
||||||
|
<?php
|
||||||
|
// Skip metadata fields
|
||||||
|
if ($status === 'ticket_type_id' || $status === 'total') {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
?>
|
||||||
|
<?php
|
||||||
|
$formattedStatus = strlen($status) < 5 ? strtoupper($status): ucwords(str_replace('_', ' ', $status));
|
||||||
|
$truncatedStatus = strlen($formattedStatus) > 20 ? substr($formattedStatus, 0, 15) . '...' : $formattedStatus;
|
||||||
|
$showTooltip = strlen($formattedStatus) > 20;
|
||||||
|
?>
|
||||||
|
<div class="col-md-2 col-xl-1 claimStatusTitle_<?= $ticketTypeId ?>" style="display: none;">
|
||||||
|
<div class="card order-card" style="background: <?= $bgColor ?>;" onclick="linkRedirectForClaims(<?= $ticketTypeId ?>, '<?= $status ?>')">
|
||||||
|
<h2 class="text-center"><span><?= $count ?></span></h2>
|
||||||
|
<h6 class="m-b-20 font-15 text-center"
|
||||||
|
<?= $showTooltip ? 'data-toggle="tooltip" title="' . htmlspecialchars($formattedStatus, ENT_QUOTES, 'UTF-8') . '"' : '' ?>>
|
||||||
|
<?= $truncatedStatus ?>
|
||||||
|
</h6>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<?php endforeach; ?>
|
||||||
|
<?php endforeach; ?>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
$(document).ready(function() {
|
||||||
|
$('.goBack').hide();
|
||||||
|
$('[class*="claimStatusTitle_"]').hide();
|
||||||
|
});
|
||||||
|
|
||||||
|
function hideAndShowTile(type, claimType = null) {
|
||||||
|
|
||||||
|
if (type == 1) {
|
||||||
|
|
||||||
|
$('.claimTypeTile').hide();
|
||||||
|
$(".goBack").show();
|
||||||
|
} else {
|
||||||
|
|
||||||
|
$('.claimTypeTile').show();
|
||||||
|
$('.goBack').hide();
|
||||||
|
$('[class*="claimStatusTitle_"]').hide();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (type == 1 && claimType != null) {
|
||||||
|
|
||||||
|
$('.claimTypeTile').hide();
|
||||||
|
$('.claimStatusTitle_' + claimType).show();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function linkRedirectForClaims(ticketTypeId, status) {
|
||||||
|
$('.loader').fadeIn();
|
||||||
|
$('.loader-mask').fadeIn();
|
||||||
|
$.ajax({
|
||||||
|
url: "<?= base_url("/dashboard/prepareClaimSearchData") ?>",
|
||||||
|
type: "POST",
|
||||||
|
data: {
|
||||||
|
ticketTypeId: ticketTypeId,
|
||||||
|
status: status
|
||||||
|
},
|
||||||
|
success: function(response) {
|
||||||
|
// Handle the response from the server
|
||||||
|
if (response.status === 'success') {
|
||||||
|
// Redirect to the claims list page with the selected filters
|
||||||
|
console.log("response", response);
|
||||||
|
// alert(JSON.stringify(response));
|
||||||
|
data = response.data;
|
||||||
|
data.is_dashboard = 1;
|
||||||
|
redirectWithPost("<?= base_url("ticket/list") ?>", data);
|
||||||
|
} else {
|
||||||
|
// Handle error case
|
||||||
|
console.log('Error: ' + response.message);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
error: function(xhr, status, error) {
|
||||||
|
// Handle AJAX error
|
||||||
|
console.error('AJAX Error:', error);
|
||||||
|
// alert('An error occurred while processing your request.');
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
function redirectWithPost(url, data = {}) {
|
||||||
|
const form = document.createElement('form');
|
||||||
|
form.method = 'POST';
|
||||||
|
form.action = url;
|
||||||
|
|
||||||
|
for (const key in data) {
|
||||||
|
if (data.hasOwnProperty(key)) {
|
||||||
|
const input = document.createElement('input');
|
||||||
|
input.type = 'hidden';
|
||||||
|
input.name = key;
|
||||||
|
input.value = data[key];
|
||||||
|
form.appendChild(input);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
document.body.appendChild(form);
|
||||||
|
form.submit();
|
||||||
|
}
|
||||||
|
</script>
|
||||||
173
app/Views/leads_dash.php
Normal file
173
app/Views/leads_dash.php
Normal file
@ -0,0 +1,173 @@
|
|||||||
|
<style>
|
||||||
|
|
||||||
|
body{
|
||||||
|
margin-top:20px;
|
||||||
|
background:#FAFAFA;
|
||||||
|
}
|
||||||
|
.order-card {
|
||||||
|
color: #fff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.bg-c-blue {
|
||||||
|
background: linear-gradient(45deg,#4099ff,#73b4ff);
|
||||||
|
}
|
||||||
|
|
||||||
|
.bg-c-green {
|
||||||
|
background: linear-gradient(45deg,#2ed8b6,#59e0c5);
|
||||||
|
}
|
||||||
|
|
||||||
|
.bg-c-yellow {
|
||||||
|
background: linear-gradient(45deg,#FFB64D,#ffcb80);
|
||||||
|
}
|
||||||
|
|
||||||
|
.bg-c-pink {
|
||||||
|
background: linear-gradient(45deg,#FF5370,#ff869a);
|
||||||
|
}
|
||||||
|
|
||||||
|
.bg-c-red {
|
||||||
|
background: linear-gradient(45deg,#FF4E50,#F9D423);
|
||||||
|
}
|
||||||
|
|
||||||
|
.bg-c-purple {
|
||||||
|
background: linear-gradient(45deg,#9D50BB,#6E48AA);
|
||||||
|
}
|
||||||
|
|
||||||
|
.bg-c-orange {
|
||||||
|
background: linear-gradient(45deg,#F2994A,#F2C94C);
|
||||||
|
}
|
||||||
|
|
||||||
|
.bg-c-teal {
|
||||||
|
background: linear-gradient(45deg,#1ABC9C,#16A085);
|
||||||
|
}
|
||||||
|
|
||||||
|
.bg-c-cyan {
|
||||||
|
background: linear-gradient(45deg,#00C9FF,#92FE9D);
|
||||||
|
}
|
||||||
|
|
||||||
|
.bg-c-lime {
|
||||||
|
background: linear-gradient(45deg,#A8E063,#56AB2F);
|
||||||
|
}
|
||||||
|
|
||||||
|
.bg-c-indigo {
|
||||||
|
background: linear-gradient(45deg,#3F51B5,#5A55AE);
|
||||||
|
}
|
||||||
|
|
||||||
|
.bg-c-Pelorous {
|
||||||
|
background: linear-gradient(45deg, #00d6db, #00a8b5);
|
||||||
|
}
|
||||||
|
|
||||||
|
.bg-c-Pelorous2 {
|
||||||
|
background: linear-gradient(45deg, #02a8b5, #017f8b);
|
||||||
|
}
|
||||||
|
|
||||||
|
.bg-c-Pelorous3 {
|
||||||
|
background: linear-gradient(45deg, #098895, #046063);
|
||||||
|
}
|
||||||
|
|
||||||
|
.bg-c-Grenadier {
|
||||||
|
background: linear-gradient(45deg, #ff9d37, #ff7a10);
|
||||||
|
}
|
||||||
|
|
||||||
|
.bg-c-Grenadier2 {
|
||||||
|
background: linear-gradient(45deg, #ff8010, #ff4c00);
|
||||||
|
}
|
||||||
|
|
||||||
|
.bg-c-Grenadier3 {
|
||||||
|
background: linear-gradient(45deg, #f06306, #cc4b05);
|
||||||
|
}
|
||||||
|
|
||||||
|
.bg-c-SilverChalice {
|
||||||
|
background: linear-gradient(45deg, #a3a8a8, #8f9494);
|
||||||
|
}
|
||||||
|
|
||||||
|
.bg-c-SilverChalice2 {
|
||||||
|
background: linear-gradient(45deg, #7e8484, #686e6e);
|
||||||
|
}
|
||||||
|
|
||||||
|
.bg-c-SilverChalice3 {
|
||||||
|
background: linear-gradient(45deg, #5c6363, #434949);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
.card {
|
||||||
|
border-radius: 5px;
|
||||||
|
-webkit-box-shadow: 0 1px 2.94px 0.06px rgba(4,26,55,0.16);
|
||||||
|
box-shadow: 0 1px 2.94px 0.06px rgba(4,26,55,0.16);
|
||||||
|
border: none;
|
||||||
|
margin-bottom: 30px;
|
||||||
|
-webkit-transition: all 0.3s ease-in-out;
|
||||||
|
transition: all 0.3s ease-in-out;
|
||||||
|
}
|
||||||
|
|
||||||
|
.card .card-block {
|
||||||
|
padding-top: 10px;
|
||||||
|
padding-bottom: 10px;
|
||||||
|
padding-left: 25px;
|
||||||
|
padding-right: 25px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.order-card i {
|
||||||
|
font-size: 26px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.f-left {
|
||||||
|
float: left;
|
||||||
|
}
|
||||||
|
|
||||||
|
.f-right {
|
||||||
|
float: right;
|
||||||
|
}
|
||||||
|
|
||||||
|
.m-b-1{
|
||||||
|
margin-top: 0;
|
||||||
|
margin-bottom: 5px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
<div class="tab-pane fade" id="leads-dash-tab">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-4 col-xl-3 leadTypeTile">
|
||||||
|
<div class="card bg-c-Pelorous order-card" onclick="hide_and_show_tile(1)">
|
||||||
|
<div class="card-block">
|
||||||
|
<h6 class="m-b-20 font-15">Leads</h6>
|
||||||
|
<h2 class="text-right"><i class="mdi mdi-playlist-check f-left"></i><span></span></h2>
|
||||||
|
<p class="m-b-1"> <span class="f-right"></span></p>
|
||||||
|
<p class="m-b-1"> <span class="f-right"></span></p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-md-4 col-xl-3 leadTypeTile">
|
||||||
|
<div class="card bg-c-Pelorous order-card" onclick="hide_and_show_tile(1)">
|
||||||
|
<div class="card-block">
|
||||||
|
<h6 class="m-b-20 font-15">Renewals</h6>
|
||||||
|
<h2 class="text-right"><i class="mdi mdi-playlist-check f-left"></i><span></span></h2>
|
||||||
|
<p class="m-b-1"> <span class="f-right"></span></p>
|
||||||
|
<p class="m-b-1"> <span class="f-right"></span></p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="status_tile" style="display: none; position: relative; bottom: 15px;">
|
||||||
|
<a href="#" onclick="hide_and_show_tile(2)" >show all pending Tile</a>
|
||||||
|
</div>
|
||||||
|
<div class="row">
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<script>
|
||||||
|
function hide_and_show_tile(type) {
|
||||||
|
|
||||||
|
if (type == 1) {
|
||||||
|
|
||||||
|
$('.leadTypeTile').hide();
|
||||||
|
$('.status_tile').show();
|
||||||
|
} else {
|
||||||
|
|
||||||
|
$('.leadTypeTile').show();
|
||||||
|
$('.status_tile').hide();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
</script>
|
||||||
Loading…
Reference in New Issue
Block a user