English
diff --git a/admin_platform_users.php b/admin_platform_users.php
index cbceb9d..eeb6cd9 100644
--- a/admin_platform_users.php
+++ b/admin_platform_users.php
@@ -1,7 +1,7 @@
= e(t('create_user')) ?>
-
diff --git a/admin_reports_shippers.php b/admin_reports_shippers.php
index f5c0836..40460b8 100644
--- a/admin_reports_shippers.php
+++ b/admin_reports_shippers.php
@@ -1,7 +1,7 @@
getMessage();
}
-// Calculate totals for footer
+// Calculate totals
$totalShipments = 0;
$grandTotalAmount = 0.0;
$grandTotalProfit = 0.0;
@@ -106,6 +107,33 @@ foreach ($results as $row) {
$grandTotalProfit += $row['total_profit'];
}
+// Handle CSV Export
+if ($export === 'csv') {
+ header('Content-Type: text/csv');
+ header('Content-Disposition: attachment; filename="report_' . $reportType . '_' . date('Ymd') . '.csv"');
+
+ $out = fopen('php://output', 'w');
+
+ // Header
+ fputcsv($out, ['Name', 'Shipments', 'Total Amount', 'Profit']);
+
+ // Rows
+ foreach ($results as $row) {
+ fputcsv($out, [
+ $row['name'],
+ $row['shipment_count'],
+ number_format((float)$row['total_amount'], 2, '.', ''),
+ number_format((float)$row['total_profit'], 2, '.', '')
+ ]);
+ }
+
+ // Footer
+ fputcsv($out, ['Total', $totalShipments, number_format($grandTotalAmount, 2, '.', ''), number_format($grandTotalProfit, 2, '.', '')]);
+
+ fclose($out);
+ exit;
+}
+
render_header(t('summary_report'), 'reports_summary', true);
?>
@@ -162,6 +190,9 @@ render_header(t('summary_report'), 'reports_summary', true);
= e(t('analyze_performance')) ?>