prepare(" SELECT xi.*, p.name as patient_name, p.gender, p.dob, p.phone, d.name_$lang as doctor_name FROM xray_inquiries xi LEFT JOIN patients p ON xi.patient_id = p.id LEFT JOIN visits v ON xi.visit_id = v.id LEFT JOIN employees d ON v.doctor_id = d.id WHERE xi.id = ? "); $stmt->execute([$id]); $inquiry = $stmt->fetch(); if (!$inquiry) { die("Inquiry not found"); } // Fetch Items $stmt = $db->prepare(" SELECT it.*, t.name_$lang as xray_name FROM xray_inquiry_items it JOIN xray_tests t ON it.xray_id = t.id WHERE it.inquiry_id = ? "); $stmt->execute([$id]); $items = $stmt->fetchAll(); ?> X-Ray Inquiry #<?php echo $id; ?>

X-Ray Report

Inquiry #
Patient:
Gender/Age: y . ' Years'; ?>
Doctor:
Source:
Examination Results
X-Ray Examination Result / Findings
Attachment available online
Notes

Generated by Clinic Management System on