[ Root System Explorer ]
Location:
Root
/
home
/
u784288082
/
domains
/
dranujagrawal.com
/
public_html
/
include
+ Folder
+ File
Upload
Editing: bot.php
<style> :root { --primary: #0066ff; --primary-soft: rgba(0, 102, 255, 0.12); --accent: #00c9a7; --bg-deep: #050816; --text-main: #111827; --text-light: #6b7280; --bot-bg: #f3f4ff; } /* Floating tooltip */ #botTooltip { position: fixed; left: 38px; bottom: 110px; background: linear-gradient(135deg, #2a240f, #a48543); color: #fff; padding: 10px 14px; border-radius: 14px; font-size: 13px; font-weight: 500; box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45); z-index: 9998; opacity: 0; transform: translateY(8px); pointer-events: none; transition: all 0.35s ease; } /* Tooltip arrow */ #botTooltip::after { content: ""; position: absolute; bottom: -6px; left: 24px; width: 12px; height: 12px; background: linear-gradient(135deg, #2a240f, #a48543); transform: rotate(45deg); } /* Show tooltip */ #botTooltip.show { opacity: 1; transform: translateY(0); } /* Responsive positioning */ @media screen and (max-width: 575px) { #botTooltip { left: 34px; bottom: 90px; font-size: 12px; } } /* Floating AI bot button */ #botButton { position: fixed; left: 38px; bottom: 30px; /* background: #664712ff; color: #fff; */ width: 70px; height: 70px; border-radius: 999px; display: flex; align-items: center; justify-content: center; font-size: 26px; cursor: pointer; /* box-shadow: 0 18px 35px rgba(15, 23, 42, 0.45); */ z-index: 9999; /* border: 1px solid rgba(255, 255, 255, 0.2); */ transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s; } #botButton:hover { transform: translateY(-3px) scale(1.04); box-shadow: 0 22px 45px rgba(15, 23, 42, 0.6); } /* Bot Chat Box */ #chatBox { position: fixed; left: 20px; bottom: 110px; width: 360px; max-width: calc(100% - 40px); height: 340px; background: rgba(255, 255, 255, 0.96); border-radius: 16px; display: none; flex-direction: column; box-shadow: 0 24px 60px rgba(15, 23, 42, 0.55); overflow: hidden; z-index: 9999; border: 1px solid rgba(148, 163, 184, 0.4); backdrop-filter: blur(18px); transform: translateY(10px); opacity: 0; transition: all 0.22s ease-out; } #chatBox.active { display: flex; opacity: 1; transform: translateY(0); } #chatHeader { background: linear-gradient(135deg, #2a240f, #a48543); color: #fff; padding: 12px 14px; display: flex; align-items: center; justify-content: space-between; } #chatHeader-left { display: flex; align-items: center; gap: 10px; } .bot-avatar { width: 34px; height: 34px; border-radius: 999px; background: radial-gradient(circle at 30% 30%, #60a5fa, #22d3ee); display: flex; align-items: center; justify-content: center; font-size: 18px; box-shadow: 0 6px 18px rgba(15, 23, 42, 0.65); } .bot-title { font-size: 15px; font-weight: 600; line-height: 1.2; } .bot-subtitle { font-size: 11px; color: #cbd5f5; } #chatHeader-right { font-size: 11px; color: #cbd5f5; } #chatMessages { flex: 1; padding: 12px; overflow-y: auto; font-size: 14px; background: radial-gradient(circle at top, #eef2ff 0, #ffffff 40%); display: flex; flex-direction: column; gap: 8px; } .msg { padding: 8px 10px; margin-bottom: 2px; border-radius: 12px; max-width: 82%; display: inline-block; line-height: 1.35; word-wrap: break-word; white-space: pre-wrap; } .bot { background: var(--bot-bg); align-self: flex-start; border-bottom-left-radius: 4px; border: 1px solid rgba(129, 140, 248, 0.25); } .user { background: #635228; color: #fff; align-self: flex-end; border-bottom-right-radius: 4px; box-shadow: 0 8px 18px rgba(37, 99, 235, 0.45); } .meta-text { font-size: 11px; color: var(--text-light); margin-top: 2px; } #chatInputBox { display: flex; border-top: 1px solid rgba(209, 213, 219, 0.8); background: #f9fafb; padding: 6px; align-items: center; gap: 6px; } #chatInput { flex: 1; padding: 7px 10px; border: 1px solid rgba(209, 213, 219, 0.9); border-radius: 999px; outline: none; font-size: 13px; background: #ffffff; } #chatInput::placeholder { color: #9ca3af; } #sendBtn { padding: 7px 14px; background: #111827; color: #fff; border: none; border-radius: 999px; cursor: pointer; font-size: 12px; display: flex; align-items: center; gap: 6px; text-transform: uppercase; letter-spacing: 0.06em; } #sendBtn span { font-size: 13px; } #sendBtn:hover { background: #020617; } /* Option buttons row */ .options-row { margin-top: 6px; display: flex; flex-wrap: wrap; gap: 6px; } .option-pill { border-radius: 999px; border: 1px solid rgba(148, 163, 184, 0.7); padding: 6px 10px; background: #ffffff; cursor: pointer; font-size: 12px; display: inline-flex; align-items: center; gap: 6px; box-shadow: 0 4px 10px rgba(148, 163, 184, 0.35); transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease; } .option-pill span.icon { font-size: 14px; } .option-pill:hover { transform: translateY(-1px); background: #eff6ff; box-shadow: 0 6px 14px rgba(37, 99, 235, 0.35); } /* Contact form */ .form-container { background: #f9fafb; padding: 10px; border-radius: 12px; margin-top: 8px; border: 1px solid rgba(209, 213, 219, 0.9); } .form-container h4 { margin: 0 0 6px 0; font-size: 14px; font-weight: 600; color: #111827; } .form-container small { font-size: 11px; color: #6b7280; } .form-container input, .form-container textarea { width: 100%; padding: 7px 8px; margin-top: 6px; border: 1px solid rgba(209, 213, 219, 0.9); border-radius: 8px; outline: none; font-size: 13px; } .form-container textarea { min-height: 60px; resize: vertical; } .form-container button { margin-top: 8px; padding: 7px 10px; background: #655329; color: white; border: none; border-radius: 999px; cursor: pointer; font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; } .form-container button:hover { opacity: 0.95; } /* Scrollbar subtle style */ #chatMessages::-webkit-scrollbar { width: 6px; } #chatMessages::-webkit-scrollbar-track { background: transparent; } #chatMessages::-webkit-scrollbar-thumb { background: rgba(148, 163, 184, 0.7); border-radius: 999px; } @media screen and (max-width: 1440px) { /* Back to top button */ #botButton { left: 30px; } } @media screen and (max-width: 1199px) { /* Back to top button */ #botButton { width: 60px; height: 60px; bottom: 35px; } } @media screen and (max-width: 991px) { /* Back to top button */ #botButton { width: 55px; height: 55px; bottom: 38px; left: 30px; } #botButton::after { font-size: 18px; line-height: 18px; } } @media screen and (max-width: 767px) { /* Back to top button */ #botButton { width: 50px; height: 50px; left: 30px; bottom: 30px; } } @media screen and (max-width: 575px) { /* Back to top button */ #botButton { width: 47px; height: 47px; left: 34px; bottom: 16px; } #botButton::after { font-size: 16px; line-height: 16px; } } </style> <!-- Floating Chat Button --> <div id="botButton" aria-label="Open health assistant"> <!-- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 640" height="35px" width="35px"> <path fill="#f0f2f5" d="M352 64C352 46.3 337.7 32 320 32C302.3 32 288 46.3 288 64L288 128L192 128C139 128 96 171 96 224L96 448C96 501 139 544 192 544L448 544C501 544 544 501 544 448L544 224C544 171 501 128 448 128L352 128L352 64zM160 432C160 418.7 170.7 408 184 408L216 408C229.3 408 240 418.7 240 432C240 445.3 229.3 456 216 456L184 456C170.7 456 160 445.3 160 432zM280 432C280 418.7 290.7 408 304 408L336 408C349.3 408 360 418.7 360 432C360 445.3 349.3 456 336 456L304 456C290.7 456 280 445.3 280 432zM400 432C400 418.7 410.7 408 424 408L456 408C469.3 408 480 418.7 480 432C480 445.3 469.3 456 456 456L424 456C410.7 456 400 445.3 400 432zM224 240C250.5 240 272 261.5 272 288C272 314.5 250.5 336 224 336C197.5 336 176 314.5 176 288C176 261.5 197.5 240 224 240zM368 288C368 261.5 389.5 240 416 240C442.5 240 464 261.5 464 288C464 314.5 442.5 336 416 336C389.5 336 368 314.5 368 288zM64 288C64 270.3 49.7 256 32 256C14.3 256 0 270.3 0 288L0 384C0 401.7 14.3 416 32 416C49.7 416 64 401.7 64 384L64 288zM608 256C590.3 256 576 270.3 576 288L576 384C576 401.7 590.3 416 608 416C625.7 416 640 401.7 640 384L640 288C640 270.3 625.7 256 608 256z" /> </svg> --> <img src="assets/img/assistant.png" alt="assistant" style="height: 80px; border-radius: 15px;"> </div> <div id="botTooltip"> π¬ How can I assist you? </div> <!-- Chat Box --> <div id="chatBox"> <div id="chatHeader"> <div id="chatHeader-left"> <div class="bot-avatar">A</div> <div> <div class="bot-title">Dr. Anuj Agrawal</div> <div class="bot-subtitle">- Orthopaedic & Robotic Joint Replacement Surgeon</div> </div> </div> <div id="chatHeader-right"> <div>Online<span style="color:#22c55e;">β</span></div> </div> </div> <div id="chatMessages"></div> <div id="chatInputBox"> <input type="text" id="chatInput" placeholder="Type a question or pick an optionβ¦" style="color:black;" /> <button id="sendBtn"> <span>Send</span> <span>β€</span> </button> </div> </div> <script> /* CONFIG */ const DOCTOR_NAME = "Dr. Anuj Agrawal"; const CONTACT_NUMBER = "<?= $phone ?>"; const WHATSAPP_NUMBER = "<?= $phone ?>"; const SERVICES = [ " 1. Knee Replacement Surgery", "2. Hip Replacement Surgery", "3. Partial Knee Replacement ", "4. Trauma & Fracture Management", "5. Deformity Correction Surgery", "6. Orthopaedic Oncology ", "7. Arthritis & Joint Pain Management", "8. Sports Injury Treatment", "9. Post-Operative Rehabilitation" ]; const botButton = document.getElementById("botButton"); const chatBox = document.getElementById("chatBox"); const chatMessages = document.getElementById("chatMessages"); const chatInput = document.getElementById("chatInput"); const botTooltip = document.getElementById("botTooltip"); // Show tooltip on load setTimeout(() => { botTooltip.classList.add("show"); }, 1200); // Auto hide after 6 seconds setTimeout(() => { botTooltip.classList.remove("show"); }, 7000); // Show tooltip again on hover botButton.addEventListener("mouseenter", () => { if (!chatBox.classList.contains("active")) { botTooltip.classList.add("show"); } }); // Hide tooltip when chat opens or mouse leaves botButton.addEventListener("mouseleave", () => { botTooltip.classList.remove("show"); }); botButton.addEventListener("click", () => { botTooltip.classList.remove("show"); }); /* Toggle Chat Box */ botButton.addEventListener("click", () => { if (chatBox.classList.contains("active")) { chatBox.classList.remove("active"); setTimeout(() => { chatBox.style.display = "none"; }, 200); } else { chatBox.style.display = "flex"; setTimeout(() => chatBox.classList.add("active"), 10); chatMessages.innerHTML = ""; showOptions(); } }); /* Close chat when clicking outside */ document.addEventListener("click", function(event) { const isChatOpen = chatBox.classList.contains("active"); // If chat is open and click is NOT inside chatBox or botButton if ( isChatOpen && !chatBox.contains(event.target) && !botButton.contains(event.target) ) { chatBox.classList.remove("active"); setTimeout(() => { chatBox.style.display = "none"; }, 200); } }); document.addEventListener("keydown", function(e) { if (e.key === "Escape" && chatBox.classList.contains("active")) { chatBox.classList.remove("active"); setTimeout(() => { chatBox.style.display = "none"; }, 200); } }); /* Send Message */ document.getElementById("sendBtn").addEventListener("click", sendMessage); chatInput.addEventListener("keypress", e => { if (e.key === "Enter") sendMessage(); }); function sendMessage() { const text = chatInput.value.trim(); if (!text) return; addMessage(text, "user"); chatInput.value = ""; if (option !== "appointment") { showOptions(); } } /* Add message bubble */ function addMessage(text, type) { const msgBox = document.createElement("div"); msgBox.className = `msg ${type}`; msgBox.innerHTML = text.replace(/\n/g, "<br>"); chatMessages.appendChild(msgBox); msgBox.scrollIntoView({ behavior: "smooth", block: "end" }); } /* Show 4 pill options */ function showOptions() { const btnBox = document.createElement("div"); btnBox.className = "options-row"; btnBox.innerHTML = ` <button class="option-pill" onclick="handleOption('appointment')"> <span class="icon">π </span> <span>Appointment</span> </button> <button class="option-pill" onclick="handleOption('contact')"> <span class="icon">π</span> <span>Contact Number</span> </button> <button class="option-pill" onclick="handleOption('whatsapp')"> <span class="icon">π’</span> <span>WhatsApp</span> </button> <button class="option-pill" onclick="handleOption('services')"> <span class="icon">π</span> <span>Services</span> </button> `; chatMessages.appendChild(btnBox); btnBox.scrollIntoView({ behavior: "smooth", block: "end" }); } /* Handle actions */ function handleOption(option) { if (option === "appointment") { addMessage("I want to book an appointment.", "user"); addMessage("Certainly. Please share a few details below.", "bot"); showForm(); } function showForm() { const formHTML = ` <form class="form-container"> <h4>Book an Appointment</h4> <small>We will connect you on WhatsApp.</small> <input id="fName" placeholder="Full Name *"> <input type="number" id="fPhone" placeholder="Phone Number *"> <textarea id="fMsg" placeholder="Describe your concern (optional)"></textarea> <button type="button" onclick="submitForm(event)">Submit Request</button> </form> `; const msgDiv = document.createElement("div"); msgDiv.innerHTML = formHTML; chatMessages.appendChild(msgDiv); msgDiv.scrollIntoView({ behavior: "smooth", block: "end" }); } if (option === "contact") { addMessage("Contact number, please.", "user"); const callLink = `tel:${CONTACT_NUMBER.replace(/ /g, "")}`; addMessage( `π <b>Tap below to call the clinic:</b><br><br>` + `${CONTACT_NUMBER}<br><br>` + `<a href="${callLink}" style="color:#1d4ed8; text-decoration:underline; font-weight:bold;">π Click to Call</a>`, "bot" ); } if (option === "whatsapp") { addMessage("WhatsApp details.", "user"); const cleanNumber = WHATSAPP_NUMBER.replace(/\D/g, ""); const defaultText = "Hello, I would like to connect with Dr. Mona Verma."; const whatsappURL = `https://wa.me/${cleanNumber}?text=${encodeURIComponent(defaultText)}`; addMessage( `π’ <b>Tap below to chat on WhatsApp:</b><br><br>` + `${WHATSAPP_NUMBER}<br><br>` + `<a href="${whatsappURL}" target="_blank" style="color:#16a34a; text-decoration:underline; font-weight:bold;">π Open WhatsApp</a>`, "bot" ); } if (option === "services") { addMessage("What treatments do you provide?", "user"); addMessage( "We offer the following key services:<br><br>" + SERVICES.map(s => "β’ " + s).join("<br>"), "bot" ); } showOptions(); } function submitForm(event) { event.preventDefault(); const name = document.getElementById("fName")?.value.trim(); const phone = document.getElementById("fPhone")?.value.trim(); const message = document.getElementById("fMsg")?.value.trim(); if (!name) { alert("Please enter your full name."); return; } if (!phone || !/^[0-9+\-\s]{8,15}$/.test(phone)) { alert("Please enter a valid phone number."); return; } const whatsappNumber = "<?= $phone ?>"; // β Clean number const cleanNumber = whatsappNumber.replace(/\D/g, ""); // β Proper encoding const text = `New Appointment Request: Name: ${name} Phone: ${phone} Message: ${message || "N/A"}`; const whatsappURL = `https://wa.me/${cleanNumber}?text=${encodeURIComponent(text)}`; window.open(whatsappURL, "_blank"); addMessage("β Redirecting you to WhatsApp to complete your request.", "bot"); } </script>
SAVE CHANGES
[ CANCEL ]
Name
Type
Actions
.. (Parent Directory)
π bot.php
FILE
Ren
[EDIT]
DEL
π connection.php
FILE
Ren
[EDIT]
DEL
π footer.php
FILE
Ren
[EDIT]
DEL
π head.php
FILE
Ren
[EDIT]
DEL
π header.php
FILE
Ren
[EDIT]
DEL
π script.php
FILE
Ren
[EDIT]
DEL