Add files via upload

This commit is contained in:
Fernando Méndez 2021-05-25 17:02:29 +02:00 committed by GitHub
parent 4e1cdc6522
commit b4f2d17d0e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
12 changed files with 214 additions and 43 deletions

View File

@ -373,13 +373,19 @@
.code.purchase { .code.purchase {
text-align: center; text-align: center;
} }
.code.purchase h3 {
margin-top: 2em;
}
.code.purchase img { .code.purchase img {
margin: 0.1em 0 0.8em 0; margin: 0.1em 0 0.8em 0;
width: 100%; width: 100%;
box-shadow: 0 4px 8px 0 #00020f, 0 6px 20px 0 #00020f; box-shadow: 0 4px 8px 0 #d3ebff, 0 6px 20px 0 #d3ebff;
} }
.code.purchase select, .code.purchase select option { .code.purchase select, .code.purchase select option {
display: block;
width: 100%; width: 100%;
height: 30px;
margin: 0.1em 0.5em 1em 0.5em;
font-weight: bold !important; font-weight: bold !important;
color: #1f2c3d !important; color: #1f2c3d !important;
background-color: #d3ebff; background-color: #d3ebff;
@ -678,6 +684,53 @@
.file input{ .file input{
height: 110%; height: 110%;
} }
.card-holder {
width: 75%;
display: inline-block;
}
.input-cart-number, .fieldset-cvv, .select {
width: 70px;
max-width: 100%;
display: inline-block;
}
form select {
display: inline-block;
font-size: 15px;
font-weight: 400;
color: #1f2c3d;
line-height: 1.3;
padding: .4em 1.4em .3em .8em;
width: 75px;
max-width: 100%;
box-sizing: border-box;
margin: 10px auto;
border: 1px solid #d3ebff;
box-shadow: 0 1px 0 1px #1f2c3d;
border-radius: .3em;
-moz-appearance: none;
-webkit-appearance: none;
appearance: none;
background-color: #fff;
}
form select::-ms-expand {
display: none;
}
form select:hover {
border-color: #d3ebff;
}
form select:focus {
border-color: #d3ebff;
box-shadow: 0 0 1px 3px #1f2c3d;
box-shadow: 0 0 0 3px -moz-mac-focusring;
color: #1f2c3d;
outline: none;
}
form select option {
font-weight:normal;
}
/* Preformatted Text */ /* Preformatted Text */
pre { pre {

View File

@ -371,13 +371,19 @@ main img {
.code.purchase { .code.purchase {
text-align: center; text-align: center;
} }
.code.purchase h3 {
margin-top: 2em;
}
.code.purchase img { .code.purchase img {
margin: 0.1em 0 0.8em 0; margin: 0.1em 0 0.8em 0;
width: 100%; width: 100%;
box-shadow: 0 4px 8px 0 #d3ebff, 0 6px 20px 0 #d3ebff; box-shadow: 0 4px 8px 0 #d3ebff, 0 6px 20px 0 #d3ebff;
} }
.code.purchase select, .code.purchase select option { .code.purchase select, .code.purchase select option {
display: block;
width: 100%; width: 100%;
height: 30px;
margin: 0.1em 0.5em 1em 0.5em;
font-weight: bold !important; font-weight: bold !important;
color: #1f2c3d !important; color: #1f2c3d !important;
background-color: #d3ebff; background-color: #d3ebff;
@ -664,6 +670,7 @@ textarea {
border:#000000; border:#000000;
background-color: #791515; background-color: #791515;
} }
.file{ .file{
margin-top: 10px; margin-top: 10px;
} }
@ -671,6 +678,53 @@ textarea {
height: 110%; height: 110%;
} }
.card-holder {
width: 75%;
display: inline-block;
}
.input-cart-number, .fieldset-cvv, .select {
width: 70px;
max-width: 100%;
display: inline-block;
}
form select {
display: inline-block;
font-size: 15px;
font-weight: 400;
color: #1f2c3d;
line-height: 1.3;
padding: .4em 1.4em .3em .8em;
width: 75px;
max-width: 100%;
box-sizing: border-box;
margin: 10px auto;
border: 1px solid #d3ebff;
box-shadow: 0 1px 0 1px #1f2c3d;
border-radius: .3em;
-moz-appearance: none;
-webkit-appearance: none;
appearance: none;
background-color: #fff;
}
form select::-ms-expand {
display: none;
}
form select:hover {
border-color: #d3ebff;
}
form select:focus {
border-color: #d3ebff;
box-shadow: 0 0 1px 3px #1f2c3d;
box-shadow: 0 0 0 3px -moz-mac-focusring;
color: #1f2c3d;
outline: none;
}
form select option {
font-weight:normal;
}
/* Preformatted Text */ /* Preformatted Text */
pre { pre {
font-weight: bold; font-weight: bold;
@ -680,6 +734,7 @@ fieldset pre {
color: red; color: red;
} }
/* Footer */ /* Footer */
footer { footer {
text-align: left; text-align: left;

View File

@ -0,0 +1,3 @@
function newWindow(page){
window.open(page, 'Ventana de Confirmación', 'width=500, height=300');
}

View File

@ -44,7 +44,14 @@
public function cinemaData($id){ public function cinemaData($id){
$sql = sprintf( "SELECT * FROM cinema WHERE cinema.id = '%d'", $id); $sql = sprintf( "SELECT * FROM cinema WHERE cinema.id = '%d'", $id);
$resul = mysqli_query($this->mysqli, $sql) or die ('Error into query database'); $resul = mysqli_query($this->mysqli, $sql) or die ('Error into query database');
return $resul;
$cinema = null;
while($fila=$resul->fetch_assoc()){
$cinema = $this->loadCinema($fila["id"], $fila["name"], $fila["direction"], $fila["phone"]);
}
$resul->free();
return $cinema;
} }
//Deleted film by "id". //Deleted film by "id".

View File

@ -120,24 +120,6 @@
return $cinemas; return $cinemas;
} }
//Get sessions associated with a film.
public function getSessions($id){
include_once('session_dao.php');
$session = new SessionDAO("complucine");
$sql = sprintf( " SELECT DISTINCT * FROM session WHERE session.id in
(SELECT session.id FROM session JOIN film ON session.idfilm = film.id WHERE film.id = '%d'); ", $id);
$resul = mysqli_query($this->mysqli, $sql) or die ('Error into query database');
$sessions = null;
while($fila = $resul->fetch_assoc()){
$sessions[] = $session->loadSession($fila["id"], $fila["idfilm"], $fila["idhall"], $fila["idcinema"], $fila["date"], $fila["start_time"], $fila["seat_price"], $fila["format"], $fila["seats_full"]);
}
$resul->free();
return $sessions;
}
//Create a new film Data Transfer Object. //Create a new film Data Transfer Object.
public function loadFilm($id, $tittle, $duration, $language,$description, $img){ public function loadFilm($id, $tittle, $duration, $language,$description, $img){

View File

@ -79,6 +79,19 @@
return $sessions; return $sessions;
} }
public function getSessions_Film_Cinema($idFiml, $idCinema){
$sql = sprintf( "SELECT * FROM session WHERE session.idfilm = '%d' AND session.idcinema = '%d' ", $idFiml, $idCinema);
$resul = mysqli_query($this->mysqli, $sql) or die ('Error into query database');
$sessions = null;
while($fila = $resul->fetch_assoc()){
$sessions[] = $this->loadSession($fila["id"], $fila["idfilm"], $fila["idhall"], $fila["idcinema"], $fila["date"], $fila["start_time"], $fila["seat_price"], $fila["format"], $fila["seats_full"]);
}
$resul->free();
return $sessions;
}
public function editSession($idfilm, $idhall, $idcinema, $date, $startTime, $seatPrice, $format, $origin){ public function editSession($idfilm, $idhall, $idcinema, $date, $startTime, $seatPrice, $format, $origin){
$format = $this->mysqli->real_escape_string($format); $format = $this->mysqli->real_escape_string($format);

View File

@ -690,6 +690,7 @@
<script type='text/javascript' src='{$prefix}assets/js/checkForms.js'></script> <script type='text/javascript' src='{$prefix}assets/js/checkForms.js'></script>
"; ";
if($page === "FDI-Cines") echo"<script type='text/javascript' src='{$prefix}assets/js/promotions.js' ></script>\n"; if($page === "FDI-Cines") echo"<script type='text/javascript' src='{$prefix}assets/js/promotions.js' ></script>\n";
if($page === "Panel de Usuario") echo"<script type='text/javascript' src='{$prefix}assets/js/deleteConfirm.js' ></script>\n";
} }
} }

1
panel_user/confirm.php Normal file
View File

@ -0,0 +1 @@
<?php echo"HOLA MUNDO"; ?>

View File

@ -36,8 +36,9 @@ class FormDeleteAccount extends Form {
<input type='checkbox' id='checkbox' name='verify' required> <input type='checkbox' id='checkbox' name='verify' required>
<label for='verify'>Al marcar esta casilla, verifica y entiende que esta acción no se puede deshacer.</label> <label for='verify'>Al marcar esta casilla, verifica y entiende que esta acción no se puede deshacer.</label>
</div> </div>
<div class='actions'> <div class='actions'>
<input type='submit' id='submit' value='Eliminar Cuenta de Usuario' class='primary' /> <input type='submit' id='submit' value='Eliminar Cuenta de Usuario' class='primary' />
<!-- <input type='submit' id='submit' value='Eliminar Cuenta de Usuario' class='primary' onclick=\"newWindow('confirm.php');\" /> -->
</div> </div>
</div>"; </div>";

View File

@ -1,11 +1,8 @@
<?php <?php
//General Config File: //General Config File:
require_once('../assets/php/config.php'); require_once('../assets/php/config.php');
$sessionDAO = new SessionDAO("complucine");
//$session = $sessionDAO->loadSession($_POST["session_id"], $_POST["film_id"], $_POST["hall_id"], $_POST["cinema_id"], $_POST["date_"], $_POST["hour_"], "12", null, null);
$session = $sessionDAO->sessionData($_POST["session_id"]);
//echo $_POST["session_id"];
//Purchase form: //Purchase form:
require_once('includes/formPurchase.php'); require_once('includes/formPurchase.php');

View File

@ -1,15 +1,41 @@
<?php <?php
include_once($prefix.'assets/php/form.php'); include_once($prefix.'assets/php/form.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/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');
class FormPurchase extends Form { class FormPurchase extends Form {
//Atributes: //Atributes:
private $user; // User who is going to log-in. private $session; // Session of the film to be purchased.
private $cinema; // Cinema of the film to be purchased.
private $film; // Film to be purchased.
private $years; // Actual year.
private $months; // Months of the year.
public function __construct() { public function __construct() {
parent::__construct('formPurchase'); parent::__construct('formPurchase');
$sessionDAO = new SessionDAO("complucine");
$this->session = $sessionDAO->sessionData($_POST["session_id"]);
$filmDAO = new Film_DAO("complucine");
$this->film = $filmDAO->FilmData($this->session->getIdfilm());
$cinemaDAO = new Cinema_DAO("complucine");
$this->cinema = $cinemaDAO->cinemaData($this->session->getIdcinema());
$TODAY = getdate();
$year = "$TODAY[year]";
$this->years = array();
for($i = $year; $i < $year+10; $i++) array_push($this->years, $i);
$this->months = array();
for($i = 1; $i <= 12; $i++) array_push($this->months, $i);
} }
protected function generaCamposFormulario($datos, $errores = array()){ protected function generaCamposFormulario($datos, $errores = array()){
@ -19,17 +45,46 @@ class FormPurchase extends Form {
$errorNombre = self::createMensajeError($errores, 'name', 'span', array('class' => 'error')); $errorNombre = self::createMensajeError($errores, 'name', 'span', array('class' => 'error'));
$errorPassword = self::createMensajeError($errores, 'pass', 'span', array('class' => 'error')); $errorPassword = self::createMensajeError($errores, 'pass', 'span', array('class' => 'error'));
$monthsHTML = "";
foreach($this->months as $value){
$monthsHTML .= "<option>".$value."</option>";
}
$yearsHTML = "";
foreach($this->years as $value){
$yearsHTML .= "<option>".$value."</option>";
}
$html = "<div class='row'> $html = "<div class='row'>
<fieldset id='pagar_entrada'><pre>".$htmlErroresGlobales."</pre> <fieldset id='datos_entrada'>
<legend>Resumen de la Compra</legend> <legend>Resumen de la Compra</legend>
<p>Película: ".$session->getIdfilm()."</p> <p>Película: ".str_replace('_', ' ', strtoupper($this->film->getTittle()))."</p>
<p>Cine: ".$session->getIdcinema()."</p> <p>Cine: ".$this->cinema->getName()."</p>
<p>Sala: ".$session->getIdhall()."</p> <p>Sala: ".$this->session->getIdhall()."</p>
<p>Fecha: ".date_format(date_create($session->getDate()), 'd-m-Y')."</p> <p>Fecha: ".date_format(date_create($this->session->getDate()), 'd-m-Y')."</p>
<p>Hora: ".$session->getStartTime()."</p> <p>Hora: ".$this->session->getStartTime()."</p>
<p>Precio: ".$session->getSeatPrice()."</p> <p>Precio: ".$this->session->getSeatPrice()."</p>
</fieldset>
<fieldset id='pagar_entrada'><pre>".$htmlErroresGlobales."</pre>
<legend>Datos Bancarios</legend> <legend>Datos Bancarios</legend>
<input type='text' name='account' id='account' value='' placeholder='Cuenta Bancaria [En desarrollo...]' required/><pre>".$errorNombre."</pre> <label for='card-holder'>Titular de la Tarjeta:</label><br />
<input type='text' id='card-holder' class='card-holder' required />
<br />
<label for='card-number'>Número de Tarjeta: </label><br />
<input type='num' id='card-number-0' class='input-cart-number' placeholder='XXXX' maxlength='4' required />
<input type='num' id='card-number-1' class='input-cart-number' placeholder='XXXX' maxlength='4' required />
<input type='num' id='card-number-2' class='input-cart-number' placeholder='XXXX' maxlength='4' required />
<input type='num' id='card-number-3' class='input-cart-number' placeholder='XXXX' maxlength='4' required />
<label for='card-cvv'>CVV: </label>
<input type='text' id='card-cvv' class='fieldset-cvv' maxlength='3' placeholder='XXX' required />
<br />
<label for='card-expiration'>Fecha de Expiración:</label><br />
<select id='card-expiration-month' required>
".$monthsHTML."
</select>
<select id='card-expiration-year' required>
".$yearsHTML."
</select>
</fieldset> </fieldset>
<div class='actions'> <div class='actions'>
<input type='submit' id='submit' value='Pagar' class='primary' /> <input type='submit' id='submit' value='Pagar' class='primary' />

View File

@ -7,6 +7,7 @@
include_once($prefix.'assets/php/includes/film.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_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.php'); include_once($prefix.'assets/php/includes/session.php');
$TODAY = getdate(); $TODAY = getdate();
@ -50,7 +51,9 @@
$fiml_id = $film->getId(); $fiml_id = $film->getId();
$cinema_id = $value["cID"]; $cinema_id = $value["cID"];
$sessions = $filmDAO->getSessions($_GET["film"]); $sessionsDAO = new SessionDAO("complucine");
$sessions = $sessionsDAO->getSessions_Film_Cinema($fiml_id, $cinema_id);
//print_r($sessions);
if(!empty($sessions)){ if(!empty($sessions)){
$sessionsDates = new ArrayIterator(array()); $sessionsDates = new ArrayIterator(array());
$sessionsStarts = new ArrayIterator(array()); $sessionsStarts = new ArrayIterator(array());
@ -71,10 +74,10 @@
$sessionsListHTML = '<select name="sessions">'; $sessionsListHTML = '<select name="sessions">';
foreach ($sessionsIT as $value) { foreach ($sessionsIT as $value) {
if($TODAY <= $value["DATE"]){ if($TODAY <= $value["DATE"]){
if($value == reset($sessionsIT)){ if($value === reset($sessionsIT)){
$sessionsListHTML .= '<option value="'.$value["sID"].'" selected>'.$value["DATE"].' | '.$value["HOUR"].' (Sala: '.$value["HALL"].') '.'</option>'; $sessionsListHTML .= '<option value="'.$value["sID"].'" selected>Fecha: '.$value["DATE"].' || Hora: '.$value["HOUR"].' || Sala: '.$value["HALL"].'</option>';
} else { } else {
$sessionsListHTML .='<option value="'.$value["sID"].'">'.$value["DATE"].' | '.$value["HOUR"].' (Sala: '.$value["HALL"].') '.'</option>'; $sessionsListHTML .='<option value="'.$value["sID"].'">Fecha: '.$value["DATE"].' || Hora:'.$value["HOUR"].' || Sala: '.$value["HALL"].'</option>';
} }
} }
} }
@ -97,9 +100,9 @@
</div> </div>
<div class="column right"> <div class="column right">
<h2>Seleccione un Cine y una Sesión</h2><hr /> <h2>Seleccione un Cine y una Sesión</h2><hr />
<br /><h3>Cines</h3> <h3>Cines</h3>
'.$cinemasListHTML.'<br /> '.$cinemasListHTML.'
<br/><h3>Sesiones</h3> <h3>Sesiones</h3>
'.$sessionsListHTML.' '.$sessionsListHTML.'
</div> </div>
'; ';