prepare("SELECT * FROM employees WHERE id = ?"); $employee->execute([$id]); $employee = $employee->fetch(); if (!$employee) { die("Employee not found."); } $pageTitle = "Employee Detail: " . htmlspecialchars($employee['name']); include __DIR__ . '/includes/header.php'; // Fetch recent labour entries $stmt = $db->prepare(" SELECT l.*, p.name as project_name, lt.name as labour_type FROM labour_entries l JOIN projects p ON l.project_id = p.id JOIN labour_types lt ON l.labour_type_id = lt.id WHERE l.employee_id = ? ORDER BY l.entry_date DESC LIMIT 20 "); $stmt->execute([$id]); $entries = $stmt->fetchAll(); // Fetch summary stats $stats = $db->prepare("SELECT SUM(hours) as total_hours, COUNT(*) as entry_count FROM labour_entries WHERE employee_id = ?"); $stats->execute([$id]); $stats = $stats->fetch(); ?>

Information
Recent Labour Entries View All
Date Project Type Hours Notes
No entries found for this employee.
50 ? '...' : '' ?>