Пример #1
0
 public function Obtener($intidrespuesta)
 {
     try {
         $stm = $this->pdo->prepare("SELECT * FROM tb_respuesta WHERE intidrespuesta = ?");
         $stm->execute(array($intidrespuesta));
         $r = $stm->fetch(PDO::FETCH_OBJ);
         $rsp = new Respuesta();
         $rsp->__SET('intidrespuesta', $r->intidrespuesta);
         $rsp->__SET('intidpregunta', $r->intidpregunta);
         $rsp->__SET('nvchrespuesta', $r->nvchrespuesta);
         $rsp->__SET('chrvf', $r->chrvf);
         return $rsp;
     } catch (Exception $e) {
         die($e->getMessage());
     }
 }
Пример #2
0
    while ($registro = mysql_fetch_array($resultado_consulta_mysql)) {
        echo "\n            <option style='font-size:15px; margin:5px' value='" . $registro['intidpregunta'] . "'>\n              " . $registro['nvchdescripcion'] . "-" . $registro['nvchpregunta'] . "\n            </option>\n        ";
    }
}
//end dame tareas para el combobox
//definiendo la estructura del mvc
require_once 'respuesta.entidad.php';
require_once 'respuesta.model.php';
$buttonname = 'Registrar';
// Logica
$rsp = new Respuesta();
$model = new RespuestaModel();
if (isset($_REQUEST['action'])) {
    switch ($_REQUEST['action']) {
        case 'actualizar':
            $rsp->__SET('intidrespuesta', $_REQUEST['intidrespuesta']);
            $rsp->__SET('intidpregunta', $_REQUEST['intidpregunta']);
            $rsp->__SET('nvchrespuesta', $_REQUEST['nvchrespuesta']);
            $rsp->__SET('chrvf', $_REQUEST['chrvf']);
            $model->Actualizar($rsp);
            header('Location: respuesta.php');
            break;
        case 'registrar':
            //$preg->__SET('intidpregunta',$_REQUEST['intidpregunta']);
            $rsp->__SET('intidpregunta', $_REQUEST['intidpregunta']);
            $rsp->__SET('nvchrespuesta', $_REQUEST['nvchrespuesta']);
            $rsp->__SET('chrvf', $_REQUEST['chrvf']);
            $model->Registrar($rsp);
            header('Location: respuesta.php');
            break;
        case 'eliminar':