prepare("SELECT * FROM users WHERE id = ?");
$stmt->execute([$_SESSION['user_id']]);
$user = $stmt->fetch();
if (!$user) {
// If user not found, destroy session and redirect
session_destroy();
header('Location: login.php');
exit;
}
// Create initials from the username
$initials = '';
$parts = explode(' ', $user['username']);
foreach ($parts as $part) {
$initials .= strtoupper(substr($part, 0, 1));
}
// 3. Task data remains static for now, but will be moved to database later.
$tasks = [
[
'name' => 'Complete Tax Forms (W-4)',
'description' => 'Download, fill out, and upload your W-4 tax withholding form',
'due_date' => '12/9/2024',
'details' => 'Please upload a completed and signed W-4 form (PDF format preferred)',
'status' => 'pending',
'type' => 'upload'
],
[
'name' => 'Upload Profile Photo',
'description' => 'Upload a professional headshot for your company profile',
'due_date' => '12/11/2024',
'details' => 'JPG or PNG, minimum 400x400 pixels',
'status' => 'pending',
'type' => 'upload'
],
[
'name' => 'Review Employee Handbook',
'description' => 'Read through the company policies and employee handbook',
'due_date' => '12/10/2024',
'status' => 'pending',
'type' => 'action'
],
[
'name' => 'Set Up Direct Deposit',
'description' => 'Provide your bank account information for payroll',
'due_date' => '12/9/2024',
'details' => 'Upload a voided check or bank letter with account details',
'status' => 'pending',
'type' => 'upload'
],
[
'name' => 'Complete I-9 Form',
'completed_date' => '12/7/2024',
'status' => 'completed'
],
[
'name' => 'Sign Offer Letter',
'completed_date' => '12/6/2024',
'status' => 'completed'
]
];
$pending_tasks = array_filter($tasks, fn($t) => $t['status'] === 'pending');
$completed_tasks = array_filter($tasks, fn($t) => $t['status'] === 'completed');
$total_tasks = count($tasks);
$completed_count = count($completed_tasks);
$progress_percent = $total_tasks > 0 ? ($completed_count / $total_tasks) * 100 : 0;
// For display purposes, placeholder data for manager and start date
$display_manager = 'Sarah Johnson';
$display_start_date = '12/14/2024';
?>
Employee View - FinMox
Your Tasks
-
Onboarding Progress
of tasks completed
%
Need Help?
hr@company.com
(555) 123-4567
Questions? Reach out to your manager or contact HR.
Start Date: