File "subMenu.php"
Full Path: C:/wamp64/www/sistemas/disponibles/subMenu.php
File size: 8.8 KB
MIME-type: text/x-php
Charset: utf-8
<?php
// Iniciar la sesión (esto es crucial y faltaba)
session_start();
// Verificar si el usuario está autenticado
if (!isset($_SESSION['loggedin']) || $_SESSION['loggedin'] !== true) {
header("Location: ../login.php");
exit();
}
// Datos de Conexion Base de Datos
include("../connection.php");
$con = connection();
?>
<!DOCTYPE html>
<html lang="es">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="author" content="Sebastian Obando">
<meta name="copyright" content="Sebastian Obando">
<title>Menú Inventario Sistemas Avicampo</title>
<link rel="icon" type="image/png" href="../img/icono1.png"><!-- Cambia el icono de los titulos en las pestañas ico 16X16 -->
<style>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: Arial, sans-serif;
background-image: linear-gradient(to right, #FF8626, #025159);
overflow-x: hidden;
position: relative;
min-height: 100vh;
}
.logo {
display: block;
margin: 0 auto 1.5rem;
}
.user-info {
text-align: right;
margin: 10px 20px;
padding: 5px;
background-color: rgba(255, 255, 255, 0.8);
border-radius: 5px;
display: inline-block;
position: absolute;
top: 0;
right: 0;
}
.logout {
margin-left: 10px;
padding: 3px 8px;
background-color: #e74c3c;
color: white;
text-decoration: none;
border-radius: 3px;
font-size: 14px;
}
.logout:hover {
background-color: #c0392b;
}
.GLPI {
margin-left: 10px;
padding: 3px 8px;
background-color: #f1ae27;
color: white;
text-decoration: none;
border-radius: 3px;
font-size: 14px;
}
.GLPI:hover {
background-color: #e3a424;
}
/* Estilos del carrusel de fondo */
.carousel-container {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: -1;
}
.carousel-slide {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
opacity: 0;
transition: opacity 1s ease-in-out;
background-size: cover;
background-position: center;
}
.carousel-slide.active {
opacity: 1;
}
/* Estilos del menú Principal */
.menu-principal {
max-width: 1150px;
margin: 30px auto;
background-color: rgba(255, 255, 255, 0.92);
border-radius: 15px;
box-shadow: 0 0 20px rgba(0, 0, 0, 0.2);
position: relative;
min-height: auto;
padding: 30px 20px;
display: flex;
flex-direction: column;
align-items: center;
border: 3px solid #FF8C00; /* Borde naranja como los botones */
}
/* Estilos del menú */
.menu-container {
display: flex;
justify-content: center;
padding: 20px;
flex-wrap: wrap;
gap: 20px;
margin-top: 30px;
}
.menu-button {
width: 150px;
height: 180px;
border-radius: 15px;
border: 2px solid #FF8C00;
display: flex;
flex-direction: column; /* Organiza el contenido en columna */
align-items: center;
justify-content: space-between; /* Distribuye el espacio entre la imagen y el texto */
color: #000;
font-weight: bold;
text-decoration: none;
position: relative;
cursor: pointer;
transition: transform 0.3s ease;
background-color: white;
padding: 15px 10px; /* Añade espacio interno */
}
.menu-button:hover {
transform: scale(1.05);
}
.button-image {
width: 80px; /* Tamaño fijo para la imagen */
height: 80px;
background-size: contain;
background-position: center;
background-repeat: no-repeat;
margin-bottom: 10px; /* Espacio entre la imagen y el texto */
}
.button-text {
background-color: rgba(255, 255, 255, 0.7);
padding: 5px 10px;
border-radius: 5px;
text-align: center;
font-size: 12px; /* Tamaño de texto más pequeño para que quepa mejor */
}
/* Estilos del footer */
.footer {
position: fixed;
bottom: 20px;
width: 100%;
text-align: center;
}
@font-face {
font-family: 'Gardenia';
src: local('Gardenia Black Italic'), local('Gardenia-Black-Italic'),
url('Gardenia-BlackItalic.woff2') format('woff2'),
url('Gardenia-BlackItalic.woff') format('woff'),
url('Gardenia-BlackItalic.ttf') format('truetype');
font-weight: 900;
font-style: italic;
}
/* Estilo para el título principal */
.main-title {
font-family: 'Gardenia', sans-serif;
font-weight: 900;
font-style: italic;
color: #ff7918;
text-align: center;
font-size: 48px;
margin: 20px 0;
text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
letter-spacing: 2px;
-webkit-text-stroke: 1px #ff7918;
}
.copyright {
display: inline-block;
padding: 8px 20px;
background-color: white;
border: 1px solid #000;
border-radius: 5px;
font-size: 14px;
font-family: 'Gardenia', sans-serif;
font-weight: 900; /* Opcional, según la definición de tu fuente */
font-style: italic; /* Opcional, según la definición de tu fuente */
}
</style>
</head>
<body>
<!-- Menú de botones -->
<img src="../img/sistemas.png" alt="" width="37" height="37" class="logo" style="width: 650px; height: auto; display: block; margin: 0 auto;" />
<div class="menu-principal">
<div class="user-info">
Usuario: <?php echo $_SESSION['nombre']; ?>
<a href="logout.php" class="logout">Cerrar Sesión</a>
<a href="http://192.200.100.56:8950/glpi/index.php?noAUTO=1" class="GLPI">Ir A GLPI Sesión</a>
</div>
<!-- Título principal -->
<h1 class="main-title">Control De Inventario De Equipos</h1>
<br><br>
<div class="menu-container">
<?php
// Configuración de los botones
$buttons = [
['text' => 'NUEVO EQUIPO', 'link' => 'nuevo.php', 'image' => '../img/Nuevo.png'],
['text' => 'DETALLE DE MOVIMIENTO', 'link' => 'disponible.php', 'image' => '../img/disponibles.png'],
['text' => 'DETALLE DE INVENTARIO', 'link' => 'totalDisponible.php', 'image' => '../img/inventario.png'],
['text' => 'BAJA DE ACTIVOS FIJOS', 'link' => '../activosFijos/activo.php', 'image' => '../img/activo.png'],
['text' => 'MENU PRINCIPAL', 'link' => '../index.php', 'image' => '../img/regresar.png']
];
foreach ($buttons as $button) {
echo '<a href="' . $button['link'] . '" class="menu-button">';
// Cambiamos la estructura para usar un div para la imagen en lugar de background-image
echo '<div class="button-image" style="background-image: url(\'' . $button['image'] . '\');"></div>';
echo '<span class="button-text">' . $button['text'] . '</span>';
echo '</a>';
}
?>
</div>
</div> <!-- Cierre del main-content-container -->
<!-- Footer con copyright -->
<div class="footer">
<div class="copyright">
© Avicampo <?php echo date('Y'); ?>
</div>
</div>
<script>
// Script para el carrusel
document.addEventListener('DOMContentLoaded', function() {
const slides = document.querySelectorAll('.carousel-slide');
let currentSlide = 0;
function nextSlide() {
slides[currentSlide].classList.remove('active');
currentSlide = (currentSlide + 1) % slides.length;
slides[currentSlide].classList.add('active');
}
// Cambiar slide cada 5 segundos
setInterval(nextSlide, 5000);
});
</script>
</body>
</html>