コード例 #1
0
 public function deleteData()
 {
     $model = new PreguntaModel();
     try {
         $datos = $model->deletePregunta();
         $_SESSION['message'] = "Datos eliminados correctamente.";
     } catch (Exception $e) {
         $_SESSION['message'] = $e->getMessage();
     }
     header("Location: index.php");
 }
コード例 #2
0
ファイル: pregunta.php プロジェクト: jsabbath/G4m1f1c4M3
<?php

include 'headerdocente.php';
require_once 'pregunta.entidad.php';
require_once 'pregunta.model.php';
$buttonname = 'Registrar';
// Logica
$preg = new Pregunta();
$model = new PreguntaModel();
//dame tareas para el combobox
function dametarea()
{
    $consulta_mysql = "\n    SELECT\n      tb_tarea.intidtarea,\n      tb_tarea.nvchtarea\n    FROM\n      tb_tarea\n    ";
    $resultado_consulta_mysql = mysql_query($consulta_mysql);
    while ($registro = mysql_fetch_array($resultado_consulta_mysql)) {
        echo "\n              <option value='" . $registro['intidtarea'] . "'>\n                " . $registro['nvchtarea'] . "\n              </option>\n        ";
    }
}
//end dame tareas para el combobox
if (isset($_REQUEST['action'])) {
    switch ($_REQUEST['action']) {
        case 'actualizar':
            $preg->__SET('intidpregunta', $_REQUEST['intidpregunta']);
            $preg->__SET('intidtarea', $_REQUEST['intidtarea']);
            $preg->__SET('nvchpregunta', $_REQUEST['nvchpregunta']);
            $preg->__SET('nvchdescripcion', $_REQUEST['nvchdescripcion']);
            $preg->__SET('chrhabilitado', $_REQUEST['chrhabilitado']);
            $model->Actualizar($preg);
            header('Location: pregunta.php');
            break;
        case 'registrar':