Example #1
0
 public function Obtener($intidtarea)
 {
     try {
         $stm = $this->pdo->prepare("SELECT * FROM tb_tarea WHERE intidtarea = ?");
         $stm->execute(array($intidtarea));
         $r = $stm->fetch(PDO::FETCH_OBJ);
         $tar = new Tarea();
         $tar->__SET('nvchtarea', $r->nvchtarea);
         $tar->__SET('vchmaterial', $r->vchmaterial);
         $tar->__SET('nvchdescripciontarea', $r->nvchdescripciontarea);
         //$alm->__SET('foto', $r->foto);
         return $tar;
     } catch (Exception $e) {
         die($e->getMessage());
     }
 }
Example #2
0
    case 'sunday':
        echo "Domingo " . $hora;
        break;
    default:
        echo 'nada';
        break;
}
require_once 'tarea.entidad.php';
require_once 'tarea.model.php';
// Logica
$tar = new Tarea();
$model = new TareaModel();
if (isset($_REQUEST['action'])) {
    switch ($_REQUEST['action']) {
        case 'actualizar':
            $tar->__SET('intidtarea', $_REQUEST['intidtarea']);
            $tar->__SET('nvchtarea', $_REQUEST['nvchtarea']);
            $tar->__SET('vchmaterial', $_REQUEST['vchmaterial']);
            $tar->__SET('nvchdescripciontarea', $_REQUEST['nvchdescripciontarea']);
            //$alm->__SET('foto', $_REQUEST['foto']);
            //$alm->__SET('foto', $_REQUEST['foto']);
            $model->Actualizar($tar);
            header('Location: tarea.php');
            break;
        case 'registrar':
            $tar->__SET('nvchtarea', $_REQUEST['nvchtarea']);
            $tar->__SET('vchmaterial', $_REQUEST['vchmaterial']);
            $tar->__SET('nvchdescripciontarea', $_REQUEST['nvchdescripciontarea']);
            //$alm->__SET('foto', $_REQUEST['foto']);
            $model->Registrar($tar);
            header('Location: tarea.php');