2021-05-08 15:17:51 +02:00
|
|
|
<?php
|
2021-05-12 10:40:22 +02:00
|
|
|
|
2021-05-08 15:17:51 +02:00
|
|
|
//General Config File:
|
2021-04-26 22:40:34 +02:00
|
|
|
require_once('../assets/php/config.php');
|
2021-05-05 16:52:04 +02:00
|
|
|
//Controller file:
|
2021-05-13 14:06:48 +02:00
|
|
|
require_once('panel_manager.php');
|
|
|
|
require_once('../assets/php/common/manager_dao.php');
|
|
|
|
require_once('../assets/php/common/manager.php');
|
|
|
|
require_once('../assets/php/common/user.php');
|
2021-05-06 23:25:38 +02:00
|
|
|
|
2021-05-05 16:52:04 +02:00
|
|
|
if($_SESSION["login"] && $_SESSION["rol"] === "manager"){
|
2021-05-13 14:06:48 +02:00
|
|
|
$bd = new Manager_DAO('complucine');
|
|
|
|
$manager = false;
|
|
|
|
if($bd && !$manager){
|
|
|
|
$user = unserialize($_SESSION["user"]);
|
|
|
|
$manager = $bd->GetManager($user->getId());
|
|
|
|
|
|
|
|
if($manager){
|
|
|
|
if($manager->num_rows == 1){
|
|
|
|
$fila = $manager->fetch_assoc();
|
2021-05-13 23:58:18 +02:00
|
|
|
$manager = new Manager($fila["id"], $fila["idcinema"], null, null, null);
|
2021-05-13 14:06:48 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2021-05-13 23:58:18 +02:00
|
|
|
$state = isset($_GET['state']) ? $_GET['state'] : '';
|
|
|
|
switch($state){
|
2021-05-05 16:52:04 +02:00
|
|
|
case "view_ruser":
|
|
|
|
case "view_user":
|
2021-05-13 23:58:18 +02:00
|
|
|
$panel = '<div class="column side"></div>
|
|
|
|
<div class="column middle">
|
2021-05-05 16:52:04 +02:00
|
|
|
<div class="code info">
|
2021-05-13 23:58:18 +02:00
|
|
|
<h1>Esta vista aun no esta implementada.</h1><hr />
|
2021-05-05 16:52:04 +02:00
|
|
|
</div>
|
|
|
|
</div>
|
2021-05-13 23:58:18 +02:00
|
|
|
<div class="column side"></div>'."\n";
|
|
|
|
break;
|
2021-05-05 16:52:04 +02:00
|
|
|
case "manage_halls":
|
2021-05-13 23:58:18 +02:00
|
|
|
$panel = Manager_panel::manage_halls($manager);
|
|
|
|
break;
|
2021-05-05 16:52:04 +02:00
|
|
|
case "new_hall":
|
2021-05-13 23:58:18 +02:00
|
|
|
$panel = Manager_panel::new_hall($manager);
|
|
|
|
break;
|
2021-05-05 16:52:04 +02:00
|
|
|
case "edit_hall":
|
2021-05-13 23:58:18 +02:00
|
|
|
$panel = Manager_panel::edit_hall($manager);
|
|
|
|
break;
|
|
|
|
case "manage_sessions":
|
|
|
|
$panel = Manager_panel::manage_sessions($manager);
|
|
|
|
break;
|
2021-05-05 21:10:46 +02:00
|
|
|
case "new_session":
|
2021-05-13 23:58:18 +02:00
|
|
|
$panel = Manager_panel::new_session($manager);
|
|
|
|
break;
|
2021-05-05 21:10:46 +02:00
|
|
|
case "edit_session":
|
2021-05-13 23:58:18 +02:00
|
|
|
$panel = Manager_panel::edit_session($manager);
|
|
|
|
break;
|
2021-05-07 13:48:20 +02:00
|
|
|
case "select_film":
|
2021-05-13 23:58:18 +02:00
|
|
|
$panel = Manager_panel::select_film($template,$manager);
|
|
|
|
break;
|
2021-05-05 16:52:04 +02:00
|
|
|
case "success":
|
2021-05-13 23:58:18 +02:00
|
|
|
$panel = Manager_panel::success();
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
$panel = Manager_panel::welcome($manager);
|
|
|
|
break;
|
|
|
|
}
|
2021-05-05 16:52:04 +02:00
|
|
|
}
|
|
|
|
else{
|
|
|
|
$panel = '<div class="column side"></div>
|
|
|
|
<div class="column middle">
|
|
|
|
<div class="code info">
|
|
|
|
<h1>Debes iniciar sesión para ver el Panel de Manager.</h1><hr />
|
|
|
|
<p>Inicia Sesión en una cuenta con permisos.</p>
|
|
|
|
<a href="'.$prefix.'login/" ><button class="button large">Iniciar Sesión</button></a>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="column side"></div>'."\n";
|
|
|
|
}
|
2021-04-26 22:40:34 +02:00
|
|
|
|
2021-05-13 09:37:14 +02:00
|
|
|
//Specific page content:
|
|
|
|
$section = '<!-- Manager Panel -->
|
2021-05-13 14:06:48 +02:00
|
|
|
<link rel="stylesheet" href="../assets/css/manager.css">
|
2021-05-13 09:37:14 +02:00
|
|
|
<section id="manager_panel">
|
2021-05-13 14:06:48 +02:00
|
|
|
<!-- Contents -->
|
|
|
|
<div class="row">
|
|
|
|
'.$panel.'
|
|
|
|
</div>
|
2021-05-13 09:37:14 +02:00
|
|
|
</section>';
|
2021-04-26 22:40:34 +02:00
|
|
|
|
2021-05-13 09:37:14 +02:00
|
|
|
//General page content:
|
|
|
|
require RAIZ_APP.'/HTMLtemplate.php';
|
|
|
|
?>
|