예제 #1
0
 public function indexAction()
 {
     $this->dbAdapter = $this->getServiceLocator()->get('Zend\\Db\\Adapter');
     $identi = $this->auth->getStorage()->read();
     if ($identi != false && $identi != null) {
         $datos = $identi;
     } else {
         $this->redirect()->toUrl($this->getRequest()->getBaseUrl() . '/usuario/');
     }
     $nom_usuario = $datos->Nombre;
     $id_user = $datos->id_usuario;
     $SearchPymes = new Empresa($this->dbAdapter);
     $Pymes = $SearchPymes->SearchUser($id_user);
     $promociones = $this->dbAdapter->query("SELECT * FROM cuponera  WHERE id_user = '******' order by id_cupon Desc", Adapter::QUERY_MODE_EXECUTE);
     $layout = new ViewModel(array('nombre' => $nom_usuario, 'id_user' => $id_user, 'NumPymes' => count($Pymes), 'pymes' => $Pymes));
     $this->layout('layout/cpanel');
     return $layout;
 }