cinemaData($_SESSION["cinema"]);
$c_name = $cinema->getName();
$c_dir = $cinema->getDirection();
}
$name = strtoupper($_SESSION["nombre"]);
$userPic = USER_PICS.strtolower($name).".jpg";
$panel= '
Bienvenido '.$name.' a tu Panel de Manager.
'.strftime("%A %e de %B de %Y | %H:%M").'
Usuario: '.$name.'
Cine: '.$c_name.'
Dirección: '.$c_dir.'
Hack para entrar al calendario
'."\n";
return $panel;
}
static function welcomeAdmin() {
$cinemaList = new Cinema_DAO('complucine');
$cinemas = $cinemaList->allCinemaData();
$bd = new Cinema_DAO('complucine');
$c_name = "Aun no se ha escogido un cine";
if($bd && $_SESSION["cinema"] ){
$cinema = $bd->cinemaData($_SESSION["cinema"]);
$c_name = $cinema->getName();
$cinema = $cinema->getId();
}
$name = strtoupper($_SESSION["nombre"]);
$userPic = USER_PICS.strtolower($name).".jpg";
$panel= '
Bienvenido '.$name.' a tu Panel de Manager.
'.strftime("%A %e de %B de %Y | %H:%M").'
Usuario: '.$name.'
Como administrador puedes escoger el cine que gestionar
Cine: '.$c_name.'
Hack para entrar al calendario
';
return $panel;
}
static function calendar(){
$hall = $_POST['hall'] ?? $_GET['hall'] ?? "1";
$halls = Hall::getListHalls($_SESSION["cinema"]);
if($halls){
$panel ='
';
foreach(Hall::getListHalls($_SESSION["cinema"]) as $hll){
if($hll->getNumber() == $hall){
$panel.= '
Sala '. $hll->getNumber() .' ';
}else{
$panel.= '
Sala '. $hll->getNumber() .' ';
}
}
$panel.='
';
}else{
$panel ='';
}
return $panel;
}
static function success(){
$panel = '
Operacion completada.
'.$_SESSION['msg'].'
'."\n";
$_SESSION['msg'] = "";
return $panel;
}
static function manage_halls(){
$panel = '
';
$listhall = Hall::getListHalls($_SESSION["cinema"]);
if(!$listhall){
$panel .= "
No hay ninguna sala en este cine";
}else{
$panel .= '
Sala
Asientos
Sesión
';
$parity = "odd";
foreach($listhall as $hall){
$panel .='
';
$parity = ($parity == "odd") ? "even" : "odd";
}
$panel.='
';
}
$panel.='
';
return $panel;
}
static function new_hall(){
$formHall = new FormHall("new_hall",$_SESSION["cinema"],new Hall(null, null, null, null, null, null));
$panel = 'Crear una sala.
'.$formHall->gestiona();
return $panel;
}
static function edit_hall(){
$hall = Hall::search_hall($_GET["number"], $_SESSION["cinema"]);
if($hall || isset($_POST["restart"]) || isset($_POST["filter"]) || isset($_POST["sumbit"]) ){
$formHall = new FormHall("edit_hall",$_SESSION["cinema"], $hall);
$panel = 'Editar una sala.
'.$formHall->gestiona();
return $panel;
} else{
return Manager_panel::warning();
}
}
static function manage_sessions(){
//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,$_SESSION["cinema"],$date);
if($sessions) {
$panel .='
';
} else {
$panel.='
No hay ninguna sesion ';
}
$panel.='
';
return $panel;
}
static function new_session(){
$formSession = new FormSession("new_session", $_SESSION["cinema"] );
$panel = 'Crear una sesion.
'.$formSession->gestiona();
return $panel;
}
static function edit_session(){
$formSession = new FormSession("edit_session", $_SESSION["cinema"] );
$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){
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();
return $panel;
}
//Funcion que se envia cuando hay inconsistencia en el panel manager, principalmente por tocar cosas con la ulr
static function warning(){
$panel = ''."\n";
return $panel;
}
}
?>