| 1 | <?php |
| 2 | |
| 3 | require_once __DIR__ . "/../lib/php/ejecutaServicio.php"; |
| 4 | require_once __DIR__ . "/../lib/php/select.php"; |
| 5 | require_once __DIR__ . "/../lib/php/devuelveJson.php"; |
| 6 | require_once __DIR__ . "/Bd.php"; |
| 7 | require_once __DIR__ . "/TABLA_PASATIEMPO.php"; |
| 8 | |
| 9 | ejecutaServicio(function () { |
| 10 | |
| 11 | $lista = select(pdo: Bd::pdo(), from: PASATIEMPO, orderBy: PAS_NOMBRE); |
| 12 | |
| 13 | $render = ""; |
| 14 | foreach ($lista as $modelo) { |
| 15 | $encodeId = urlencode($modelo[PAS_ID]); |
| 16 | $id = htmlentities($encodeId); |
| 17 | $nombre = htmlentities($modelo[PAS_NOMBRE]); |
| 18 | $render .= |
| 19 | "<li> |
| 20 | <p> |
| 21 | <a href='modifica.html?id=$id'>$nombre</a> |
| 22 | </p> |
| 23 | </li>"; |
| 24 | } |
| 25 | |
| 26 | devuelveJson(["lista" => ["innerHTML" => $render]]); |
| 27 | }); |
| 28 | |