From d370d281f1d6657654fa07ad15119af06321ba1e Mon Sep 17 00:00:00 2001 From: Markines16 <80280295+Markines16@users.noreply.github.com> Date: Mon, 3 May 2021 12:40:59 +0200 Subject: [PATCH] Restructuracion de las salas La lista de salas se obtiene de forma distinta, por eso editar/crear sessiones ha dejado de funcionar, pero bueno, estamos a la espera de ver como deberiamos estructurarlo y eso hay que cambiarlo asi que tampoco es problema. El html del formulario de crear salas esta guardado en formhalls, haciendo mas sencillo el codigo de la vista y la logica de edit_halls --- panel_manager/edit_halls.php | 16 +++++++++++++ panel_manager/edit_sessions.php | 6 ++--- panel_manager/includes/formHall.php | 33 ++++++++++++++++++++++++--- panel_manager/index.php | 11 ++------- panel_manager/manage_halls.php | 35 +++++++++++++++++++++++++++++ panel_manager/manage_sessions.php | 8 +++---- panel_manager/panel_manager.php | 3 ++- 7 files changed, 92 insertions(+), 20 deletions(-) create mode 100644 panel_manager/edit_halls.php create mode 100644 panel_manager/manage_halls.php diff --git a/panel_manager/edit_halls.php b/panel_manager/edit_halls.php new file mode 100644 index 0000000..1d681cf --- /dev/null +++ b/panel_manager/edit_halls.php @@ -0,0 +1,16 @@ + Crear una Sala "; + $form->gestiona(); + } + +?> \ No newline at end of file diff --git a/panel_manager/edit_sessions.php b/panel_manager/edit_sessions.php index a3ce8ab..e867a93 100644 --- a/panel_manager/edit_sessions.php +++ b/panel_manager/edit_sessions.php @@ -3,12 +3,12 @@ require_once($prefix.'assets/php/config.php'); include_once('./includes/formHall.php'); - require_once($prefix.'assets/php/common/hall_dto.php'); + require_once($prefix.'assets/php/common/hall.php'); - require_once($prefix.'assets/php/common/session_dto.php'); + require_once($prefix.'assets/php/common/session.php'); include_once($prefix.'assets/php/common/session_dao.php'); - require_once($prefix.'assets/php/common/film_dto.php'); + require_once($prefix.'assets/php/common/film.php'); include_once($prefix.'assets/php/common/film_dao.php'); $formHall = new FormHall(); diff --git a/panel_manager/includes/formHall.php b/panel_manager/includes/formHall.php index 0972e16..ee45443 100644 --- a/panel_manager/includes/formHall.php +++ b/panel_manager/includes/formHall.php @@ -15,7 +15,35 @@ class FormHall extends Form { parent::__construct('formSession'); $this->reply = array(); } - + + protected function generaCamposFormulario($datos, $errores = array()){ + $this->option = $_SESSION['option']; + $_SESSION['option'] = ""; + $htmlform = ""; + + + + if($this->option == "new"){ + $number = $datos['number'] ?? ''; + $rows = $datos['rows'] ?? ''; + $cols = $datos['cols'] ?? ''; + $seats = $datos['seats'] ?? ''; + + + $htmlform .= ' +
+ '; + } + + + return $htmlform; + } //Methods: //Returns validation response: @@ -46,8 +74,7 @@ class FormHall extends Form { } //Process form: - public function processesForm($number, $cinema, $rows, $cols, $option) { - $this->option = $option; + public function processesForm($datos){ $this->correct = true; $bd = new HallDAO('complucine'); diff --git a/panel_manager/index.php b/panel_manager/index.php index 100eb33..ae40f52 100644 --- a/panel_manager/index.php +++ b/panel_manager/index.php @@ -5,16 +5,9 @@ include_once('panel_manager.php'); - $login = false; + $login = (isset($_SESSION["login"]) && $_SESSION["rol"] == "manager") ? true : false; + $panel = isset($_REQUEST['state']) ? new Panel($_REQUEST['state'],$login) : $panel = new Panel('',$login); - if(isset($_SESSION["login"]) && $_SESSION["rol"] == "manager") $login = true; - - if(isset($_REQUEST['state'])) { - $panel = new Panel($_REQUEST['state'],$login); - } - else { - $panel = new Panel('',$login); - } ?> +