<?php include_once './cad/DAL/Connection.php'; include_once './cad/DTO/ClaseNota.php'; include_once './cad/BLL/ClaseNotaBLL.php'; $notaBLL = new NotaBLL(); if (isset($_REQUEST["task"])) { $task = $_REQUEST["task"]; } else { $task = "mostrar"; } switch ($task) { case "insertar": if (isset($_REQUEST["titulo"])) { $titulo = $_REQUEST["titulo"]; } if (isset($_REQUEST["nota"])) { $nota = $_REQUEST["nota"]; } $date = new DateTime(); $notaBLL->insert($date->format("Y-m-d-H:i:s"), $titulo, $nota, true, 1); $objNota = $notaBLL->select($idnota); echo json_encode($objNota); break; }
<?php include_once './cad/DAL/Connection.php'; include_once './cad/BLL/ClaseNotaBLL.php'; include_once './cad/DTO/ClaseNota.php'; include_once './cad/BLL/ClaseCategoriaBLL.php'; include_once './cad/DTO/ClaseCategoria.php'; $notaBLL = new NotaBLL(); $categoriaBLL = new CategoriaBLL(); if (isset($_REQUEST["task"])) { $task = $_REQUEST["task"]; } else { $task = "mostrar"; } switch ($task) { case "insertar": if (isset($_REQUEST["fecha"])) { $fecha = $_REQUEST["fecha"]; } if (isset($_REQUEST["nota"])) { $nota = $_REQUEST["nota"]; } if (isset($_REQUEST["estado"])) { $estado = $_REQUEST["estado"]; } if (isset($_REQUEST["id_categoria"])) { $id_categoria = $_REQUEST["id_categoria"]; } $id = $notaBLL->insert($fecha, $nota, $estado, $id_categoria); $objNota = $notaBLL->select($id); echo json_encode($objNota);
<?php include_once './cad/DAL/Connection.php'; include_once './cad/BLL/ClaseNotaBLL.php'; include_once './cad/DTO/ClaseNota.php'; include_once './cad/BLL/ClaseCategoriaBLL.php'; include_once './cad/DTO/ClaseCategoria.php'; $NotaBLL = new NotaBLL(); $categoriaBLL = new CategoriaBLL(); ?> <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <script src="js/script.js" type="text/javascript"></script> <link rel="stylesheet" href="css/style.css" type="text/css"> <link rel="stylesheet" href="css/style2.css" type="text/css"> <link rel="stylesheet" href="css/style3.css" type="text/css"> <link rel="stylesheet" href="css/normalize.css" type="text/css"> <title>Practico 2</title> </head> <body id="body"> <div class="arriba"> <form action="index.php" class="main-header__form"> <a href="javascript:buscar()" ><img src="img/search.png" border="0" class="main-header__form__search-button"></a> <input type="text" name="texto" onkeypress="callkeydownhandler(this);" id="tbus" class="main-header__form__search-field" placeholder="Buscar"> </form>
<?php include_once './cad/DAL/Connection.php'; include_once './cad/BLL/ClaseCategoriaBLL.php'; include_once './cad/DTO/ClaseCategoria.php'; include_once './cad/BLL/ClaseNotaBLL.php'; include_once './cad/DTO/ClaseNota.php'; $categoriaBLL = new CategoriaBLL(); $notaBLL = new NotaBLL(); ?> <!DOCTYPE html> <html> <head> <title>TODO supply a title</title> <meta charset="UTF-8"> <link type="text/css" rel="stylesheet" href="css/materialize.css" media="screen,projection" /> <link type="text/css" rel="stylesheet" href="css/style.css" media="screen,projection" /> <meta name="viewport" content="width=device-width, initial-scale=1.0"> </head> <body class="grey lighten-2"> <header> <div class="row no-margin-bottom white"> <div class="col s2"> <a href="#"><img class="responsive-img" src="images/logo.png"></a> </div> <div class="col s4"> <nav class="grey lighten-2 z-depth-0"> <div class="nav-wrapper"> <form> <div class="input-field">
<?php include_once './CAD/DAL/Connection.php'; include_once './CAD/BLL/ClaseNotaBLL.php'; include_once './CAD/DTO/ClaseNota.php'; include_once './CAD/BLL/ClaseCategoriaBLL.php'; include_once './CAD/DTO/ClaseCategoria.php'; $notaBLL = new NotaBLL(); $categoriaBLL = new CategoriaBLL(); if (isset($_REQUEST["task"])) { $task = $_REQUEST["task"]; } else { $task = "mostrar"; } switch ($task) { case "insertar": if (isset($_REQUEST["titulo"])) { $titulo = $_REQUEST["titulo"]; } if (isset($_REQUEST["nota"])) { $nota = $_REQUEST["nota"]; } if (isset($_REQUEST["idCategoria"])) { $idCategoria = $_REQUEST["idCategoria"]; } $id = $notaBLL->insert($titulo, $nota, $idCategoria); $objNota = $notaBLL->selectById($id); $objCategoria = $categoriaBLL->selectById($idCategoria); echo json_encode(array('nota' => $objNota, 'categoria' => $objCategoria)); break; case "seleccionar":
<?php include_once './cad/DAL/Connection.php'; include_once './cad/BLL/ClaseNotaBLL.php'; include_once './cad/DTO/ClaseNota.php'; include_once './cad/BLL/ClaseCategoriaBLL.php'; include_once './cad/DTO/ClaseCategoria.php'; $NotaBLL = new NotaBLL(); $categoriaBLL = new CategoriaBLL(); ?> <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <script src="js/script.js" type="text/javascript"></script> <link rel="stylesheet" href="css/style.css" type="text/css"> <link rel="stylesheet" href="css/style2.css" type="text/css"> <link rel="stylesheet" href="css/style3.css" type="text/css"> <link rel="stylesheet" href="css/normalize.css" type="text/css"> <title>Practico 2</title> </head> <body id="body"> <div class="arriba"> <form action="index.php" class="main-header__form"> <a href="javascript:buscar()" ><img src="img/search.png" border="0" class="main-header__form__search-button"></a> <input type="text" name="texto" id="tbus" class="main-header__form__search-field" placeholder="Buscar"> </form>