I have a session that is based on the IdRol of a database, depending on the Role it shows the menu, but it only lets me put 1 Role per Menu and it does not leave me for 2. (I do not want to use a nested if I have 8 user types and would make a huge mega code) Example that works with only 1 IdRol:
<? if ($_SESSION[ 'idRol' ] == 1) { ?>
<li class="active">
<a href="index.php#" title="Subtipo" data-toggle="collapse-next" class="has-submenu">
<span class="item-text">Subtipo</span>
</a>
<ul class="nav collapse ">
<li>
<a href="Subtipo.php" title="Subtipo Nuevo" data-toggle="" class="no-submenu">
<span class="item-text">Subtipo Nuevo</span>
</a>
</li>
</ul>
</li>
<? } ?>
When I try it with two it does not leave me, example:
<? if ($_SESSION[ 'idRol' ] == 1 && $_SESSION[ 'idRol' ] == 2) { ?>
<li class="active">
<a href="index.php#" title="Subtipo" data-toggle="collapse-next" class="has-submenu">
<span class="item-text">Subtipo</span>
</a>
<ul class="nav collapse ">
<li>
<a href="Subtipo.php" title="Subtipo Nuevo" data-toggle="" class="no-submenu">
<span class="item-text">Subtipo Nuevo</span>
</a>
</li>
</ul>
</li>
<? } ?>