From af64affae4043e8d9c1e1ef2b166349a6b399f56 Mon Sep 17 00:00:00 2001 From: Srinivas-Saravanan Date: Mon, 3 Feb 2025 10:26:49 +0530 Subject: [PATCH] FEAT_CHATBOT_INIATED --- .../Chatbot/EcardDownloadConversation.php | 2 +- .../Chatbot/MainMenuConversation.php | 20 +++-- .../Chatbot}/NetworkHospitalConversation.php | 19 ++++- .../ReimbursementClaimProcessConversation.php | 47 +++++++++++ .../ReimbursementClaimStatusConversation.php | 47 +++++++++++ .../commonPolicyOptionConversations.php | 50 +++++++++++ .../doYouWantToContinueConversation.php | 48 +++++++++++ .../fourWheelerOptionsConversations.php | 50 +++++++++++ .../Chatbot/hospitalPolicyConversation.php | 49 +++++++++++ .../medicalClaimOptionConversations.php | 50 +++++++++++ .../Chatbot/policyConversation.php | 55 ++++++++++++ .../Chatbot/serviceExecutiveConversation.php | 60 ++++++++++++++ .../twoWheelerOptionsConversations.php | 50 +++++++++++ .../Chatbot/vehicleFormConversation.php | 83 +++++++++++++++++++ app/Controllers/ChatbotControllerNew.php | 4 +- app/Helpers/ChatbotHelper.php | 39 ++++++++- app/Models/EmployeePolicyModel.php | 13 +++ app/Views/chatbot.php | 4 +- composer.json | 2 +- 19 files changed, 678 insertions(+), 14 deletions(-) rename app/{ => Controllers/Chatbot}/NetworkHospitalConversation.php (61%) create mode 100644 app/Controllers/Chatbot/ReimbursementClaimProcessConversation.php create mode 100644 app/Controllers/Chatbot/ReimbursementClaimStatusConversation.php create mode 100644 app/Controllers/Chatbot/commonPolicyOptionConversations.php create mode 100644 app/Controllers/Chatbot/doYouWantToContinueConversation.php create mode 100644 app/Controllers/Chatbot/fourWheelerOptionsConversations.php create mode 100644 app/Controllers/Chatbot/hospitalPolicyConversation.php create mode 100644 app/Controllers/Chatbot/medicalClaimOptionConversations.php create mode 100644 app/Controllers/Chatbot/policyConversation.php create mode 100644 app/Controllers/Chatbot/serviceExecutiveConversation.php create mode 100644 app/Controllers/Chatbot/twoWheelerOptionsConversations.php create mode 100644 app/Controllers/Chatbot/vehicleFormConversation.php diff --git a/app/Controllers/Chatbot/EcardDownloadConversation.php b/app/Controllers/Chatbot/EcardDownloadConversation.php index 0cc82314..19fad42f 100644 --- a/app/Controllers/Chatbot/EcardDownloadConversation.php +++ b/app/Controllers/Chatbot/EcardDownloadConversation.php @@ -51,7 +51,7 @@ class EcardDownloadConversation extends Conversation $link = base_url().'/download-e-card/' . explode('#',$answer->getValue())[1].'/1'; $this->say('Click here to downlad: Ecard'); - $this->bot->startConversation(new EcardDownloadConversation()); // ✅ Restart the + $this->bot->startConversation(new doYouWantToContinueConversation()); // ✅ Restart the break; diff --git a/app/Controllers/Chatbot/MainMenuConversation.php b/app/Controllers/Chatbot/MainMenuConversation.php index 01b1c576..8a36512c 100644 --- a/app/Controllers/Chatbot/MainMenuConversation.php +++ b/app/Controllers/Chatbot/MainMenuConversation.php @@ -2,6 +2,7 @@ namespace App\Controllers\Chatbot; +use App\Helpers\ChatbotHelper; use BotMan\BotMan\Messages\Conversations\Conversation; use BotMan\BotMan\Messages\Outgoing\Question; use BotMan\BotMan\Messages\Outgoing\Actions\Button; @@ -28,24 +29,30 @@ class MainMenuConversation extends Conversation $this->bot->ask($question, function ($answer) { switch ($answer->getValue()) { case "ecard_download": - $this->say("📄 Ecard Download Menu:"); - $this->bot->startConversation(new EcardDownloadConversation()); + + $message = ChatbotHelper::get_payload_data(); + $this->say($message); + // $this->say("📄 Ecard Download Menu:"); + // $this->bot->startConversation(new EcardDownloadConversation()); break; case "network_hospital": - $this->say("🏥 Network Hospital Menu:"); + $this->say("🏥 Network Hospital Menu:");log_message('error','Network Hospital clicked'); $this->bot->startConversation(new NetworkHospitalConversation()); break; case "reimbursement_claim": - $this->say("Reimbursement Claim Process selected. (Dummy Response)"); + // $this->say("Reimbursement Claim Process selected. (Dummy Response)"); + $this->bot->startConversation(new ReimbursementClaimProcessConversation()); break; case "reimbursement_status": $this->say("Reimbursement Claim Status selected. (Dummy Response)"); + $this->bot->startConversation(new ReimbursementClaimStatusConversation()); + break; case "new_policy": - $this->say("New Policy selected. (Dummy Response)"); + $this->bot->startConversation(new policyConversation()); break; case "renew_policy": - $this->say("Renew Policy selected. (Dummy Response)"); + $this->bot->startConversation(new policyConversation()); break; default: $this->say("Invalid selection. Please choose an option."); @@ -54,4 +61,5 @@ class MainMenuConversation extends Conversation } }); } + } diff --git a/app/NetworkHospitalConversation.php b/app/Controllers/Chatbot/NetworkHospitalConversation.php similarity index 61% rename from app/NetworkHospitalConversation.php rename to app/Controllers/Chatbot/NetworkHospitalConversation.php index 70e71340..004b6ef6 100644 --- a/app/NetworkHospitalConversation.php +++ b/app/Controllers/Chatbot/NetworkHospitalConversation.php @@ -7,8 +7,12 @@ use BotMan\BotMan\Messages\Conversations\Conversation; use BotMan\BotMan\Messages\Outgoing\Question; use BotMan\BotMan\Messages\Outgoing\Actions\Button; +use App\Helpers\ChatbotHelper; + class NetworkHospitalConversation extends Conversation { + + public function run() { $this->showHospitalMenu(); @@ -26,10 +30,20 @@ class NetworkHospitalConversation extends Conversation $this->bot->ask($question, function ($answer) { switch ($answer->getValue()) { case "search_city": - $this->say("Searching by City... (Dummy Response)"); + $this->bot->ask("Enter the City Name",function ($response){ + // $cityName = $response->getText(); + $hospital_link = ChatbotHelper::getHospitalLink(); + $this->say("Searching for hospitals in ....."); + + $this->say('Click here for hospital details'); + $this->bot->startConversation(new doYouWantToContinueConversation()); + }); break; case "search_pincode": - $this->say("Searching by Pincode... (Dummy Response)"); + $this->bot->ask("Enter the Pincode",function ($response){ + $pincode = $response->getText(); + $this->say("Searching for hospitals in ".$pincode.'.....'); + }); break; case "go_back": $this->bot->startConversation(new MainMenuConversation()); @@ -41,4 +55,5 @@ class NetworkHospitalConversation extends Conversation } }); } + } diff --git a/app/Controllers/Chatbot/ReimbursementClaimProcessConversation.php b/app/Controllers/Chatbot/ReimbursementClaimProcessConversation.php new file mode 100644 index 00000000..b1cf1ec0 --- /dev/null +++ b/app/Controllers/Chatbot/ReimbursementClaimProcessConversation.php @@ -0,0 +1,47 @@ +claimProcess(); + } + + protected function claimProcess() + { + $question = Question::create("Do you Need Anything Else ?") + ->addButtons([ + Button::create("🔹 Yes I need some more Help")->value("yes"), + Button::create("🔹 No, Thank You")->value("no"), + // Button::create("◀️ Go Back")->value("go_back"), + ]); + + $this->bot->ask($question, function ($answer) { + switch ($answer->getValue()) { + case "yes": + + $this->say("Sure, How can I help you "); + $this->bot->startConversation(new MainMenuConversation()); + break; + case "no": + $this->say("Thank you for your time! If you need anything else, feel free to reach out. Goodbye!"); + break; + default: + $this->say("Invalid selection. Please choose an option."); + $this->askQuestion(); + break; + } + }); + } + +} diff --git a/app/Controllers/Chatbot/ReimbursementClaimStatusConversation.php b/app/Controllers/Chatbot/ReimbursementClaimStatusConversation.php new file mode 100644 index 00000000..4c6b58dc --- /dev/null +++ b/app/Controllers/Chatbot/ReimbursementClaimStatusConversation.php @@ -0,0 +1,47 @@ +claimStatus(); + } + + protected function claimStatus() + { + $question = Question::create("Do you Need Anything Else ?") + ->addButtons([ + Button::create("🔹 Yes I need some more Help")->value("yes"), + Button::create("🔹 No, Thank You")->value("no"), + // Button::create("◀️ Go Back")->value("go_back"), + ]); + + $this->bot->ask($question, function ($answer) { + switch ($answer->getValue()) { + case "yes": + + $this->say("Sure, How can I help you "); + $this->bot->startConversation(new MainMenuConversation()); + break; + case "no": + $this->say("Thank you for your time! If you need anything else, feel free to reach out. Goodbye!"); + break; + default: + $this->say("Invalid selection. Please choose an option."); + $this->askQuestion(); + break; + } + }); + } + +} diff --git a/app/Controllers/Chatbot/commonPolicyOptionConversations.php b/app/Controllers/Chatbot/commonPolicyOptionConversations.php new file mode 100644 index 00000000..e32c318b --- /dev/null +++ b/app/Controllers/Chatbot/commonPolicyOptionConversations.php @@ -0,0 +1,50 @@ +policyOptions(); + } + + protected function policyOptions() + { + $question = Question::create("Choose Policy Type:") + ->addButtons([ + Button::create("🔹 Upload Vehicle Details")->value("upload_vehicle_details"), + Button::create("🔹 Talk to our Service Executive")->value("service_executive"), + Button::create("◀️ Go Back")->value("go_back"), + ]); + + $this->bot->ask($question, function ($answer) { + switch ($answer->getValue()) { + case "upload_vehicle_details": + // $cityName = $response->getText(); + $this->bot->startConversation(new vehicleFormConversation()); + break; + case "service_executive": + $this->bot->startConversation(new serviceExecutiveConversation()); + break; + case "go_back": + $this->bot->startConversation(new MainMenuConversation()); + break; + default: + $this->say("Invalid selection. Please choose an option."); + $this->policyOptions(); + break; + } + }); + } + +} diff --git a/app/Controllers/Chatbot/doYouWantToContinueConversation.php b/app/Controllers/Chatbot/doYouWantToContinueConversation.php new file mode 100644 index 00000000..4da9aed7 --- /dev/null +++ b/app/Controllers/Chatbot/doYouWantToContinueConversation.php @@ -0,0 +1,48 @@ +askQuestion(); + } + + protected function askQuestion() + { + $question = Question::create("Do you Need Anything Else ?") + ->addButtons([ + Button::create("🔹 Yes I need some more Help")->value("yes"), + Button::create("🔹 No, Thank You")->value("no"), + // Button::create("◀️ Go Back")->value("go_back"), + ]); + + $this->bot->ask($question, function ($answer) { + switch ($answer->getValue()) { + case "yes": + + $this->say("Sure, How can I help you "); + $this->bot->startConversation(new MainMenuConversation()); + break; + case "no": + $this->say("Thank you for your time! If you need anything else, feel free to reach out. Goodbye!"); + break; + default: + $this->say("Invalid selection. Please choose an option."); + $this->askQuestion(); + break; + } + }); + } + +} diff --git a/app/Controllers/Chatbot/fourWheelerOptionsConversations.php b/app/Controllers/Chatbot/fourWheelerOptionsConversations.php new file mode 100644 index 00000000..6c850c03 --- /dev/null +++ b/app/Controllers/Chatbot/fourWheelerOptionsConversations.php @@ -0,0 +1,50 @@ +show4WOptions(); + } + + protected function show4WOptions() + { + $question = Question::create("Choose Policy Type:") + ->addButtons([ + Button::create("🔹 Comprehensive")->value("comp"), + Button::create("🔹 Third-Party Only")->value("3p"), + Button::create("◀️ Go Back")->value("go_back"), + ]); + + $this->bot->ask($question, function ($answer) { + switch ($answer->getValue()) { + case "3p": + // $cityName = $response->getText(); + $this->bot->startConversation(new commonPolicyOptionConversations()); + break; + case "comp": + $this->bot->startConversation(new commonPolicyOptionConversations()); + break; + case "go_back": + $this->bot->startConversation(new MainMenuConversation()); + break; + default: + $this->say("Invalid selection. Please choose an option."); + $this->showHospitalMenu(); + break; + } + }); + } + +} diff --git a/app/Controllers/Chatbot/hospitalPolicyConversation.php b/app/Controllers/Chatbot/hospitalPolicyConversation.php new file mode 100644 index 00000000..4a29c918 --- /dev/null +++ b/app/Controllers/Chatbot/hospitalPolicyConversation.php @@ -0,0 +1,49 @@ +showMediclaimPolicyOptions(); + } + + protected function showMediclaimPolicyOptions() + { + $question = Question::create("Choose Policy Type:") + ->addButtons([ + Button::create("🔹 Individual")->value("individual"), + Button::create("🔹 Floater")->value("floater"), + Button::create("◀️ Go Back")->value("go_back"), + ]); + + $this->bot->ask($question, function ($answer) { + switch ($answer->getValue()) { + case "individual": + $this->bot->startConversation(new commonPolicyOptionConversations()); + break; + case "floater": + $this->bot->startConversation(new commonPolicyOptionConversations()); + break; + case "go_back": + $this->bot->startConversation(new MainMenuConversation()); + break; + default: + $this->say("Invalid selection. Please choose an option."); + $this->showHospitalMenu(); + break; + } + }); + } + +} diff --git a/app/Controllers/Chatbot/medicalClaimOptionConversations.php b/app/Controllers/Chatbot/medicalClaimOptionConversations.php new file mode 100644 index 00000000..db66cda3 --- /dev/null +++ b/app/Controllers/Chatbot/medicalClaimOptionConversations.php @@ -0,0 +1,50 @@ +showMediclaimOptions(); + } + + protected function showMediclaimOptions() + { + $question = Question::create("Choose Policy Type:") + ->addButtons([ + Button::create("🔹 Individual")->value("individual"), + Button::create("🔹 Floater")->value("floater"), + Button::create("◀️ Go Back")->value("go_back"), + ]); + + $this->bot->ask($question, function ($answer) { + switch ($answer->getValue()) { + case "individual": + // $cityName = $response->getText(); + $this->bot->startConversation(new commonPolicyOptionConversations()); + break; + case "floater": + $this->bot->startConversation(new commonPolicyOptionConversations()); + break; + case "go_back": + $this->bot->startConversation(new MainMenuConversation()); + break; + default: + $this->say("Invalid selection. Please choose an option."); + $this->showHospitalMenu(); + break; + } + }); + } + +} diff --git a/app/Controllers/Chatbot/policyConversation.php b/app/Controllers/Chatbot/policyConversation.php new file mode 100644 index 00000000..9a3c2669 --- /dev/null +++ b/app/Controllers/Chatbot/policyConversation.php @@ -0,0 +1,55 @@ +showNewPolicy(); + } + + protected function showNewPolicy() + { + $question = Question::create("Choose Policy Type:") + ->addButtons([ + Button::create("🏍️ 2 Wheeler")->value("2_wheeler"), + Button::create("🚗 4 Wheeler")->value("4_wheeler"), + Button::create("🩺 Medical Claim")->value("mediclaim"), + Button::create("◀️ Go Back")->value("go_back"), + ]); + + $this->bot->ask($question, function ($answer) { + switch ($answer->getValue()) { + case "2_wheeler": + // $cityName = $response->getText(); + $this->bot->startConversation(new twoWheelerOptionsConversations()); + break; + case "4_wheeler": + $this->bot->startConversation(new fourWheelerOptionsConversations()); + break; + case "mediclaim": + $this->bot->startConversation(new medicalClaimOptionConversations()); + + break; + case "go_back": + $this->bot->startConversation(new MainMenuConversation()); + break; + default: + $this->say("Invalid selection. Please choose an option."); + $this->showHospitalMenu(); + break; + } + }); + } + +} diff --git a/app/Controllers/Chatbot/serviceExecutiveConversation.php b/app/Controllers/Chatbot/serviceExecutiveConversation.php new file mode 100644 index 00000000..64a3e842 --- /dev/null +++ b/app/Controllers/Chatbot/serviceExecutiveConversation.php @@ -0,0 +1,60 @@ +askServiceExecutive(); + } + + protected function askServiceExecutive() + { + $mobile = ChatbotHelper::getPhoneNumber(); // Assuming this fetches the user's phone number + $question = Question::create("Is this Your Mobile Number: $mobile") + ->addButtons([ + Button::create("✅ Yes")->value("yes"), + Button::create("❌ No")->value("no"), + Button::create("◀️ Go Back")->value("go_back"), + ]); + + $this->bot->ask($question, function ($answer) { + switch ($answer->getValue()) { + case "yes": + $this->say("Our executive will call you at the earliest."); + $this->bot->startConversation(new doYouWantToContinueConversation()); + break; + + case "no": + $this->ask('Enter Your Mobile Number?', function ($response) { + $this->mobile_number = $response->getText(); + $this->bot->userStorage()->save([ + 'mobile_number' => $this->mobile_number + ]); + // Use 'use' to bring the class context into the closure + $this->say("Our executive will call you at the earliest."); + $this->bot->startConversation(new doYouWantToContinueConversation()); + }); + break; + + case "go_back": + $this->bot->startConversation(new MainMenuConversation()); + break; + + default: + $this->say("Invalid selection. Please choose an option."); + $this->askServiceExecutive(); + break; + } + }); + } + +} diff --git a/app/Controllers/Chatbot/twoWheelerOptionsConversations.php b/app/Controllers/Chatbot/twoWheelerOptionsConversations.php new file mode 100644 index 00000000..44c1f4da --- /dev/null +++ b/app/Controllers/Chatbot/twoWheelerOptionsConversations.php @@ -0,0 +1,50 @@ +show2WOptions(); + } + + protected function show2WOptions() + { + $question = Question::create("Choose Policy Type:") + ->addButtons([ + Button::create("🔹 Third-Party")->value("3p"), + Button::create("🔹 Comprehensive")->value("comp"), + Button::create("◀️ Go Back")->value("go_back"), + ]); + + $this->bot->ask($question, function ($answer) { + switch ($answer->getValue()) { + case "3p": + // $cityName = $response->getText(); + $this->bot->startConversation(new commonPolicyOptionConversations()); + break; + case "comp": + $this->bot->startConversation(new commonPolicyOptionConversations()); + break; + case "go_back": + $this->bot->startConversation(new MainMenuConversation()); + break; + default: + $this->say("Invalid selection. Please choose an option."); + $this->showHospitalMenu(); + break; + } + }); + } + +} diff --git a/app/Controllers/Chatbot/vehicleFormConversation.php b/app/Controllers/Chatbot/vehicleFormConversation.php new file mode 100644 index 00000000..aa80c550 --- /dev/null +++ b/app/Controllers/Chatbot/vehicleFormConversation.php @@ -0,0 +1,83 @@ +askVehicleName(); + } + + protected function askVehicleName() + { + $this->ask('Enter Vehicle Name ?', function ($response) { + $this->vehicleName = $response->getText(); + if (empty($this->vehicleName)) { + $this->say('Vehicle Name Cannot be Empty'); + return $this->askVehicleName(); // Re-ask if empty + } + $this->askVehicleYOM(); // Ask next question + }); + } + + protected function askVehicleYOM() + { + $this->ask('Enter Vehicle Year of Manufacture ?', function ($response) { + $this->vehicleYOM = $response->getText(); + if (empty($this->vehicleYOM)) { + $this->say('Vehicle Year of Manufacture Cannot be Empty'); + return $this->askVehicleYOM(); // Re-ask if empty + } + $this->askVehicleEngineNo(); // Ask next question + }); + } + + protected function askVehicleEngineNo() + { + $this->ask('Enter Vehicle Engine Number ?', function ($response) { + $this->vehicleEngineNo = $response->getText(); + if (empty($this->vehicleEngineNo)) { + $this->say('Vehicle Engine Number Cannot be Empty'); + return $this->askVehicleEngineNo(); // Re-ask if empty + } + $this->askVehicleInvoiceNo(); // Ask next question + }); + } + + protected function askVehicleInvoiceNo() + { + $this->ask('Enter Vehicle Invoice Number ?', function ($response) { + $this->vehicleInvoiceNo = $response->getText(); + if (empty($this->vehicleInvoiceNo)) { + $this->say('Vehicle Invoice Number Cannot be Empty'); + return $this->askVehicleInvoiceNo(); // Re-ask if empty + } + $this->storeVehicleData(); // Proceed to store the data + }); + } + + protected function storeVehicleData() + { + // Save all collected data to user storage + $this->bot->userStorage()->save([ + 'vehicle_name' => $this->vehicleName, + 'vehicle_yom' => $this->vehicleYOM, + 'vehicle_engine_no' => $this->vehicleEngineNo, + 'vehicle_invoice_no' => $this->vehicleInvoiceNo + ]); + + $this->say('Vehicle Information Saved!'); + $this->bot->startConversation(new doYouWantToContinueConversation()); + + } +} diff --git a/app/Controllers/ChatbotControllerNew.php b/app/Controllers/ChatbotControllerNew.php index fc6bd75a..a43111eb 100644 --- a/app/Controllers/ChatbotControllerNew.php +++ b/app/Controllers/ChatbotControllerNew.php @@ -54,10 +54,12 @@ class ChatbotControllerNew extends BaseController { // Start the Main Menu when user says "hi" or "start" $this->botman->hears('start|hi|hello', function (BotMan $bot) { - $bot->reply('How how can i assit?'); + $bot->reply('Hi how can i assit?'); $bot->startConversation(new MainMenuConversation()); }); + + // $this->botman->hears('main_menu', function (BotMan $bot) { // BotService::sendMainOptions($bot); // }); diff --git a/app/Helpers/ChatbotHelper.php b/app/Helpers/ChatbotHelper.php index 0b547cd0..03abeeeb 100644 --- a/app/Helpers/ChatbotHelper.php +++ b/app/Helpers/ChatbotHelper.php @@ -5,6 +5,8 @@ namespace App\Helpers; use App\Models\EmployeeModel; use App\Models\CDMasterModel; +use App\Models\EmployeePolicyModel; +use App\Models\TPAModel; class ChatbotHelper { @@ -19,9 +21,44 @@ class ChatbotHelper $client_branch_id = 126; $relationship ='Father'; $EmployeeModel = new EmployeeModel(); - return $EmployeeModel->getEmpFamilybyEmpCode(emp_code: $emp_code,client_id: $client_id,emp_status: ['draft'],policy_status:['draft'],client_branch_id:[ $client_branch_id ],relationship:[$relationship]); + return $EmployeeModel->getEmpFamilybyEmpCode(emp_code: $emp_code,client_id: $client_id,emp_status: ['draft'],policy_status:['draft'],client_branch_id:[ $client_branch_id ],relationship:[$relationship]); } + public static function getHospitalLink(){ + $client_policy_id = 336; + $emp_id = 12288; + $EmployeePolicyModel = new EmployeePolicyModel(); + return $EmployeePolicyModel->getHospitalLinkByPolicyandEmp(336,12288); + } + + public static function getPhoneNumber(){ + $emp_id = 12288; + $EmployeeModel = new EmployeeModel(); + return $EmployeeModel->select('mobile')->where('id',$emp_id)->first()['mobile']; + } + + public static function get_payload_data(string $key = null) + { + // Get the request object using the service helper + $request = service('request'); + + // Get the raw input (JSON or other data) + $rawInput = $request->getBody(); + + // Check if the raw input is valid JSON + $payload = json_decode($rawInput, true); + + if (json_last_error() === JSON_ERROR_NONE) { + // JSON is valid, return the requested key or the entire payload + return $key ? ($payload[$key] ?? null) : $payload; + } else { + // JSON is invalid, fallback to raw input or POST data + $payload = $request->getRawInput() ?: $request->getPost(); + return $key ? ($payload[$key] ?? null) : $payload; + } + } + + } diff --git a/app/Models/EmployeePolicyModel.php b/app/Models/EmployeePolicyModel.php index 1d79f36d..67db3017 100755 --- a/app/Models/EmployeePolicyModel.php +++ b/app/Models/EmployeePolicyModel.php @@ -1744,4 +1744,17 @@ class EmployeePolicyModel extends Model return $result[0]; } + + public function getHospitalLinkByPolicyandEmp($client_policy_id,$emp_id){ + $data = $this->db->table('employee_polices') + ->select('tpa.network_hospitals') + ->where('client_policy_id', $client_policy_id) + ->where('employee_polices.is_active', 1) + ->join('tpa', 'tpa.id = employee_polices.tpa_id AND tpa.is_active = 1') + ->join('employees', 'employees.id = employee_polices.employee_id AND employees.id = ' . (int) $emp_id) + ->get()->getResultArray()[0]; + + // var_dump($this->db->getLastQuery()); + return $data; + } } \ No newline at end of file diff --git a/app/Views/chatbot.php b/app/Views/chatbot.php index 77adf697..adbeb587 100644 --- a/app/Views/chatbot.php +++ b/app/Views/chatbot.php @@ -24,8 +24,8 @@ var uid = Math.floor(100000 + Math.random() * 900000); console.log('CURRENT_USER' + uid); var botmanWidget = { - chatServer: "https://localhost/PHP828APPS/ruc/nhance/chat", // Make sure this URL is correct - frameEndpoint: 'https://localhost/PHP828APPS/ruc/nhance/widget', // This should match your CI4 + chatServer: ``, // Make sure this URL is correct + frameEndpoint: ``, // This should match your CI4 title: "Ask ஆதிரை", introMessage: "", bubbleBackground: "#007bff", diff --git a/composer.json b/composer.json index 467fb3a4..bbe0843f 100755 --- a/composer.json +++ b/composer.json @@ -27,7 +27,7 @@ "psr/http-message": "^1.0", "psr/log": "^1.1", "slim/slim": "^4.13", - "symfony/cache": "^7.2", + "symfony/cache": "^6.0", "zircote/swagger-php": "^4.8" }, "require-dev": {