From 3e7378d9d9e5b458b63133fc04ce8a3cc3590599 Mon Sep 17 00:00:00 2001 From: Markines16 <80280295+Markines16@users.noreply.github.com> Date: Wed, 14 Apr 2021 19:59:52 +0200 Subject: [PATCH] Add files via upload --- panel_manager/includes/formSession.php | 2 +- panel_manager/index.php | 6 ++-- panel_manager/manage_sessions.php | 49 ++++++++++++++++---------- panel_manager/panel_manager.php | 1 + 4 files changed, 36 insertions(+), 22 deletions(-) diff --git a/panel_manager/includes/formSession.php b/panel_manager/includes/formSession.php index 90e235d..c27804b 100644 --- a/panel_manager/includes/formSession.php +++ b/panel_manager/includes/formSession.php @@ -37,7 +37,7 @@ class FormSession extends Form { }else if($this->option == "list"){ $this->reply = $this->sessions; } - } else { + } else if($this->correct == false) { $this->reply = "

ERROR


Ha habido un error en la operacion. Revisa los datos introducidos o ponte en contacto con el administrador de la base de datos.

"; diff --git a/panel_manager/index.php b/panel_manager/index.php index 825c4c4..8957579 100644 --- a/panel_manager/index.php +++ b/panel_manager/index.php @@ -3,9 +3,11 @@ session_start(); require_once('../assets/php/template.php'); - require_once('./panel_manager.php'); - $template = new Template(); + $prefix = $template->get_prefix(); + + include_once('panel_manager.php'); + $login = false; if(isset($_SESSION["login"]) && $_SESSION["nombre"] == "manager") $login = true; diff --git a/panel_manager/manage_sessions.php b/panel_manager/manage_sessions.php index 5806155..7818f25 100644 --- a/panel_manager/manage_sessions.php +++ b/panel_manager/manage_sessions.php @@ -5,30 +5,31 @@ require('./includes/session_dto.php'); require('./includes/formSession.php'); - require('../panel_admin/includes/film_dto.php'); - require('../panel_admin/includes/film_dao.php'); + require_once('../assets/php/template.php'); + $template = new Template(); + $prefix = $template->get_prefix(); + + require($prefix.'panel_admin/includes/film_dto.php'); + require($prefix.'/panel_admin/includes/film_dao.php'); $formSession = new FormSession(); $formHall = new FormHall(); $placeholder_date = date("Y-m-d"); $placeholder_hall = "1"; - $filtered = false; $cinema = "1"; - - $formHall->processesForm(null, $cinema, null, null, "list"); - + if(isset($_POST['filter'])) { $placeholder_date = $_POST["date"]; $placeholder_hall = $_POST["hall"]; - $filtered = true; - - $formSession->processesForm(null, null, $placeholder_hall, $cinema, $placeholder_date, null, null, null, null, "list"); } - + + $formHall->processesForm(null, $cinema, null, null, "list"); + $formSession->processesForm(null, null, $placeholder_hall, $cinema, $placeholder_date, null, null, null, null, "list"); + echo"
-
+
"; - function drawSessions($sessions){ + function drawSessions($sessions,$bd){ echo " -
+
@@ -59,11 +60,13 @@ "; foreach($sessions as $s){ + $film = mysqli_fetch_array($bd->FilmData($s->getIdfilm())); echo " - - - + + + + "; } @@ -74,12 +77,20 @@ "; } - if($formSession->getReply() != null){ - drawSessions($formSession->getReply()); + if($formSession->getReply()){ + $bd = new Film_DAO('complucine'); + if($bd){ + drawSessions($formSession->getReply(), $bd); + } else { + echo "
+

Hay un error en la conexion

+
"; + } } else { echo "

No hay ninguna session en la sala ". $placeholder_hall . " el dia ". $placeholder_date . "

- "; + +
"; } echo " diff --git a/panel_manager/panel_manager.php b/panel_manager/panel_manager.php index 11e2387..0eadbc0 100644 --- a/panel_manager/panel_manager.php +++ b/panel_manager/panel_manager.php @@ -6,6 +6,7 @@ function __construct($panel,$log){ $this->state = $panel; $this->login = $log; + } function showPanel() {
" . $s->getStartTime() . " " . $s->getIdfilm() . " ". $s->getSeatPrice() . " " . date('H:i', strtotime( $s->getStartTime())) . " " . str_replace('_', ' ', $film["tittle"]) . " " . $s->getFormat() . " " . $s->getSeatPrice() . " getid() ."\"/>