37 lines
1.8 KiB
PHP
37 lines
1.8 KiB
PHP
<?php
|
|
$content = file_get_contents('index.php');
|
|
|
|
$search_th = '<th data-en="Access Level" data-ar="مستوى الوصول">Access Level</th>';
|
|
$replace_th = '<th data-en="Access Level" data-ar="مستوى الوصول">Access Level</th>
|
|
<th data-en="Outlet" data-ar="الفرع">Outlet</th>';
|
|
|
|
$content = str_replace($search_th, $replace_th, $content);
|
|
|
|
$search_td = '<span class="badge rounded-pill bg-info bg-opacity-10 text-info px-3">
|
|
<?= htmlspecialchars((string)($u[\'group_name\'] ?? \'No Role Assigned\')) ?>
|
|
</span>
|
|
</td>';
|
|
$replace_td = '<span class="badge rounded-pill bg-info bg-opacity-10 text-info px-3">
|
|
<?= htmlspecialchars((string)($u[\'group_name\'] ?? \'No Role Assigned\')) ?>
|
|
</span>
|
|
</td>
|
|
<td>
|
|
<span class="badge rounded-pill bg-secondary bg-opacity-10 text-secondary px-3">
|
|
<?php
|
|
$out_name = "Global / All Outlets";
|
|
foreach (($data["outlets"] ?? []) as $out) {
|
|
if ($out["id"] == $u["outlet_id"]) {
|
|
$out_name = $out["name"];
|
|
break;
|
|
}
|
|
}
|
|
echo htmlspecialchars($out_name);
|
|
?>
|
|
</span>
|
|
</td>';
|
|
|
|
$content = str_replace($search_td, $replace_td, $content);
|
|
|
|
file_put_contents('index.php', $content);
|
|
echo "Users table updated to show assigned outlet.\n";
|