From 668598fef923de16c356d5f828f10864f315b58b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Mu=C3=B1oz=20Garcia?= <73303506+danimu03@users.noreply.github.com> Date: Tue, 1 Jun 2021 17:46:11 +0200 Subject: [PATCH] update show cinemas --- panel_admin/index.php | 15 +++++- panel_admin/panelAdmin.php | 96 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 109 insertions(+), 2 deletions(-) diff --git a/panel_admin/index.php b/panel_admin/index.php index 7d813d1..1da8328 100644 --- a/panel_admin/index.php +++ b/panel_admin/index.php @@ -16,8 +16,19 @@ $reply=AdminPanel::deleteCinema(); } else { - $reply=AdminPanel::addCinema(); - $reply.= ($template->print_cinemas()); + 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"]); + //} + } + else { + $reply=AdminPanel::addCinema(); + $reply.= ($template->print_cinemas()); + } }; break; case 'mf': if(isset($_POST['edit_film'])) { diff --git a/panel_admin/panelAdmin.php b/panel_admin/panelAdmin.php index 7e63596..ce44cdb 100644 --- a/panel_admin/panelAdmin.php +++ b/panel_admin/panelAdmin.php @@ -86,6 +86,102 @@ '."\n"; } + static function showHalls($idCinema) { + include_once('../assets/php/includes/hall.php'); + include_once('../assets/php/includes/hall_dao.php'); + $panel = '
+
'; + $listhall = Hall::getListHalls($idCinema); + if(!$listhall){ + $panel .= "

No hay ninguna sala en este cine"; + }else{ + $panel .= ' +
+
    +
  • Sala
  • +
  • Asientos
  • +
  • Sesión
  • + '; + $parity = "odd"; + foreach($listhall as $hall){ + $panel .='
    +
  • '. $hall->getNumber().'
  • +
  • '.$hall->getTotalSeats().'
  • + + +
  • Sesiones
  • +
    +
    + '; + $parity = ($parity == "odd") ? "even" : "odd"; + } + $panel.=' +
'; + } + $panel.=' +
+
'; + return $panel; + + } + + /* static function showSessions($idCinema, $hallNumber) { + //Session list + $panel .='
'; + $sessions = Session::getListSessions($hall,$manager->getIdcinema(),$date); + + if($sessions) { + $panel .=' +
+ + + + + + + + + + '; + + + foreach($sessions as $session){ + $film = Session::getThisSessionFilm($session->getIdfilm()); + $panel .=' + + + + + + + + + + + + + + + + + + + '; + } + $panel.=' + +
HoraPeliculaFormatoPrecio
'.date("H:i", strtotime( $session->getStartTime())).' '. str_replace('_', ' ', $film["tittle"]) .' '.$session->getFormat().' '.$session->getSeatPrice().'
+ '; + } else { + $panel.='

No hay ninguna sesion

'; + } + $panel.=' + +
'; + + return $panel; + }*/ + //Functions MANAGERS static function print_managers(){