prepare(' SELECT i.*, c.name AS customer_name, c.email AS customer_email, p.name AS plan_name FROM invoices i JOIN customers c ON i.customer_id = c.id JOIN plans p ON i.plan_id = p.id WHERE i.id = ? '); $stmt->execute([$invoice_id]); $invoice = $stmt->fetch(PDO::FETCH_ASSOC); if (!$invoice) { header('Location: invoices.php'); exit; } } catch (PDOException $e) { $error_message = 'Database error: ' . $e->getMessage(); } $status_colors = [ 'Paid' => 'success', 'Pending' => 'warning', 'Overdue' => 'danger', ]; ?>
Invoice #:
Created Date:
Due Date:
| Description | Amount |
|---|---|
| Subscription: | $ |
| Total: | $ |