/home/u775757334/domains/civicwelllife.com/public_html
Edit: /home/u775757334/domains/civicwelllife.com/public_html/doctor-profile.php (32002B)
tbl_doctor_sp
------------------------------ */
$speciality_list = getNamesFromIds(
$conn,
"tbl_doctor_sp",
"id",
"name",
$doctorRow['category_id']
);
/* -----------------------------
5) disease/problem fetch karo
problem_id => tbl_disease_category
------------------------------ */
$problem_list = getNamesFromIds(
$conn,
"tbl_disease_category",
"id",
"name",
$doctorRow['problem_id']
);
/* -----------------------------
6) doctor main array banao
same keys rakho jo tum html me use kar rahe ho
------------------------------ */
$doctor = [
"id" => $doctorRow['id'],
"name" => $doctorRow['name'],
"status" => !empty($doctorRow['status']) ? $doctorRow['status'] : "Available",
"speciality" => !empty($speciality_list) ? implode(', ', $speciality_list) : "General Consultation",
"degree" => !empty($doctorRow['eduaction']) ? $doctorRow['eduaction'] : "Qualification Not Added",
"experience_years" => !empty($doctorRow['experience']) ? $doctorRow['experience'] . " Years of Experience" : "Experience Not Added",
"about" => !empty($doctorRow['about']) ? $doctorRow['about'] : "Doctor information will be updated soon.",
"clinic_name" => !empty($doctorRow['hospital_name']) ? $doctorRow['hospital_name'] : "Clinic Not Added",
"consultation_fee" => !empty($doctorRow['consultation_fee']) ? "₹" . $doctorRow['consultation_fee'] : "N/A",
/* ye abhi static rakh diye */
"member_fee" => "₹150",
"member_old_fee" => !empty($doctorRow['consultation_fee']) ? "₹" . $doctorRow['consultation_fee'] : "₹200",
"member_discount" => "25% off",
"image" => !empty($doctorRow['image1']) ? "media/image/" . $doctorRow['image1'] : "images/doctor-placeholder.jpg"
];
/* -----------------------------
7) timings fetch karo
tbl_timming se
------------------------------ */
$timings = [];
$sqlTiming = mysqli_query($conn, "SELECT * FROM tbl_timmng WHERE doctor_id = '$doctor_id' ORDER BY id ASC");
if ($sqlTiming && mysqli_num_rows($sqlTiming) > 0) {
while ($timeRow = mysqli_fetch_assoc($sqlTiming)) {
$timeParts = [];
// Morning
if (!empty($timeRow['start_timming'])) {
$timeParts[] = $timeRow['start_timming'];
}
// Evening
if (!empty($timeRow['evening_time'])) {
$timeParts[] = $timeRow['evening_time'];
}
// Combine
$timeText = !empty($timeParts) ? implode(" & ", $timeParts) : "Closed";
$timings[] = [
"day" => $timeRow['day'],
"time" => $timeText
];
}
} else {
$timings[] = [
"day" => "Monday - Sunday",
"time" => !empty($doctorRow['timimg']) ? $doctorRow['timimg'] : "Time not available"
];
}
/* -----------------------------
8) education array
abhi simple rakha hai
------------------------------ */
$education = [
[
"course" => !empty($doctorRow['eduaction']) ? $doctorRow['eduaction'] : "Qualification Not Added",
"institute" => "Institute details will be updated soon",
"year" => ""
]
];
/* -----------------------------
9) experience array
abhi simple rakha hai
------------------------------ */
$experience = [
[
"designation" => "Doctor",
"hospital" => !empty($doctorRow['hospital_name']) ? $doctorRow['hospital_name'] : "Hospital Not Added",
"duration" => !empty($doctorRow['experience']) ? $doctorRow['experience'] . " Years" : "N/A"
]
];
/* -----------------------------
10) faq fetch karo
------------------------------ */
$faqs = [];
$sqlFaq = mysqli_query($conn, "SELECT * FROM tbl_faq WHERE doctor_id = '$doctor_id' ORDER BY id DESC");
if ($sqlFaq && mysqli_num_rows($sqlFaq) > 0) {
while ($faqRow = mysqli_fetch_assoc($sqlFaq)) {
$faqs[] = [
"question" => $faqRow['question'],
"answer" => $faqRow['answer']
];
}
} else {
/* fallback static faq */
$faqs[] = [
"question" => "How can I book an appointment?",
"answer" => "You can click on the Book Appointment button to continue."
];
}
/* -----------------------------
11) meta tags dynamic
------------------------------ */
$blogs = [];
$sqlBlog = mysqli_query($conn, "SELECT * FROM tbl_blog WHERE doctor_id = '$doctor_id' ORDER BY id DESC");
if ($sqlBlog && mysqli_num_rows($sqlBlog) > 0) {
while ($blogRow = mysqli_fetch_assoc($sqlBlog)) {
$blogs[] = [
"id" => $blogRow['id'],
"image" => $blogRow['image1'],
"heading" => $blogRow['heading'],
"description" => substr(strip_tags($blogRow['short_description']), 0, 150) . "..."
];
}
} else {
/* fallback */
$blogs[] = [
"id" => "1",
"image" => "default.jpg",
"heading" => "Health Tips for Better Living",
"description" => "Simple lifestyle changes can improve your health and prevent diseases. Regular exercise, balanced diet, and stress management are key."
];
}
$testimonials = [];
$sqlTestimonial = mysqli_query($conn, "SELECT * FROM tbl_testimonial WHERE doctor_id = '$doctor_id' ORDER BY id DESC");
if ($sqlTestimonial && mysqli_num_rows($sqlTestimonial) > 0) {
while ($row = mysqli_fetch_assoc($sqlTestimonial)) {
$testimonials[] = [
"name" => $row['name'],
"description" => $row['description']
];
}
} else {
/* fallback */
$testimonials[] = [
"name" => "Rahul Sharma",
"description" => "Very good doctor, highly recommended. Treatment was effective and consultation was smooth."
];
}
$meta_title = $doctor['name'] . " - Doctor Profile";
$meta_keyword = $doctor['name'] . ", " . $doctor['speciality'] . ", " . $doctor['degree'] . ", Doctor Profile";
$meta_description = "Consult " . $doctor['name'] . ", specialist in " . $doctor['speciality'] . " with " . $doctor['experience_years'] . ".";
?>
= $meta_title ?>
= $doctor['status']; ?>
Trusted Specialist
= htmlspecialchars($doctor['name']); ?>
= $doctor['speciality']; ?>
= $doctor['degree']; ?>
= $doctor['experience_years']; ?>
Expert in = !empty($problem_list) ? htmlspecialchars($problem_list[0]) : 'patient care'; ?>
and = htmlspecialchars($doctor['speciality']); ?> consultation
with over = htmlspecialchars($doctorRow['experience']); ?> years of clinical experience.
Available 7 Days
Fee = $doctor['consultation_fee']; ?>
= $doctor['clinic_name']; ?>
About Dr. Jyoti Gangwar
= $doctor['about']; ?>
= $doctor['clinic_name']; ?> Clinic(s)
= $doctor['clinic_name']; ?>
Consultation available every day
Available All Days
Day
Timing
= $item['day']; ?>
= $item['time']; ?>
Speciality
= htmlspecialchars($sp); ?>
General Consultation
= htmlspecialchars($problem); ?>
Education
= $edu['course']; ?>
= $edu['institute']; ?>
= $edu['year']; ?>
Experience
= $exp['designation']; ?>
= $exp['hospital']; ?>
= $exp['duration']; ?>
Common Questions & Answers
Patient Testimonials
“= $item['description']; ?>”
— = $item['name']; ?>