This commit is contained in:
Thanakorn S
2026-04-25 16:02:55 +07:00
parent 3cc5baba3f
commit 76b9b2a2cb
12 changed files with 1625 additions and 669 deletions
@@ -0,0 +1,24 @@
<?php
session_start();
require '../../../assets/utils/db_auth.php';
require '../../../assets/utils/classes/Reports.php';
$month = $data['month'] ?? date('Y-m');
$report = new Reports($pdo2, $company_id);
$stats = $report->getDashboardStats($month);
$answer['output'] = [
'total_in' => $stats['total_in'],
'total_out' => $stats['total_out'],
'active_products' => $stats['active_products'],
'low_stock' => $report->getDashboardLowStockCount(),
'stock_movement' => $report->getStockMovementChart(12),
'most_moved' => $report->getMostMovedProducts($month),
'low_stock_items' => $report->getLowStockItems(),
'recent_activity' => $report->getRecentActivity(10),
'months' => $report->getAvailableMonths(),
];
$answer['success'] = 1;
exit(json_encode($answer));
?>