Files
wms-app/app/dashboard/api/engine_report/reports_stats.php
T
2026-04-25 16:02:55 +07:00

24 lines
906 B
PHP

<?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));
?>