From 997209ecf3f5076248193ea07f48e68f519fbd2f Mon Sep 17 00:00:00 2001 From: marian1010 <79144276+marian1010@users.noreply.github.com> Date: Tue, 13 Apr 2021 20:21:27 +0200 Subject: [PATCH] . --- panel_admin/editFilm.php | 2 +- panel_admin/includes/film_dao.php | 16 ++++++++-------- panel_admin/includes/formFilm.php | 2 +- panel_admin/index.php | 2 ++ panel_admin/manage_films.php | 2 +- 5 files changed, 13 insertions(+), 11 deletions(-) diff --git a/panel_admin/editFilm.php b/panel_admin/editFilm.php index 3ac8f90..3058869 100644 --- a/panel_admin/editFilm.php +++ b/panel_admin/editFilm.php @@ -20,7 +20,7 @@
- +
diff --git a/panel_admin/includes/film_dao.php b/panel_admin/includes/film_dao.php index 70e24bc..61efe56 100644 --- a/panel_admin/includes/film_dao.php +++ b/panel_admin/includes/film_dao.php @@ -1,5 +1,5 @@ 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 $resul; + return $films; } //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){ - return new FilmDTO( $id, $tittle, $duration, $language); + public function loadFilm($id, $tittle, $duration, $language,$description){ + return new Film_DTO( $id, $tittle, $duration, $language,$description); } } diff --git a/panel_admin/includes/formFilm.php b/panel_admin/includes/formFilm.php index 9982558..68c4146 100644 --- a/panel_admin/includes/formFilm.php +++ b/panel_admin/includes/formFilm.php @@ -52,7 +52,7 @@ class FormFilm extends Form { //Habria que validar todo para que encaje en la base de datos - $bd = new FilmDAO('complucine'); + $bd = new Film_DAO('complucine'); if($bd ){ if($option == "new"){ $bd->createFilm(null, $title,$duration,$languaje,$description); diff --git a/panel_admin/index.php b/panel_admin/index.php index 3ad1eea..7516ee7 100644 --- a/panel_admin/index.php +++ b/panel_admin/index.php @@ -6,6 +6,8 @@ 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']); } diff --git a/panel_admin/manage_films.php b/panel_admin/manage_films.php index 2348ed8..b7e9402 100644 --- a/panel_admin/manage_films.php +++ b/panel_admin/manage_films.php @@ -60,7 +60,7 @@ '; } function addFilm(){ - echo'
+ echo'

AƱadir pelicula