grales
This commit is contained in:
@@ -8,20 +8,21 @@ $sql = "SELECT TOP 1 * FROM configuracion_sistema";
|
||||
$stmt = sqlsrv_query($conn, $sql);
|
||||
$config = sqlsrv_fetch_array($stmt, SQLSRV_FETCH_ASSOC);
|
||||
|
||||
// Variables con valores por defecto
|
||||
$nombre = $config['nombre_plataforma'] ?? 'Sistema Integral para Importadores de Hidrocarburos';
|
||||
$siglas = $config['siglas'] ?? 'SIIH';
|
||||
$logo = $config['logo_url'] ?? 'assets/img/logo_siih.png';
|
||||
$color1 = explode(',', $config['colores_primarios'] ?? '#003366,#0055A5')[0];
|
||||
$color2 = explode(',', $config['colores_primarios'] ?? '#003366,#0055A5')[1];
|
||||
// Variables con valores por defecto - Branding moderno
|
||||
$nombre = $config['nombre_plataforma'] ?? 'Sistema de Gestión de Importaciones';
|
||||
$siglas = $config['siglas'] ?? 'AduanaSoft';
|
||||
$logo = $config['logo_url'] ?? 'assets/img/logo_aduanasoft.png';
|
||||
$color1 = explode(',', $config['colores_primarios'] ?? '#0f172a,#334155')[0];
|
||||
$color2 = explode(',', $config['colores_primarios'] ?? '#0f172a,#334155')[1];
|
||||
?>
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html lang="es">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title><?= htmlspecialchars($siglas) ?> | Registro de Importador</title>
|
||||
<title><?= htmlspecialchars($siglas) ?> | Registro</title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<meta name="description" content="Registro de importadores y agencias aduanales en la plataforma integral de gestión">
|
||||
<!-- Bootstrap 5 -->
|
||||
<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>
|
||||
@@ -29,36 +30,289 @@ $color2 = explode(',', $config['colores_primarios'] ?? '#003366,#0055A5')
|
||||
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
|
||||
<!-- Google reCAPTCHA v2 -->
|
||||
<script src="https://www.google.com/recaptcha/api.js" async defer></script>
|
||||
<!-- Google Fonts -->
|
||||
<link href="https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap" rel="stylesheet">
|
||||
<style>
|
||||
body { background-color: #f4f6f9; font-family: 'Segoe UI', sans-serif; }
|
||||
.navbar { background-color: #fff; }
|
||||
.navbar .nav-link,
|
||||
.navbar-brand { color: <?= $color1 ?> !important; font-weight: 500; }
|
||||
.navbar .nav-link.active { background-color: #F9F9F9; border-radius: 5px; }
|
||||
.card-form { max-width: 900px; margin: 50px auto; padding: 40px; background: #fff; border-radius: 10px; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08); }
|
||||
.form-label { font-weight: 500; }
|
||||
.form-control,
|
||||
.form-select { border-radius: 6px; }
|
||||
footer { background-color: #e9ecef; padding: 20px; text-align: center; font-size: 14px; color: #666; }
|
||||
.recaptcha { margin-top: 20px; }
|
||||
.logo-siih { height: 90px; margin-right: 10px; }
|
||||
.form-toggle { margin-bottom: 2rem; text-align: center; }
|
||||
.form-toggle .btn { margin: 0 0.5rem; min-width: 150px; }
|
||||
.form-container { display: none; }
|
||||
.form-container.active { display: block; }
|
||||
.form-title { text-align: center; margin-bottom: 2rem; color: #333; }
|
||||
.transition-fade { transition: opacity 0.3s ease-in-out; }
|
||||
.alert { bottom: 30px; }
|
||||
:root {
|
||||
--primary: <?= $color1 ?>;
|
||||
--secondary: <?= $color2 ?>;
|
||||
--accent: #10b981;
|
||||
--surface: #ffffff;
|
||||
--background: #f8fafc;
|
||||
--text: #1e293b;
|
||||
--text-muted: #64748b;
|
||||
--border: #e2e8f0;
|
||||
}
|
||||
|
||||
* {
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
body {
|
||||
background: linear-gradient(135deg, var(--background) 0%, #e2e8f0 100%);
|
||||
font-family: 'Poppins', sans-serif;
|
||||
color: var(--text);
|
||||
line-height: 1.6;
|
||||
margin: 0;
|
||||
min-height: 100vh;
|
||||
}
|
||||
|
||||
.navbar {
|
||||
background: rgba(255, 255, 255, 0.95);
|
||||
backdrop-filter: blur(20px);
|
||||
border-bottom: 1px solid var(--border);
|
||||
padding: 1rem 0;
|
||||
}
|
||||
|
||||
.navbar-brand {
|
||||
font-weight: 600;
|
||||
font-size: 1.25rem;
|
||||
color: var(--primary) !important;
|
||||
}
|
||||
|
||||
.nav-link {
|
||||
color: var(--text-muted) !important;
|
||||
font-weight: 500;
|
||||
padding: 0.5rem 1rem !important;
|
||||
border-radius: 8px;
|
||||
transition: all 0.2s ease;
|
||||
}
|
||||
|
||||
.nav-link:hover, .nav-link.active {
|
||||
color: var(--primary) !important;
|
||||
background-color: #f1f5f9;
|
||||
}
|
||||
|
||||
.registration-container {
|
||||
max-width: 1000px;
|
||||
margin: 2rem auto;
|
||||
padding: 0 1rem;
|
||||
}
|
||||
|
||||
.card-form {
|
||||
background: var(--surface);
|
||||
border-radius: 20px;
|
||||
box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08);
|
||||
padding: 3rem;
|
||||
border: 1px solid var(--border);
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.card-form::before {
|
||||
content: '';
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
height: 4px;
|
||||
background: linear-gradient(90deg, var(--accent), var(--primary));
|
||||
}
|
||||
|
||||
.page-header {
|
||||
text-align: center;
|
||||
margin-bottom: 3rem;
|
||||
}
|
||||
|
||||
.page-title {
|
||||
font-size: 2.5rem;
|
||||
font-weight: 700;
|
||||
color: var(--text);
|
||||
margin-bottom: 0.5rem;
|
||||
}
|
||||
|
||||
.page-subtitle {
|
||||
color: var(--text-muted);
|
||||
font-size: 1.1rem;
|
||||
}
|
||||
|
||||
.form-toggle {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
margin-bottom: 3rem;
|
||||
background: var(--background);
|
||||
border-radius: 12px;
|
||||
padding: 0.5rem;
|
||||
gap: 0.5rem;
|
||||
}
|
||||
|
||||
.toggle-btn {
|
||||
flex: 1;
|
||||
max-width: 200px;
|
||||
padding: 1rem 1.5rem;
|
||||
border: none;
|
||||
border-radius: 8px;
|
||||
font-weight: 600;
|
||||
transition: all 0.3s ease;
|
||||
background: transparent;
|
||||
color: var(--text-muted);
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.toggle-btn.active {
|
||||
background: var(--surface);
|
||||
color: var(--primary);
|
||||
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
|
||||
.form-container {
|
||||
display: none;
|
||||
animation: fadeIn 0.3s ease-in-out;
|
||||
}
|
||||
|
||||
.form-container.active {
|
||||
display: block;
|
||||
}
|
||||
|
||||
@keyframes fadeIn {
|
||||
from { opacity: 0; transform: translateY(20px); }
|
||||
to { opacity: 1; transform: translateY(0); }
|
||||
}
|
||||
|
||||
.form-section-title {
|
||||
font-size: 1.5rem;
|
||||
font-weight: 600;
|
||||
color: var(--text);
|
||||
margin-bottom: 2rem;
|
||||
text-align: center;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.form-section-title::after {
|
||||
content: '';
|
||||
position: absolute;
|
||||
bottom: -8px;
|
||||
left: 50%;
|
||||
transform: translateX(-50%);
|
||||
width: 50px;
|
||||
height: 3px;
|
||||
background: var(--accent);
|
||||
border-radius: 2px;
|
||||
}
|
||||
|
||||
.form-label {
|
||||
font-weight: 500;
|
||||
color: var(--text);
|
||||
margin-bottom: 0.5rem;
|
||||
}
|
||||
|
||||
.form-control, .form-select {
|
||||
border: 2px solid var(--border);
|
||||
border-radius: 12px;
|
||||
padding: 0.75rem 1rem;
|
||||
font-size: 0.95rem;
|
||||
transition: all 0.2s ease;
|
||||
background: var(--surface);
|
||||
}
|
||||
|
||||
.form-control:focus, .form-select:focus {
|
||||
border-color: var(--accent);
|
||||
box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
|
||||
background: var(--surface);
|
||||
}
|
||||
|
||||
.section-divider {
|
||||
border: none;
|
||||
height: 2px;
|
||||
background: linear-gradient(90deg, transparent, var(--border), transparent);
|
||||
margin: 2.5rem 0;
|
||||
}
|
||||
|
||||
.section-subtitle {
|
||||
font-weight: 600;
|
||||
color: var(--text);
|
||||
font-size: 1.1rem;
|
||||
margin-bottom: 1.5rem;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 0.5rem;
|
||||
}
|
||||
|
||||
.recaptcha {
|
||||
margin: 2rem 0;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.btn-modern {
|
||||
padding: 12px 28px;
|
||||
border-radius: 12px;
|
||||
font-weight: 600;
|
||||
text-decoration: none;
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
transition: all 0.3s ease;
|
||||
border: none;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.btn-primary-modern {
|
||||
background: linear-gradient(135deg, var(--accent), #059669);
|
||||
color: white;
|
||||
box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
|
||||
}
|
||||
|
||||
.btn-primary-modern:hover {
|
||||
transform: translateY(-2px);
|
||||
box-shadow: 0 8px 25px rgba(16, 185, 129, 0.4);
|
||||
color: white;
|
||||
}
|
||||
|
||||
.info-alert {
|
||||
background: linear-gradient(135deg, #fef3c7, #fde68a);
|
||||
border: 1px solid #f59e0b;
|
||||
border-radius: 12px;
|
||||
padding: 1.5rem;
|
||||
margin-top: 2rem;
|
||||
color: #92400e;
|
||||
}
|
||||
|
||||
.info-alert .alert-icon {
|
||||
color: #f59e0b;
|
||||
margin-right: 0.5rem;
|
||||
}
|
||||
|
||||
footer {
|
||||
background: var(--text);
|
||||
color: #94a3b8;
|
||||
padding: 2rem 0;
|
||||
text-align: center;
|
||||
margin-top: 3rem;
|
||||
}
|
||||
|
||||
.footer-text {
|
||||
font-size: 0.9rem;
|
||||
line-height: 1.5;
|
||||
}
|
||||
|
||||
@media (max-width: 768px) {
|
||||
.card-form {
|
||||
margin: 1rem;
|
||||
padding: 2rem 1.5rem;
|
||||
}
|
||||
|
||||
.page-title {
|
||||
font-size: 2rem;
|
||||
}
|
||||
|
||||
.form-toggle {
|
||||
flex-direction: column;
|
||||
gap: 0.5rem;
|
||||
}
|
||||
|
||||
.toggle-btn {
|
||||
max-width: none;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<!-- Navbar institucional -->
|
||||
<!-- NAVBAR -->
|
||||
<nav class="navbar navbar-expand-lg">
|
||||
<div class="container">
|
||||
<a class="navbar-brand d-flex align-items-center text-dark" href="#">
|
||||
<img src="/IMPORTADORES/public/<?= htmlspecialchars($logo) ?>" alt="Logo" class="logo-siih">
|
||||
| Registro de Importador
|
||||
<a class="navbar-brand" href="/IMPORTADORES/">
|
||||
<i class="fas fa-shipping-fast me-2"></i><?= htmlspecialchars($siglas) ?>
|
||||
</a>
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav">
|
||||
<span class="navbar-toggler-icon"></span>
|
||||
@@ -72,166 +326,242 @@ $color2 = explode(',', $config['colores_primarios'] ?? '#003366,#0055A5')
|
||||
<a class="nav-link active" aria-current="page" href="/IMPORTADORES/registro">Registro</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="/IMPORTADORES/login">Inicio sesión</a>
|
||||
<a class="nav-link" href="/IMPORTADORES/login">Iniciar Sesión</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
<!-- Contenedor de formularios -->
|
||||
<div class="container">
|
||||
<!-- CONTENEDOR PRINCIPAL -->
|
||||
<div class="registration-container">
|
||||
<div class="page-header">
|
||||
<h1 class="page-title">Únete a Nuestra Plataforma</h1>
|
||||
<p class="page-subtitle">Registra tu empresa o agencia aduanal para comenzar a gestionar importaciones</p>
|
||||
</div>
|
||||
|
||||
<div class="card-form">
|
||||
<!-- Botón para alternar entre formularios -->
|
||||
<!-- SELECTOR DE TIPO DE REGISTRO -->
|
||||
<div class="form-toggle">
|
||||
<button type="button" class="btn btn-white" id="btnToggle" onclick="alternarFormulario()">🔄 Registro de Agencia Aduanal</button>
|
||||
<button type="button" class="toggle-btn active" id="btnImportador" onclick="mostrarFormulario('importador')">
|
||||
<i class="fas fa-building me-2"></i>Importador
|
||||
</button>
|
||||
<button type="button" class="toggle-btn" id="btnAgencia" onclick="mostrarFormulario('agencia')">
|
||||
<i class="fas fa-handshake me-2"></i>Agencia Aduanal
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<!-- Formulario de Importador -->
|
||||
<div id="formImportadorContainer" class="form-container active transition-fade">
|
||||
<h3 class="form-title">Registro de Importador</h3>
|
||||
<!-- FORMULARIO DE IMPORTADOR -->
|
||||
<div id="formImportadorContainer" class="form-container active">
|
||||
<h3 class="form-section-title">Registro de Importador</h3>
|
||||
<form action="/IMPORTADORES/registro/enviarSoliImportador" method="POST" enctype="multipart/form-data" id="formRegistro">
|
||||
<div class="row g-3">
|
||||
<div class="row g-4">
|
||||
<div class="col-md-6">
|
||||
<label for="company_name" class="form-label">Nombre de la empresa *</label>
|
||||
<input type="text" class="form-control" name="company_name" id="company_name" required>
|
||||
<label for="company_name" class="form-label">
|
||||
<i class="fas fa-building text-muted me-2"></i>Nombre de la empresa *
|
||||
</label>
|
||||
<input type="text" class="form-control" name="company_name" id="company_name" placeholder="Ingresa el nombre de tu empresa" required>
|
||||
</div>
|
||||
|
||||
<div class="col-md-6">
|
||||
<label for="rfc" class="form-label">RFC *</label>
|
||||
<input type="text" class="form-control" name="rfc" maxlength="13" id="rfc" required>
|
||||
<label for="rfc" class="form-label">
|
||||
<i class="fas fa-id-card text-muted me-2"></i>RFC *
|
||||
</label>
|
||||
<input type="text" class="form-control" name="rfc" maxlength="13" id="rfc" placeholder="RFC de la empresa" required>
|
||||
</div>
|
||||
|
||||
<div class="col-md-6">
|
||||
<label for="email" class="form-label">Correo electrónico *</label>
|
||||
<input type="email" class="form-control" name="email" id="email" required>
|
||||
<label for="email" class="form-label">
|
||||
<i class="fas fa-envelope text-muted me-2"></i>Correo electrónico *
|
||||
</label>
|
||||
<input type="email" class="form-control" name="email" id="email" placeholder="correo@empresa.com" required>
|
||||
</div>
|
||||
|
||||
<div class="col-md-6">
|
||||
<label for="phone" class="form-label">Teléfono *</label>
|
||||
<input type="text" class="form-control" name="phone" id="phone" required>
|
||||
<label for="phone" class="form-label">
|
||||
<i class="fas fa-phone text-muted me-2"></i>Teléfono *
|
||||
</label>
|
||||
<input type="text" class="form-control" name="phone" id="phone" placeholder="123 4567890" required>
|
||||
</div>
|
||||
|
||||
<div class="col-md-12">
|
||||
<label for="opinion_file_importador" class="form-label">Padrón de importadores o encargo conferido (PDF) *</label>
|
||||
<div class="col-12">
|
||||
<label for="opinion_file_importador" class="form-label">
|
||||
<i class="fas fa-file-pdf text-muted me-2"></i>Padrón de Importadores o Encargo Conferido (PDF) *
|
||||
</label>
|
||||
<input type="file" class="form-control" name="opinion_file" id="opinion_file_importador" accept=".pdf" required>
|
||||
<div class="form-text">Sube tu documento oficial que acredite tu actividad como importador.</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-12 text-center recaptcha">
|
||||
<div class="col-12 recaptcha">
|
||||
<div class="g-recaptcha" id="recaptcha-importador" data-sitekey="6LfkMB8rAAAAAH-BEC1cMYij1HEhw4sTaEOl-UCA"></div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-12 text-end mt-4">
|
||||
<button type="submit" class="btn btn-primary px-4 py-2">Enviar solicitud</button>
|
||||
<div class="col-12 text-center">
|
||||
<button type="submit" class="btn-modern btn-primary-modern">
|
||||
<i class="fas fa-paper-plane me-2"></i>
|
||||
Enviar Solicitud
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<!-- Formulario de Agencia Aduanal -->
|
||||
<div id="formAgenciaContainer" class="form-container transition-fade">
|
||||
<h3 class="form-title">Registro de Agencia Aduanal</h3>
|
||||
<!-- FORMULARIO DE AGENCIA ADUANAL -->
|
||||
<div id="formAgenciaContainer" class="form-container">
|
||||
<h3 class="form-section-title">Registro de Agencia Aduanal</h3>
|
||||
<form action="/IMPORTADORES/registro/enviarSoliAgencia" method="POST" enctype="multipart/form-data" id="formRegistroAgencia">
|
||||
<div class="row g-3">
|
||||
<div class="col-md-6">
|
||||
<label for="nombre_agencia" class="form-label">Nombre de la agencia *</label>
|
||||
<input type="text" class="form-control" name="nombre_agencia" id="nombre_agencia" required>
|
||||
<div class="row g-4">
|
||||
<!-- Información de la Agencia -->
|
||||
<div class="col-12">
|
||||
<div class="section-subtitle">
|
||||
<i class="fas fa-handshake text-primary"></i>
|
||||
Información de la Agencia
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-6">
|
||||
<label for="rfc_agencia" class="form-label">RFC *</label>
|
||||
<input type="text" class="form-control" name="rfc_agencia" maxlength="13" id="rfc_agencia" required>
|
||||
<label for="nombre_agencia" class="form-label">
|
||||
<i class="fas fa-building text-muted me-2"></i>Nombre de la agencia *
|
||||
</label>
|
||||
<input type="text" class="form-control" name="nombre_agencia" id="nombre_agencia" placeholder="Nombre de la agencia aduanal" required>
|
||||
</div>
|
||||
|
||||
<div class="col-md-6">
|
||||
<label for="correo" class="form-label">Correo electrónico *</label>
|
||||
<input type="email" class="form-control" name="correo" id="correo" required>
|
||||
<label for="rfc_agencia" class="form-label">
|
||||
<i class="fas fa-id-card text-muted me-2"></i>RFC *
|
||||
</label>
|
||||
<input type="text" class="form-control" name="rfc_agencia" maxlength="13" id="rfc_agencia" placeholder="RFC de la agencia" required>
|
||||
</div>
|
||||
|
||||
<div class="col-md-6">
|
||||
<label for="telefono" class="form-label">Teléfono *</label>
|
||||
<input type="text" class="form-control" name="telefono" maxlength="11" id="telefono" required>
|
||||
<label for="correo" class="form-label">
|
||||
<i class="fas fa-envelope text-muted me-2"></i>Correo electrónico *
|
||||
</label>
|
||||
<input type="email" class="form-control" name="correo" id="correo" placeholder="contacto@agencia.com" required>
|
||||
</div>
|
||||
<div class="col-md-12">
|
||||
<label for="direccion" class="form-label">Dirección *</label>
|
||||
|
||||
<div class="col-md-6">
|
||||
<label for="telefono" class="form-label">
|
||||
<i class="fas fa-phone text-muted me-2"></i>Teléfono *
|
||||
</label>
|
||||
<input type="text" class="form-control" name="telefono" maxlength="11" id="telefono" placeholder="123 4567890" required>
|
||||
</div>
|
||||
|
||||
<div class="col-12">
|
||||
<label for="direccion" class="form-label">
|
||||
<i class="fas fa-map-marker-alt text-muted me-2"></i>Dirección completa *
|
||||
</label>
|
||||
<input type="text" class="form-control" name="direccion" id="direccion"
|
||||
placeholder="Ej: Calle, num.externo, num.interno, colonia, municipio, código postal, estado" required>
|
||||
placeholder="Calle, num.externo, num.interno, colonia, municipio, código postal, estado" required>
|
||||
</div>
|
||||
<div class="col-md-12">
|
||||
<label for="opinion_file_agencia" class="form-label">Padrón de importadores o encargo conferido (PDF) *</label>
|
||||
|
||||
<div class="col-12">
|
||||
<label for="opinion_file_agencia" class="form-label">
|
||||
<i class="fas fa-file-pdf text-muted me-2"></i>Padrón de Importadores o Encargo Conferido (PDF) *
|
||||
</label>
|
||||
<input type="file" class="form-control" name="opinion_file" id="opinion_file_agencia" accept=".pdf" required>
|
||||
</div>
|
||||
<hr>
|
||||
<p><strong>Administrador de la Agencia</strong></p>
|
||||
<div class="col-md-6">
|
||||
<label for="nombre_admin" class="form-label">Nombre *</label>
|
||||
<input type="text" class="form-control" name="nombre_admin" id="nombre_admin" required>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<label for="correo_admin" class="form-label">Correo Administrador *</label>
|
||||
<input type="email" class="form-control" name="correo_admin" id="correo_admin" required>
|
||||
|
||||
<hr class="section-divider">
|
||||
|
||||
<!-- Información del Administrador -->
|
||||
<div class="col-12">
|
||||
<div class="section-subtitle">
|
||||
<i class="fas fa-user-tie text-primary"></i>
|
||||
Administrador de la Agencia
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-12 text-center recaptcha">
|
||||
<div class="col-md-6">
|
||||
<label for="nombre_admin" class="form-label">
|
||||
<i class="fas fa-user text-muted me-2"></i>Nombre completo *
|
||||
</label>
|
||||
<input type="text" class="form-control" name="nombre_admin" id="nombre_admin" placeholder="Nombre del administrador" required>
|
||||
</div>
|
||||
|
||||
<div class="col-md-6">
|
||||
<label for="correo_admin" class="form-label">
|
||||
<i class="fas fa-envelope text-muted me-2"></i>Correo del administrador *
|
||||
</label>
|
||||
<input type="email" class="form-control" name="correo_admin" id="correo_admin" placeholder="admin@agencia.com" required>
|
||||
</div>
|
||||
|
||||
<div class="col-12 recaptcha">
|
||||
<div class="g-recaptcha" id="recaptcha-agencia" data-sitekey="6LfkMB8rAAAAAH-BEC1cMYij1HEhw4sTaEOl-UCA"></div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-12 text-end mt-4">
|
||||
<button type="submit" class="btn btn-primary px-4 py-2">Enviar solicitud</button>
|
||||
<div class="col-12 text-center">
|
||||
<button type="submit" class="btn-modern btn-primary-modern">
|
||||
<i class="fas fa-paper-plane me-2"></i>
|
||||
Enviar Solicitud
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="container mb-4">
|
||||
<div class="alert alert-warning" role="alert">
|
||||
Una vez que envíes tu solicitud, será revisada manualmente por la agencia aduanal.
|
||||
Recibirás una notificación por correo electrónico cuando tu registro sea aprobado, junto con las instrucciones para activar tu cuenta e iniciar sesión en la plataforma.
|
||||
<!-- INFORMACIÓN ADICIONAL -->
|
||||
<div class="info-alert">
|
||||
<div class="d-flex align-items-start">
|
||||
<i class="fas fa-info-circle alert-icon"></i>
|
||||
<div>
|
||||
<strong>Proceso de Aprobación</strong><br>
|
||||
Una vez enviada tu solicitud, será revisada manualmente por nuestro equipo.
|
||||
Recibirás una notificación por correo electrónico cuando tu registro sea aprobado,
|
||||
junto con las instrucciones para activar tu cuenta e iniciar sesión en la plataforma.
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- FOOTER -->
|
||||
<footer class="fixed-bottom text-center py-3">
|
||||
© <?= date('Y') ?> <?= htmlspecialchars($siglas) ?> · <?= htmlspecialchars($nombre) ?>
|
||||
<footer>
|
||||
<div class="container text-center">
|
||||
<div class="footer-text">
|
||||
© <?= date('Y') ?> <?= htmlspecialchars($siglas) ?> - <?= htmlspecialchars($nombre) ?><br>
|
||||
Optimizando el comercio internacional
|
||||
</div>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
<!-- Validación JS -->
|
||||
<!-- SCRIPTS -->
|
||||
<script>
|
||||
let formularioActual = 'importador';
|
||||
|
||||
function alternarFormulario() {
|
||||
function mostrarFormulario(tipo) {
|
||||
const formImportador = document.getElementById('formImportadorContainer');
|
||||
const formAgencia = document.getElementById('formAgenciaContainer');
|
||||
const btnToggle = document.getElementById('btnToggle');
|
||||
const btnImportador = document.getElementById('btnImportador');
|
||||
const btnAgencia = document.getElementById('btnAgencia');
|
||||
|
||||
if (formularioActual === 'importador') {
|
||||
// Cambiar a formulario de agencia
|
||||
formImportador.classList.remove('active');
|
||||
formAgencia.classList.add('active');
|
||||
btnToggle.textContent = '🔄 Registro de Importador';
|
||||
formularioActual = 'agencia';
|
||||
} else {
|
||||
// Cambiar a formulario de importador
|
||||
formAgencia.classList.remove('active');
|
||||
// Resetear clases
|
||||
formImportador.classList.remove('active');
|
||||
formAgencia.classList.remove('active');
|
||||
btnImportador.classList.remove('active');
|
||||
btnAgencia.classList.remove('active');
|
||||
|
||||
if (tipo === 'importador') {
|
||||
formImportador.classList.add('active');
|
||||
btnToggle.textContent = '🔄 Registro de Agencia Aduanal';
|
||||
formularioActual = 'importador';
|
||||
btnImportador.classList.add('active');
|
||||
formularioActual = 'importador';
|
||||
} else {
|
||||
formAgencia.classList.add('active');
|
||||
btnAgencia.classList.add('active');
|
||||
formularioActual = 'agencia';
|
||||
}
|
||||
|
||||
// Resetear reCAPTCHA si está disponible
|
||||
// Resetear reCAPTCHA
|
||||
if (typeof grecaptcha !== 'undefined') {
|
||||
try{
|
||||
grecaptcha.reset(0); // Reset primer reCAPTCHA
|
||||
grecaptcha.reset(1); // Reset primer reCAPTCHA
|
||||
grecaptcha.reset(0);
|
||||
grecaptcha.reset(1);
|
||||
} catch (e) {
|
||||
console.log('Error resetting reCAPTCHA:', e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Función para obtener la respuesta del reCAPTCHA activo
|
||||
function getActiveRecaptchaResponse() {
|
||||
if (typeof grecaptcha !== 'undefined') {
|
||||
try {
|
||||
@@ -248,14 +578,7 @@ $color2 = explode(',', $config['colores_primarios'] ?? '#003366,#0055A5')
|
||||
return '';
|
||||
}
|
||||
|
||||
// Inicializar al cargar la página
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
// Por defecto mostrar el formulario de importador
|
||||
const formImportador = document.getElementById('formImportadorContainer');
|
||||
formImportador.classList.add('active');
|
||||
});
|
||||
|
||||
// Registro de Importador
|
||||
// Validación para formulario de importador
|
||||
document.getElementById('formRegistro').addEventListener('submit', function(e) {
|
||||
e.preventDefault();
|
||||
|
||||
@@ -271,65 +594,75 @@ $color2 = explode(',', $config['colores_primarios'] ?? '#003366,#0055A5')
|
||||
const rfcRegex = /^[A-ZÑ&]{3,4}\d{6}[A-Z0-9]{3}$/;
|
||||
const phoneRegex = /^\d{3}\s\d{7}$/;
|
||||
|
||||
// Validación de nombre
|
||||
// Validaciones
|
||||
if (!nombre) {
|
||||
Swal.fire({ icon: 'warning', title: 'Campo requerido', text: 'El nombre es obligatorio.', confirmButtonColor: '#dc3545' });
|
||||
Swal.fire({
|
||||
icon: 'warning',
|
||||
title: 'Campo requerido',
|
||||
text: 'El nombre de la empresa es obligatorio.',
|
||||
confirmButtonColor: '#10b981'
|
||||
});
|
||||
document.getElementById('company_name').focus();
|
||||
return;
|
||||
}
|
||||
// Validación de correo
|
||||
if (!email) {
|
||||
Swal.fire({ icon: 'warning', title: 'Campo requerido', text: 'El correo es obligatorio.', confirmButtonColor: '#dc3545' });
|
||||
|
||||
if (!email || !emailRegex.test(email)) {
|
||||
Swal.fire({
|
||||
icon: 'error',
|
||||
title: 'Correo inválido',
|
||||
text: 'Ingresa una dirección de correo válida.',
|
||||
confirmButtonColor: '#10b981'
|
||||
});
|
||||
document.getElementById('email').focus();
|
||||
return;
|
||||
}
|
||||
if (!emailRegex.test(email)) {
|
||||
Swal.fire({ icon: 'error', title: 'Correo inválido', text: 'No es una dirección de correo válida.', confirmButtonColor: '#dc3545' });
|
||||
document.getElementById('email').focus();
|
||||
return;
|
||||
}
|
||||
// Validación de RFC
|
||||
if (!rfc) {
|
||||
Swal.fire({ icon: 'warning', title: 'Campo requerido', text: 'El RFC es obligatorio.', confirmButtonColor: '#dc3545' });
|
||||
|
||||
if (!rfc || !rfcRegex.test(rfc)) {
|
||||
Swal.fire({
|
||||
icon: 'error',
|
||||
title: 'RFC inválido',
|
||||
text: 'El RFC debe tener el formato correcto (ej. ABC123456XYZ).',
|
||||
confirmButtonColor: '#10b981'
|
||||
});
|
||||
document.getElementById('rfc').focus();
|
||||
return;
|
||||
}
|
||||
if (!rfcRegex.test(rfc)) {
|
||||
Swal.fire({ icon: 'error', title: 'RFC inválido', text: 'El RFC debe tener 12 o 13 caracteres con el formato correcto (ej. ABC123456XYZ).', confirmButtonColor: '#dc3545' });
|
||||
document.getElementById('rfc').focus();
|
||||
return;
|
||||
}
|
||||
// Validación de teléfono
|
||||
if (!phone) {
|
||||
Swal.fire({ icon: 'warning', title: 'Campo requerido', text: 'El teléfono es obligatorio.', confirmButtonColor: '#dc3545' });
|
||||
|
||||
if (!phone || !phoneRegex.test(phone)) {
|
||||
Swal.fire({
|
||||
icon: 'error',
|
||||
title: 'Teléfono inválido',
|
||||
text: 'Formato: 3 dígitos (LADA), espacio, y 7 dígitos. Ejemplo: 123 4567890',
|
||||
confirmButtonColor: '#10b981'
|
||||
});
|
||||
document.getElementById('phone').focus();
|
||||
return;
|
||||
}
|
||||
if (!phoneRegex.test(phone)) {
|
||||
Swal.fire({ icon: 'error', title: 'Teléfono inválido', text: 'Debe tener 10 dígitos en el formato: 3 dígitos (LADA), espacio, y 7 dígitos. Ejemplo: 123 4567890', confirmButtonColor: '#dc3545' });
|
||||
document.getElementById('phone').focus();
|
||||
|
||||
if (!archivo || archivo.type !== 'application/pdf') {
|
||||
Swal.fire({
|
||||
icon: 'error',
|
||||
title: 'Archivo requerido',
|
||||
text: 'Sube el padrón de importadores en formato PDF.',
|
||||
confirmButtonColor: '#10b981'
|
||||
});
|
||||
return;
|
||||
}
|
||||
// Validación de archivo PDF
|
||||
if (!archivo) {
|
||||
Swal.fire({ icon: 'warning', title: 'Campo requerido', text: 'El padrón de importadores es obligatorio.', confirmButtonColor: '#dc3545' });
|
||||
document.getElementById('opinion_file_importador').focus();
|
||||
|
||||
if (!recaptcha || recaptcha.length === 0) {
|
||||
Swal.fire({
|
||||
icon: 'warning',
|
||||
title: 'Verificación requerida',
|
||||
text: 'Por favor completa la verificación reCAPTCHA.',
|
||||
confirmButtonColor: '#10b981'
|
||||
});
|
||||
return;
|
||||
}
|
||||
if (!archivo || archivo.type !== 'application/pdf') {
|
||||
Swal.fire({ icon: 'error', title: 'Formato de documento inválido', text: 'Solo se permite subir archivos PDF.', confirmButtonColor: '#dc3545' });
|
||||
return;
|
||||
}
|
||||
// Validación de reCAPTCHA
|
||||
if (!recaptcha || recaptcha.length === 0) {
|
||||
Swal.fire({ icon: 'warning', title: 'Verificación requerida', text: 'Por favor completa el reCAPTCHA.', confirmButtonColor: '#dc3545' });
|
||||
return;
|
||||
}
|
||||
// Si todas las validaciones pasan, el formulario se envía.
|
||||
|
||||
this.submit();
|
||||
});
|
||||
|
||||
// Registro de Agencia
|
||||
// Validación para formulario de agencia
|
||||
document.getElementById('formRegistroAgencia').addEventListener('submit', function(e) {
|
||||
e.preventDefault();
|
||||
|
||||
@@ -343,88 +676,71 @@ $color2 = explode(',', $config['colores_primarios'] ?? '#003366,#0055A5')
|
||||
const correo_admin = document.getElementById('correo_admin').value.trim();
|
||||
const recaptcha = getActiveRecaptchaResponse();
|
||||
|
||||
// Expresiones regulares
|
||||
const correoRegex = /^[a-zA-Z0-9._+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/;
|
||||
const rfcRegex = /^[A-ZÑ&]{3,4}\d{6}[A-Z0-9]{3}$/;
|
||||
const telefonoRegex = /^\d{3}\s\d{7}$/;
|
||||
|
||||
// Validación de nombre
|
||||
if (!nombre) {
|
||||
Swal.fire({ icon: 'warning', title: 'Campo requerido', text: 'El nombre es obligatorio.', confirmButtonColor: '#dc3545' });
|
||||
document.getElementById('nombre_agencia').focus();
|
||||
// Validaciones básicas
|
||||
if (!nombre || !correo || !rfc_agencia || !telefono || !direccion || !nombre_admin || !correo_admin) {
|
||||
Swal.fire({
|
||||
icon: 'warning',
|
||||
title: 'Campos incompletos',
|
||||
text: 'Todos los campos son obligatorios.',
|
||||
confirmButtonColor: '#10b981'
|
||||
});
|
||||
return;
|
||||
}
|
||||
// Validación de correo
|
||||
if (!correo) {
|
||||
Swal.fire({ icon: 'warning', title: 'Campo requerido', text: 'El correo es obligatorio.', confirmButtonColor: '#dc3545' });
|
||||
document.getElementById('correo').focus();
|
||||
return;
|
||||
}
|
||||
if (!correoRegex.test(correo)) {
|
||||
Swal.fire({ icon: 'error', title: 'Correo inválido', text: 'No es una dirección de correo válida.', confirmButtonColor: '#dc3545' });
|
||||
document.getElementById('correo').focus();
|
||||
return;
|
||||
}
|
||||
// Validación de RFC
|
||||
if (!rfc_agencia) {
|
||||
Swal.fire({ icon: 'warning', title: 'Campo requerido', text: 'El RFC es obligatorio.', confirmButtonColor: '#dc3545' });
|
||||
document.getElementById('rfc_agencia').focus();
|
||||
|
||||
if (!correoRegex.test(correo) || !correoRegex.test(correo_admin)) {
|
||||
Swal.fire({
|
||||
icon: 'error',
|
||||
title: 'Correos inválidos',
|
||||
text: 'Verifica que los correos tengan formato válido.',
|
||||
confirmButtonColor: '#10b981'
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
if (!rfcRegex.test(rfc_agencia)) {
|
||||
Swal.fire({ icon: 'error', title: 'RFC inválido', text: 'El RFC debe tener 12 o 13 caracteres con el formato correcto (ej. ABC123456XYZ).', confirmButtonColor: '#dc3545' });
|
||||
document.getElementById('rfc_agencia').focus();
|
||||
return;
|
||||
}
|
||||
// Validación de teléfono
|
||||
if (!telefono) {
|
||||
Swal.fire({ icon: 'warning', title: 'Campo requerido', text: 'El teléfono es obligatorio.', confirmButtonColor: '#dc3545' });
|
||||
document.getElementById('telefono').focus();
|
||||
Swal.fire({
|
||||
icon: 'error',
|
||||
title: 'RFC inválido',
|
||||
text: 'El RFC debe tener el formato correcto.',
|
||||
confirmButtonColor: '#10b981'
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
if (!telefonoRegex.test(telefono)) {
|
||||
Swal.fire({ icon: 'error', title: 'Teléfono inválido', text: 'Debe tener 10 dígitos en el formato: 3 dígitos (LADA), espacio, y 7 dígitos (ej. 123 4567890).', confirmButtonColor: '#dc3545' });
|
||||
document.getElementById('telefono').focus();
|
||||
Swal.fire({
|
||||
icon: 'error',
|
||||
title: 'Teléfono inválido',
|
||||
text: 'Formato: 3 dígitos (LADA), espacio, y 7 dígitos.',
|
||||
confirmButtonColor: '#10b981'
|
||||
});
|
||||
return;
|
||||
}
|
||||
// Validación de dirección
|
||||
if (!direccion) {
|
||||
Swal.fire({ icon: 'warning', title: 'Campo requerido', text: 'La dirección es obligatoria.', confirmButtonColor: '#dc3545' });
|
||||
document.getElementById('direccion').focus();
|
||||
|
||||
if (!archivo || archivo.type !== 'application/pdf') {
|
||||
Swal.fire({
|
||||
icon: 'error',
|
||||
title: 'Archivo requerido',
|
||||
text: 'Sube el documento en formato PDF.',
|
||||
confirmButtonColor: '#10b981'
|
||||
});
|
||||
return;
|
||||
}
|
||||
// Validación de archivo PDF
|
||||
if (!archivo) {
|
||||
Swal.fire({ icon: 'warning', title: 'Campo requerido', text: 'El padrón de importadores es obligatorio.', confirmButtonColor: '#dc3545' });
|
||||
document.getElementById('opinion_file_agencia').focus();
|
||||
|
||||
if (!recaptcha || recaptcha.length === 0) {
|
||||
Swal.fire({
|
||||
icon: 'warning',
|
||||
title: 'Verificación requerida',
|
||||
text: 'Por favor completa la verificación reCAPTCHA.',
|
||||
confirmButtonColor: '#10b981'
|
||||
});
|
||||
return;
|
||||
}
|
||||
if (!archivo || archivo.type !== 'application/pdf') {
|
||||
Swal.fire({ icon: 'error', title: 'Formato de documento inválido', text: 'Solo se permite subir archivos PDF.', confirmButtonColor: '#dc3545' });
|
||||
return; }
|
||||
// Validación de administrador
|
||||
if (!nombre_admin) {
|
||||
Swal.fire({ icon: 'warning', title: 'Campo requerido', text: 'El nombre del administrador es obligatorio.', confirmButtonColor: '#dc3545' });
|
||||
document.getElementById('nombre_admin').focus();
|
||||
return;
|
||||
}
|
||||
// Validación de correo de administrador
|
||||
if (!correo_admin) {
|
||||
Swal.fire({ icon: 'warning', title: 'Campo requerido', text: 'El correo de administrador es obligatorio.', confirmButtonColor: '#dc3545' });
|
||||
document.getElementById('correo_admin').focus();
|
||||
return;
|
||||
}
|
||||
if (!correoRegex.test(correo_admin)) {
|
||||
Swal.fire({ icon: 'error', title: 'Correo inválido', text: 'No es una dirección de correo válida.', confirmButtonColor: '#dc3545' });
|
||||
document.getElementById('correo_admin').focus();
|
||||
return;
|
||||
}
|
||||
// Validación de reCAPTCHA
|
||||
if (!recaptcha || recaptcha.length === 0) {
|
||||
Swal.fire({ icon: 'warning', title: 'Verificación requerida', text: 'Por favor completa el reCAPTCHA.', confirmButtonColor: '#dc3545' });
|
||||
return;
|
||||
}
|
||||
// Si todas las validaciones pasan, el formulario se envía.
|
||||
|
||||
this.submit();
|
||||
});
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user