Cambios de Majo
This commit is contained in:
commit
a776bcb630
|
@ -231,15 +231,34 @@ while ($row = $result->fetch_assoc()) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function mostrarInputOtro(tipo) {
|
function mostrarInputOtro(tipo) {
|
||||||
const selectElement = document.getElementById(tipo);
|
const select = document.getElementById(tipo);
|
||||||
const inputOtroElement = document.getElementById(tipo + '_otro');
|
const inputOtro = document.getElementById(tipo + '_otro');
|
||||||
|
|
||||||
if (selectElement.value === 'otro') {
|
if (select.value === 'otro') {
|
||||||
inputOtroElement.classList.remove('d-none');
|
inputOtro.classList.remove('d-none');
|
||||||
inputOtroElement.setAttribute('required', 'required');
|
inputOtro.required = true;
|
||||||
} else {
|
} else {
|
||||||
inputOtroElement.classList.add('d-none');
|
inputOtro.classList.add('d-none');
|
||||||
inputOtroElement.removeAttribute('required');
|
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);
|
examenSelect.appendChild(option);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const optionOtro = document.createElement("option");
|
if (!Array.from(examenSelect.options).some(opt => opt.value === "otro")) {
|
||||||
optionOtro.value = "otro";
|
const optionOtro = document.createElement("option");
|
||||||
optionOtro.textContent = "Otro";
|
optionOtro.value = "otro";
|
||||||
examenSelect.appendChild(optionOtro);
|
optionOtro.textContent = "Otro";
|
||||||
|
examenSelect.appendChild(optionOtro);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// Reinicia certificaciones
|
// Reinicia certificaciones
|
||||||
certificacionSelect.innerHTML = '<option value="">Selecciona una certificación</option>';
|
certificacionSelect.innerHTML = '<option value="">Selecciona una certificación</option>';
|
||||||
const optionCertOtro = document.createElement("option");
|
if (!Array.from(certificacionSelect.options).some(opt => opt.value === "otro")) {
|
||||||
optionCertOtro.value = "otro";
|
const optionCertOtro = document.createElement("option");
|
||||||
optionCertOtro.textContent = "Otro";
|
optionCertOtro.value = "otro";
|
||||||
certificacionSelect.appendChild(optionCertOtro);
|
optionCertOtro.textContent = "Otro";
|
||||||
|
certificacionSelect.appendChild(optionCertOtro);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function actualizarCertificaciones() {
|
function actualizarCertificaciones() {
|
||||||
|
@ -286,11 +310,13 @@ while ($row = $result->fetch_assoc()) {
|
||||||
certificacionSelect.appendChild(option);
|
certificacionSelect.appendChild(option);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
// Siempre agrega la opción "Otro"
|
// Solo agrega la opción "Otro" si no existe ya
|
||||||
const optionOtro = document.createElement("option");
|
if (![...certificacionSelect.options].some(opt => opt.value === "otro")) {
|
||||||
optionOtro.value = "otro";
|
const optionOtro = document.createElement("option");
|
||||||
optionOtro.textContent = "Otro";
|
optionOtro.value = "otro";
|
||||||
certificacionSelect.appendChild(optionOtro);
|
optionOtro.textContent = "Otro";
|
||||||
|
certificacionSelect.appendChild(optionOtro);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
document.getElementById("registroForm").addEventListener("submit", function(e) {
|
document.getElementById("registroForm").addEventListener("submit", function(e) {
|
||||||
|
@ -447,5 +473,4 @@ document.addEventListener('DOMContentLoaded', function() {
|
||||||
|
|
||||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
|
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
@ -3,156 +3,170 @@ require_once 'database/database.php';
|
||||||
|
|
||||||
$query = "SELECT id_usuario, nombre FROM entrada";
|
$query = "SELECT id_usuario, nombre FROM entrada";
|
||||||
$resultado = $conexion->query($query);
|
$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();
|
||||||
|
}
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="es">
|
<html lang="es">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
<title>Centro de Certificación LANIA</title>
|
<title>Centro de Certificación LANIA</title>
|
||||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
|
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
|
||||||
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css" rel="stylesheet">
|
<!-- Font Awesome para íconos -->
|
||||||
<link href="style/dashboard.css" rel="stylesheet">
|
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css" rel="stylesheet">
|
||||||
|
<link href="style/dashboard.css" rel="stylesheet">
|
||||||
|
|
||||||
</head>
|
</head>
|
||||||
<body class="bg-light">
|
<body class="bg-light">
|
||||||
|
|
||||||
<?php include 'sidebar.php'; ?>
|
<?php include 'sidebar.php'; ?>
|
||||||
|
|
||||||
<div class="main-content">
|
|
||||||
<div class="container py-5">
|
|
||||||
<div class="text-center mb-4">
|
|
||||||
<h1 class="display-5">Centro de Certificación LANIA</h1>
|
|
||||||
<p class="lead">Formulario de salida para candidatos de exámenes PEARSON VUE</p>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="card shadow p-4">
|
|
||||||
<form id="formSalida" method="POST">
|
|
||||||
<div class="row g-3">
|
|
||||||
<div class="col-md-6">
|
|
||||||
<label for="nombre" class="form-label">Nombre del Usuario</label>
|
|
||||||
<select class="form-select" id="nombre" name="id_usuario" required>
|
|
||||||
<option value="">Selecciona tu nombre</option>
|
|
||||||
<?php while ($row = $resultado->fetch_assoc()): ?>
|
|
||||||
<option value="<?= $row['id_usuario'] ?>"><?= htmlspecialchars($row['nombre']) ?></option>
|
|
||||||
<?php endwhile; ?>
|
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
<div class="mt-4 survey">
|
<div class="main-content">
|
||||||
<h5>Encuesta de satisfacción</h5>
|
<div class="container py-5">
|
||||||
|
<div class="text-center mb-4">
|
||||||
|
<h1 class="display-5">Centro de Certificación LANIA</h1>
|
||||||
|
<p class="lead">Formulario de salida para candidatos de exámenes PEARSON VUE</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="card shadow p-4">
|
||||||
|
<form id="formSalida" method="POST">
|
||||||
|
<div class="row g-3">
|
||||||
|
<div class="col-md-6">
|
||||||
|
<label for="nombre" class="form-label">Nombre del Usuario</label>
|
||||||
|
<select class="form-select" id="nombre" name="id_usuario" required>
|
||||||
|
<option value="">Selecciona tu nombre</option>
|
||||||
|
<?php while ($row = $resultado->fetch_assoc()): ?>
|
||||||
|
<option value="<?= $row['id_usuario'] ?>"><?= htmlspecialchars($row['nombre']) ?></option>
|
||||||
|
<?php endwhile; ?>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<?php
|
<div class="mt-4 survey">
|
||||||
$preguntas = [
|
<h5>Encuesta de satisfacción</h5>
|
||||||
'atencion_personal' => '¿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): ?>
|
|
||||||
<div class="mb-3">
|
|
||||||
<label class="form-label"><?= $texto ?></label>
|
|
||||||
<div>
|
|
||||||
<?php for ($i = 1; $i <= 5; $i++): ?>
|
|
||||||
<input
|
|
||||||
type="radio"
|
|
||||||
name="<?= $campo ?>"
|
|
||||||
id="<?= $campo . '_' . $i ?>"
|
|
||||||
value="<?= $i ?>"
|
|
||||||
style="display: none;"
|
|
||||||
>
|
|
||||||
<label for="<?= $campo . '_' . $i ?>">
|
|
||||||
<img src="assets/face_<?= $i ?>.png" alt="<?= $i ?>" width="30">
|
|
||||||
</label>
|
|
||||||
<?php endfor; ?>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<?php endforeach; ?>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<input type="hidden" name="consentimiento" value="no">
|
<?php
|
||||||
<div class="form-check mb-4">
|
$preguntas = [
|
||||||
<input
|
'atencion_personal' => '¿Cómo calificaría usted la atención proporcionada por el personal de LANIA antes y durante la realización del examen?',
|
||||||
class="form-check-input"
|
'equipo_funcionando' => '¿ El equipo de cómputo proporcionado funcionó correctamente durante todo el examen?',
|
||||||
type="checkbox"
|
'ambiente_aula' => '¿Cómo valoraría el ambiente del aula (nivel de ruido, iluminación, temperatura, mobiliario) durante su examen?',
|
||||||
id="consentimiento"
|
'calidad_internet' => '¿Qué tan satisfactoria fue la calidad de la conexión a internet mientras realizaba su examen?',
|
||||||
name="consentimiento"
|
'instrucciones_claras' => '¿Recibió instrucciones claras sobre el procedimiento del examen y las normas del centro?',
|
||||||
value="si"
|
'respuesta_personal' => 'En caso de surgir dudas o problemas, ¿el personal respondió con rapidez y eficacia? ',
|
||||||
checked
|
'recomendacion_lania' => '¿Qué tan probable es que usted recomiende el Centro de Exámenes LANIA a otras personas?'
|
||||||
>
|
];
|
||||||
<label class="form-check-label" for="consentimiento">
|
foreach ($preguntas as $campo => $texto): ?>
|
||||||
Doy mi consentimiento para recibir publicidad
|
<div class="mb-3">
|
||||||
</label>
|
<label class="form-label"><?= $texto ?></label>
|
||||||
</div>
|
<div>
|
||||||
<input type="hidden" id="hora_salida_local" name="hora_salida">
|
<?php for ($i = 1; $i <= 5; $i++): ?>
|
||||||
|
<input
|
||||||
|
type="radio"
|
||||||
|
name="<?= $campo ?>"
|
||||||
|
id="<?= $campo . '_' . $i ?>"
|
||||||
|
value="<?= $i ?>"
|
||||||
|
style="display: none;"
|
||||||
|
>
|
||||||
|
<label for="<?= $campo . '_' . $i ?>">
|
||||||
|
<img src="assets/face_<?= $i ?>.png" alt="<?= $i ?>" width="30">
|
||||||
|
</label>
|
||||||
|
<?php endfor; ?>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<?php endforeach; ?>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="mt-4 text-end">
|
<!-- Consentimiento -->
|
||||||
<button type="submit" class="btn btn-primary">Enviar registro</button>
|
<input type="hidden" name="consentimiento" value="no">
|
||||||
</div>
|
<div class="form-check mb-4">
|
||||||
</form>
|
<input
|
||||||
</div>
|
class="form-check-input"
|
||||||
</div>
|
type="checkbox"
|
||||||
|
id="consentimiento"
|
||||||
|
name="consentimiento"
|
||||||
|
value="si"
|
||||||
|
checked
|
||||||
|
>
|
||||||
|
<label class="form-check-label" for="consentimiento">
|
||||||
|
Doy mi consentimiento para recibir publicidad
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
<input type="hidden" id="hora_salida_local" name="hora_salida">
|
||||||
|
|
||||||
<div class="modal fade" id="modalGracias" tabindex="-1" aria-labelledby="modalGraciasLabel" aria-hidden="true">
|
<!-- Botón enviar -->
|
||||||
<div class="modal-dialog modal-dialog-centered">
|
<div class="mt-4 text-end">
|
||||||
<div class="modal-content">
|
<button type="submit" class="btn btn-primary">Enviar registro</button>
|
||||||
<div class="modal-header bg-success text-white">
|
</div>
|
||||||
<h5 class="modal-title" id="modalGraciasLabel">¡Salida registrada!</h5>
|
</form>
|
||||||
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Cerrar"></button>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-body text-center">
|
|
||||||
Gracias por tu asistencia.
|
|
||||||
</div>
|
|
||||||
<div class="modal-footer">
|
|
||||||
<button type="button" class="btn btn-success" data-bs-dismiss="modal">Aceptar</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<script>
|
<!-- Modal de agradecimiento -->
|
||||||
document.getElementById("formSalida").addEventListener("submit", function(e) {
|
<div class="modal fade" id="modalGracias" tabindex="-1" aria-labelledby="modalGraciasLabel" aria-hidden="true">
|
||||||
e.preventDefault();
|
<div class="modal-dialog modal-dialog-centered">
|
||||||
|
<div class="modal-content">
|
||||||
|
<div class="modal-header bg-success text-white">
|
||||||
|
<h5 class="modal-title" id="modalGraciasLabel">¡Salida registrada!</h5>
|
||||||
|
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Cerrar"></button>
|
||||||
|
</div>
|
||||||
|
<div class="modal-body text-center">
|
||||||
|
Gracias por tu asistencia.
|
||||||
|
</div>
|
||||||
|
<div class="modal-footer">
|
||||||
|
<button type="button" class="btn btn-success" data-bs-dismiss="modal">Aceptar</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
const ahora = new Date();
|
<script>
|
||||||
const hora = ahora.toTimeString().slice(0,8); // "HH:MM:SS"
|
document.getElementById("formSalida").addEventListener("submit", function(e) {
|
||||||
document.getElementById("hora_salida_local").value = hora;
|
e.preventDefault();
|
||||||
|
|
||||||
const form = e.target;
|
const ahora = new Date();
|
||||||
const formData = new FormData(form);
|
const hora = ahora.toTimeString().slice(0,8); // "HH:MM:SS"
|
||||||
|
document.getElementById("hora_salida_local").value = hora;
|
||||||
|
|
||||||
fetch("model/logout.php", {
|
const form = e.target;
|
||||||
method: "POST",
|
const formData = new FormData(form);
|
||||||
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() {
|
fetch("model/logout.php", {
|
||||||
document.querySelectorAll('.sidebar-menu li').forEach(item => {
|
method: "POST",
|
||||||
item.classList.remove('active');
|
body: formData
|
||||||
});
|
})
|
||||||
const menuSalida = document.getElementById('menu-salida');
|
.then(response => response.text())
|
||||||
if (menuSalida) {
|
.then(data => {
|
||||||
menuSalida.classList.add('active');
|
const modalGracias = new bootstrap.Modal(document.getElementById('modalGracias'));
|
||||||
}
|
modalGracias.show();
|
||||||
});
|
form.reset();
|
||||||
</script>
|
})
|
||||||
|
.catch(error => {
|
||||||
|
console.error("Error al enviar:", error);
|
||||||
|
alert("Ocurrió un error al registrar la salida.");
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
|
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');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
Binary file not shown.
After Width: | Height: | Size: 12 KiB |
|
@ -1,3 +1,13 @@
|
||||||
|
<?php
|
||||||
|
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();
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="es">
|
<html lang="es">
|
||||||
<head>
|
<head>
|
||||||
|
@ -16,7 +26,6 @@
|
||||||
border-color: #0d6efd;
|
border-color: #0d6efd;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Estilos para los contenedores de los gráficos para asegurar que se muestren correctamente */
|
|
||||||
.chart-container {
|
.chart-container {
|
||||||
position: relative;
|
position: relative;
|
||||||
height: 300px; /* Ajusta esta altura según sea necesario para tus gráficos */
|
height: 300px; /* Ajusta esta altura según sea necesario para tus gráficos */
|
||||||
|
|
|
@ -2,12 +2,11 @@
|
||||||
|
|
||||||
$host = "localhost";
|
$host = "localhost";
|
||||||
$user = "root";
|
$user = "root";
|
||||||
$pass = "Arbolito123.";
|
$pass = "Starfox19.";
|
||||||
$db = "lania";
|
$db = "lania";
|
||||||
|
|
||||||
$conexion = new mysqli($host, $user, $pass, $db);
|
$conexion = new mysqli($host, $user, $pass, $db);
|
||||||
|
|
||||||
// Verifica errores de conexión
|
|
||||||
if ($conexion->connect_error) {
|
if ($conexion->connect_error) {
|
||||||
die("Error de conexión: " . $conexion->connect_error);
|
die("Error de conexión: " . $conexion->connect_error);
|
||||||
}
|
}
|
||||||
|
|
Binary file not shown.
After Width: | Height: | Size: 88 KiB |
Binary file not shown.
After Width: | Height: | Size: 16 KiB |
|
@ -0,0 +1,70 @@
|
||||||
|
<?php
|
||||||
|
// inicio.php
|
||||||
|
if (session_status() === PHP_SESSION_NONE) {
|
||||||
|
session_start();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Logout
|
||||||
|
if (isset($_GET['action']) && $_GET['action'] === 'logout') {
|
||||||
|
session_destroy();
|
||||||
|
header('Location: inicio.php');
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Selección de rol
|
||||||
|
if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['role'])) {
|
||||||
|
session_unset();
|
||||||
|
$_SESSION['role'] = $_POST['role'];
|
||||||
|
if ($_POST['role'] === 'admin') {
|
||||||
|
header('Location: sesion.php');
|
||||||
|
} else {
|
||||||
|
header('Location: FormularioInicial.php');
|
||||||
|
}
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="es">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<meta name="viewport" content="width=device-width,initial-scale=1.0">
|
||||||
|
<title>Inicio - LANIA</title>
|
||||||
|
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
|
||||||
|
<style>
|
||||||
|
body {
|
||||||
|
margin: 0;
|
||||||
|
height: 100vh;
|
||||||
|
background: #001f3f; /* azul marino */
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
flex-direction: column;
|
||||||
|
}
|
||||||
|
.logo {
|
||||||
|
max-width: 300px;
|
||||||
|
width: 100%;
|
||||||
|
margin-bottom: 2rem;
|
||||||
|
}
|
||||||
|
.btn-role {
|
||||||
|
width: 220px;
|
||||||
|
margin-bottom: 1rem;
|
||||||
|
}
|
||||||
|
form {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<img src="assets/logo.png" alt="Logo LANIA" class="logo">
|
||||||
|
<form method="post">
|
||||||
|
<button type="submit" name="role" value="aspirant" class="btn btn-outline-light btn-role">
|
||||||
|
Iniciar como Aspirante
|
||||||
|
</button>
|
||||||
|
<button type="submit" name="role" value="admin" class="btn btn-light btn-role">
|
||||||
|
Iniciar como Administrador
|
||||||
|
</button>
|
||||||
|
</form>
|
||||||
|
</body>
|
||||||
|
</html>
|
|
@ -0,0 +1,181 @@
|
||||||
|
<?php
|
||||||
|
session_start(); // Start the session at the very beginning
|
||||||
|
|
||||||
|
$error_message = '';
|
||||||
|
|
||||||
|
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
||||||
|
$email = $_POST['email'] ?? '';
|
||||||
|
$password = $_POST['password'] ?? '';
|
||||||
|
|
||||||
|
// Define allowed email domain and password
|
||||||
|
$allowed_domain = '@lania.edu.mx';
|
||||||
|
$correct_password = '1234';
|
||||||
|
|
||||||
|
// Validate email and password
|
||||||
|
if (str_ends_with($email, $allowed_domain) && $password === $correct_password) {
|
||||||
|
// Authentication successful
|
||||||
|
$_SESSION['loggedin'] = true;
|
||||||
|
$_SESSION['email'] = $email;
|
||||||
|
header('Location: dashboard.php'); // Redirect to dashboard
|
||||||
|
exit();
|
||||||
|
} else {
|
||||||
|
// Authentication failed
|
||||||
|
$error_message = 'Correo o contraseña incorrectos.';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="es">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<title>Iniciar Sesión - Centro de Certificación LANIA</title>
|
||||||
|
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
|
||||||
|
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css" rel="stylesheet">
|
||||||
|
<link rel="preconnect" href="https://fonts.googleapis.com">
|
||||||
|
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
||||||
|
<link href="https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;700&display=swap" rel="stylesheet">
|
||||||
|
<style>
|
||||||
|
body {
|
||||||
|
font-family: 'Roboto', sans-serif;
|
||||||
|
background: linear-gradient(to right, #eef7ff, #0a248a); /* Gradiente azul para LANIA */
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
min-height: 100vh;
|
||||||
|
margin: 0;
|
||||||
|
padding: 20px; /* Padding general para pantallas pequeñas */
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
.login-wrapper {
|
||||||
|
display: flex;
|
||||||
|
background-color: #ffffff;
|
||||||
|
border-radius: 10px;
|
||||||
|
box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
|
||||||
|
overflow: hidden; /* Para que las esquinas redondeadas funcionen bien con el contenido */
|
||||||
|
max-width: 900px; /* Ancho máximo para el contenedor de login */
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
.login-image-section {
|
||||||
|
flex: 1;
|
||||||
|
background: url('img/image.png') no-repeat center center;
|
||||||
|
background-size: cover;
|
||||||
|
min-height: 350px; /* Altura mínima para la imagen en móvil */
|
||||||
|
display: none; /* Ocultar por defecto en móviles */
|
||||||
|
}
|
||||||
|
@media (min-width: 768px) { /* Mostrar la imagen en pantallas medianas y grandes */
|
||||||
|
.login-image-section {
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.login-form-section {
|
||||||
|
flex: 1;
|
||||||
|
padding: 40px;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
.login-form-section h2 {
|
||||||
|
margin-bottom: 25px;
|
||||||
|
color: #133dd5; /* Color del texto del título */
|
||||||
|
text-align: center;
|
||||||
|
font-weight: 700;
|
||||||
|
}
|
||||||
|
.login-form-section .form-label {
|
||||||
|
font-weight: 500;
|
||||||
|
color: #343a40;
|
||||||
|
}
|
||||||
|
.login-form-section .form-control {
|
||||||
|
border-radius: 5px;
|
||||||
|
border: 1px solid #ced4da;
|
||||||
|
padding: 10px 15px;
|
||||||
|
transition: all 0.3s ease;
|
||||||
|
}
|
||||||
|
.login-form-section .form-control:focus {
|
||||||
|
border-color: #133dd5;
|
||||||
|
box-shadow: 0 0 0 0.25rem rgba(19, 61, 213, 0.25);
|
||||||
|
}
|
||||||
|
.btn-primary {
|
||||||
|
background-color: #133dd5; /* LANIA blue */
|
||||||
|
border-color: #133dd5;
|
||||||
|
padding: 10px 20px;
|
||||||
|
font-size: 1.1em;
|
||||||
|
font-weight: 600;
|
||||||
|
border-radius: 5px;
|
||||||
|
transition: all 0.3s ease;
|
||||||
|
}
|
||||||
|
.btn-primary:hover {
|
||||||
|
background-color: #0a248a; /* Darker shade on hover */
|
||||||
|
border-color: #0a248a;
|
||||||
|
transform: translateY(-2px); /* Pequeño efecto al pasar el mouse */
|
||||||
|
}
|
||||||
|
.alert {
|
||||||
|
margin-top: 20px;
|
||||||
|
text-align: center;
|
||||||
|
border-radius: 5px;
|
||||||
|
font-weight: 400;
|
||||||
|
}
|
||||||
|
.text-center.mt-4 p {
|
||||||
|
color: #6c757d;
|
||||||
|
font-size: 0.9em;
|
||||||
|
}
|
||||||
|
.social-login-buttons .btn {
|
||||||
|
border-radius: 50px; /* Botones más redondeados para redes sociales */
|
||||||
|
padding: 8px 20px;
|
||||||
|
font-size: 0.9em;
|
||||||
|
margin: 0 5px;
|
||||||
|
transition: all 0.3s ease;
|
||||||
|
}
|
||||||
|
.social-login-buttons .btn:hover {
|
||||||
|
transform: translateY(-2px);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Estilos para el logo o icono */
|
||||||
|
.login-logo {
|
||||||
|
text-align: center;
|
||||||
|
margin-bottom: 30px;
|
||||||
|
}
|
||||||
|
.login-logo img {
|
||||||
|
max-width: 120px; /* Ajusta el tamaño del logo */
|
||||||
|
height: auto;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div class="login-wrapper">
|
||||||
|
<div class="login-image-section">
|
||||||
|
</div>
|
||||||
|
<div class="login-form-section">
|
||||||
|
<div class="login-logo">
|
||||||
|
<img src="img/logo.png" alt="Logo LANIA" class="img-fluid">
|
||||||
|
</div>
|
||||||
|
<h2>Inicio de sesión</h2>
|
||||||
|
<?php if ($error_message): ?>
|
||||||
|
<div class="alert alert-danger" role="alert">
|
||||||
|
<?= $error_message ?>
|
||||||
|
</div>
|
||||||
|
<?php endif; ?>
|
||||||
|
<form action="login.php" method="POST">
|
||||||
|
<div class="mb-3">
|
||||||
|
<label for="email" class="form-label">Correo Electrónico</label>
|
||||||
|
<div class="input-group">
|
||||||
|
<span class="input-group-text"><i class="fas fa-user"></i></span>
|
||||||
|
<input type="email" class="form-control" id="email" name="email" placeholder="tu.correo@lania.edu.mx" required>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="mb-4">
|
||||||
|
<label for="password" class="form-label">Contraseña</label>
|
||||||
|
<div class="input-group">
|
||||||
|
<span class="input-group-text"><i class="fas fa-lock"></i></span>
|
||||||
|
<input type="password" class="form-control" id="password" name="password" placeholder="Ingresa tu contraseña" required>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<button type="submit" class="btn btn-primary d-block mx-auto">Ingresar</button>
|
||||||
|
</form>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
|
||||||
|
</body>
|
||||||
|
</html>
|
|
@ -0,0 +1,10 @@
|
||||||
|
<?php
|
||||||
|
session_start();
|
||||||
|
|
||||||
|
$_SESSION = array();
|
||||||
|
|
||||||
|
session_destroy();
|
||||||
|
|
||||||
|
header('Location: login.php');
|
||||||
|
exit();
|
||||||
|
?>
|
|
@ -1,5 +0,0 @@
|
||||||
{
|
|
||||||
"dependencies": {
|
|
||||||
"mysql2": "^3.14.1"
|
|
||||||
}
|
|
||||||
}
|
|
69
registro.php
69
registro.php
|
@ -1,69 +0,0 @@
|
||||||
<?php require_once 'model/register.php'; ?>
|
|
||||||
|
|
||||||
<!DOCTYPE html>
|
|
||||||
<html lang="es">
|
|
||||||
<head>
|
|
||||||
<meta charset="UTF-8">
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
||||||
<title>Registro de Usuario</title>
|
|
||||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
|
|
||||||
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css" rel="stylesheet">
|
|
||||||
|
|
||||||
<style>
|
|
||||||
body {
|
|
||||||
display: flex;
|
|
||||||
}
|
|
||||||
.sidebar {
|
|
||||||
min-width: 250px;
|
|
||||||
height: 400vh;
|
|
||||||
background: rgb(19, 61, 213);
|
|
||||||
color: white;
|
|
||||||
}
|
|
||||||
.sidebar a {
|
|
||||||
color: white;
|
|
||||||
text-decoration: none;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
</head>
|
|
||||||
<body class="bg-light">
|
|
||||||
<nav class="sidebar p-3">
|
|
||||||
<h4 class="text-center mb-4">LANIA</h4>
|
|
||||||
<ul class="nav flex-column">
|
|
||||||
<li class="nav-item"><a class="nav-link" href="Estadisticas.php"><i class="fas fa-tachometer-alt"></i> Estadísticas</a></li>
|
|
||||||
<li class="nav-item"><a class="nav-link" href="FormularioInicial.php"><i class="fas fa-user"></i> Formulario de Ingreso</a></li>
|
|
||||||
<li class="nav-item"><a class="nav-link" href="FormularioSalida.php"><i class="fas fa-user"></i> Formulario de Salida</a></li>
|
|
||||||
</ul>
|
|
||||||
</nav>
|
|
||||||
|
|
||||||
<div class="container py-5">
|
|
||||||
<div class="text-center mb-4">
|
|
||||||
<h1 class="display-5">Registro de Usuario</h1>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="card shadow p-4 mx-auto" style="max-width: 500px;">
|
|
||||||
<form method="post">
|
|
||||||
<label for="nombre" class="form-label">Nombre:</label>
|
|
||||||
<input type="text" class="form-control" id="nombre" name="nombre" required><br>
|
|
||||||
|
|
||||||
<label for="password" class="form-label">Contraseña:</label>
|
|
||||||
<input type="password" class="form-control" id="password" name="password" required><br>
|
|
||||||
|
|
||||||
<div class="mt-4 d-flex justify-content-center gap-3">
|
|
||||||
<button type="submit" class="btn btn-primary">Registrar</button>
|
|
||||||
<a href="sesion.php"><button type="button" class="btn btn-primary">Ir al Login</button></a>
|
|
||||||
</div>
|
|
||||||
</form>
|
|
||||||
|
|
||||||
<?php if (isset($success)): ?>
|
|
||||||
<div class="alert alert-success mt-3"><?php echo $success; ?></div>
|
|
||||||
<?php endif; ?>
|
|
||||||
|
|
||||||
<?php if (isset($error)): ?>
|
|
||||||
<div class="alert alert-danger mt-3"><?php echo $error; ?></div>
|
|
||||||
<?php endif; ?>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
137
sidebar.php
137
sidebar.php
|
@ -1,22 +1,149 @@
|
||||||
|
<?php
|
||||||
|
// Asegúrate de que la sesión esté iniciada en los archivos que incluyen esta barra lateral
|
||||||
|
if (session_status() == PHP_SESSION_NONE) {
|
||||||
|
session_start();
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
|
||||||
|
|
||||||
<div class="sidebar">
|
<div class="sidebar">
|
||||||
<div class="sidebar-header text-center">
|
<div class="sidebar-header text-center">
|
||||||
<h4>LANIA</h4>
|
<h4 style="font-size: 2em; color: white; margin-bottom: 20px;">LANIA</h4>
|
||||||
</div>
|
</div>
|
||||||
<ul class="sidebar-menu">
|
<ul class="sidebar-menu">
|
||||||
<li id="menu-estadisticas"> <a href="dashboard.php">
|
<li id="menu-estadisticas">
|
||||||
|
<a href="dashboard.php">
|
||||||
<span class="menu-icon-wrapper"><i class="fas fa-tachometer-alt"></i></span>
|
<span class="menu-icon-wrapper"><i class="fas fa-tachometer-alt"></i></span>
|
||||||
<span class="menu-text">Estadísticas</span>
|
<span class="menu-text">Estadísticas</span>
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
<li id="menu-entrada"> <a href="FormularioInicial.php">
|
<li id="menu-entrada">
|
||||||
|
<a href="FormularioInicial.php">
|
||||||
<span class="menu-icon-wrapper"><i class="fas fa-sign-in-alt"></i></span>
|
<span class="menu-icon-wrapper"><i class="fas fa-sign-in-alt"></i></span>
|
||||||
<span class="menu-text">Formulario de Entrada</span>
|
<span class="menu-text">Formulario de Entrada</span>
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
<li id="menu-salida"> <a href="FormularioSalida.php">
|
<li id="menu-salida">
|
||||||
|
<a href="FormularioSalida.php">
|
||||||
<span class="menu-icon-wrapper"><i class="fas fa-sign-out-alt"></i></span>
|
<span class="menu-icon-wrapper"><i class="fas fa-sign-out-alt"></i></span>
|
||||||
<span class="menu-text">Formulario de Salida</span>
|
<span class="menu-text">Formulario de Salida</span>
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
|
||||||
|
|
||||||
|
<div class="sidebar-footer">
|
||||||
|
<hr class="separator-line">
|
||||||
|
<ul class="sidebar-menu">
|
||||||
|
<li>
|
||||||
|
<a href="logout.php" class="logout-btn">
|
||||||
|
<span class="menu-icon-wrapper"><i class="fas fa-sign-out-alt"></i></span>
|
||||||
|
<span class="menu-text">Cerrar Sesión</span>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<style>
|
||||||
|
/* Añade esto a tu dashboard.css o directamente en sidebar.php para pruebas rápidas */
|
||||||
|
.sidebar {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column; /* Permite que el contenido se apile y el pie de página se empuje hacia abajo */
|
||||||
|
justify-content: space-between; /* Empuja el pie de página hacia abajo */
|
||||||
|
min-width: 250px;
|
||||||
|
height: 100vh; /* Haz que la barra lateral ocupe toda la altura de la ventana gráfica */
|
||||||
|
color: white; /* Texto blanco por defecto */
|
||||||
|
padding-bottom: 20px; /* Espacio para el botón de cerrar sesión */
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.sidebar-header {
|
||||||
|
padding: 20px;
|
||||||
|
text-align: center;
|
||||||
|
color: white;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.sidebar-menu {
|
||||||
|
list-style: none;
|
||||||
|
padding: 0;
|
||||||
|
margin: 0;
|
||||||
|
flex-grow: 1; /* Permite que el menú ocupe el espacio disponible */
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.sidebar-menu li {
|
||||||
|
margin-bottom: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.sidebar-menu a {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
padding: 10px 20px;
|
||||||
|
color: white; /* Texto blanco por defecto */
|
||||||
|
text-decoration: none;
|
||||||
|
transition: background-color 0.3s ease;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.sidebar-menu a:hover,
|
||||||
|
.sidebar-menu li.active a {
|
||||||
|
background-color:rgb(220, 220, 220); /* Fondo más claro al pasar el ratón o activo */
|
||||||
|
border-radius: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.sidebar-menu a .menu-text {
|
||||||
|
margin-left: 10px;
|
||||||
|
color: white;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
.menu-icon-wrapper {
|
||||||
|
width: 30px; /* Ancho fijo para los iconos */
|
||||||
|
text-align: center;
|
||||||
|
margin-right: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.sidebar-footer {
|
||||||
|
padding: 0 20px;
|
||||||
|
margin-top: auto; /* Empuja el pie de página hacia abajo */
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.separator-line {
|
||||||
|
border-top: 1px solid rgba(255, 255, 255, 0.3);
|
||||||
|
margin: 15px 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.logout-btn {
|
||||||
|
background-color: #dc3545; /* Rojo para el botón de cerrar sesión */
|
||||||
|
border-radius: 5px;
|
||||||
|
padding: 10px 20px;
|
||||||
|
text-align: center;
|
||||||
|
margin-top: 10px; /* Espacio encima del botón */
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.logout-btn:hover {
|
||||||
|
background-color: #c82333; /* Rojo más oscuro al pasar el ratón */
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
body {
|
||||||
|
display: flex; /* Asegura que la barra lateral y el contenido principal estén uno al lado del otro */
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.main-content {
|
||||||
|
flex-grow: 1; /* Permite que el contenido principal ocupe el ancho restante */
|
||||||
|
padding: 20px;
|
||||||
|
background-color: #f8f9fa; /* Fondo claro para el área de contenido */
|
||||||
|
}
|
||||||
|
</style>
|
Loading…
Reference in New Issue