Vista información general
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
<?php
|
||||
|
||||
session_start();
|
||||
require_once __DIR__ . '/../../vendor/autoload.php';
|
||||
|
||||
@@ -9,13 +8,11 @@ require_once __DIR__ . '/../helpers/crypto.php';
|
||||
require_once __DIR__ . '/../helpers/bitacoras.php';
|
||||
require_once __DIR__ . '/../helpers/env.php';
|
||||
|
||||
|
||||
use PHPMailer\PHPMailer\PHPMailer;
|
||||
use PHPMailer\PHPMailer\Exception;
|
||||
|
||||
loadEnv();
|
||||
|
||||
|
||||
function dashboard() {
|
||||
if (!isset($_SESSION['usuario_id']) || $_SESSION['tipo_usuario'] !== 'agente_aduanal') {
|
||||
header("Location: /IMPORTADORES/login");
|
||||
@@ -31,8 +28,6 @@ function dashboard() {
|
||||
include __DIR__ . '/../../views/agentes/dashboard.php';
|
||||
}
|
||||
|
||||
|
||||
|
||||
function importadores_activos() {
|
||||
if (!($_SESSION['usuario_id'] ?? false) || $_SESSION['tipo_usuario'] !== 'agente_aduanal') {
|
||||
header('Location: /IMPORTADORES/login');
|
||||
@@ -55,7 +50,6 @@ function importadores_activos() {
|
||||
include __DIR__ . '/../../views/agentes/importadores_activos.php';
|
||||
}
|
||||
|
||||
|
||||
function solicitudes_pendientes() {
|
||||
if (!($_SESSION['usuario_id'] ?? false) || $_SESSION['tipo_usuario'] !== 'agente_aduanal') {
|
||||
header('Location: /IMPORTADORES/login');
|
||||
@@ -79,12 +73,8 @@ function solicitudes_pendientes() {
|
||||
include __DIR__ . '/../../views/agentes/solicitudes_pendientes.php';
|
||||
}
|
||||
|
||||
|
||||
function aprobar_solicitud()
|
||||
{
|
||||
|
||||
|
||||
|
||||
$conn = getConnection();
|
||||
$id = $_GET['id'] ?? null;
|
||||
|
||||
@@ -129,7 +119,7 @@ function aprobar_solicitud()
|
||||
if (!$stmtInsert) {
|
||||
die("❌ Error al crear usuario: " . print_r(sqlsrv_errors(), true));
|
||||
}
|
||||
|
||||
|
||||
// Actualizar solicitud
|
||||
$sqlUpdate = "UPDATE solicitudes_importadores
|
||||
SET request_status = 'approved', approval_date = GETDATE(), approved_by = ?
|
||||
@@ -185,7 +175,6 @@ function aprobar_solicitud()
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
function activos() {
|
||||
|
||||
if (!($_SESSION['usuario_id'] ?? false)) {
|
||||
@@ -214,7 +203,6 @@ function activos() {
|
||||
include __DIR__ . '/../../views/agentes/importadores_activos.php';
|
||||
}
|
||||
|
||||
|
||||
function toggle_estado() {
|
||||
|
||||
|
||||
@@ -252,6 +240,4 @@ function toggle_estado() {
|
||||
|
||||
header("Location: /IMPORTADORES/agentes/activos");
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user