prepare(" SELECT a.*, le.entry_date, e.name as employee_name, p.name as project_name FROM attachments a JOIN labour_entries le ON a.entity_id = le.id JOIN employees e ON le.employee_id = e.id JOIN projects p ON le.project_id = p.id WHERE a.tenant_id = ? AND a.entity_type = 'labour_entry' ORDER BY a.created_at DESC "); $stmt->execute([$tenant_id]); $files = $stmt->fetchAll(); function formatBytes($bytes, $precision = 2) { $units = ['B', 'KB', 'MB', 'GB', 'TB']; $bytes = max($bytes, 0); $pow = floor(($bytes ? log($bytes) : 0) / log(1024)); $pow = min($pow, count($units) - 1); $bytes /= pow(1024, $pow); return round($bytes, $precision) . ' ' . $units[$pow]; } $pageTitle = "SR&ED Manager - Labour Files"; include __DIR__ . '/includes/header.php'; ?>
| Filename | Size | Uploaded By | Created At | Linked Entry | Actions |
|---|---|---|---|---|---|
| No labour files found. | |||||
| = htmlspecialchars($f['file_name']) ?> | = formatBytes((int)$f['file_size']) ?> |
|
= date('M j, Y H:i', strtotime($f['created_at'])) ?> |
= $f['entry_date'] ?>
= htmlspecialchars($f['employee_name']) ?> - = htmlspecialchars($f['project_name']) ?> |
View |