ver como gerente

This commit is contained in:
OscarRui 2021-06-01 12:30:28 +02:00 committed by GitHub
parent 91d001f29d
commit 0bafdb106a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 6 deletions

View File

@ -8,8 +8,10 @@
require_once('../assets/php/includes/user.php'); require_once('../assets/php/includes/user.php');
if($_SESSION["login"] && $_SESSION["lastRol"] === "admin" && $_SESSION["rol"] === "manager") { if($_SESSION["login"] && $_SESSION["lastRol"] === "admin" && $_SESSION["rol"] === "manager") {
$manager = false;
$manager = new Manager(null, null, null, null, null); $manager = new Manager(null, null, null, null, null);
if(isset($_POST['changecinema']))$_SESSION['cinema'] = $_POST['cinema'];
if(!is_null($_SESSION['cinema'])) $manager->setIdcinema($_SESSION['cinema']);
$state = isset($_GET['state']) ? $_GET['state'] : ''; $state = isset($_GET['state']) ? $_GET['state'] : '';

View File

@ -40,12 +40,9 @@
static function welcomeAdmin($manager) { static function welcomeAdmin($manager) {
$cinemaList = new Cinema_DAO('complucine'); $cinemaList = new Cinema_DAO('complucine');
$cinemas = $cinemaList->allCinemaData(); $cinemas = $cinemaList->allCinemaData();
$cinema = 1; $cinema;
$name = strtoupper($_SESSION["nombre"]); $name = strtoupper($_SESSION["nombre"]);
if(isset($_POST['change'])){
$manager->setIdcinema($_POST['cinema']);
}
if($manager->getIdcinema() != null) $cinema = strtoupper( $manager->getIdcinema()); if($manager->getIdcinema() != null) $cinema = strtoupper( $manager->getIdcinema());
@ -67,7 +64,7 @@
"; ";
} }
} }
$panel .= ' <input type="submit" name="change" value="Cambiar" /><br> $panel .= ' <input type="submit" name="changecinema" value="Cambiar" /><br>
</select> </select>
</form> </form>
</div>'; </div>';