diff --git a/FormularioInicial.php b/FormularioInicial.php index c53ae8a..23d5dfa 100644 --- a/FormularioInicial.php +++ b/FormularioInicial.php @@ -231,15 +231,34 @@ while ($row = $result->fetch_assoc()) { } function mostrarInputOtro(tipo) { - const selectElement = document.getElementById(tipo); - const inputOtroElement = document.getElementById(tipo + '_otro'); + const select = document.getElementById(tipo); + const inputOtro = document.getElementById(tipo + '_otro'); - if (selectElement.value === 'otro') { - inputOtroElement.classList.remove('d-none'); - inputOtroElement.setAttribute('required', 'required'); + if (select.value === 'otro') { + inputOtro.classList.remove('d-none'); + inputOtro.required = true; } else { - inputOtroElement.classList.add('d-none'); - inputOtroElement.removeAttribute('required'); + inputOtro.classList.add('d-none'); + inputOtro.value = ''; + inputOtro.required = false; + } + + // Si cambias proveedor, resetea examen y certificación + if (tipo === 'empresa') { + // Oculta y limpia examen_otro y certificacion_otro + document.getElementById('examen_otro').classList.add('d-none'); + document.getElementById('examen_otro').value = ''; + document.getElementById('examen_otro').required = false; + + document.getElementById('certificacion_otro').classList.add('d-none'); + document.getElementById('certificacion_otro').value = ''; + document.getElementById('certificacion_otro').required = false; + } + // Si cambias examen, resetea certificación + if (tipo === 'examen') { + document.getElementById('certificacion_otro').classList.add('d-none'); + document.getElementById('certificacion_otro').value = ''; + document.getElementById('certificacion_otro').required = false; } } @@ -258,17 +277,22 @@ while ($row = $result->fetch_assoc()) { examenSelect.appendChild(option); } } - const optionOtro = document.createElement("option"); - optionOtro.value = "otro"; - optionOtro.textContent = "Otro"; - examenSelect.appendChild(optionOtro); + if (!Array.from(examenSelect.options).some(opt => opt.value === "otro")) { + const optionOtro = document.createElement("option"); + optionOtro.value = "otro"; + optionOtro.textContent = "Otro"; + examenSelect.appendChild(optionOtro); + } + // Reinicia certificaciones - certificacionSelect.innerHTML = ''; - const optionCertOtro = document.createElement("option"); - optionCertOtro.value = "otro"; - optionCertOtro.textContent = "Otro"; - certificacionSelect.appendChild(optionCertOtro); + certificacionSelect.innerHTML = ''; + if (!Array.from(certificacionSelect.options).some(opt => opt.value === "otro")) { + const optionCertOtro = document.createElement("option"); + optionCertOtro.value = "otro"; + optionCertOtro.textContent = "Otro"; + certificacionSelect.appendChild(optionCertOtro); + } } function actualizarCertificaciones() { @@ -286,11 +310,13 @@ while ($row = $result->fetch_assoc()) { certificacionSelect.appendChild(option); }); } - // Siempre agrega la opción "Otro" - const optionOtro = document.createElement("option"); - optionOtro.value = "otro"; - optionOtro.textContent = "Otro"; - certificacionSelect.appendChild(optionOtro); + // Solo agrega la opción "Otro" si no existe ya + if (![...certificacionSelect.options].some(opt => opt.value === "otro")) { + const optionOtro = document.createElement("option"); + optionOtro.value = "otro"; + optionOtro.textContent = "Otro"; + certificacionSelect.appendChild(optionOtro); + } } document.getElementById("registroForm").addEventListener("submit", function(e) { @@ -447,5 +473,4 @@ document.addEventListener('DOMContentLoaded', function() { - - + \ No newline at end of file diff --git a/FormularioSalida.php b/FormularioSalida.php index bbf7fa9..589cdf7 100644 --- a/FormularioSalida.php +++ b/FormularioSalida.php @@ -3,156 +3,170 @@ require_once 'database/database.php'; $query = "SELECT id_usuario, nombre FROM entrada"; $resultado = $conexion->query($query); + +session_start(); // Start the session + +// Check if the user is not logged in +if (!isset($_SESSION['loggedin']) || $_SESSION['loggedin'] !== true) { + header('Location: login.php'); // Redirect to login page + exit(); +} ?> -  Centro de Certificación LANIA -    + + + Centro de Certificación LANIA + + + + + -   
-     
-       
-         

Centro de Certificación LANIA

-         

Formulario de salida para candidatos de exámenes PEARSON VUE

-       
-        -       
-         
-           
-             
-                -                -             
-              -           
-             
Encuesta de satisfacción
+
+
+
+

Centro de Certificación LANIA

+

Formulario de salida para candidatos de exámenes PEARSON VUE

+
+ +
+ +
+
+ + +
+ - '¿Cómo calificaría usted la atención proporcionada por el personal de LANIA antes y durante la realización del examen?', // <-- Remove the ; here -                'equipo_funcionando'   => '¿ El equipo de cómputo proporcionado funcionó correctamente durante todo el examen?', // <-- Remove the ; here -                'ambiente_aula'        => '¿Cómo valoraría el ambiente del aula (nivel de ruido, iluminación, temperatura, mobiliario) durante su examen?', // <-- Remove the ; here -                'calidad_internet'     => '¿Qué tan satisfactoria fue la calidad de la conexión a internet mientras realizaba su examen?', // <-- Remove the ; here -                'instrucciones_claras' => '¿Recibió instrucciones claras sobre el procedimiento del examen y las normas del centro?', // <-- Remove the ; here -                'respuesta_personal'   => 'En caso de surgir dudas o problemas, ¿el personal respondió con rapidez y eficacia?  ', // <-- Remove the ; here -                'recomendacion_lania'  => '¿Qué tan probable es que usted recomiende el Centro de Exámenes LANIA a otras personas?' // <-- Remove the ; here (and it's optional for the last element) -              ]; -              foreach ($preguntas as $campo => $texto): ?> -               
-                  -                 
-                    -                      -                      -                    -                 
-               
-              -           
+
+
Encuesta de satisfacción
-                        -           
-              -              -           
-            + '¿Cómo calificaría usted la atención proporcionada por el personal de LANIA antes y durante la realización del examen?', + 'equipo_funcionando' => '¿ El equipo de cómputo proporcionado funcionó correctamente durante todo el examen?', + 'ambiente_aula' => '¿Cómo valoraría el ambiente del aula (nivel de ruido, iluminación, temperatura, mobiliario) durante su examen?', + 'calidad_internet' => '¿Qué tan satisfactoria fue la calidad de la conexión a internet mientras realizaba su examen?', + 'instrucciones_claras' => '¿Recibió instrucciones claras sobre el procedimiento del examen y las normas del centro?', + 'respuesta_personal' => 'En caso de surgir dudas o problemas, ¿el personal respondió con rapidez y eficacia? ', + 'recomendacion_lania' => '¿Qué tan probable es que usted recomiende el Centro de Exámenes LANIA a otras personas?' + ]; + foreach ($preguntas as $campo => $texto): ?> +
+ +
+ + + + +
+
+ +
-                       
-              -           
-          -       
-     
+ + +
+ + +
+ -            -   
+ +
+ +
+ +
+
+ fetch("model/logout.php", { + method: "POST", + body: formData + }) + .then(response => response.text()) + .then(data => { + const modalGracias = new bootstrap.Modal(document.getElementById('modalGracias')); + modalGracias.show(); + form.reset(); + }) + .catch(error => { + console.error("Error al enviar:", error); + alert("Ocurrió un error al registrar la salida."); + }); + }); -  + document.addEventListener('DOMContentLoaded', function() { + document.querySelectorAll('.sidebar-menu li').forEach(item => { + item.classList.remove('active'); + }); + const menuSalida = document.getElementById('menu-salida'); + if (menuSalida) { + menuSalida.classList.add('active'); + } + }); + + + \ No newline at end of file diff --git a/assets/logo.png b/assets/logo.png new file mode 100644 index 0000000..e880915 Binary files /dev/null and b/assets/logo.png differ diff --git a/dashboard.php b/dashboard.php index 17da58e..be33aad 100644 --- a/dashboard.php +++ b/dashboard.php @@ -1,3 +1,13 @@ + + @@ -16,7 +26,6 @@ border-color: #0d6efd; } - /* Estilos para los contenedores de los gráficos para asegurar que se muestren correctamente */ .chart-container { position: relative; height: 300px; /* Ajusta esta altura según sea necesario para tus gráficos */ diff --git a/database/database.php b/database/database.php index a5da874..12b1095 100644 --- a/database/database.php +++ b/database/database.php @@ -2,12 +2,11 @@ $host = "localhost"; $user = "root"; - $pass = "Arbolito123."; + $pass = "Starfox19."; $db = "lania"; $conexion = new mysqli($host, $user, $pass, $db); - // Verifica errores de conexión if ($conexion->connect_error) { die("Error de conexión: " . $conexion->connect_error); } diff --git a/img/image.png b/img/image.png new file mode 100644 index 0000000..33aa5de Binary files /dev/null and b/img/image.png differ diff --git a/img/logo.png b/img/logo.png new file mode 100644 index 0000000..2456e7b Binary files /dev/null and b/img/logo.png differ diff --git a/inicio.php b/inicio.php new file mode 100644 index 0000000..f565012 --- /dev/null +++ b/inicio.php @@ -0,0 +1,70 @@ + + + + + + + Inicio - LANIA + + + + + +
+ + +
+ + diff --git a/login.php b/login.php new file mode 100644 index 0000000..db374bf --- /dev/null +++ b/login.php @@ -0,0 +1,181 @@ + + + + + + + + Iniciar Sesión - Centro de Certificación LANIA + + + + + + + + + + + + \ No newline at end of file diff --git a/logout.php b/logout.php new file mode 100644 index 0000000..412520c --- /dev/null +++ b/logout.php @@ -0,0 +1,10 @@ + \ No newline at end of file diff --git a/package.json b/package.json deleted file mode 100644 index 84e2516..0000000 --- a/package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "dependencies": { - "mysql2": "^3.14.1" - } -} diff --git a/registro.php b/registro.php deleted file mode 100644 index d1af2d3..0000000 --- a/registro.php +++ /dev/null @@ -1,69 +0,0 @@ - - - - - - - - Registro de Usuario - - - - - - - - -
-
-

Registro de Usuario

-
- -
-
- -
- - -
- -
- - -
-
- - -
- - - -
- -
-
- - - - \ No newline at end of file diff --git a/sidebar.php b/sidebar.php index 8ab9293..114b556 100644 --- a/sidebar.php +++ b/sidebar.php @@ -1,22 +1,149 @@ + + + \ No newline at end of file + + + +
+ + + \ No newline at end of file