0 ? qh_fetch_doctor($editId) : null; if ($editId > 0 && $editDoctor === null) { qh_set_flash('warning', qh_t('The requested room 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('Room management', 'إدارة الغرف'), qh_t('Professional room directory with search, edit, and delete actions.', 'دليل احترافي للغرف مع البحث وخيارات التعديل والحذف.') ); ?>
= qh_h(qh_t('Search rooms, 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 room records.', 'جميع سجلات الغرف المهيأة.')) ?>
| = qh_h(qh_t('Clinic', 'العيادة')) ?> | = qh_h(qh_t('Room no.', 'رقم الغرفة')) ?> | = qh_h(qh_t('Order', 'الترتيب')) ?> | = qh_h(qh_t('Actions', 'الإجراءات')) ?> |
|---|---|---|---|
| = 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('Create each room using only its room number and clinic assignment.', 'أنشئ كل غرفة باستخدام رقم الغرفة وتعيين العيادة فقط.')) ?>