Add files via upload
This commit is contained in:
		@@ -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){
 | 
			
		||||
 
 | 
			
		||||
@@ -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){
 | 
			
		||||
 
 | 
			
		||||
@@ -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){
 | 
			
		||||
 
 | 
			
		||||
@@ -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){
 | 
			
		||||
 
 | 
			
		||||
@@ -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 .= '</div>
 | 
			
		||||
                        ';
 | 
			
		||||
                        $purchasesHTML .= '<div class="column left">
 | 
			
		||||
                        $purchasesHTML .= '<div class="column right">
 | 
			
		||||
                        ';
 | 
			
		||||
                    } else {
 | 
			
		||||
                        if($i !== 0) $purchasesHTML .= '</div>
 | 
			
		||||
                        ';
 | 
			
		||||
                        $purchasesHTML .= '<div class="column right">
 | 
			
		||||
                        $purchasesHTML .= '<div class="column left">
 | 
			
		||||
                        ';
 | 
			
		||||
                    }
 | 
			
		||||
                    $purchasesHTML .= '<h1>Compara realizada el: '.$dates[$i].'</h1><hr />
 | 
			
		||||
 
 | 
			
		||||
@@ -18,7 +18,8 @@ class FormPurchase extends Form {
 | 
			
		||||
    private $session;       // Session of the film to be purchased.
 | 
			
		||||
    private $cinema;        // Cinema of the film to be purchased.
 | 
			
		||||
    private $hall;          // Hall of the film to be purchased.
 | 
			
		||||
    private $film;          // Film to be purchased.
 | 
			
		||||
    private $seat;          // Seat of the film to be purchased. 
 | 
			
		||||
    private $row;           // Row of the seat.
 | 
			
		||||
    private $years;         // Actual year.
 | 
			
		||||
    private $months;        // Months of the year.
 | 
			
		||||
    private $_TODAY;         // Actual date.
 | 
			
		||||
@@ -38,6 +39,16 @@ class FormPurchase extends Form {
 | 
			
		||||
        $hallDAO = new HallDAO("complucine");
 | 
			
		||||
        $this->hall = $hallDAO->HallData($this->session->getIdhall());
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
        $rows = $this->hall->getNumRows();
 | 
			
		||||
        $cols = $this->hall->getNumCol();
 | 
			
		||||
        for($i = 0; $i <= $rows; $i++){
 | 
			
		||||
            for($j = 0; $j <= $cols; $j++){
 | 
			
		||||
                $seat = $i.$j;
 | 
			
		||||
                if(isset($_POST["checkbox".$seat])){ $this->seat = $seat; }
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        $TODAY = getdate();
 | 
			
		||||
        $year = "$TODAY[year]";
 | 
			
		||||
 | 
			
		||||
@@ -83,7 +94,7 @@ class FormPurchase extends Form {
 | 
			
		||||
                                <p>Película: ".str_replace('_', ' ', strtoupper($this->film->getTittle()))."</p>
 | 
			
		||||
                                <p>Cine: ".$this->cinema->getName()."</p>
 | 
			
		||||
                                <p>Sala: ".$this->session->getIdhall()."</p>
 | 
			
		||||
                                <p>Asiento: ".$_POST["checkbox11"]."</p>
 | 
			
		||||
                                <p>Asiento: ".$this->seat."</p>
 | 
			
		||||
                                <p>Fecha: ".date_format(date_create($this->session->getDate()), 'd-m-Y')."</p>
 | 
			
		||||
                                <p>Hora: ".$this->session->getStartTime()."</p>
 | 
			
		||||
                                <p>Precio: ".$this->session->getSeatPrice()."€</p>
 | 
			
		||||
@@ -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";
 | 
			
		||||
 
 | 
			
		||||
@@ -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 ='<h2>Seleccionar un Asiento</h2><hr />
 | 
			
		||||
@@ -73,7 +71,7 @@ class FormSelectSeat extends Form {
 | 
			
		||||
                        $html .= '<td> <input type="checkbox" class="check_box" name="checkbox'.$i.$j.'" value="'.$seats_map[$i][$j].'" id="checkbox'.$i.$j.'" checked> <label for="checkbox'.$i.$j.'"> </td>
 | 
			
		||||
                            ';}
 | 
			
		||||
                    else {
 | 
			
		||||
                        $html .= '<td> <input type="checkbox" class="check_box" name="checkbox'.$i.$j.'" value="'.$seats_map[$i][$j].'" id="checkbox'.$i.$j.'" > <label for="checkbox'.$i.$j.'"> </td>
 | 
			
		||||
                        $html .= '<td> <input type="checkbox" class="check_box" name="checkbox'.$i.$j.'" value="'.$seats_map[$i][$j].'" id="checkbox'.$i.$j.'" disabled> <label for="checkbox'.$i.$j.'"> </td>
 | 
			
		||||
                            ';}
 | 
			
		||||
                }
 | 
			
		||||
                    $html .='</tr>';
 | 
			
		||||
 
 | 
			
		||||
@@ -18,6 +18,8 @@
 | 
			
		||||
        $cinemaDAO = new Cinema_DAO("complucine");
 | 
			
		||||
        $cinema = $cinemaDAO->cinemaData($purchase->getCinemaId());
 | 
			
		||||
 | 
			
		||||
        $seat = 1; //$_POST[];
 | 
			
		||||
 | 
			
		||||
        unset($_SESSION["purchase"]);
 | 
			
		||||
        unset($_SESSION["film_purchase"]);
 | 
			
		||||
 | 
			
		||||
@@ -34,6 +36,7 @@
 | 
			
		||||
                        <p>Sesión (Hora): ".$session->getStartTime()."</p>
 | 
			
		||||
                        <p>Cine: ".$cinema->getName()."</p>
 | 
			
		||||
                        <p>Sala: ".$purchase->getHallId()."</p>
 | 
			
		||||
                        <p>Asiento: ".$seat."</p>
 | 
			
		||||
                        <p>Asiento (Columna): ".$purchase->getRow()."</p>
 | 
			
		||||
                        <p>Asiento (Fila): ".$purchase->getColumn()."</p>
 | 
			
		||||
                        <p>Fecha de la Compra: ".$purchase->getTime()."</p>
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user