2021-05-03 15:11:59 +02:00
|
|
|
<?php
|
2021-05-09 16:14:52 +02:00
|
|
|
require_once($prefix.'assets/php/common/user.php');
|
2021-05-03 16:38:53 +02:00
|
|
|
|
2021-05-03 15:11:59 +02:00
|
|
|
class UserPanel {
|
|
|
|
//Atributes:
|
|
|
|
|
|
|
|
//Constructor:
|
|
|
|
function __construct(){}
|
|
|
|
|
|
|
|
//Methods:
|
|
|
|
|
2021-05-03 15:18:17 +02:00
|
|
|
//Welcome view.
|
|
|
|
static function panel(){
|
2021-05-10 18:15:58 +02:00
|
|
|
$name = strtoupper(unserialize($_SESSION['user'])->getName());
|
2021-05-03 16:38:53 +02:00
|
|
|
$email = unserialize($_SESSION['user'])->getEmail();
|
2021-05-03 15:18:17 +02:00
|
|
|
return $reply = '<div class="code info">
|
2021-05-03 21:58:47 +02:00
|
|
|
<h1>Bienvenido '.$name.' a tu Panel de Usuario.</h1>
|
|
|
|
<hr />
|
|
|
|
<h3>'.strftime("%A %e de %B de %Y | %H:%M").'</h3>
|
|
|
|
<br />
|
|
|
|
<p>Usuario: '.$name.'</p>
|
|
|
|
<p>Email: '.$email.'</p>
|
|
|
|
</div>'."\n";
|
2021-05-03 15:18:17 +02:00
|
|
|
}
|
|
|
|
|
2021-05-03 15:11:59 +02:00
|
|
|
//Manage the user account.
|
|
|
|
static function manage(){
|
2021-05-09 16:46:12 +02:00
|
|
|
|
2021-05-09 16:14:52 +02:00
|
|
|
require_once('./includes/formChangePass.php');
|
|
|
|
require_once('./includes/formChangeEmail.php');
|
|
|
|
require_once('./includes/formChangeName.php');
|
|
|
|
|
|
|
|
$formCN = new FormChangeName();
|
|
|
|
$htmlFormChangeName = $formCN->gestiona();
|
2021-05-09 16:27:21 +02:00
|
|
|
|
|
|
|
$formCP = new FormChangePass();
|
|
|
|
$htmlFormChangePass = $formCP->gestiona();
|
|
|
|
|
|
|
|
$formCE = new FormChangeEmail();
|
|
|
|
$htmlFormChangeEmail = $formCE->gestiona();
|
2021-05-09 16:14:52 +02:00
|
|
|
|
|
|
|
return $reply = '<!-- Change User Name -->
|
|
|
|
<div class="column side">
|
|
|
|
<h2>Cambiar nombre de usuario</h2>
|
|
|
|
'.$htmlFormChangeName.'
|
|
|
|
</div>
|
2021-05-09 20:31:54 +02:00
|
|
|
<!-- Change User Password -->
|
2021-05-09 16:27:21 +02:00
|
|
|
<div class="column middle">
|
|
|
|
<h2>Cambiar contraseña</h2>
|
|
|
|
'.$htmlFormChangePass.'
|
|
|
|
</div>
|
2021-05-09 20:31:54 +02:00
|
|
|
<!-- Change User Email -->
|
2021-05-09 16:27:21 +02:00
|
|
|
<div class="column side">
|
|
|
|
<h2>Cambiar email de usuario</h2>
|
|
|
|
'.$htmlFormChangeEmail.'
|
|
|
|
</div>'."\n";
|
2021-05-03 15:11:59 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
//User purchase history.
|
|
|
|
static function purchases(){
|
|
|
|
return $reply = '<div class="code info">
|
|
|
|
<h2>Aquí el historial de compras</h2><hr />
|
|
|
|
</div>'."\n";
|
|
|
|
}
|
|
|
|
|
|
|
|
//User payment details
|
|
|
|
static function payment(){
|
|
|
|
return $reply = '<div class="code info">
|
|
|
|
<h2>Aquí los datos de pago</h2><hr />
|
|
|
|
</div>'."\n";
|
|
|
|
}
|
|
|
|
|
|
|
|
//Delete user account.
|
|
|
|
static function delete(){
|
|
|
|
return $reply = '<div class="code info">
|
|
|
|
<h2>Aquí el formulario para eliminar cuenta</h2><hr />
|
|
|
|
</div>'."\n";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
?>
|