- Rename rack_log.php → bin_log.php and rack_occupancy.php → bin_occupancy.php (occupy_rack.php was already calling bin_*.php, causing 404 on every load) - Fix occupy_rack.php: page title, stat card label (add id="stat_label_bins"), section headings, and <th> column headers still read "Rack/Racks" - Fix ReportManager: constructor wrote to $this->companyId (dynamic property) instead of the declared $this->company_id, causing all queries to filter on company_id = 0 under strict PHP 8.2+ property semantics Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
19 lines
682 B
PHP
19 lines
682 B
PHP
<?php
|
|
session_start();
|
|
require_once '../../../assets/utils/db_auth.php';
|
|
require_once '../../../assets/utils/classes/UsageGuard.php';
|
|
|
|
(new UsageGuard($pdo1, $company_id, $packages))->assertFeatureAccessible('reports');
|
|
require_once '../../../assets/utils/classes/ReportManager.php';
|
|
|
|
$report = new ReportManager($pdo2, $company_id);
|
|
$total = $report->getTotalCapacity();
|
|
$occupied = $report->getSpaceUsed();
|
|
|
|
$answer['output'] = $report->getRackOccupancy();
|
|
$answer['total'] = $total;
|
|
$answer['occupied'] = $occupied;
|
|
$answer['empty'] = $total - $occupied;
|
|
$answer['success'] = 1;
|
|
exit(json_encode($answer));
|
|
?>
|