$acc) {
if (
str_contains(strtolower((string)$acc['name_ar']), $lowerSearch) ||
str_contains(strtolower((string)$acc['name_en']), $lowerSearch) ||
str_contains(strtolower((string)$acc['username']), $lowerSearch)
) {
$filteredAccounts[$key] = $acc;
}
}
} else {
$filteredAccounts = $allAccounts;
}
// Pagination logic
$page = max(1, (int)($_GET['p'] ?? 1));
$limit = 10;
$total = count($filteredAccounts);
$totalPages = max(1, ceil($total / $limit));
$offset = ($page - 1) * $limit;
$accounts = array_slice($filteredAccounts, $offset, $limit, true);
require __DIR__ . '/includes/header.php';
?>
= h(tr('الإصدار الأول يستخدم حسابات تجريبية منفصلة لإثبات هيكل الصلاحيات قبل ربط المستخدمين بقاعدة البيانات.', 'This first version uses separate demo accounts to prove the permissions model before wiring users into the database.')) ?>= h(tr('الوصول حسب الدور', 'Role-based access')) ?>