Ejemplo n.º 1
0
//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':
            $model->Eliminar($_REQUEST['intidrespuesta']);
            header('Location: respuesta.php');
            break;
        case 'editar':