intranet-apei/photos.php

89 lines
3.4 KiB
PHP
Raw Permalink Normal View History

2026-02-24 14:26:25 +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"]);
2026-02-26 07:41:16 +00:00
$page = 'photos';
2026-02-24 14:26:25 +00:00
/* Gestion de la connexion */
session_start();
2026-03-10 09:37:35 +00:00
if (!isset($_SESSION['connected']) || $_SESSION['connected'] == false) {
header('location: login.php?redirect_to=photos.php');
2026-02-24 14:26:25 +00:00
}
/* Récupération des évènements */
$permission = $_SESSION["permission"];
if($permission == "toute_lecture" || $permission == "admin"){
$evenements = getEvenements($bdd, $_SESSION['site'], true);
}else{
$evenements = getEvenements($bdd, $_SESSION['site']);
}
$prefixe = $config['LOCAL_IMG_PREFIXE']
2026-02-24 14:26:25 +00:00
?>
<!doctype html>
<html lang="fr">
2026-03-10 09:37:35 +00:00
<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>
2026-02-24 14:26:25 +00:00
2026-03-10 09:37:35 +00:00
<body>
<?php include('./Assets/navbar.php'); ?>
<h3>Évènements de <?= getSiteName($bdd, $_SESSION['site']) ?></h3>
<div class="parent">
<div class="div1">
<?php $debut = str_starts_with($evenements[0]["couverture"], "http") ? '' : $prefixe; ?>
<a href="./event.php?event=<?= $evenements[0]["id"] ?>">
<img src="<?= $debut . $evenements[0]["couverture"] ?>" alt="">
2026-02-24 14:26:25 +00:00
<div class="overlay">
<p><?= $evenements[0]["titre"] ?></p>
</div>
2026-03-10 09:37:35 +00:00
</a>
</div>
<div class="div2">
<?php $debut = str_starts_with($evenements[1]["couverture"], "http") ? '' : $prefixe; ?>
<a href="./event.php?event=<?= $evenements[1]["id"] ?>">
<img src="<?= $debut . $evenements[1]["couverture"] ?>" alt="">
2026-02-24 14:26:25 +00:00
<div class="overlay">
<p><?= $evenements[1]["titre"] ?></p>
</div>
2026-03-10 09:37:35 +00:00
</a>
</div>
<div class="div3">
<?php $debut = str_starts_with($evenements[2]["couverture"], "http") ? '' : $prefixe; ?>
<a href="./event.php?event=<?= $evenements[2]["id"] ?>">
<img src="<?= $debut . $evenements[2]["couverture"] ?>" alt="">
2026-02-24 14:26:25 +00:00
<div class="overlay">
<p><?= $evenements[2]["titre"] ?></p>
</div>
2026-03-10 09:37:35 +00:00
</a>
</div>
<div class="div4">
<?php $debut = str_starts_with($evenements[3]["couverture"], "http") ? '' : $prefixe; ?>
<a href="./event.php?event=<?= $evenements[3]["id"] ?>">
<img src="<?= $debut . $evenements[3]["couverture"] ?>" alt="">
2026-02-24 14:26:25 +00:00
<div class="overlay">
<p><?= $evenements[3]["titre"] ?></p>
</div>
2026-03-10 09:37:35 +00:00
</a>
2026-02-24 14:26:25 +00:00
</div>
2026-03-10 09:37:35 +00:00
</div>
<button type="button" class="btn btn-primary" style="position: fixed; bottom: 20px; right: 20px;" onclick="window.location.href='./viewAllEvents.php'">Voir tous les évènements</button>
<form action="logout.php" method="post" style="position: fixed; bottom: 20px; left: 20px;">
<button type="submit" class="btn btn-danger">
Se déconnecter
</button>
</form>
<!-- footer pas toucher -->
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.8/dist/js/bootstrap.bundle.min.js" integrity="sha384-FKyoEForCGlyvwx9Hj09JcYn3nv7wiPVlz7YYwJrWVcXK/BmnVDxM+D2scQbITxI" crossorigin="anonymous"></script>
</body>
2026-02-24 14:26:25 +00:00
</html>