Complete functionality

Missing elements of design and security
This commit is contained in:
Daniel Muñoz Garcia 2021-04-13 14:57:25 +02:00 committed by GitHub
parent cbbf66d128
commit 5a5a99ad80
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 53 additions and 1 deletions

View File

@ -0,0 +1,30 @@
<?php
include_once('./includes/film_dto.php');
include_once('./includes/formFilm.php');
if($_REQUEST['delete_film']) {
echo'<div class="column size">
<h2>Editar pelicula</h2>
<form method="post" action="delete_film.php">
<div class="row">
<fieldset id="film_form">
<legend>¿Estás seguro de que quieres eliminar esta pelicula?</legend>
<input type="hidden" name="id" value='.$_REQUEST['id'].'/>
<p>Id: '.$_REQUEST['id'].' </p>
<p>Título: '.$_REQUEST['tittle'].' </p>
<p>Duración: '.$_REQUEST['duration'].' </p>
<p>Idioma: '.$_REQUEST['language'].' </p>
<p>Descripción: '.$_REQUEST['description'].' </p>
</fieldset>
<div class="actions">
<input type="submit" id="submit" value="Eliminar" name="confirm_delete_film" class="primary" />
<input type="submit" id="submit" value="Cancelar" name="cancel_delete_film" class="primary" />
</div>
</div>
</form>
</div>';
}
?>

View File

@ -0,0 +1,12 @@
<?php
session_start();
include_once('./includes/film_dto.php');
include_once('./includes/formFilm.php');
if($_REQUEST['confirm_delete_film']) {
$film = new FormFilm();
$film->processesForm($_REQUEST['id'],null,null,null,null,"del");
$_SESSION['message'] = $film->getReply();
}
header("Location: ../panel_admin/index.php?state=mf");
?>

View File

@ -44,7 +44,16 @@
<input type="submit" id="submit" value="Editar" name="edit_film" class="primary" /> <input type="submit" id="submit" value="Editar" name="edit_film" class="primary" />
</form> </form>
</td> </td>
<td> <input type=submit name="submit" value="Borrar" class="button" formaction="delete_film.php"> </td> <td>
<form method="post" action="./index.php?state=df">
<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>
</tr>'; </tr>';
} }
echo'<tbody> echo'<tbody>

View File

@ -8,6 +8,7 @@
function showPanel() { function showPanel() {
switch($this->state) { switch($this->state) {
case 'df': require('deleteFilm.php');break;
case 'ef': require('editFilm.php');break; case 'ef': require('editFilm.php');break;
case 'mc': require('manage_cinemas.php'); break; case 'mc': require('manage_cinemas.php'); break;
case 'mf': require('manage_films.php'); break; case 'mf': require('manage_films.php'); break;