public function showPage($selected = '')
 {
     if (!FUTURI_Session::isUserAdmin()) {
         $this->load->view("nopermission_admin");
     }
     $this->load->view("admin_header", array('selected' => $selected));
     switch ($selected) {
         case "usuarios":
             include "application/controllers/User.php";
             define_constants();
             $userController = new User();
             $userController->showListPage('', 10, false);
             break;
         case "estatisticas":
             break;
         case "backups":
             include "application/controllers/Backup.php";
             define_constants();
             $backupController = new Backup();
             $backupController->showListPage('', 10, false);
             break;
         case "configs":
             $this->load->view("admin_configs", array("object_handler" => $this));
             break;
         case "relatorios":
             include "application/controllers/Report.php";
             define_constants();
             $reportController = new Report();
             $reportController->showListPage('', 10, false);
             break;
         case "graficos":
             include "application/controllers/Chart.php";
             define_constants();
             $chartController = new Chart();
             $chartController->showListPage('', 10, false);
             break;
     }
 }
 public static function havePermission($permName = '', $user_id = -1)
 {
     include_once "application/models/Permission_model.php";
     $permModel = new Permission_Model();
     if ($user_id > 0) {
         include_once "User.php";
         $user = new User($user_id);
         $is_admin = $user->fields['administrador'];
     } else {
         $is_admin = FUTURI_Session::isUserAdmin();
         $user_id = FUTURI_Session::getUserID();
     }
     $have_count = count($permModel->getObjects(array("where" => "usuario_id = '" . $user_id . "' AND nome_permissao = '" . $permName . "'")));
     return $have_count || $is_admin;
 }
Exemplo n.º 3
0
?>
"><a href='<?php 
echo base_url() . "trabalhos";
?>
'><i class='fa fa-tags'></i>Trabalhos</a></li>
					<li class="<?php 
echo $selected == "graficos_relatorios" ? "submenuSelected" : "";
?>
">
						<a href='<?php 
echo base_url() . "graficos_relatorios";
?>
'><i class='fa fa-bar-chart-o'></i>Relatórios & Gráficos</a>
					</li>
					<?php 
if (FUTURI_Session::isUserAdmin()) {
    /*<li class="<?php echo ($selected == "relatorios" ? "submenuSelected" : "");?>"><a href='<?php echo base_url()."relatorios";?>'><i class='fa fa-copy'></i>Relatórios</a></li> */
    ?>
						<li class="<?php 
    echo $selected == "admin" ? "submenuSelected" : "";
    ?>
"><a href='<?php 
    echo base_url() . "admin";
    ?>
'><i class='fa fa-sitemap'></i>Administração</a></li>
					<?php 
}
?>
				</ul>
			</div>
		</aside>