Пример #1
0
function nav_html()
{
    $permiso = new Permiso();
    $menu = new Menu();
    $submenu = new SubMenu();
    $submenu->setOrder(" ORDER BY orden");
    echo "\n\t<div class='nav-wrapper blue row'>\n      \t<ul id='nav-mobile' class='side-nav left'>";
    foreach ($menu->findAll() as $value) {
        if ($permiso->getPermisos($_SESSION['id_rol'], $value['id'])) {
            echo "<li><a class='dropdown-button' href='#!' data-activates='" . $value['ver'] . "'>" . $value['ver'] . "</a></li>";
            echo "<ul id='" . $value['ver'] . "' class='dropdown-content'>";
            foreach ($permiso->getPermisos($_SESSION['id_rol'], $value['id']) as $valueSub) {
                $m = $submenu->find($valueSub['id_submenu']);
                echo "<li><a class='blue-text' href='" . $m[0]['link'] . "'>" . $m[0]['ver'] . "</a></li>";
            }
            echo "</ul>";
        }
    }
    echo "\n    </ul>\n    <div class='opUsuario dropdown valign-wrapper right'>\n    \tAdministrador<img src='img/yuna.jpg' alt='' class='circle responsive-img right' style='height:2.5rem; margin-top:1em;margin-left:1rem;'></div>\n\t</div>";
}