يرجى تسجيل الدخول."; require_once 'includes/footer.php'; exit; } $user_id = $_SESSION['user_id']; $error = ''; $success = ''; if (isset($_SESSION["success"])) { $success = $_SESSION["success"]; unset($_SESSION["success"]); } // Check if current user is linked to an employee $stmt = db()->prepare("SELECT id, first_name, last_name, department_id FROM hr_employees WHERE user_id = ? AND status = 'active'"); $stmt->execute([$user_id]); $employee = $stmt->fetch(); if (!$employee) { echo "
يرجى التواصل مع قسم الموارد البشرية لربط حسابك بملف الموظف الخاص بك لتتمكن من تقديم طلبات الإجازات.
"; echo "| نوع الإجازة | الفترة | المدة | السبب | تاريخ التقديم | الحالة | المعتمد |
|---|---|---|---|---|---|---|
| لا توجد طلبات إجازات سابقة. | ||||||
| 'سنوية', 'sick' => 'مرضية', 'unpaid' => 'بدون راتب', 'maternity' => 'أمومة', 'emergency' => 'طارئة', 'other' => 'أخرى' ]; echo $type_map[$req['leave_type']] ?? $req['leave_type']; ?> |
من = $req['start_date'] ?> إلى = $req['end_date'] ?> |
= $req['days_count'] ?> يوم | = htmlspecialchars($req['reason'] ?? '') ?> | = date('Y-m-d', strtotime($req['created_at'])) ?> | 'success', 'rejected' => 'danger', default => 'warning' }; $status_txt = match($req['status']) { 'approved' => 'مقبولة', 'rejected' => 'مرفوضة', default => 'معلقة' }; ?> = $status_txt ?> | = $req['status'] === 'pending' ? '-' : htmlspecialchars($req['approver_name'] ?? 'مدير النظام') ?> |