104 lines
6.4 KiB
PHP
104 lines
6.4 KiB
PHP
<?php
|
|
require_once 'auth.php';
|
|
$currentPage = basename($_SERVER['PHP_SELF']);
|
|
?>
|
|
<!DOCTYPE html>
|
|
<html lang="es">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>Consultoría Jurídica - Gestión de Documentos</title>
|
|
<script src="https://cdn.tailwindcss.com"></script>
|
|
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap" rel="stylesheet">
|
|
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
|
|
<link rel="stylesheet" href="public/css/style.css">
|
|
<script>
|
|
tailwind.config = {
|
|
theme: {
|
|
extend: {
|
|
fontFamily: {
|
|
sans: ['Inter', 'sans-serif'],
|
|
},
|
|
colors: {
|
|
'primary': '#0f172a', // Slate 900 (más sobrio, elegante)
|
|
'secondary': '#f1f5f9',
|
|
'accent': '#c2410c', // Naranja oscuro/óxido
|
|
}
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
</head>
|
|
<body class="bg-slate-50 text-slate-800 font-sans antialiased flex h-screen overflow-hidden">
|
|
|
|
<!-- Sidebar -->
|
|
<aside class="w-72 bg-primary text-white flex flex-col hidden md:flex shadow-2xl z-20 transition-all duration-300">
|
|
<div class="p-8 flex flex-col items-center justify-center border-b border-slate-800 relative overflow-hidden">
|
|
<div class="absolute inset-0 opacity-10 bg-[url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI4IiBoZWlnaHQ9IjgiPgo8cmVjdCB3aWR0aD0iOCIgaGVpZ2h0PSI4IiBmaWxsPSIjZmZmIiBmaWxsLW9wYWNpdHk9IjAuMSIvPgo8cGF0aCBkPSJNMCAwTDggOFpNOCAwTDAgOFoiIHN0cm9rZT0iIzAwMCIgc3Ryb2tlLW9wYWNpdHk9IjAuMSIvPjwvc3ZnPg==')]"></div>
|
|
<div class="text-center relative z-10">
|
|
<i class="fas fa-balance-scale text-4xl text-accent mb-3 drop-shadow-md"></i>
|
|
<h1 class="text-xl font-bold tracking-widest text-slate-100">DIRECCIÓN DE</h1>
|
|
<p class="text-sm text-slate-400 font-medium uppercase tracking-[0.2em] mt-1">Consultoría Jurídica</p>
|
|
</div>
|
|
</div>
|
|
|
|
<nav class="flex-1 px-4 py-6 space-y-2 overflow-y-auto custom-scrollbar">
|
|
<a href="dashboard.php" class="flex items-center gap-4 px-4 py-3.5 rounded-xl transition-all duration-200 <?= $currentPage === 'dashboard.php' ? 'bg-slate-800 text-white shadow-md' : 'text-slate-300 hover:bg-slate-800/50 hover:text-white' ?>">
|
|
<i class="fas fa-chart-pie w-5 text-center <?= $currentPage === 'dashboard.php' ? 'text-accent' : '' ?>"></i>
|
|
<span class="font-medium text-sm tracking-wide">Panel de Control</span>
|
|
</a>
|
|
<a href="documents.php" class="flex items-center gap-4 px-4 py-3.5 rounded-xl transition-all duration-200 <?= $currentPage === 'documents.php' ? 'bg-slate-800 text-white shadow-md' : 'text-slate-300 hover:bg-slate-800/50 hover:text-white' ?>">
|
|
<i class="fas fa-folder-open w-5 text-center <?= $currentPage === 'documents.php' ? 'text-accent' : '' ?>"></i>
|
|
<span class="font-medium text-sm tracking-wide">Archivos y Expedientes</span>
|
|
</a>
|
|
|
|
<?php if(hasRole(['superadmin', 'admin', 'supervisor'])): ?>
|
|
<a href="document_add.php" class="flex items-center gap-4 px-4 py-3.5 rounded-xl transition-all duration-200 <?= $currentPage === 'document_add.php' ? 'bg-slate-800 text-white shadow-md' : 'text-slate-300 hover:bg-slate-800/50 hover:text-white' ?>">
|
|
<i class="fas fa-file-signature w-5 text-center <?= $currentPage === 'document_add.php' ? 'text-accent' : '' ?>"></i>
|
|
<span class="font-medium text-sm tracking-wide">Registrar Documento</span>
|
|
</a>
|
|
<?php endif; ?>
|
|
|
|
<?php if(hasRole(['superadmin', 'admin'])): ?>
|
|
<div class="pt-6 mt-6 border-t border-slate-800">
|
|
<p class="px-4 text-xs font-bold text-slate-500 uppercase tracking-widest mb-3">Administración</p>
|
|
<a href="users.php" class="flex items-center gap-4 px-4 py-3.5 rounded-xl transition-all duration-200 <?= $currentPage === 'users.php' ? 'bg-slate-800 text-white shadow-md' : 'text-slate-300 hover:bg-slate-800/50 hover:text-white' ?>">
|
|
<i class="fas fa-users-cog w-5 text-center <?= $currentPage === 'users.php' ? 'text-accent' : '' ?>"></i>
|
|
<span class="font-medium text-sm tracking-wide">Gestión de Usuarios</span>
|
|
</a>
|
|
</div>
|
|
<?php endif; ?>
|
|
</nav>
|
|
|
|
<div class="p-5 border-t border-slate-800 bg-slate-900/50">
|
|
<div class="flex items-center gap-3 mb-4">
|
|
<div class="w-10 h-10 rounded-full bg-slate-800 border border-slate-700 flex items-center justify-center text-accent font-bold shadow-inner">
|
|
<?= strtoupper(substr(getUserName(), 0, 1)) ?>
|
|
</div>
|
|
<div class="flex-1 min-w-0">
|
|
<p class="text-sm font-bold text-slate-200 truncate"><?= htmlspecialchars(getUserName()) ?></p>
|
|
<p class="text-xs text-accent font-medium truncate"><?= getRoleName() ?></p>
|
|
</div>
|
|
</div>
|
|
<a href="logout.php" class="flex items-center justify-center gap-2 w-full py-2.5 bg-slate-800 hover:bg-red-900/80 hover:text-red-100 text-slate-300 border border-slate-700 hover:border-red-800 rounded-lg transition-all duration-300 text-xs font-semibold tracking-wider uppercase">
|
|
<i class="fas fa-sign-out-alt"></i> Cerrar Sesión
|
|
</a>
|
|
</div>
|
|
</aside>
|
|
|
|
<!-- Main Content -->
|
|
<main class="flex-1 flex flex-col h-screen overflow-hidden bg-slate-50 relative">
|
|
<!-- Mobile Header -->
|
|
<header class="md:hidden bg-primary text-white p-4 flex justify-between items-center shadow-md z-10">
|
|
<div class="flex items-center gap-3">
|
|
<i class="fas fa-balance-scale text-accent"></i>
|
|
<span class="font-bold tracking-wider text-sm">DIR. JURÍDICA</span>
|
|
</div>
|
|
<button id="mobile-menu-btn" class="text-slate-300 focus:outline-none">
|
|
<i class="fas fa-bars text-xl"></i>
|
|
</button>
|
|
</header>
|
|
|
|
<!-- Content Area -->
|
|
<div class="flex-1 overflow-y-auto p-4 md:p-8 custom-scrollbar">
|