diff --git a/reports.php b/reports.php index df6d496..0b74102 100644 --- a/reports.php +++ b/reports.php @@ -132,7 +132,7 @@ $overdue_invoices = $invoice_statuses['Overdue'] ?? 0; - + View diff --git a/view_report.php b/view_report.php new file mode 100644 index 0000000..28ed201 --- /dev/null +++ b/view_report.php @@ -0,0 +1,111 @@ +prepare($sql); + $stmt->execute([$report_id]); + $report = $stmt->fetch(PDO::FETCH_ASSOC); + + if ($report === false) { + $errors[] = "Report not found."; + $report = null; + } + } catch (PDOException $e) { + $errors[] = "Database error: " . $e->getMessage(); + } + } +} else { + $errors[] = "Report ID is missing."; +} + +?> + +
+ +

Report:

+ + +
+
+ + Report Details +
+
+

Report Type:

+

Date Generated:

+ +
Report Data
+ + + + + + + + + + $value): ?> + + + + + + +
KeyValue
+ ' . htmlspecialchars(json_encode($value, JSON_PRETTY_PRINT)) . ''; + } else { + echo htmlspecialchars($value); + } + ?> +
+ +
Could not decode report data or data is empty.
+
+ +
+
+ + +

Error

+ +
+ +
+ + + + + Back to Reports + +
+ +