Revert "."

This reverts commit 997209ecf3.
This commit is contained in:
marian1010 2021-04-13 20:28:33 +02:00
parent 75e56e378f
commit 6d7795563e
5 changed files with 11 additions and 13 deletions

View File

@ -20,7 +20,7 @@
<input type="text" name="language" id="language" value='.$_REQUEST['language'].' />
</div>
<div>
<input type="text" name="description" id="description" value="'.$_REQUEST['description'].'"/>
<input type="text" name="description" id="description" value='.$_REQUEST['description'].'/>
</div>
</fieldset>
<div class="actions">

View File

@ -1,5 +1,5 @@
<?php
require_once('../assets/php/dao.php');
require_once($prefix.'assets/php/dao.php');
include_once('film_dto.php');
class Film_DAO extends DAO {
@ -12,11 +12,11 @@
//Methods:
//Create a new Session.
public function createFilm($id, $tittle, $duration, $language,$description){
public function createFilm($id, $tittle, $duration, $language){
$sql = sprintf( "INSERT INTO `film`( `id`, `tittle`, `duration`, `language`,`description`)
VALUES ( '%d', '%s', '%d', '%s','%s')",
$id, $tittle, $duration, $language,$description);
$sql = sprintf( "INSERT INTO film( $id, $tittle, $duration, $language)
VALUES ( '%d', '%s', '%d', '%s')",
$id, $tittle, $duration, $language);
$resul = mysqli_query($this->mysqli, $sql) or die ('Error into query database');
@ -40,7 +40,7 @@
$films[] = $this->loadFilm($fila["id"], $fila["tittle"], $fila["duration"], $fila["language"], $fila["description"]);
}
return $films;
return $resul;
}
//Returns a query to get all films tittles.
@ -87,8 +87,8 @@
}
//Create a new film Data Transfer Object.
public function loadFilm($id, $tittle, $duration, $language,$description){
return new Film_DTO( $id, $tittle, $duration, $language,$description);
public function loadFilm($id, $tittle, $duration, $language){
return new FilmDTO( $id, $tittle, $duration, $language);
}
}

View File

@ -52,7 +52,7 @@ class FormFilm extends Form {
//Habria que validar todo para que encaje en la base de datos
$bd = new Film_DAO('complucine');
$bd = new FilmDAO('complucine');
if($bd ){
if($option == "new"){
$bd->createFilm(null, $title,$duration,$languaje,$description);

View File

@ -6,8 +6,6 @@
require_once('../panel_admin/panelAdmin.php');
$template = new Template();
if(isset($_SESSION["login"]) && $_SESSION["rol"] == "admin") $login = true;
if(isset($_REQUEST['state'])) {
$panel = new Panel($_REQUEST['state']);
}

View File

@ -60,7 +60,7 @@
</table>';
}
function addFilm(){
echo'<div class="column left">
echo'<div class="column size">
<h2>Añadir pelicula</h2>
<form method="post" action="add_film.php">
<div class="row">