71 lines
1.7 KiB
PHP
71 lines
1.7 KiB
PHP
<?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>
|