function damepregunta() { $consulta_mysql = "SELECT tb_pregunta.intidpregunta,tb_pregunta.nvchdescripcion,tb_pregunta.nvchpregunta from tb_pregunta"; $resultado_consulta_mysql = mysql_query($consulta_mysql); 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']);
function damealumnos() { $consulta_mysql = "SELECT persona.nvchidpersona,persona.nvchdni,persona.nvchapellido,persona.nvchnombre from persona where persona.chrtipopersona = '1'"; $resultado_consulta_mysql = mysql_query($consulta_mysql); while ($registro = mysql_fetch_array($resultado_consulta_mysql)) { echo "\n <option style='font-size:15px; margin:5px; text-transform:uppercase;' value='" . $registro['nvchidpersona'] . "'>\n " . $registro['nvchdni'] . " - " . $registro['nvchapellido'] . ", " . $registro['nvchnombre'] . "\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']);