cinemaData($manager->getIdcinema())); $c_name = $cinema->getId(); $c_dir = $cinema->getId(); $c_tel = $cinema->getId(); } $name = strtoupper($_SESSION["nombre"]); $cinema = strtoupper( $manager->getIdcinema()); $panel = '

Bienvenido '.$name.' a tu Panel de Manager.


Usuario: '.$name.'


Cine: '.$c_name.'

Dirección: '.$c_dir.'

Telefono: '.$c_tel.'


Espero que estes pasando un buen dia

'; return $panel; } static function welcomeAdmin($manager) { $cinemaList = new Cinema_DAO('complucine'); $cinemas = $cinemaList->allCinemaData(); $cinema = 1; $name = strtoupper($_SESSION["nombre"]); if(isset($_POST['change'])){ $manager->setIdcinema($_POST['cinema']); } if($manager->getIdcinema() != null) $cinema = strtoupper( $manager->getIdcinema()); $panel = '

Bienvenido '.$name.' a tu Panel de Manager.


Usuario: '.$name.'

Cine: '.$cinema.'

Espero que estes pasando un buen dia


'; return $panel; } static function success(){ $panel = '

Operacion completada.


'.$_SESSION['msg'].'

'."\n"; $_SESSION['msg'] = ""; return $panel; } static function manage_halls($manager){ $panel = '
'; $listhall = Hall::getListHalls($manager->getIdcinema()); if(!$listhall){ $panel .= "

No hay ninguna sala en este cine"; }else{ $panel .= '

Salas

Asientos


'; } $panel.='
'; return $panel; } static function new_hall($manager){ $formHall = new FormHall("new_hall",$manager->getIdcinema()); $panel = '

Crear una sala.



'.$formHall->gestiona(); return $panel; } static function edit_hall($manager){ $hall = Hall::search_hall($_GET["number"], $manager->getIdcinema()); if($hall || isset($_POST["restart"]) || isset($_POST["filter"]) || isset($_POST["sumbit"]) ){ $formHall = new FormHall("edit_hall",$manager->getIdcinema(), $hall); $panel = '

Editar una sala.



'.$formHall->gestiona(); return $panel; } else{ return Manager_panel::warning($manager); } } static function manage_sessions($manager){ //Base filtering values $date = $_POST['date'] ?? $_GET['date'] ?? date("Y-m-d"); $hall = $_POST['hall'] ?? $_GET['hall'] ?? "1"; //Session filter $panel='
'; //Session list $panel .='
'; $sessions = Session::getListSessions($hall,$manager->getIdcinema(),$date); if($sessions) { $panel .='
'; foreach($sessions as $session){ $film = Session::getThisSessionFilm($session->getIdfilm()); $panel .=' '; } $panel.='
Hora Pelicula Formato Precio
'.date("H:i", strtotime( $session->getStartTime())).' '. str_replace('_', ' ', $film["tittle"]) .' '.$session->getFormat().' '.$session->getSeatPrice().'
'; } else { $panel.='

No hay ninguna sesion

'; } $panel.='
'; return $panel; } static function new_session($manager){ $formSession = new FormSession("new_session", $manager->getIdcinema() ); $panel = '

Crear una sesion.



'.$formSession->gestiona(); return $panel; } static function edit_session($manager){ $formSession = new FormSession("edit_session", $manager->getIdcinema() ); $panel = '

Editar una sesion.



'.$formSession->gestiona(); return $panel; } //TODO: estado al modificar sesiones para la seleccion de peliculas usando el template->print films static function select_film($template,$manager){ if(isset($_POST["select_film"]) && isset($_POST["option"])){ $_SESSION["option"] = $_POST["option"]; $panel = '

Seleccionar Pelicula.



'; $panel .= $template->print_fimls(); $_SESSION["option"] = ""; } else $panel = self::warning($manager); return $panel; } //Funcion que se envia cuando hay inconsistencia en el panel manager, principalmente por tocar cosas con la ulr static function warning($manager){ $panel = '

Ha habido un error.


>.<

'."\n"; return $panel; } } ?>