159 lines
5.9 KiB
PHP
159 lines
5.9 KiB
PHP
<?php
|
|
session_start();
|
|
$isLoggedIn = !empty($_SESSION['user_id']);
|
|
$userRole = (string) ($_SESSION['user_role'] ?? '');
|
|
$homeUrl = 'pedidos.php';
|
|
$homeLabel = 'Ir a Pedidos';
|
|
if (in_array($userRole, ['Administrador', 'admin'], true)) {
|
|
$homeUrl = 'dashboard.php';
|
|
$homeLabel = 'Ir al dashboard';
|
|
} elseif (strcasecmp(trim($userRole), 'Marketing') === 0) {
|
|
$homeUrl = 'marketing_produccion.php';
|
|
$homeLabel = 'Ir a Producción de Video';
|
|
} elseif (strcasecmp(trim($userRole), 'Asesor') === 0) {
|
|
$homeUrl = 'kanban.php';
|
|
$homeLabel = 'Ir al panel';
|
|
}
|
|
$callCenterParams = [];
|
|
foreach ([
|
|
'callcenter_assessor_filter' => 'assessor',
|
|
'callcenter_store' => 'store',
|
|
'callcenter_view' => 'view',
|
|
] as $sessionKey => $paramKey) {
|
|
if (!empty($_SESSION[$sessionKey])) {
|
|
$callCenterParams[$paramKey] = (string) $_SESSION[$sessionKey];
|
|
}
|
|
}
|
|
if (in_array($userRole, ['Administrador', 'admin'], true)) {
|
|
$callCenterParams['view'] = 'todos';
|
|
}
|
|
$callCenterUrl = 'gestiones_callcenter.php';
|
|
if (!empty($callCenterParams)) {
|
|
$callCenterUrl .= '?' . http_build_query($callCenterParams);
|
|
}
|
|
$pageTitle = 'Inicio | Panel CRM y Administración';
|
|
$pageDescription = 'Entrada rápida al sistema CRM y panel de administración.';
|
|
?>
|
|
<!doctype html>
|
|
<html lang="es">
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
<title><?php echo htmlspecialchars($pageTitle); ?></title>
|
|
<meta name="description" content="<?php echo htmlspecialchars($pageDescription); ?>">
|
|
<style>
|
|
:root {
|
|
--bg: #f6f8fb;
|
|
--card: rgba(255,255,255,.84);
|
|
--text: #102033;
|
|
--muted: #5f6c7b;
|
|
--accent: #2563eb;
|
|
--accent-2: #14b8a6;
|
|
--border: rgba(16,32,51,.10);
|
|
}
|
|
* { box-sizing: border-box; }
|
|
body {
|
|
margin: 0;
|
|
min-height: 100vh;
|
|
font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
|
|
color: var(--text);
|
|
background:
|
|
radial-gradient(circle at top left, rgba(37,99,235,.12), transparent 28%),
|
|
radial-gradient(circle at bottom right, rgba(20,184,166,.12), transparent 24%),
|
|
var(--bg);
|
|
display: grid;
|
|
place-items: center;
|
|
padding: 24px;
|
|
}
|
|
.card {
|
|
width: min(720px, 100%);
|
|
background: var(--card);
|
|
border: 1px solid var(--border);
|
|
border-radius: 28px;
|
|
padding: 40px;
|
|
box-shadow: 0 20px 60px rgba(16,32,51,.10);
|
|
backdrop-filter: blur(14px);
|
|
}
|
|
.eyebrow {
|
|
display: inline-flex;
|
|
align-items: center;
|
|
gap: 8px;
|
|
padding: 8px 14px;
|
|
border-radius: 999px;
|
|
background: rgba(37,99,235,.10);
|
|
color: var(--accent);
|
|
font-size: .9rem;
|
|
font-weight: 700;
|
|
}
|
|
h1 { margin: 18px 0 10px; font-size: clamp(2rem, 4vw, 3.4rem); line-height: 1.05; }
|
|
p { margin: 0; color: var(--muted); font-size: 1.05rem; line-height: 1.6; }
|
|
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
|
|
.btn {
|
|
display: inline-flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
min-height: 48px;
|
|
padding: 0 18px;
|
|
border-radius: 14px;
|
|
text-decoration: none;
|
|
font-weight: 700;
|
|
transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
|
|
}
|
|
.btn:hover { transform: translateY(-1px); }
|
|
.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 12px 24px rgba(37,99,235,.24); }
|
|
.btn-secondary { background: rgba(16,32,51,.05); color: var(--text); }
|
|
.meta {
|
|
margin-top: 26px;
|
|
display: grid;
|
|
grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
|
|
gap: 12px;
|
|
}
|
|
.meta div {
|
|
padding: 14px 16px;
|
|
border-radius: 16px;
|
|
background: rgba(255,255,255,.72);
|
|
border: 1px solid var(--border);
|
|
}
|
|
.meta strong { display: block; margin-bottom: 4px; }
|
|
.footer { margin-top: 24px; font-size: .95rem; color: var(--muted); }
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<main class="card">
|
|
<span class="eyebrow"><?php echo $isLoggedIn ? 'Sesión activa' : 'Acceso al sistema'; ?></span>
|
|
<h1>Panel CRM y Administración</h1>
|
|
<p>
|
|
<?php if ($isLoggedIn): ?>
|
|
Ya tienes una sesión activa. Entra directo al módulo que corresponde a tu rol para continuar con la operación.
|
|
<?php else: ?>
|
|
Accede al sistema para gestionar pedidos, inventario, llamadas y operaciones desde un solo lugar.
|
|
<?php endif; ?>
|
|
</p>
|
|
|
|
<div class="actions">
|
|
<a class="btn btn-primary" href="<?php echo $isLoggedIn ? htmlspecialchars($homeUrl) : 'login.php'; ?>">
|
|
<?php echo $isLoggedIn ? htmlspecialchars($homeLabel) : 'Iniciar sesión'; ?>
|
|
</a>
|
|
<a class="btn btn-secondary" href="<?php echo htmlspecialchars($callCenterUrl); ?>">Abrir Base de Datos Pedidos</a>
|
|
</div>
|
|
|
|
<div class="meta">
|
|
<div>
|
|
<strong>Estado</strong>
|
|
<span><?php echo $isLoggedIn ? 'Sesión autenticada' : 'Sin sesión iniciada'; ?></span>
|
|
</div>
|
|
<div>
|
|
<strong>Zona horaria</strong>
|
|
<span>America/Lima</span>
|
|
</div>
|
|
<div>
|
|
<strong>Versión</strong>
|
|
<span>CRM / Panel de administración</span>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="footer">Si estás comenzando, usa el botón principal para entrar al sistema.</div>
|
|
</main>
|
|
</body>
|
|
</html>
|