Add files via upload
This commit is contained in:
parent
51032e2630
commit
3087940f70
@ -1,6 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
class DAO {
|
class DAO {
|
||||||
|
|
||||||
//Atributes:
|
//Atributes:
|
||||||
public $mysqli;
|
public $mysqli;
|
||||||
|
|
||||||
|
@ -19,8 +19,13 @@
|
|||||||
|
|
||||||
//Encrypt password with SHA254.
|
//Encrypt password with SHA254.
|
||||||
private function encryptPass($password){
|
private function encryptPass($password){
|
||||||
//$password = hash('sha256', $password);
|
/* Una rica ensalada salada */
|
||||||
$password = password_hash($password, PASSWORD_DEFAULT);
|
/* $SALAD = [
|
||||||
|
'cost' => 11,
|
||||||
|
'salt' => mcrypt_create_iv(22, MCRYPT_DEV_URANDOM), //Hay que tener activado el módulo mcrypt para usar esta función.
|
||||||
|
]; */
|
||||||
|
|
||||||
|
$password = password_hash($password, PASSWORD_DEFAULT); //Actualmente en PHP PASSWORD_DEFAULT equivale a PASSWORD_BCRYPT.
|
||||||
|
|
||||||
return $password;
|
return $password;
|
||||||
}
|
}
|
||||||
|
@ -13,9 +13,19 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
static function panel(){
|
static function panel(){
|
||||||
|
include_once('../assets/php/includes/user.php');
|
||||||
|
|
||||||
|
$name = strtoupper(unserialize($_SESSION['user'])->getName());
|
||||||
|
$email = unserialize($_SESSION['user'])->getEmail();
|
||||||
|
$userPic = USER_PICS.strtolower($name).".jpg";
|
||||||
|
|
||||||
return $reply= '<div class="code info">
|
return $reply= '<div class="code info">
|
||||||
<h1>Bienvenido al Panel de Administrador.</h1>
|
<h1>Bienvenido al Panel de Administrador.</h1>
|
||||||
<hr />
|
<hr />
|
||||||
|
<img src='.$userPic.' alt="user_profile_picture"/>
|
||||||
|
<h3>'.strftime("%A %e de %B de %Y | %H:%M").'</h3>
|
||||||
|
<p>Administrador: '.$name.'</p>
|
||||||
|
<p>Email empresarial: '.$email.'</p>
|
||||||
</div>'."\n";
|
</div>'."\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
require_once('../assets/php/includes/manager.php');
|
require_once('../assets/php/includes/manager.php');
|
||||||
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"] && isset($_SESSION["lastRol"]) && ($_SESSION["lastRol"] === "admin" || $_SESSION["rol"] === "manager")) {
|
||||||
$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(isset($_POST['changecinema']))$_SESSION['cinema'] = $_POST['cinema'];
|
||||||
if(!is_null($_SESSION['cinema'])) $manager->setIdcinema($_SESSION['cinema']);
|
if(!is_null($_SESSION['cinema'])) $manager->setIdcinema($_SESSION['cinema']);
|
||||||
|
@ -20,11 +20,13 @@
|
|||||||
$c_tel = $cinema->getPhone();
|
$c_tel = $cinema->getPhone();
|
||||||
}
|
}
|
||||||
$name = strtoupper($_SESSION["nombre"]);
|
$name = strtoupper($_SESSION["nombre"]);
|
||||||
|
$userPic = USER_PICS.strtolower($name).".jpg";
|
||||||
$cinema = strtoupper( $manager->getIdcinema());
|
$cinema = strtoupper( $manager->getIdcinema());
|
||||||
|
|
||||||
$panel = '<div class="code info">
|
$panel = '<div class="code info">
|
||||||
<h1>Bienvenido '.$name.' a tu Panel de Manager.</h1>
|
<h1>Bienvenido '.$name.' a tu Panel de Manager.</h1>
|
||||||
<hr />
|
<hr />
|
||||||
|
<img src='.$userPic.' alt="user_profile_picture"/>
|
||||||
<p>Usuario: '.$name.'</p> <br>
|
<p>Usuario: '.$name.'</p> <br>
|
||||||
<p>Cine: '.$c_name.'</p>
|
<p>Cine: '.$c_name.'</p>
|
||||||
<p>Dirección: '.$c_dir.'</p>
|
<p>Dirección: '.$c_dir.'</p>
|
||||||
|
Loading…
Reference in New Issue
Block a user