0 ? qh_fetch_clinic($editId) : null; if ($editId > 0 && $editClinic === null) { qh_set_flash('warning', qh_t('The requested clinic record was not found.', 'لم يتم العثور على سجل العيادة المطلوب.')); qh_redirect('admin_clinics.php'); } $toLower = static function (string $value): string { return function_exists('mb_strtolower') ? mb_strtolower($value, 'UTF-8') : strtolower($value); }; if ($search !== '') { $needle = $toLower($search); $clinics = array_values(array_filter($clinics, static function (array $clinic) use ($needle, $toLower): bool { $haystack = implode(' ', [ (string) ($clinic['code'] ?? ''), (string) ($clinic['name_en'] ?? ''), (string) ($clinic['name_ar'] ?? ''), (int) ($clinic['requires_vitals'] ?? 0) === 1 ? 'vitals first' : 'direct doctor', ]); return str_contains($toLower($haystack), $needle); })); } qh_page_start( 'admin', qh_t('Clinic management', 'إدارة العيادات'), qh_t('Professional clinic directory with search, edit, and delete actions.', 'دليل احترافي للعيادات مع البحث وخيارات التعديل والحذف.') ); ?>

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

>