Correo respaldo y notificaciones
This commit is contained in:
@@ -139,10 +139,15 @@ $mensajeMantenimiento = $config['mensaje_mantenimiento'] ?? 'El sistema se encue
|
||||
<!-- Formulario para verificar el código -->
|
||||
<form id="formCodigo" action="/IMPORTADORES/login/verificarCodigo" method="POST">
|
||||
<div class="mb-3">
|
||||
<label class="form-label" for="codigo">Código recibido por correo</label>
|
||||
<label class="form-label" for="codigo">Ingresa el código recibido por correo</label>
|
||||
<input type="text" id="codigo" name="codigo" class="form-control" required pattern="\d{6}" maxlength="6" placeholder="Ej. 123456">
|
||||
</div>
|
||||
<button type="submit" class="btn btn-primary w-100">Verificar código</button>
|
||||
|
||||
<!-- Botón para enviar el código al corrreo de respaldo-->
|
||||
<div class="text-center mt-3">
|
||||
<button type="button" id="btnReenviarRespaldo">¿No tienes acceso al correo? Reenviar al correo de respaldo</button>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<!-- Mostrar mensajes -->
|
||||
@@ -215,6 +220,16 @@ $mensajeMantenimiento = $config['mensaje_mantenimiento'] ?? 'El sistema se encue
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
document.getElementById("btnReenviarRespaldo").addEventListener("click", () => {
|
||||
fetch("/IMPORTADORES/login/reenviarCodigo", {
|
||||
method: "POST",
|
||||
headers: {'Content-Type': 'application/x-www-form-urlencoded'},
|
||||
body: "accion=reenviarCodigo"
|
||||
})
|
||||
.then(response => response.json())
|
||||
.then(data => alert(data.message));
|
||||
});
|
||||
</script>
|
||||
|
||||
</body>
|
||||
|
||||
@@ -55,6 +55,16 @@ if (!isset($_SESSION['usuario_id']) || $_SESSION['tipo_usuario'] !== 'importador
|
||||
<div class="d-none d-md-block bg-dark text-white position-fixed h-100 pt-5" style="width: 250px;">
|
||||
<nav class="nav flex-column">
|
||||
|
||||
<!-- Definimos variables de ubicación -->
|
||||
<?php
|
||||
// Detecta si estamos en alguna parte de configuración
|
||||
$esConfiguracion = str_contains($_SERVER['REQUEST_URI'], '/configuracion');
|
||||
// Detecta si estamos en alguna ruta de bitácoras
|
||||
$esVistaBitacoras = str_contains($_SERVER['REQUEST_URI'], '/bitacoras');
|
||||
// Detecta si estamos en alguna parta de seguridad
|
||||
$esVistaSeguridad = str_contains($_SERVER['REQUEST_URI'], '/seguridad');
|
||||
?>
|
||||
|
||||
<!-- INFORMACIÓN GENERAL -->
|
||||
<a href="/IMPORTADORES/configuracion/index"
|
||||
class="nav-link px-3 py-2 <?= str_contains($_SERVER['REQUEST_URI'], '/configuracion/dashboard_configuracion') ? 'active' : '' ?>">
|
||||
@@ -74,24 +84,41 @@ if (!isset($_SESSION['usuario_id']) || $_SESSION['tipo_usuario'] !== 'importador
|
||||
</a>
|
||||
|
||||
<!-- SEGURIDAD -->
|
||||
<a href="/IMPORTADORES/seguridad/index"
|
||||
class="nav-link px-3 py-2 <?= str_contains($_SERVER['REQUEST_URI'], '/seguridad/index') ? 'active' : '' ?>">
|
||||
🦺 Seguridad
|
||||
</a>
|
||||
|
||||
<?php if ($esVistaSeguridad): ?>
|
||||
<?php $enDashboardSeguridad = $_SERVER['REQUEST_URI'] === '/IMPORTADORES/seguridad/index'; ?>
|
||||
<a class="nav-link px-3 py-2 d-flex justify-content-between align-items-center <?= $esVistaSeguridad ? 'active' : '' ?>"
|
||||
href="<?= $enDashboardSeguridad ? '#submenuSeguridad' : '/IMPORTADORES/seguridad/index' ?>"
|
||||
<?= $enDashboardSeguridad ? 'data-bs-toggle="collapse"' : '' ?>
|
||||
role="button" aria-expanded="true" aria-controls="submenuSeguridad"
|
||||
onclick="<?= $enDashboardSeguridad ? '' : 'event.preventDefault(); window.location.href = \'/IMPORTADORES/seguridad/index\';' ?>">
|
||||
👮 Seguridad
|
||||
<span class="badge bg-secondary">1</span>
|
||||
</a>
|
||||
<div class="collapse show" id="submenuSeguridad">
|
||||
<nav class="nav flex-column ms-3">
|
||||
<a href="/IMPORTADORES/seguridad/opciones"
|
||||
class="nav-link px-3 py-1 <?= $_SERVER['REQUEST_URI'] === '/IMPORTADORES/seguridad/opciones' ? 'active' : '' ?>">
|
||||
• Opciones de Seguridad
|
||||
</a>
|
||||
</nav>
|
||||
</div>
|
||||
<?php elseif ($esConfiguracion || $esVistaBitacoras): ?>
|
||||
<a href="/IMPORTADORES/seguridad/index"
|
||||
class="nav-link px-3 py-2 d-flex justify-content-between align-items-center">
|
||||
👮 Seguridad
|
||||
<span class="badge bg-secondary">1</span>
|
||||
</a>
|
||||
<?php endif; ?>
|
||||
|
||||
<!-- BITÁCORAS -->
|
||||
<?php
|
||||
// Detecta si estamos en alguna parte de configuración
|
||||
$esConfiguracion = str_contains($_SERVER['REQUEST_URI'], '/configuracion');
|
||||
// Detecta si estamos en alguna ruta de bitácoras
|
||||
$esVistaBitacoras = str_contains($_SERVER['REQUEST_URI'], '/bitacoras');
|
||||
// Detecta si estamos en alguna parta de seguridad
|
||||
$esVistaSeguridad = str_contains($_SERVER['REQUEST_URI'], '/seguridad')
|
||||
?>
|
||||
<?php if ($esVistaBitacoras): ?>
|
||||
<?php $enDashboardBitacoras = $_SERVER['REQUEST_URI'] === '/IMPORTADORES/bitacoras/index'; ?>
|
||||
<!-- Estamos en cualquier página relacionada a bitácoras -->
|
||||
<a class="nav-link px-3 py-2 d-flex justify-content-between align-items-center <?= $esVistaBitacoras ? 'active' : '' ?>"
|
||||
data-bs-toggle="collapse" href="#submenuBitacoras" role="button" aria-expanded="true" aria-controls="submenuBitacoras">
|
||||
href="<?= $enDashboardBitacoras ? '#submenuBitacoras' : '/IMPORTADORES/bitacoras/index' ?>"
|
||||
<?= $enDashboardBitacoras ? 'data-bs-toggle="collapse"' : '' ?>
|
||||
role="button" aria-expanded="true" aria-controls="submenuBitacoras"
|
||||
onclick="<?= $enDashboardBitacoras ? '' : 'event.preventDefault(); window.location.href = \'/IMPORTADORES/bitacoras/index\';' ?>">
|
||||
📖 Bitácoras
|
||||
<span class="badge bg-secondary">1</span>
|
||||
</a>
|
||||
@@ -103,14 +130,7 @@ if (!isset($_SESSION['usuario_id']) || $_SESSION['tipo_usuario'] !== 'importador
|
||||
</a>
|
||||
</nav>
|
||||
</div>
|
||||
<?php elseif ($esConfiguracion): ?>
|
||||
<!-- Si estamos en configuración, pero no en bitácoras -->
|
||||
<a href="/IMPORTADORES/bitacoras/index"
|
||||
class="nav-link px-3 py-2 d-flex justify-content-between align-items-center">
|
||||
📖 Bitácoras
|
||||
<span class="badge bg-secondary">1</span>
|
||||
</a>
|
||||
<?php elseif ($esVistaSeguridad): ?>
|
||||
<?php elseif ($esConfiguracion || $esVistaSeguridad): ?>
|
||||
<!-- Si estamos en configuración, pero no en bitácoras -->
|
||||
<a href="/IMPORTADORES/bitacoras/index"
|
||||
class="nav-link px-3 py-2 d-flex justify-content-between align-items-center">
|
||||
@@ -118,6 +138,7 @@ if (!isset($_SESSION['usuario_id']) || $_SESSION['tipo_usuario'] !== 'importador
|
||||
<span class="badge bg-secondary">1</span>
|
||||
</a>
|
||||
<?php endif; ?>
|
||||
|
||||
</nav>
|
||||
</div>
|
||||
|
||||
@@ -144,16 +165,41 @@ if (!isset($_SESSION['usuario_id']) || $_SESSION['tipo_usuario'] !== 'importador
|
||||
</a>
|
||||
|
||||
<!-- SEGURIDAD -->
|
||||
<a href="/IMPORTADORES/seguridad/index"
|
||||
class="nav-link px-3 py-2 <?= str_contains($_SERVER['REQUEST_URI'], '/seguridad/index') ? 'active' : '' ?>">
|
||||
🦺 Seguridad
|
||||
</a>
|
||||
<?php if ($esVistaSeguridad): ?>
|
||||
<?php $enDashboardSeguridad = $_SERVER['REQUEST_URI'] === '/IMPORTADORES/seguridad/index'; ?>
|
||||
<a class="nav-link px-3 py-2 d-flex justify-content-between align-items-center <?= $esVistaSeguridad ? 'active' : '' ?>"
|
||||
href="<?= $enDashboardSeguridad ? '#submenuSeguridad' : '/IMPORTADORES/seguridad/index' ?>"
|
||||
<?= $enDashboardSeguridad ? 'data-bs-toggle="collapse"' : '' ?>
|
||||
role="button" aria-expanded="true" aria-controls="submenuSeguridad"
|
||||
onclick="<?= $enDashboardSeguridad ? '' : 'event.preventDefault(); window.location.href = \'/IMPORTADORES/seguridad/index\';' ?>">
|
||||
👮 Seguridad
|
||||
<span class="badge bg-secondary">1</span>
|
||||
</a>
|
||||
<div class="collapse show" id="submenuSeguridad">
|
||||
<nav class="nav flex-column ms-3">
|
||||
<a href="/IMPORTADORES/seguridad/opciones"
|
||||
class="nav-link px-3 py-1 <?= $_SERVER['REQUEST_URI'] === '/IMPORTADORES/seguridad/opciones' ? 'active' : '' ?>">
|
||||
• Opciones de Seguridad
|
||||
</a>
|
||||
</nav>
|
||||
</div>
|
||||
<?php elseif ($esConfiguracion || $esVistaBitacoras): ?>
|
||||
<a href="/IMPORTADORES/seguridad/index"
|
||||
class="nav-link px-3 py-2 d-flex justify-content-between align-items-center">
|
||||
👮 Seguridad
|
||||
<span class="badge bg-secondary">1</span>
|
||||
</a>
|
||||
<?php endif; ?>
|
||||
|
||||
<!-- BITÁCORAS -->
|
||||
<?php if ($esVistaBitacoras): ?>
|
||||
<?php $enDashboardBitacoras = $_SERVER['REQUEST_URI'] === '/IMPORTADORES/bitacoras/index'; ?>
|
||||
<!-- Estamos en cualquier página relacionada a bitácoras -->
|
||||
<a class="nav-link px-3 py-2 d-flex justify-content-between align-items-center <?= $esVistaBitacoras ? 'active' : '' ?>"
|
||||
data-bs-toggle="collapse" href="#submenuBitacoras" role="button" aria-expanded="true" aria-controls="submenuBitacoras">
|
||||
href="<?= $enDashboardBitacoras ? '#submenuBitacoras' : '/IMPORTADORES/bitacoras/index' ?>"
|
||||
<?= $enDashboardBitacoras ? 'data-bs-toggle="collapse"' : '' ?>
|
||||
role="button" aria-expanded="true" aria-controls="submenuBitacoras"
|
||||
onclick="<?= $enDashboardBitacoras ? '' : 'event.preventDefault(); window.location.href = \'/IMPORTADORES/bitacoras/index\';' ?>">
|
||||
📖 Bitácoras
|
||||
<span class="badge bg-secondary">1</span>
|
||||
</a>
|
||||
@@ -165,14 +211,7 @@ if (!isset($_SESSION['usuario_id']) || $_SESSION['tipo_usuario'] !== 'importador
|
||||
</a>
|
||||
</nav>
|
||||
</div>
|
||||
<?php elseif ($esConfiguracion): ?>
|
||||
<!-- Si estamos en configuración, pero no en bitácoras -->
|
||||
<a href="/IMPORTADORES/bitacoras/index"
|
||||
class="nav-link px-3 py-2 d-flex justify-content-between align-items-center">
|
||||
📖 Bitácoras
|
||||
<span class="badge bg-secondary">1</span>
|
||||
</a>
|
||||
<?php elseif ($esVistaSeguridad): ?>
|
||||
<?php elseif ($esConfiguracion || $esVistaSeguridad): ?>
|
||||
<!-- Si estamos en configuración, pero no en bitácoras -->
|
||||
<a href="/IMPORTADORES/bitacoras/index"
|
||||
class="nav-link px-3 py-2 d-flex justify-content-between align-items-center">
|
||||
|
||||
123
views/seguridad/agregar.php
Normal file
123
views/seguridad/agregar.php
Normal file
@@ -0,0 +1,123 @@
|
||||
<?php
|
||||
include __DIR__ . '/../partials/sidebar_configuracion.php';
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html lang="es">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Dashboard | Configuración</title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet">
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js"></script>
|
||||
<style>
|
||||
body {
|
||||
font-family: 'Segoe UI', sans-serif;
|
||||
background-color: #f4f6f9;
|
||||
}
|
||||
.sidebar {
|
||||
width: 220px;
|
||||
height: 100vh;
|
||||
background-color: #343a40;
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
padding-top: 56px; /* Alineado con la altura de la navbar */
|
||||
z-index: 1040; /* Asegura que esté por encima del contenido */
|
||||
}
|
||||
.sidebar .nav-link {
|
||||
font-weight: bold;
|
||||
color: white;
|
||||
transition: all 0.3s ease;
|
||||
}
|
||||
.sidebar .nav-link:hover,
|
||||
.sidebar .nav-link.active {
|
||||
background-color: #495057;
|
||||
color: #fff;
|
||||
}
|
||||
.content {
|
||||
margin-top: 56px; /* Ajusta debajo de navbar */
|
||||
padding: 40px 20px;
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
background-color: #f4f6f9; /* Asegura fondo uniforme */
|
||||
transition: margin-left 0.3s ease;
|
||||
}
|
||||
.navbar {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
width: 100%;
|
||||
z-index: 1050;
|
||||
}
|
||||
/* A partir de dispositivos medianos (>=768px), deja espacio lateral */
|
||||
@media (min-width: 768px) {
|
||||
.content {
|
||||
margin-left: 250px; /* Ancho del sidebar */
|
||||
}
|
||||
}
|
||||
|
||||
/* En móviles, sin margen lateral */
|
||||
@media (max-width: 767.98px) {
|
||||
.content {
|
||||
margin-left: 0;
|
||||
}
|
||||
.sidebar .nav-link {
|
||||
font-weight: normal;
|
||||
color: #343a40;
|
||||
background-color: transparent;
|
||||
}
|
||||
.sidebar .nav-link:hover,
|
||||
.sidebar .nav-link.active {
|
||||
background-color: #e9ecef;
|
||||
color: #212529;
|
||||
}
|
||||
}
|
||||
.card {
|
||||
border-radius: 12px;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div class="content">
|
||||
<h4 class="mb-4">👮 Opciones de Seguridad</h4>
|
||||
|
||||
<div class="row g-3">
|
||||
|
||||
<!-- Correo adicional (extra) -->
|
||||
<div class="col-md-7">
|
||||
<div class="card shadow-sm p-3">
|
||||
<h4 class="mb-4 text-dark">Recibe Notificaciones</h4>
|
||||
<p>Agrega un correo adicional para recibir notificaciones.</p>
|
||||
<form action="/IMPORTADORES/seguridad/correoExtra" method="POST">
|
||||
<div class="mb-3">
|
||||
<label class="form-label">Correo electrónico</label>
|
||||
<input type="email" name="email-extra" class="form-control" required value="">
|
||||
</div>
|
||||
<div class="d-grid">
|
||||
<button type="submit" class="btn btn-primary">Registrar</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Correo de Respaldo -->
|
||||
<div class="col-md-7">
|
||||
<div class="card shadow-sm p-3">
|
||||
<h4 class="mb-4 text-dark">Correo de Respaldo</h4>
|
||||
<p>Agrega un correo de respaldo para reuperación de tu cuenta.</p>
|
||||
<form action="/IMPORTADORES/seguridad/correoRespaldo" method="POST">
|
||||
<div class="mb-3">
|
||||
<label class="form-label">Correo electrónico respaldo</label>
|
||||
<input type="email" name="email-respaldo" class="form-control" required value="">
|
||||
</div>
|
||||
<div class="d-grid">
|
||||
<button type="submit" class="btn btn-success">Registrar</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -79,21 +79,17 @@ include __DIR__ . '/../partials/sidebar_configuracion.php';
|
||||
<body>
|
||||
|
||||
<div class="content">
|
||||
<h4 class="mb-4">🦺 Seguridad</h4>
|
||||
<h4 class="mb-4">👮 Seguridad</h4>
|
||||
|
||||
<div class="row g-3">
|
||||
|
||||
<div class="col-md-7">
|
||||
<div class="card shadow-sm p-3">
|
||||
<h4 class="mb-4 text-dark">Recibe Notificaciones</h4>
|
||||
<p>Agrega un correo adicional para recibir notificaciones.</p>
|
||||
<form action="/IMPORTADORES/seguridad/respaldo" method="POST">
|
||||
<form>
|
||||
<div class="mb-3">
|
||||
<label class="form-label">Correo electrónico</label>
|
||||
<input type="email" name="email-extra" class="form-control" required value="">
|
||||
</div>
|
||||
<div class="d-grid">
|
||||
<button type="submit" class="btn btn-primary">Registrar</button>
|
||||
<label class="form-label">Correo electrónico adicional</label>
|
||||
<input type="email" name="email-extra" class="form-control" disabled value="<?php echo htmlspecialchars($correos['correo_extra']); ?>">
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
@@ -102,14 +98,10 @@ include __DIR__ . '/../partials/sidebar_configuracion.php';
|
||||
<div class="col-md-7">
|
||||
<div class="card shadow-sm p-3">
|
||||
<h4 class="mb-4 text-dark">Correo de Respaldo</h4>
|
||||
<p>Agrega un correo de respaldo para reuperación de tu cuenta.</p>
|
||||
<form action="/IMPORTADORES/seguridad/respaldo" method="POST">
|
||||
<form>
|
||||
<div class="mb-3">
|
||||
<label class="form-label">Correo electrónico respaldo</label>
|
||||
<input type="email" name="email-respaldo" class="form-control" required value="">
|
||||
</div>
|
||||
<div class="d-grid">
|
||||
<button type="submit" class="btn btn-success">Registrar</button>
|
||||
<label class="form-label">Correo electrónico de respaldo</label>
|
||||
<input type="email" name="email-respaldo" class="form-control" disabled value="<?php echo htmlspecialchars($correos['correo_respaldo']); ?>">
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user