Add files via upload

This commit is contained in:
Fernando Méndez 2021-05-19 11:58:30 +02:00 committed by GitHub
parent fd587dcf22
commit a41f1a86ab
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 9 deletions

View File

@ -5,13 +5,14 @@
//private const _NUMPAGES = 10; //Constant to page results. //private const _NUMPAGES = 10; //Constant to page results.
//Attributes: //Attributes:
private $page; //Page Name. private $page; //Page Name.
private $prefix; //Page prefix. private $prefix; //Page prefix.
private $session; //"Iniciar Sesión" (if user isn´t logged in), "Cerrar Sesión" (otherwise). private $session; //"Iniciar Sesión" (if user isn´t logged in), "Cerrar Sesión" (otherwise).
private $session_route; //"login/" (if user isn´t logged in), "logout/" (otherwise). private $session_route; //"login/" (if user isn´t logged in), "logout/" (otherwise).
private $panel; //Button to access the user's dashboard (only displayed if logged in). private $panel; //Button to access the user's dashboard (only displayed if logged in).
private $user_route; //Route of the panel (depends on the type of user). private $user_route; //Route of the panel (depends on the type of user).
private $sessionButtonClass; //Type of button to login or logout.
//Constructor: //Constructor:
function __construct(){ function __construct(){
@ -24,6 +25,7 @@
$this->session_route = 'login/'; //Default, the session has not started. $this->session_route = 'login/'; //Default, the session has not started.
$this->panel = ''; //Default, the session has not started. $this->panel = ''; //Default, the session has not started.
$this->user_route = 'panel_user/'; //Default, the type of client is user. $this->user_route = 'panel_user/'; //Default, the type of client is user.
$this->sessionButtonClass = ''; //Default, normal button.
} }
//Methods: //Methods:
@ -80,7 +82,8 @@
$page = $this->page; $page = $this->page;
$prefix = $this->prefix; $prefix = $this->prefix;
$session = $this->session; $session = $this->session;
$session_route =$this->session_route; $sessionButtonClass = $this->sessionButtonClass;
$session_route = $this->session_route;
$user_route = $this->user_route; $user_route = $this->user_route;
$panel =$this->panel; $panel =$this->panel;
@ -89,6 +92,7 @@
else if($_SESSION["rol"] === "manager") $user_route = 'panel_manager/'; else if($_SESSION["rol"] === "manager") $user_route = 'panel_manager/';
$panel = "<a href='{$prefix}{$user_route}'><li>Mi Panel</li></a>"; $panel = "<a href='{$prefix}{$user_route}'><li>Mi Panel</li></a>";
$session = 'Cerrar Sesión'; $session = 'Cerrar Sesión';
$sessionButtonClass = 'danger';
$session_route = 'logout/'; $session_route = 'logout/';
} }
@ -102,7 +106,7 @@
<a href='{$prefix}'><img src='{$prefix}img/favicon2.png' alt='favicon' /> CompluCine</a> | {$page} <a href='{$prefix}'><img src='{$prefix}img/favicon2.png' alt='favicon' /> CompluCine</a> | {$page}
<div class='menu'> <div class='menu'>
<nav>{$changeRol} <nav>{$changeRol}
<a href='{$prefix}{$session_route}'><li>{$session}</li></a> <a href='{$prefix}{$session_route}'><li class={$sessionButtonClass}>{$session}</li></a>
{$panel} {$panel}
<li>Menú <li>Menú
<ul> <ul>

View File

@ -80,6 +80,7 @@ class FormDeleteAccount extends Form {
session_destroy(); session_destroy();
$result = ROUTE_APP; $result = ROUTE_APP;
} else { } else {
$result[] = "Los datos introducidos\nno son válidos."; $result[] = "Los datos introducidos\nno son válidos.";
} }