public function indexAction() { $this->view->headTitle('Novidades'); $categoriaModel = new Application_Model_Categoria(); $nome_categorias = $categoriaModel->fetchAll($categoriaModel->select()->from($categoriaModel->info(Zend_Db_Table_Abstract::NAME))->columns(array('nome_categoria'))); $this->view->categorias = $nome_categorias; $sessao = new Zend_Session_Namespace('SESSAO_CARRINHO'); if (isset($sessao->produtos)) { $carrinhoContador = sizeof($sessao->produtos); } else { $carrinhoContador = 0; } if ($carrinhoContador == 0) { $this->view->carrinhoImagem = ''; } else { if ($carrinhoContador < 5) { $this->view->carrinhoImagem = $carrinhoContador; } else { $this->view->carrinhoImagem = 4; } } $noticiaModel = new Application_Model_Novidades(); $this->view->noticia = $noticiaModel->fetchAll($noticiaModel->select()->where('excluido = 0')); $busca = $this->_request->getParam('busca'); }
public function indexAction() { $this->view->headTitle('Novidades'); $categoriaModel = new Application_Model_Categoria(); $nome_categorias = $categoriaModel->fetchAll($categoriaModel->select()->from($categoriaModel->info(Zend_Db_Table_Abstract::NAME))->columns(array('nome_categoria'))); $this->view->categorias = $nome_categorias; $noticiaModel = new Application_Model_Novidades(); $this->view->noticia = $noticiaModel->fetchAll($noticiaModel->select()->where('excluido = 0')); $busca = $this->_request->getParam('busca'); }
public function removerAction() { $id = $this->_request->getParam('id'); $confirma = $this->_request->getParam('confirma'); if (isset($confirma)) { if ($confirma == 1) { $novidadesModel = new Application_Model_Novidades(); $novidadesModel->update(array('excluido' => '1'), 'id_noticia = ' . $id); unlink(APPLICATION_PATH . '/../novidades_fotos/' . $id . '.jpg'); } return $this->_helper->redirector('index'); } else { $this->view->id = $this->_request->getParam('id'); $novidadesModel = new Application_Model_Novidades(); $nome_novidade = $novidadesModel->fetchAll($novidadesModel->select()->from($novidadesModel->info(Zend_Db_Table_Abstract::NAME))->columns(array('titulo'))->where('id_noticia = ?', $id)); $this->view->novidade = $nome_novidade; } }
public function indexAction() { $novidadesModel = new Application_Model_Novidades(); $this->view->novidades = $novidadesModel->fetchAll($novidadesModel->select()->where('excluido = 0')); $busca = $this->_request->getParam('busca'); }