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(){