public static function getSitio($nombre) { $sitios = new Sitios(); return $sitios->fetchRow("nombre = '" . $nombre . "'"); }
public function eliminarAction() { $this->view->subtitle = "Eliminar"; Zend_Loader::loadClass('Sitios'); $Sitios = new Sitios(); if ($this->_request->isPost()) { $filter = new Zend_Filter_Alpha(); $id = (int) $this->_request->getPost('id'); $del = $filter->filter($this->_request->getPost('del')); if ($del == 'Si' && $id > 0) { $where = 'id = ' . $id; $rows_affected = $Sitios->delete($where); } } else { $id = (int) $this->_request->getParam('id'); if ($id > 0) { $this->view->sitio = $Sitios->fetchRow('id=' . $id); if ($this->view->sitio->id > 0) { $this->render(); return; } } } $this->_redirect('/admin/sitios/'); }