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.', 'دليل احترافي للأطباء مع البحث وخيارات التعديل والحذف.') ); ?>

(int) $doctor['id'], 'q' => $search]); ?>