diff --git a/app/Config/Routes.php b/app/Config/Routes.php index 8cde4f3a..9ab269ae 100755 --- a/app/Config/Routes.php +++ b/app/Config/Routes.php @@ -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 @@ -553,6 +554,13 @@ $routes->group("employeeRest", ["filter" => "authJWT"], function ($routes) { $routes->get("claimView", "EmployeeRestController::claimView"); $routes->get("exportCashDepositData", "EmployeeRestController::exportCashDepositData"); + + //thz_master's + $routes->post("ticketSave", "ThzController::ticketSave"); + $routes->get("ticketList", "ThzController::ticketList"); + $routes->post("ticketConversationSave", "ThzController::ticketConversationSave"); + $routes->get("ticketConversationList", "ThzController::ticketConversationList"); + }); $routes->get("getEmployeeActiveOrInactivePolicy", "EmployeeRestController::getEmployeeActiveOrInactivePolicy"); $routes->get("sendPushNotification", "EmployeeRestController::sendPushNotification"); @@ -637,4 +645,8 @@ $routes->post('newClaim','VidalApiController::newClaim'); $routes->post('enrollment','VidalApiController::enrollment'); -$routes->post("ticketCreation", "ThzController::ticketCreation"); \ No newline at end of file +$routes->post("ticketSave", "ThzController::ticketSave"); +$routes->get("ticketList", "ThzController::ticketList"); +$routes->post("ticketConversationSave", "ThzController::ticketConversationSave"); +$routes->get("ticketConversationList", "ThzController::ticketConversationList"); +$routes->post('ticketAutoFetchDetails',"ThzController::ticketAutoFetchDetails"); \ No newline at end of file diff --git a/app/Controllers/Home.php b/app/Controllers/Home.php index 09d3dc19..cc084f72 100755 --- a/app/Controllers/Home.php +++ b/app/Controllers/Home.php @@ -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 '
';
+                print_r($responseData);
+            echo '
';
+            // 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 = '

' . htmlspecialchars($worksheet->getTitle()) . '

'; + $html .= ''; + + foreach ($worksheet->getRowIterator() as $row) { + $html .= ''; + $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 .= ''; + } + + $html .= ''; + } + + $html .= '
' . htmlspecialchars($formattedValue) . '
'; + return $html; + } + + + } diff --git a/app/Controllers/ThzController.php b/app/Controllers/ThzController.php index 590e8f78..0141ef61 100644 --- a/app/Controllers/ThzController.php +++ b/app/Controllers/ThzController.php @@ -3,11 +3,17 @@ namespace App\Controllers; use App\Controllers\BaseController; +use App\Helpers\MailHelper; use CodeIgniter\HTTP\ResponseInterface; use App\Models\ThzMasterModel; use App\Models\ThzMasterNotesModel; use App\ControllerCleaners\ThzControllerCleaner; +use App\Models\UserModel; +use App\Models\ClientPolicyModel; +use App\Models\ClientModel; +use App\Models\TicketMailTemplateModel; + class ThzController extends BaseController { @@ -17,11 +23,21 @@ class ThzController extends BaseController protected $thzControllerCleaner; + protected $userModel; + protected $clientPolicyModel; + protected $clientModel; + + protected $ticketMailTemplateModel; + public function __construct() { - $this->thzMasterModel = new ThzMasterModel(); - $this->thzMasterNotesModel = new ThzMasterNotesModel(); - $this->thzControllerCleaner = new ThzControllerCleaner(); + $this->thzMasterModel = new ThzMasterModel(); + $this->thzMasterNotesModel = new ThzMasterNotesModel(); + $this->thzControllerCleaner = new ThzControllerCleaner(); + $this->userModel = new UserModel(); + $this->clientPolicyModel = new ClientPolicyModel(); + $this->clientModel = new ClientModel(); + $this->ticketMailTemplateModel = new TicketMailTemplateModel(); } public function index() @@ -29,140 +45,410 @@ class ThzController extends BaseController // } - public function ticketCreation(){ + public function ticketSave(){ - $data = $this->request->getJSON(true); + $data = $this->request->getPost(); - $cleanedData = $this->thzControllerCleaner->ticketCreation($data); + if (!empty($data['thz_id'])) { + + $text = "update"; + $result = $this->updateTicket($data); + $updateID = $data['thz_id']; + + } else { + + $text = "create"; + $insertID = $this->insertTicket($data); + $result = true; - if ($cleanedData === false) { - return $this->response->setJSON((['status' => 'error', 'message' => 'Invalid data given'])); } - $result = $this->thzMasterModel->insert($cleanedData); + $id = isset($insertID) && !empty($insertID) ? $insertID : $updateID ; - return $this->response->setJSON((['status' => 'success', 'message' => 'Ticket created successfully'])); + $emailNotificationResult = $this->ticketSaveNotification($data , $insertOrUpdate = $text , $id); + return $this->response->setJSON([ + 'status' => $result ? 'success' : 'error', + 'message' => $result ? "Ticket {$text}d successfully " : "Unable to {$text} ticket. Please try again." , + 'notification' => $emailNotificationResult ? 'Email Notification Success..!!' : 'Email Notification Failed..!!' + ])->setStatusCode($result ? 200 : 400); } + + public function ticketList() + { - public function ticketList(){ - - $data = $this->request->getJson(true); - - $cleanedData = $this->thzControllerCleaner->ticketList($data); - - if( $cleanedData === false ) { - return $this->response->setJSON((['status' => 'error', 'message' => 'Invalid data given'])); - } - - $id = $cleanedData['id'] ?? null; - - if (empty($id)) { - $result = $this->thzMasterModel->findAll(); - } - - $result = $this->thzMasterModel->where('id',$id)->findAll(); - - if(empty($result)){ - return $this->response->setJSON((['status' => 'error', 'message' => 'No tickets found'])); - } - - return $this->response->setJSON((['status' => 'success', 'data' => $result])); + $returnType = strtolower($this->request->getGet('return_type') ?? 'api'); + + $data = $this->request->getGet(); + + $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['assignee'] = $this->userModel->where('is_active', 1)->whereIn('role', ['2', '3','4'])->findAll(); // enga 5-"head" and 1-"admin" assign pannvaga so dropdown la varakudhathu + // 2,3,4 remain person varannum. + $data['client_list'] = $this->clientModel->getCreatedByUserName(); + return $this->loadLayout('thz_list', $data); + } + + return $this->response->setJSON([ + 'status' => 'success', + 'data' => $tickets, + ])->setStatusCode(200); } public function ticketConversationSave(){ - $data = $this->request->getJson(true); + $data = $this->request->getPost(); - $cleanedData = $this->thzControllerCleaner->ticketList($data); - - if( $cleanedData === false ) { - return $this->response->setJSON((['status' => 'error', 'message' => 'Invalid data given'])); - } + $data['notes_type'] = $data['notes_type'] ?? 'External' ; $result = $this->thzMasterNotesModel->insert($data); - if(empty($result)){ - return $this->response->setJSON((['status' => 'error', 'message' => 'No tickets found'])); - } + if(empty($result)){ + return $this->response->setJSON((['status' => 'error', 'message' => 'No tickets found']))->setStatusCode(404); + } - return $this->response->setJSON((['status' => 'success', 'data' => $result])); + if($data['notes_type'] == "External"){ + $emailNotificationResult = $this->ticketConversationSaveNotification($data); + }else{ + $emailNotificationResult = false ; + } + + + return $this->response->setJSON([ + 'status' => $result ? 'success' : 'error', + 'message' => $result ? "Ticket Notes created successfully" : "Unable to create ticket notes. Please try again." , + 'notification' => $emailNotificationResult ? 'Email Notification Success..!!' : 'Email Notification Failed Or No Need..!!' + ])->setStatusCode($result ? 200 : 400); } - public function ticketListForUser(){ + public function ticketAutoFetchDetails(){ + $data = $this->request->getPost(); - $data = $this->request->getJson(true); + $client_id = $data['client_id']; + $mobile = $data['mobile']; - $cleanedData = $this->thzControllerCleaner->ticketList($data); + if($client_id && $mobile){ + + $details = $this->thzMasterModel->ticketAutoFetchDetails($client_id ,$mobile); + + if(empty($details)){ + return $this->response->setJSON((['status' => 'error', 'message' => 'No Data found']))->setStatusCode(400); + }else{ - if( $cleanedData === false ) { - return $this->response->setJSON((['status' => 'error', 'message' => 'Invalid data given'])); - } + $policyIds = array_column($details, 'policy_id'); + $policyIds = array_filter($policyIds); + $clientPolicy = $this->clientPolicyModel->whereIn('policy_id', $policyIds)->where('is_active', 1)->get()->getResultArray(); + $result['client_details'] = $details; + $result['policy_details'] = empty($clientPolicy) ? [] : $clientPolicy ; - $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])); + } + }else{ + return $this->response->setJSON((['status' => 'error', 'message' => 'Client and Mobile Not found']))->setStatusCode(400); + } + + return $this->response->setJSON((['status' => 'success', 'data' => $result]))->setStatusCode(200); + } - public function conversationListForUserPerTicket(){ + public function ticketConversationList(){ - $data = $this->request->getJson(true); + $data = $this->request->getGet(); - $cleanedData = $this->thzControllerCleaner->ticketList($data); + $returnType = strtolower($this->request->getGet('return_type') ?? 'api'); - if( $cleanedData === false ) { - return $this->response->setJSON((['status' => 'error', 'message' => 'Invalid data given'])); - } + $thz_id = $data['thz_id'] ?? null; + + $ticketType = $data['notes_type'] ?? 'External' ; - $thz_id = $cleanedData['thz_id'] ?? null; + if($thz_id){ + $result['master'] = $this->thzMasterModel + ->select('thz_master.*, CONCAT(user_profiles.first_name, " ", user_profiles.last_name) as assignee_name') + ->join('user_profiles', 'user_profiles.id = thz_master.assign_to', 'left') + ->where('thz_master.thz_id', $thz_id) + ->findAll(); - $result = $this->thzMasterNotesModel->conversationListForUserPerTicket($thz_id); + if(!empty($result['master'])){ + $notes = $this->thzMasterNotesModel->ticketConversationList($thz_id, $returnType ); + $result['notes'] = !empty($notes) ? $notes : []; + }else{ + return $this->response->setJSON((['status' => 'error', 'message' => 'No tickets found']))->setStatusCode(400); + } + }else{ + return $this->response->setJSON((['status' => 'error', 'message' => 'No tickets found']))->setStatusCode(404); + } - if(empty($result)){ - return $this->response->setJSON((['status' => 'error', 'message' => 'No tickets found'])); - } - - return $this->response->setJSON((['status' => 'success', 'data' => $result])); + + + if ($returnType === 'api') { + return $this->response->setJSON((['status' => 'success', 'data' => $result]))->setStatusCode(200); + }else{ + $toGetRelated = $result['master'][0]['created_by']; + $result['related_tickets'] = $this->thzMasterModel + ->select('thz_master.*, CONCAT(user_profiles.first_name, " ", user_profiles.last_name) as assignee_name') + ->join('user_profiles', 'user_profiles.id = thz_master.assign_to', 'left') + ->where('thz_master.created_by', $toGetRelated) + ->findAll(); + $result['assignee'] = $this->userModel->where('is_active', 1)->whereIn('role', ['2', '3','4'])->findAll(); // enga 5-"head" and 1-"admin" assign pannvaga so dropdown la varakudhathu + // 2,3,4 remain person varannum. + return $this->loadLayout('thz_notes', $result); + } } - public function ticketListForAssignedStaff(){ - - } - - public function conversationListForAssignedStaffPerTicket(){ - - } - - - /************************************************** PRIVATE FUNCTIONS ********************************************************/ - private function checkGeneralUserOrEmployee($data){ + private function fetchTicketsBasedOnrole(array $data): array + { + // $id = $data['thz_id'] ?? null; + $assign_to = $data['assign_to'] ?? null; + $mobile = $data['mobile'] ?? null; - if($data['empcode']){ - return $data['empcode']; - } elseif ($data['mobile']) { - return $data['mobile']; - } elseif ($data['email']) { - return $data['email']; - } else { - return null; + if (!empty($assign_to)) { + // Tickets assigned to a staff + return $this->thzMasterModel + ->select('thz_master.*, CONCAT(user_profiles.first_name, " ", user_profiles.last_name) as assignee_name') + ->join('user_profiles', 'user_profiles.id = thz_master.assign_to', 'left') + ->where('thz_master.assign_to', $assign_to) + ->orderBy('thz_master.created_at','desc') + ->findAll(); } + // if (!empty($id) && !empty($mobile)) { + if (!empty($mobile)) { + // Specific ticket by ID and mobile + return $this->thzMasterModel + ->select('thz_master.*, CONCAT(user_profiles.first_name, " ", user_profiles.last_name) as assignee_name') + ->join('user_profiles', 'user_profiles.id = thz_master.assign_to', 'left') + // ->where('thz_id', $id) + ->where('thz_master.mobile', $mobile) + ->orderBy('thz_master.created_at','desc') + ->findAll(); + } + + // All tickets (e.g., for managers) + return $this->thzMasterModel + ->select('thz_master.*, CONCAT(user_profiles.first_name, " ", user_profiles.last_name) as assignee_name') + ->join('user_profiles', 'user_profiles.id = thz_master.assign_to', 'left') + ->orderBy('thz_master.created_at','desc') + ->findAll(); + } + + + + private function ticketSaveNotification( $data , $insertOrUpdate , $id){ + + $user_email = $data['email'] ?? null; + + $assignee_id = $data['assign_to'] ?? null; + + $assignee_email = $this->findAssigneeEmail($assignee_id); + + $emailToNotified = [ + 'user_email' => $user_email, + 'assignee_email' => $assignee_email + ]; + + $ticketId = $id; + + $result = $this->ticketSaveEmailNotificationBasedOnRole($emailToNotified , $insertOrUpdate , $ticketId , $data); + + return $result; + + } + + private function ticketConversationSaveNotification($data){ + + $thz_id = $data['thz_id'] ; // thz is alias of ticket + + $data['subject'] = $this->findSubject($data['thz_id']); + + $assignee_id = $this->findAssigneeId($data['thz_id']) ; + + $user_email = $this->findUserEmail($data['thz_id']) ; + + $assignee_email = $this->findAssigneeEmail($assignee_id) ?? ''; + + $sender_mail = $data['notes_by'] == "User" ? $user_email : $assignee_email ; + $receiver_mail = $data['notes_by'] == "User" ? $assignee_email : $user_email ; + + $templateName = "ticket_conversation_save_notification"; + + $to_email = $receiver_mail; + + $ticketId = $thz_id; + + $message = $data['notes'] ?? ''; + + $this->sendEmail( $templateName, $data , $to_email , $ticketId , $message); + + return true; + + } + + + private function findAssigneeEmail($assignee_id){ + + $row = $this->userModel->where('id', $assignee_id)->get()->getRow(); + $assigneeEmail = $row ? $row->email : null; + return $assigneeEmail ? $assigneeEmail : ""; + + } + + private function findAssigneeId($ticketId){ + $row = $this->thzMasterModel->where('thz_id', $ticketId)->get()->getRow(); + $assigneeId = $row ? $row->assign_to : null; + return $assigneeId ? $assigneeId : 0 ; + } + + private function findUserEmail($ticket_id){ + $row = $this->thzMasterModel->where('thz_id', $ticket_id)->get()->getRow(); + $email = $row ? $row->email : null; + return $email ? $email : " " ; + } + + private function findSubject($ticketId){ + $row = $this->thzMasterModel->where('thz_id', $ticketId)->get()->getRow(); + $subject = $row ? $row->subject : null; + return $subject ? $subject : " " ; + } + + private function ticketSaveEmailNotificationBasedOnRole($emailToNotified , $insertOrUpdate , $ticketId , $data){ + + $user_email = $emailToNotified['user_email'] ?? null; + $assignee_email = $emailToNotified['assignee_email'] ?? null; + + + if (!empty($assignee_email)) { + + switch ($insertOrUpdate) { + + case 'update': + + $this->sendEmail( 'ticket_save_update_assignee', $data ,$assignee_email , $ticketId ) ; + + break; + + case 'create': + + $this->sendEmail( 'ticket_save_create_assignee', $data ,$assignee_email , $ticketId ) ; + + break; + + default: + # code... + break; + } + + } + + if (!empty($user_email)) { + + switch ($insertOrUpdate) { + + case 'update': + + if(empty($assignee_email)){ + $data['assigneeAndStatus'] = "Not Yet Assigned"; + $this->sendEmail( 'ticket_save_update_user', $data ,$user_email , $ticketId ) ; + }else{ + $data['assigneeAndStatus'] = "Assigned With {$assignee_email}"; + $this->sendEmail( 'ticket_save_update_user', $data ,$user_email , $ticketId ) ; + } + + break; + + case 'create': + + if(empty($assignee_email)){ + $this->sendEmail( 'ticket_save_create_user_unassigned', $data ,$user_email , $ticketId ) ; + }else{ + $data['assignee_email'] = $assignee_email ; + $this->sendEmail( 'ticket_save_create_user_assigned', $data , $user_email , $ticketId ) ; + } + + break; + + default: + # code... + break; + } + + } + + return true; + + + } + + private function updateTicket($data){ + + $data['updated_by'] = get_session_userid(); + $ticket_id = $data['thz_id']; + $result = $this->thzMasterModel->where('thz_id', $ticket_id)->set($data)->update(); + + return $result; + + } + + private function insertTicket($data) + { + $data['created_by'] = get_session_userid(); + $this->thzMasterModel->insert($data); + + return $this->thzMasterModel->insertID(); // returns the inserted row's ID + } + + + private function sendEmail( $templateName, $data , $to_email , $ticketId , $message = ""){ + + $mailTemplate = $this->ticketMailTemplateModel->where('template_name',$templateName )->findAll()[0] ?? []; + + if(empty($mailTemplate)){ + return ; + } + + $mailTemplate['subject'] = str_replace('%subject%', $data['subject'] ?? '', $mailTemplate['subject']); + + $mailTemplate['mail_content'] = str_replace('%subject%', $data['subject'] ?? '', $mailTemplate['mail_content']); + + $mailTemplate['mail_content'] = str_replace('%ticketId%', $ticketId ?? '', $mailTemplate['mail_content']); + + $mailTemplate['mail_content'] = str_replace('%message%', $message ?? '', $mailTemplate['mail_content']); + + $mailTemplate['mail_content'] = str_replace('%assignee_email%', $data['assignee_email'] ?? '', $mailTemplate['mail_content']); + + $mailTemplate['mail_content'] = str_replace('%assigneeAndStatus%',$data['assigneeAndStatus'] ?? '' ,$mailTemplate['mail_content']); + + $from_mail = ""; + $to_mail = $to_email; + $cc_string = ""; + $subject = $mailTemplate['subject'] ; + $message = $mailTemplate['mail_content'] ; + $attachments = ""; + $reply_to = ""; + $bcc_string = ""; + + $res = MailHelper::send_email(['from_mail' => $from_mail, 'mail' => $to_mail , 'cc' => $cc_string, 'subject' => $subject, 'message' => $message, 'attachments' => $attachments, 'reply_to' => $reply_to, 'bcc' => $bcc_string]); + } } + diff --git a/app/Helpers/header.php b/app/Helpers/header.php index 2ade2b0b..dc193798 100755 --- a/app/Helpers/header.php +++ b/app/Helpers/header.php @@ -267,7 +267,6 @@ .right-bar { - width: 300px; /* Adjust as needed */ overflow: hidden; } diff --git a/app/Models/ThzMasterModel.php b/app/Models/ThzMasterModel.php index 410a84ba..aa33fc32 100644 --- a/app/Models/ThzMasterModel.php +++ b/app/Models/ThzMasterModel.php @@ -12,7 +12,7 @@ class ThzMasterModel extends Model 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 $allowedFields = ['name','mobile','email','empcode','policy_no','ticket_type','subject','message','status','assign_to','created_at','updated_at','created_by','updated_by' ,'client_id' ,'policy_id' ,'branch_id']; protected bool $allowEmptyInserts = false; @@ -39,4 +39,22 @@ class ThzMasterModel extends Model protected $afterFind = []; protected $beforeDelete = []; protected $afterDelete = []; + + public function ticketAutoFetchDetails($client_id ,$mobile){ + + $result = $this->db->table('employees e') + ->select('e.id, e.email_personal, e.client_id, e.client_branch_id as branch_id, e.mobile, e.emp_code, e.name, ep.client_policy_id as policy_id') + ->join('employee_polices ep', 'ep.employee_id = e.id AND ep.is_active = 1', 'left') + ->whereIn('e.emp_status', ['active', 'draft', 'enrolled']) + ->where('e.is_active', 1) + ->where('e.mobile', $mobile) + ->where('e.client_id', $client_id) + ->groupBy('e.client_id') + ->get() + ->getResultArray(); + + return $result; + + } + } diff --git a/app/Models/ThzMasterNotesModel.php b/app/Models/ThzMasterNotesModel.php index 2072c094..413781df 100644 --- a/app/Models/ThzMasterNotesModel.php +++ b/app/Models/ThzMasterNotesModel.php @@ -12,7 +12,7 @@ class ThzMasterNotesModel extends Model protected $returnType = 'array'; protected $useSoftDeletes = false; protected $protectFields = true; - protected $allowedFields = ['thz_id','notes','notes_by','created_by','created_at']; + protected $allowedFields = ['thz_id','notes','notes_by','created_by','created_at','notes_type']; protected bool $allowEmptyInserts = false; @@ -40,7 +40,7 @@ class ThzMasterNotesModel extends Model protected $beforeDelete = []; protected $afterDelete = []; - public function conversationListForUserPerTicket($thz_id){ + public function ticketConversationLists($thz_id){ if(empty($thz_id)){ @@ -50,6 +50,7 @@ class ThzMasterNotesModel extends Model $sql = "SELECT + thz_master.*, thz_master_notes.id, thz_master_notes.thz_id, thz_master_notes.notes, @@ -60,6 +61,7 @@ class ThzMasterNotesModel extends Model thz_master_notes Join thz_master ON thz_master.thz_id = :thz_id: + WHERE thz_master_notes.thz_id = :thz_id: ORDER BY @@ -74,5 +76,42 @@ class ThzMasterNotesModel extends Model } + public function ticketConversationList($thz_id , $returnType) + { + $ticketTypeFilter = ""; + + if ($returnType == 'api') { + //user only see his message + $ticketTypeFilter = "AND thz_master_notes.notes_type = 'External' "; + } + + $integer_ticket_id = (int)$thz_id; + + $notes_sql = "SELECT + thz_master_notes.*, + CASE + WHEN LOWER(thz_master_notes.notes_by) = 'staff' + THEN CONCAT(user_profiles.first_name, ' ', user_profiles.last_name) + WHEN LOWER(thz_master_notes.notes_by) = 'user' + THEN thz_master.name + ELSE thz_master_notes.notes_by + END AS name + FROM thz_master_notes + LEFT JOIN user_profiles + ON user_profiles.id = thz_master_notes.created_by + AND LOWER(thz_master_notes.notes_by) = 'staff' + LEFT JOIN thz_master + ON thz_master.thz_id = thz_master_notes.thz_id + AND LOWER(thz_master_notes.notes_by) = 'user' + WHERE thz_master_notes.thz_id = ". $integer_ticket_id ." + $ticketTypeFilter + ORDER BY thz_master_notes.created_at ASC"; + + $result = $this->db->query($notes_sql)->getResultArray(); + + return $result; + } + + } diff --git a/app/Views/DashBoard.php b/app/Views/DashBoard.php index 08e08855..e3c54d7d 100755 --- a/app/Views/DashBoard.php +++ b/app/Views/DashBoard.php @@ -171,79 +171,113 @@ 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; + } + + .active{ + color : white !important ; + } + + +

Dashboard

+
-
-
-
-
-
-
- -
+
-
+
+
+ @@ -257,7 +291,6 @@ - @@ -234,9 +248,6 @@ table.dataTable tbody td {

User List

-
- -
@@ -372,7 +383,7 @@ table.dataTable tbody td {
-
+
@@ -464,7 +475,7 @@ table.dataTable tbody td {
-
Team
+
@@ -520,7 +531,17 @@ table.dataTable tbody td { exportOptions: { columns: ':not(:last-child)' } + }, + { + text: 'ADD', + className: 'btn-color', + attr: { + id: 'btnAdd', + title: 'Add' + } } + + ], @@ -541,14 +562,6 @@ table.dataTable tbody td { }); - $('#btnAdd').click(function(){ - $('#first_name').val(''); - $('#last_name').val(''); - $('#email').val(''); - $('#mobile').val(''); - $('#emp_code').val(''); - $('#UserForm').attr('action', ''); - }) $('.close').click(function(){ @@ -815,3 +828,17 @@ table.dataTable tbody td { } + \ No newline at end of file diff --git a/app/Views/bds_dash.php b/app/Views/bds_dash.php index 0544e646..c91b2b6e 100644 --- a/app/Views/bds_dash.php +++ b/app/Views/bds_dash.php @@ -1,9 +1,4 @@ @@ -130,26 +157,32 @@ body{ -
-
-
Team
`; + // table = `
`; + div = `
`; + $.each(res.data, function(index, item) { var Params = null; @@ -350,22 +450,37 @@ function getPendingActionClientDataForDashboard(input, headerName, type) } console.log(link) - table += `
`; + // table += ``; + div += `
+
+

${item.client_name}

+
${item.branch_name} - ${item.policy_name}
+
+
+ `; }); - table += "
${item.client_name} - ${item.branch_name} - ${item.policy_name}
${item.client_name} - ${item.branch_name} - ${item.policy_name}
"; + div += "
"; } else { - table = '
No data available
'; + // table = '
No data available
'; + div = '
No data available
'; } - $(".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 ..!!"); } }); } diff --git a/app/Views/enrollment_list.php b/app/Views/enrollment_list.php index d88a4619..96da7591 100755 --- a/app/Views/enrollment_list.php +++ b/app/Views/enrollment_list.php @@ -73,17 +73,17 @@
- +
- +
- +
@@ -92,7 +92,7 @@
@@ -454,25 +454,25 @@ buttons: [ { extend: 'copy', - text: '', + text: '', titleAttr: 'Copy', filename: 'Enrolment List' }, { extend: 'print', - text: '', + text: '', titleAttr: 'Print', filename: 'Enrolment List' }, { extend: 'pdf', - text: '', + text: '', titleAttr: 'PDF', filename: 'Enrolment List' }, { extend: 'csv', - text: '', + text: '', titleAttr: 'CSV', filename: 'Enrolment List' } diff --git a/app/Views/finance_team_list.php b/app/Views/finance_team_list.php index b9d3f0b6..9613b9df 100644 --- a/app/Views/finance_team_list.php +++ b/app/Views/finance_team_list.php @@ -137,8 +137,8 @@ table.dataTable tbody td {
-   - +   +
diff --git a/app/Views/hr_access_controll.php b/app/Views/hr_access_controll.php index 033b54cb..7d262a17 100644 --- a/app/Views/hr_access_controll.php +++ b/app/Views/hr_access_controll.php @@ -24,7 +24,7 @@

- +
@@ -38,7 +38,7 @@ value="1" > - Pre enrollment + Pre enrollment
@@ -84,7 +84,7 @@ value="2" > - Active policies + Active policies
@@ -128,7 +128,7 @@
> - CD statement + CD statement
@@ -153,7 +153,7 @@
> - Claims + Claims
diff --git a/app/Views/hr_activity_history.php b/app/Views/hr_activity_history.php index e9dc0a18..15d53361 100644 --- a/app/Views/hr_activity_history.php +++ b/app/Views/hr_activity_history.php @@ -27,8 +27,8 @@ table.dataTable tbody td {
-   - +   +
diff --git a/app/Views/import_export.php b/app/Views/import_export.php index 7f2bc15d..604e9853 100755 --- a/app/Views/import_export.php +++ b/app/Views/import_export.php @@ -21,7 +21,7 @@ diff --git a/app/Views/insurer_list.php b/app/Views/insurer_list.php index 5168ba4f..e7ce6e82 100755 --- a/app/Views/insurer_list.php +++ b/app/Views/insurer_list.php @@ -26,6 +26,19 @@ color: #16181b !important; cursor: pointer !important; } + +.btn-color{ + background-color: rgba(52, 174, 178, 1); + color: white; + border:1px solid rgba(52, 174, 178, 1); +} + +.btn-color:hover{ + background-color: rgba(41, 139, 142, 1); + color: white; + border:1px solid rgba(41, 139, 142, 1); +} +
@@ -182,6 +192,13 @@ document.addEventListener("DOMContentLoaded", function () { exportOptions: { columns: ':not(:last-child)' } + }, + { + text: 'ADD', + className: 'btn btn-color', + action: function () { + window.location.href = ""; + } } ], diff --git a/app/Views/insurer_onboarding.php b/app/Views/insurer_onboarding.php index bdc3fd71..68c10e80 100755 --- a/app/Views/insurer_onboarding.php +++ b/app/Views/insurer_onboarding.php @@ -8,7 +8,7 @@ diff --git a/app/Views/irba_report.php b/app/Views/irba_report.php index d86d4452..bb4d0427 100644 --- a/app/Views/irba_report.php +++ b/app/Views/irba_report.php @@ -15,8 +15,8 @@
-   - +   +
> > diff --git a/app/Views/kyc_list.php b/app/Views/kyc_list.php index c1a72d31..8e8eefd6 100755 --- a/app/Views/kyc_list.php +++ b/app/Views/kyc_list.php @@ -26,6 +26,19 @@ color: #16181b !important; cursor: pointer !important; } + +.btn-color{ + background-color: rgba(52, 174, 178, 1); + color: white; + border:1px solid rgba(52, 174, 178, 1); +} + +.btn-color:hover{ + background-color: rgba(41, 139, 142, 1); + color: white; + border:1px solid rgba(41, 139, 142, 1); +} +
@@ -176,6 +186,13 @@ exportOptions: { columns: ':not(:last-child)' } + }, + { + text: 'ADD', + className: 'btn btn-color', + action: function () { + window.location.href = ""; + } } ], diff --git a/app/Views/kyc_onboarding.php b/app/Views/kyc_onboarding.php index 412331ba..7ddeefb4 100755 --- a/app/Views/kyc_onboarding.php +++ b/app/Views/kyc_onboarding.php @@ -39,7 +39,7 @@ body {

KYC Entity Type

+ + + + - + + + + + +
+
+
Welcome first_name) ? get_session_userdata()->first_name : 'NOT SET') ?>
+
+ +
+ + +
+ + diff --git a/app/Views/layout/header_old.php b/app/Views/layout/header_old.php new file mode 100644 index 00000000..def757d5 --- /dev/null +++ b/app/Views/layout/header_old.php @@ -0,0 +1,899 @@ + + + + + + + <?= isset($page_name) ? $page_name : 'NHance'; ?> + + + + + + + + /assets/images/Nhance_Favi.svg"> + + + /assets/libs/admin-resources/jquery.vectormap/jquery-jvectormap-1.2.2.css" rel="stylesheet" type="text/css" /> + + + /assets/libs/datatables.net-bs4/css/dataTables.bootstrap4.min.css" rel="stylesheet" type="text/css" /> + /assets/libs/datatables.net-responsive-bs4/css/responsive.bootstrap4.min.css" rel="stylesheet" type="text/css" /> + /assets/libs/datatables.net-buttons-bs4/css/buttons.bootstrap4.min.css" rel="stylesheet" type="text/css" /> + /assets/libs/datatables.net-select-bs4/css//select.bootstrap4.min.css" rel="stylesheet" type="text/css" /> + + + + /assets/css/bootstrap-creative.min.css" rel="stylesheet" type="text/css" id="bs-default-stylesheet" /> + /assets/css/app-creative.min.css" rel="stylesheet" type="text/css" id="app-default-stylesheet" /> + + /assets/css/bootstrap-creative-dark.min.css" rel="stylesheet" type="text/css" id="bs-dark-stylesheet" /> + /assets/css/app-creative-dark.min.css" rel="stylesheet" type="text/css" id="app-dark-stylesheet" /> + + + /assets/css/icons.min.css" rel="stylesheet" type="text/css" /> + + /assets/libs/bootstrap-datepicker/css/bootstrap-datepicker.min.css" rel="stylesheet" type="text/css" /> + /assets/libs/bootstrap-daterangepicker/daterangepicker.css" rel="stylesheet" type="text/css"> + /assets/libs/bootstrap-daterangepicker/daterangepicker.css" rel="stylesheet" type="text/css"> + + + + + + + + + + + /assets/css/jodit.css" rel="stylesheet" type="text/css" /> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ /assets/images/nhance-loader-fast.gif" height="40" width="40" alt="Loading..."> +
+
+ + + +
+ + + + + + +
+ + + + +
+ + + +
+ + +
+ + + + + + +
+
+ + +
\ No newline at end of file diff --git a/app/Views/lead_filter.php b/app/Views/lead_filter.php index 441b363b..86938097 100644 --- a/app/Views/lead_filter.php +++ b/app/Views/lead_filter.php @@ -11,7 +11,7 @@
-

Lead Filter

+

Lead Filter

- body { - margin-top: 20px; - background: #FAFAFA; - } .order-card { color: #fff; @@ -123,129 +119,185 @@ 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: 300px; + } + + #leads-dash-tab{ + padding-right: 20px; + } + + .span-color{ + color:#09B9BF !important; + } + + .leadTypeTile{ + margin-left: 20px; + } + + + + +
-
-
-
-
Leads
-

-

-

 

-

 

+
+
+
+
+

Leads

+

+

+
Lead Tracker
+
-
-
-
-
-
BDS Renewals
-

-

-

 

-

 

+
+
+
+

BDS Renewals

+

+ +

+
Renewal Tracker
+
+
-
-
- Back to Overview + + + + +
+ - +
+
- + $value) : ?> + + $value) : ?> - - + 20 ? substr($formattedStatus, 0, 15) . '...' : $formattedStatus; + $showTooltip = strlen($formattedStatus) > 20; + ?> + +
- - $value) : ?> +
- - 20 ? substr($formattedStatus, 0, 15) . '...' : $formattedStatus; - $showTooltip = strlen($formattedStatus) > 20; - ?> - + + // Get the background color for the current tile + $bgColor = $colorShades[$colorSetIndex][$shadeIndex]; + ?> + 20 ? substr($formattedStatus, 0, 15) . '...' : $formattedStatus; + $showTooltip = strlen($formattedStatus) > 20; + ?> + + + +
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/app/Views/thz_notes.php b/app/Views/thz_notes.php new file mode 100644 index 00000000..09dd2504 --- /dev/null +++ b/app/Views/thz_notes.php @@ -0,0 +1,432 @@ + + + + + +
+
+
+ + +
+
+

Ticket ID-

+
+
+ + +
+ + +
+
+
+
Details
+ + + + +
+
+
+
Ticket ID
+
+
+
+
Name
+
+
+
+
Mobile
+
+
+
+
Policy Number
+
+
+
+
Assigned To
+
+
+
+
Status
+
+
+
+
Ticket Type
+
+
+
+
Subject
+
+
+
+
Message
+
+
+
+
Related Tickets
+
+ + + View + + +
+ +
+ +
+
+
+ + + +
+ + +
+
+
Conversation
+
+
+ +
+ + $conv): ?> + + +
+

+ + + + +
+ + +
+ + +
+ + ' : ''; ?> + + + +
+

No Data Found

+
+ +
+
+ + +
+
+ + + + +
+ +
+ + + + +
+
+ +
+ +
+
+ +
+
+
+ + + + + + + + \ No newline at end of file diff --git a/app/Views/ticket_conversation.php b/app/Views/ticket_conversation.php index d2fa00c3..13707a84 100644 --- a/app/Views/ticket_conversation.php +++ b/app/Views/ticket_conversation.php @@ -23,7 +23,7 @@
-
format('j F Y h:i a');?>
+
format('j F Y h:i a');?>

@@ -58,7 +58,7 @@
-
format('j F Y h:i a');?>
+
format('j F Y h:i a');?>

diff --git a/app/Views/ticket_edit_onbording.php b/app/Views/ticket_edit_onbording.php index c84a7206..5a6812ac 100644 --- a/app/Views/ticket_edit_onbording.php +++ b/app/Views/ticket_edit_onbording.php @@ -14,7 +14,7 @@
diff --git a/app/Views/ticket_form_gmc.php b/app/Views/ticket_form_gmc.php index 56e299aa..2d8c2aa2 100644 --- a/app/Views/ticket_form_gmc.php +++ b/app/Views/ticket_form_gmc.php @@ -36,7 +36,7 @@
@@ -58,7 +58,7 @@
-
@@ -51,7 +51,7 @@
- '; } elseif ($row['is_head_approved'] == 1) { - echo $row['status'] . ' '; + echo $row['status'] . ' '; } elseif ($row['is_head_approved'] == 2) { echo $row['status'] . ' '; } else { diff --git a/app/Views/ticket_mail_template.php b/app/Views/ticket_mail_template.php index 9f67a034..5d69d8d9 100644 --- a/app/Views/ticket_mail_template.php +++ b/app/Views/ticket_mail_template.php @@ -23,6 +23,7 @@ .addbtnStyle { margin-left: 20px !important; + color: #000; } .custom-dropdown-menu { @@ -51,6 +52,13 @@ color: #16181b !important; cursor: pointer !important; } + /* strongest, beats most parent rules and pasted styles on wrappers */ + .jodit-container .jodit-wysiwyg, + .jodit-container .jodit-wysiwyg * { + color: #000 !important; + background-color: #fff !important; /* optional: ensure white background */ + } +
@@ -279,6 +287,9 @@ toolbarAdaptive: false, saveHeightInStorage: true, minHeight: 400, + defaultStyle: { + color: '#000000' // 👈 force black text + }, extraButtons: [{ name: 'info', iconURL: '/assets/images/image-solid.svg', // Replace with the actual icon URL diff --git a/app/Views/ticket_reports.php b/app/Views/ticket_reports.php index 4fe9732d..57c73a2e 100644 --- a/app/Views/ticket_reports.php +++ b/app/Views/ticket_reports.php @@ -15,8 +15,8 @@
-   - +   +
> > diff --git a/app/Views/ticket_search.php b/app/Views/ticket_search.php index 7594a910..8a79e1e9 100644 --- a/app/Views/ticket_search.php +++ b/app/Views/ticket_search.php @@ -10,7 +10,8 @@
-
+
+

Claim Filter

diff --git a/app/Views/tpa_list.php b/app/Views/tpa_list.php index d6d44e58..a2a1b5eb 100755 --- a/app/Views/tpa_list.php +++ b/app/Views/tpa_list.php @@ -25,7 +25,21 @@ background-color: #f8f9fa !important; color: #16181b !important; cursor: pointer !important; -} +} + +.btn-color{ + background-color: rgba(52, 174, 178, 1); + color: white; + border:1px solid rgba(52, 174, 178, 1); +} + +.btn-color:hover{ + background-color: rgba(41, 139, 142, 1); + color: white; + border:1px solid rgba(41, 139, 142, 1); +} + +
@@ -176,7 +187,15 @@ document.addEventListener("DOMContentLoaded", function () { exportOptions: { columns: ':not(:last-child)' } + }, + { + text: 'ADD', + className: 'btn btn-color', + action: function () { + window.location.href = ""; + } } + ], diff --git a/app/Views/tpa_onboarding.php b/app/Views/tpa_onboarding.php index 2d6196aa..107d61f9 100755 --- a/app/Views/tpa_onboarding.php +++ b/app/Views/tpa_onboarding.php @@ -39,7 +39,7 @@ body {

TPA

- "> + ">
@@ -461,7 +469,8 @@ $(document).ready(function() { dom: "<'row'<'col-sm-0'f><'col-sm-9 text-right'B>>" + "<'row'<'col-sm-12'tr>>" + "<'row'<'col-sm-5'i><'col-sm-7'p>>", - buttons: [{ + buttons: [ + { extend: 'csv', text: 'CSV', title: 'Vehicle-Master-List', @@ -469,7 +478,19 @@ $(document).ready(function() { exportOptions: { columns: ':not(:last-child)' }, - }], + }, + { + text: 'ADD', + className: 'btn-color', + attr: { + id: 'btnAdd', + title: 'Add' + }, + action: function () { + showModal('add') + } + } + ], language: { search: "_INPUT_", searchPlaceholder: "Search..." diff --git a/app/Views/view_deposit.php b/app/Views/view_deposit.php index 30ee261a..3f18ce81 100755 --- a/app/Views/view_deposit.php +++ b/app/Views/view_deposit.php @@ -86,7 +86,7 @@ diff --git a/app/Views/view_rfq.php b/app/Views/view_rfq.php index 9e906235..87085a6d 100644 --- a/app/Views/view_rfq.php +++ b/app/Views/view_rfq.php @@ -567,7 +567,7 @@
- > + >
@@ -591,7 +591,7 @@
- > + >
diff --git a/app/Views/view_rfq_non_eb.php b/app/Views/view_rfq_non_eb.php index 8e75cf94..89cf7748 100644 --- a/app/Views/view_rfq_non_eb.php +++ b/app/Views/view_rfq_non_eb.php @@ -461,7 +461,7 @@
- > + >
@@ -485,7 +485,7 @@
- > + >
diff --git a/composer.json b/composer.json index bbe0843f..e86456ca 100755 --- a/composer.json +++ b/composer.json @@ -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", diff --git a/public/assets/images/active_bds.png b/public/assets/images/active_bds.png new file mode 100644 index 00000000..c0a1b32f Binary files /dev/null and b/public/assets/images/active_bds.png differ diff --git a/public/assets/images/active_claims.png b/public/assets/images/active_claims.png new file mode 100644 index 00000000..2ef84f75 Binary files /dev/null and b/public/assets/images/active_claims.png differ diff --git a/public/assets/images/active_leads_and_bds_renewal.png b/public/assets/images/active_leads_and_bds_renewal.png new file mode 100644 index 00000000..327d5d8c Binary files /dev/null and b/public/assets/images/active_leads_and_bds_renewal.png differ diff --git a/public/assets/images/active_pending_actions.png b/public/assets/images/active_pending_actions.png new file mode 100644 index 00000000..aadbcb25 Binary files /dev/null and b/public/assets/images/active_pending_actions.png differ diff --git a/public/assets/images/inactive_bds.png b/public/assets/images/inactive_bds.png new file mode 100644 index 00000000..4bc9aa57 Binary files /dev/null and b/public/assets/images/inactive_bds.png differ diff --git a/public/assets/images/inactive_claims.png b/public/assets/images/inactive_claims.png new file mode 100644 index 00000000..c405503c Binary files /dev/null and b/public/assets/images/inactive_claims.png differ diff --git a/public/assets/images/inactive_leads_and_bds_renewal.png b/public/assets/images/inactive_leads_and_bds_renewal.png new file mode 100644 index 00000000..b34db30e Binary files /dev/null and b/public/assets/images/inactive_leads_and_bds_renewal.png differ diff --git a/public/assets/images/inactive_pending_actions.png b/public/assets/images/inactive_pending_actions.png new file mode 100644 index 00000000..b75a15f4 Binary files /dev/null and b/public/assets/images/inactive_pending_actions.png differ diff --git a/public/assets/js/pages/treeview.init.js b/public/assets/js/pages/treeview.init.js index 400c7029..33a26040 100755 --- a/public/assets/js/pages/treeview.init.js +++ b/public/assets/js/pages/treeview.init.js @@ -1 +1 @@ -$(document).ready(function(){$("#basicTree").jstree({core:{themes:{responsive:!1}},types:{default:{icon:"mdi mdi-folder-star text-warning"},file:{icon:"mdi mdi-file text-primary"}},plugins:["types"]}),$("#checkTree").jstree({core:{themes:{responsive:!1}},types:{default:{icon:"fa fa-folder text-warning"},file:{icon:"fa fa-file text-primary"}},plugins:["types","checkbox"]}),$("#dragTree").jstree({core:{check_callback:!0,themes:{responsive:!1}},types:{default:{icon:"fa fa-folder text-warning"},file:{icon:"fa fa-file text-primary"}},plugins:["types","dnd"]}),$("#ajaxTree").jstree({core:{check_callback:!0,themes:{responsive:!1},data:{url:function(e){return"#"===e.id?"../assets/data/ajax_roots.json":"../assets/data/ajax_children.json"},data:function(e){return{id:e.id}}}},types:{default:{icon:"fa fa-folder text-warning"},file:{icon:"fa fa-file text-primary"}},plugins:["contextmenu","dnd","search","state","types","wholerow"]})}); \ No newline at end of file +$(document).ready(function(){$("#basicTree").jstree({core:{themes:{responsive:!1}},types:{default:{icon:"mdi mdi-folder-star text-warning"},file:{icon:"mdi mdi-file text-primary"}},plugins:["types"]}),$("#checkTree").jstree({core:{themes:{responsive:!1}},types:{default:{icon:"fa fa-folder text-warning"},file:{icon:"mdi mdi-file text-primary"}},plugins:["types","checkbox"]}),$("#dragTree").jstree({core:{check_callback:!0,themes:{responsive:!1}},types:{default:{icon:"fa fa-folder text-warning"},file:{icon:"mdi mdi-file text-primary"}},plugins:["types","dnd"]}),$("#ajaxTree").jstree({core:{check_callback:!0,themes:{responsive:!1},data:{url:function(e){return"#"===e.id?"../assets/data/ajax_roots.json":"../assets/data/ajax_children.json"},data:function(e){return{id:e.id}}}},types:{default:{icon:"fa fa-folder text-warning"},file:{icon:"mdi mdi-file text-primary"}},plugins:["contextmenu","dnd","search","state","types","wholerow"]})}); \ No newline at end of file diff --git a/public/assets/libs/bootstrap-daterangepicker/index.html b/public/assets/libs/bootstrap-daterangepicker/index.html index 4621257c..459d6138 100755 --- a/public/assets/libs/bootstrap-daterangepicker/index.html +++ b/public/assets/libs/bootstrap-daterangepicker/index.html @@ -31,7 +31,7 @@