Add files via upload

This commit is contained in:
Fernando Méndez 2021-06-01 17:59:32 +02:00 committed by GitHub
parent 019872acfb
commit 10e060d4c8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 15 additions and 11 deletions

View File

@ -126,13 +126,13 @@
$filmDAO = new Film_DAO("complucine");
$film = $filmDAO->FilmData($session->getIdfilm());
if($i%2 === 0){
if($i != 0) $purchasesHTML .= '</div>
if($i%3 === 0){
if($i !== 0) $purchasesHTML .= '</div>
';
$purchasesHTML .= '<div class="column left">
$purchasesHTML .= '<div class="column right">
';
} else {
if($i != 0) $purchasesHTML .= '</div>
if($i !== 0) $purchasesHTML .= '</div>
';
$purchasesHTML .= '<div class="column left">
';
@ -149,7 +149,8 @@
<p>Sesión: '.$sessions[$i].'</p>
<p>Asiento(Fila): '.$rows[$i].'</p>
<p>Asiento(Columna): '.$columns[$i].'</p>
</div>';
</div>
';
}
}

View File

@ -152,12 +152,15 @@ class FormPurchase extends Form {
if (count($result) === 0) {
if(isset($_SESSION["login"]) && $_SESSION["login"] == true){
$purchaseDAO = new PurchaseDAO("complucine");
$purchaseDAO->createPurchase(unserialize($_SESSION["user"])->getId(), $this->session->getId(), $this->session->getIdhall(), $this->cinema->getId(), rand(1, $this->hall->getNumRows()), rand(1, $this->hall->getNumCol()), date("Y-m-d H:i:s"));
if($purchaseDAO->createPurchase(unserialize($_SESSION["user"])->getId(), $this->session->getId(), $this->session->getIdhall(), $this->cinema->getId(), rand(1, $this->hall->getNumRows()), rand(1, $this->hall->getNumCol()), date("Y-m-d H:i:s"))){
$purchase = new Purchase(unserialize($_SESSION["user"])->getId(), $this->session->getId(), $this->session->getIdhall(), $this->cinema->getId(), rand(1, $this->hall->getNumRows()), rand(1, $this->hall->getNumCol()), strftime("%A %e de %B de %Y a las %H:%M"));
$_SESSION["purchase"] = serialize($purchase);
$_SESSION["film_purchase"] = serialize($this->film);
$result = "resume.php";
} else {
$result[] = "Error al realizar la compra.";
}
} else {
$purchase = new Purchase("null", $this->session->getId(), $this->session->getIdhall(), $this->cinema->getId(), rand(1, $this->hall->getNumRows()), rand(1, $this->hall->getNumCol()), strftime("%A %e de %B de %Y a las %H:%M"));
$_SESSION["purchase"] = serialize($purchase);