Add files via upload

This commit is contained in:
Fernando Méndez 2021-06-02 14:55:05 +02:00 committed by GitHub
parent 6efe3fc241
commit 85a0ff411d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 151 additions and 21 deletions

View File

@ -25,7 +25,7 @@
public function getAllSeats($number, $cinema){
$sql = sprintf( "SELECT * FROM seat WHERE
idhall = '%s' AND idcinema = '%s'",
idhall = '%d' AND idcinema = '%d'",
$number, $cinema);
$resul = mysqli_query($this->mysqli, $sql) or die ('Error into query database');

View File

@ -10,7 +10,7 @@
//Specific page content:
$section = '<!-- Contact Form -->
<section id="formulario">
<h4>Formulario (EN DESARROLLO)</h4>
<h4>Formulario</h4>
'.$htmlForm.'
</section>
';

View File

@ -20,19 +20,19 @@ class FormChangePass extends Form {
$errorPassword2 = self::createMensajeError($errores, 'repass', 'span', array('class' => 'error'));
$html = "<div class='row'>
<fieldset id='contraseña_usuario'><pre>".$htmlErroresGlobales."</pre>
<legend>Nueva Contraseña</legend>
<input type='password' name='old_pass' id='old_pass' value='' placeholder='Contraseña Actual' required/><pre>".$errorOldPass."</pre>
<input type='password' name='new_pass' id='new_pass' value='' placeholder='Nueva Contraseña' required/><pre>".$errorPassword."</pre>
<span id='passValid'>&#x2714;</span><span id='passWarning'>&#x26a0;</span></span><span id='passInvalid'>&#x274C;</span>
<input type='password' name='repass' id='repass' value='' placeholder='Repita la nueva contraseña' required/><pre>".$errorPassword2."</pre>
<span id='repassValid'>&#x2714;</span></span><span id='repassInvalid'>&#x274C;</span>
</fieldset>
<div class='actions'>
<input type='submit' id='submit' value='Cambiar Contraseña' class='primary' />
<input type='reset' id='reset' value='Borrar' />
</div>
</div>";
<fieldset id='contraseña_usuario'><pre>".$htmlErroresGlobales."</pre>
<legend>Nueva Contraseña</legend>
<input type='password' name='old_pass' id='old_pass' value='' placeholder='Contraseña Actual' required/><pre>".$errorOldPass."</pre>
<input type='password' name='new_pass' id='new_pass' value='' placeholder='Nueva Contraseña' required/><pre>".$errorPassword."</pre>
<span id='passValid'>&#x2714;</span><span id='passWarning'>&#x26a0;</span></span><span id='passInvalid'>&#x274C;</span>
<input type='password' name='repass' id='repass' value='' placeholder='Repita la nueva contraseña' required/><pre>".$errorPassword2."</pre>
<span id='repassValid'>&#x2714;</span></span><span id='repassInvalid'>&#x274C;</span>
</fieldset>
<div class='actions'>
<input type='submit' id='submit' value='Cambiar Contraseña' class='primary' />
<input type='reset' id='reset' value='Borrar' />
</div>
</div>";
return $html;
}

View File

@ -129,12 +129,12 @@
if($i%3 === 0){
if($i !== 0) $purchasesHTML .= '</div>
';
$purchasesHTML .= '<div class="column right">
$purchasesHTML .= '<div class="column left">
';
} else {
if($i !== 0) $purchasesHTML .= '</div>
';
$purchasesHTML .= '<div class="column left">
$purchasesHTML .= '<div class="column right">
';
}
$purchasesHTML .= '<h1>Compara realizada el: '.$dates[$i].'</h1><hr />

View File

@ -83,6 +83,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>Fecha: ".date_format(date_create($this->session->getDate()), 'd-m-Y')."</p>
<p>Hora: ".$this->session->getStartTime()."</p>
<p>Precio: ".$this->session->getSeatPrice()."</p>

View File

@ -6,6 +6,8 @@ include_once($prefix.'assets/php/includes/cinema_dao.php');
include_once($prefix.'assets/php/includes/cinema.php');
include_once($prefix.'assets/php/includes/session_dao.php');
include_once($prefix.'assets/php/includes/session.php');
include_once($prefix.'assets/php/includes/hall_dao.php');
include_once($prefix.'assets/php/includes/hall.php');
class FormSelectCinemaSession extends Form {
@ -17,7 +19,7 @@ class FormSelectCinemaSession extends Form {
private $_TODAY; // Actual date.
public function __construct() {
$options = array("action" => "confirm.php");
$options = array("action" => "selectSeat.php");
parent::__construct('formSelectCinemaSession', $options);
$TODAY = getdate();
@ -219,9 +221,9 @@ class FormSelectCinemaSession extends Form {
$pay = false;
}
//Pay button:
//Select seat button:
if($pay){
$pay = '<input type="submit" id="submit" value="Pagar" />';
$pay = '<input type="submit" id="submit" value="Seleccionar Asiento" />';
}
return '
@ -258,7 +260,7 @@ class FormSelectCinemaSession extends Form {
}
if (count($result) === 0) {
$result = "confirm.php";
$result = "selectSeat.php";
}
return $result;

View File

@ -0,0 +1,109 @@
<?php
include_once($prefix.'assets/php/form.php');
include_once($prefix.'assets/php/includes/film_dao.php');
include_once($prefix.'assets/php/includes/film.php');
include_once($prefix.'assets/php/includes/cinema_dao.php');
include_once($prefix.'assets/php/includes/cinema.php');
include_once($prefix.'assets/php/includes/session_dao.php');
include_once($prefix.'assets/php/includes/session.php');
include_once($prefix.'assets/php/includes/hall_dao.php');
include_once($prefix.'assets/php/includes/hall.php');
include_once($prefix.'assets/php/includes/seat_dao.php');
include_once($prefix.'assets/php/includes/seat.php');
class FormSelectSeat extends Form {
//Atributes:
public function __construct() {
$options = array("action" => "confirm.php");
parent::__construct('formSelectSeat', $options);
}
protected function generaCamposFormulario($datos, $errores = array()){
// Se generan los mensajes de error, si existen.
$htmlErroresGlobales = self::generaListaErroresGlobales($errores);
$errorSeat = self::createMensajeError($errores, 'seats', 'span', array('class' => 'error'));
$sessionDAO = new SessionDAO("complucine");
$session = $sessionDAO->sessionData($_POST["sessions"]);
$hallDAO = new HallDAO("complucine");
$hall = $hallDAO->HallData($session->getIdhall());
$seatDAO = new SeatDAO("complucine");
$seats = $seatDAO->getAllSeats($session->getIdhall(), $session->getIdcinema());
$rows = $hall->getNumRows();
$cols = $hall->getNumCol();
//$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();
}
}
}
$html ='<h2>Seleccionar un Asiento</h2><hr />
<h3 class="table_title">Pantalla</h3>
<table class="seat">
<thead>
<tr>
<th> </th>
';
for($j = 1; $j <= $cols; $j++){
$html .= '<th>'.$j.'</th>
';
}
$html .= '</tr>
</thead>
<tbody>';
for($i = 1; $i <= $rows; $i++){
$html .= '
<tr>
<td>'.$i.'</td>
';
for($j = 1; $j <= $cols; $j++){
if($seats_map[$i][$j] >= 0){
$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 .='</tr>';
}
$html .= '
</tbody>
</table>';
//Pay button:
$pay = '<input type="hidden" name="sessions" id="sessions" value="'.$_POST["sessions"].'" />
<input type="submit" id="submit" value="Pagar" />';
return '
<section class="code purchase">
'.$html.'
</section>
<section class="code purchase">
'.$pay.'
</section>';
}
protected function procesaFormulario($datos){
$result = array();
if (count($result) === 0) {
$result = "confirm.php";
}
return $result;
}
}
?>

18
purchase/selectSeat.php Normal file
View File

@ -0,0 +1,18 @@
<?php
//General Config File:
require_once('../assets/php/config.php');
//Seats form:
require_once('includes/formSelectSeat.php');
$form = new FormSelectSeat();
$formHTML = $form->gestiona();
//Page-specific content:
$section = '<section class="row">
<!-- Seat Form -->
'.$formHTML.'
</div>';
//General page content:
require RAIZ_APP.'/HTMLtemplate.php';
?>