From e799376cbde8731612dc14f7d1bb2a4c17de41c9 Mon Sep 17 00:00:00 2001 From: OscarRui <79144467+OscarRui@users.noreply.github.com> Date: Thu, 20 May 2021 10:53:47 +0200 Subject: [PATCH] en proceso para que admin pueda ver como gerente MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit por ahora peta esta en proceso, se sube para que mi compaƱero pueda unir su parte --- panel_manager/index.php | 44 +++++++++++++++++++++++++++++++-- panel_manager/panel_manager.php | 40 ++++++++++++++++++++++++++++++ 2 files changed, 82 insertions(+), 2 deletions(-) diff --git a/panel_manager/index.php b/panel_manager/index.php index 438786a..7548fb0 100644 --- a/panel_manager/index.php +++ b/panel_manager/index.php @@ -7,8 +7,48 @@ require_once('../assets/php/common/manager_dao.php'); require_once('../assets/php/common/manager.php'); require_once('../assets/php/common/user.php'); - - if($_SESSION["login"] && $_SESSION["rol"] === "manager"){ + + if($_SESSION["login"] && $_SESSION["lastRol"] === "admin" && $_SESSION["rol"] === "manager") { + $manager = false; + $manager = new Manager(null, null, null, null, null); + + + $state = isset($_GET['state']) ? $_GET['state'] : ''; + switch($state){ + case "view_user": + break; + case "view_ruser": + break; + case "manage_halls": + $panel = Manager_panel::manage_halls($manager); + break; + case "new_hall": + $panel = Manager_panel::new_hall($manager); + break; + case "edit_hall": + $panel = Manager_panel::edit_hall($manager); + break; + case "manage_sessions": + $panel = Manager_panel::manage_sessions($manager); + break; + case "new_session": + $panel = Manager_panel::new_session($manager); + break; + case "edit_session": + $panel = Manager_panel::edit_session($manager); + break; + case "select_film": + $panel = Manager_panel::select_film($template,$manager); + break; + case "success": + $panel = Manager_panel::success(); + break; + default: + $panel = Manager_panel::welcomeAdmin($manager); + break; + } + } + else if($_SESSION["login"] && $_SESSION["rol"] === "manager"){ $bd = new Manager_DAO('complucine'); $manager = false; if($bd && !$manager){ diff --git a/panel_manager/panel_manager.php b/panel_manager/panel_manager.php index e27e743..3a3861a 100644 --- a/panel_manager/panel_manager.php +++ b/panel_manager/panel_manager.php @@ -2,6 +2,7 @@ include_once($prefix.'assets/php/common/hall.php'); include_once($prefix.'assets/php/common/session.php'); require_once($prefix.'assets/php/common/manager.php'); + require_once($prefix.'assets/php/common/cinema_dao.php'); include_once('./includes/formHall.php'); include_once('./includes/formSession.php'); @@ -24,6 +25,45 @@ 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 = '
Usuario: '.$name.'
+Cine: '.$cinema.'
+Espero que estes pasando un buen dia
+ +