<?php

class GerenciarTopoSistema {
    public static function mostrarMenu($nivel) {
        if ($nivel == 1) {
            self::menusDaAdministracao();
        } else if ($nivel == 4) {
            self::menusDoTecnico();
        }
    }

    private static function menusDaAdministracao() {
        self::menuHome('Home', 'principal/gerenciarSistema');
//        self::montarMenu('Cadastro', self::subMenusDoMenuCadastro());
//        self::montarMenu('Administra&ccedil;&atilde;o', self::subMenusDoMenuAdministracao());
//        self::montarMenu('Produ&ccedil;&atilde;o', self::subMenusDoMenuManutencao());
        self::montarMenu('Relat&oacute;rios', self::subMenusDoMenuRelatorios());
        self::montarMenu('Configurações', self::subMenusDoMenuConfiguracoes());
//        self::montarMenu('Gerencial', self::subMenusDoMenuGerencial());
    }

    private static function menusDoTecnico() {
//        self::menuHome('Home', 'principal/gerenciarSistema');
//        self::montarMenu('Manuten&ccedil;&atilde;o', self::subMenusDoMenuManutencao());
    }

    private static function subMenusDoMenuCadastro() {
        return
            self::subMenu('Checklists', 'checklists') .
            self::subMenu('Serviços', 'servicos') .
            self::subMenu('Inspeção', 'inspecao') .
            self::subMenu('Peças', 'pecas') .
            self::subMenu('Funcionarios', 'funcionario');
    }

    private static function subMenusDoMenuAdministracao() {
        return
            self::subMenu('Gest&atilde;o Resultados', 'gestaoResultados');
    }

    private static function subMenusDoMenuManutencao() {
        return
            self::subMenu('Ordem Serviço', 'manutencao/ordensServicos') .
            self::subMenu('Corretivas', 'manutencao') .
            self::subMenu('Manutenções', 'manutencao/gerenciarModelos');
    }

    private static function subMenusDoMenuDocumentos() {
        return self::subMenu('Documentos Site', 'docsCond');
    }

    private static function subMenusDoMenuFinanceiro() {
        return
            self::subMenu('Controle de Inadimplencia', '') .
            self::subMenu('Lan&ccedil;amentos', 'financeiro/lancamentos') .
            self::subMenu('Presta&ccedil;&atilde;o de Contas', 'relatorios/prestacaoContas');
    }

    private static function subMenusDoMenuRelatorios() {
        return
            self::subMenu('Pedidos', 'relatorios/manutencao') ;
//            .
//            self::subMenu('Serviços', 'relatorios/servicos') .
//            self::subMenu('Peças', 'relatorios/pecas') ;
//            self::subMenu('Planejamento', 'relatorios/planejamento');
    }

    private static function subMenusDoMenuConfiguracoes() {
        return
            self::subMenu('Usuários', 'usuarios') .
//            self::subMenu('Config do Sistema', 'configsistema') .
//            self::subMenu('Planejamento', 'agenda') .
            self::subMenu('Backup', '');
    }

    private static function subMenusDoMenuGerencial() {
        return
            self::subMenu('Categorias', 'categorianotificacao');
    }

    public static function montarMenu($nomeMenu, $subMenu) {
        echo '
        <li>
                    <a class="has-arrow" href="#" aria-expanded="false"><i class="mdi mdi-gauge"></i><span class="hide-menu">' . $nomeMenu . ' <span class="label label-rounded label-success">5</span></span></a>
                    <ul aria-expanded="false" class="collapse">
                       ' . $subMenu . '
                    </ul>
                </li>
        ';

    }

    public static function subMenu($tituloSubMenu, $controller) {
        return '<li>
                <a href="' . base_url() . '' . $controller . '/"
                   class="auto">
                    <i class="fa fa-arrow-circle-right"></i>

                    <span>' . $tituloSubMenu . '</span>
                </a>
            </li>';
    }

    public static function menuHome($tituloSubMenu, $controller) {
        echo '<li>
                <a href="' . base_url() . '' . $controller . '/"
                   class="auto">
                     <i class="fa fa-home"></i>
                    <span class="font-bold">' . $tituloSubMenu . '</span>
                </a>
            </li>';
    }


}

?>
