public function indexAction() { $orden = (string) $this->_request->getParam('orden', 0); $asc = (bool) $this->_request->getParam('asc', 0); if (empty($orden)) { $orden = "id"; } if ($asc) { $orden .= " ASC"; } else { $orden .= " DESC"; } $this->view->orden_asc = $asc; $this->view->subtitle = $this->info->sitio->usuarios->index->titulo; $this->view->usuarios = Usuarios::getAll($this->session->sitio->id, 0, $orden); $this->render(); }
<?php $usr = new Usuarios(); $usuarios = $usr->getAll(); ob_start(); ?> <div class='row'> <h1>Administración de Usuarios</h1> <a href="?op=new" class="btn btn-default btn-sm" role="button">Nuevo</a> <br><br> <table class='table table-hover table-striped'> <thead> <tr> <th>Usuario</th> <th>Apellidos</th> <th>Nombres</th> <th>Nivel</th> <th>Acciones</th> </tr> </thead> <tbody> <?php foreach ($usuarios as $u) { ?> <tr> <td><span class="glyphicon glyphicon-user"></span><?php echo " " . $u['usuario']; ?> </td> <td><?php echo $u['apellidos']; ?>