public function execute() { try { if (request::getInstance()->isMethod('POST')) { $idsToDelete = request::getInstance()->getPost('chk'); foreach ($idsToDelete as $id) { $ids = array(vacunacionTableClass::ID => $id); $idsDetalle = array(detalleVacunacionTableClass::ID_REGISTRO => $id); vacunacionTableClass::delete($ids, true); detalleVacunacionTableClass::delete($idsDetalle, true); } //close foreach session::getInstance()->setSuccess(i18n::__('succesInhabilMasive', null, 'vacunacion')); log::register(i18n::__('borrar seleccion'), vacunacionTableClass::getNameTable()); routing::getInstance()->redirect('vacunacion', 'indexVacunacion'); } else { session::getInstance()->setError('mal'); routing::getInstance()->redirect('vacunacion', 'indexVacunacion'); } //close if } catch (PDOException $exc) { session::getInstance()->setFlash('exc', $exc); routing::getInstance()->forward('shfSecurity', 'exception'); } }
public function execute() { try { if (request::getInstance()->isMethod('POST') and request::getInstance()->isAjaxRequest()) { $id = request::getInstance()->getPost(detalleVacunacionTableClass::getNameField(detalleVacunacionTableClass::ID, true)); $ids = array(detalleVacunacionTableClass::ID => $id); $this->arrayAjax = array('code' => 11, 'msg' => 'La eliminacion ha sido exitosa'); detalleVacunacionTableClass::delete($ids, true); // session::getInstance()->setSuccess(i18n::__('succesInhabil', null, 'detalleVacunacion)); // log::register(i18n::__('delete'), detalleVacunacionTableClass::getNameTable()); $this->defineView('detalleVacunacion', 'vacunacion', session::getInstance()->getFormatOutput()); } else { routing::getInstance()->redirect('vacunacion', 'indexDetalleVacunacion'); } //close if } catch (PDOException $exc) { session::getInstance()->setFlash('exc', $exc); routing::getInstance()->forward('shfSecurity', 'exception'); } }