From 2a5a9a9d12fa3b1041c4eb63e7ed6c06c9e3e8cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fernando=20M=C3=A9ndez?= <45081533+FerMdez@users.noreply.github.com> Date: Tue, 1 Jun 2021 09:52:53 +0200 Subject: [PATCH] Add files via upload --- assets/js/deleteConfirm.js | 7 ++++--- assets/js/selectTicket.js | 23 ++++++++++++++++++----- panel_user/includes/formDeleteAccount.php | 15 ++++++++------- register/includes/formRegister.php | 12 +++++++++--- 4 files changed, 39 insertions(+), 18 deletions(-) diff --git a/assets/js/deleteConfirm.js b/assets/js/deleteConfirm.js index b4d41f7..8ce89d2 100644 --- a/assets/js/deleteConfirm.js +++ b/assets/js/deleteConfirm.js @@ -3,10 +3,11 @@ * CompluCine - FDI-cines */ -function confirmDelete() { +function confirmDelete(e) { if(confirm("¿Está seguro de que desea eliminar su cuenta de usuario?\nEsta acción no se puede deshacer.")){ - document.formDeleteAccount.submit(); + document.getElementById("formDeleteAccount1").submit(); } else { - location.href = "./"; + //location.href = "./"; + e.preventDefault(); } } \ No newline at end of file diff --git a/assets/js/selectTicket.js b/assets/js/selectTicket.js index b04ee79..1de59c9 100644 --- a/assets/js/selectTicket.js +++ b/assets/js/selectTicket.js @@ -5,17 +5,30 @@ // Método 1: recargar la página y enviar un GET. window.onload = function(){ + if(!select_cinema()) select_film(); +} + +function select_cinema(){ var select = document.getElementById("select_cinema"); - select.onchange = function(){ - location.href += "&cinema=" + $('select[id=cinemas]').val(); + console.log(select); + if(select != undefined){ + select.onchange = function(){ + location.href += "&cinema=" + $('select[id=cinemas]').val(); + } + return true; + } else { + return false; } } -var select_ = document.getElementById("select_film"); -select_.onchange = function(){ - location.href += "&film=" + $('select[id=films]').val(); +function select_film(){ + var select_ = document.getElementById("select_film"); + select_.onchange = function(){ + location.href += "&film=" + $('select[id=films]').val(); + } } + // Método 2: enviar una petición AJAX con POST. ==> (NO FUNCIONA, PERO LA IDEA ERA HACERLO ASÍ PARA EVITAR REFRESCAR LA PÁGINA Y LLENAR LA URL) /* $(document).ready(function(){ diff --git a/panel_user/includes/formDeleteAccount.php b/panel_user/includes/formDeleteAccount.php index fb3aff0..2176aa8 100644 --- a/panel_user/includes/formDeleteAccount.php +++ b/panel_user/includes/formDeleteAccount.php @@ -22,9 +22,10 @@ class FormDeleteAccount extends Form { $errorEmail = self::createMensajeError($errores, 'email', 'span', array('class' => 'error')); $errorPassword = self::createMensajeError($errores, 'pass', 'span', array('class' => 'error')); $errorPassword2 = self::createMensajeError($errores, 'repass', 'span', array('class' => 'error')); + $errorVerify = self::createMensajeError($errores, 'verify', 'span', array('class' => 'error')); $html = "
".$htmlErroresGlobales."@@ -39,7 +40,7 @@ class FormRegister extends Form {
".$errorPassword2."✔❌
".$errorVerify."