2021-05-28 14:21:10 +02:00
|
|
|
<?php
|
|
|
|
//General Config File:
|
|
|
|
require_once('../assets/php/config.php');
|
|
|
|
|
|
|
|
//Get purchase summary
|
|
|
|
include_once($prefix.'assets/php/includes/purchase.php');
|
|
|
|
include_once($prefix.'assets/php/includes/film.php');
|
|
|
|
include_once($prefix.'assets/php/includes/session_dao.php');
|
|
|
|
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');
|
|
|
|
|
2021-05-29 15:59:19 +02:00
|
|
|
if(isset($_SESSION["purchase"]) && isset($_SESSION["film_purchase"])){
|
|
|
|
$purchase = unserialize($_SESSION["purchase"]);
|
|
|
|
$film_purchase = unserialize($_SESSION["film_purchase"]);
|
|
|
|
$sessionDAO = new SessionDAO("complucine");
|
|
|
|
$session = $sessionDAO->sessionData($purchase->getSessionId());
|
|
|
|
$cinemaDAO = new Cinema_DAO("complucine");
|
|
|
|
$cinema = $cinemaDAO->cinemaData($purchase->getCinemaId());
|
2021-05-28 14:21:10 +02:00
|
|
|
|
2021-06-02 17:42:58 +02:00
|
|
|
$seat = 1; //$_POST[];
|
|
|
|
|
2021-05-29 15:59:19 +02:00
|
|
|
unset($_SESSION["purchase"]);
|
|
|
|
unset($_SESSION["film_purchase"]);
|
2021-05-28 14:21:10 +02:00
|
|
|
|
2021-05-29 15:59:19 +02:00
|
|
|
$reply = "<h2>Se ha realizado su compra con éxito, a continuación puede ver el resumen:</h2><hr />
|
|
|
|
<div class='column left'>
|
|
|
|
<img src='".$prefix."img/films/".$film_purchase->getImg()."' alt='".$film_purchase->getTittle()."' />
|
|
|
|
<p>Película: ".str_replace('_', ' ', strtoupper($film_purchase->getTittle()))."</p>
|
|
|
|
<p>Duración: ".$film_purchase->getDuration()." minutos</p>
|
|
|
|
<p>Idioma: ".$film_purchase->getLanguage()."</p>
|
|
|
|
<p>Precio: ".$session->getSeatPrice()." €</p>
|
|
|
|
</div>
|
|
|
|
<div class='column right'>
|
|
|
|
<p>Sesión (Fecha): ".$session->getDate()."</p>
|
|
|
|
<p>Sesión (Hora): ".$session->getStartTime()."</p>
|
|
|
|
<p>Cine: ".$cinema->getName()."</p>
|
|
|
|
<p>Sala: ".$purchase->getHallId()."</p>
|
2021-06-02 17:42:58 +02:00
|
|
|
<p>Asiento: ".$seat."</p>
|
2021-05-29 15:59:19 +02:00
|
|
|
<p>Asiento (Columna): ".$purchase->getRow()."</p>
|
|
|
|
<p>Asiento (Fila): ".$purchase->getColumn()."</p>
|
2021-06-01 13:06:00 +02:00
|
|
|
<p>Fecha de la Compra: ".$purchase->getTime()."</p>
|
2021-05-29 15:59:19 +02:00
|
|
|
</div>
|
|
|
|
";
|
2021-05-28 14:21:10 +02:00
|
|
|
|
2021-05-29 15:59:19 +02:00
|
|
|
if(isset($_SESSION["login"]) && $_SESSION["login"] == true){
|
|
|
|
$actions = '<h3>Guarde esta información y enséñela para entrar al cine.</h3><hr />
|
|
|
|
<p>Se ha guardado la información de la compra en su panel de usuario.</p>
|
|
|
|
<button onclick="javascript:window.print()">Imprimir<//button>
|
|
|
|
<a href="'.$prefix.'panel_user/?option=purchases"><button>Mi Historial</button></a>
|
|
|
|
';
|
|
|
|
} else {
|
|
|
|
$actions = '<h3>Guarde esta información y enséñela para entrar al cine.</h3><hr />
|
|
|
|
<button onclick="javascript:window.print()">Imprimir<//button>
|
|
|
|
<!-- <button onclick="javascript:window.print()">Guardar<//button> -->
|
|
|
|
';
|
|
|
|
}
|
2021-05-28 14:21:10 +02:00
|
|
|
} else {
|
2021-05-29 15:59:19 +02:00
|
|
|
$reply = '<h2>No se han encontrado datos de compra<h2>';
|
|
|
|
$actions = '';
|
2021-05-28 14:21:10 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
//Page-specific content:
|
|
|
|
$section = '<!-- Purchase Summary -->
|
|
|
|
<section id="purchase_summary">
|
|
|
|
<div class="row">
|
|
|
|
<section class="code">
|
|
|
|
'.$reply.'
|
|
|
|
</section>
|
|
|
|
<section class="code resume">
|
|
|
|
'.$actions.'
|
|
|
|
</section>
|
|
|
|
</div>
|
|
|
|
</section>
|
|
|
|
';
|
|
|
|
|
|
|
|
//General page content:
|
|
|
|
require RAIZ_APP.'/HTMLtemplate.php';
|
|
|
|
?>
|