Billing
Manage outstanding payments.
Pending Payments
| Patient Name | Doctor | Service Rendered | Cost | Action |
|---|---|---|---|---|
| Dr. | $ | Invoice | ||
| No pending payments. | ||||
prepare("UPDATE patients SET payment_status = 'paid' WHERE id = ?"); $stmt->execute([$patient_id_to_update]); // Redirect to avoid form resubmission header("Location: billing.php"); exit; } catch (PDOException $e) { // Log error } } } // Fetch unpaid patients try { $pdo = db(); $stmt = $pdo->prepare("SELECT p.*, u.username as doctor_name FROM patients p JOIN users u ON p.doctor_id = u.id WHERE p.status = 'Completed' AND p.payment_status = 'unpaid' ORDER BY p.updated_at DESC"); $stmt->execute(); $unpaid_patients = $stmt->fetchAll(PDO::FETCH_ASSOC); } catch (PDOException $e) { $unpaid_patients = []; // Log error } ?>
Manage outstanding payments.
| Patient Name | Doctor | Service Rendered | Cost | Action |
|---|---|---|---|---|
| Dr. | $ | Invoice | ||
| No pending payments. | ||||