0 ? qh_fetch_doctor($editId) : null; if ($editId > 0 && $editDoctor === null) { qh_set_flash('warning', qh_t('The requested doctor record was not found.', 'لم يتم العثور على سجل الطبيب المطلوب.')); qh_redirect('admin_doctors.php'); } $toLower = static function (string $value): string { return function_exists('mb_strtolower') ? mb_strtolower($value, 'UTF-8') : strtolower($value); }; if ($search !== '') { $needle = $toLower($search); $doctors = array_values(array_filter($doctors, static function (array $doctor) use ($needle, $toLower): bool { $haystack = implode(' ', [ (string) ($doctor['name_en'] ?? ''), (string) ($doctor['name_ar'] ?? ''), (string) ($doctor['clinic_name_en'] ?? ''), (string) ($doctor['clinic_name_ar'] ?? ''), (string) ($doctor['room_number'] ?? ''), ]); return str_contains($toLower($haystack), $needle); })); } qh_page_start( 'admin', qh_t('Doctor management', 'إدارة الأطباء'), qh_t('Professional doctor directory with search, edit, and delete actions.', 'دليل احترافي للأطباء مع البحث وخيارات التعديل والحذف.') ); ?>
= qh_h(qh_t('Search doctors, edit assignments, and manage room records from a focused page.', 'ابحث عن الأطباء وعدّل التعيينات وأدر سجلات الغرف من صفحة مركزة.')) ?>
= qh_h($search !== '' ? qh_t('Filtered results based on your search.', 'نتائج مفلترة بناءً على البحث.') : qh_t('All configured doctor records.', 'جميع سجلات الأطباء المهيأة.')) ?>
| = qh_h(qh_t('Doctor', 'الطبيب')) ?> | = qh_h(qh_t('Clinic', 'العيادة')) ?> | = qh_h(qh_t('Room', 'الغرفة')) ?> | = qh_h(qh_t('Order', 'الترتيب')) ?> | = qh_h(qh_t('Actions', 'الإجراءات')) ?> |
|---|---|---|---|---|
|
= qh_h(qh_name($doctor)) ?>
= qh_h(qh_is_ar() ? (string) ($doctor['name_en'] ?? '') : (string) ($doctor['name_ar'] ?? '')) ?>
|
= qh_h(qh_name($doctor, 'clinic_name', qh_t('Unassigned', 'غير محدد'))) ?> | = qh_h((string) $doctor['room_number']) ?> | = qh_h((string) $doctor['sort_order']) ?> |
= qh_h(qh_t('Store both English and Arabic names while keeping the page language separate.', 'احفظ الاسمين الإنجليزي والعربي مع إبقاء لغة الصفحة منفصلة.')) ?>