Add files via upload
This commit is contained in:
parent
6efe3fc241
commit
85a0ff411d
@ -25,7 +25,7 @@
|
|||||||
public function getAllSeats($number, $cinema){
|
public function getAllSeats($number, $cinema){
|
||||||
|
|
||||||
$sql = sprintf( "SELECT * FROM seat WHERE
|
$sql = sprintf( "SELECT * FROM seat WHERE
|
||||||
idhall = '%s' AND idcinema = '%s'",
|
idhall = '%d' AND idcinema = '%d'",
|
||||||
$number, $cinema);
|
$number, $cinema);
|
||||||
$resul = mysqli_query($this->mysqli, $sql) or die ('Error into query database');
|
$resul = mysqli_query($this->mysqli, $sql) or die ('Error into query database');
|
||||||
|
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
//Specific page content:
|
//Specific page content:
|
||||||
$section = '<!-- Contact Form -->
|
$section = '<!-- Contact Form -->
|
||||||
<section id="formulario">
|
<section id="formulario">
|
||||||
<h4>Formulario (EN DESARROLLO)</h4>
|
<h4>Formulario</h4>
|
||||||
'.$htmlForm.'
|
'.$htmlForm.'
|
||||||
</section>
|
</section>
|
||||||
';
|
';
|
||||||
|
@ -20,19 +20,19 @@ class FormChangePass extends Form {
|
|||||||
$errorPassword2 = self::createMensajeError($errores, 'repass', 'span', array('class' => 'error'));
|
$errorPassword2 = self::createMensajeError($errores, 'repass', 'span', array('class' => 'error'));
|
||||||
|
|
||||||
$html = "<div class='row'>
|
$html = "<div class='row'>
|
||||||
<fieldset id='contraseña_usuario'><pre>".$htmlErroresGlobales."</pre>
|
<fieldset id='contraseña_usuario'><pre>".$htmlErroresGlobales."</pre>
|
||||||
<legend>Nueva Contraseña</legend>
|
<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='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>
|
<input type='password' name='new_pass' id='new_pass' value='' placeholder='Nueva Contraseña' required/><pre>".$errorPassword."</pre>
|
||||||
<span id='passValid'>✔</span><span id='passWarning'>⚠</span></span><span id='passInvalid'>❌</span>
|
<span id='passValid'>✔</span><span id='passWarning'>⚠</span></span><span id='passInvalid'>❌</span>
|
||||||
<input type='password' name='repass' id='repass' value='' placeholder='Repita la nueva contraseña' required/><pre>".$errorPassword2."</pre>
|
<input type='password' name='repass' id='repass' value='' placeholder='Repita la nueva contraseña' required/><pre>".$errorPassword2."</pre>
|
||||||
<span id='repassValid'>✔</span></span><span id='repassInvalid'>❌</span>
|
<span id='repassValid'>✔</span></span><span id='repassInvalid'>❌</span>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
<div class='actions'>
|
<div class='actions'>
|
||||||
<input type='submit' id='submit' value='Cambiar Contraseña' class='primary' />
|
<input type='submit' id='submit' value='Cambiar Contraseña' class='primary' />
|
||||||
<input type='reset' id='reset' value='Borrar' />
|
<input type='reset' id='reset' value='Borrar' />
|
||||||
</div>
|
</div>
|
||||||
</div>";
|
</div>";
|
||||||
|
|
||||||
return $html;
|
return $html;
|
||||||
}
|
}
|
||||||
|
@ -129,12 +129,12 @@
|
|||||||
if($i%3 === 0){
|
if($i%3 === 0){
|
||||||
if($i !== 0) $purchasesHTML .= '</div>
|
if($i !== 0) $purchasesHTML .= '</div>
|
||||||
';
|
';
|
||||||
$purchasesHTML .= '<div class="column right">
|
$purchasesHTML .= '<div class="column left">
|
||||||
';
|
';
|
||||||
} else {
|
} else {
|
||||||
if($i !== 0) $purchasesHTML .= '</div>
|
if($i !== 0) $purchasesHTML .= '</div>
|
||||||
';
|
';
|
||||||
$purchasesHTML .= '<div class="column left">
|
$purchasesHTML .= '<div class="column right">
|
||||||
';
|
';
|
||||||
}
|
}
|
||||||
$purchasesHTML .= '<h1>Compara realizada el: '.$dates[$i].'</h1><hr />
|
$purchasesHTML .= '<h1>Compara realizada el: '.$dates[$i].'</h1><hr />
|
||||||
|
@ -83,6 +83,7 @@ class FormPurchase extends Form {
|
|||||||
<p>Película: ".str_replace('_', ' ', strtoupper($this->film->getTittle()))."</p>
|
<p>Película: ".str_replace('_', ' ', strtoupper($this->film->getTittle()))."</p>
|
||||||
<p>Cine: ".$this->cinema->getName()."</p>
|
<p>Cine: ".$this->cinema->getName()."</p>
|
||||||
<p>Sala: ".$this->session->getIdhall()."</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>Fecha: ".date_format(date_create($this->session->getDate()), 'd-m-Y')."</p>
|
||||||
<p>Hora: ".$this->session->getStartTime()."</p>
|
<p>Hora: ".$this->session->getStartTime()."</p>
|
||||||
<p>Precio: ".$this->session->getSeatPrice()."€</p>
|
<p>Precio: ".$this->session->getSeatPrice()."€</p>
|
||||||
|
@ -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/cinema.php');
|
||||||
include_once($prefix.'assets/php/includes/session_dao.php');
|
include_once($prefix.'assets/php/includes/session_dao.php');
|
||||||
include_once($prefix.'assets/php/includes/session.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 {
|
class FormSelectCinemaSession extends Form {
|
||||||
|
|
||||||
@ -17,7 +19,7 @@ class FormSelectCinemaSession extends Form {
|
|||||||
private $_TODAY; // Actual date.
|
private $_TODAY; // Actual date.
|
||||||
|
|
||||||
public function __construct() {
|
public function __construct() {
|
||||||
$options = array("action" => "confirm.php");
|
$options = array("action" => "selectSeat.php");
|
||||||
parent::__construct('formSelectCinemaSession', $options);
|
parent::__construct('formSelectCinemaSession', $options);
|
||||||
|
|
||||||
$TODAY = getdate();
|
$TODAY = getdate();
|
||||||
@ -219,9 +221,9 @@ class FormSelectCinemaSession extends Form {
|
|||||||
$pay = false;
|
$pay = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
//Pay button:
|
//Select seat button:
|
||||||
if($pay){
|
if($pay){
|
||||||
$pay = '<input type="submit" id="submit" value="Pagar" />';
|
$pay = '<input type="submit" id="submit" value="Seleccionar Asiento" />';
|
||||||
}
|
}
|
||||||
|
|
||||||
return '
|
return '
|
||||||
@ -258,7 +260,7 @@ class FormSelectCinemaSession extends Form {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (count($result) === 0) {
|
if (count($result) === 0) {
|
||||||
$result = "confirm.php";
|
$result = "selectSeat.php";
|
||||||
}
|
}
|
||||||
|
|
||||||
return $result;
|
return $result;
|
||||||
|
109
purchase/includes/formSelectSeat.php
Normal file
109
purchase/includes/formSelectSeat.php
Normal 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
18
purchase/selectSeat.php
Normal 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';
|
||||||
|
?>
|
Loading…
Reference in New Issue
Block a user