2021-04-12 23:23:55 +02:00
|
|
|
<?php
|
2021-04-15 10:18:50 +02:00
|
|
|
include_once('./includes/film_dto.php');
|
|
|
|
include_once('./includes/formFilm.php');
|
2021-04-12 23:23:55 +02:00
|
|
|
/*$f1 = new FilmDTO(1000,"Los vengadores",183,"español","");
|
|
|
|
$f2 = new FilmDTO(2001,"Mecernarios",140,"español","");
|
|
|
|
$f3 = new FilmDTO(3022,"Monster hunter",104,"español","");
|
|
|
|
$f4 = new FilmDTO(4560,"Godzilla vs kong",113,"inglés","");
|
|
|
|
$f5 = new FilmDTO(4260,"Tom y Jerry",131,"inglés","");
|
|
|
|
$f6 = new FilmDTO(4606,"Pequeños Detalles",127,"inglés","");
|
2021-04-13 13:50:23 +02:00
|
|
|
$film= array($f1, $f2, $f3, $f4,$f5,$f6); */
|
2021-04-12 23:23:55 +02:00
|
|
|
|
2021-04-13 13:50:23 +02:00
|
|
|
$film = new FormFilm();
|
|
|
|
$film->processesForm(null, null, null, null, null, "show");
|
|
|
|
|
|
|
|
function drawFilms($films){
|
|
|
|
|
2021-04-12 23:23:55 +02:00
|
|
|
echo "
|
|
|
|
<table class='alt'>
|
|
|
|
<thead>
|
|
|
|
<tr>
|
|
|
|
<th>Id</th>
|
|
|
|
<th>Título</th>
|
|
|
|
<th>Duracion</th>
|
|
|
|
<th>Idioma</th>
|
|
|
|
<th>Descripcion</th>
|
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
<tbody>";
|
|
|
|
foreach($films as $f){
|
2021-04-13 13:50:23 +02:00
|
|
|
echo '
|
2021-04-12 23:23:55 +02:00
|
|
|
<tr>
|
2021-04-13 13:50:23 +02:00
|
|
|
<td>'. $f->getId() .'</td>
|
|
|
|
<td>'. $f->getTittle() .'</td>
|
|
|
|
<td>'. $f->getDuration() .'</td>
|
|
|
|
<td>'. $f->getLanguage() .'</td>
|
|
|
|
<td>'. $f->getDescription().'</td>
|
|
|
|
<td>
|
2021-04-13 22:29:25 +02:00
|
|
|
<form method="post" action="./index.php?state=uf">
|
2021-04-13 13:50:23 +02:00
|
|
|
<input name="id" type="hidden" value="'.$f->getId().'">
|
|
|
|
<input name="tittle" type="hidden" value="'.$f->getTittle().'">
|
|
|
|
<input name="duration" type="hidden" value="'.$f->getDuration().'">
|
|
|
|
<input name="language" type="hidden" value="'.$f->getLanguage().'">
|
|
|
|
<input name="description" type="hidden" value="'.$f->getDescription().'">
|
|
|
|
<input type="submit" id="submit" value="Editar" name="edit_film" class="primary" />
|
|
|
|
</form>
|
|
|
|
</td>
|
2021-04-13 14:57:25 +02:00
|
|
|
<td>
|
2021-04-13 22:29:25 +02:00
|
|
|
<form method="post" action="./index.php?state=uf">
|
2021-04-13 14:57:25 +02:00
|
|
|
<input name="id" type="hidden" value="'.$f->getId().'">
|
|
|
|
<input name="tittle" type="hidden" value="'.$f->getTittle().'">
|
|
|
|
<input name="duration" type="hidden" value="'.$f->getDuration().'">
|
|
|
|
<input name="language" type="hidden" value="'.$f->getLanguage().'">
|
|
|
|
<input name="description" type="hidden" value="'.$f->getDescription().'">
|
|
|
|
<input type="submit" id="submit" value="Eliminar" name="delete_film" class="primary" />
|
|
|
|
</form>
|
|
|
|
</td>
|
2021-04-13 13:50:23 +02:00
|
|
|
</tr>';
|
2021-04-12 23:23:55 +02:00
|
|
|
}
|
2021-04-13 13:50:23 +02:00
|
|
|
echo'<tbody>
|
|
|
|
</table>';
|
2021-04-12 23:23:55 +02:00
|
|
|
}
|
|
|
|
function addFilm(){
|
2021-04-13 20:28:33 +02:00
|
|
|
echo'<div class="column size">
|
2021-04-12 23:23:55 +02:00
|
|
|
<h2>Añadir pelicula</h2>
|
2021-04-13 22:29:25 +02:00
|
|
|
<form method="post" action="update_film.php">
|
2021-04-12 23:23:55 +02:00
|
|
|
<div class="row">
|
|
|
|
<fieldset id="film_form">
|
|
|
|
<legend>Datos de pelicula</legend>
|
|
|
|
<div>
|
2021-04-13 13:50:23 +02:00
|
|
|
<input type="text" name="tittle" id="tittle" placeholder="Título" />
|
2021-04-12 23:23:55 +02:00
|
|
|
</div>
|
|
|
|
<div>
|
2021-04-13 13:50:23 +02:00
|
|
|
<input type="number" name="duration" id="duration" placeholder="Duración" />
|
2021-04-12 23:23:55 +02:00
|
|
|
</div>
|
|
|
|
<div>
|
2021-04-13 13:50:23 +02:00
|
|
|
<input type="text" name="language" id="language" placeholder="Idioma" />
|
2021-04-12 23:23:55 +02:00
|
|
|
</div>
|
|
|
|
<div>
|
2021-04-13 13:50:23 +02:00
|
|
|
<input type="text" name="description" id="description" placeholder="Descripción" />
|
2021-04-12 23:23:55 +02:00
|
|
|
</div>
|
|
|
|
</fieldset>
|
|
|
|
<div class="actions">
|
|
|
|
<input type="submit" id="submit" value="Añadir pelicula" name="add_film" class="primary" />
|
|
|
|
<input type="reset" id="reset" value="Borrar" />
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</form>
|
2021-04-13 13:50:23 +02:00
|
|
|
</div>';
|
|
|
|
}
|
|
|
|
drawFilms($film->getReply());
|
2021-04-12 23:23:55 +02:00
|
|
|
addFilm();
|
|
|
|
|
|
|
|
?>
|