MERGE_TEST_CHAT_BOT&EB&UI
@ -47,6 +47,7 @@ $routes->get("frontend_content", "AppContentManagementController::frontend_conte
|
||||
// $routes->get('/', 'LoginController::index');
|
||||
$routes->get('/test', 'Home::index');
|
||||
$routes->get('/check_gemini', 'Home::check_Gemini');
|
||||
$routes->get('/check_gemini2', 'Home::check_gemini_2');
|
||||
$routes->get('/login', 'LoginController::index'); ///auth/google
|
||||
$routes->get('/loginPos', 'LoginController::loginPos'); //login POS team
|
||||
$routes->post('/getVerifyPosMobileNo', 'LoginController::getVerifyPosMobileNo'); //Verify POS team mobile no
|
||||
@ -579,6 +580,7 @@ $routes->group("/bdsReport", ["filter" => "authMVC"], function ($routes) {
|
||||
$routes->group("/ticket", ["filter" => "authMVC"], function ($routes) {
|
||||
$routes->match( ['get', 'post'], 'list','TicketController::ticketList');
|
||||
$routes->get('feedback-list','TicketController::feedbackList');
|
||||
$routes->match(['get', 'post'], 'claim-upload','TicketController::claimDumpUpload');
|
||||
$routes->get('remove','TicketController::removeTicket');
|
||||
$routes->get('new/(:any)','TicketController::ticket_form/$1');
|
||||
$routes->post('create','TicketController::createTicket');
|
||||
@ -614,7 +616,7 @@ $routes->post("retrieveWebhookDataClaim","ClientWebHooksController::pullData_cla
|
||||
|
||||
|
||||
|
||||
//Third party Api Call
|
||||
//Third party ICICILombard Api Call
|
||||
|
||||
$routes->get('generateAuthToken','ICICILombardController::generateAuthToken');
|
||||
$routes->get('createEnrollmentBatch','ICICILombardController::createEnrollmentBatch');
|
||||
@ -623,3 +625,17 @@ $routes->get('fetchUHIDDetails','ICICILombardController::fetchUHIDDetails');
|
||||
|
||||
$routes->get('testTracelog','TestBusinessController::a');
|
||||
$routes->get("claimView", "EmployeeRestController::claimView");
|
||||
|
||||
//Third party Vidal Api Call
|
||||
|
||||
$routes->post('hospitalNetwork','VidalApiController::hospitalNetwork');
|
||||
$routes->post('eCardService','VidalApiController::eCardService');
|
||||
$routes->post('claimStatusCheck','VidalApiController::claimStatusCheck');
|
||||
$routes->post('newClaim','VidalApiController::newClaim');
|
||||
$routes->post('enrollment','VidalApiController::enrollment');
|
||||
|
||||
|
||||
$routes->post("ticketSave", "ThzController::ticketSave");
|
||||
$routes->post("ticketList", "ThzController::ticketList");
|
||||
$routes->post("ticketConversationSave", "ThzController::ticketConversationSave");
|
||||
$routes->post("ticketConversationList", "ThzController::ticketConversationList");
|
||||
67
app/ControllerCleaners/ThzControllerCleaner.php
Normal file
@ -0,0 +1,67 @@
|
||||
<?php
|
||||
|
||||
namespace App\ControllerCleaners;
|
||||
|
||||
use App\Controllers\BaseController;
|
||||
use CodeIgniter\HTTP\ResponseInterface;
|
||||
|
||||
use App\Models\ThzMasterModel;
|
||||
use App\Models\ThzMasterNotesModel;
|
||||
|
||||
class ThzControllerCleaner extends BaseController
|
||||
{
|
||||
|
||||
protected $thzMasterModel;
|
||||
protected $thzMasterNotesModel;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->thzMasterModel = new ThzMasterModel();
|
||||
$this->thzMasterNotesModel = new ThzMasterNotesModel();
|
||||
}
|
||||
|
||||
public function index()
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
public function ticketCreation($data){
|
||||
|
||||
if(empty($data)){
|
||||
return false;
|
||||
}
|
||||
|
||||
$cleanedData = $data;
|
||||
|
||||
return $cleanedData;
|
||||
|
||||
|
||||
}
|
||||
|
||||
public function ticketList($data){
|
||||
|
||||
if(empty($data)){
|
||||
return false;
|
||||
}
|
||||
|
||||
$cleanedData = $data;
|
||||
|
||||
return $cleanedData;
|
||||
|
||||
}
|
||||
|
||||
public function ticketConversation($data){
|
||||
|
||||
if(empty($data)){
|
||||
return false;
|
||||
}
|
||||
|
||||
$cleanedData = $data;
|
||||
|
||||
return $cleanedData;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
@ -10,8 +10,11 @@ use App\Helpers\ChatbotHelper;
|
||||
|
||||
class EcardDownloadConversation extends Conversation
|
||||
{
|
||||
protected $buttonsData = [];
|
||||
public function run()
|
||||
{
|
||||
$this->bot->types();
|
||||
sleep(0.5);
|
||||
$this->showEcardMenu();
|
||||
}
|
||||
|
||||
@ -22,6 +25,7 @@ class EcardDownloadConversation extends Conversation
|
||||
$chat_session_info = get_chatbot_session_info();
|
||||
$policy_list = ChatbotHelper::getListOfPolicies($chat_session_info);
|
||||
$buttons = [];
|
||||
|
||||
$question = 'Choose Policy to Download Ecard:';
|
||||
// log_message('error', ('policy_list : ' . json_encode($policy_list)));
|
||||
|
||||
@ -34,20 +38,24 @@ class EcardDownloadConversation extends Conversation
|
||||
// Button::create("🔹 $policy['policy_name']")->value("$policy['emp_policy_id']"),
|
||||
// Button::create("◀️ Go Back")->value("go_back"),
|
||||
// ]);
|
||||
$buttons[] = Button::create("🔹 {$policy['policy_name']}")->value($policy['emp_policy_id'].'#'.$policy['rand_string']);
|
||||
$this->buttonsData[$policy['emp_policy_id'].'#'.$policy['rand_string']] = ['response_text' => "🔹 {$policy['policy_name']}"] ;
|
||||
$buttons[] = Button::create("{$policy['policy_name']}")->value($policy['emp_policy_id'].'#'.$policy['rand_string']);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$question = 'No policy found';
|
||||
}
|
||||
$this->buttonsData['go_back'] = ['response_text' => '◀️ Go Back'] ;
|
||||
$buttons = array_merge($buttons,[Button::create("◀️ Go Back")->value("go_back")]);
|
||||
$question = Question::create($question)
|
||||
->addButtons($buttons);
|
||||
|
||||
$this->bot->ask($question, function ($answer) {
|
||||
$temp = $this->buttonsData;
|
||||
$this->bot->ask($question, function ($answer) use ($temp) {
|
||||
log_message('error', 'showEcardMenu answer received');
|
||||
log_message('error', ($answer));
|
||||
$selectedOption = $answer->getText();
|
||||
$this->say("You have selected {$selectedOption}");
|
||||
$this->say("You have selected {$temp[$selectedOption]['response_text']}");
|
||||
switch ($answer->getValue()) {
|
||||
case "go_back":
|
||||
$this->bot->startConversation(new MainMenuConversation());
|
||||
|
||||
@ -7,6 +7,10 @@ use GeminiAPI\Client;
|
||||
use GeminiAPI\Resources\ModelName;
|
||||
use GeminiAPI\Resources\Parts\TextPart;
|
||||
|
||||
use Mpdf\Mpdf;
|
||||
use PhpOffice\PhpSpreadsheet\IOFactory;
|
||||
use PhpOffice\PhpSpreadsheet\Shared\Date;
|
||||
|
||||
|
||||
class Home extends PublicController
|
||||
{
|
||||
@ -36,24 +40,300 @@ class Home extends PublicController
|
||||
|
||||
public function check_Gemini()
|
||||
{
|
||||
try {
|
||||
$apiKey = 'AIzaSyBbx-uotRBqkYhqLpmD60420E_a0G0duP8';
|
||||
// Initialize the Gemini client
|
||||
$client = new Client($apiKey);
|
||||
try {
|
||||
$apiKey = 'AIzaSyBbx-uotRBqkYhqLpmD60420E_a0G0duP8';
|
||||
// Initialize the Gemini client
|
||||
$client = new Client($apiKey);
|
||||
|
||||
// Send a prompt to the Gemini Pro model
|
||||
$response = $client->generativeModel(ModelName::GEMINI_PRO)->generateContent(
|
||||
new TextPart('Write a short, creative story about a knight and a dragon.')
|
||||
);
|
||||
// Send a prompt to the Gemini Pro model
|
||||
$response = $client->generativeModel(ModelName::GEMINI_PRO)->generateContent(
|
||||
new TextPart('Write a short, creative story about a knight and a dragon.')
|
||||
);
|
||||
|
||||
// Display the generated text
|
||||
$data['gemini_response'] = $response->text();
|
||||
} catch (\Exception $e) {
|
||||
// Handle any errors that occur during the API call
|
||||
$data['gemini_response'] = 'An error occurred: ' . $e->getMessage();
|
||||
}
|
||||
// Display the generated text
|
||||
$data['gemini_response'] = $response->text();
|
||||
} catch (\Exception $e) {
|
||||
// Handle any errors that occur during the API call
|
||||
$data['gemini_response'] = 'An error occurred: ' . $e->getMessage();
|
||||
}
|
||||
|
||||
print_rr($data);
|
||||
}
|
||||
|
||||
public function check_gemini_2()
|
||||
{
|
||||
|
||||
// $this->convertToPdf();die();
|
||||
// Replace with your actual Gemini API key
|
||||
$apiKey = 'AIzaSyBbx-uotRBqkYhqLpmD60420E_a0G0duP8';
|
||||
|
||||
// The model to use and the API endpoint
|
||||
$model = "gemini-pro";
|
||||
$model = "gemini-2.5-flash";
|
||||
// $model = "gemini-1.5-pro";
|
||||
// $model = "gemini-1.5-pro";
|
||||
$url = "https://generativelanguage.googleapis.com/v1beta/models/{$model}:generateContent?key={$apiKey}";
|
||||
|
||||
$filePath = 'C:\Users\Venba\Downloads\NIA MDU May-2025 (2).pdf';
|
||||
$filePath = 'C:/Users/Venba/Desktop/ins stmts/NIC MDU June-2025 (1).pdf';
|
||||
$filePath = 'C:/Users/Venba/Desktop/ins stmts/UIIC GR June-2025.pdf';
|
||||
$filePath = 'C:/Users/Venba/Desktop/ins stmts/UIIC VLR June-2025 (2).xlsx';
|
||||
$filePath = 'C:/Users/Venba/Desktop/ins stmts/pdf/2.pdf';
|
||||
$filePath = 'C:\Users\Venba\Downloads\Raheja June-2025.csv';
|
||||
// $filePath = 'C:/Users/Venba/Downloads/Raheja June-2025.pdf';
|
||||
// $filePath = 'C:/Users/Venba/Desktop/ins stmts/ICICI Pru June-2025 (1).xlsx';
|
||||
// $filePath = 'C:/Users/Venba/Desktop/ins stmts/Digit Life June-2025.xlsx';
|
||||
|
||||
// Check if the file exists
|
||||
if (!file_exists($filePath)) {
|
||||
die("Error: File not found at {$filePath}");
|
||||
}
|
||||
|
||||
// Get the file's MIME type using the finfo extension
|
||||
$finfo = finfo_open(FILEINFO_MIME_TYPE);
|
||||
$mimeType = finfo_file($finfo, $filePath);
|
||||
finfo_close($finfo);
|
||||
// print_r($mimeType);die();
|
||||
// Define supported inline MIME types
|
||||
$supportedInlineMimeTypes = ['application/pdf','text/csv'];
|
||||
|
||||
// Read the file content and encode it to Base64
|
||||
$fileContent = file_get_contents($filePath);
|
||||
$base64Content = base64_encode($fileContent);
|
||||
// The prompt you want to send to the model
|
||||
$prompt = "give me a json with emp data like name,age,dob,mobile and email. only json not any explanations";
|
||||
$prompt = "Read the following insurer monthly statement file and convert into JSON format as sample specified.attach statement items in 'items' key and if any other data available put it in 'meta'. Give me only JSON,not any explanations. If you find the same details like insured name, policy number,endorsement no,policy start date,policy end date group it as single policy and identify base premium, third party premium and terrorism premium.";
|
||||
$prompt .= "{\'items\': [{\'sno\': 1, \'policy_no\': \'\', \'insured_name\': \'\', \'endorsement_no\': \'\', \'policy_start_date\': \'\', \'policy_end_date\': \'\', \'actual_base_premium_amount\': \'\', \'actual_third_party_premium_amount\': \'\', \'actual_terrorism_premium_amount\': \'\', \'actual_base_premium_percentage\': \'\', \'actual_third_party_premium_percentage\': \'\', \'actual_terrorism_premium_percentage\': \'\', \'actual_bp_brokerage_amount\': \'\', \'actual_tp_brokerage_amount\': \'\', \'actual_tep_brokerage_amount\': \'\', \'reward_amount\': \'\'}]}";
|
||||
|
||||
$payloadPart = null;
|
||||
|
||||
// The text part of the prompt
|
||||
$text_part = [
|
||||
"text" => $prompt
|
||||
];
|
||||
// Conditionally handle the file upload based on MIME type
|
||||
if (in_array($mimeType, $supportedInlineMimeTypes)) {
|
||||
echo "Detected supported format inline MIME type ({$mimeType})";
|
||||
// Handle PDF as inline data
|
||||
$fileContent = file_get_contents($filePath);
|
||||
$base64Content = base64_encode($fileContent);
|
||||
$payloadPart = [
|
||||
"inlineData" => [
|
||||
"mimeType" => $mimeType,
|
||||
"data" => $base64Content
|
||||
]
|
||||
];
|
||||
|
||||
$content_parts = [
|
||||
"parts" => [
|
||||
$text_part,
|
||||
$payloadPart
|
||||
]
|
||||
];
|
||||
} else {
|
||||
// Handle Excel/CSV using the Files API
|
||||
echo "Detected unsupported inline MIME type ({$mimeType}). Uploading via Files API...\n";
|
||||
$fileInfo = $this->uploadFileToGemini($filePath, $apiKey); // Pass apiKey
|
||||
|
||||
print_r($fileInfo);
|
||||
// The file part, using the URI from the Files API upload
|
||||
$file_part = [
|
||||
"fileData" => [
|
||||
"fileUri" => $fileInfo['uri'],
|
||||
"mimeType" => $fileInfo['mimeType']
|
||||
]
|
||||
];
|
||||
|
||||
// The full content array, containing both parts
|
||||
$content_parts = [
|
||||
"parts" => [
|
||||
$text_part,
|
||||
$file_part
|
||||
]
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// The final JSON payload
|
||||
$data = [
|
||||
"contents" => [
|
||||
$content_parts
|
||||
]
|
||||
];
|
||||
|
||||
// Encode the data to a JSON string
|
||||
$json_data = json_encode($data);
|
||||
|
||||
// Initialize cURL
|
||||
$ch = curl_init($url);
|
||||
|
||||
// Set cURL options
|
||||
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json')); // Set the Content-Type header
|
||||
curl_setopt($ch, CURLOPT_POSTFIELDS, $json_data); // Set the JSON payload
|
||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); // Return the response as a string
|
||||
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); // Optional: to bypass SSL verification if needed (not recommended for production)
|
||||
|
||||
// Execute the cURL request and get the response
|
||||
$response = curl_exec($ch);
|
||||
|
||||
// Check for cURL errors
|
||||
if (curl_errno($ch)) {
|
||||
echo 'cURL Error: ' . curl_error($ch);
|
||||
}
|
||||
|
||||
// Close the cURL handle
|
||||
curl_close($ch);
|
||||
|
||||
// Decode the JSON response
|
||||
$responseData = json_decode($response, true);
|
||||
echo '<pre>';
|
||||
print_r($responseData);
|
||||
echo '<pre>';
|
||||
// Check if the response contains generated text
|
||||
if (isset($responseData['candidates'][0]['content']['parts'][0]['text'])) {
|
||||
$generatedText = $responseData['candidates'][0]['content']['parts'][0]['text'];
|
||||
echo "Generated Text: " . $generatedText;
|
||||
} else {
|
||||
echo "Error or no text generated. Response: " . $response;
|
||||
}
|
||||
|
||||
print_rr($data);
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Function to upload a file to the Gemini Files API
|
||||
function uploadFileToGemini($filePath, $apiKey)
|
||||
{
|
||||
// Define the URL for the Files API upload
|
||||
$uploadUrl = "https://generativelanguage.googleapis.com/upload/v1beta/files?key={$apiKey}";
|
||||
|
||||
// Get file info
|
||||
$finfo = finfo_open(FILEINFO_MIME_TYPE);
|
||||
$fileMimeType = finfo_file($finfo, $filePath);
|
||||
finfo_close($finfo);
|
||||
|
||||
$displayName = basename($filePath);
|
||||
|
||||
// Build the request body for the Files API
|
||||
$fileUploadData = [
|
||||
'file' => [
|
||||
'display_name' => $displayName,
|
||||
],
|
||||
];
|
||||
$jsonUploadData = json_encode($fileUploadData);
|
||||
|
||||
// Initialize cURL for the upload
|
||||
$ch_upload = curl_init();
|
||||
curl_setopt($ch_upload, CURLOPT_URL, $uploadUrl);
|
||||
curl_setopt($ch_upload, CURLOPT_RETURNTRANSFER, true);
|
||||
curl_setopt($ch_upload, CURLOPT_POST, true);
|
||||
|
||||
// Use CURLFile for multipart/form-data upload
|
||||
$payload = [
|
||||
'metadata' => $jsonUploadData,
|
||||
'file' => new \CURLFile($filePath, $fileMimeType, $displayName),
|
||||
];
|
||||
|
||||
curl_setopt($ch_upload, CURLOPT_POSTFIELDS, $payload);
|
||||
curl_setopt($ch_upload, CURLOPT_HTTPHEADER, [
|
||||
'X-Goog-Upload-Protocol: multipart',
|
||||
]);
|
||||
curl_setopt($ch_upload, CURLOPT_SSL_VERIFYPEER, false); // Optional: not for production
|
||||
|
||||
// Execute the upload request
|
||||
$uploadResponse = curl_exec($ch_upload);
|
||||
|
||||
if (curl_errno($ch_upload)) {
|
||||
die('cURL Error (Files API): ' . curl_error($ch_upload));
|
||||
}
|
||||
|
||||
curl_close($ch_upload);
|
||||
|
||||
$uploadResponseData = json_decode($uploadResponse, true);
|
||||
|
||||
// Check for a successful upload and return the file URI
|
||||
if (!isset($uploadResponseData['file']['uri'])) {
|
||||
die("Error uploading file. Response: " . $uploadResponse);
|
||||
}
|
||||
|
||||
return [
|
||||
'uri' => $uploadResponseData['file']['uri'],
|
||||
'mimeType' => $fileMimeType
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
public function convertToPdf($inputFile = null)
|
||||
{
|
||||
// 1. Load your Excel file
|
||||
$inputFile = 'C:/Users/Venba/Desktop/ins stmts/Raheja June-2025.xlsx';
|
||||
// $inputFile = 'C:/Users/Venba/Desktop/ins stmts/pdf/sample.pdf';
|
||||
$spreadsheet = IOFactory::load($inputFile);
|
||||
|
||||
// 2. Initialize mPDF with proper configuration
|
||||
$mpdf = new Mpdf([
|
||||
'mode' => 'utf-8',
|
||||
'format' => 'A4',
|
||||
'margin_header' => 5,
|
||||
'margin_footer' => 5,
|
||||
'orientation' => 'L',
|
||||
'default_font_size' => 18,
|
||||
// 'default_font' => 'Arial'
|
||||
]);
|
||||
|
||||
// 3. Process each worksheet
|
||||
foreach ($spreadsheet->getWorksheetIterator() as $worksheet) {
|
||||
// Get HTML representation of the sheet
|
||||
$html = $this->worksheetToHtml($worksheet);
|
||||
// print_r($html);
|
||||
// Add to PDF
|
||||
$mpdf->AddPage();
|
||||
$mpdf->WriteHTML($html);
|
||||
}
|
||||
$pdfPath = 'C:/Users/Venba/Desktop/ins stmts/pdf/2.pdf';
|
||||
// $pdfPath = WRITEPATH.'tmp';
|
||||
$mpdf->Output($pdfPath, \Mpdf\Output\Destination::FILE); // Save file on server
|
||||
// 4. Output
|
||||
// $mpdf->Output('financial_report.pdf', 'D');
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
protected function worksheetToHtml($worksheet)
|
||||
{
|
||||
// Customize this based on your needs
|
||||
$html = '<h2>' . htmlspecialchars($worksheet->getTitle()) . '</h2>';
|
||||
$html .= '<table border="1" cellpadding="5">';
|
||||
|
||||
foreach ($worksheet->getRowIterator() as $row) {
|
||||
$html .= '<tr>';
|
||||
$cellIterator = $row->getCellIterator();
|
||||
$cellIterator->setIterateOnlyExistingCells(true);
|
||||
|
||||
foreach ($cellIterator as $cell) {
|
||||
$value = $cell->getValue();
|
||||
|
||||
// ✅ Detect and format Excel date cells
|
||||
if (Date::isDateTime($cell)) {
|
||||
$formattedValue = Date::excelToDateTimeObject($value)->format('Y-m-d');
|
||||
} else {
|
||||
$formattedValue = $cell->getCalculatedValue();
|
||||
}
|
||||
|
||||
$html .= '<td>' . htmlspecialchars($formattedValue) . '</td>';
|
||||
}
|
||||
|
||||
$html .= '</tr>';
|
||||
}
|
||||
|
||||
$html .= '</table>';
|
||||
return $html;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -44,6 +44,8 @@ use Google\Service\FactCheckTools\Resource\Claims;
|
||||
use GPBMetadata\Google\Type\Datetime;
|
||||
use PhpOffice\PhpSpreadsheet\Worksheet\Worksheet;
|
||||
|
||||
use function PHPSTORM_META\type;
|
||||
|
||||
class LeadsController extends BaseController
|
||||
{
|
||||
use ResponseTrait;
|
||||
@ -773,7 +775,7 @@ class LeadsController extends BaseController
|
||||
// dd($data);
|
||||
|
||||
if ($data['lead_data']['lead_form_type'] == 1) {
|
||||
|
||||
$data['demogrphy_html_data'] = $this->generateDemographyDataTable(['lead_id' => $id]);
|
||||
$this->loadLayout('view_rfq.php', $data);
|
||||
} else if ($data['lead_data']['lead_form_type'] == 2) {
|
||||
|
||||
@ -961,7 +963,7 @@ class LeadsController extends BaseController
|
||||
}
|
||||
|
||||
|
||||
private function reorderProposalsByInsurerTotal(array $data): array
|
||||
public function reorderProposalsByInsurerTotal(array $data): array
|
||||
{
|
||||
|
||||
if (!isset($data['premium_data']['data'])) return $data;
|
||||
@ -973,7 +975,7 @@ class LeadsController extends BaseController
|
||||
|
||||
foreach ($original as $key => $value) {
|
||||
// Match only keys that look like 'Proposal X'
|
||||
if (preg_match('/^(Proposal\s+\d+|Existing Renewal|Existing Rollover)$/', $key)) {
|
||||
if (preg_match('/^(Proposal\s+\d+|Existing Renewal|Existing Rollover)$/', $key)) {
|
||||
// Get the insurer entry (not 'Quote Asked')
|
||||
foreach ($value as $subKey => $subVal) {
|
||||
if ($subKey !== 'Quote Asked' && isset($subVal['Total'])) {
|
||||
@ -994,6 +996,18 @@ class LeadsController extends BaseController
|
||||
}
|
||||
}
|
||||
|
||||
foreach ($proposals as $proposalKey => &$proposal) {
|
||||
$quoteAsked = $proposal['Quote Asked']; // Keep Quote Asked separately
|
||||
unset($proposal['Quote Asked']);
|
||||
|
||||
uasort($proposal, function ($a, $b) {
|
||||
return $a['Total'] <=> $b['Total']; // Ascending by Total
|
||||
});
|
||||
|
||||
// Add Quote Asked back at the top
|
||||
$proposal = array_merge(['Quote Asked' => $quoteAsked], $proposal);
|
||||
}
|
||||
|
||||
// Sort proposals by their insurer's total
|
||||
uasort($proposals, function ($a, $b) {
|
||||
$totalA = 0;
|
||||
@ -1028,9 +1042,48 @@ class LeadsController extends BaseController
|
||||
return $data;
|
||||
}
|
||||
|
||||
$porposalData = $data['premium_data']['data'];
|
||||
$premiumProposals = array_keys($data['premium_data']['data']);
|
||||
$filteredProposals = [];
|
||||
|
||||
//Reorder the Insurer based on the Premium data insurer
|
||||
foreach ($porposalData as $key => $value) {
|
||||
|
||||
if(in_array($key, ['Particulars', ""])){
|
||||
continue;
|
||||
}
|
||||
|
||||
// Ensure the premium data is an array and not empty
|
||||
if (!is_array($value) || empty($value)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// Step 1: Get the premium display_name order (excluding "Quote Asked")
|
||||
$premiumOrder = array_keys(array_diff_key($value, ["Quote Asked" => ""]));
|
||||
|
||||
// Skip if no valid order found
|
||||
if (empty($premiumOrder)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// usort($data['proposal_data']['over_all_column_data'][$key]['insurers'], function($a, $b) use ($premiumOrder) {
|
||||
// return array_search($a['display_name'], $premiumOrder) - array_search($b['display_name'], $premiumOrder);
|
||||
// });
|
||||
|
||||
// Step 2: Reorder proposal insurers based on premium order
|
||||
usort($data['proposal_data']['over_all_column_data'][$key]['insurers'], function($a, $b) use ($premiumOrder) {
|
||||
$posA = array_search($a['display_name'] ?? '', $premiumOrder);
|
||||
$posB = array_search($b['display_name'] ?? '', $premiumOrder);
|
||||
|
||||
// If not found, push to the end
|
||||
$posA = $posA === false ? PHP_INT_MAX : $posA;
|
||||
$posB = $posB === false ? PHP_INT_MAX : $posB;
|
||||
|
||||
return $posA - $posB;
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
// Collect proposal keys that match the pattern "Proposal X"
|
||||
foreach ($premiumProposals as $key) {
|
||||
if (preg_match('/^(Proposal\s+\d+|Existing Renewal|Existing Rollover)$/', $key) && isset($data['proposal_data']['over_all_column_data'][$key])) {
|
||||
@ -1068,6 +1121,32 @@ class LeadsController extends BaseController
|
||||
}
|
||||
}
|
||||
|
||||
//Reorder the SubHeader of the Proposel
|
||||
foreach ($sortedProposalOrder as $proposalKey => $proposalData) {
|
||||
// Skip if insurers or subHeaders are missing
|
||||
if (
|
||||
!isset($proposalData['insurers']) ||
|
||||
!is_array($proposalData['insurers']) ||
|
||||
!isset($proposalHeaders[$proposalKey]['subHeaders']) ||
|
||||
!is_array($proposalHeaders[$proposalKey]['subHeaders'])
|
||||
) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// Keep "Quote Asked" fixed at index 0
|
||||
$newSubHeaders = ["Quote Asked"];
|
||||
|
||||
// Add insurers in the sorted order
|
||||
foreach ($proposalData['insurers'] as $insurer) {
|
||||
if(in_array($insurer['display_name'], $proposalHeaders[$proposalKey]['subHeaders'])){
|
||||
$newSubHeaders[] = $insurer['display_name'];
|
||||
}
|
||||
}
|
||||
|
||||
// Replace the subHeaders in the header array
|
||||
$proposalHeaders[$proposalKey]['subHeaders'] = $newSubHeaders;
|
||||
}
|
||||
|
||||
// dd($staticHeaders, $proposalHeaders, $sortedProposalOrder);
|
||||
|
||||
// Step 2: Reorder headers
|
||||
@ -1088,10 +1167,9 @@ class LeadsController extends BaseController
|
||||
}
|
||||
unset($value);
|
||||
|
||||
|
||||
//merge the all headers
|
||||
$reorderedHeaders = array_merge($staticHeaders, $reorderedHeaders, $actionHeader);
|
||||
|
||||
|
||||
|
||||
// Step 3: Reorder each row's `data` by matching parentth
|
||||
foreach ($dataRows as $dataRowIndex => &$row) {
|
||||
$staticData = [];
|
||||
@ -1137,6 +1215,12 @@ class LeadsController extends BaseController
|
||||
}
|
||||
unset($value);
|
||||
|
||||
//Reorder the Row Data based on the Insurer
|
||||
$reorderedProposalData = $this->reorderProposalRowData($reorderedProposalData, $proposalHeaders);
|
||||
|
||||
|
||||
// print_rr($reorderedProposalData); die;
|
||||
|
||||
$row['data'] = array_merge($staticData, $reorderedProposalData, $actionData);
|
||||
}
|
||||
|
||||
@ -1151,6 +1235,44 @@ class LeadsController extends BaseController
|
||||
return $data;
|
||||
}
|
||||
|
||||
private function reorderProposalRowData(array $proposalRowData, array $proposalHeaderData): array
|
||||
{
|
||||
$newRowData = [];
|
||||
|
||||
// Group rows by parentth
|
||||
$groupedRows = [];
|
||||
foreach ($proposalRowData as $row) {
|
||||
if (!isset($row['parentth'])) {
|
||||
continue; // skip invalid rows
|
||||
}
|
||||
$groupedRows[$row['parentth']][] = $row;
|
||||
}
|
||||
|
||||
// Reorder each group's rows based on header subHeaders
|
||||
foreach ($proposalHeaderData as $proposalKey => $headerInfo) {
|
||||
if (
|
||||
!isset($groupedRows[$proposalKey]) ||
|
||||
!isset($headerInfo['subHeaders']) ||
|
||||
!is_array($headerInfo['subHeaders'])
|
||||
) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$order = $headerInfo['subHeaders'];
|
||||
$rows = $groupedRows[$proposalKey];
|
||||
|
||||
// Sort whole rows according to subth position in $order
|
||||
usort($rows, function ($a, $b) use ($order) {
|
||||
return array_search($a['subth'], $order) - array_search($b['subth'], $order);
|
||||
});
|
||||
|
||||
// Append sorted rows to final array
|
||||
$newRowData = array_merge($newRowData, $rows);
|
||||
}
|
||||
|
||||
return $newRowData;
|
||||
}
|
||||
|
||||
private function renumberProposalKeys(array $input): array
|
||||
{
|
||||
$result = [];
|
||||
@ -1284,7 +1406,7 @@ class LeadsController extends BaseController
|
||||
$lead_data = [
|
||||
'Insured' => $rfq_data['client_name'],
|
||||
'No of Employees at Inception' => $rfq_data['incept_emp_count'],
|
||||
'Total Sum Insured at Inception ' => $rfq_data['total_si_at_incept'],
|
||||
// 'Total Sum Insured at Inception ' => $rfq_data['total_si_at_incept'],
|
||||
'Policy Period' => !empty($rfq_data['policy_start_date']) && !empty($rfq_data['policy_end_date']) ? date('d-m-Y', strtotime($rfq_data['policy_start_date'])) . ' to ' . date('d-m-Y', strtotime($rfq_data['policy_end_date'])) : "To be decided",
|
||||
// 'Insurer' => $rfq_data['insurer_name'] ?? " - ",
|
||||
// 'TPA' => $rfq_data['tpa_name'] ?? " - ",
|
||||
@ -1455,7 +1577,20 @@ class LeadsController extends BaseController
|
||||
],
|
||||
],
|
||||
]);
|
||||
$subheader_count = array_sum(array_map(fn($header) => count($header['subHeaders']), $data['table_data']['headers']));
|
||||
|
||||
if($type == 2){
|
||||
$subheader_count = array_sum(
|
||||
array_map(
|
||||
fn($header) => count(array_filter(
|
||||
$header['subHeaders'],
|
||||
fn($sub) => $sub !== "Quote Asked"
|
||||
)),
|
||||
$data['table_data']['headers']
|
||||
)
|
||||
);
|
||||
}else{
|
||||
$subheader_count = array_sum(array_map(fn($header) => count($header['subHeaders']), $data['table_data']['headers']));
|
||||
}
|
||||
|
||||
if ($is_placement == false) {
|
||||
$subheader_count = $subheader_count - 2;
|
||||
@ -1484,7 +1619,8 @@ class LeadsController extends BaseController
|
||||
if ($type == 2) {
|
||||
$subHeaderRow = $rowNumber + 1;
|
||||
} else {
|
||||
$subHeaderRow = $rowNumber_for_remove_quote_asked;
|
||||
// $subHeaderRow = $rowNumber_for_remove_quote_asked;
|
||||
$subHeaderRow = $rowNumber + 1;
|
||||
}
|
||||
|
||||
$columnLetter = 'A';
|
||||
@ -1505,6 +1641,13 @@ class LeadsController extends BaseController
|
||||
|
||||
if (!in_array($header['parentHeader'], ['Item Key', 'Action', 'Sno', 'Particulars'])) {
|
||||
$header_actual_count++;
|
||||
|
||||
//Quote asked not showed in the QCR excel so some proposel has only one Quote Asked, So that case avoid the proposel name
|
||||
$subHeaderCount = count($header['subHeaders'] ?? []) ?? 0;
|
||||
if($subHeaderCount <= 1 && $type == 2 && $is_placement == false){
|
||||
// print_rr($header);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
if ($header['parentHeader'] === 'Sno') {
|
||||
@ -1525,7 +1668,14 @@ class LeadsController extends BaseController
|
||||
}
|
||||
|
||||
$startColumn = $columnLetter; // Start of the current header range
|
||||
$subHeaderCount = count($header['subHeaders']); // Number of subheaders for this parent header
|
||||
if($type == 2){
|
||||
$subHeaderCount = count(array_filter($header['subHeaders'], function($subHeader) {
|
||||
return $subHeader !== "Quote Asked";
|
||||
}));
|
||||
}else{
|
||||
$subHeaderCount = count($header['subHeaders']); // Number of subheaders for this parent header
|
||||
}
|
||||
|
||||
// Set parent header value
|
||||
if ($is_placement == true && !in_array($header['parentHeader'], ['Particulars', 'S.No.'])) {
|
||||
$sheet->setCellValue("{$startColumn}{$rowNumber}", "Terms");
|
||||
@ -1539,6 +1689,7 @@ class LeadsController extends BaseController
|
||||
$sheet->setCellValue("{$startColumn}{$rowNumber}", "Proposal Terms " . $headerIndex);
|
||||
}
|
||||
}
|
||||
|
||||
$sheet->getStyle("{$startColumn}{$rowNumber}")->applyFromArray([
|
||||
'font' => ['bold' => true],
|
||||
'alignment' => [
|
||||
@ -1558,7 +1709,11 @@ class LeadsController extends BaseController
|
||||
// Add subheaders
|
||||
foreach ($header['subHeaders'] as $subHeader) {
|
||||
|
||||
if ($type == 2 && $is_placement == false) {
|
||||
if($type == 2 && in_array($subHeader, ['Quote Asked'])){
|
||||
continue;
|
||||
}
|
||||
|
||||
if ($is_placement == false) {
|
||||
$sheet->setCellValue("{$columnLetter}{$subHeaderRow}", $subHeader);
|
||||
}
|
||||
|
||||
@ -1583,7 +1738,7 @@ class LeadsController extends BaseController
|
||||
$length++;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if($header_actual_count == 1 && $type == 1){
|
||||
$sheet->getColumnDimension('B')->setWidth(80);
|
||||
}else{
|
||||
@ -1625,6 +1780,10 @@ class LeadsController extends BaseController
|
||||
continue;
|
||||
}
|
||||
|
||||
if($type == 2 && in_array($cellData['subth'], ['Quote Asked'])){
|
||||
continue;
|
||||
}
|
||||
|
||||
if ($cellData['parentth'] == 'Sno') {
|
||||
$sheet->setCellValue("{$columnLetter}{$rowNumber}", $serial_no);
|
||||
} else {
|
||||
@ -1651,7 +1810,7 @@ class LeadsController extends BaseController
|
||||
//premium data
|
||||
if ($type == 2) {
|
||||
|
||||
if($is_placement == true){$columnLetterForPremium = "B";}else{$columnLetterForPremium = "C";}
|
||||
if($is_placement == true){$columnLetterForPremium = "B";}else{$columnLetterForPremium = "B";}
|
||||
$rowNumber += 2;
|
||||
|
||||
// Add premium data
|
||||
@ -1665,20 +1824,20 @@ class LeadsController extends BaseController
|
||||
// $gstAmt = [$labelArray[1]];
|
||||
// $total = [$labelArray[2]];
|
||||
|
||||
if($is_placement == true){
|
||||
// if($is_placement == true){
|
||||
$premium[] = $labelArray[0];
|
||||
$gstAmt[] = $labelArray[1];
|
||||
$total[] = $labelArray[2];
|
||||
}
|
||||
// }
|
||||
|
||||
foreach ($premiumData as $proposal => $insurers) {
|
||||
if ($proposal != 'Particulars') {
|
||||
foreach ($insurers as $insurer => $values) {
|
||||
if($insurer == 'Quote Asked'){
|
||||
$premium[] = count($insurers ?? []) > 1 ? $labelArray[0] : "";
|
||||
// $premium[] = count($insurers ?? []) > 1 ? $labelArray[0] : "";
|
||||
// $gst[] = "";
|
||||
$gstAmt[] = count($insurers ?? []) > 1 ? $labelArray[1] : "";
|
||||
$total[] = count($insurers ?? []) > 1 ? $labelArray[2] : "";
|
||||
// $gstAmt[] = count($insurers ?? []) > 1 ? $labelArray[1] : "";
|
||||
// $total[] = count($insurers ?? []) > 1 ? $labelArray[2] : "";
|
||||
}else{
|
||||
$premium[] = formatIndianCurrency($values[$labelArray[0]]);
|
||||
// $gst[] = $values[$labelArray[1]];
|
||||
@ -1912,7 +2071,7 @@ class LeadsController extends BaseController
|
||||
return true;
|
||||
}
|
||||
|
||||
public function calculateMembersDemography($params)
|
||||
public function calculateMembersDemography($params, $returnType = null)
|
||||
{
|
||||
$lead_id = $params['lead_id'];
|
||||
$lead_data = $this->leadsModel->find($lead_id);
|
||||
@ -1921,87 +2080,102 @@ class LeadsController extends BaseController
|
||||
if (!$lead_data) {
|
||||
return ['status' => 'failed', 'message' => 'Lead data not found'];
|
||||
}
|
||||
if ($lead_data['file_name']) {
|
||||
// $file_name_with_path = WRITEPATH . "/uploads/lead_files/NonPrintableCharacters.xlsx";
|
||||
|
||||
//check physical file
|
||||
if (!file_exists($file_name_with_path)) {
|
||||
//file not found update status and reason
|
||||
$message = "Lead Physcial file not found";
|
||||
// echo $message;
|
||||
$this->myLogger->logme('error', ($message . ' for file ' . $file_name_with_path));
|
||||
return ['status' => 'failed', 'message' => 'no physical file'];
|
||||
}
|
||||
try{
|
||||
if ($lead_data['file_name']) {
|
||||
// $file_name_with_path = WRITEPATH . "/uploads/lead_files/NonPrintableCharacters.xlsx";
|
||||
|
||||
$spreadsheet = \PhpOffice\PhpSpreadsheet\IOFactory::load($file_name_with_path);
|
||||
|
||||
//get members data
|
||||
$members_sheet = $spreadsheet->getSheet(0);
|
||||
$highestRowAndColumn = $members_sheet->getHighestRowAndColumn();
|
||||
// dd($highestRowAndColumn);
|
||||
$uncleaned_members = $members_sheet->rangeToArray('A1:' . $highestRowAndColumn['column'] . $highestRowAndColumn['row']);
|
||||
$members = ExcelSanitizeHelper::sanitizeArrayData($uncleaned_members);
|
||||
//get age band data
|
||||
$age_band_sheet = $spreadsheet->getSheet(1);
|
||||
$highestRowAndColumn = $age_band_sheet->getHighestRowAndColumn();
|
||||
$age_band_data = $age_band_sheet->rangeToArray('A1:' . $highestRowAndColumn['column'] . $highestRowAndColumn['row']);
|
||||
|
||||
|
||||
//check age or dob column
|
||||
$members_heading = $members[0];
|
||||
$available_col = null;
|
||||
$col_index = null;
|
||||
|
||||
if (in_array('age', array_map('strtolower', $members_heading))) {
|
||||
$available_col = 'age';
|
||||
$col_index = array_search('age', array_map('strtolower', $members_heading));
|
||||
} elseif (in_array('dob', array_map('strtolower', $members_heading))) {
|
||||
$available_col = 'dob';
|
||||
$col_index = array_search('dob', array_map('strtolower', $members_heading));
|
||||
}
|
||||
|
||||
if ($available_col == null) {
|
||||
$message = 'No DOB or Age column ';
|
||||
$this->myLogger->logme('error', ($message . $file_name_with_path));
|
||||
return ['status' => 'failed', 'message' => $message];
|
||||
}
|
||||
try {
|
||||
$classifiers = $this->getDemographyData($members, $age_band_data, $members_heading, $available_col, $col_index);
|
||||
} catch (Exception $e) {
|
||||
return ['status' => 'fail', 'message' => $e->getMessage()];
|
||||
}
|
||||
|
||||
try {
|
||||
$result = $this->generateClassifierSpreadsheet($classifiers, WRITEPATH . 'uploads/lead_files/');
|
||||
if ($result['success']) {
|
||||
$this->myLogger->logme('error', "Spreadsheet generated successfully!");
|
||||
|
||||
echo "Location: " . $result['fullpath'] . "\n";
|
||||
echo "Filename: " . $result['filename'] . "\n";
|
||||
$filePaths = [
|
||||
['file_path' => WRITEPATH . 'uploads/lead_files/' . $lead_data['file_name'], 'sheets' => [0, 1]],
|
||||
['file_path' => WRITEPATH . '/uploads/lead_files/' . $result['filename'], 'sheets' => []],
|
||||
];
|
||||
$outputPath = WRITEPATH . 'uploads/lead_files/' . $lead_data['file_name'];
|
||||
$result_merge = ExcelMergeHelper::mergeExcelFiles($filePaths, $outputPath);
|
||||
if ($result_merge) {
|
||||
// Call the delete function after the file is successfully created
|
||||
$deleteResponse = $this->deleteGeneratedFile($result['fullpath']);
|
||||
|
||||
// Add delete message to response
|
||||
$response['deleteMessage'] = $deleteResponse['message'];
|
||||
return ['status' => 'success', 'message' => 'Member_Data Merged Suceesfully'];
|
||||
}
|
||||
} else {
|
||||
echo "Error generating spreadsheet: " . $result['error'];
|
||||
//check physical file
|
||||
if (!file_exists($file_name_with_path)) {
|
||||
//file not found update status and reason
|
||||
$message = "Lead Physcial file not found";
|
||||
// echo $message;
|
||||
$this->myLogger->logme('error', ($message . ' for file ' . $file_name_with_path));
|
||||
return ['status' => 'failed', 'message' => 'no physical file'];
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
echo "Error: " . $e->getMessage();
|
||||
return ['status' => 'fail', 'message' => $e->getMessage()];
|
||||
|
||||
$spreadsheet = \PhpOffice\PhpSpreadsheet\IOFactory::load($file_name_with_path);
|
||||
|
||||
//get members data
|
||||
$members_sheet = $spreadsheet->getSheet(0);
|
||||
$highestRowAndColumn = $members_sheet->getHighestRowAndColumn();
|
||||
// dd($highestRowAndColumn);
|
||||
$uncleaned_members = $members_sheet->rangeToArray('A1:' . $highestRowAndColumn['column'] . $highestRowAndColumn['row']);
|
||||
$members = ExcelSanitizeHelper::sanitizeArrayData($uncleaned_members);
|
||||
//get age band data
|
||||
$age_band_sheet = $spreadsheet->getSheet(1);
|
||||
$highestRowAndColumn = $age_band_sheet->getHighestRowAndColumn();
|
||||
$age_band_data = $age_band_sheet->rangeToArray('A1:' . $highestRowAndColumn['column'] . $highestRowAndColumn['row']);
|
||||
|
||||
|
||||
//check age or dob column
|
||||
$members_heading = $members[0];
|
||||
$available_col = null;
|
||||
$col_index = null;
|
||||
|
||||
if (in_array('age', array_map('strtolower', $members_heading))) {
|
||||
$available_col = 'age';
|
||||
$col_index = array_search('age', array_map('strtolower', $members_heading));
|
||||
} elseif (in_array('dob', array_map('strtolower', $members_heading))) {
|
||||
$available_col = 'dob';
|
||||
$col_index = array_search('dob', array_map('strtolower', $members_heading));
|
||||
}
|
||||
|
||||
if ($available_col == null) {
|
||||
$message = 'No DOB or Age column ';
|
||||
$this->myLogger->logme('error', ($message . $file_name_with_path));
|
||||
return ['status' => 'failed', 'message' => $message];
|
||||
}
|
||||
|
||||
try {
|
||||
$classifiers = $this->getDemographyData($members, $age_band_data, $members_heading, $available_col, $col_index);
|
||||
} catch (Exception $e) {
|
||||
return ['status' => 'fail', 'message' => $e->getMessage()];
|
||||
}
|
||||
|
||||
//for this to view the demography in the RFQ and QCR page to using internal
|
||||
if($returnType == "internal"){
|
||||
return ['data' => $classifiers];
|
||||
// print_rr($classifiers); die;
|
||||
}
|
||||
|
||||
|
||||
try {
|
||||
$result = $this->generateClassifierSpreadsheet($classifiers, WRITEPATH . 'uploads/lead_files/');
|
||||
if ($result['success']) {
|
||||
$this->myLogger->logme('error', "Spreadsheet generated successfully!");
|
||||
|
||||
echo "Location: " . $result['fullpath'] . "\n";
|
||||
echo "Filename: " . $result['filename'] . "\n";
|
||||
$filePaths = [
|
||||
['file_path' => WRITEPATH . 'uploads/lead_files/' . $lead_data['file_name'], 'sheets' => [0, 1]],
|
||||
['file_path' => WRITEPATH . '/uploads/lead_files/' . $result['filename'], 'sheets' => []],
|
||||
];
|
||||
$outputPath = WRITEPATH . 'uploads/lead_files/' . $lead_data['file_name'];
|
||||
$result_merge = ExcelMergeHelper::mergeExcelFiles($filePaths, $outputPath);
|
||||
if ($result_merge) {
|
||||
// Call the delete function after the file is successfully created
|
||||
$deleteResponse = $this->deleteGeneratedFile($result['fullpath']);
|
||||
|
||||
// Add delete message to response
|
||||
$response['deleteMessage'] = $deleteResponse['message'];
|
||||
return ['status' => 'success', 'message' => 'Member_Data Merged Suceesfully'];
|
||||
}
|
||||
} else {
|
||||
echo "Error generating spreadsheet: " . $result['error'];
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
echo "Error: " . $e->getMessage();
|
||||
return ['status' => 'fail', 'message' => $e->getMessage()];
|
||||
}
|
||||
} else {
|
||||
$this->myLogger->logme('error', (' no file found ' . $file_name_with_path));
|
||||
return ['status' => 'failed', 'message' => 'no file found'];
|
||||
}
|
||||
} else {
|
||||
$this->myLogger->logme('error', (' no file found ' . $file_name_with_path));
|
||||
return ['status' => 'failed', 'message' => 'no file found'];
|
||||
|
||||
}catch(Exception $e){
|
||||
$this->myLogger->logme("error", "Exception: " . $e->getMessage() . " --- Line: " . $e->getLine() . " --- Trace: " . $e->getTraceAsString());
|
||||
return ['status' => 'fail', 'error' => "File not found / Wrong file"];
|
||||
}
|
||||
}
|
||||
|
||||
@ -4668,4 +4842,55 @@ class LeadsController extends BaseController
|
||||
|
||||
return [];
|
||||
}
|
||||
|
||||
|
||||
public function generateDemographyDataTable($param)
|
||||
{
|
||||
$returnData = $this->calculateMembersDemography($param, "internal");
|
||||
|
||||
$html = "";
|
||||
|
||||
if (isset($returnData['data'])) {
|
||||
|
||||
$data = $returnData['data'];
|
||||
foreach ($data as $category => $records) {
|
||||
// Extract all column headers (age groups) dynamically
|
||||
$allColumns = [];
|
||||
foreach ($records as $person => $ages) {
|
||||
$allColumns = array_merge($allColumns, array_keys($ages));
|
||||
}
|
||||
$allColumns = array_unique($allColumns);
|
||||
$allColumns = array_values($allColumns); // reset index
|
||||
|
||||
$category = ucfirst($category);
|
||||
|
||||
// Start table with clean styling
|
||||
$html .= "<h3 style='color: #333; font-weight: 500; margin-bottom: 15px;'>{$category}</h3>";
|
||||
$html .= "<table style='width: 100%; border-collapse: collapse; font-family: Arial, sans-serif; font-size: 14px;'>";
|
||||
|
||||
// Table header with light background
|
||||
$html .= "<tr>";
|
||||
$html .= "<th style='background-color: #f8f9fa; color: #495057; padding: 6px 8px; text-align: left; border: 1px solid #dee2e6; font-weight: 500;'>Relation</th>";
|
||||
foreach ($allColumns as $col) {
|
||||
$html .= "<th style='background-color: #f8f9fa; color: #495057; padding: 6px 8px; text-align: center; border: 1px solid #dee2e6; font-weight: 500;'>{$col}</th>";
|
||||
}
|
||||
$html .= "</tr>";
|
||||
|
||||
// Table rows with clean styling
|
||||
foreach ($records as $relation => $ages) {
|
||||
$html .= "<tr>";
|
||||
$html .= "<td style='padding: 5px 8px; border: 1px solid #dee2e6; background-color: #fff;'>{$relation}</td>";
|
||||
foreach ($allColumns as $col) {
|
||||
$value = isset($ages[$col]) ? $ages[$col] : "-";
|
||||
$html .= "<td style='padding: 5px 8px; border: 1px solid #dee2e6; text-align: center; background-color: #fff;'>{$value}</td>";
|
||||
}
|
||||
$html .= "</tr>";
|
||||
}
|
||||
|
||||
$html .= "</table>";
|
||||
}
|
||||
}
|
||||
|
||||
return $html;
|
||||
}
|
||||
}
|
||||
|
||||
@ -35,6 +35,7 @@ use App\Models\COShareStmtDetailsModel;
|
||||
use App\Models\BdsPlacementModel;
|
||||
use Kint\Kint;
|
||||
use App\Helpers\MailHelper;
|
||||
use App\Helpers\ExcelSanitizeHelper;
|
||||
use Exception;
|
||||
|
||||
class PolicyTransactionController extends BaseController
|
||||
@ -2270,6 +2271,7 @@ class PolicyTransactionController extends BaseController
|
||||
// dd($highestRowAndColumn);
|
||||
$excel_data = $sheet->rangeToArray('A1:' . $highestRowAndColumn['column'] . $highestRowAndColumn['row']);
|
||||
unset($excel_data[0]);
|
||||
$excel_data = ExcelSanitizeHelper::sanitizeArrayData($excel_data);
|
||||
// Kint::dump($excel_data);die();
|
||||
//get no of line items and update in DB
|
||||
$line_items = 0;
|
||||
@ -2384,6 +2386,7 @@ class PolicyTransactionController extends BaseController
|
||||
// dd($highestRowAndColumn);
|
||||
$excel_data = $sheet->rangeToArray('A1:' . $highestRowAndColumn['column'] . $highestRowAndColumn['row']);
|
||||
unset($excel_data[0]);
|
||||
$excel_data = ExcelSanitizeHelper::sanitizeArrayData($excel_data);
|
||||
// dd($excel_data);
|
||||
//get no of line items and update in DB
|
||||
$line_items = count($excel_data);
|
||||
|
||||
169
app/Controllers/ThzController.php
Normal file
@ -0,0 +1,169 @@
|
||||
<?php
|
||||
|
||||
namespace App\Controllers;
|
||||
|
||||
use App\Controllers\BaseController;
|
||||
use CodeIgniter\HTTP\ResponseInterface;
|
||||
|
||||
use App\Models\ThzMasterModel;
|
||||
use App\Models\ThzMasterNotesModel;
|
||||
use App\ControllerCleaners\ThzControllerCleaner;
|
||||
|
||||
class ThzController extends BaseController
|
||||
{
|
||||
|
||||
protected $thzMasterModel;
|
||||
protected $thzMasterNotesModel;
|
||||
|
||||
protected $thzControllerCleaner;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->thzMasterModel = new ThzMasterModel();
|
||||
$this->thzMasterNotesModel = new ThzMasterNotesModel();
|
||||
$this->thzControllerCleaner = new ThzControllerCleaner();
|
||||
}
|
||||
|
||||
public function index()
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
public function ticketSave(){
|
||||
|
||||
$data = $this->request->getJSON(true);
|
||||
|
||||
if (!empty($data['thz_id'])) {
|
||||
$data['updated_by'] = get_session_userid();
|
||||
$ticket_id = $data['thz_id'];
|
||||
$text = "update";
|
||||
|
||||
$result = $this->thzMasterModel->where('thz_id', $ticket_id)->set($data)->update();
|
||||
} else {
|
||||
$data['created_by'] = get_session_userid();
|
||||
$text = "create";
|
||||
|
||||
$result = $this->thzMasterModel->insert($data);
|
||||
}
|
||||
|
||||
return $this->response->setJSON(([ 'status' => $result ? 'success' : 'error' ,
|
||||
'message' => $result ? "Ticket {$text}d successfully" : "Unable to {$text} ticket. Please try again." ]));
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
public function ticketList()
|
||||
{
|
||||
|
||||
$returnType = strtolower($this->request->getGet('return_type') ?? 'api');
|
||||
|
||||
$data = $this->request->getJSON(true);
|
||||
|
||||
$tickets = $this->fetchTicketsBasedOnrole($data);
|
||||
|
||||
|
||||
|
||||
if ($returnType === 'api') {
|
||||
if (empty($tickets)) {
|
||||
return $this->response->setJSON([ 'status' => 'error','message' => 'No tickets found',])->setStatusCode(404);
|
||||
}
|
||||
}else{
|
||||
|
||||
$data['page_name'] = "Ticket List";
|
||||
$data['ticket_data'] = $tickets;
|
||||
$data['assigner'] = $this->userModel->where('is_active', 1)->findAll();
|
||||
return $this->loadLayout('ticket_list_web', $data);
|
||||
}
|
||||
|
||||
|
||||
|
||||
return $this->response->setJSON([
|
||||
'status' => 'success',
|
||||
'data' => $tickets,
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
public function ticketConversationSave(){
|
||||
|
||||
$data = $this->request->getJSON(true);
|
||||
|
||||
$result = $this->thzMasterNotesModel->insert($data);
|
||||
|
||||
if(empty($result)){
|
||||
return $this->response->setJSON((['status' => 'error', 'message' => 'No tickets found']));
|
||||
}
|
||||
|
||||
return $this->response->setJSON((['status' => 'success', 'data' => $result]));
|
||||
|
||||
|
||||
}
|
||||
|
||||
public function ticketConversationList(){
|
||||
|
||||
$data = $this->request->getJSON(true);
|
||||
|
||||
$thz_id = $data['thz_id'] ?? null;
|
||||
|
||||
$result = $this->thzMasterNotesModel->ticketConversationList($thz_id);
|
||||
|
||||
if(empty($result)){
|
||||
return $this->response->setJSON((['status' => 'error', 'message' => 'No tickets found']));
|
||||
}
|
||||
|
||||
return $this->response->setJSON((['status' => 'success', 'data' => $result]));
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/************************************************** PRIVATE FUNCTIONS ********************************************************/
|
||||
|
||||
|
||||
private function checkGeneralUserOrEmployee($data){
|
||||
|
||||
if($data['empcode']){
|
||||
return $data['empcode'];
|
||||
} elseif ($data['mobile']) {
|
||||
return $data['mobile'];
|
||||
} elseif ($data['email']) {
|
||||
return $data['email'];
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private function fetchTicketsBasedOnrole(array $data): array
|
||||
{
|
||||
$id = $data['thz_id'] ?? null;
|
||||
$assign_to = $data['assign_to'] ?? null;
|
||||
$mobile = $data['mobile'] ?? null;
|
||||
|
||||
if (!empty($assign_to)) {
|
||||
// Tickets assigned to a staff
|
||||
return $this->thzMasterModel
|
||||
->where('assign_to', $assign_to)
|
||||
->findAll();
|
||||
}
|
||||
|
||||
if (!empty($id) && !empty($mobile)) {
|
||||
// Specific ticket by ID and mobile
|
||||
return $this->thzMasterModel
|
||||
->where('thz_id', $id)
|
||||
->where('mobile', $mobile)
|
||||
->findAll();
|
||||
}
|
||||
|
||||
// All tickets (e.g., for managers)
|
||||
return $this->thzMasterModel->findAll();
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -95,6 +95,7 @@ class TicketController extends BaseController
|
||||
4 => "Smart Service Desk",
|
||||
5 => "Direct to TPA"
|
||||
];
|
||||
|
||||
$this->claimType = [
|
||||
1 => [
|
||||
1 => "Main Hospitalization",
|
||||
@ -829,11 +830,25 @@ class TicketController extends BaseController
|
||||
$data['ticket_data'] = $ticket_data;
|
||||
$data['acms'] = $this->employeeModel->getAcmUsingClientID($ticket_data['client_id']);
|
||||
|
||||
$raw_json = $this->ticketMasterModel->getPolicyTermsJson($ticket_id) ;
|
||||
|
||||
$decoded_top = json_decode($raw_json ?? "", true) ?? [];
|
||||
$data['policy_terms'] = $this->recursive_json_decode($decoded_top);
|
||||
// do not remove this
|
||||
// $raw_json = $this->ticketMasterModel->getPolicyTermsJson($ticket_id) ;
|
||||
// $decoded_top = json_decode($raw_json ?? "", true) ?? [];
|
||||
// $data['policy_terms'] = $this->recursive_json_decode($decoded_top);
|
||||
|
||||
|
||||
$policy_data = $this->ticketMasterModel
|
||||
->select('client_policy.policy_terms')
|
||||
->join('client_policy', 'ticket_master.client_policy_id = client_policy.id')
|
||||
->where('client_policy.is_active', 1)
|
||||
->where('ticket_master.is_active', 1)
|
||||
->where('ticket_master.id', $ticket_id)
|
||||
->first();
|
||||
|
||||
if(isset($policy_data['policy_terms']) && !empty($policy_data['policy_terms'])){
|
||||
$terms = json_decode($policy_data['policy_terms'], true);
|
||||
$data['policy_terms'] = $this->convertTermsToDisplay($terms);
|
||||
// print_rr($data); die;
|
||||
}
|
||||
|
||||
return $this->loadLayout('ticket_edit_onbording', $data);
|
||||
}
|
||||
@ -2232,7 +2247,8 @@ class TicketController extends BaseController
|
||||
}
|
||||
}
|
||||
|
||||
public function recursive_json_decode($input) {
|
||||
public function recursive_json_decode($input)
|
||||
{
|
||||
if (is_string($input)) {
|
||||
$decoded = json_decode($input, true);
|
||||
if (json_last_error() === JSON_ERROR_NONE) {
|
||||
@ -2251,6 +2267,182 @@ class TicketController extends BaseController
|
||||
return $input;
|
||||
}
|
||||
|
||||
function convertTermsToDisplay(array $data)
|
||||
{
|
||||
$result = [];
|
||||
|
||||
$LableKeys = [
|
||||
"sum_insured" => "Sum Insured",
|
||||
"family_floater" => "Family Floater",
|
||||
"family_floaters" => "Family Floater Details",
|
||||
"age_ratio" => "Age Ratio",
|
||||
"is_payable_employee" => "Payable by Employee",
|
||||
"waiverofpreexistingdiseases" => "Waivers of Pre Existing Diseases",
|
||||
"waiverof1,2,3&4thyearexclusions" => "Waivers of 1, 2, 3 & 4th Year Exclusions",
|
||||
"waiverof30dayswaitingperiod" => "Waivers of 30 Days Waiting Period",
|
||||
"waiver_of_90_days_waiting_period" => "Waiver of 90 Days Waiting Period",
|
||||
"waiver_of_other_waiting_periods" => "Waiver of Other Waiting Periods",
|
||||
"maternity_benefit" => "Maternity Benefit",
|
||||
"9monthwaitingperiodwaived" => "9 Month Waiting Period Waived",
|
||||
"maternitycoverage" => "Maternity Coverage",
|
||||
"twindelivery" => "Twin Delivery",
|
||||
"well_baby_well_mother_expenses" => "Well Baby & Well Mother Expenses",
|
||||
"preandpostnatal" => "Pre and Post Natal",
|
||||
"infertility_treatment_coverage" => "Infertility Treatment Coverage",
|
||||
"babyday1cover" => "Baby Day 1 Cover",
|
||||
"coverfromthedateofjoining" => "Cover from the Date of Joining",
|
||||
"mid_term_addition_of_new_born_newly_wedded_spouse" => "Mid Term Addition of New Born / Newly Wedded Spouse",
|
||||
"prehospitalizationcover" => "Pre Hospitalization Cover",
|
||||
"posthospitalizationcover" => "Post Hospitalization Cover",
|
||||
"congenitaldiseasesinternal" => "Congenital Diseases - Internal",
|
||||
"congenitaldiseasesexternal" => "Congenital Diseases - External",
|
||||
"copayzonewisecopay" => "Co-Pay (Zone Wise)",
|
||||
"roomrentlimit" => "Room Rent Limit",
|
||||
"icu_limit" => "ICU Limit",
|
||||
"proportionatedeductionclause" => "Proportionate Deduction Clause",
|
||||
"ailmentcapping" => "Ailment Capping",
|
||||
"ailment_capping_details" => "Ailment Capping Details",
|
||||
"corporatebuffer" => "Corporate Buffer",
|
||||
"non_admissible_contingency_corporate_buffer" => "Non-Admissible Contingency Corporate Buffer",
|
||||
"ambulancecharges" => "Ambulance Charges",
|
||||
"airambulance" => "Air Ambulance",
|
||||
"reasonableandcustomarycharges" => "Reasonable and Customary Charges",
|
||||
"daycaretreatment" => "Day Care Treatment",
|
||||
"lasiksurgery" => "Lasik Surgery",
|
||||
"ayudhtreatmentcover" => "Ayudh Treatment Cover",
|
||||
"moderntreatmentsasperirdai" => "Modern Treatments as per IRDAI",
|
||||
"opd_treatment" => "OPD Treatment",
|
||||
"days_of_discharge" => "Days of Discharge",
|
||||
"days_from_dod" => "Days from Date of Discharge",
|
||||
"terrorism" => "Terrorism Cover",
|
||||
"widower_cover" => "Widower Cover",
|
||||
"breavement_cover" => "Breavement Cover",
|
||||
"suminsuredenhancement" => "Sum Insured Enhancement",
|
||||
"special_condition_label" => "Special Condition Label",
|
||||
"special_condition_input" => "Special Condition Input"
|
||||
];
|
||||
|
||||
// // 1. Family Floaters
|
||||
// $floatersMap = [
|
||||
// 'self' => '<b>Self</b>',
|
||||
// 'spouse' => 'Spouse',
|
||||
// 'childrens' => 'Childrens',
|
||||
// 'parents' => 'Parents',
|
||||
// 'parents-in-law' => 'Parents-in-law',
|
||||
// 'either-parents-pil' => 'Either Parents/PIL',
|
||||
// 'elders_count' => 'Elders'
|
||||
// ];
|
||||
|
||||
// 1. Family Floaters
|
||||
$floatersMap = [
|
||||
'self' => '<b style="color : #000;">Self</b>',
|
||||
'spouse' => '<b style="color : #000;">Spouse</b>',
|
||||
'childrens' => '<b style="color : #000;">Childrens</b>',
|
||||
'parents' => '<b style="color : #000;">Parents</b>',
|
||||
'parents-in-law' => '<b style="color : #000;">Parents-in-law</b>',
|
||||
'either-parents-pil' => '<b style="color : #000;">Either Parents/PIL</b>',
|
||||
'elders_count' => '<b style="color : #000;">Total Elders Count</b>'
|
||||
];
|
||||
|
||||
if(isset($data['family_floaters'])){
|
||||
$floatersOutput = [];
|
||||
foreach ($floatersMap as $key => $label) {
|
||||
if (isset($data['family_floaters'][$key])) {
|
||||
$val = $data['family_floaters'][$key];
|
||||
$floatersOutput[] = "$label : " . ($val > 0 ? $val : 'No');
|
||||
}
|
||||
}
|
||||
$data['family_floaters'] = implode(', ', $floatersOutput);
|
||||
}
|
||||
|
||||
// 2. Age Ratio
|
||||
if (!empty($data['age_ratio'])) {
|
||||
$ageOutput = [];
|
||||
foreach ($data['age_ratio'] as $person => $age) {
|
||||
if (isset($age['min']) && isset($age['max'])) {
|
||||
// $ageOutput[] = ucfirst($person) . " - Min : {$age['min']}, Max : {$age['max']}";
|
||||
$ageOutput[] = "<b style='color : #000;'>" . ucfirst($person) . "</b> - <b> Min </b>: {$age['min']}, <b> Max </b> : {$age['max']}";
|
||||
}
|
||||
}
|
||||
$data['age_ratio'] = implode(', ', $ageOutput);
|
||||
}
|
||||
|
||||
// 3. Is Payable Employee
|
||||
if (!empty($data['is_payable_employee'])) {
|
||||
$payableOutput = [];
|
||||
foreach ($data['is_payable_employee'] as $person => $status) {
|
||||
// $payableOutput[] = ucfirst($person) . " : " . ($status ? 'Yes' : 'No');
|
||||
$payableOutput[] = "<b style='color : #000;'>" . ucfirst($person) . "</b> : " . ($status ? 'Yes' : 'No');
|
||||
}
|
||||
$data['is_payable_employee'] = implode(', ', $payableOutput);
|
||||
}
|
||||
|
||||
// 4. Remove the Enrollment display key
|
||||
if(isset($data['enrollment_display_key'])){
|
||||
unset($data['enrollment_display_key']);
|
||||
}
|
||||
|
||||
// 5. Merge the Sum Insured value if the multiple sum insured exists
|
||||
if(isset($data['multiple_sum_insured'])){
|
||||
if(isset($data['sumInsured2'])){
|
||||
$data['sumInsured2'] = $data['sumInsured2'] . ", " . implode(", ", $data['multiple_sum_insured']);
|
||||
}else{
|
||||
$data['sum_insured'] = $data['sum_insured'] . ", " . implode(", ", $data['multiple_sum_insured']);
|
||||
}
|
||||
unset($data['multiple_sum_insured']);
|
||||
}
|
||||
|
||||
// 6. Add the special condition to key value pair
|
||||
|
||||
if(!empty($data['special_condition_label'])){
|
||||
foreach ($data['special_condition_label'] as $key => $value) {
|
||||
if($value != "" && $value != null) {
|
||||
$data[$value] = $data['special_condition_input'][$key];
|
||||
}
|
||||
}
|
||||
}//GMC
|
||||
|
||||
if(!empty($data['gpa_special_condition_label'])){
|
||||
foreach ($data['gpa_special_condition_label'] as $key => $value) {
|
||||
if($value != "" && $value != null) {
|
||||
$data[$value] = $data['gpa_special_condition_input'][$key];
|
||||
}
|
||||
}
|
||||
}//GPA
|
||||
|
||||
// 7. Remove the special condition keys
|
||||
unset($data['special_condition_label']);
|
||||
unset($data['special_condition_input']);
|
||||
unset($data['gpa_special_condition_label']);
|
||||
unset($data['gpa_special_condition_input']);
|
||||
|
||||
if(isset($data['sumInsured2'])){
|
||||
$firstItem = ["Sum Insured" => $data['sumInsured2']];
|
||||
unset($data['sumInsured2']);
|
||||
$data = $firstItem + $data;
|
||||
}
|
||||
|
||||
// 8. Change the key name to lable name
|
||||
$result = [];
|
||||
foreach ($data as $key => $value) {
|
||||
|
||||
// $label = isset($LableKeys[$key]) ? $LableKeys[$key] : $key;
|
||||
if (isset($LableKeys[$key])) {
|
||||
$label = $LableKeys[$key];
|
||||
// echo "1";
|
||||
} else {
|
||||
// Handle camelCase first, then snake_case
|
||||
$label = preg_replace('/(?<!^)[A-Z]/', ' $0', $key); // camelCase → space
|
||||
$label = ucwords(str_replace('_', ' ', $label)); // snake_case → space & capitalize
|
||||
// echo "2";
|
||||
}
|
||||
|
||||
$result[$label] = $value == 1 ? "Yes" : ($value == 0 ? "No" : $value);
|
||||
}
|
||||
// return count($result);
|
||||
// return $data;
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
214
app/Controllers/VidalApiController.php
Normal file
@ -0,0 +1,214 @@
|
||||
<?php
|
||||
|
||||
namespace App\Controllers;
|
||||
|
||||
use App\Controllers\BaseController;
|
||||
use CodeIgniter\HTTP\ResponseInterface;
|
||||
|
||||
class VidalApiController extends BaseController
|
||||
{
|
||||
public function index()
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
public function hospitalNetwork(){
|
||||
|
||||
$postData = $this->request->getJSON(true);
|
||||
|
||||
|
||||
helper('api');
|
||||
|
||||
$url = ''. getenv('VIDAL_API_BASE_URL').'/hospitalnetwork';
|
||||
$method = 'POST';
|
||||
|
||||
$headers = [
|
||||
'Content-Type: application/json',
|
||||
'Authorization:'. getenv('VIDAL_API_KEY').'',
|
||||
'username:'. getenv('VIDAL_API_USERNAME').'',
|
||||
'password:'. getenv('VIDAL_API_PASSWORD').'',
|
||||
'policynumber:'. $postData['policyNo'] ?? '',
|
||||
];
|
||||
|
||||
|
||||
|
||||
$body = [];
|
||||
|
||||
$response = call_third_party_api($url, $method, $headers, $body);
|
||||
|
||||
|
||||
if($response['status'] != true){
|
||||
return $this->response->setJSON([
|
||||
'status' => false,
|
||||
'message' => 'Token generation failed.',
|
||||
'data' => $response
|
||||
]);
|
||||
}
|
||||
|
||||
return $this->response->setJSON($response);
|
||||
|
||||
}
|
||||
|
||||
public function eCardService(){
|
||||
|
||||
$postData = $this->request->getJSON(true);
|
||||
|
||||
helper('api');
|
||||
|
||||
$url = ''. getenv('VIDAL_API_BASE_URL').'/ecardservice';
|
||||
$method = 'POST';
|
||||
|
||||
|
||||
$headers = [
|
||||
'Content-Type: application/json',
|
||||
'Authorization:'.getenv('VIDAL_API_KEY').'',
|
||||
'username:' .getenv('VIDAL_API_USERNAME').'',
|
||||
'password:' .getenv('VIDAL_API_PASSWORD').'',
|
||||
'PolicyNo:' .$postData['PolicyNo'] ?? '',
|
||||
'enrollmentNo:' .$postData['enrollmentNo'] ?? '',
|
||||
];
|
||||
|
||||
$body = [
|
||||
];
|
||||
|
||||
$response = call_third_party_api($url, $method, $headers, $body);
|
||||
|
||||
if($response['status'] != true){
|
||||
return $this->response->setJSON([
|
||||
'status' => false,
|
||||
'message' => 'Token generation failed.',
|
||||
'data' => $response
|
||||
]);
|
||||
}
|
||||
|
||||
return $this->response->setJSON($response);
|
||||
|
||||
}
|
||||
|
||||
public function claimStatusCheck(){
|
||||
|
||||
$postData = $this->request->getJSON(true);
|
||||
|
||||
helper('api');
|
||||
|
||||
$url = ''. getenv('VIDAL_API_BASE_URL').'/claimpreauthservice';
|
||||
$method = 'POST';
|
||||
|
||||
$headers = [
|
||||
'Content-Type: application/json',
|
||||
'Authorization:' .getenv('VIDAL_API_KEY').'',
|
||||
'username:' .getenv('VIDAL_API_USERNAME').'',
|
||||
'password:' .getenv('VIDAL_API_PASSWORD').'',
|
||||
'PolicyNo:' .$postData['policyNo'] ?? '',
|
||||
'enrollmentNo:' .$postData['enrollmentNo'] ?? '',
|
||||
'empNo:' .$postData['empNo'] ?? '',
|
||||
'startdate:' .$postData['startdate'] ?? '',
|
||||
'enddate:' .$postData['enddate'] ?? '',
|
||||
'tpaclaimNo:' .$postData['tpaclaimNo'] ?? ''
|
||||
];
|
||||
|
||||
$body = [];
|
||||
|
||||
$response = call_third_party_api($url, $method, $headers, $body);
|
||||
|
||||
if($response['status'] != true){
|
||||
return $this->response->setJSON([
|
||||
'status' => false,
|
||||
'message' => 'Token generation failed.',
|
||||
'data' => $response
|
||||
]);
|
||||
}
|
||||
|
||||
return $this->response->setJSON($response);
|
||||
|
||||
}
|
||||
|
||||
public function newClaim(){
|
||||
|
||||
$postData = $this->request->getPost();
|
||||
|
||||
helper('api');
|
||||
|
||||
$url = ''. getenv('VIDAL_API_BASE_URL').'/submitClaim';
|
||||
$method = 'POST';
|
||||
|
||||
$headers = [
|
||||
'Content-Type: multipart/form-data',
|
||||
'Authorization:' .getenv('VIDAL_API_KEY').'',
|
||||
];
|
||||
|
||||
$body = [
|
||||
'username:' .getenv('VIDAL_API_USERNAME').'',
|
||||
'password:' .getenv('VIDAL_API_PASSWORD').'',
|
||||
'PolicyNo:' .$postData['policyNo'] ?? '',
|
||||
'enrollmentId:' .$postData['enrollmentId'] ?? '',
|
||||
'typeOfClaim:' .$postData['typeOfClaim'] ?? '',
|
||||
'claimSubType:' .$postData['claimSubType'] ?? '',
|
||||
'requestedAmount:' .$postData['requestedAmount'] ?? '',
|
||||
'ailmentType:' .$postData['ailmentType'] ?? '',
|
||||
'admissionDate:' .$postData['admissionDate'] ?? '',
|
||||
'dischargeDate:' .$postData['dischargeDate'] ?? '',
|
||||
'hospitalName:' .$postData['hospitalName'] ?? '',
|
||||
'empanelmentNo:' .$postData['empanelmentNo'] ?? '',
|
||||
'documentType:' .$postData['documentType'] ?? '',
|
||||
'ailmentName:' .$postData['ailmentName'] ?? '',
|
||||
'hospitalAddress:' .$postData['hospitalAddress'] ?? '',
|
||||
'hospitalState:' .$postData['hospitalState'] ?? '',
|
||||
'hospitalCity:' .$postData['hospitalCity'] ?? '',
|
||||
'hospitalPinCode:' .$postData['hospitalPinCode'] ?? '',
|
||||
'hospitalPhoneNo:' .$postData['hospitalPhoneNo'] ?? ''
|
||||
];
|
||||
|
||||
$response = call_third_party_api($url, $method, $headers, $body);
|
||||
|
||||
if($response['status'] != true){
|
||||
return $this->response->setJSON([
|
||||
'status' => false,
|
||||
'message' => 'Token generation failed.',
|
||||
'data' => $response
|
||||
]);
|
||||
}
|
||||
|
||||
return $this->response->setJSON($response);
|
||||
|
||||
}
|
||||
|
||||
|
||||
public function enrollment(){
|
||||
|
||||
$postData = $this->request->getJSON(true);
|
||||
|
||||
helper('api');
|
||||
|
||||
$url = ''. getenv('VIDAL_API_BASE_URL').'/enrollmendataservice';
|
||||
$method = 'POST';
|
||||
|
||||
$headers = [
|
||||
'Content-Type: application/json',
|
||||
'Authorization:'. getenv('VIDAL_API_KEY').'',
|
||||
'username:' . getenv('VIDAL_API_USERNAME').'',
|
||||
'password:' . getenv('VIDAL_API_PASSWORD').'',
|
||||
'policyNo:' .$postData['policyNo'] ?? '',
|
||||
'startindex:' .$postData['startindex'] ?? '',
|
||||
'endindex:' .$postData['endindex'] ?? ''
|
||||
];
|
||||
|
||||
$body = [
|
||||
];
|
||||
|
||||
$response = call_third_party_api($url, $method, $headers, $body);
|
||||
|
||||
|
||||
if($response['status'] != true){
|
||||
return $this->response->setJSON([
|
||||
'status' => false,
|
||||
'message' => 'Token generation failed.',
|
||||
'data' => $response
|
||||
]);
|
||||
}
|
||||
|
||||
return $this->response->setJSON($response);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@ -767,11 +767,17 @@ class PolicyTransactionModel extends Model
|
||||
) AS unbilled_amt,
|
||||
created_user.first_name as user_name,
|
||||
CASE
|
||||
WHEN `pt_co_share_details`.`co_share_type` IN (0, 1) THEN `policy_transaction`.`policy_no`
|
||||
WHEN `pt_co_share_details`.`co_share_type` > 1 THEN `pt_co_share_details`.`follower_policy_no`
|
||||
ELSE `policy_transaction`.`policy_no` -- Default fallback
|
||||
END AS `policy_no`
|
||||
|
||||
WHEN pt_co_share_details.co_share_type IN (0, 1)
|
||||
THEN policy_transaction.policy_no
|
||||
WHEN pt_co_share_details.co_share_type > 1
|
||||
THEN CASE
|
||||
WHEN pt_co_share_details.follower_policy_no IS NULL
|
||||
OR pt_co_share_details.follower_policy_no = ''
|
||||
THEN policy_transaction.policy_no
|
||||
ELSE pt_co_share_details.follower_policy_no
|
||||
END
|
||||
ELSE policy_transaction.policy_no
|
||||
END AS policy_no
|
||||
")
|
||||
->join('pt_co_share_details', 'policy_transaction.id = pt_co_share_details.pt_id', 'left')
|
||||
// ->join('insurer_statements', 'pt_co_share_details.statement_id = insurer_statements.id', 'left')
|
||||
@ -993,10 +999,17 @@ class PolicyTransactionModel extends Model
|
||||
DATE_FORMAT(policy_transaction.created_at, '%d %b %Y %h:%i %p') AS created_at,
|
||||
user_profiles.first_name as user_name,
|
||||
CASE
|
||||
WHEN `pt_co_share_details`.`co_share_type` IN (0, 1) THEN `policy_transaction`.`policy_no`
|
||||
WHEN `pt_co_share_details`.`co_share_type` > 1 THEN `pt_co_share_details`.`follower_policy_no`
|
||||
ELSE `policy_transaction`.`policy_no` -- Default fallback
|
||||
END AS `policy_no`
|
||||
WHEN pt_co_share_details.co_share_type IN (0, 1)
|
||||
THEN policy_transaction.policy_no
|
||||
WHEN pt_co_share_details.co_share_type > 1
|
||||
THEN CASE
|
||||
WHEN pt_co_share_details.follower_policy_no IS NULL
|
||||
OR pt_co_share_details.follower_policy_no = ''
|
||||
THEN policy_transaction.policy_no
|
||||
ELSE pt_co_share_details.follower_policy_no
|
||||
END
|
||||
ELSE policy_transaction.policy_no
|
||||
END AS policy_no
|
||||
")
|
||||
->join('pt_co_share_details', 'policy_transaction.id = pt_co_share_details.pt_id', 'left')
|
||||
->join('clients', 'clients.id = policy_transaction.client_id', 'left')
|
||||
@ -1068,7 +1081,7 @@ class PolicyTransactionModel extends Model
|
||||
{
|
||||
// dd($start_date, $end_date, $client_id, $insurer_id, $policy_type_id, $date_type, $issuer, $status);
|
||||
$builder = $this->db->table('policy_transaction')
|
||||
->select('
|
||||
->select("
|
||||
policy_transaction.*,
|
||||
clients.short_name as client_short_name,
|
||||
clients.client_code,
|
||||
@ -1077,11 +1090,18 @@ class PolicyTransactionModel extends Model
|
||||
insurers.short_name AS insurer_short_name,
|
||||
policy_type.policy_type ,
|
||||
CASE
|
||||
WHEN `pt_co_share_details`.`co_share_type` IN (0, 1) THEN `policy_transaction`.`policy_no`
|
||||
WHEN `pt_co_share_details`.`co_share_type` > 1 THEN `pt_co_share_details`.`follower_policy_no`
|
||||
ELSE `policy_transaction`.`policy_no` -- Default fallback
|
||||
END AS `policy_no`
|
||||
')
|
||||
WHEN pt_co_share_details.co_share_type IN (0, 1)
|
||||
THEN policy_transaction.policy_no
|
||||
WHEN pt_co_share_details.co_share_type > 1
|
||||
THEN CASE
|
||||
WHEN pt_co_share_details.follower_policy_no IS NULL
|
||||
OR pt_co_share_details.follower_policy_no = ''
|
||||
THEN policy_transaction.policy_no
|
||||
ELSE pt_co_share_details.follower_policy_no
|
||||
END
|
||||
ELSE policy_transaction.policy_no
|
||||
END AS policy_no
|
||||
")
|
||||
->join('pt_co_share_details', 'policy_transaction.id = pt_co_share_details.pt_id', 'left')
|
||||
->join('clients', 'policy_transaction.client_id = clients.id', 'left')
|
||||
->join('client_branch', 'policy_transaction.client_branch_id = client_branch.id', 'left')
|
||||
@ -1245,12 +1265,17 @@ class PolicyTransactionModel extends Model
|
||||
2
|
||||
) AS variance_amt,
|
||||
CASE
|
||||
WHEN `pt_co_share_details`.`co_share_type` IN (0, 1) THEN `policy_transaction`.`policy_no`
|
||||
WHEN `pt_co_share_details`.`co_share_type` > 1 THEN `pt_co_share_details`.`follower_policy_no`
|
||||
ELSE `policy_transaction`.`policy_no` -- Default fallback
|
||||
END AS `policy_no`
|
||||
|
||||
|
||||
WHEN pt_co_share_details.co_share_type IN (0, 1)
|
||||
THEN policy_transaction.policy_no
|
||||
WHEN pt_co_share_details.co_share_type > 1
|
||||
THEN CASE
|
||||
WHEN pt_co_share_details.follower_policy_no IS NULL
|
||||
OR pt_co_share_details.follower_policy_no = ''
|
||||
THEN policy_transaction.policy_no
|
||||
ELSE pt_co_share_details.follower_policy_no
|
||||
END
|
||||
ELSE policy_transaction.policy_no
|
||||
END AS policy_no
|
||||
")
|
||||
->join('pt_co_share_details', 'policy_transaction.id = pt_co_share_details.pt_id', 'left')
|
||||
->join('insurer_statements', 'pt_co_share_details.statement_id = insurer_statements.id', 'left')
|
||||
@ -1348,10 +1373,17 @@ class PolicyTransactionModel extends Model
|
||||
'pt_co_share_details.tep_amt',
|
||||
'policy_transaction.status',
|
||||
'CASE
|
||||
WHEN `pt_co_share_details`.`co_share_type` IN (0, 1) THEN `policy_transaction`.`policy_no`
|
||||
WHEN `pt_co_share_details`.`co_share_type` > 1 THEN `pt_co_share_details`.`follower_policy_no`
|
||||
ELSE `policy_transaction`.`policy_no` -- Default fallback
|
||||
END AS `policy_no`'
|
||||
WHEN pt_co_share_details.co_share_type IN (0, 1)
|
||||
THEN policy_transaction.policy_no
|
||||
WHEN pt_co_share_details.co_share_type > 1
|
||||
THEN CASE
|
||||
WHEN pt_co_share_details.follower_policy_no IS NULL
|
||||
OR pt_co_share_details.follower_policy_no = ""
|
||||
THEN policy_transaction.policy_no
|
||||
ELSE pt_co_share_details.follower_policy_no
|
||||
END
|
||||
ELSE policy_transaction.policy_no
|
||||
END AS policy_no'
|
||||
])
|
||||
->join('pt_co_share_details', 'policy_transaction.id = pt_co_share_details.pt_id', 'left')
|
||||
->join('clients', 'clients.id = policy_transaction.client_id', 'left')
|
||||
@ -1443,10 +1475,17 @@ class PolicyTransactionModel extends Model
|
||||
pt_co_share_details.variance,
|
||||
policy_transaction.status,
|
||||
CASE
|
||||
WHEN `pt_co_share_details`.`co_share_type` IN (0, 1) THEN `policy_transaction`.`policy_no`
|
||||
WHEN `pt_co_share_details`.`co_share_type` > 1 THEN `pt_co_share_details`.`follower_policy_no`
|
||||
ELSE `policy_transaction`.`policy_no` -- Default fallback
|
||||
END AS `policy_no`
|
||||
WHEN pt_co_share_details.co_share_type IN (0, 1)
|
||||
THEN policy_transaction.policy_no
|
||||
WHEN pt_co_share_details.co_share_type > 1
|
||||
THEN CASE
|
||||
WHEN pt_co_share_details.follower_policy_no IS NULL
|
||||
OR pt_co_share_details.follower_policy_no = ''
|
||||
THEN policy_transaction.policy_no
|
||||
ELSE pt_co_share_details.follower_policy_no
|
||||
END
|
||||
ELSE policy_transaction.policy_no
|
||||
END AS policy_no
|
||||
")
|
||||
->join('pt_co_share_details', 'policy_transaction.id = pt_co_share_details.pt_id', 'left')
|
||||
->join('clients', 'clients.id = policy_transaction.client_id', 'left')
|
||||
@ -1554,11 +1593,18 @@ class PolicyTransactionModel extends Model
|
||||
AND inv_payment_details.is_active = 1
|
||||
),
|
||||
2) AS outstanding_amount,
|
||||
CASE
|
||||
WHEN `pt_co_share_details`.`co_share_type` IN (0, 1) THEN `policy_transaction`.`policy_no`
|
||||
WHEN `pt_co_share_details`.`co_share_type` > 1 THEN `pt_co_share_details`.`follower_policy_no`
|
||||
ELSE `policy_transaction`.`policy_no` -- Default fallback
|
||||
END AS `policy_no`
|
||||
CASE
|
||||
WHEN pt_co_share_details.co_share_type IN (0, 1)
|
||||
THEN policy_transaction.policy_no
|
||||
WHEN pt_co_share_details.co_share_type > 1
|
||||
THEN CASE
|
||||
WHEN pt_co_share_details.follower_policy_no IS NULL
|
||||
OR pt_co_share_details.follower_policy_no = ''
|
||||
THEN policy_transaction.policy_no
|
||||
ELSE pt_co_share_details.follower_policy_no
|
||||
END
|
||||
ELSE policy_transaction.policy_no
|
||||
END AS policy_no
|
||||
")
|
||||
->join('pt_co_share_details', 'policy_transaction.id = pt_co_share_details.pt_id', 'left')
|
||||
->join('insurer_statements', 'pt_co_share_details.statement_id = insurer_statements.id', 'left')
|
||||
|
||||
42
app/Models/ThzMasterModel.php
Normal file
@ -0,0 +1,42 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use CodeIgniter\Model;
|
||||
|
||||
class ThzMasterModel extends Model
|
||||
{
|
||||
protected $table = 'thz_master';
|
||||
protected $primaryKey = 'thz_id';
|
||||
protected $useAutoIncrement = true;
|
||||
protected $returnType = 'array';
|
||||
protected $useSoftDeletes = false;
|
||||
protected $protectFields = true;
|
||||
protected $allowedFields = ['name','mobile','email','empcode','policy_no','ticket_type','subject','message','status','assign_to','created_at','updated_at'];
|
||||
|
||||
protected bool $allowEmptyInserts = false;
|
||||
|
||||
// Dates
|
||||
protected $useTimestamps = false;
|
||||
protected $dateFormat = 'datetime';
|
||||
protected $createdField = 'created_at';
|
||||
protected $updatedField = 'updated_at';
|
||||
protected $deletedField = 'deleted_at';
|
||||
|
||||
// Validation
|
||||
protected $validationRules = [];
|
||||
protected $validationMessages = [];
|
||||
protected $skipValidation = false;
|
||||
protected $cleanValidationRules = true;
|
||||
|
||||
// Callbacks
|
||||
protected $allowCallbacks = true;
|
||||
protected $beforeInsert = [];
|
||||
protected $afterInsert = [];
|
||||
protected $beforeUpdate = [];
|
||||
protected $afterUpdate = [];
|
||||
protected $beforeFind = [];
|
||||
protected $afterFind = [];
|
||||
protected $beforeDelete = [];
|
||||
protected $afterDelete = [];
|
||||
}
|
||||
80
app/Models/ThzMasterNotesModel.php
Normal file
@ -0,0 +1,80 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use CodeIgniter\Model;
|
||||
|
||||
class ThzMasterNotesModel extends Model
|
||||
{
|
||||
protected $table = 'thz_master_notes';
|
||||
protected $primaryKey = 'id';
|
||||
protected $useAutoIncrement = true;
|
||||
protected $returnType = 'array';
|
||||
protected $useSoftDeletes = false;
|
||||
protected $protectFields = true;
|
||||
protected $allowedFields = ['thz_id','notes','notes_by','created_by','created_at'];
|
||||
|
||||
protected bool $allowEmptyInserts = false;
|
||||
|
||||
// Dates
|
||||
protected $useTimestamps = false;
|
||||
protected $dateFormat = 'datetime';
|
||||
protected $createdField = 'created_at';
|
||||
protected $updatedField = 'updated_at';
|
||||
protected $deletedField = 'deleted_at';
|
||||
|
||||
// Validation
|
||||
protected $validationRules = [];
|
||||
protected $validationMessages = [];
|
||||
protected $skipValidation = false;
|
||||
protected $cleanValidationRules = true;
|
||||
|
||||
// Callbacks
|
||||
protected $allowCallbacks = true;
|
||||
protected $beforeInsert = [];
|
||||
protected $afterInsert = [];
|
||||
protected $beforeUpdate = [];
|
||||
protected $afterUpdate = [];
|
||||
protected $beforeFind = [];
|
||||
protected $afterFind = [];
|
||||
protected $beforeDelete = [];
|
||||
protected $afterDelete = [];
|
||||
|
||||
public function ticketConversationList($thz_id){
|
||||
|
||||
|
||||
if(empty($thz_id)){
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
$sql = "SELECT
|
||||
thz_master.*,
|
||||
thz_master_notes.id,
|
||||
thz_master_notes.thz_id,
|
||||
thz_master_notes.notes,
|
||||
thz_master_notes.notes_by,
|
||||
thz_master_notes.created_by,
|
||||
thz_master_notes.created_at
|
||||
FROM
|
||||
thz_master_notes
|
||||
|
||||
Join thz_master ON thz_master.thz_id = :thz_id:
|
||||
|
||||
WHERE
|
||||
thz_master_notes.thz_id = :thz_id:
|
||||
ORDER BY
|
||||
thz_master_notes.created_at DESC
|
||||
";
|
||||
|
||||
$binds = ["thz_id" => $thz_id ];
|
||||
|
||||
$result = $this->db->query($sql,$binds)->getResultArray() ;
|
||||
|
||||
return $result;
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@ -171,79 +171,109 @@
|
||||
margin: 0 5px 10px!important;
|
||||
}
|
||||
|
||||
.nav-link{
|
||||
color:black !important;
|
||||
background-color: #D4F5F6 !important;
|
||||
font-size: small;
|
||||
padding:8px;
|
||||
border-radius: 10px !important;
|
||||
}
|
||||
.nav-link.active-tab {
|
||||
color: white !important;
|
||||
background-color: #00999E !important;
|
||||
font-size: small;
|
||||
padding:8px;
|
||||
border-radius: 10px !important;
|
||||
|
||||
}
|
||||
.tab-content-styles{
|
||||
background-color:#F4F4F4;
|
||||
margin-right:20px;
|
||||
border-radius:25px!important;
|
||||
min-height: 70vh !important;
|
||||
}
|
||||
|
||||
|
||||
</style>
|
||||
|
||||
<p style="color:black;font-size:x-large;margin-left:50px;margin-bottom:20px;"><b>Dashboard</b></p>
|
||||
|
||||
<?php if(in_array(get_role_id(), [1,2,3,4,5]) || (in_array(ENROLLMENT_TEAM_ID, user_team()) || in_array(CLAIMS_TEAM_ID, user_team()) || in_array(MANAGEMENT_TEAM_ID, user_team()) || in_array(FINANCE_TEAM_ID, user_team()) || in_array(BUSINESS_TEAM_ID, user_team()))) { ?>
|
||||
|
||||
<div class="row" id="client_add" style="margin-top: -32px;">
|
||||
<div class="col-12">
|
||||
<!-- <div class="card"> -->
|
||||
<div class="card-body">
|
||||
<div class="row" style="padding-bottom: 10px;">
|
||||
<div class="col-6" style="align-self: center;">
|
||||
</div>
|
||||
<div class="col-6" style="text-align: right;">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<br>
|
||||
|
||||
<br>
|
||||
<ul class="nav nav-pills navtab-bg">
|
||||
|
||||
<?php if(in_array(get_role_id(), [1,2,3,5])) { ?>
|
||||
|
||||
<li class="nav-item">
|
||||
<a href="#pending-actions-dash-tab" data-toggle="tab" aria-expanded="false"
|
||||
class="nav-link px-3 py-2 active" id="pending_actions_tab">
|
||||
<span class="mr-1"><i class="mdi mdi-contacts"></i></span>
|
||||
<li class="nav-item d-flex justify-content-center align-items-center">
|
||||
<a href="#pending-actions-dash-tab" data-toggle="tab" aria-expanded="false"
|
||||
class="nav-link px-3 py-1 " id="pending_actions_tab">
|
||||
<img src="<?= base_url() . "public"; ?>/assets/images/inactive_pending_actions.png" alt="Logo" height="14" class="inactive_pending" >
|
||||
<img src="<?= base_url() . "public"; ?>/assets/images/active_pending_actions.png" alt="Logo" height="14"
|
||||
class="active_pending" style="display:none;">
|
||||
|
||||
<span class="d-none d-sm-inline-block">Pending Actions</span>
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a href="#enrollment-dash-tab" data-toggle="tab" aria-expanded="true" class="nav-link px-3 py-2" id="enrollemnt_tab">
|
||||
<span class="mr-1"><i class="fa fa-file"></i></span>
|
||||
<span class="d-none d-sm-inline-block">Enrolment</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<?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()))) { ?>
|
||||
|
||||
<li class="nav-item">
|
||||
<a href="#bds-dash-tab" data-toggle="tab" aria-expanded="true" class="nav-link px-3 py-2" id="bds_tab">
|
||||
<span class="mr-1"><i class="fa fa-file"></i></span>
|
||||
<li class="nav-item d-flex justify-content-center align-items-center">
|
||||
<a href="#bds-dash-tab" data-toggle="tab" aria-expanded="true" class="nav-link px-3 py-1" id="bds_tab">
|
||||
<img src="<?= base_url() . "public"; ?>/assets/images/inactive_bds.png" alt="Logo" height="14" class="inactive_bds">
|
||||
<img src="<?= base_url() . "public"; ?>/assets/images/active_bds.png" alt="Logo" height="14"
|
||||
class="active_bds" style="display:none;">
|
||||
|
||||
<span class="d-none d-sm-inline-block">BDS</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
<?php } ?>
|
||||
<?php if ((get_role_id() == STAFF_ROLE_ID && in_array(CLAIMS_TEAM_ID,user_team())) || in_array(get_role_id(),[1,5])) :?>
|
||||
<?php
|
||||
$isActive = get_role_id() == STAFF_ROLE_ID && in_array(CLAIMS_TEAM_ID,user_team()) ? 'active show' : '';
|
||||
?>
|
||||
<li class="nav-item">
|
||||
<a href="#claims-dash-tab" data-toggle="tab" aria-expanded="true" class="nav-link px-3 py-2 <?= $isActive?>" id="claims_tab">
|
||||
<span class="mr-1"><i class="fa fa-file-alt"></i> </span>
|
||||
<li class="nav-item d-flex justify-content-center align-items-center">
|
||||
<a href="#claims-dash-tab" data-toggle="tab" aria-expanded="true" class="nav-link px-3 py-1" id="claims_tab">
|
||||
<img src="<?= base_url() . "public"; ?>/assets/images/inactive_claims.png" alt="Logo" height="14" class="inactive_claims">
|
||||
<img src="<?= base_url() . "public"; ?>/assets/images/active_claims.png" alt="Logo" height="14"
|
||||
class="active_claims" style="display:none;">
|
||||
|
||||
<span class="d-none d-sm-inline-block">Claims</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<?php endif; ?>
|
||||
<?php if ((get_role_id() == STAFF_ROLE_ID && in_array(ENROLLMENT_TEAM_ID,user_team())) || in_array(get_role_id(),[1,5])) :?>
|
||||
<?php
|
||||
$isActive = get_role_id() == STAFF_ROLE_ID && in_array(ENROLLMENT_TEAM_ID,user_team()) ? 'active show' : '';
|
||||
?>
|
||||
<li class="nav-item">
|
||||
<a href="#leads-dash-tab" data-toggle="tab" aria-expanded="true" class="nav-link px-3 py-2 <?= $isActive?>" id="leads_tab">
|
||||
<span class="mr-1"><i class="fa fa-file-alt"></i> </span>
|
||||
<li class="nav-item d-flex justify-content-center align-items-center">
|
||||
<a href="#leads-dash-tab" data-toggle="tab" aria-expanded="true" class="nav-link px-3 py-1" id="leads_tab" >
|
||||
<img src="<?= base_url() . "public"; ?>/assets/images/inactive_leads_and_bds_renewal.png" alt="Logo" height="14" class="inactive_leads">
|
||||
<img src="<?= base_url() . "public"; ?>/assets/images/active_leads_and_bds_renewal.png" alt="Logo" height="14"
|
||||
class="active_leads" style="display:none;">
|
||||
|
||||
<span class="d-none d-sm-inline-block">Leads and BDS Renewals</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
|
||||
</ul>
|
||||
<div class="tab-content">
|
||||
<br>
|
||||
<div class="tab-content tab-content-styles">
|
||||
|
||||
<?php if ((get_role_id() == STAFF_ROLE_ID && in_array(CLAIMS_TEAM_ID,user_team())) || in_array(get_role_id(),[1,5])) :?>
|
||||
<?php include("claims_dash.php") ?>
|
||||
<?php endif; ?>
|
||||
@ -257,7 +287,6 @@
|
||||
|
||||
<?php if(in_array(get_role_id(), [1,2,3,5])) { ?>
|
||||
<?php include('endorsement_dash.php'); ?>
|
||||
<?php include('enrollment_dash.php'); ?>
|
||||
<?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()))) { ?>
|
||||
@ -274,5 +303,75 @@
|
||||
<?php } ?>
|
||||
|
||||
|
||||
<script>
|
||||
$(document).ready(function(){
|
||||
$('.nav-link').click(function(){
|
||||
|
||||
//image of tabs by default inactive before particular click
|
||||
$('.inactive_leads').show();
|
||||
$('.inactive_bds').show();
|
||||
$('.inactive_claims').show();
|
||||
$('.inactive_pending').show();
|
||||
|
||||
$('.active_leads').hide();
|
||||
$('.active_bds').hide();
|
||||
$('.active_claims').hide();
|
||||
$('.active_pending').hide();
|
||||
|
||||
// change bg color of tab
|
||||
$('.nav-link').removeClass('active-tab');
|
||||
$(this).addClass('active-tab');
|
||||
|
||||
// change active pic for the clicked tab
|
||||
// #leads-dash-tab
|
||||
let tab_name = $(this).attr('href').split('-')[0];
|
||||
tab_name = tab_name.replace('#', '');
|
||||
|
||||
console.log(tab_name);
|
||||
|
||||
switch (tab_name) {
|
||||
case "leads":
|
||||
$('.active_leads').show();
|
||||
$('.inactive_leads').hide();
|
||||
break;
|
||||
case "bds":
|
||||
$('.active_bds').show();
|
||||
$('.inactive_bds').hide();
|
||||
break;
|
||||
case "claims":
|
||||
$('.active_claims').show();
|
||||
$('.inactive_claims').hide();
|
||||
break;
|
||||
case "pending":
|
||||
$('.active_pending').show();
|
||||
$('.inactive_pending').hide();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
//clear local storage
|
||||
|
||||
localStorage.clear();
|
||||
|
||||
let dashboardHistory = {};
|
||||
|
||||
let str = window.location.href ;
|
||||
str = str.endsWith('#') ? str.slice(0, -1) : str;
|
||||
|
||||
dashboardHistory['dashboard_url'] = str ;
|
||||
dashboardHistory['tab'] = $(this).attr('href'); // e.g. #leads-dash-tab
|
||||
dashboardHistory['tile_params'] = {};
|
||||
dashboardHistory['function_name'] = '';
|
||||
|
||||
localStorage.setItem('dashboardHistory', JSON.stringify(dashboardHistory));
|
||||
|
||||
history.pushState({}, '', str);
|
||||
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
@ -1,9 +1,4 @@
|
||||
<style>
|
||||
|
||||
body{
|
||||
margin-top:20px;
|
||||
background:#FAFAFA;
|
||||
}
|
||||
.order-card {
|
||||
color: #fff;
|
||||
}
|
||||
@ -105,6 +100,7 @@ body{
|
||||
padding-bottom: 10px;
|
||||
padding-left: 25px;
|
||||
padding-right: 25px;
|
||||
font-size: small;
|
||||
}
|
||||
|
||||
.order-card i {
|
||||
@ -123,6 +119,37 @@ body{
|
||||
margin-top: 0;
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
|
||||
.inside-tab-content-div{
|
||||
display:flex;
|
||||
justify-content:flex-start !important;
|
||||
flex-flow: row wrap;
|
||||
|
||||
}
|
||||
|
||||
.dash-card{
|
||||
background-color:#F4FBFB !important;
|
||||
border-radius: 15px !important;
|
||||
border:2px solid #09B9BF;
|
||||
box-shadow: 0px 1px 5px rgba(0, 0, 0, 0.1), 0px 4px 8px rgba(0, 0, 0, 0.2);
|
||||
min-width: 250px;
|
||||
}
|
||||
|
||||
#bds-dash-tab{
|
||||
padding-right: 20px;
|
||||
}
|
||||
|
||||
.span-color{
|
||||
color:#09B9BF !important;
|
||||
}
|
||||
|
||||
.financeStatusTile{margin-left:20px;}
|
||||
.financePendingTile{margin-left:20px;}
|
||||
|
||||
.businessPendingTile{margin-left:20px;}
|
||||
.businessStatusTile{margin-left:20px;}
|
||||
|
||||
|
||||
</style>
|
||||
|
||||
<?php if((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()))) { ?>
|
||||
@ -130,7 +157,7 @@ body{
|
||||
<?php } ?>
|
||||
|
||||
|
||||
<div class="tab-pane <?= isset($add_active_calss) ? $add_active_calss : 'fade' ?>" id="bds-dash-tab" style="padding-right: 35px;">
|
||||
<div class="tab-pane <?= isset($add_active_calss) ? $add_active_calss : 'fade' ?>" id="bds-dash-tab" >
|
||||
<div class="row">
|
||||
<div class="StatusTileHide" style="display: none; padding-bottom: 10px;padding-left: 17px">
|
||||
<a href="#" onclick="hide_status_show_pending_tile()" ><i class="fas fa-arrow-left"></i> Back to Overview</a>
|
||||
@ -140,16 +167,17 @@ body{
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
|
||||
<?php if (in_array(BUSINESS_TEAM_ID, user_team()) || in_array(MANAGEMENT_TEAM_ID, user_team())) { ?>
|
||||
<div class="col inside-tab-content-div">
|
||||
<?php if (in_array(BUSINESS_TEAM_ID, user_team()) || in_array(MANAGEMENT_TEAM_ID, user_team())) { ?>
|
||||
|
||||
<div class="col-md-4 col-xl-3 businessPendingTile">
|
||||
<div class="card bg-c-Pelorous order-card" onclick="show_business_status_tile(this)">
|
||||
<div class=" businessPendingTile">
|
||||
<div class="card dash-card" onclick="show_business_status_tile(this)">
|
||||
<div class="card-block">
|
||||
<h6 class="m-b-20 font-15">Business Team Pending</h6>
|
||||
<h2 class="text-right"><i class="mdi mdi-playlist-check f-left"></i><span><?= $businessTeamCount ?></span></h2>
|
||||
<p class="m-b-1"> <span class="f-right"></span></p>
|
||||
<p class="m-b-1"> <span class="f-right"></span></p>
|
||||
<h4 class="mb-3" style="color:black;">Business Team Pending</h4>
|
||||
<h2>
|
||||
<span class="mb-3 span-color"><?= $businessTeamCount ?>
|
||||
</h2>
|
||||
<h6 > <span class="text-danger"> Team Action</span></h6>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -167,11 +195,18 @@ body{
|
||||
// Get the background color for the current tile
|
||||
$bgColor = $colorShades[$colorSetIndex][$shadeIndex];
|
||||
?>
|
||||
<div class="col-md-2 col-xl-1 businessStatusTile" style="display: none;">
|
||||
<div class="card order-card" style="background: <?= $bgColor ?>;" onclick="linkRedirectForBDS(this, 'B')">
|
||||
<h2 class="text-center"><span><?= count($value) ?></span></h2>
|
||||
<h6 class="m-b-20 font-15 text-center"><?= $policyStatus[$status] ?></h6>
|
||||
<div class=" businessStatusTile" style="display: none;">
|
||||
<div class="card dash-card">
|
||||
<div class="card-block" onclick="linkRedirectForBDS(this, 'B')">
|
||||
<h5 class="text-right">
|
||||
<span class="f-left" style="color:black;"><?= $policyStatus[$status] ?></span>
|
||||
|
||||
<span class="span-color"><?= count($value) ?></span>
|
||||
</h5>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<?php
|
||||
@ -183,13 +218,14 @@ body{
|
||||
|
||||
<?php if (in_array(FINANCE_TEAM_ID, user_team()) || in_array(MANAGEMENT_TEAM_ID, user_team())) { ?>
|
||||
|
||||
<div class="col-md-4 col-xl-3 financePendingTile">
|
||||
<div class="card bg-c-Pelorous2 order-card" onclick="show_finance_status_tile(this, 'F')">
|
||||
<div class=" financePendingTile">
|
||||
<div class="card dash-card" onclick="show_finance_status_tile(this, 'F')">
|
||||
<div class="card-block">
|
||||
<h6 class="m-b-20 font-15">Finance Team Pending</h6>
|
||||
<h2 class="text-right"><i class="mdi mdi-playlist-check f-left"></i><span><?= $financeTeamCount ?></span></h2>
|
||||
<p class="m-b-1"> <span class="f-right"></span></p>
|
||||
<p class="m-b-1"> <span class="f-right"></span></p>
|
||||
<h4 class="mb-3" style="color:black;">Finance Team Pending</h4>
|
||||
<h2>
|
||||
<span class="mb-3 span-color"><?= $financeTeamCount ?>
|
||||
</h2>
|
||||
<h6 > <span class="text-danger">Team Action</span></h6>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -207,11 +243,18 @@ body{
|
||||
// Get the background color for the current tile
|
||||
$bgColor = $colorShades[$colorSetIndex][$shadeIndex];
|
||||
?>
|
||||
<div class="col-md-2 col-xl-1 financeStatusTile" style="display: none;">
|
||||
<div class="card order-card" style="background: <?= $bgColor ?>;" onclick="linkRedirectForBDS(this, 'F')">
|
||||
<h2 class="text-center"><span><?= count($value) ?></span></h2>
|
||||
<h6 class="m-b-20 font-15 text-center"><?= $policyStatus[$status] ?></h6>
|
||||
<div class=" financeStatusTile" style="display: none;">
|
||||
<div class="card dash-card">
|
||||
<div class="card-block" onclick="linkRedirectForBDS(this, 'F')">
|
||||
<h5 class="text-right p-0">
|
||||
<span class="f-left" style="color:black;"><?= $policyStatus[$status] ?></span>
|
||||
|
||||
<span class="span-color"><?= count($value) ?></span>
|
||||
</h5>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<?php
|
||||
@ -220,7 +263,7 @@ body{
|
||||
?>
|
||||
|
||||
<?php } ?>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
@ -244,12 +287,27 @@ function linkRedirectForBDS(input, team)
|
||||
|
||||
if(link){
|
||||
|
||||
window.open(link, '_blank');
|
||||
window.location.href = link;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
function show_business_status_tile(){
|
||||
|
||||
let dashboardHistoryString = localStorage.getItem('dashboardHistory');
|
||||
|
||||
if (dashboardHistoryString){
|
||||
|
||||
let dashboardHistory = JSON.parse(dashboardHistoryString);
|
||||
|
||||
dashboardHistory['tile_params'] = { majorType: 0, minorType: 0 };
|
||||
dashboardHistory['function_name'] = 'show_business_status_tile';
|
||||
|
||||
localStorage.setItem('dashboardHistory', JSON.stringify(dashboardHistory));
|
||||
|
||||
|
||||
}
|
||||
|
||||
$('.businessStatusTile').show()
|
||||
$('.StatusTileHide').show()
|
||||
$("#mainMenuTiles").text("Viewing Details of Business Team Pending");
|
||||
@ -261,6 +319,20 @@ function show_business_status_tile(){
|
||||
|
||||
function show_finance_status_tile(){
|
||||
|
||||
|
||||
let dashboardHistoryString = localStorage.getItem('dashboardHistory');
|
||||
|
||||
if (dashboardHistoryString){
|
||||
|
||||
let dashboardHistory = JSON.parse(dashboardHistoryString);
|
||||
|
||||
dashboardHistory['tile_params'] = { majorType: 0, minorType: 0 };
|
||||
dashboardHistory['function_name'] = 'show_finance_status_tile';
|
||||
|
||||
localStorage.setItem('dashboardHistory', JSON.stringify(dashboardHistory));
|
||||
|
||||
}
|
||||
|
||||
$('.financeStatusTile').show()
|
||||
$('.StatusTileHide').show()
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
|
||||
<title>Insurance ChatBot</title>
|
||||
</head>
|
||||
|
||||
@ -12,8 +12,8 @@
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
body {
|
||||
background-color: rgba(0, 0, 0, 0.3); /* 30% transparent black */
|
||||
/* body {
|
||||
background-color: rgba(0, 0, 0, 0.3);
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
@ -31,15 +31,72 @@
|
||||
50% { color: green; }
|
||||
75% { color: blue; }
|
||||
100% { color: violet; }
|
||||
}
|
||||
}*/
|
||||
</style>
|
||||
|
||||
|
||||
<style>
|
||||
/* Full-screen overlay */
|
||||
#page-loader {
|
||||
position: fixed;
|
||||
inset: 0; /* top:0; right:0; bottom:0; left:0 */
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
background: rgba(255,255,255,0.85);
|
||||
z-index: 9999;
|
||||
transition: opacity 300ms ease, visibility 300ms ease;
|
||||
visibility: visible;
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
/* Hidden state */
|
||||
#page-loader.hidden {
|
||||
opacity: 0;
|
||||
visibility: hidden;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
/* Optional card around GIF */
|
||||
#page-loader .loader-box {
|
||||
text-align: center;
|
||||
padding: 18px;
|
||||
border-radius: 12px;
|
||||
box-shadow: 0 8px 30px rgba(0,0,0,0.12);
|
||||
background: rgba(255,255,255,0.95);
|
||||
backdrop-filter: blur(4px);
|
||||
}
|
||||
|
||||
/* Restrict gif size for large screens */
|
||||
#page-loader img {
|
||||
display: block;
|
||||
max-width: 120px;
|
||||
width: 20vw;
|
||||
height: auto;
|
||||
}
|
||||
|
||||
/* Example page content styling */
|
||||
body.noscroll {
|
||||
overflow: hidden; /* prevent scrolling while loader is visible */
|
||||
}
|
||||
|
||||
main { padding: 2rem; font-family: Arial, Helvetica, sans-serif; }
|
||||
</style>
|
||||
|
||||
|
||||
<body>
|
||||
<h1>Loading...</h1>
|
||||
<script src="https://code.jquery.com/jquery-3.7.1.min.js" integrity="sha256-/JqT3SQfawRcv/BIHPThkBvs0OEvtFFmqPF/lYI/Cxo=" crossorigin="anonymous"></script>
|
||||
<script src='https://cdn.jsdelivr.net/npm/botman-web-widget@0/build/js/widget.js'></script>
|
||||
<!-- <h1>Loading...from page</h1> -->
|
||||
<!-- Page loader overlay (visible by default) -->
|
||||
<div id="page-loader" aria-hidden="false">
|
||||
<div class="loader-box">
|
||||
<!-- Replace the src with your GIF file path -->
|
||||
<img src="https://venbait.in/nhance/dev/assets/images/nhance-loader.gif" alt="Loading..." />
|
||||
<!-- <div style="margin-top:8px;font-size:14px;color:#555;">Loading, please wait...</div> -->
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
|
||||
// alert('start of main');
|
||||
var uid = Math.floor(100000 + Math.random() * 900000);
|
||||
console.log('CURRENT_USER' + uid);
|
||||
|
||||
@ -146,6 +203,28 @@ function setupMessageObserver() {
|
||||
return;
|
||||
}
|
||||
|
||||
const whiteSVG = `data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='100%' height='100%'>
|
||||
<rect width='100%' height='100%' fill='white'/>
|
||||
</svg>`;
|
||||
|
||||
const svg = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1 1" preserveAspectRatio="none"><rect width="1" height="1" fill="#ffffff"/></svg>`;
|
||||
const uri = `data:image/svg+xml;charset=utf-8,${encodeURIComponent(svg)}`;
|
||||
// ✅ Change iframe body background here
|
||||
// doc.body.style.background = `url("${uri}") repeat center center fixed`;
|
||||
// // doc.body.style.background = "url('https://venbait.in/nhance/app/dev/assets/chat-bg.jpg')";
|
||||
// // doc.body.style.background = "cover";
|
||||
// doc.body.style.backgroundSize = "auto";
|
||||
// doc.documentElement.style.backgroundColor = '#ffffff';
|
||||
// doc.body.style.margin = "0"; // optional
|
||||
|
||||
doc.documentElement.style.backgroundImage = "none";
|
||||
doc.body.style.backgroundImage = "none";
|
||||
|
||||
// Optionally set plain white background
|
||||
doc.documentElement.style.backgroundColor = "#ffffff";
|
||||
doc.body.style.backgroundColor = "transparent";
|
||||
|
||||
|
||||
// Wait for the document to be ready
|
||||
const waitForElement = () => {
|
||||
const messageArea = doc.querySelector("#messageArea");
|
||||
@ -157,35 +236,35 @@ function setupMessageObserver() {
|
||||
// Set initial height based on device
|
||||
const initialHeight = isMobile ? 700 : 800; // Default to keyboard closed state
|
||||
|
||||
// Method 1: Create style element with high specificity
|
||||
const style = doc.createElement("style");
|
||||
style.id = 'dynamic-chat-height';
|
||||
style.textContent = `
|
||||
/* High specificity selectors */
|
||||
#messageArea ol.chat,
|
||||
#messageArea .chat,
|
||||
ol.chat {
|
||||
height: ${initialHeight}px !important;
|
||||
max-height: ${initialHeight}px !important;
|
||||
min-height: ${initialHeight}px !important;
|
||||
transition: height 0.3s ease;
|
||||
}
|
||||
// // Method 1: Create style element with high specificity
|
||||
// const style = doc.createElement("style");
|
||||
// style.id = 'dynamic-chat-height';
|
||||
// style.textContent = `
|
||||
// /* High specificity selectors */
|
||||
// #messageArea ol.chat,
|
||||
// #messageArea .chat,
|
||||
// ol.chat {
|
||||
// height: ${initialHeight}px !important;
|
||||
// max-height: ${initialHeight}px !important;
|
||||
// min-height: ${initialHeight}px !important;
|
||||
// transition: height 0.3s ease;
|
||||
// }
|
||||
|
||||
/* Additional styling to ensure proper display */
|
||||
#messageArea {
|
||||
height: auto !important;
|
||||
}
|
||||
`;
|
||||
doc.head.appendChild(style);
|
||||
// /* Additional styling to ensure proper display */
|
||||
// #messageArea {
|
||||
// height: auto !important;
|
||||
// }
|
||||
// `;
|
||||
// doc.head.appendChild(style);
|
||||
|
||||
// Method 2: Direct style application as backup
|
||||
setTimeout(() => {
|
||||
const chatElements = doc.querySelectorAll("#messageArea .chat, #messageArea ol.chat, ol.chat");
|
||||
chatElements.forEach(element => {
|
||||
if (element) {
|
||||
element.style.setProperty("height", initialHeight + "px", "important");
|
||||
element.style.setProperty("max-height", initialHeight + "px", "important");
|
||||
element.style.setProperty("min-height", initialHeight + "px", "important");
|
||||
element.style.setProperty("height", 85 + "vh", "important");
|
||||
element.style.setProperty("max-height", 85 + "vh", "important");
|
||||
element.style.setProperty("min-height", 85 + "vh", "important");
|
||||
element.style.setProperty("transition", "height 0.3s ease", "important");
|
||||
console.log('Direct style applied to:', element);
|
||||
}
|
||||
@ -294,6 +373,10 @@ function setupMessageObserver() {
|
||||
height: 100% !important;
|
||||
width: 100% !important;
|
||||
}
|
||||
|
||||
iframe#body {
|
||||
background: none !important;
|
||||
}
|
||||
`;
|
||||
document.getElementsByTagName('head')[0].appendChild(style);
|
||||
}
|
||||
@ -312,31 +395,31 @@ function setupMessageObserver() {
|
||||
const doc = currentIframe.contentDocument || currentIframe.contentWindow.document;
|
||||
if (doc) {
|
||||
// Update existing style
|
||||
let styleElement = doc.querySelector('#dynamic-chat-height');
|
||||
if (!styleElement) {
|
||||
styleElement = doc.createElement('style');
|
||||
styleElement.id = 'dynamic-chat-height';
|
||||
doc.head.appendChild(styleElement);
|
||||
}
|
||||
// let styleElement = doc.querySelector('#dynamic-chat-height');
|
||||
// if (!styleElement) {
|
||||
// styleElement = doc.createElement('style');
|
||||
// styleElement.id = 'dynamic-chat-height';
|
||||
// doc.head.appendChild(styleElement);
|
||||
// }
|
||||
|
||||
styleElement.textContent = `
|
||||
#messageArea ol.chat,
|
||||
#messageArea .chat,
|
||||
ol.chat {
|
||||
height: ${height}px !important;
|
||||
max-height: ${height}px !important;
|
||||
min-height: ${height}px !important;
|
||||
transition: height 0.3s ease;
|
||||
}
|
||||
`;
|
||||
// styleElement.textContent = `
|
||||
// #messageArea ol.chat,
|
||||
// #messageArea .chat,
|
||||
// ol.chat {
|
||||
// height: ${height}px !important;
|
||||
// max-height: ${height}px !important;
|
||||
// min-height: ${height}px !important;
|
||||
// transition: height 0.3s ease;
|
||||
// }
|
||||
// `;
|
||||
|
||||
// Direct style application as backup
|
||||
const chatElements = doc.querySelectorAll("#messageArea .chat, #messageArea ol.chat, ol.chat");
|
||||
chatElements.forEach(element => {
|
||||
if (element) {
|
||||
element.style.setProperty("height", height + "px", "important");
|
||||
element.style.setProperty("max-height", height + "px", "important");
|
||||
element.style.setProperty("min-height", height + "px", "important");
|
||||
element.style.setProperty("height", 85 + "vh", "important");
|
||||
element.style.setProperty("max-height", 85 + "vh", "important");
|
||||
element.style.setProperty("min-height", 85 + "vh", "important");
|
||||
}
|
||||
});
|
||||
|
||||
@ -593,6 +676,11 @@ function setupMessageObserver() {
|
||||
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
<script src="https://code.jquery.com/jquery-3.7.1.min.js" integrity="sha256-/JqT3SQfawRcv/BIHPThkBvs0OEvtFFmqPF/lYI/Cxo=" crossorigin="anonymous"></script>
|
||||
|
||||
<script src='https://cdn.jsdelivr.net/npm/botman-web-widget@0/build/js/widget.js'></script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@ -1,8 +1,4 @@
|
||||
<style>
|
||||
body {
|
||||
margin-top: 20px;
|
||||
background: #FAFAFA;
|
||||
}
|
||||
|
||||
.order-card {
|
||||
color: #fff;
|
||||
@ -123,57 +119,86 @@
|
||||
margin-top: 0;
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
|
||||
.inside-tab-content-div{
|
||||
display:flex;
|
||||
justify-content:flex-start !important;
|
||||
flex-flow: row wrap;
|
||||
|
||||
}
|
||||
|
||||
.claimTypeTile{
|
||||
margin-left:20px;
|
||||
}
|
||||
|
||||
.claimStatusTitle{margin-left:20px;}
|
||||
|
||||
.dash-card{
|
||||
background-color:#F4FBFB !important;
|
||||
border-radius:25px;
|
||||
border:2px solid #09B9BF;
|
||||
box-shadow: 0px 1px 5px rgba(0, 0, 0, 0.1), 0px 4px 8px rgba(0, 0, 0, 0.2);
|
||||
min-width: 250px;
|
||||
}
|
||||
|
||||
#claims-dash-tab{
|
||||
padding-right: 20px;
|
||||
}
|
||||
|
||||
.span-color{
|
||||
color:#09B9BF !important;
|
||||
}
|
||||
|
||||
</style>
|
||||
<?php
|
||||
$isActive = get_role_id() == STAFF_ROLE_ID && in_array(CLAIMS_TEAM_ID,user_team()) ? 'active show' : '';
|
||||
?>
|
||||
<div class="tab-pane fade <?= $isActive ?>" 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 class="col inside-tab-content-div">
|
||||
<div class="claimTypeTile">
|
||||
<div class="card dash-card" onclick="hideAndShowTile(1,1)">
|
||||
<div class="card-block">
|
||||
<h4 class="mb-3">GMC</h4>
|
||||
<h2 class="span-color"><span><?= isset($claim_data[1]['total']) ? $claim_data[1]['total'] : '0' ?></span></h2>
|
||||
<h6><span class="text-danger">All GMC Records</span></h6>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class=" claimTypeTile">
|
||||
<div class="card dash-card" onclick="hideAndShowTile(1,2)">
|
||||
<div class="card-block">
|
||||
<h4 class="mb-3">GPA</h4>
|
||||
<h2 class="span-color"><span><?= isset($claim_data[2]['total']) ? $claim_data[2]['total'] : '0' ?></span></h2>
|
||||
<h6><span class="text-danger">All GPA Records</span></h6>
|
||||
</div>
|
||||
</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 class=" claimTypeTile">
|
||||
<div class="card dash-card" onclick="hideAndShowTile(1,3)">
|
||||
<div class="card-block">
|
||||
<h4 class="mb-3">EDLI</h4>
|
||||
<h2 class="span-color"><span><?= isset($claim_data[3]['total']) ? $claim_data[3]['total'] : '0' ?></span></h2>
|
||||
<h6><span class="text-danger">All EDLI Records</span></h6>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class=" claimTypeTile">
|
||||
<div class="card dash-card" onclick="hideAndShowTile(1,4)">
|
||||
<div class="card-block">
|
||||
<h4 class="mb-3">GTLI</h4>
|
||||
<h2 class="span-color"><span><?= isset($claim_data[4]['total']) ? $claim_data[4]['total'] : '0' ?></span></h2>
|
||||
<h6><span class="text-danger">All GTLI Records</span></h6>
|
||||
</div>
|
||||
</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="row">
|
||||
<div class="goBack" style="padding-bottom: 10px;padding-left: 17px;">
|
||||
<a href="#" onclick="hideAndShowTile('2')" ><i class="fas fa-arrow-left"></i> Back to Overview<br></a>
|
||||
@ -183,7 +208,8 @@ $isActive = get_role_id() == STAFF_ROLE_ID && in_array(CLAIMS_TEAM_ID,user_team(
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<?php
|
||||
<div class="col inside-tab-content-div">
|
||||
<?php
|
||||
$colorSetCount = count($colorShades); // Number of color sets
|
||||
$shadeCount = count($colorShades[0]); // Number of shades per set
|
||||
$index = 0;
|
||||
@ -213,18 +239,25 @@ $isActive = get_role_id() == STAFF_ROLE_ID && in_array(CLAIMS_TEAM_ID,user_team(
|
||||
$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 ?>','<?= $statuses[$status . '_ids'] ?? '' ?>')">
|
||||
<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 class="claimStatusTitle claimStatusTitle_<?=$ticketTypeId?>" style="display: none;">
|
||||
<div class="card dash-card" onclick="linkRedirectForClaims(<?= $ticketTypeId ?>, '<?= $status ?>','<?= $statuses[$status . '_ids'] ?? '' ?>')">
|
||||
<div class="card-block">
|
||||
<h5 class="text-right"
|
||||
<?= $showTooltip ? 'data-toggle="tooltip" title="' . htmlspecialchars($formattedStatus, ENT_QUOTES, 'UTF-8') . '"' : '' ?>>
|
||||
<span class="f-left"> <?= $truncatedStatus ?> </span>
|
||||
<span class="span-color"><?= $count ?></span>
|
||||
</h5>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php endforeach; ?>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
@ -239,6 +272,21 @@ $isActive = get_role_id() == STAFF_ROLE_ID && in_array(CLAIMS_TEAM_ID,user_team(
|
||||
|
||||
function hideAndShowTile(type, claimType = null) {
|
||||
|
||||
let dashboardHistoryString = localStorage.getItem('dashboardHistory');
|
||||
|
||||
if (dashboardHistoryString){
|
||||
|
||||
let dashboardHistory = JSON.parse(dashboardHistoryString);
|
||||
|
||||
dashboardHistory['tile_params'] = { majorType: type, minorType: claimType };
|
||||
dashboardHistory['function_name'] = 'hideAndShowTile';
|
||||
|
||||
localStorage.setItem('dashboardHistory', JSON.stringify(dashboardHistory));
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (type == 1) {
|
||||
|
||||
$('.claimTypeTile').hide();
|
||||
@ -252,8 +300,16 @@ $isActive = get_role_id() == STAFF_ROLE_ID && in_array(CLAIMS_TEAM_ID,user_team(
|
||||
|
||||
if (type == 1 && claimType != null) {
|
||||
|
||||
if ($('.claimStatusTitle_' + claimType).length > 0) {
|
||||
console.log("Element exists!");
|
||||
} else {
|
||||
console.log("Element does NOT exist!");
|
||||
}
|
||||
|
||||
|
||||
|
||||
$('.claimTypeTile').hide();
|
||||
$('.claimStatusTitle_' + claimType).show();
|
||||
$('.claimStatusTitle_'+claimType).show();
|
||||
|
||||
if (claimType == 1) {
|
||||
$('#current_tile').text("Viewing Details For : GMC");
|
||||
@ -312,7 +368,6 @@ $isActive = get_role_id() == STAFF_ROLE_ID && in_array(CLAIMS_TEAM_ID,user_team(
|
||||
const form = document.createElement('form');
|
||||
form.method = 'POST';
|
||||
form.action = url;
|
||||
form.target = '_blank';
|
||||
|
||||
for (const key in data) {
|
||||
if (data.hasOwnProperty(key)) {
|
||||
|
||||
@ -2242,18 +2242,19 @@
|
||||
|
||||
// Start the interval
|
||||
function startAutoSubmit(attrId) {
|
||||
if (!submitInterval) {
|
||||
submitInterval = setInterval(function() {
|
||||
if(attrId == "GMC"){
|
||||
autoSaveGmcTerms();
|
||||
}else if(attrId == "GPA"){
|
||||
autoSaveGpaTerms();
|
||||
}else if(attrId == "OTHERS"){
|
||||
autoSaveOtherTerms();
|
||||
}
|
||||
}, 20000);
|
||||
console.log("Auto-submit started.");
|
||||
}
|
||||
// if (!submitInterval) {
|
||||
// submitInterval = setInterval(function() {
|
||||
// if(attrId == "GMC"){
|
||||
// autoSaveGmcTerms();
|
||||
// }else if(attrId == "GPA"){
|
||||
// autoSaveGpaTerms();
|
||||
// }else if(attrId == "OTHERS"){
|
||||
// autoSaveOtherTerms();
|
||||
// }
|
||||
// }, 20000);
|
||||
// console.log("Auto-submit started.");
|
||||
// }
|
||||
console.log("Auto-submit Disabled.");
|
||||
}
|
||||
|
||||
// Stop the interval
|
||||
|
||||
@ -1,9 +1,5 @@
|
||||
<style>
|
||||
|
||||
body{
|
||||
margin-top:20px;
|
||||
background:#FAFAFA;
|
||||
}
|
||||
.order-card {
|
||||
color: #fff;
|
||||
}
|
||||
@ -135,110 +131,201 @@ body{
|
||||
padding-left: 25px !important;
|
||||
padding-right: 25px !important;
|
||||
padding-top: 10px !important;
|
||||
padding-bottom: 35% !important;
|
||||
padding-bottom: 30px !important;
|
||||
|
||||
}
|
||||
|
||||
.modal-content{
|
||||
background-color: #F4F4F4 !important;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.inside-tab-content-div{
|
||||
display:flex;
|
||||
justify-content:flex-start !important;
|
||||
flex-flow: row wrap;
|
||||
|
||||
}
|
||||
|
||||
.dash-card{
|
||||
background-color:#F4FBFB !important;
|
||||
border-radius:25px;
|
||||
border:2px solid #09B9BF;
|
||||
box-shadow: 0px 1px 5px rgba(0, 0, 0, 0.1), 0px 4px 8px rgba(0, 0, 0, 0.2);
|
||||
min-width: 250px !important;
|
||||
}
|
||||
|
||||
#pending-actions-dash-tab{
|
||||
padding-right: 20px;
|
||||
}
|
||||
|
||||
.span-color{
|
||||
color:#09B9BF;
|
||||
}
|
||||
|
||||
.endorsement-div{
|
||||
margin-left:20px;
|
||||
}
|
||||
|
||||
.custom-card{
|
||||
border-radius: 10px !important;
|
||||
background-color: white;
|
||||
box-shadow: 0px 1px 5px rgba(0, 0, 0, 0.1), 0px 4px 8px rgba(0, 0, 0, 0.2);
|
||||
margin-bottom: 5px;
|
||||
padding : 5px 0px 5px 10px;
|
||||
border-left: 10px solid #09B9BF;
|
||||
}
|
||||
|
||||
#right-modal .modal-content {
|
||||
border-radius: 10px !important;
|
||||
overflow: hidden; /* optional, keeps children inside rounded corners */
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
</style>
|
||||
|
||||
<div class="tab-pane active show" id="pending-actions-dash-tab" style="/*padding-left: 35px;*/padding-right: 35px;">
|
||||
<div class="tab-pane active show" id="pending-actions-dash-tab" >
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-4 col-xl-3">
|
||||
<div data-toggle="modal" data-target="#right-modal" class="card bg-c-Pelorous order-card" onclick="getPendingActionClientDataForDashboard(this, 'Inception Pending', 'I')">
|
||||
<div class="card-block">
|
||||
<h6 class="m-b-20 font-15">Inception Pending</h6>
|
||||
<h2 class="text-right"><i class="mdi mdi-account-multiple-plus f-left"></i><span><?= $pendingActionsData['inception'] ?></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 class="inside-tab-content-div">
|
||||
|
||||
<div class="endorsement-div">
|
||||
<div data-toggle="modal" data-target="#right-modal" class="card dash-card"
|
||||
onclick="getPendingActionClientDataForDashboard(this, 'Inception Pending', 'I')">
|
||||
<div class="card-block" >
|
||||
<h4 class="mb-3"><b>Inception Pending</b></h4>
|
||||
<h2>
|
||||
<span class="span-color"><?= $pendingActionsData['inception'] ?></span>
|
||||
</h2>
|
||||
<h6 > <span class="text-danger">Inception Action</span></h6>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-4 col-xl-3">
|
||||
<div data-toggle="modal" data-target="#right-modal" class="card bg-c-Pelorous2 order-card" onclick="getPendingActionClientDataForDashboard(this, 'Pending Insurer', 'insurer')">
|
||||
<div class="card-block">
|
||||
<h6 class="m-b-20 font-15">Pending Insurer</h6>
|
||||
<h2 class="text-right"><i class="mdi mdi-account-box f-left"></i><span><?= $pendingActionsData['uhid'] ?></span></h2>
|
||||
<p class="m-b-1">Exported <span class="f-right"><?= $pendingActionsData['uhid_export_count'] ?></span></p>
|
||||
<p class="m-b-1">Not Exported <span class="f-right"><?= $pendingActionsData['uhid_not_export_count'] ?></span></p>
|
||||
|
||||
<div class="endorsement-div">
|
||||
<div data-toggle="modal" data-target="#right-modal" class="card dash-card"
|
||||
onclick="getPendingActionClientDataForDashboard(this, 'Pending Insurer', 'insurer')">
|
||||
<div class=" card-block ">
|
||||
<h4 class="mb-3">Pending Insurer</h4>
|
||||
<h2 >
|
||||
<span class="span-color"><?= $pendingActionsData['uhid'] ?></span>
|
||||
</h2>
|
||||
<h6 class="text-right">
|
||||
<span class="span-color f-left">Exported : <?= $pendingActionsData['uhid_export_count'] ?></span>
|
||||
<span class="text-danger">Not Exported : <?= $pendingActionsData['uhid_not_export_count'] ?></span>
|
||||
</h6>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-4 col-xl-3">
|
||||
<div data-toggle="modal" data-target="#right-modal" class="card bg-c-Pelorous3 order-card" onclick="getPendingActionClientDataForDashboard(this, 'Pending TPA', 'TPA')">
|
||||
<div class="card-block">
|
||||
<h6 class="m-b-20 font-15">Pending TPA</h6>
|
||||
<h2 class="text-right"><i class="mdi mdi-signal-variant f-left"></i><span><?= $pendingActionsData['tpa'] ?></span></h2>
|
||||
<p class="m-b-1">Exported <span class="f-right"><?= $pendingActionsData['tpa_export_count'] ?></span></p>
|
||||
<p class="m-b-1">Not Exported <span class="f-right"><?= $pendingActionsData['tpa_not_export_count'] ?></span></p>
|
||||
|
||||
<div class="endorsement-div">
|
||||
<div data-toggle="modal" data-target="#right-modal" class="card dash-card"
|
||||
onclick="getPendingActionClientDataForDashboard(this, 'Pending TPA', 'TPA')">
|
||||
<div class="card-block">
|
||||
<h4 class="mb-3">Pending TPA</h4>
|
||||
<h2>
|
||||
<span class="span-color"><?= $pendingActionsData['tpa'] ?></span>
|
||||
</h2>
|
||||
<h6 class="text-right">
|
||||
<span class="span-color f-left">Exported : <?= $pendingActionsData['tpa_export_count'] ?></span>
|
||||
<span class="text-danger">Not Exported : <?= $pendingActionsData['tpa_not_export_count'] ?></span>
|
||||
</h6>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-4 col-xl-3">
|
||||
<div data-toggle="modal" data-target="#right-modal" class="card bg-c-Grenadier order-card" onclick="getPendingActionClientDataForDashboard(this, 'Correction Pending', 'C')">
|
||||
<div class="card-block">
|
||||
<h6 class="m-b-20 font-15">Correction Pending</h6>
|
||||
<h2 class="text-right"><i class="mdi mdi-account-edit f-left"></i><span><?= $pendingActionsData['correction'] ?></span></h2>
|
||||
<p class="m-b-1">Exported <span class="f-right"><?= $pendingActionsData['correction_export_count'] ?></span></p>
|
||||
<p class="m-b-1">Not Exported <span class="f-right"><?= $pendingActionsData['correction_not_export_count'] ?></span></p>
|
||||
|
||||
<div class="endorsement-div">
|
||||
<div data-toggle="modal" data-target="#right-modal" class="card dash-card"
|
||||
onclick="getPendingActionClientDataForDashboard(this, 'Correction Pending', 'C')">
|
||||
<div class="card-block">
|
||||
<h4 class="mb-3">Correction Pending</h4>
|
||||
<h2 >
|
||||
<span class="span-color"><?= $pendingActionsData['correction'] ?></span>
|
||||
</h2>
|
||||
<h6 class="tex-right">
|
||||
<span class="span-color">Exported : <?= $pendingActionsData['correction_export_count'] ?></span>
|
||||
<span class="text-danger f-right">Not Exported : <span ><?= $pendingActionsData['correction_not_export_count'] ?></span></span>
|
||||
</h6>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-4 col-xl-3">
|
||||
<div data-toggle="modal" data-target="#right-modal" class="card bg-c-Grenadier2 order-card" onclick="getPendingActionClientDataForDashboard(this, 'Deletion Pending', 'D')">
|
||||
<div class="card-block">
|
||||
<h6 class="m-b-20 font-15">Deletion Pending</h6>
|
||||
<h2 class="text-right"><i class="mdi mdi-account-multiple-minus f-left"></i><span><?= $pendingActionsData['deletion'] ?></span></h2>
|
||||
<p class="m-b-1">Exported <span class="f-right"><?= $pendingActionsData['deletion_export_count'] ?></span></p>
|
||||
<p class="m-b-1">Not Exported <span class="f-right"><?= $pendingActionsData['deletion_not_export_count'] ?></span></p>
|
||||
|
||||
<div class="endorsement-div">
|
||||
<div data-toggle="modal" data-target="#right-modal" class="card dash-card"
|
||||
onclick="getPendingActionClientDataForDashboard(this, 'Deletion Pending', 'D')">
|
||||
<div class="card-block">
|
||||
<h4 class="mb-3">Deletion Pending</h4>
|
||||
<h2 >
|
||||
<span class="span-color"><?= $pendingActionsData['deletion'] ?></span>
|
||||
</h2>
|
||||
<h6>
|
||||
<span class="span-color">Exported : <?= $pendingActionsData['deletion_export_count'] ?></span>
|
||||
<span class="text-danger f-right">Not Exported : <span ><?= $pendingActionsData['deletion_not_export_count'] ?></span></span>
|
||||
</h6>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-4 col-xl-3">
|
||||
<div data-toggle="modal" data-target="#right-modal" class="card bg-c-Grenadier3 order-card" onclick="getPendingActionClientDataForDashboard(this, 'SI Enhancement Pending', 'SI')">
|
||||
<div class="card-block">
|
||||
<h6 class="m-b-20 font-15">SI Enhancment Pending</h6>
|
||||
<h2 class="text-right"><i class="mdi mdi-account-convert f-left"></i><span><?= $pendingActionsData['si_enhancement'] ?></span></h2>
|
||||
<p class="m-b-1">Exported <span class="f-right"><?= $pendingActionsData['si_export_count'] ?></span></p>
|
||||
<p class="m-b-1">Not Exported <span class="f-right"><?= $pendingActionsData['si_not_export_count'] ?></span></p>
|
||||
|
||||
<div class="endorsement-div">
|
||||
<div data-toggle="modal" data-target="#right-modal" class="card dash-card"
|
||||
onclick="getPendingActionClientDataForDashboard(this, 'SI Enhancement Pending', 'SI')">
|
||||
<div class="card-block">
|
||||
<h4 class="mb-3">SI Enhancment </h4>
|
||||
<h2>
|
||||
<span class="span-color"><?= $pendingActionsData['si_enhancement'] ?></span>
|
||||
</h2>
|
||||
<h6>
|
||||
<span class="span-color">Exported : <?= $pendingActionsData['si_export_count'] ?></span>
|
||||
<span class="text-danger f-right">Not Exported : <span ><?= $pendingActionsData['si_not_export_count'] ?></span></span>
|
||||
</h6>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-4 col-xl-3">
|
||||
<div data-toggle="modal" data-target="#right-modal" class="card bg-c-SilverChalice order-card" onclick="getPendingActionClientDataForDashboard(this, 'Policy Renewal', 'policy')">
|
||||
<div class="card-block">
|
||||
<h6 class="m-b-20 font-15">Policy</h6>
|
||||
<h2 class="text-right"><i class="mdi mdi-autorenew f-left"></i><span><?= $pendingActionsData['PolicyRenewalData'] ?></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 class="endorsement-div">
|
||||
<div data-toggle="modal" data-target="#right-modal" class="card dash-card"
|
||||
onclick="getPendingActionClientDataForDashboard(this, 'Policy Renewal', 'policy')">
|
||||
<div class="card-block">
|
||||
<h4 class="mb-3">Policy</h4>
|
||||
<h2 >
|
||||
<span class="span-color"><?= $pendingActionsData['PolicyRenewalData'] ?></span>
|
||||
</h2>
|
||||
<h6 > <span class="text-danger">Policy Documents</span></h6>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-4 col-xl-3">
|
||||
<div class="card bg-c-SilverChalice2 order-card">
|
||||
<div class="card-block">
|
||||
<h6 class="m-b-20 font-15">Ticket</h6>
|
||||
<h2 class="text-right"><i class="mdi mdi-tag f-left"></i><span><?= $pendingActionsData['ticketData'] ?></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 class="endorsement-div">
|
||||
<div class="card dash-card">
|
||||
<div class="card-block">
|
||||
<h4 class="mb-3">Ticket</h4>
|
||||
<h2 >
|
||||
<span class="span-color"><?= $pendingActionsData['ticketData'] ?></span>
|
||||
</h2>
|
||||
<h6> <span class="text-danger">Support Tickets</span></h6>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<!-- Right modal content -->
|
||||
<div id="right-modal" class="modal fade" role="dialog" aria-hidden="true">
|
||||
<div class="modal-dialog modal-lg modal-right">
|
||||
<div class="modal-dialog modal-lg modal-center" style="border-radius: 10px !important;">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header border-0">
|
||||
<div class="modal-header border-0 pb-0" style="margin-left:10px;">
|
||||
<h4 class="modal-title" id="right-modalLabel">Modal Heading</h4>
|
||||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
||||
</div>
|
||||
@ -254,12 +341,18 @@ body{
|
||||
|
||||
function getPendingActionClientDataForDashboard(input, headerName, type)
|
||||
{
|
||||
$('#right-modal').modal('hide');
|
||||
$('.loader').fadeIn();
|
||||
$('.loader-mask').fadeIn();
|
||||
|
||||
console.log('hi')
|
||||
$(".modal-body").empty();
|
||||
var nodata = '<center>No data available</center>';
|
||||
$(".modal-body").html(nodata);
|
||||
|
||||
$("#right-modalLabel").html(headerName);
|
||||
$("#right-modalLabel").html(
|
||||
`<p style="font-size:25px;font-weight:600;">${headerName}</p>`
|
||||
);
|
||||
|
||||
|
||||
$.ajax({
|
||||
url: '<?= base_url("util/featch_dashboard_data/") ?>' + type,
|
||||
type: "GET",
|
||||
@ -268,7 +361,8 @@ function getPendingActionClientDataForDashboard(input, headerName, type)
|
||||
|
||||
console.log('responce', res)
|
||||
console.log('responce', res.data)
|
||||
var table;
|
||||
// var table;
|
||||
var div;
|
||||
|
||||
var actions = 'inception';
|
||||
|
||||
@ -276,7 +370,9 @@ function getPendingActionClientDataForDashboard(input, headerName, type)
|
||||
var link = '<?=base_url()?>';
|
||||
|
||||
if (res.data.length !== 0) {
|
||||
table = `<table class="table table-striped table-sm table-centered mb-0"><tbody>`;
|
||||
// table = `<table class="table table-striped table-sm table-centered mb-0"><tbody>`;
|
||||
div = `<div class="row">`;
|
||||
|
||||
$.each(res.data, function(index, item) {
|
||||
|
||||
var Params = null;
|
||||
@ -350,22 +446,37 @@ function getPendingActionClientDataForDashboard(input, headerName, type)
|
||||
}
|
||||
console.log(link)
|
||||
|
||||
table += `<tr><td onclick="linkRedirect('${link}')">${item.client_name} - ${item.branch_name} - ${item.policy_name}</td></tr>`;
|
||||
// table += `<tr><td onclick="linkRedirect('${link}')">${item.client_name} - ${item.branch_name} - ${item.policy_name}</td></tr>`;
|
||||
div += `<div class="col-md-6 mb-2">
|
||||
<div class="custom-card" onclick="linkRedirect('${link}')">
|
||||
<h4 style="margin-bottom:5px;">${item.client_name}</h4>
|
||||
<h5>${item.branch_name} - ${item.policy_name} </h5>
|
||||
</div>
|
||||
</div>
|
||||
`;
|
||||
|
||||
});
|
||||
table += "</tbody></table>";
|
||||
div += "</div>";
|
||||
} else {
|
||||
table = '<center>No data available</center>';
|
||||
// table = '<center>No data available</center>';
|
||||
div = '<center>No data available</center>';
|
||||
}
|
||||
|
||||
$(".modal-body").html(table);
|
||||
// $(".modal-body").html(table);
|
||||
$(".modal-body").append(div);
|
||||
|
||||
$('#right-modal').modal('show');
|
||||
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
console.error(xhr.responseText);
|
||||
console.error(status, error);
|
||||
$(".modal-body").html(nodata);
|
||||
|
||||
},
|
||||
complete:function(){
|
||||
$('.loader').fadeOut();
|
||||
$('.loader-mask').delay(350).fadeOut('slow');
|
||||
console.log("Ajax call is completed ..!!");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@ -6,24 +6,27 @@
|
||||
|
||||
|
||||
<!-- Footer Start -->
|
||||
<footer class="footer">
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<script>
|
||||
document.write(new Date().getFullYear())
|
||||
</script> © NHANCE
|
||||
</div>
|
||||
<!-- <div class="col-md-6">
|
||||
<div class="text-md-right footer-links d-none d-sm-block">
|
||||
<a href="javascript:void(0);">About Us</a>
|
||||
<a href="javascript:void(0);">Help</a>
|
||||
<a href="javascript:void(0);">Contact Us</a>
|
||||
<div style="display: block;">
|
||||
<footer class="footer">
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<script>
|
||||
document.write(new Date().getFullYear())
|
||||
</script> © NHANCE
|
||||
</div>
|
||||
</div> -->
|
||||
<!-- <div class="col-md-6">
|
||||
<div class="text-md-right footer-links d-none d-sm-block">
|
||||
<a href="javascript:void(0);">About Us</a>
|
||||
<a href="javascript:void(0);">Help</a>
|
||||
<a href="javascript:void(0);">Contact Us</a>
|
||||
</div>
|
||||
</div> -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</footer>
|
||||
</footer>
|
||||
</div>
|
||||
|
||||
<!-- end Footer -->
|
||||
|
||||
</div>
|
||||
@ -930,6 +933,66 @@ function confirmActionSweertAlert(message = "Are you sure?", confirmText = "Yes,
|
||||
|
||||
</script>
|
||||
|
||||
<script>
|
||||
function restoreDashboardHistoryIfNeeded() {
|
||||
|
||||
const dashboardHistoryString = localStorage.getItem('dashboardHistory');
|
||||
|
||||
if (!dashboardHistoryString) {
|
||||
console.log("dashboardHistory not found");
|
||||
return;
|
||||
}
|
||||
|
||||
const dashboardHistory = JSON.parse(dashboardHistoryString);
|
||||
|
||||
if (window.location.href === dashboardHistory.dashboard_url) {
|
||||
const tabSelector = dashboardHistory.tab;
|
||||
if (tabSelector) {
|
||||
const tabElement = document.querySelector(`a[href="${tabSelector}"]`);
|
||||
if (tabElement) {
|
||||
tabElement.click();
|
||||
}
|
||||
}
|
||||
|
||||
const functionName = dashboardHistory.function_name;
|
||||
const params = dashboardHistory.tile_params;
|
||||
|
||||
if (functionName && typeof window[functionName] === 'function') {
|
||||
if(params.majorType == 0 && params.minorType == 0){
|
||||
window[functionName]();
|
||||
}else{
|
||||
window[functionName](params.majorType, params.minorType);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
console.log("inside location match");
|
||||
}
|
||||
}
|
||||
|
||||
// Run on popstate (back/forward buttons)
|
||||
window.addEventListener('popstate', restoreDashboardHistoryIfNeeded);
|
||||
|
||||
// Run on page load (refresh)
|
||||
window.addEventListener('DOMContentLoaded', () => {
|
||||
// slight delay ensures DOM/tab loads completely
|
||||
setTimeout(restoreDashboardHistoryIfNeeded, 100);
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
$('.img-inactive').on('click', function() {
|
||||
|
||||
$('.img-c').addClass('img-inactive');
|
||||
$(this).removeClass('.img-inactive');
|
||||
$(this).addClass('.img-active');
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
||||
|
||||
936
app/Views/layout/footer_old.php
Normal file
@ -0,0 +1,936 @@
|
||||
</div> <!-- container -->
|
||||
|
||||
</div> <!-- content -->
|
||||
|
||||
<?php include(__DIR__ . '/../ticket_type_modal.php'); ?>
|
||||
|
||||
|
||||
<!-- Footer Start -->
|
||||
<footer class="footer">
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<script>
|
||||
document.write(new Date().getFullYear())
|
||||
</script> © NHANCE
|
||||
</div>
|
||||
<!-- <div class="col-md-6">
|
||||
<div class="text-md-right footer-links d-none d-sm-block">
|
||||
<a href="javascript:void(0);">About Us</a>
|
||||
<a href="javascript:void(0);">Help</a>
|
||||
<a href="javascript:void(0);">Contact Us</a>
|
||||
</div>
|
||||
</div> -->
|
||||
</div>
|
||||
</div>
|
||||
</footer>
|
||||
<!-- end Footer -->
|
||||
|
||||
</div>
|
||||
|
||||
<!-- ============================================================== -->
|
||||
<!-- End Page content -->
|
||||
<!-- ============================================================== -->
|
||||
|
||||
|
||||
</div>
|
||||
<!-- END wrapper -->
|
||||
|
||||
<!-- Right Sidebar -->
|
||||
<div class="right-bar">
|
||||
<div class="h-100">
|
||||
<!-- Notifications Header -->
|
||||
<h6 class="font-weight-medium px-3 m-0 py-2 font-13 text-uppercase bg-light fixed-header">
|
||||
<i class="mdi mdi-message-text-outline font-22"></i>
|
||||
<span class="header-title">Notification</span>
|
||||
</h6>
|
||||
<div class="scrollable-content">
|
||||
<ul class="list-unstyled" id="messages-list">
|
||||
<!-- Notifications list items go here -->
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<!-- Pending Action Header -->
|
||||
<h6 class="font-weight-medium px-3 m-0 py-2 font-13 bg-light fixed-header">
|
||||
<i class="mdi mdi-format-list-checks font-22"></i>
|
||||
<span class="header-title">TO DOs</span>
|
||||
</h6>
|
||||
<div class="scrollable-content">
|
||||
<ul class="list-unstyled" id="messages-list-2">
|
||||
<!-- Pending action list items go here -->
|
||||
</ul>
|
||||
</div>
|
||||
</div> <!-- end simplebar -->
|
||||
</div>
|
||||
|
||||
<!-- /Right-bar -->
|
||||
|
||||
<!-- Right bar overlay-->
|
||||
<div class="rightbar-overlay"></div>
|
||||
|
||||
<!-- Vendor js -->
|
||||
<script src="<?= base_url() . "public"; ?>/assets/js/vendor.min.js"></script>
|
||||
|
||||
<!-- KNOB JS -->
|
||||
<script src="<?= base_url() . "public"; ?>/assets/libs/jquery-knob/jquery.knob.min.js"></script>
|
||||
<!-- Apex js-->
|
||||
<script src="<?= base_url() . "public"; ?>/assets/libs/apexcharts/apexcharts.min.js"></script>
|
||||
|
||||
<!-- third party js -->
|
||||
<script src="<?= base_url() . "public"; ?>/assets/libs/datatables.net/js/jquery.dataTables.min.js"></script>
|
||||
<script src="<?= base_url() . "public"; ?>/assets/libs/datatables.net-bs4/js/dataTables.bootstrap4.min.js"></script>
|
||||
<script src="<?= base_url() . "public"; ?>/assets/libs/datatables.net-responsive/js/dataTables.responsive.min.js"></script>
|
||||
<script src="<?= base_url() . "public"; ?>/assets/libs/datatables.net-responsive-bs4/js/responsive.bootstrap4.min.js"></script>
|
||||
<script src="<?= base_url() . "public"; ?>/assets/libs/datatables.net-buttons/js/dataTables.buttons.min.js"></script>
|
||||
<script src="<?= base_url() . "public"; ?>/assets/libs/datatables.net-buttons-bs4/js/buttons.bootstrap4.min.js"></script>
|
||||
<script src="<?= base_url() . "public"; ?>/assets/libs/datatables.net-buttons/js/buttons.html5.min.js"></script>
|
||||
<script src="<?= base_url() . "public"; ?>/assets/libs/datatables.net-buttons/js/buttons.flash.min.js"></script>
|
||||
<script src="<?= base_url() . "public"; ?>/assets/libs/datatables.net-buttons/js/buttons.print.min.js"></script>
|
||||
<script src="<?= base_url() . "public"; ?>/assets/libs/datatables.net-keytable/js/dataTables.keyTable.min.js"></script>
|
||||
<script src="<?= base_url() . "public"; ?>/assets/libs/datatables.net-select/js/dataTables.select.min.js"></script>
|
||||
<script src="<?= base_url() . "public"; ?>/assets/libs/pdfmake/build/pdfmake.min.js"></script>
|
||||
<script src="<?= base_url() . "public"; ?>/assets/libs/pdfmake/build/vfs_fonts.js"></script>
|
||||
<!-- third party js ends -->
|
||||
|
||||
<script src="<?= base_url() . "public"; ?>/assets/libs/bootstrap-datepicker/js/bootstrap-datepicker.min.js"></script>
|
||||
<script src="<?= base_url() . "public"; ?>/assets/libs/moment/min/moment.min.js"></script>
|
||||
<script src="<?= base_url() . "public"; ?>/assets/libs/bootstrap-daterangepicker/daterangepicker.js"></script>
|
||||
|
||||
|
||||
<!-- Datatables init -->
|
||||
<!-- <script src="<?= base_url() . "public"; ?>/assets/js/pages/datatables.init.js"></script> -->
|
||||
|
||||
|
||||
<script src="<?= base_url() . "public"; ?>/assets/js/pages/tickets.init.js"></script>
|
||||
|
||||
<!-- Plugins js-->
|
||||
<script src="<?= base_url() . "public"; ?>/assets/libs/admin-resources/jquery.vectormap/jquery-jvectormap-1.2.2.min.js"></script>
|
||||
<script src="<?= base_url() . "public"; ?>/assets/libs/admin-resources/jquery.vectormap/maps/jquery-jvectormap-us-merc-en.js"></script>
|
||||
<script src="<?= base_url() . "public"; ?>/assets/libs/parsleyjs/parsley.min.js"></script>
|
||||
|
||||
<!-- Dashboard init-->
|
||||
<script src="<?= base_url() . "public"; ?>/assets/js/pages/dashboard-analytics.init.js"></script>
|
||||
|
||||
<!-- Validation init js-->
|
||||
<script src="<?= base_url() . "public"; ?>/assets/js/pages/form-validation.init.js"></script>
|
||||
|
||||
<!-- App js -->
|
||||
<script src="<?= base_url() . "public"; ?>/assets/js/app.min.js"></script>
|
||||
|
||||
|
||||
<!-- Sweet Alert CDN -->
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap-multiselect@1.1.0/dist/js/bootstrap-multiselect.min.js"></script>
|
||||
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-multiselect/0.9.13/css/bootstrap-multiselect.css" />
|
||||
|
||||
<script src="https://cdn.jsdelivr.net/npm/toastr@2.1.4/toastr.min.js"></script>
|
||||
<link href="https://cdn.jsdelivr.net/npm/toastr@2.1.4/build/toastr.min.css" rel="stylesheet">
|
||||
|
||||
<!-- flatpicker datepicker -->
|
||||
<link href="https://cdn.jsdelivr.net/npm/flatpickr@4.6.13/dist/flatpickr.min.css" rel="stylesheet">
|
||||
<script src="https://cdn.jsdelivr.net/npm/flatpickr@4.6.13/dist/flatpickr.min.js"></script>
|
||||
|
||||
<!-- bootstrap datepicker -->
|
||||
<!-- <script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datepicker/1.10.0/js/bootstrap-datepicker.min.js"></script> -->
|
||||
|
||||
<script src="<?= base_url() . "public"; ?>/assets/js/pages/jquery.xeditable.js"></script>
|
||||
<script src="<?= base_url() . "public"; ?>/assets/js/form-xeditable.init.js"></script>
|
||||
<script src="<?= base_url() . "public"; ?>/assets/js/bootstrap-editable.min.js"></script>
|
||||
|
||||
<!-- Jodit Js -->
|
||||
<script src="<?= base_url() . "public"; ?>/assets/js/jodit.min.js"></script>
|
||||
|
||||
<!-- select2 -->
|
||||
<script src="https://cdn.jsdelivr.net/npm/select2@4.1.0-rc.0/dist/js/select2.min.js"></script>
|
||||
|
||||
|
||||
<script src="https://cdn.datatables.net/plug-ins/2.0.8/sorting/scientific.js"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/jszip/3.7.1/jszip.min.js"></script>
|
||||
|
||||
|
||||
<script>
|
||||
toastr.options = {
|
||||
"timeOut": 5000,
|
||||
"closeButton": true,
|
||||
};
|
||||
</script>
|
||||
|
||||
|
||||
<script>
|
||||
var pullNotificationCount = 0;
|
||||
var pendingActionCount = 0;
|
||||
|
||||
$(document).ready(function() {
|
||||
|
||||
|
||||
function fetchMessages() {
|
||||
|
||||
$.ajax({
|
||||
url: '<?= base_url('dashboard/get-notification') ?>',
|
||||
method: 'GET',
|
||||
success: function(response) {
|
||||
|
||||
// console.log('responce', response)
|
||||
|
||||
if(response.status == false){
|
||||
$('#notification_count').html('0')
|
||||
console.log('The session is not set correctly. ')
|
||||
return;
|
||||
}
|
||||
|
||||
let messagesList = $('#messages-list');
|
||||
messagesList.empty();
|
||||
|
||||
var html = "";
|
||||
|
||||
pullNotificationCount = response.message.length
|
||||
|
||||
|
||||
|
||||
localStorage.setItem('pullNotificationCount', pullNotificationCount)
|
||||
|
||||
response.message.forEach(message => {
|
||||
|
||||
// if (!message.is_read) {
|
||||
// unreadCount++;
|
||||
// }
|
||||
|
||||
var jasonDecodeData = JSON.parse(message.message_text)
|
||||
|
||||
var toast_body_css = 'background : #bfd7eb !important;';
|
||||
var toast_head_css = 'background-color : rgb(2, 168, 181) !important; color :#000; border-bottom: 0;';
|
||||
var toast_icon = 'mdi mdi-checkbox-marked-circle mr-auto';
|
||||
var toast_status_word = 'Success';
|
||||
|
||||
if (jasonDecodeData.msg_status == 'failure') {
|
||||
|
||||
toast_body_css = 'background : #fdcfcf !important;';
|
||||
toast_head_css = 'background-color : rgb(235 105 105 / 85%) !important; color :#000; border-bottom: 0;';
|
||||
toast_icon = 'mdi mdi-information mr-auto'
|
||||
toast_status_word = 'Failure';
|
||||
|
||||
} else if (jasonDecodeData.msg_status == 'success') {
|
||||
|
||||
toast_body_css = 'background : #bfd7eb !important;';
|
||||
toast_head_css = 'background-color : rgb(2, 168, 181) !important; color :#000; border-bottom: 0;';
|
||||
toast_icon = 'mdi mdi-checkbox-marked-circle mr-auto'
|
||||
toast_status_word = 'Success';
|
||||
}
|
||||
|
||||
var html = ` <li data-id="${message.id}" data-url="${jasonDecodeData.action_url != undefined && jasonDecodeData.action_url != "" ? jasonDecodeData.action_url : 'dashboard/view'}">
|
||||
<div class="p-3">
|
||||
<div class="toast fade show" role="alert" aria-live="assertive" aria-atomic="true" data-toggle="toast">
|
||||
<div class="toast-header " style="${toast_head_css}" >
|
||||
<strong class="${toast_icon}"> ${toast_status_word}</strong>
|
||||
<button type="button" class="ml-2 mb-1 close rm_msg" data-dismiss="toast" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="toast-body" style="${toast_body_css}">
|
||||
<strong>${jasonDecodeData.msg_title ? jasonDecodeData.msg_title : ''}</strong> <br><br>
|
||||
<small style="position: relative;bottom: 8px;">${jasonDecodeData.message_text}</small>
|
||||
<div class="toast-footer">
|
||||
<a href="#" class="redirect_page" data-toggle="tooltip" data-placement="bottom" title="Click Go to the Page"><small style="margin-right: 25px;position: relative;top: 2px;">${jasonDecodeData.action_url != undefined && jasonDecodeData.action_url != "" ? 'see more' : ''}</small></a>
|
||||
<small style="position: relative;top: 2px;left: 5px;font-size: 10px;">${formatDate(message.created_at)}</small>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</li>`
|
||||
|
||||
|
||||
messagesList.append(html);
|
||||
$(function() {
|
||||
$('[data-toggle="tooltip"]').tooltip();
|
||||
});
|
||||
});
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
console.error(xhr.responseText); // Log the error response
|
||||
}
|
||||
});
|
||||
|
||||
let PNCount = parseInt(localStorage.getItem('pullNotificationCount'));
|
||||
let PACount = parseInt(localStorage.getItem('pendingActionCount'));
|
||||
|
||||
totalcount = PNCount + PACount
|
||||
$('#notification_count').html(totalcount);
|
||||
|
||||
}
|
||||
|
||||
function acknowledgeMessage(messageId) {
|
||||
$.ajax({
|
||||
url: '<?= base_url('dashboard/acknowledge-notification/') ?>' + messageId,
|
||||
method: 'GET',
|
||||
success: function(response) {
|
||||
fetchMessages();
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
console.error(xhr.responseText); // Log the error response
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
$('#messages-list').on('click', 'li', function(event) {
|
||||
|
||||
//console.log('messages-list click li')
|
||||
|
||||
if ($(event.target).closest('.rm_msg').length > 0) {
|
||||
|
||||
//console.log('.rm_msg')
|
||||
|
||||
let messageId = $(this).data('id');
|
||||
let url = $(this).data('url');
|
||||
acknowledgeMessage(messageId);
|
||||
|
||||
$(this).delay(300).fadeOut('slow', function() {
|
||||
$(this).remove();
|
||||
});
|
||||
|
||||
} else if ($(event.target).closest('.redirect_page').length > 0) {
|
||||
|
||||
//console.log('redirect_page')
|
||||
|
||||
let messageId = $(this).data('id');
|
||||
let url = $(this).data('url');
|
||||
//console.log('url : ', url)
|
||||
acknowledgeMessage(messageId);
|
||||
|
||||
window.location.href = '<?= base_url() ?>' + url;
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
|
||||
// fetchMessages();
|
||||
|
||||
// setInterval(fetchMessages, 60000); // Fetch messages every sixty seconds
|
||||
});
|
||||
|
||||
$(document).ready(function() {
|
||||
|
||||
function fetchPendingAction() {
|
||||
|
||||
$.ajax({
|
||||
|
||||
url: '<?= base_url('dashboard/get-pending-action') ?>',
|
||||
method: 'GET',
|
||||
success: function(response) {
|
||||
|
||||
console.log(response);
|
||||
|
||||
if (response.length == 0) {
|
||||
|
||||
pendingActionCount = 0;
|
||||
localStorage.setItem('pendingActionCount', pendingActionCount);
|
||||
}
|
||||
|
||||
for (let key in response) {
|
||||
// console.log(response[key].length)
|
||||
// console.log('type', typeof response[key].length)
|
||||
// console.log('key', response[key])
|
||||
if(response[key].length != 'undefined' && response[key].length != undefined)
|
||||
{
|
||||
pendingActionCount = pendingActionCount + response[key].length;
|
||||
}
|
||||
}
|
||||
|
||||
console.log(pendingActionCount);
|
||||
|
||||
let messagesList = $('#messages-list-2');
|
||||
messagesList.empty();
|
||||
|
||||
|
||||
if (response.inception) {
|
||||
$.each(response.inception, function(index, item) {
|
||||
|
||||
var queryParams = {
|
||||
client_id: item.client_id,
|
||||
client_policy_id: item.client_policy_id,
|
||||
client_branch_id: item.branch_id,
|
||||
actions: 'inception'
|
||||
};
|
||||
|
||||
const queryString = objectToQueryString(queryParams);
|
||||
|
||||
var url = 'employee/upload?' + queryString
|
||||
////console.log(url)
|
||||
|
||||
|
||||
var toast_body_css = 'background : #bfd7eb !important;';
|
||||
var toast_head_css = 'background-color : rgb(2, 168, 181) !important; color :#000; border-bottom: 0;';
|
||||
var toast_icon = 'mdi mdi-checkbox-marked-circle mr-auto';
|
||||
var toast_status_word = 'Info';
|
||||
|
||||
if (!item.branch_name.toLowerCase().includes('branch')) {
|
||||
|
||||
//console.log(item.branch_name)
|
||||
item.branch_name += ' branch';
|
||||
}
|
||||
|
||||
////console.log(item.branch_name);
|
||||
|
||||
var toast_body_data = item.client_name + '( ' + item.branch_name + ' ) ' + ' - ' + item.policy_name;
|
||||
|
||||
////console.log(toast_body_data);
|
||||
|
||||
var html = ` <li data-id="" data-url="${url}">
|
||||
<div class="p-3">
|
||||
<div class="toast fade show" role="alert" aria-live="assertive" aria-atomic="true" data-toggle="toast">
|
||||
<div class="toast-header " style="${toast_head_css}" >
|
||||
<strong class="${toast_icon}"> ${toast_status_word}</strong>
|
||||
<button type="button" class="ml-2 mb-1 close rm_msg" data-dismiss="toast" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="toast-body" style="${toast_body_css}">
|
||||
<strong>Inception Pending</strong><br><br>
|
||||
<small style="position: relative;bottom: 8px;">${toast_body_data}</small>
|
||||
<div class="toast-footer">
|
||||
<a href="#" class="redirect_page" data-toggle="tooltip" data-placement="bottom" title="Click Go to the Page"><small style="margin-right: 142px;position: relative;top: 2px;">see more</small></a>
|
||||
<small style="position: relative;top: 2px;left: 5px;font-size: 10px;"></small>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</li>`
|
||||
|
||||
|
||||
messagesList.append(html);
|
||||
|
||||
});
|
||||
} else {
|
||||
console.log('response.inception is undefined or null');
|
||||
}
|
||||
|
||||
if (response.correction) {
|
||||
$.each(response.correction, function(index, item) {
|
||||
if (item.batch_export_count == 0 || item.batch_import_count == 0) {
|
||||
|
||||
|
||||
var queryParams = {
|
||||
client_id: item.client_id,
|
||||
client_branch_id: item.branch_id,
|
||||
event: 'correction',
|
||||
actions: 'export',
|
||||
insurer_or_tpa: 'tpa',
|
||||
};
|
||||
|
||||
const queryString = objectToQueryString(queryParams);
|
||||
|
||||
var url = 'employee/upload?' + queryString + '#KYC-DOC-tab'
|
||||
////console.log(url)
|
||||
|
||||
|
||||
var toast_body_css = 'background : #bfd7eb !important;';
|
||||
var toast_head_css = 'background-color : rgb(2, 168, 181) !important; color :#000; border-bottom: 0;';
|
||||
var toast_icon = 'mdi mdi-checkbox-marked-circle mr-auto';
|
||||
var toast_status_word = 'Info';
|
||||
|
||||
var title = 'Correction Pending';
|
||||
|
||||
|
||||
if (!item.branch_name.toLowerCase().includes('branch')) {
|
||||
|
||||
//console.log(item.branch_name)
|
||||
item.branch_name += ' branch';
|
||||
|
||||
}
|
||||
|
||||
////console.log(item.branch_name);
|
||||
|
||||
// if (item.batch_export_count > 0) {
|
||||
|
||||
// title = 'Correction Import Pending';
|
||||
// }
|
||||
|
||||
var toast_body_data = item.client_name + ' - ' + item.branch_name;
|
||||
////console.log(toast_body_data);
|
||||
|
||||
var html = ` <li data-id="" data-url="${url}">
|
||||
<div class="p-3">
|
||||
<div class="toast fade show" role="alert" aria-live="assertive" aria-atomic="true" data-toggle="toast">
|
||||
<div class="toast-header " style="${toast_head_css}" >
|
||||
<strong class="${toast_icon}"> ${toast_status_word}</strong>
|
||||
<button type="button" class="ml-2 mb-1 close rm_msg" data-dismiss="toast" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="toast-body" style="${toast_body_css}">
|
||||
<strong>${title}</strong><br><br>
|
||||
<small style="position: relative;bottom: 8px;">${toast_body_data}</small>
|
||||
<div class="toast-footer">
|
||||
<a href="#" class="redirect_page" data-toggle="tooltip" data-placement="bottom" title="Click Go to the Page"><small style="margin-right: 142px;position: relative;top: 2px;">see more</small></a>
|
||||
<small style="position: relative;top: 2px;left: 5px;font-size: 10px;"></small>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</li>`
|
||||
|
||||
|
||||
messagesList.append(html);
|
||||
|
||||
}
|
||||
});
|
||||
}else{
|
||||
console.log('response.correction is undefined or null');
|
||||
}
|
||||
|
||||
if (response.deletion) {
|
||||
$.each(response.deletion, function(index, item) {
|
||||
|
||||
if (item.batch_export_count == 0 || item.batch_import_count == 0) {
|
||||
|
||||
|
||||
var queryParams = {
|
||||
|
||||
client_id: item.client_id,
|
||||
client_policy_id: item.client_policy_id,
|
||||
client_branch_id: item.branch_id,
|
||||
event: 'deletion',
|
||||
actions: 'export',
|
||||
insurer_or_tpa: 'tpa',
|
||||
|
||||
};
|
||||
|
||||
const queryString = objectToQueryString(queryParams);
|
||||
|
||||
var url = 'employee/upload?' + queryString + '#KYC-DOC-tab'
|
||||
////console.log(url)
|
||||
|
||||
|
||||
var toast_body_css = 'background : #bfd7eb !important;';
|
||||
var toast_head_css = 'background-color : rgb(2, 168, 181) !important; color :#000; border-bottom: 0;';
|
||||
var toast_icon = 'mdi mdi-checkbox-marked-circle mr-auto';
|
||||
var toast_status_word = 'Info';
|
||||
var title = 'Deletion Pending';
|
||||
|
||||
|
||||
if (!item.branch_name.toLowerCase().includes('branch')) {
|
||||
|
||||
//console.log(item.branch_name)
|
||||
item.branch_name += ' branch';
|
||||
|
||||
}
|
||||
|
||||
////console.log(item.branch_name);
|
||||
|
||||
// if (item.batch_export_count > 0) {
|
||||
|
||||
// title = 'Deletion Import Pending';
|
||||
// }
|
||||
|
||||
var toast_body_data = item.client_name + '( ' + item.branch_name + ' ) ' + ' - ' + item.policy_name;
|
||||
////console.log(toast_body_data);
|
||||
|
||||
var html = ` <li data-id="" data-url="${url}">
|
||||
<div class="p-3">
|
||||
<div class="toast fade show" role="alert" aria-live="assertive" aria-atomic="true" data-toggle="toast">
|
||||
<div class="toast-header " style="${toast_head_css}" >
|
||||
<strong class="${toast_icon}"> ${toast_status_word}</strong>
|
||||
<button type="button" class="ml-2 mb-1 close rm_msg" data-dismiss="toast" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="toast-body" style="${toast_body_css}">
|
||||
<strong>${title}</strong><br><br>
|
||||
<small style="position: relative;bottom: 8px;">${toast_body_data}</small>
|
||||
<div class="toast-footer">
|
||||
<a href="#" class="redirect_page" data-toggle="tooltip" data-placement="bottom" title="Click Go to the Page"><small style="margin-right: 142px;position: relative;top: 2px;">see more</small></a>
|
||||
<small style="position: relative;top: 2px;left: 5px;font-size: 10px;"></small>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</li>`
|
||||
|
||||
|
||||
messagesList.append(html);
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
}else{
|
||||
console.log('response.deletion is undefined or null');
|
||||
|
||||
}
|
||||
|
||||
if (response.si_enhancement) {
|
||||
$.each(response.si_enhancement, function(index, item) {
|
||||
if (item.batch_export_count == 0 || item.batch_import_count == 0) {
|
||||
|
||||
|
||||
var queryParams = {
|
||||
client_id: item.client_id,
|
||||
client_policy_id: item.client_policy_id,
|
||||
client_branch_id: item.branch_id,
|
||||
event: 'si_enhancement',
|
||||
actions: 'export',
|
||||
insurer_or_tpa: 'tpa',
|
||||
};
|
||||
|
||||
const queryString = objectToQueryString(queryParams);
|
||||
|
||||
var url = 'employee/upload?' + queryString + '#KYC-DOC-tab'
|
||||
////console.log(url)
|
||||
|
||||
|
||||
var toast_body_css = 'background : #bfd7eb !important;';
|
||||
var toast_head_css = 'background-color : rgb(2, 168, 181) !important; color :#000; border-bottom: 0;';
|
||||
var toast_icon = 'mdi mdi-checkbox-marked-circle mr-auto';
|
||||
var toast_status_word = 'Info';
|
||||
var title = 'SI Enhancement Pending';
|
||||
|
||||
|
||||
if (!item.branch_name.toLowerCase().includes('branch')) {
|
||||
|
||||
//console.log(item.branch_name)
|
||||
item.branch_name += ' branch';
|
||||
|
||||
}
|
||||
|
||||
////console.log(item.branch_name);
|
||||
|
||||
// if (item.batch_export_count > 0) {
|
||||
|
||||
// title = 'SI Enhancement Import Pending';
|
||||
// }
|
||||
|
||||
var toast_body_data = item.client_name + '( ' + item.branch_name + ' ) ' + ' - ' + item.policy_name;
|
||||
////console.log(toast_body_data);
|
||||
|
||||
var html = ` <li data-id="" data-url="${url}">
|
||||
<div class="p-3">
|
||||
<div class="toast fade show" role="alert" aria-live="assertive" aria-atomic="true" data-toggle="toast">
|
||||
<div class="toast-header " style="${toast_head_css}" >
|
||||
<strong class="${toast_icon}"> ${toast_status_word}</strong>
|
||||
<button type="button" class="ml-2 mb-1 close rm_msg" data-dismiss="toast" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="toast-body" style="${toast_body_css}">
|
||||
<strong>${title}</strong><br><br>
|
||||
<small style="position: relative;bottom: 8px;">${toast_body_data}</small>
|
||||
<div class="toast-footer">
|
||||
<a href="#" class="redirect_page" data-toggle="tooltip" data-placement="bottom" title="Click Go to the Page"><small style="margin-right: 142px;position: relative;top: 2px;">see more</small></a>
|
||||
<small style="position: relative;top: 2px;left: 5px;font-size: 10px;"></small>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</li>`
|
||||
|
||||
|
||||
messagesList.append(html);
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
}else{
|
||||
console.log('response.si_enhancement is undefined or null');
|
||||
|
||||
}
|
||||
|
||||
if (response.tpa) {
|
||||
$.each(response.tpa, function(index, item) {
|
||||
if (item.batch_export_count == 0 || item.batch_import_count == 0) {
|
||||
|
||||
|
||||
var queryParams = {
|
||||
client_id: item.client_id,
|
||||
client_policy_id: item.client_policy_id,
|
||||
client_branch_id: item.branch_id,
|
||||
event: 'inception',
|
||||
insurer_or_tpa: 'tpa',
|
||||
actions: 'export',
|
||||
};
|
||||
|
||||
const queryString = objectToQueryString(queryParams);
|
||||
|
||||
var url = 'employee/upload?' + queryString + '#KYC-DOC-tab'
|
||||
////console.log(url)
|
||||
|
||||
|
||||
var toast_body_css = 'background : #bfd7eb !important;';
|
||||
var toast_head_css = 'background-color : rgb(2, 168, 181) !important; color :#000; border-bottom: 0;';
|
||||
var toast_icon = 'mdi mdi-checkbox-marked-circle mr-auto';
|
||||
var toast_status_word = 'Info';
|
||||
var title = 'TPA Pending';
|
||||
|
||||
if (!item.branch_name.toLowerCase().includes('branch')) {
|
||||
|
||||
//console.log(item.branch_name)
|
||||
item.branch_name += ' branch';
|
||||
|
||||
}
|
||||
|
||||
////console.log(item.branch_name);
|
||||
|
||||
// if (item.batch_export_count > 0) {
|
||||
|
||||
// title = 'TPA Import Pending';
|
||||
// }
|
||||
|
||||
var toast_body_data = item.client_name + '( ' + item.branch_name + ' ) ' + ' - ' + item.policy_name;
|
||||
////console.log(toast_body_data);
|
||||
|
||||
var html = ` <li data-id="" data-url="${url}">
|
||||
<div class="p-3">
|
||||
<div class="toast fade show" role="alert" aria-live="assertive" aria-atomic="true" data-toggle="toast">
|
||||
<div class="toast-header " style="${toast_head_css}" >
|
||||
<strong class="${toast_icon}"> ${toast_status_word}</strong>
|
||||
<button type="button" class="ml-2 mb-1 close rm_msg" data-dismiss="toast" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="toast-body" style="${toast_body_css}">
|
||||
<strong>${title}</strong><br><br>
|
||||
<small style="position: relative;bottom: 8px;">${toast_body_data}</small>
|
||||
<div class="toast-footer">
|
||||
<a href="#" class="redirect_page" data-toggle="tooltip" data-placement="bottom" title="Click Go to the Page"><small style="margin-right: 142px;position: relative;top: 2px;">see more</small></a>
|
||||
<small style="position: relative;top: 2px;left: 5px;font-size: 10px;"></small>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</li>`
|
||||
|
||||
|
||||
messagesList.append(html);
|
||||
|
||||
}
|
||||
});
|
||||
}else{
|
||||
console.log('response.tpa is undefined or null');
|
||||
|
||||
}
|
||||
|
||||
if (response.uhid) {
|
||||
$.each(response.uhid, function(index, item) {
|
||||
if (item.batch_export_count == 0 || item.batch_import_count == 0) {
|
||||
|
||||
var queryParams = {
|
||||
|
||||
client_id: item.client_id,
|
||||
client_policy_id: item.client_policy_id,
|
||||
client_branch_id: item.branch_id,
|
||||
event: 'inception',
|
||||
insurer_or_tpa: 'insurer',
|
||||
actions: 'export',
|
||||
};
|
||||
|
||||
const queryString = objectToQueryString(queryParams);
|
||||
|
||||
var url = 'employee/upload?' + queryString + '#KYC-DOC-tab'
|
||||
//console.log(url)
|
||||
|
||||
var toast_body_css = 'background : #bfd7eb !important;';
|
||||
var toast_head_css = 'background-color : rgb(2, 168, 181) !important; color :#000; border-bottom: 0;';
|
||||
var toast_icon = 'mdi mdi-checkbox-marked-circle mr-auto';
|
||||
var toast_status_word = 'Info';
|
||||
var title = 'Insurer Pending';
|
||||
|
||||
|
||||
if (!item.branch_name.toLowerCase().includes('branch')) {
|
||||
|
||||
//console.log(item.branch_name)
|
||||
item.branch_name += ' branch';
|
||||
|
||||
}
|
||||
|
||||
////console.log(item.branch_name);
|
||||
|
||||
// if (item.batch_export_count > 0) {
|
||||
|
||||
// title = 'Insurer Import Pending';
|
||||
// }
|
||||
|
||||
var toast_body_data = item.client_name + '( ' + item.branch_name + ' ) ' + ' - ' + item.policy_name;
|
||||
////console.log(toast_body_data);
|
||||
|
||||
var html = ` <li data-id="" data-url="${url}">
|
||||
<div class="p-3">
|
||||
<div class="toast fade show" role="alert" aria-live="assertive" aria-atomic="true" data-toggle="toast">
|
||||
<div class="toast-header " style="${toast_head_css}" >
|
||||
<strong class="${toast_icon}"> ${toast_status_word}</strong>
|
||||
<button type="button" class="ml-2 mb-1 close rm_msg" data-dismiss="toast" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="toast-body" style="${toast_body_css}">
|
||||
<strong>${title}</strong><br><br>
|
||||
<small style="position: relative;bottom: 8px;">${toast_body_data}</small>
|
||||
<div class="toast-footer">
|
||||
<a href="#" class="redirect_page" data-toggle="tooltip" data-placement="bottom" title="Click Go to the Page"><small style="margin-right: 142px;position: relative;top: 2px;">see more</small></a>
|
||||
<small style="position: relative;top: 2px;left: 5px;font-size: 10px;"></small>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</li>`
|
||||
|
||||
|
||||
messagesList.append(html);
|
||||
|
||||
}
|
||||
});
|
||||
}else{
|
||||
console.log('response.uhid is undefined or null');
|
||||
}
|
||||
localStorage.setItem('pendingActionCount', pendingActionCount)
|
||||
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
console.error(xhr.responseText); // Log the error response
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
fetchPendingAction()
|
||||
|
||||
$('#messages-list-2').on('click', 'li', function(event) {
|
||||
|
||||
//console.log('messages-list-2 click li')
|
||||
|
||||
if ($(event.target).closest('.rm_msg').length > 0) {
|
||||
|
||||
//console.log('.rm_msg')
|
||||
|
||||
$(this).delay(300).fadeOut('slow', function() {
|
||||
$(this).remove();
|
||||
});
|
||||
|
||||
} else if ($(event.target).closest('.redirect_page').length > 0) {
|
||||
|
||||
//console.log('redirect_page')
|
||||
|
||||
let url = $(this).data('url');
|
||||
//console.log('url : ', url);
|
||||
|
||||
window.location.href = '<?= base_url() ?>' + url;
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
})
|
||||
|
||||
function objectToQueryString(obj) {
|
||||
return Object.keys(obj).map(key => `${encodeURIComponent(key)}=${encodeURIComponent(obj[key])}`).join('&');
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
<script>
|
||||
|
||||
function formatDate(dateString)
|
||||
{
|
||||
// Parse the input date string
|
||||
let date = new Date(dateString);
|
||||
|
||||
// Define months array
|
||||
const months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
|
||||
|
||||
// Extract day, month, year, hours, and minutes
|
||||
let day = date.getDate();
|
||||
let month = months[date.getMonth()];
|
||||
let year = date.getFullYear();
|
||||
let hours = date.getHours();
|
||||
let minutes = date.getMinutes();
|
||||
|
||||
// Convert hours to 12-hour format
|
||||
let period = hours >= 12 ? 'pm' : 'am';
|
||||
hours = hours % 12;
|
||||
hours = hours ? hours : 12; // Handle midnight (0 hours)
|
||||
|
||||
// Format the time string
|
||||
let timeString = ('0' + hours).slice(-2) + ':' + ('0' + minutes).slice(-2) + ' ' + period;
|
||||
|
||||
// Format the date string
|
||||
let formattedDate = day + '-' + month + '-' + year + ' ' + timeString;
|
||||
|
||||
return formattedDate;
|
||||
}
|
||||
|
||||
function printCurrentTime()
|
||||
{
|
||||
var now = new Date();
|
||||
var hours = now.getHours().toString().padStart(2, '0');
|
||||
var minutes = now.getMinutes().toString().padStart(2, '0');
|
||||
var seconds = now.getSeconds().toString().padStart(2, '0');
|
||||
var currentTime = hours + ':' + minutes + ':' + seconds;
|
||||
// console.log("Current Time:", currentTime);
|
||||
|
||||
return currentTime;
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<script>
|
||||
|
||||
function checkDuplicateTableFieldValue(tableName, fieldName, value, callback) {
|
||||
$.ajax({
|
||||
url: '<?= base_url('util/checkDuplicateTableFieldValue') ?>', // Adjust this to your endpoint in CodeIgniter
|
||||
type: 'POST',
|
||||
data: {
|
||||
table: tableName,
|
||||
field: fieldName,
|
||||
value: value
|
||||
},
|
||||
dataType: 'json',
|
||||
success: function(response) {
|
||||
if (typeof callback === 'function') {
|
||||
callback(response.isDuplicate); // Pass the result to the callback
|
||||
}
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
console.error('AJAX Error:', error);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function sendAjaxRequestForGlobal(url, method, data = {}, successCallback = null, errorCallback = null) {
|
||||
$.ajax({
|
||||
url: url,
|
||||
method: method,
|
||||
data: data,
|
||||
dataType: 'json', // Expected response type
|
||||
success: function(response) {
|
||||
// If a success callback is provided, call it with the response
|
||||
if (successCallback) {
|
||||
successCallback(response);
|
||||
}
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
// Handle errors if provided error callback
|
||||
if (errorCallback) {
|
||||
errorCallback(xhr, status, error);
|
||||
} else {
|
||||
console.error('AJAX Error:', error);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function confirmActionSweertAlert(message = "Are you sure?", confirmText = "Yes, Proceed!", cancelText = "Cancel", icon = "warning") {
|
||||
return Swal.fire({
|
||||
title: message,
|
||||
icon: icon,
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: "#3085d6",
|
||||
cancelButtonColor: "#d33",
|
||||
confirmButtonText: confirmText,
|
||||
cancelButtonText: cancelText
|
||||
}).then((result) => {
|
||||
return result.isConfirmed; // Returns true if confirmed, false otherwise
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
||||
|
||||
899
app/Views/layout/header_old.php
Normal file
@ -0,0 +1,899 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
|
||||
<meta charset="utf-8" />
|
||||
<title><?= isset($page_name) ? $page_name : 'NHance'; ?></title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<meta content="" name="description" />
|
||||
<meta content="NHANCE" name="NHANCE" />
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
|
||||
|
||||
|
||||
<!-- App favicon -->
|
||||
<link rel="shortcut icon" href="<?= base_url() . "public"; ?>/assets/images/Nhance_Favi.svg">
|
||||
|
||||
<!-- plugin css -->
|
||||
<link href="<?= base_url() . "public"; ?>/assets/libs/admin-resources/jquery.vectormap/jquery-jvectormap-1.2.2.css" rel="stylesheet" type="text/css" />
|
||||
|
||||
<!-- third party css -->
|
||||
<link href="<?= base_url() . "public"; ?>/assets/libs/datatables.net-bs4/css/dataTables.bootstrap4.min.css" rel="stylesheet" type="text/css" />
|
||||
<link href="<?= base_url() . "public"; ?>/assets/libs/datatables.net-responsive-bs4/css/responsive.bootstrap4.min.css" rel="stylesheet" type="text/css" />
|
||||
<link href="<?= base_url() . "public"; ?>/assets/libs/datatables.net-buttons-bs4/css/buttons.bootstrap4.min.css" rel="stylesheet" type="text/css" />
|
||||
<link href="<?= base_url() . "public"; ?>/assets/libs/datatables.net-select-bs4/css//select.bootstrap4.min.css" rel="stylesheet" type="text/css" />
|
||||
<!-- third party css end -->
|
||||
|
||||
<!-- App css -->
|
||||
<link href="<?= base_url() . "public"; ?>/assets/css/bootstrap-creative.min.css" rel="stylesheet" type="text/css" id="bs-default-stylesheet" />
|
||||
<link href="<?= base_url() . "public"; ?>/assets/css/app-creative.min.css" rel="stylesheet" type="text/css" id="app-default-stylesheet" />
|
||||
|
||||
<link href="<?= base_url() . "public"; ?>/assets/css/bootstrap-creative-dark.min.css" rel="stylesheet" type="text/css" id="bs-dark-stylesheet" />
|
||||
<link href="<?= base_url() . "public"; ?>/assets/css/app-creative-dark.min.css" rel="stylesheet" type="text/css" id="app-dark-stylesheet" />
|
||||
|
||||
<!-- icons -->
|
||||
<link href="<?= base_url() . "public"; ?>/assets/css/icons.min.css" rel="stylesheet" type="text/css" />
|
||||
|
||||
<link href="<?= base_url() . "public"; ?>/assets/libs/bootstrap-datepicker/css/bootstrap-datepicker.min.css" rel="stylesheet" type="text/css" />
|
||||
<link href="<?= base_url() . "public"; ?>/assets/libs/bootstrap-daterangepicker/daterangepicker.css" rel="stylesheet" type="text/css">
|
||||
<link href="<?= base_url() . "public"; ?>/assets/libs/bootstrap-daterangepicker/daterangepicker.css" rel="stylesheet" type="text/css">
|
||||
|
||||
|
||||
<!-- <link href="<?= base_url() . "public"; ?>/assets/css/bootstrap-material.min.css" rel="stylesheet" type="text/css" id="bs-default-stylesheet" /> -->
|
||||
<!-- <link href="<?= base_url() . "public"; ?>/assets/css/app-material.min.css" rel="stylesheet" type="text/css" id="app-default-stylesheet" /> -->
|
||||
|
||||
|
||||
<!-- <link href="<?= base_url() . "public"; ?>/assets/css/bootstrap-editable.css" rel="stylesheet" type="text/css" /> -->
|
||||
<link href="https://cdn.jsdelivr.net/npm/remixicon/fonts/remixicon.css" rel="stylesheet">
|
||||
|
||||
<!-- Jodit Css -->
|
||||
<link href="<?= base_url() . "public"; ?>/assets/css/jodit.css" rel="stylesheet" type="text/css" />
|
||||
|
||||
|
||||
<!-- JQuery CDN -->
|
||||
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
|
||||
|
||||
<!-- Sweet Alert CDN -->
|
||||
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11.10.4/dist/sweetalert2.all.min.js"></script>
|
||||
|
||||
<!-- select2 -->
|
||||
<link href="https://cdn.jsdelivr.net/npm/select2@4.1.0-beta.1/dist/css/select2.min.css" rel="stylesheet" type="text/css">
|
||||
|
||||
<script src="https://code.jquery.com/jquery-3.5.1.slim.min.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/@popperjs/core@2.5.3/dist/umd/popper.min.js"></script>
|
||||
|
||||
<link rel="manifest" href="../manifest.json">
|
||||
|
||||
<script>
|
||||
if ('serviceWorker' in navigator) {
|
||||
window.addEventListener('load', function() {
|
||||
navigator.serviceWorker.register('../service-worker.js').then(function(registration) {
|
||||
// console.log('Service Worker registration successful with scope:', registration.scope);
|
||||
}, function(err) {
|
||||
// console.log('Service Worker registration failed:', err);
|
||||
});
|
||||
});
|
||||
}
|
||||
</script>
|
||||
<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/slick-carousel/1.8.1/slick.min.css" />
|
||||
<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/slick-carousel/1.8.1/slick-theme.min.css" />
|
||||
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
|
||||
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/slick-carousel/1.8.1/slick.min.js"></script>
|
||||
<!-- srinivas -->
|
||||
|
||||
<link href="https://cdn.jsdelivr.net/gh/gitbrent/bootstrap4-toggle@3.6.1/css/bootstrap4-toggle.min.css" rel="stylesheet">
|
||||
<script src="https://cdn.jsdelivr.net/gh/gitbrent/bootstrap4-toggle@3.6.1/js/bootstrap4-toggle.min.js"></script>
|
||||
<script src="https://editor.unlayer.com/embed.js"></script>
|
||||
|
||||
<!-- MD5 Hash Start -->
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/blueimp-md5/2.19.0/js/md5.min.js"></script>
|
||||
|
||||
|
||||
<!-- MD5 Hash End -->
|
||||
|
||||
<!-- <script src="<?= base_url('public/unlayer/js/embed.js') . '' ?>"></script> -->
|
||||
<!-- srinivas -->
|
||||
<style>
|
||||
body[data-sidebar-size=condensed]:not([data-layout=compact]):not(.auth-fluid-pages) {
|
||||
min-height: 0;
|
||||
}
|
||||
|
||||
body[data-sidebar-size=condensed] .navbar-custom {
|
||||
left: 155px !important;
|
||||
}
|
||||
|
||||
body[data-sidebar-size=condensed] .logo-box {
|
||||
width: 155px !important;
|
||||
}
|
||||
|
||||
.navbar-custom {
|
||||
top: -10px !important;
|
||||
height: 61px !important;
|
||||
}
|
||||
|
||||
.logo-box {
|
||||
top: -10px !important;
|
||||
height: 61px !important;
|
||||
}
|
||||
|
||||
.content-page {
|
||||
padding: 80px 15px 65px 15px !important;
|
||||
}
|
||||
|
||||
/* Media query for small screens */
|
||||
@media screen and (min-width: 768px) {
|
||||
|
||||
/* Styles for screens with a minimum width of 768px (e.g., tablets and larger devices) */
|
||||
.navbar-custom .button-menu-mobile {
|
||||
display: none;
|
||||
/* Hide the button on larger screens */
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
.loader-mask {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
background-color: #00000069;
|
||||
z-index: 99999;
|
||||
}
|
||||
|
||||
.loader {
|
||||
position: absolute;
|
||||
left: 50%;
|
||||
top: 50%;
|
||||
width: 50px;
|
||||
height: 50px;
|
||||
font-size: 0;
|
||||
color: #00c9d0;
|
||||
display: inline-block;
|
||||
margin: -25px 0 0 -25px;
|
||||
text-indent: -9999em;
|
||||
-webkit-transform: translateZ(0);
|
||||
-ms-transform: translateZ(0);
|
||||
transform: translateZ(0);
|
||||
}
|
||||
|
||||
.lead {
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
.loader div {
|
||||
background-color: #6ad9cf;
|
||||
display: inline-block;
|
||||
float: none;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 50px;
|
||||
height: 50px;
|
||||
opacity: .5;
|
||||
border-radius: 50%;
|
||||
-webkit-animation: ballPulseDouble 2s ease-in-out infinite;
|
||||
animation: ballPulseDouble 2s ease-in-out infinite;
|
||||
}
|
||||
|
||||
.loader div:last-child {
|
||||
-webkit-animation-delay: -1s;
|
||||
animation-delay: -1s;
|
||||
}
|
||||
|
||||
@-webkit-keyframes ballPulseDouble {
|
||||
|
||||
0%,
|
||||
100% {
|
||||
-webkit-transform: scale(0);
|
||||
transform: scale(0);
|
||||
}
|
||||
|
||||
50% {
|
||||
-webkit-transform: scale(1);
|
||||
transform: scale(1);
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes ballPulseDouble {
|
||||
|
||||
0%,
|
||||
100% {
|
||||
-webkit-transform: scale(0);
|
||||
transform: scale(0);
|
||||
}
|
||||
|
||||
50% {
|
||||
-webkit-transform: scale(1);
|
||||
transform: scale(1);
|
||||
}
|
||||
}
|
||||
|
||||
.toast-success {
|
||||
background-color: #009688 !important;
|
||||
color: #FFFFFF !important;
|
||||
}
|
||||
|
||||
/* .dataTables_wrapper .text-right {
|
||||
position: relative;
|
||||
} */
|
||||
|
||||
.dataTables_wrapper .dt-buttons .buttons-csv,
|
||||
.dataTables_wrapper .dt-buttons .buttons-html5 {
|
||||
background-color: #02a8b5;
|
||||
color: #fff;
|
||||
border-color: #02a8b5;
|
||||
}
|
||||
|
||||
.dataTables_wrapper .dt-buttons .buttons-csv:hover,
|
||||
.dataTables_wrapper .dt-buttons .buttons-html5:hover {
|
||||
background-color: #028291;
|
||||
border-color: #028291;
|
||||
}
|
||||
|
||||
|
||||
.modal-full-width {
|
||||
width: 80% !important;
|
||||
/* width: 95% !important; */
|
||||
/* max-width: none; */
|
||||
}
|
||||
|
||||
.modal-body {
|
||||
/* position: relative;
|
||||
flex: 1 1 auto; */
|
||||
padding: 2rem !important;
|
||||
}
|
||||
</style>
|
||||
|
||||
<style>
|
||||
.text-danger-2 {
|
||||
font-style: italic;
|
||||
color: black !important;
|
||||
/* color: #02a8b5 !important; */
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
/* .form-group {
|
||||
margin-bottom: -0.2rem !important;
|
||||
}
|
||||
.form-row{
|
||||
width: 84%;
|
||||
} */
|
||||
</style>
|
||||
|
||||
<style>
|
||||
.select2-container--default .select2-selection--single {
|
||||
height: 37px !important;
|
||||
}
|
||||
|
||||
.select2-container--default .select2-selection--single .select2-selection__rendered {
|
||||
line-height: 35px !important;
|
||||
}
|
||||
|
||||
.select2-container--default .select2-selection--single .select2-selection__arrow {
|
||||
top: 7px !important;
|
||||
}
|
||||
</style>
|
||||
|
||||
<style>
|
||||
.toast-body {
|
||||
padding: .75rem;
|
||||
background: aliceblue !important;
|
||||
}
|
||||
|
||||
#messages-list li {
|
||||
margin-top: 0;
|
||||
margin-bottom: -25px;
|
||||
/* Adjust this value to reduce the space */
|
||||
}
|
||||
|
||||
.toast-footer {
|
||||
text-align: right;
|
||||
color: #000;
|
||||
border-top: 1px solid aliceblue;
|
||||
margin-top: 11px;
|
||||
margin-bottom: -6px;
|
||||
}
|
||||
|
||||
|
||||
.right-bar {
|
||||
width: 300px;
|
||||
/* Adjust as needed */
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.fixed-header {
|
||||
position: relative;
|
||||
top: 0;
|
||||
z-index: 1000;
|
||||
background-color: #f8f9fa !important;
|
||||
}
|
||||
|
||||
.scrollable-content {
|
||||
max-height: 42vh;
|
||||
overflow-y: auto;
|
||||
padding-top: 0px;
|
||||
}
|
||||
|
||||
/* Additional styles to enhance appearance */
|
||||
.header-title {
|
||||
position: relative;
|
||||
bottom: 5px;
|
||||
left: 60px;
|
||||
}
|
||||
|
||||
#app_content_management:hover {
|
||||
color: red;
|
||||
}
|
||||
</style>
|
||||
|
||||
<script>
|
||||
$(window).on('load', function() {
|
||||
setTimeout(function() {
|
||||
$('.loader').fadeOut();
|
||||
$('.loader-mask').fadeOut('slow');
|
||||
}, 1000);
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
</head>
|
||||
|
||||
<body class="loading" data-layout-mode="" data-layout='{"mode": "light", "width": "fluid", "menuPosition": "fixed", "sidebar": { "color": "light", "size": "condensed", "showuser": false}, "topbar": {"color": "dark"}, "showRightSidebarOnPageLoad": false}'></body>
|
||||
|
||||
<!-- Preloader -->
|
||||
<div class="loader-mask">
|
||||
<div class="loader">
|
||||
<img src="<?= base_url() . "public" ?>/assets/images/nhance-loader-fast.gif" height="40" width="40" alt="Loading...">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- <img src="<?= base_url() . "public" ?>/assets/images/nhance-loader-fast.gif" height="40" width="40" alt="Loading..."> -->
|
||||
<!-- Begin page -->
|
||||
<div id="wrapper">
|
||||
|
||||
<!-- Topbar Start -->
|
||||
<div class="navbar-custom">
|
||||
<div class="container-fluid">
|
||||
<ul class="list-unstyled topnav-menu float-right mb-0">
|
||||
|
||||
<li class="d-none d-lg-block">
|
||||
<form class="app-search">
|
||||
<div class="app-search-box dropdown">
|
||||
<div class="input-group">
|
||||
<input type="search" class="form-control" placeholder="Search..." id="top-search">
|
||||
<div class="input-group-append">
|
||||
<button class="btn" type="submit">
|
||||
<i class="fe-search"></i>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- <div class="dropdown-menu dropdown-lg" id="search-dropdown">
|
||||
<div class="dropdown-header noti-title">
|
||||
<h5 class="text-overflow mb-2">Found <span class="text-danger">09</span> results</h5>
|
||||
</div>
|
||||
|
||||
<a href="javascript:void(0);" class="dropdown-item notify-item">
|
||||
<i class="fe-home mr-1"></i>
|
||||
<span>Analytics Report</span>
|
||||
</a>
|
||||
|
||||
<a href="javascript:void(0);" class="dropdown-item notify-item">
|
||||
<i class="fe-aperture mr-1"></i>
|
||||
<span>How can I help you?</span>
|
||||
</a>
|
||||
|
||||
<a href="javascript:void(0);" class="dropdown-item notify-item">
|
||||
<i class="fe-settings mr-1"></i>
|
||||
<span>User profile settings</span>
|
||||
</a>
|
||||
|
||||
<div class="dropdown-header noti-title">
|
||||
<h6 class="text-overflow mb-2 text-uppercase">Users</h6>
|
||||
</div>
|
||||
|
||||
<div class="notification-list">
|
||||
<a href="javascript:void(0);" class="dropdown-item notify-item">
|
||||
<div class="media">
|
||||
<img class="d-flex mr-2 rounded-circle" src="<?= base_url() . "public"; ?>/assets/images/users/avatar-2.jpg" alt="Generic placeholder image" height="32">
|
||||
<div class="media-body">
|
||||
<h5 class="m-0 font-14">Erwin E. Brown</h5>
|
||||
<span class="font-12 mb-0">UI Designer</span>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
|
||||
<a href="javascript:void(0);" class="dropdown-item notify-item">
|
||||
<div class="media">
|
||||
<img class="d-flex mr-2 rounded-circle" src="<?= base_url() . "public"; ?>/assets/images/users/avatar-5.jpg" alt="Generic placeholder image" height="32">
|
||||
<div class="media-body">
|
||||
<h5 class="m-0 font-14">Jacob Deo</h5>
|
||||
<span class="font-12 mb-0">Developer</span>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
</div> -->
|
||||
</div>
|
||||
</form>
|
||||
</li>
|
||||
|
||||
<li class="dropdown notification-list topbar-dropdown">
|
||||
<a class="nav-link dropdown-toggle right-bar-toggle waves-effect waves-light">
|
||||
<i class="fe-bell noti-icon"></i>
|
||||
<span class="badge badge-danger rounded-circle noti-icon-badge" id="notification_count">0</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li class="dropdown notification-list topbar-dropdown">
|
||||
<a class="nav-link dropdown-toggle nav-user mr-0 waves-effect waves-light" data-toggle="dropdown" href="#" role="button" aria-haspopup="false" aria-expanded="false">
|
||||
<img src="<?php echo (get_userProfile() != null && !empty(get_userProfile())) ? get_userProfile() : base_url() . 'public/assets/images/avatar_2x.png'; ?>" alt="user-image" class="rounded-circle">
|
||||
<span class="pro-user-name ml-1" style="font-size: 16px;">
|
||||
<?= (isset(get_session_userdata()->first_name) ? get_session_userdata()->first_name : 'NOT SET') ?>
|
||||
<!-- <i class="mdi mdi-chevron-down"></i> -->
|
||||
</span>
|
||||
</a>
|
||||
<!--<div class="dropdown-menu dropdown-menu-right profile-dropdown ">
|
||||
<div class="dropdown-header noti-title">
|
||||
<h6 class="text-overflow m-0">Welcome !</h6>
|
||||
</div>
|
||||
|
||||
<a href="javascript:void(0);" class="dropdown-item notify-item">
|
||||
<i class="ri-account-circle-line"></i>
|
||||
<span>My Account</span>
|
||||
</a>
|
||||
|
||||
<a href="javascript:void(0);" class="dropdown-item notify-item">
|
||||
<i class="ri-settings-3-line"></i>
|
||||
<span>Settings</span>
|
||||
</a>
|
||||
|
||||
<a href="javascript:void(0);" class="dropdown-item notify-item">
|
||||
<i class="ri-wallet-line"></i>
|
||||
<span>My Wallet <span class="badge badge-success float-right">3</span> </span>
|
||||
</a>
|
||||
|
||||
<a href="javascript:void(0);" class="dropdown-item notify-item">
|
||||
<i class="ri-lock-line"></i>
|
||||
<span>Lock Screen</span>
|
||||
</a>
|
||||
|
||||
|
||||
<a href="<?= base_url('/logout'); ?>" class="dropdown-item notify-item">
|
||||
<i class="ri-logout-box-line"></i>
|
||||
<span>Logout</span>
|
||||
</a>
|
||||
|
||||
</div>-->
|
||||
</li>
|
||||
|
||||
<!-- <li class="dropdown notification-list">
|
||||
<a href="javascript:void(0);" class="nav-link right-bar-toggle waves-effect waves-light">
|
||||
<i class="fe-settings noti-icon"></i>
|
||||
</a>
|
||||
</li> -->
|
||||
|
||||
<li class="dropdown notification-list">
|
||||
<a href="<?= base_url('/logout'); ?>" class="nav-link waves-effect waves-light">
|
||||
<i class="ri-logout-box-r-line" style="font-size: 25px;"></i>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
<!-- LOGO -->
|
||||
<div class="logo-box">
|
||||
<a href="https://localhost/nhance/dashboard/view" class="logo logo-dark text-center">
|
||||
<span class="logo-sm">
|
||||
<img src="<?= base_url() . "public"; ?>/assets/images/Nhance_Favi.svg" alt="" height="24">
|
||||
<!-- <span class="logo-lg-text-light">NHANCE</span> -->
|
||||
</span>
|
||||
<span class="logo-lg">
|
||||
<img src="<?= base_url() . "public"; ?>/assets/images/Nhance_Favi.svg" alt="" height="20">
|
||||
<!-- <span class="logo-lg-text-light">M</span> -->
|
||||
</span>
|
||||
</a>
|
||||
|
||||
<a href="https://localhost/nhance/dashboard/view" class="logo logo-light text-center">
|
||||
<span class="logo-sm">
|
||||
<img src="<?= base_url() . "public"; ?>/assets/images/Nhance_Favi.svg" alt="" height="24">
|
||||
</span>
|
||||
<!-- <span class="logo-lg">
|
||||
<img src="<?= base_url() . "public"; ?>/assets/images/logo-light.png" alt="" height="20">
|
||||
</span> -->
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<ul class="list-unstyled topnav-menu topnav-menu-left m-0">
|
||||
<li>
|
||||
<button class="button-menu-mobile waves-effect waves-light">
|
||||
<i class="fe-menu"></i>
|
||||
</button>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<!-- Mobile menu toggle (Horizontal Layout)-->
|
||||
<a class="navbar-toggle nav-link" data-toggle="collapse" data-target="#topnav-menu-content">
|
||||
<div class="lines">
|
||||
<span></span>
|
||||
<span></span>
|
||||
<span></span>
|
||||
</div>
|
||||
</a>
|
||||
<!-- End mobile menu toggle-->
|
||||
</li>
|
||||
|
||||
|
||||
</ul>
|
||||
<div class="clearfix"></div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- end Topbar -->
|
||||
|
||||
<!-- ========== Left Sidebar Start ========== -->
|
||||
<div class="left-side-menu">
|
||||
|
||||
<!-- LOGO -->
|
||||
<div class="logo-box">
|
||||
<a href="<?= base_url('/dashboard/view') ?>" class="logo logo-dark text-center">
|
||||
<span class="logo-sm">
|
||||
<img src="<?= base_url() . "public"; ?>/assets/images/logo-sm-dark.png" alt="" height="24">
|
||||
<!-- <span class="logo-lg-text-light">nHance</span> -->
|
||||
</span>
|
||||
<span class="logo-lg">
|
||||
<img src="<?= base_url() . "public"; ?>/assets/images/logo-dark.png" alt="" height="20">
|
||||
<!-- <span class="logo-lg-text-light">N</span> -->
|
||||
</span>
|
||||
</a>
|
||||
|
||||
<a href="<?= base_url('/dashboard/view') ?>" class="logo logo-light text-center">
|
||||
<span class="logo-sm">
|
||||
<img src="<?= base_url() . "public"; ?>/assets/images/nhance_white_logo.svg" alt="" width="130" height="30">
|
||||
</span>
|
||||
<!-- <span class="logo-lg">
|
||||
<img src="<?= base_url() . "public"; ?>./assets/images/logo-light.png" alt="" height="20">
|
||||
</span> -->
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div class="h-100" data-simplebar>
|
||||
<!--- Sidemenu -->
|
||||
<div id="sidebar-menu">
|
||||
<ul id="side-menu">
|
||||
|
||||
<li>
|
||||
<a href="<?= base_url('/dashboard/view') ?>">
|
||||
<i class="ri-dashboard-line"></i>
|
||||
<span> Dashboard </span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<!-- client -->
|
||||
<?php if (in_array(get_role_id(), [1,2,3,5])) { ?>
|
||||
<li>
|
||||
<a href="<?= base_url('/client/list') ?>">
|
||||
<i class="mdi mdi-domain"></i>
|
||||
<span> Clients </span>
|
||||
</a>
|
||||
</li>
|
||||
<?php } ?>
|
||||
|
||||
<!-- Enrollment process -->
|
||||
<?php if (in_array(get_role_id(), [1,2,3,5]) || in_array(ENROLLMENT_TEAM_ID, user_team())) { ?>
|
||||
<li>
|
||||
<a href="#sidebarDashboards" data-toggle="collapse" class="waves-effect">
|
||||
<i class="fas fa-user-tie"></i>
|
||||
<span class="badge badge-success badge-pill float-right">2</span>
|
||||
<span> Action on Policies </span>
|
||||
</a>
|
||||
<div class="collapse" id="sidebarDashboards">
|
||||
<ul class="nav-second-level">
|
||||
|
||||
<li>
|
||||
<a href="<?= base_url('/employee/upload') ?>">View Inception</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="<?= base_url('/employee/list') ?>">View Members</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="<?= base_url('/employee/endorsement-list') ?>">View Endorsement</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="<?= base_url('/employee/enrollment-list') ?>">View Enrolment</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="<?= base_url('/employee/test_members_list') ?>">Test Members List</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</li>
|
||||
<?php } ?>
|
||||
|
||||
<!-- Masters -->
|
||||
<?php if (get_role_id() == 1 || get_role_id() == 5) { ?>
|
||||
|
||||
<li>
|
||||
<a href="#sidebarDashboards" data-toggle="collapse" class="waves-effect">
|
||||
<i class="ri-database-2-line"></i>
|
||||
<span class="badge badge-success badge-pill float-right">2</span>
|
||||
<span> Masters </span>
|
||||
</a>
|
||||
<div class="collapse" id="sidebarDashboards">
|
||||
<ul class="nav-second-level">
|
||||
<li>
|
||||
<a href="<?= base_url('/master/insurer/list') ?>">Insurer</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="<?= base_url('/master/tpa/list') ?>">TPA</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="<?= base_url('/master/kyc/list') ?>">KYC</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="<?= base_url('/master/policy/list') ?>">Policy</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="<?= base_url('/master/cash_deposite/list') ?>">CD Master</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="<?= base_url('/master/vehicle/list') ?>">Vehicle Master</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="<?= base_url('/user/list') ?>"> Users </a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</li>
|
||||
|
||||
<?php } ?>
|
||||
|
||||
<!-- <li>
|
||||
<?php
|
||||
$sessionData = get_session_userdata();
|
||||
$currentUrl = base_url();
|
||||
$parsedUrl = parse_url($currentUrl);
|
||||
$baseUrl = $parsedUrl['scheme'] . '://' . $parsedUrl['host'] . '/';
|
||||
$hashedEmail = hash('sha256', $sessionData->email);
|
||||
$redirectUrl = getenv('helpdeskURL') . '/staff/login?' . http_build_query(['token' => $hashedEmail]);
|
||||
?>
|
||||
<a href="<?php echo $redirectUrl; ?>" target="_blank">
|
||||
<i class="mdi mdi-lifebuoy"></i>
|
||||
<span> Tickets </span>
|
||||
</a>
|
||||
</li> -->
|
||||
|
||||
<!-- Claims -->
|
||||
<?php if (in_array(get_role_id(), [1,2,3,5]) || in_array(CLAIMS_TEAM_ID, user_team())) { ?>
|
||||
<li>
|
||||
<a href="#sidebarDashboardsTicket" data-toggle="collapse" class="waves-effect">
|
||||
<i class="mdi mdi-lifebuoy"></i>
|
||||
<span class="badge badge-success badge-pill float-right">2</span>
|
||||
<span> Claims </span>
|
||||
</a>
|
||||
<div class="collapse" id="sidebarDashboardsTicket">
|
||||
<ul class="nav-second-level">
|
||||
<li>
|
||||
<a href="#" onclick="openTicketTypeAskModal()">New claim</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="<?= base_url('/ticket/list') ?>">Claim List</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="<?= base_url('/ticket/mail_template') ?>">Mail Template</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="<?= base_url('/ticket/ticket_reports') ?>">Claim Reports</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="<?= base_url('/ticket/feedback-list') ?>">Claim Feedback List</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</li>
|
||||
<?php } ?>
|
||||
|
||||
<!-- leads -->
|
||||
<?php if (in_array(get_role_id(), [1,2,3,5]) || in_array(BUSINESS_SUPPORT_TEAM_ID, user_team()) || in_array(SALES_TEAM_ID, user_team())) { ?>
|
||||
<li>
|
||||
<a href="<?= base_url('/leads/list') ?>">
|
||||
<i class="mdi mdi-chart-bar"></i>
|
||||
<span> Leads </span>
|
||||
</a>
|
||||
</li>
|
||||
<?php } ?>
|
||||
|
||||
<!-- BDS -->
|
||||
<?php if ((get_role_id() == 1 || get_role_id() == 5) || (in_array(MANAGEMENT_TEAM_ID, user_team()) || in_array(FINANCE_TEAM_ID, user_team()) || in_array(BUSINESS_TEAM_ID, user_team()) || in_array(POS_TEAM_ID, user_team()))) { ?>
|
||||
<li>
|
||||
<a href="#policyTransactions" data-toggle="collapse" class="waves-effect">
|
||||
<i class="mdi mdi-format-list-bulleted"></i>
|
||||
<span class="badge badge-success badge-pill float-right">2</span>
|
||||
<span> Policy Transactions </span>
|
||||
</a>
|
||||
<div class="collapse" id="policyTransactions">
|
||||
<ul class="nav-second-level">
|
||||
<li>
|
||||
<a href="#policyTransactionsSub" data-toggle="collapse" class="waves-effect">
|
||||
<i class="mdi mdi-format-list-bulleted"></i>
|
||||
<span>Policy Transactions</span>
|
||||
</a>
|
||||
<div class="collapse" id="policyTransactionsSub">
|
||||
<ul>
|
||||
|
||||
<?php if (in_array(get_role_id(), [1,5]) || (in_array(MANAGEMENT_TEAM_ID, user_team()) || in_array(FINANCE_TEAM_ID, user_team()) || in_array(BUSINESS_TEAM_ID, user_team()) || in_array(POS_TEAM_ID, user_team()))) { ?>
|
||||
<li>
|
||||
<a href="<?= base_url('/policy_tranction/inception/list') ?>">Policy</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="<?= base_url('/policy_tranction/endorsement/list') ?>">Endorsement</a>
|
||||
</li>
|
||||
<?php } ?>
|
||||
|
||||
<?php if (in_array(get_role_id(), [1,5]) || in_array(FINANCE_TEAM_ID, user_team()) || in_array(MANAGEMENT_TEAM_ID, user_team())) { ?>
|
||||
<li>
|
||||
<a href="<?= base_url('/policy_tranction/statement/list') ?>">Statement Upload</a>
|
||||
</li>
|
||||
<?php } ?>
|
||||
</ul>
|
||||
</div>
|
||||
</li>
|
||||
|
||||
<?php if ((get_role_id() == 1 || get_role_id() == 5) || (in_array(MANAGEMENT_TEAM_ID, user_team()) || in_array(FINANCE_TEAM_ID, user_team()) || in_array(BUSINESS_TEAM_ID, user_team()) || in_array(POS_TEAM_ID, user_team()))) { ?>
|
||||
|
||||
<?php if (in_array(get_role_id(), [1,5]) || in_array(MANAGEMENT_TEAM_ID, user_team()) || in_array(POS_TEAM_ID, user_team()) ) { ?>
|
||||
<li>
|
||||
<a href="#policyReports" data-toggle="collapse" class="waves-effect">
|
||||
<i class="ri-file-chart-fill"></i>
|
||||
<span> Policy Reports </span>
|
||||
</a>
|
||||
<div class="collapse" id="policyReports">
|
||||
<ul class="nav-third-level">
|
||||
<li>
|
||||
<a href="<?= base_url('/policy_tranction/report/list') ?>">BDS</a>
|
||||
</li>
|
||||
<?php if (in_array(get_role_id(), [1,5]) || in_array(MANAGEMENT_TEAM_ID, user_team())) { ?>
|
||||
<li>
|
||||
<a href="<?= base_url('/policy_tranction/report/report-varience-list') ?>">Variance</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="<?= base_url('/policy_tranction/report/report-outstanding-list') ?>">Outstanding</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="<?= base_url('/bdsReport/irba_report') ?>">IRDA Reports</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="<?= base_url('/bdsReport/renewal_report') ?>">Renewal Reports</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="<?= base_url('/bdsReport/getTATReport') ?>">TAT Band Reports</a>
|
||||
</li>
|
||||
<?php } ?>
|
||||
</ul>
|
||||
</div>
|
||||
</li>
|
||||
<?php } ?>
|
||||
<li>
|
||||
<a href="#policy_tat_report_type" data-toggle="collapse" class="waves-effect">
|
||||
<i class="ri-file-chart-fill"></i>
|
||||
<span> Policy TAT Reports </span>
|
||||
</a>
|
||||
<div class="collapse" id="policy_tat_report_type">
|
||||
<ul class="nav-third-level">
|
||||
<li>
|
||||
<a href="<?= base_url('/bdsReport/getMultiReport/1') ?>">TAT Band Wise</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="<?= base_url('/bdsReport/getMultiReport/2') ?>">ACM Status Wise</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="<?= base_url('/bdsReport/getMultiReport/3') ?>">ACM TAT Wise</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</li>
|
||||
|
||||
<?php if ((get_role_id() == 1 || get_role_id() == 5) || (in_array(MANAGEMENT_TEAM_ID, user_team()) || in_array(FINANCE_TEAM_ID, user_team()) || in_array(BUSINESS_TEAM_ID, user_team()) )) { ?>
|
||||
<li>
|
||||
<a href="#policyPendingActions" data-toggle="collapse" class="waves-effect">
|
||||
<i class="mdi mdi-timer-sand"></i>
|
||||
<span> Policy Pending Actions </span>
|
||||
</a>
|
||||
<div class="collapse" id="policyPendingActions">
|
||||
<ul class="nav-third-level">
|
||||
<?php if (in_array(get_role_id(), [1,5]) || in_array(MANAGEMENT_TEAM_ID, user_team()) || in_array(FINANCE_TEAM_ID, user_team())) { ?>
|
||||
<li>
|
||||
<a href="<?= base_url('/policy_tranction/report/report-finance-list') ?>">Finance Team</a>
|
||||
</li>
|
||||
<?php } ?>
|
||||
|
||||
<?php if (in_array(get_role_id(), [1,5]) || in_array(MANAGEMENT_TEAM_ID, user_team()) || in_array(BUSINESS_TEAM_ID, user_team())) { ?>
|
||||
<li>
|
||||
<a href="<?= base_url('/policy_tranction/report/report-business-list') ?>">Business Team</a>
|
||||
</li>
|
||||
<?php } ?>
|
||||
</ul>
|
||||
</div>
|
||||
</li>
|
||||
<?php } ?>
|
||||
|
||||
<?php if ((get_role_id() == 1 || get_role_id() == 5) || (in_array(MANAGEMENT_TEAM_ID, user_team()) || in_array(FINANCE_TEAM_ID, user_team()) || in_array(BUSINESS_TEAM_ID, user_team()) )) { ?>
|
||||
<li>
|
||||
<a href="#policyMasters" data-toggle="collapse" class="waves-effect">
|
||||
<i class="ri-database-2-line"></i>
|
||||
<span> Masters </span>
|
||||
</a>
|
||||
<div class="collapse" id="policyMasters">
|
||||
<ul class="nav-third-level">
|
||||
<li>
|
||||
<a href="<?= base_url('/master/cash_deposite/list') ?>">CD Master</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="<?= base_url('/master/vehicle/list') ?>">Vehicle Master</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</li>
|
||||
<?php } ?>
|
||||
|
||||
<?php if ((get_role_id() == 1 || get_role_id() == 5) || (in_array(MANAGEMENT_TEAM_ID, user_team()) || in_array(FINANCE_TEAM_ID, user_team()) || in_array(BUSINESS_TEAM_ID, user_team()))) { ?>
|
||||
<li>
|
||||
<a href="<?= base_url('/dmsSearch') ?>">
|
||||
<i class="ri-book-open-line"></i>
|
||||
<span> Documents</span>
|
||||
</a>
|
||||
</li>
|
||||
<?php } ?>
|
||||
|
||||
<?php } ?>
|
||||
</ul>
|
||||
</div>
|
||||
</li>
|
||||
<?php } ?>
|
||||
|
||||
<!-- Ad -->
|
||||
<?php if (in_array(get_role_id(), [1,2,3,5])) { ?>
|
||||
<li>
|
||||
<a id="app_content_management" href="#sidebarDashboardsmenu" data-toggle="collapse" class="waves-effect" style="color: grey;">
|
||||
<i class="fa fa-edit" aria-hidden="true"></i>
|
||||
<span class="badge badge-success badge-pill float-right">2</span>
|
||||
<span>App Content Mgmt</span>
|
||||
</a>
|
||||
<div class="collapse" id="sidebarDashboardsmenu">
|
||||
<ul class="nav-second-level">
|
||||
<li>
|
||||
<a href="<?= base_url('/add_image_index') ?>"> Advertisement Images </a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="<?= base_url('/frontend_content') ?>">Front-end Content</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</li>
|
||||
<?php } ?>
|
||||
<li>
|
||||
<a id="user_manual" href="<?= base_url("autobookstackLogin") ?>" class="waves-effect" target="_blank" rel="noopener noreferrer">
|
||||
<i class="fa fa-info-circle" aria-hidden="true"></i>
|
||||
<span>User Manual</span>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<!-- End Sidebar -->
|
||||
</div>
|
||||
<!-- Sidebar -left -->
|
||||
|
||||
</div>
|
||||
<!-- Left Sidebar End -->
|
||||
|
||||
<!-- ============================================================== -->
|
||||
<!-- Start Page Content here -->
|
||||
<!-- ============================================================== -->
|
||||
|
||||
<div class="content-page">
|
||||
<div class="content">
|
||||
|
||||
<!-- Start Content-->
|
||||
<div class="container-fluid"></div>
|
||||
@ -11,7 +11,7 @@
|
||||
<h5 class="m-1">
|
||||
<div class="row">
|
||||
<div class="col-md-6" style="position: relative;left: 17px;">
|
||||
<h4 style="text-align: left;">Lead Filter</h4>
|
||||
<h4 style="text-align: left; margin-left:30px;">Lead Filter</h4>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<a style="text-align: right;" id="toggleIcon" class="text-dark float-right"
|
||||
|
||||
@ -1,8 +1,4 @@
|
||||
<style>
|
||||
body {
|
||||
margin-top: 20px;
|
||||
background: #FAFAFA;
|
||||
}
|
||||
|
||||
.order-card {
|
||||
color: #fff;
|
||||
@ -123,40 +119,76 @@
|
||||
margin-top: 0;
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
|
||||
.leadStatusTitle_1{margin-left:20px;}
|
||||
.leadStatusTitle_2{margin-left:20px;}
|
||||
|
||||
|
||||
.inside-tab-content-div{
|
||||
display:flex;
|
||||
justify-content:flex-start !important;
|
||||
flex-flow: row wrap;
|
||||
|
||||
}
|
||||
|
||||
.dash-card{
|
||||
background-color:#F4FBFB !important;
|
||||
border-radius:25px;
|
||||
border:2px solid #09B9BF;
|
||||
box-shadow: 0px 1px 5px rgba(0, 0, 0, 0.1), 0px 4px 8px rgba(0, 0, 0, 0.2);
|
||||
min-width: 250px;
|
||||
}
|
||||
|
||||
#leads-dash-tab{
|
||||
padding-right: 20px;
|
||||
}
|
||||
|
||||
.span-color{
|
||||
color:#09B9BF !important;
|
||||
}
|
||||
|
||||
.leadTypeTile{
|
||||
margin-left: 20px;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</style>
|
||||
<?php
|
||||
$isActive = get_role_id() == STAFF_ROLE_ID && in_array(ENROLLMENT_TEAM_ID, user_team()) ? 'show active' : '';
|
||||
?>
|
||||
<div class="tab-pane fade <?= $isActive ?>" 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,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><?= isset($lead_data) ? $lead_data['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 class="col inside-tab-content-div">
|
||||
<div class="leadTypeTile">
|
||||
<div class="card dash-card" onclick="hide_and_show_tile(1,1)">
|
||||
<div class="card-block">
|
||||
<h4 class="mb-3">Leads</h4>
|
||||
<h2 class="span-color"><span><?= isset($lead_data) ? $lead_data['total'] : 0 ?></span>
|
||||
</h2>
|
||||
<h6><span class="text-danger">Lead Tracker</span></h6>
|
||||
</div>
|
||||
</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,2)">
|
||||
<div class="card-block">
|
||||
<h6 class="m-b-20 font-15">BDS Renewals</h6>
|
||||
<h2 class="text-right"><i
|
||||
class="mdi mdi-playlist-check f-left"></i><span><?= isset($bds_renewal) ? $bds_renewal['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 class="leadTypeTile">
|
||||
<div class="card dash-card" onclick="hide_and_show_tile(1,2)">
|
||||
<div class="card-block">
|
||||
<h4 class="mb-3">BDS Renewals</h4>
|
||||
<h2 class="span-color">
|
||||
<span><?= isset($bds_renewal) ? $bds_renewal['total'] : 0 ?></span>
|
||||
</h2>
|
||||
<h6><span class="text-danger">Renewal Tracker</span></h6>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="status_tile" style="padding-bottom: 10px;padding-left: 17px; ">
|
||||
<div class="status_tile" style="padding-bottom: 10px;padding-left: 17px; margin-left:10px;">
|
||||
<a href="#" onclick="hide_and_show_tile(2)"><i class="fas fa-arrow-left"></i> Back to Overview</a>
|
||||
</div>
|
||||
<div class="status_tile" style="padding-left: 30px;">
|
||||
@ -164,88 +196,102 @@ $isActive = get_role_id() == STAFF_ROLE_ID && in_array(ENROLLMENT_TEAM_ID, user_
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<?php
|
||||
<div class="col inside-tab-content-div">
|
||||
<?php
|
||||
$colorSetCount = count($colorShades); // Number of color sets
|
||||
$shadeCount = count($colorShades[0]); // Number of shades per set
|
||||
$index = 0;
|
||||
foreach ($lead_data as $key => $value) : ?>
|
||||
<?php
|
||||
if ($key == "total" || $key == "won" || substr($key, -4) === "_ids") {
|
||||
continue;
|
||||
} // Skip the total key
|
||||
?>
|
||||
<?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
|
||||
|
||||
$colorSetCount = count($colorShades); // Number of color sets
|
||||
$shadeCount = count($colorShades[0]); // Number of shades per set
|
||||
$index = 0;
|
||||
foreach ($lead_data as $key => $value) : ?>
|
||||
<?php
|
||||
if ($key == "total" || $key == "won" || substr($key, -4) === "_ids") {
|
||||
continue;
|
||||
} // Skip the total key
|
||||
?>
|
||||
<?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
|
||||
$formattedStatus = strlen($key) < 5 ? strtoupper($key) : ucwords(str_replace('_', ' ', $key));
|
||||
$truncatedStatus = strlen($formattedStatus) > 20 ? substr($formattedStatus, 0, 15) . '...' : $formattedStatus;
|
||||
$showTooltip = strlen($formattedStatus) > 20;
|
||||
?>
|
||||
<div class="leadStatusTitle_1" style="display: none;">
|
||||
<div class="card dash-card"
|
||||
onclick="linkRedirectForLeads('<?= esc(strtolower(str_replace(' ', '_', $key)), 'js') ?>','<?= $lead_data[$key . '_ids'] ?? '' ?>')">
|
||||
<div class="card-block">
|
||||
<h5 class="text-right">
|
||||
<span class="f-left"
|
||||
<?= $showTooltip ? 'data-toggle="tooltip" title="' . htmlspecialchars($formattedStatus, ENT_QUOTES, 'UTF-8') . '"' : '' ?>>
|
||||
<?= $truncatedStatus ?>
|
||||
</span>
|
||||
<span><?= $value ?></span>
|
||||
</h5>
|
||||
|
||||
</div>
|
||||
|
||||
// Get the background color for the current tile
|
||||
$bgColor = $colorShades[$colorSetIndex][$shadeIndex];
|
||||
?>
|
||||
<?php
|
||||
$formattedStatus = strlen($key) < 5 ? strtoupper($key) : ucwords(str_replace('_', ' ', $key));
|
||||
$truncatedStatus = strlen($formattedStatus) > 20 ? substr($formattedStatus, 0, 15) . '...' : $formattedStatus;
|
||||
$showTooltip = strlen($formattedStatus) > 20;
|
||||
?>
|
||||
<div class="col-md-2 col-xl-1 leadStatusTitle_1" style="display: none;">
|
||||
<div class="card order-card" style="background: <?= $bgColor ?>;"
|
||||
onclick="linkRedirectForLeads('<?= esc(strtolower(str_replace(' ', '_', $key)), 'js') ?>','<?= $lead_data[$key . '_ids'] ?? '' ?>')">
|
||||
<h2 class="text-center"><span><?= $value ?></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>
|
||||
</div>
|
||||
|
||||
<?php endforeach ?>
|
||||
<?php endforeach ?>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="row">
|
||||
|
||||
<?php
|
||||
$colorSetCount = count($colorShades); // Number of color sets
|
||||
$shadeCount = count($colorShades[0]); // Number of shades per set
|
||||
$index = 0;
|
||||
|
||||
foreach ($bds_renewal as $key => $value) : ?>
|
||||
<div class="col inside-tab-content-div">
|
||||
<?php
|
||||
if ($key == "total" || substr($key, -4) === "_ids") {
|
||||
continue;
|
||||
} // Skip the total key
|
||||
?>
|
||||
<?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
|
||||
$colorSetCount = count($colorShades); // Number of color sets
|
||||
$shadeCount = count($colorShades[0]); // Number of shades per set
|
||||
$index = 0;
|
||||
|
||||
// Get the background color for the current tile
|
||||
$bgColor = $colorShades[$colorSetIndex][$shadeIndex];
|
||||
?>
|
||||
<?php
|
||||
$formattedStatus = strlen($key) < 5 ? strtoupper($key) : ucwords(str_replace('_', ' ', $key));
|
||||
$truncatedStatus = strlen($formattedStatus) > 20 ? substr($formattedStatus, 0, 15) . '...' : $formattedStatus;
|
||||
$showTooltip = strlen($formattedStatus) > 20;
|
||||
?>
|
||||
<div class="col-md-2 col-xl-1 leadStatusTitle_2" style="display: none;">
|
||||
foreach ($bds_renewal as $key => $value) : ?>
|
||||
<?php
|
||||
$policyIds = isset($bds_renewal[$key . '_ids'])
|
||||
? (is_array($bds_renewal[$key . '_ids'])
|
||||
? implode('_', $bds_renewal[$key . '_ids'])
|
||||
: str_replace(' ', '_', $bds_renewal[$key . '_ids']))
|
||||
: '';
|
||||
if ($key == "total" || substr($key, -4) === "_ids") {
|
||||
continue;
|
||||
} // Skip the total key
|
||||
?>
|
||||
<div class="card order-card" style="background: <?= $bgColor ?>;"
|
||||
onclick="linkRedirectForPolicy('<?= $policyIds ?>')">
|
||||
<h2 class="text-center"><span><?= $value ?></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
|
||||
// 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
|
||||
|
||||
<?php endforeach ?>
|
||||
// Get the background color for the current tile
|
||||
$bgColor = $colorShades[$colorSetIndex][$shadeIndex];
|
||||
?>
|
||||
<?php
|
||||
$formattedStatus = strlen($key) < 5 ? strtoupper($key) : ucwords(str_replace('_', ' ', $key));
|
||||
$truncatedStatus = strlen($formattedStatus) > 20 ? substr($formattedStatus, 0, 15) . '...' : $formattedStatus;
|
||||
$showTooltip = strlen($formattedStatus) > 20;
|
||||
?>
|
||||
<div class="leadStatusTitle_2" style="display: none;">
|
||||
<?php
|
||||
$policyIds = isset($bds_renewal[$key . '_ids'])
|
||||
? (is_array($bds_renewal[$key . '_ids'])
|
||||
? implode('_', $bds_renewal[$key . '_ids'])
|
||||
: str_replace(' ', '_', $bds_renewal[$key . '_ids']))
|
||||
: '';
|
||||
?>
|
||||
<div class="card dash-card"
|
||||
onclick="linkRedirectForPolicy('<?= $policyIds ?>')">
|
||||
<div class="card-block">
|
||||
<h5 class="text-right">
|
||||
<span class="f-left"
|
||||
<?= $showTooltip ? 'data-toggle="tooltip" title="' . htmlspecialchars($formattedStatus, ENT_QUOTES, 'UTF-8') . '"' : '' ?>>
|
||||
<?= $truncatedStatus ?>
|
||||
</span>
|
||||
<span class="span-color"><?= $value ?></span>
|
||||
</h5>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php endforeach ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
@ -256,6 +302,24 @@ $isActive = get_role_id() == STAFF_ROLE_ID && in_array(ENROLLMENT_TEAM_ID, user_
|
||||
|
||||
function hide_and_show_tile(type, leadType = null) {
|
||||
|
||||
|
||||
let dashboardHistoryString = localStorage.getItem('dashboardHistory');
|
||||
|
||||
|
||||
if (dashboardHistoryString){
|
||||
|
||||
let dashboardHistory = JSON.parse(dashboardHistoryString);
|
||||
|
||||
dashboardHistory['tile_params'] = { majorType: type, minorType: leadType };
|
||||
dashboardHistory['function_name'] = 'hide_and_show_tile';
|
||||
|
||||
|
||||
localStorage.setItem('dashboardHistory', JSON.stringify(dashboardHistory));
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (type == 1) {
|
||||
|
||||
$('.leadTypeTile').hide();
|
||||
@ -311,7 +375,6 @@ $isActive = get_role_id() == STAFF_ROLE_ID && in_array(ENROLLMENT_TEAM_ID, user_
|
||||
const form = document.createElement('form');
|
||||
form.method = method;
|
||||
form.action = url;
|
||||
form.target = '_blank';
|
||||
|
||||
|
||||
for (const key in data) {
|
||||
|
||||
@ -8,8 +8,8 @@
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-3">
|
||||
<label for="total_lives_at_incept" class="total_title"> Total Lives at Inception <span class="text-danger">*</span></label>
|
||||
<input value="<?= isset($lead_edit_data['total_lives_at_incept']) ? $lead_edit_data['total_lives_at_incept'] : '' ?>" type="text" class="form-control" id="total_lives_at_incept" name="total_lives_at_incept[]" placeholder="Enter Lives" required>
|
||||
<label for="total_lives_at_incept" class="total_title"> Total Lives at Inception <span class="text-danger"></span></label>
|
||||
<input value="<?= isset($lead_edit_data['total_lives_at_incept']) ? $lead_edit_data['total_lives_at_incept'] : '' ?>" type="text" class="form-control" id="total_lives_at_incept" name="total_lives_at_incept[]" placeholder="Enter Lives" disabled>
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-3 renewalFields">
|
||||
|
||||
@ -10,7 +10,8 @@
|
||||
<div id="accordion" class="mb-3">
|
||||
<div class="card mb-1">
|
||||
<h5 class="m-1">
|
||||
<div class="row">
|
||||
<br>
|
||||
<div class="row ml-4">
|
||||
<div class="col-md-6">
|
||||
<h4 style="text-align: left;">Claim Filter</h4>
|
||||
</div>
|
||||
@ -125,7 +126,7 @@
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-12 text-right m-b-0" style="margin-bottom: -15px;">
|
||||
<a href="<?= base_url("/ticket/list"); ?>" class="btn btn-secondary"id="clear-filters">Clear</a>
|
||||
<a href="#" class="btn btn-secondary" id="clear-filters">Clear</a>
|
||||
<a class="btn btn-primary" id="get-emp-list" onclick="fetchTicketListData();">Submit</a>
|
||||
</div>
|
||||
|
||||
@ -204,11 +205,15 @@ function fetchTicketListData() {
|
||||
tpa_id: tpa_id,
|
||||
};
|
||||
|
||||
let filterData = requestData;
|
||||
localStorage.setItem('filterData', JSON.stringify(filterData));
|
||||
|
||||
console.log("requestData", requestData);
|
||||
|
||||
var url = '<?= base_url('/ticket/list') ?>';
|
||||
$('.loader').fadeIn();
|
||||
$('.loader-mask').fadeIn();
|
||||
|
||||
sendAjaxRequestForGlobal(url, 'POST', requestData, function(response) {
|
||||
|
||||
console.log('Filter Responce', response);
|
||||
@ -234,6 +239,88 @@ function fetchTicketListData() {
|
||||
$('.loader').fadeOut();
|
||||
$('.loader-mask').delay(350).fadeOut('slow');
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<script>
|
||||
$(document).ready(function(){
|
||||
let filterData = localStorage.getItem('filterData');
|
||||
|
||||
filterData = filterData ? JSON.parse(filterData) : null;
|
||||
|
||||
console.log('Filter Data', filterData);
|
||||
|
||||
if(filterData){
|
||||
|
||||
var url = '<?= base_url('/ticket/list') ?>';
|
||||
$('.loader').fadeIn();
|
||||
$('.loader-mask').fadeIn();
|
||||
|
||||
sendAjaxRequestForGlobal(url, 'POST', filterData, function(response) {
|
||||
|
||||
console.log('Filter Responce', response);
|
||||
|
||||
if (response.status == true) {
|
||||
$('#ticket_list_div').empty();
|
||||
$('#ticket_list_div').html(response.html);
|
||||
$('.loader').fadeOut();
|
||||
$('.loader-mask').delay(350).fadeOut('slow');
|
||||
|
||||
} else {
|
||||
$('.loader').fadeOut();
|
||||
$('.loader-mask').delay(350).fadeOut('slow');
|
||||
let message = response.message;
|
||||
toastr.error(message, 'ERROR');
|
||||
}
|
||||
|
||||
}, function(xhr, status, error) {
|
||||
console.error('Error fetching data:', error);
|
||||
console.error(xhr.responseText);
|
||||
toastr.error('An error occurred while fetching the data.', 'ERROR');
|
||||
|
||||
$('.loader').fadeOut();
|
||||
$('.loader-mask').delay(350).fadeOut('slow');
|
||||
});
|
||||
|
||||
$('#ticket_type').val(filterData.ticket_type_id);
|
||||
$('#pod_no').val(filterData.pod_no);
|
||||
$('#claim_no').val(filterData.claim_number);
|
||||
$('#emp_code').val(filterData.emp_code);
|
||||
$('#claim_status').val(filterData.claim_status_id);
|
||||
$('#emp_mobile_no').val(filterData.emp_mobile);
|
||||
$('#tpa_id').val(filterData.tpa_id);
|
||||
$('#client_id').val(filterData.client_id);
|
||||
$('#insurer_id').val(filterData.insurer_id);
|
||||
$('#tpa_id').val(filterData.tpa_id);
|
||||
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<script>
|
||||
$(document).on('click', '#clear-filters', function (e) {
|
||||
|
||||
e.preventDefault(); // Stops the browser from following the link
|
||||
|
||||
console.log('Clear Filters Area');
|
||||
|
||||
localStorage.removeItem('filterData');
|
||||
|
||||
$('#ticket_type').val('0');
|
||||
$('#pod_no').val('');
|
||||
$('#claim_no').val('');
|
||||
$('#emp_code').val('');
|
||||
$('#claim_status').val('0');
|
||||
$('#emp_mobile_no').val('');
|
||||
$('#tpa_id').val('0');
|
||||
$('#client_id').val('0');
|
||||
$('#insurer_id').val('0');
|
||||
|
||||
window.location.href = "<?= base_url("/ticket/list")?>";
|
||||
});
|
||||
|
||||
|
||||
</script>
|
||||
@ -1,97 +1,208 @@
|
||||
<br>
|
||||
<!-- <br>
|
||||
<p style="color:black;">
|
||||
<b>Policy Terms</b>
|
||||
</p>
|
||||
<br>
|
||||
|
||||
<?php
|
||||
// ✅ Format keys: underscores to spaces, each word capitalized
|
||||
function readable_key($key) {
|
||||
$key = str_replace('_', ' ', $key);
|
||||
return ucwords($key);
|
||||
}
|
||||
// // ✅ Format keys: underscores to spaces, each word capitalized
|
||||
// function readable_key($key) {
|
||||
// $key = str_replace('_', ' ', $key);
|
||||
// return ucwords($key);
|
||||
// }
|
||||
|
||||
// ✅ Format values: 0 = NO, 1 = YES, >1 = number as-is
|
||||
function format_value($value) {
|
||||
if (is_numeric($value)) {
|
||||
if ($value == 0) return 'No';
|
||||
if ($value == 1) return 'Yes';
|
||||
}
|
||||
return $value;
|
||||
}
|
||||
// // ✅ Format values: 0 = NO, 1 = YES, >1 = number as-is
|
||||
// function format_value($value) {
|
||||
// if (is_numeric($value)) {
|
||||
// if ($value == 0) return 'No';
|
||||
// if ($value == 1) return 'Yes';
|
||||
// }
|
||||
// return $value;
|
||||
// }
|
||||
|
||||
// ✅ Recursively render nested key–value pairs
|
||||
function nestedKeyValuePair($data) {
|
||||
$output = '';
|
||||
// // ✅ Recursively render nested key–value pairs
|
||||
// function nestedKeyValuePair($data) {
|
||||
// $output = '';
|
||||
|
||||
foreach ($data as $key => $value) {
|
||||
$label = readable_key($key);
|
||||
$output .= "<span style='color:black;'> : <b>$label</b>";
|
||||
// foreach ($data as $key => $value) {
|
||||
// $label = readable_key($key);
|
||||
// $output .= "<span style='color:black;'> : <b>$label</b>";
|
||||
|
||||
if (is_array($value)) {
|
||||
$output .= "<span style='margin-left: 10px;'>" . nestedKeyValuePair($value) . "</span>";
|
||||
} else {
|
||||
$formattedValue = format_value($value);
|
||||
$output .= " : " . htmlspecialchars($formattedValue) ;
|
||||
}
|
||||
// if (is_array($value)) {
|
||||
// $output .= "<span style='margin-left: 10px;'>" . nestedKeyValuePair($value) . "</span>";
|
||||
// } else {
|
||||
// $formattedValue = format_value($value);
|
||||
// $output .= " : " . htmlspecialchars($formattedValue) ;
|
||||
// }
|
||||
|
||||
$output .= "</span>";
|
||||
// $output .= "</span>";
|
||||
// }
|
||||
|
||||
// return $output;
|
||||
// }
|
||||
|
||||
// if (isset($policy_terms['policy_terms']) && is_array($policy_terms['policy_terms'])) {
|
||||
|
||||
// // ✅ Merge multiple_sum_insured with sum_insured
|
||||
// if (
|
||||
// isset($policy_terms['policy_terms']['multiple_sum_insured']) &&
|
||||
// is_array($policy_terms['policy_terms']['multiple_sum_insured'])
|
||||
// ) {
|
||||
// $sum_insured_values = implode(' , ', $policy_terms['policy_terms']['multiple_sum_insured']);
|
||||
// $original_sum = isset($policy_terms['policy_terms']['sum_insured'])
|
||||
// ? $policy_terms['policy_terms']['sum_insured']
|
||||
// : '';
|
||||
// $policy_terms['policy_terms']['sum_insured'] = $original_sum . " , " . $sum_insured_values;
|
||||
// unset($policy_terms['policy_terms']['multiple_sum_insured']);
|
||||
// }
|
||||
|
||||
// // ✅ Display each policy term
|
||||
// foreach ($policy_terms['policy_terms'] as $key => $value) {
|
||||
// if ($key === "age_ratio" || $key === "enrollment_display_key") {
|
||||
// continue; // Skip excluded keys
|
||||
// }
|
||||
|
||||
// // Normalize specific raw keys (if needed)
|
||||
// if ($key === 'waiverof30dayswaitingperiod') {
|
||||
// $key = 'Waiver_of_30_days_waiting_period';
|
||||
// }
|
||||
// if ($key === 'suminsuredenhancement') {
|
||||
// $key = 'sum_insured_enhancement';
|
||||
// }
|
||||
|
||||
// // Readable label
|
||||
// $label = readable_key($key);
|
||||
// $nesetedValues = "";
|
||||
// ?>
|
||||
// <div class="row">
|
||||
// <div class="form-group col-3">
|
||||
// <p style="color:black;"><b><?php //echo htmlspecialchars($label); ?>:</b></p>
|
||||
// </div>
|
||||
// <div class="form-group col-6">
|
||||
// <?php
|
||||
// if (is_array($value)) {
|
||||
// $nesetedValues .= nestedKeyValuePair($value) .",";
|
||||
// echo "$nesetedValues";
|
||||
|
||||
// } else {
|
||||
// $formattedValue = format_value($value);
|
||||
// echo "<p style='color:black;'>: " . htmlspecialchars($formattedValue) . "</p>";
|
||||
// }
|
||||
// ?>
|
||||
// </div>
|
||||
// </div>
|
||||
// <?php
|
||||
// }
|
||||
// }
|
||||
?> -->
|
||||
|
||||
<style>
|
||||
.policy-terms-container {
|
||||
border: 1px solid #ddd;
|
||||
border-radius: 8px;
|
||||
background-color: #fafafa;
|
||||
padding: 20px;
|
||||
max-width: 1200px;
|
||||
margin: 20px auto;
|
||||
box-shadow: 0 2px 4px rgba(0,0,0,0.1);
|
||||
}
|
||||
|
||||
return $output;
|
||||
}
|
||||
|
||||
if (isset($policy_terms['policy_terms']) && is_array($policy_terms['policy_terms'])) {
|
||||
|
||||
// ✅ Merge multiple_sum_insured with sum_insured
|
||||
if (
|
||||
isset($policy_terms['policy_terms']['multiple_sum_insured']) &&
|
||||
is_array($policy_terms['policy_terms']['multiple_sum_insured'])
|
||||
) {
|
||||
$sum_insured_values = implode(' , ', $policy_terms['policy_terms']['multiple_sum_insured']);
|
||||
$original_sum = isset($policy_terms['policy_terms']['sum_insured'])
|
||||
? $policy_terms['policy_terms']['sum_insured']
|
||||
: '';
|
||||
$policy_terms['policy_terms']['sum_insured'] = $original_sum . " , " . $sum_insured_values;
|
||||
unset($policy_terms['policy_terms']['multiple_sum_insured']);
|
||||
.policy-row {
|
||||
display: flex;
|
||||
border-bottom: 1px solid #eee;
|
||||
padding: 12px 0;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
// ✅ Display each policy term
|
||||
foreach ($policy_terms['policy_terms'] as $key => $value) {
|
||||
if ($key === "age_ratio" || $key === "enrollment_display_key") {
|
||||
continue; // Skip excluded keys
|
||||
}
|
||||
.policy-row:last-child {
|
||||
border-bottom: none;
|
||||
}
|
||||
|
||||
// Normalize specific raw keys (if needed)
|
||||
if ($key === 'waiverof30dayswaitingperiod') {
|
||||
$key = 'Waiver_of_30_days_waiting_period';
|
||||
}
|
||||
if ($key === 'suminsuredenhancement') {
|
||||
$key = 'sum_insured_enhancement';
|
||||
}
|
||||
.policy-label {
|
||||
flex: 0 0 40%;
|
||||
padding-right: 20px;
|
||||
}
|
||||
|
||||
// Readable label
|
||||
$label = readable_key($key);
|
||||
$nesetedValues = "";
|
||||
?>
|
||||
<div class="row">
|
||||
<div class="form-group col-3">
|
||||
<p style="color:black;"><b><?php echo htmlspecialchars($label); ?>:</b></p>
|
||||
</div>
|
||||
<div class="form-group col-6">
|
||||
<?php
|
||||
if (is_array($value)) {
|
||||
$nesetedValues .= nestedKeyValuePair($value) .",";
|
||||
echo "$nesetedValues";
|
||||
|
||||
} else {
|
||||
$formattedValue = format_value($value);
|
||||
echo "<p style='color:black;'>: " . htmlspecialchars($formattedValue) . "</p>";
|
||||
}
|
||||
?>
|
||||
.policy-label label {
|
||||
font-weight: 600;
|
||||
color: #333;
|
||||
font-size: 14px;
|
||||
margin: 0;
|
||||
text-transform: capitalize;
|
||||
}
|
||||
|
||||
.policy-value {
|
||||
flex: 1;
|
||||
padding-left: 20px;
|
||||
border-left: 1px solid #eee;
|
||||
}
|
||||
|
||||
.policy-value span {
|
||||
color: #555;
|
||||
font-size: 14px;
|
||||
line-height: 1.4;
|
||||
}
|
||||
|
||||
.no-terms-container {
|
||||
border: 1px solid #ddd;
|
||||
border-radius: 8px;
|
||||
background-color: #f9f9f9;
|
||||
padding: 40px;
|
||||
text-align: center;
|
||||
max-width: 800px;
|
||||
margin: 20px auto;
|
||||
}
|
||||
|
||||
.no-terms-message span {
|
||||
color: #666;
|
||||
font-size: 16px;
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
/* Responsive design */
|
||||
@media (max-width: 768px) {
|
||||
.policy-row {
|
||||
flex-direction: column;
|
||||
align-items: flex-start;
|
||||
}
|
||||
|
||||
.policy-label {
|
||||
flex: none;
|
||||
padding-right: 0;
|
||||
padding-bottom: 8px;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.policy-value {
|
||||
flex: none;
|
||||
padding-left: 0;
|
||||
border-left: none;
|
||||
border-top: 1px solid #eee;
|
||||
padding-top: 8px;
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
<?php if(isset($policy_terms)) { ?>
|
||||
<div class="policy-terms-container">
|
||||
<?php foreach($policy_terms as $key => $value){ ?>
|
||||
<div class="policy-row">
|
||||
<div class="policy-label">
|
||||
<label><?= htmlspecialchars($key) ?></label>
|
||||
</div>
|
||||
<div class="policy-value">
|
||||
<span><?= $value ?></span>
|
||||
</div>
|
||||
</div>
|
||||
<?php } ?>
|
||||
</div>
|
||||
<?php } else { ?>
|
||||
<div class="no-terms-container">
|
||||
<div class="no-terms-message">
|
||||
<span>No Terms Found</span>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
<?php } ?>
|
||||
|
||||
|
||||
|
||||
@ -258,6 +258,11 @@
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
.demographyTable .table th,
|
||||
.demographyTable .table td {
|
||||
padding: 4px 4px !important;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
<div class="row" id="inception_list">
|
||||
@ -288,6 +293,7 @@
|
||||
onclick="checkTheTableDataChanged(3)">Send Insurer Mail</button>
|
||||
<?php } ?>
|
||||
<button id="submitPlacement" class="btn btn-primary" onclick="checkTheTableDataChanged(6)">Placement</button>
|
||||
<button id="viewDemography" class="btn btn-primary" onclick="viewDemography()">Demography</button>
|
||||
<input type="hidden" id="lead_id" name="lead_id" value="<?= isset($lead_id) ? $lead_id : '' ?>">
|
||||
<input type="hidden" id="rfq_primaryKey" name="rfq_primaryKey" value="<?= isset($rfq_data['id']) ? $rfq_data['id'] : '' ?>">
|
||||
<input type="hidden" id="qcr_count" value="<?= isset($qcr_count) ? $qcr_count : 0 ?>">
|
||||
@ -685,6 +691,30 @@
|
||||
</div>
|
||||
</div><!-- /.modal -->
|
||||
|
||||
<!-- Modal content for View Demography Mail -->
|
||||
<div class="modal fade" id="view_demography_modal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel"
|
||||
aria-hidden="false">
|
||||
<div class="modal-dialog modal-full-width">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h4 class="modal-title" id="demographyCenterModalLabel">Demography</h4>
|
||||
<button type="button" id="close_btn" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div style='max-height: 400px; overflow-y: auto; margin-bottom: 30px;'>
|
||||
<?php
|
||||
if(isset($demogrphy_html_data) && !empty($demogrphy_html_data)){
|
||||
echo $demogrphy_html_data;
|
||||
}else{
|
||||
echo "<p style='text-align: center; color: #6c757d; font-style: italic;'>No Demography Data Found or Wrong File</p>";
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
</div><!-- /.modal-content -->
|
||||
</div>
|
||||
</div><!-- /.modal -->
|
||||
|
||||
<script>
|
||||
|
||||
var isFormDataModified = false;
|
||||
@ -6711,6 +6741,12 @@ function appendMultiFileData(data) {
|
||||
});
|
||||
}, 2000)
|
||||
})
|
||||
|
||||
function viewDemography(){
|
||||
// Show the modal
|
||||
const myModal = new bootstrap.Modal(document.getElementById('view_demography_modal'));
|
||||
myModal.show();
|
||||
}
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
@ -21,6 +21,7 @@
|
||||
"google/apiclient": "^2.15.0",
|
||||
"kreait/firebase-php": "^7.0",
|
||||
"laminas/laminas-escaper": "^2.9",
|
||||
"mpdf/mpdf": "*",
|
||||
"php-amqplib/php-amqplib": "^2.8",
|
||||
"phpmailer/phpmailer": "^6.9",
|
||||
"phpoffice/phpspreadsheet": "^2.1",
|
||||
|
||||
BIN
public/assets/images/active_bds.png
Normal file
|
After Width: | Height: | Size: 537 B |
BIN
public/assets/images/active_claims.png
Normal file
|
After Width: | Height: | Size: 1.3 KiB |
BIN
public/assets/images/active_leads_and_bds_renewal.png
Normal file
|
After Width: | Height: | Size: 1.2 KiB |
BIN
public/assets/images/active_pending_actions.png
Normal file
|
After Width: | Height: | Size: 826 B |
BIN
public/assets/images/inactive_bds.png
Normal file
|
After Width: | Height: | Size: 664 B |
BIN
public/assets/images/inactive_claims.png
Normal file
|
After Width: | Height: | Size: 1.4 KiB |
BIN
public/assets/images/inactive_leads_and_bds_renewal.png
Normal file
|
After Width: | Height: | Size: 1.8 KiB |
BIN
public/assets/images/inactive_pending_actions.png
Normal file
|
After Width: | Height: | Size: 775 B |