From 8dafa546b6bc5461d352e8077db9cc7f97ad8279 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fernando=20M=C3=A9ndez?= <45081533+FerMdez@users.noreply.github.com> Date: Fri, 4 Jun 2021 12:38:17 +0200 Subject: [PATCH] Add files via upload --- assets/css/highContrast.css | 8 ++++---- assets/js/cambiarCSS.js | 18 +++++++++++++++++- assets/js/goBack.js | 7 +++++++ assets/js/goUp.js | 1 + assets/js/selectTicket.js | 2 +- assets/php/common/changeCSS.php | 9 +++++++++ assets/php/template.php | 15 ++++++++------- purchase/includes/formPurchase.php | 1 + purchase/includes/formSelectCinemaSession.php | 16 +++++++++------- 9 files changed, 57 insertions(+), 20 deletions(-) create mode 100644 assets/js/goBack.js create mode 100644 assets/php/common/changeCSS.php diff --git a/assets/css/highContrast.css b/assets/css/highContrast.css index 47ead3c..449c6cf 100644 --- a/assets/css/highContrast.css +++ b/assets/css/highContrast.css @@ -181,8 +181,8 @@ color: #dadada; } table tbody tr { - color: #dadada; - border: solid 1px #dadada; + color: #1f2c3d; + border: solid 1px #1f2c3d; border-left: 0; border-right: 0; } @@ -193,7 +193,7 @@ padding: 0.75em 0.75em; } table th { - color: #dadada; + color: #1f2c3d; font-size: 0.9em; font-weight: 600; padding: 0.85em 0.85em 0.85em 0.85em; @@ -784,7 +784,7 @@ form select option { footer button { display: inline-block; margin: 1px; - width: 115px; + width: 120px; height: 25px; padding: 0px 0px; text-align: center; diff --git a/assets/js/cambiarCSS.js b/assets/js/cambiarCSS.js index 51e9ba6..3de430a 100644 --- a/assets/js/cambiarCSS.js +++ b/assets/js/cambiarCSS.js @@ -4,5 +4,21 @@ */ function cambiarCSS(nuevo){ - document.getElementById('estilo').setAttribute('href', nuevo); + if(nuevo.includes("main.css")){ + var viejo = "{$prefix}assets/css/highContrast.css"; + var oldName = "Alto Contraste"; + } else { + var viejo = "{$prefix}assets/css/main.css"; + var oldName = "Contrast Normal"; + } + + var url = "../assets/php/common/changeCSS.php?css=" + nuevo; + $.get(url); + + /* La idea era que cambiase todo dinámicamente sin refrescar la página */ + //document.getElementById('estilo').setAttribute('href', nuevo); + //document.getElementById('cssChange').innerHTML = oldName; + //document.getElementById('cssChange').setAttribute('onClick', 'cambiarCSS('+viejo+')'); + + location.reload(); } \ No newline at end of file diff --git a/assets/js/goBack.js b/assets/js/goBack.js new file mode 100644 index 0000000..2194701 --- /dev/null +++ b/assets/js/goBack.js @@ -0,0 +1,7 @@ +$(document).ready(function(){ + document.getElementById('go-back').addEventListener('click', function(event){ + event.preventDefault(); + history.back(); + //window.history.go(-1); + }); +}); \ No newline at end of file diff --git a/assets/js/goUp.js b/assets/js/goUp.js index 2cf01f7..d014fa7 100644 --- a/assets/js/goUp.js +++ b/assets/js/goUp.js @@ -1,4 +1,5 @@ $(document).ready(function(){ + $('.go-up').click(function(){ $('body, html').animate({ scrollTop: '0px' diff --git a/assets/js/selectTicket.js b/assets/js/selectTicket.js index 1de59c9..d765f56 100644 --- a/assets/js/selectTicket.js +++ b/assets/js/selectTicket.js @@ -10,7 +10,7 @@ window.onload = function(){ function select_cinema(){ var select = document.getElementById("select_cinema"); - console.log(select); + if(select != undefined){ select.onchange = function(){ location.href += "&cinema=" + $('select[id=cinemas]').val(); diff --git a/assets/php/common/changeCSS.php b/assets/php/common/changeCSS.php new file mode 100644 index 0000000..0424bdf --- /dev/null +++ b/assets/php/common/changeCSS.php @@ -0,0 +1,9 @@ + \ No newline at end of file diff --git a/assets/php/template.php b/assets/php/template.php index 8e7619a..bb2f380 100644 --- a/assets/php/template.php +++ b/assets/php/template.php @@ -70,13 +70,15 @@ $page = $this->page; $prefix = $this->prefix; + if(!isset($_SESSION["css"])) $_SESSION["css"] = "main.css"; + $extraCSS = ""; if($page === "Comprar Entrada") $extraCSS = "\n"; echo" CompluCine | {$page} - {$extraCSS} + {$extraCSS} @@ -664,16 +666,14 @@ function print_footer(){ $prefix = $this->prefix; $page = $this->page; - - /* TODO */ - if(!isset($_SESSION["css"]) || $_SESSION["css"] === "assets/css/main.css"){ + + if(!isset($_SESSION["css"]) || $_SESSION["css"] === "main.css"){ $css = "{$prefix}assets/css/highContrast.css"; $nameCSS = "Alto Contraste"; } else { $css = "{$prefix}assets/css/main.css"; $nameCSS = "Contraste Normal"; } - /****/ echo"\n"; } @@ -702,7 +702,8 @@ if($page === "FDI-Cines") echo"\n"; if($page === "Panel de Usuario") echo"\n"; if($page === "Comprar Entrada") echo" - \n"; + + \n"; } } diff --git a/purchase/includes/formPurchase.php b/purchase/includes/formPurchase.php index 5cb9d46..d78cdcb 100644 --- a/purchase/includes/formPurchase.php +++ b/purchase/includes/formPurchase.php @@ -160,6 +160,7 @@ class FormPurchase extends Form { $html = "

No se ha seleccionado asiento(s).

Vuelva atrás para selecionar una butaca.

+
"; } } diff --git a/purchase/includes/formSelectCinemaSession.php b/purchase/includes/formSelectCinemaSession.php index 6152b7c..e640dcc 100644 --- a/purchase/includes/formSelectCinemaSession.php +++ b/purchase/includes/formSelectCinemaSession.php @@ -78,7 +78,7 @@ class FormSelectCinemaSession extends Form { $cinemasListHTML .= ' '; } else { - $cinemasListHTML = ''; + $cinemasListHTML = ''; } $fiml_id = $film->getId(); @@ -118,15 +118,15 @@ class FormSelectCinemaSession extends Form { $sessionsListHTML .= ''; if($count == 0) { - $sessionsListHTML = ''; + $sessionsListHTML = ''; $pay = false; } } else { - $sessionsListHTML = ''; + $sessionsListHTML = ''; $pay = false; } } else { - $sessionsListHTML = ''; + $sessionsListHTML = ''; $pay = false; } @@ -192,7 +192,7 @@ class FormSelectCinemaSession extends Form { '; } else { - $filmsListHTML = ''; + $filmsListHTML = ''; } //Reply: Depends on whether the purchase is to be made from a selected movie or a cinema. @@ -213,11 +213,13 @@ class FormSelectCinemaSession extends Form { '; } else { - $html = '

No existe el cine.

'; + $html = '

No existe el cine.

+ '; $pay = false; } } else { - $html = '

No se ha encontrado película ni cine.

'; + $html = '

No se ha encontrado película ni cine.

+ '; $pay = false; }