From a67e7b9c23a663199198ed2afec98c218b3ccc20 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Mu=C3=B1oz=20Garcia?= <73303506+danimu03@users.noreply.github.com> Date: Wed, 2 Jun 2021 13:06:50 +0200 Subject: [PATCH] Add files via upload --- panel_admin/includes/formAddManager.php | 6 +- panel_admin/includes/formDeleteCinema.php | 5 +- panel_admin/includes/formEditManager.php | 7 +-- panel_admin/includes/formEditPromotion.php | 3 +- panel_admin/index.php | 21 +++---- panel_admin/panelAdmin.php | 69 ++++++++++++---------- 6 files changed, 58 insertions(+), 53 deletions(-) diff --git a/panel_admin/includes/formAddManager.php b/panel_admin/includes/formAddManager.php index 4bf3ef5..3d15b4b 100644 --- a/panel_admin/includes/formAddManager.php +++ b/panel_admin/includes/formAddManager.php @@ -105,7 +105,9 @@ class formAddManager extends Form{ $html=''; for($i = 0; $i < count($users); $i++){ $html .= ' - '.$ids[$i].', '.$usernames[$i].', '.$usernames[$key].' + '.$ids[$i].', '.$usernames[$i]. + ', '.$usernames[$key]. + ' '; } @@ -129,7 +131,7 @@ class formAddManager extends Form{ $html = ''; for($i = 0; $i < count($cinemas); $i++){ $html.= ' - '.$ids[$i].', '.$names[$i].' + '.$ids[$i].', '.$names[$i].' '; } diff --git a/panel_admin/includes/formDeleteCinema.php b/panel_admin/includes/formDeleteCinema.php index e5c5a25..bc42f98 100644 --- a/panel_admin/includes/formDeleteCinema.php +++ b/panel_admin/includes/formDeleteCinema.php @@ -17,7 +17,7 @@ class formDeleteCinema extends Form{ $htmlErroresGlobales = self::generaListaErroresGlobales($errores); $errorId = self::createMensajeError($errores, 'id', 'span', array('class' => 'error')); - $html = ' + $html = ' '.$htmlErroresGlobales.' ¿Estás seguro de que quieres eliminar este cine? '.$errorId.' @@ -28,8 +28,7 @@ class formDeleteCinema extends Form{ - - '; + '; return $html; } diff --git a/panel_admin/includes/formEditManager.php b/panel_admin/includes/formEditManager.php index 8ea792d..68e32c6 100644 --- a/panel_admin/includes/formEditManager.php +++ b/panel_admin/includes/formEditManager.php @@ -23,9 +23,9 @@ class formEditManager extends Form{ $errorId = self::createMensajeError($errores, 'id', 'span', array('class' => 'error')); $errorIdCinema = self::createMensajeError($errores, 'idcinema', 'span', array('class' => 'error')); - $html = ' + $html = ' EDITAR GERENTE ID:'.$_POST['id'].' - '.$htmlErroresGlobales.' + '.$htmlErroresGlobales.' Selecciona cine.'.$errorIdCinema.' '.$errorId.'' .$this->showCinemas(). @@ -34,7 +34,6 @@ class formEditManager extends Form{ - '; return $html; @@ -100,7 +99,7 @@ class formEditManager extends Form{ $html = ''; for($i = 0; $i < count($cinemas); $i++){ $html.= ' - '.$ids[$i].', '.$names[$i].' + '.$ids[$i].', '.$names[$i].' '; } diff --git a/panel_admin/includes/formEditPromotion.php b/panel_admin/includes/formEditPromotion.php index f57390f..cf95db2 100644 --- a/panel_admin/includes/formEditPromotion.php +++ b/panel_admin/includes/formEditPromotion.php @@ -29,8 +29,7 @@ class formEditPromotion extends Form{ $errorImg = self::createMensajeError($errores, 'img', 'span', array('class' => 'error')); $html = ' - '.$htmlErroresGlobales.' - + '.$htmlErroresGlobales.' Datos de promocion '.$errorTittle.' diff --git a/panel_admin/index.php b/panel_admin/index.php index faa1cbb..5b388e7 100644 --- a/panel_admin/index.php +++ b/panel_admin/index.php @@ -17,13 +17,14 @@ } else { if(isset($_GET["cinema"])){ - // $reply = AdminPanel::showHalls($_GET["cinema"]); - /* if(isset($_GET["number"])) { - $reply = AdminPanel::showHalls($_GET["cinema"], $_GET["number"]); - } - else { */ - $reply = AdminPanel::showHalls($_GET["cinema"]); - //} + if(isset($_GET["cinema"])){ + if(isset($_GET["number"])) { + $reply = AdminPanel::showSessions($_GET["cinema"]); + } + else { + $reply = AdminPanel::showHalls($_GET["cinema"]); + } + } } else { $reply=AdminPanel::addCinema(); @@ -65,9 +66,9 @@ $reply=AdminPanel::addManager(); } - else { - $reply=AdminPanel::showAddBotton(); - $reply.=AdminPanel::print_managers(); + else { + $reply=AdminPanel::print_managers(); + $reply.=AdminPanel::showAddBotton(); }; break; case 'un': diff --git a/panel_admin/panelAdmin.php b/panel_admin/panelAdmin.php index 81f9af3..1b19605 100644 --- a/panel_admin/panelAdmin.php +++ b/panel_admin/panelAdmin.php @@ -118,7 +118,7 @@ '. $hall->getNumber().' '.$hall->getTotalSeats().' - + Sesiones @@ -135,10 +135,39 @@ } - /* static function showSessions($idCinema, $hallNumber) { + static function showSessions($idCinema){ + include_once('../assets/php/includes/hall.php'); + include_once('../assets/php/includes/hall_dao.php'); + include_once('../assets/php/includes/session_dao.php'); + include_once('../assets/php/includes/session.php'); + //Base filtering values + $date = $_POST['date'] ?? $_GET['date'] ?? date("Y-m-d"); + $hall = $_POST['hall'] ?? $_GET['hall'] ?? "1"; + + //Session filter + $panel=' + + + '; + + foreach(Hall::getListHalls($idCinema) as $hll){ + if($hll->getNumber() == $hall){ + $panel.= ' + Sala '. $hll->getNumber() .' '; + }else{ + $panel.= ' + Sala '. $hll->getNumber() .''; + } + } + $panel.=' + + + + + '; //Session list $panel .=' '; - $sessions = Session::getListSessions($hall,$manager->getIdcinema(),$date); + $sessions = Session::getListSessions($hall,$idCinema,$date); if($sessions) { $panel .=' @@ -163,19 +192,6 @@ '. str_replace('_', ' ', $film["tittle"]) .' '.$session->getFormat().' '.$session->getSeatPrice().' - - - - - - - - - - - - - '; } $panel.=' @@ -185,12 +201,10 @@ } else { $panel.=' No hay ninguna sesion '; } - $panel.=' - - '; + $panel.=''; return $panel; - }*/ + } //Functions MANAGERS @@ -217,8 +231,6 @@ } $reply= " - - Id IdCinema @@ -258,8 +270,6 @@ $reply.=' - - '; } return $reply; @@ -295,12 +305,11 @@ $formEM = new formEditManager(); $htmlEForm = $formEM->gestiona(); return $reply= ' + - EDITAR GERENTE '.$htmlEForm.' - - '."\n"; + '; } static function deleteManager(){ @@ -327,8 +336,7 @@ AÑADIR PROMOCIÓN '.$htmlAForm.' - - '."\n"; + '; } static function editPromotion(){ @@ -378,7 +386,6 @@ } $reply= " - Id Título @@ -422,8 +429,6 @@ $reply.=' - - '; }
'.$htmlErroresGlobales.'
'.$errorId.'
'.$errorIdCinema.'
'.$errorTittle.'