Ejemplo n.º 1
0
 public function telaAltUser($users)
 {
     $cv = new View\ControleVisao();
     $index = $cv->getSidebar();
     $t = new Util\MiniTemplator();
     $t->readTemplateFromFile("Html" . DS . "templates" . DS . "alterUser.html");
     $saida = null;
     foreach ($users as $temp) {
         $cell = new Util\MiniTemplator();
         $cell->readTemplateFromFile("Html" . DS . "templates" . DS . "celluser.html");
         $cell->setVariable("id", $temp->getId());
         $cell->setVariable("nome", $temp->getNome());
         $cell->setVariable("email", $temp->getEmail());
         $cell->setVariable("tel", $temp->getTelefone());
         if ($temp->getAtivo()) {
             $cell->setVariable("ativo", "unlock");
         } else {
             $cell->setVariable("ativo", "lock");
         }
         $cell->setVariable("level", $temp->getLevel()->getPermisao());
         $cell->generateOutputToString($saida);
         $t->setVariable("user", $saida);
         $t->addBlock("user");
     }
     $t->generateOutputToString($echo);
     $index->setVariable("conteudo", $echo);
     $index->addBlock("conteudo");
     die($index->generateOutput());
 }
Ejemplo n.º 2
0
 public function getSidebar()
 {
     $t = new MiniTemplator();
     $t->readTemplateFromFile("Html" . DS . "templates" . DS . "Sidebar.html");
     if ($_SESSION["level"] === 2) {
         $adm = new MiniTemplator();
         $adm->readTemplateFromFile("Html" . DS . "templates" . DS . "admin.html");
         $adm->generateOutputToString($var);
         $t->setVariable("nivel", $var);
     } else {
         $t->setVariable("nivel", " ");
     }
     $t->setVariable("user", $_SESSION["usuario"]);
     return $t;
 }