I have a site with two access levels, Administrator and Client. When creating a new account, I want the administrator to see the possibility of creating another administrator or client. I want the client to see only the client option. I am using PHP. Here is what I tried:
<?php
foreach ($types as $type) {
if (!isset($_SESSION['user_id'])) {
echo "<option value=\"" . $type['Customer'] . "\">". $type['Customer'] . "</option>\n";
}
else
{
if ($is_admin) {
echo "<option value=\"" . $type['user_type_id']. "\">" . $type['type_name'] . "</option>\n";
}
echo "<option value=\"" . $type['Customer']. "\">" . $type['Customer'] ." </option>\n";
}
}
?>
This is not the fulfillment of what I intended. If anyone has a suggestion that I could try, that would be great. Let me know if you want any of my other codes to understand the logic better.
source
share