getName());
$email = unserialize($_SESSION['user'])->getEmail();
$userPic = USER_PICS.strtolower($name).".jpg";
$forms = self::manage();
return $reply = '
Bienvenido, '.$name.', a tu Panel de Usuario.
'.strftime("%A %e de %B de %Y | %H:%M").'
Usuario: '.$name.'
Email: '.$email.'
'."\n".$forms;
}
//Manage the user account.
static function manage(){
require_once('./includes/formChangePass.php');
require_once('./includes/formChangeEmail.php');
require_once('./includes/formChangeName.php');
$formCN = new FormChangeName();
$htmlFormChangeName = $formCN->gestiona();
$formCP = new FormChangePass();
$htmlFormChangePass = $formCP->gestiona();
$formCE = new FormChangeEmail();
$htmlFormChangeEmail = $formCE->gestiona();
return $reply = '
Cambiar información de la cuenta
Cambiar nombre de usuario
'.$htmlFormChangeName.'
Cambiar contraseña
'.$htmlFormChangePass.'
Cambiar email de usuario
'.$htmlFormChangeEmail.'
'."\n";
}
//User purchase history.
static function changeUserPic(){
require_once('./includes/formUploadPic.php');
$formCP = new FormUploadFiles();
$htmlFormChangeUserPic = $formCP->gestiona();
$name = strtoupper(unserialize($_SESSION['user'])->getName());
$userPic = USER_PICS.strtolower($name).".jpg";
return $reply = '
Cambiar imagen de perfil
'.$htmlFormChangeUserPic.'
'."\n";
}
//User purchase history.
static function purchases(){
require_once('../assets/php/includes/purchase_dao.php');
include_once('../assets/php/includes/cinema_dao.php');
include_once('../assets/php/includes/hall_dao.php');
$purchasesHTML = '';
$purchaseDAO = new PurchaseDAO("complucine");
$purchases = $purchaseDAO->allPurchasesData(unserialize($_SESSION['user'])->getId());
if($purchases){
$sessions = array();
$halls = array();
$cinemas = array();
$rows = array();
$columns = array();
$dates = array();
foreach($purchases as $key=>$value){
$sessions[$key] = $value->getSessionId();
$halls[$key] = $value->getHallId();
$cinemas[$key] = $value->getCinemaId();
$rows[$key] = $value->getRow();
$columns[$key] = $value->getColumn();
$dates[$key] = $value->getTime();
}
for($i = 0; $i < count($purchases); $i++){
$cinemaDAO = new Cinema_DAO("complucine");
$cinema = $cinemaDAO->cinemaData($cinemas[$i]);
$hallDAO = new HallDAO("complucine");
$hall = $hallDAO->HallData($halls[$i]);
if($i%2 === 0){
if($i != 0) $purchasesHTML .= '
';
$purchasesHTML .= '
';
} else {
if($i != 0) $purchasesHTML .= '
';
$purchasesHTML .= '
';
}
$purchasesHTML .= '
Compara realizada el: '.$dates[$i].'
Cine: '.$cinema->getName().'
Dirección: '.$cinema->getDirection().'
Sala: '.$hall->getNumber().'
Sesión: '.$sessions[$i].'
Asiento(Fila): '.$rows[$i].'
Asiento(Columna): '.$columns[$i].'
';
}
}
return $reply = '
Historial de compras
'.$purchasesHTML.'
'."\n";
}
//User payment details
static function payment(){
return $reply = '
Aquí los datos de pago
'."\n";
}
//Delete user account.
static function delete(){
require_once('./includes/formDeleteAccount.php');
$formDA = new FormDeleteAccount();
$htmlFormDeleteAccount = $formDA->gestiona();
return $reply = '
ELIMINAR CUENTA DE USUARIO
'.$htmlFormDeleteAccount.'
'."\n";
}
}
?>