From 987fc1a6418018897fdda9b8df7c9ed7b9ca2bb4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fernando=20M=C3=A9ndez?= <45081533+FerMdez@users.noreply.github.com> Date: Wed, 2 Jun 2021 17:42:58 +0200 Subject: [PATCH] Add files via upload --- assets/php/includes/film.php | 2 +- assets/php/includes/hall.php | 12 ++++++------ assets/php/includes/seat.php | 10 +++++----- assets/php/includes/user.php | 2 +- panel_user/panelUser.php | 6 +++--- purchase/includes/formPurchase.php | 17 ++++++++++++++--- purchase/includes/formSelectSeat.php | 10 ++++------ purchase/resume.php | 3 +++ 8 files changed, 37 insertions(+), 25 deletions(-) diff --git a/assets/php/includes/film.php b/assets/php/includes/film.php index f34a40d..ca812c5 100644 --- a/assets/php/includes/film.php +++ b/assets/php/includes/film.php @@ -8,7 +8,7 @@ private $_duration; //Film duration. private $_language; //Film language. private $_description; //Film description. - private $_img; + private $_img; //Film image. //Constructor: function __construct($id, $tittle, $duration, $language, $description, $img){ diff --git a/assets/php/includes/hall.php b/assets/php/includes/hall.php index 173b29e..2425273 100644 --- a/assets/php/includes/hall.php +++ b/assets/php/includes/hall.php @@ -5,12 +5,12 @@ class Hall{ //Attributes: - private $_number; //Room number. - private $_idcinema; //Cinema Id - private $_numRows; //Num rows. - private $_numCol; //Num columns. - private $_total_seats; - private $_seats_map; + private $_number; //Room number. + private $_idcinema; //Cinema Id + private $_numRows; //Num rows. + private $_numCol; //Num columns. + private $_total_seats; //Toal seats. + private $_seats_map; //Seat map. //Constructor: function __construct($number, $idcinema, $numRows, $numCol, $total_seats, $seats_map){ diff --git a/assets/php/includes/seat.php b/assets/php/includes/seat.php index 54a7e0b..122e212 100644 --- a/assets/php/includes/seat.php +++ b/assets/php/includes/seat.php @@ -4,11 +4,11 @@ class Seat{ //Attributes: - private $_idhall; - private $_idcinema; - private $_numRow; - private $_numCol; - private $_state; + private $_idhall; //Hall id. + private $_idcinema; //Cinema id. + private $_numRow; //Number of row. + private $_numCol; //Number of column. + private $_state; //State of the seat- //Constructor: function __construct($idhall, $idcinema, $numRow, $numCol, $state){ diff --git a/assets/php/includes/user.php b/assets/php/includes/user.php index 213e3bf..777b089 100644 --- a/assets/php/includes/user.php +++ b/assets/php/includes/user.php @@ -6,7 +6,7 @@ private $_username; //User name. private $_email; //User email. private $_password; //User password. - private $_rol; //Type of user: user | manager | admin. --> Será eliminado en la siguiente práctica para usar el modelo relacional de nuestra BD. + private $_rol; //Type of user: user | manager | admin. //Constructor: function __construct($id, $username, $email, $password, $rol){ diff --git a/panel_user/panelUser.php b/panel_user/panelUser.php index 336b5af..23c0786 100644 --- a/panel_user/panelUser.php +++ b/panel_user/panelUser.php @@ -126,15 +126,15 @@ $filmDAO = new Film_DAO("complucine"); $film = $filmDAO->FilmData($session->getIdfilm()); - if($i%3 === 0){ + if($i%3 === 0 && $i !== 0){ if($i !== 0) $purchasesHTML .= ' '; - $purchasesHTML .= '
Película: ".str_replace('_', ' ', strtoupper($this->film->getTittle()))."
Cine: ".$this->cinema->getName()."
Sala: ".$this->session->getIdhall()."
-Asiento: ".$_POST["checkbox11"]."
+Asiento: ".$this->seat."
Fecha: ".date_format(date_create($this->session->getDate()), 'd-m-Y')."
Hora: ".$this->session->getStartTime()."
Precio: ".$this->session->getSeatPrice()."€
@@ -163,7 +174,7 @@ class FormPurchase extends Form { $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")); + $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); $_SESSION["film_purchase"] = serialize($this->film); $result = "resume.php"; diff --git a/purchase/includes/formSelectSeat.php b/purchase/includes/formSelectSeat.php index 755bd39..e1efa27 100644 --- a/purchase/includes/formSelectSeat.php +++ b/purchase/includes/formSelectSeat.php @@ -42,11 +42,9 @@ class FormSelectSeat extends Form { //$seats = $hall->getTotalSeats(); $seats_map = array(); - for($x = 0; $x < $hall->getTotalSeats(); $x++){ - for($i = 0; $i < $rows; $i++){ - for($j = 0; $j < $cols; $j++){ - $seats_map[$i][$j] = $seats[$x]->getState(); - } + for($i = 1; $i <= $rows; $i++){ + for($j = 1; $j <= $cols; $j++){ + $seats_map[$i][$j] = $seats[$i]->getState(); } } $html ='Sesión (Hora): ".$session->getStartTime()."
Cine: ".$cinema->getName()."
Sala: ".$purchase->getHallId()."
+Asiento: ".$seat."
Asiento (Columna): ".$purchase->getRow()."
Asiento (Fila): ".$purchase->getColumn()."
Fecha de la Compra: ".$purchase->getTime()."