Add files via upload

This commit is contained in:
Fernando Méndez 2021-06-04 14:30:48 +02:00 committed by GitHub
parent 786d28f70c
commit f9a0a3c5ba
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 1 deletions

View File

@ -80,6 +80,12 @@ class FormChangeName extends Form {
} else {
$bd->changeUserName(unserialize($_SESSION['user'])->getId(), $nombre);
$user = $bd->selectUser($nombre, $password);
$actual_img = "../img/users/".unserialize($_SESSION['user'])->getName().".jpg";
$new_img = "../img/users/".$nombre.".jpg";
copy($actual_img, $new_img);
unlink($actual_img);
$_SESSION['user'] = serialize($user);
$_SESSION["nombre"] = $user->getName();
$_SESSION['message'] = "<div class='row'>

View File

@ -143,7 +143,7 @@ class FormSelectCinemaSession extends Form {
'.$cinemasListHTML.'
<h3>Sesiones</h3>
'.$sessionsListHTML.'
<h3>Aplicar código promocional<span id="codeValid">&#x2714;</span><span id="codeInvalid">&#x274C;</span></h3>
<h3><a href="../promotions/" target="_blank">Aplicar código promocional</a><span id="codeValid">&#x2714;</span><span id="codeInvalid">&#x274C;</span></h3>
<input type="text" name="code" id="code" value="" placeholder="Código pormocional" /><pre>'.$errorCode.'</pre>
</div>';
} else {

View File

@ -9,6 +9,7 @@
include_once($prefix.'assets/php/includes/session.php');
include_once($prefix.'assets/php/includes/cinema_dao.php');
include_once($prefix.'assets/php/includes/cinema.php');
include_once($prefix.'assets/php/includes/promotion_dao.php');
if(isset($_SESSION["purchase"]) && isset($_SESSION["film_purchase"])){
$purchase = unserialize($_SESSION["purchase"]);