intranet-apei/viewAllEvents.php

55 lines
1.8 KiB
PHP
Raw Normal View History

2026-03-10 09:37:35 +00:00
<?php
include("./Assets/functions.php");
$config = json_decode(file_get_contents("./Assets/config.json"), true);
$bdd = connectBDD("localhost", $config["BDD_USER"], $config["BDD_PASSWD"], $config["BDD_NAME"]);
$page = 'photos';
/* Gestion de la connexion */
session_start();
if (!isset($_SESSION['connected']) || $_SESSION['connected'] == false) {
header('location: login.php?redirect_to=photos.php');
}
/* Récupération des évènements */
$evenements = getEvenements($bdd, $_SESSION['site']);
$prefixe = $config['LOCAL_IMG_PREFIXE']
?>
<!doctype html>
<html lang="fr">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Intranet de l'APEI</title>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.8/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-sRIl4kxILFvY47J16cr9ZwB07vP4J8+LH7qKQnuqkuIAvNWLzeN8tE5YBujZqJLB" crossorigin="anonymous">
<link rel="shortcut icon" href="./Assets/Icones/APEIMBGE.jpg" type="image/x-icon">
<link rel="stylesheet" href="./styles-scripts/photos.css">
</head>
<body>
<?php include('./Assets/navbar.php'); ?>
<div class="container mt-4">
<?php foreach ($evenements as $event):
$img = $prefixe . getEventBigImage($bdd, $event['id']);
?>
<a href="event.php?event=<?php echo $event['id']; ?>" class="event-banner-link">
<div class="event-banner" style="background-image: url('<?php echo $img; ?>');">
<div class="event-overlay"></div>
<div class="event-text">
<h2><?php echo $event['titre']; ?></h2>
<p><?php echo $event['date']; ?></p>
</div>
</div>
</a>
<?php endforeach; ?>
</div>
</body>
</html>