prepare(
"SELECT
pr.id as prescription_id,
pr.prescription_date,
pr.medication,
pr.dosage,
pr.frequency,
p.patient_name,
p.id as patient_id,
u.username as doctor_name
FROM prescriptions pr
JOIN patients p ON pr.patient_id = p.id
JOIN users u ON pr.doctor_id = u.id
WHERE pr.status = 'Prescribed'
ORDER BY pr.prescription_date ASC"
);
$pending_prescriptions_stmt->execute();
$pending_prescriptions = $pending_prescriptions_stmt->fetchAll(PDO::FETCH_ASSOC);
?>
Pharmacy Dashboard
Pharmacy - Pending Prescriptions
Date Prescribed
Patient
Doctor
Medication
Dosage
Frequency
Action
No pending prescriptions found.
= date("d M, Y", strtotime($prescription['prescription_date'])) ?>