143 lines
5.5 KiB
PHP
Executable File
143 lines
5.5 KiB
PHP
Executable File
<?php
|
|
require("../../include/variables.php");
|
|
require("../../include/init.php");
|
|
require("../../include/main-functions.php");
|
|
require("../../include/objects.php");
|
|
require("../../include/panels.php");
|
|
|
|
$pdo = sqlConnect($sqlDatabaseHost, $sqlDatabaseName, $sqlDatabaseUser, $sqlDatabasePass);
|
|
?>
|
|
|
|
<!DOCTYPE html>
|
|
<html lang="fr">
|
|
|
|
<head>
|
|
<?php fillHead($rootPageURL, "Kezako - " . $pageName, $darkTheme, $lightTheme);?>
|
|
<style>
|
|
.kezako {
|
|
display: flex;
|
|
}
|
|
.kezako-logo {
|
|
height: 2em;
|
|
border-radius: 0px;
|
|
margin: 6.1em 0 0 0;
|
|
padding-right: 1em;
|
|
}
|
|
.liste-fiches {
|
|
margin-top: 4em;
|
|
display: flex;
|
|
flex-wrap: wrap;
|
|
justify-content: space-between;
|
|
align-items: flex-start;
|
|
padding: 10px;
|
|
box-sizing: border-box;
|
|
}
|
|
.fiche {
|
|
flex: 1 1 calc(33.333% - 20px); /* Trois éléments par ligne avec un espace de 20px */
|
|
margin: 10px;
|
|
box-sizing: border-box; /* Inclut le padding et la marge dans la largeur totale des éléments */
|
|
}
|
|
.fiche img {
|
|
height: 20em;
|
|
border-radius: 5px;
|
|
}
|
|
@media(max-width: 750px) {
|
|
.doc img {
|
|
height: 15em;
|
|
}
|
|
}
|
|
</style>
|
|
</head>
|
|
|
|
<body class="body">
|
|
|
|
<header>
|
|
<div class="panel-content">
|
|
<?php fillHeader($rootPageURL, $headerTitle, $headerSubtitle, $social);?>
|
|
</div>
|
|
<meta name="description" content="Projet de recherche de solutions d'apprentissage alternatives">
|
|
<meta name="author" content="E59">
|
|
|
|
<meta property="og:locale" content="fr_FR">
|
|
<meta property="og:site_name" content="e59.fr">
|
|
<meta property="og:type" content="website">
|
|
<meta property="og:title" content="Kezako - E59">
|
|
<meta property="og:description" content="Projet de recherche de solutions d'apprentissage alternatives">
|
|
<meta property="og:url" content="https://e59.fr/kezako">
|
|
<meta property="og:image" content="https://e59.fr/src/img/e59-pp.png">
|
|
<meta property="og:image:width" content="500">
|
|
<meta property="og:image:height" content="500">
|
|
<meta property="og:image:type" content="image/png">
|
|
</header>
|
|
|
|
<nav>
|
|
<div class="panel-content">
|
|
<?php fillNav($rootPageURL);?>
|
|
</div>
|
|
</nav>
|
|
|
|
<main>
|
|
<div class="content">
|
|
<div class="kezako"><img src="kezako.png" class="kezako-logo"/><h1>KEZAKO</h1></div>
|
|
<h2>L'apprentissage pensé pour les étudiants par les étudiants</h2>
|
|
<div>
|
|
Nous travaillons activement sur le développement de solutions d'apprentissage alternatives.<br>
|
|
</div>
|
|
<h2>Fiches</h2>
|
|
<?php
|
|
// Répertoire des fichiers PDF
|
|
$pdfDir = './fiches/pdf/';
|
|
|
|
// Répertoire pour stocker les miniatures
|
|
$thumbDir = './fiches/img/';
|
|
if (!file_exists($thumbDir)) {
|
|
mkdir($thumbDir, 0777, true);
|
|
}
|
|
|
|
// Récupérer la liste des fichiers PDF
|
|
$pdfFiles = glob($pdfDir . '*.pdf');
|
|
|
|
// Fonction pour générer une image à partir de la première page d'un PDF
|
|
function generateThumbnail($pdfFile, $outputDir, $outputFile) {
|
|
$outputPath = $outputDir . '/' . pathinfo($outputFile, PATHINFO_FILENAME);
|
|
$command = "pdftoppm -jpeg -f 1 -singlefile " . escapeshellarg($pdfFile) . " " . escapeshellarg($outputPath);
|
|
exec($command);
|
|
}
|
|
|
|
// Générer les miniatures
|
|
foreach ($pdfFiles as $pdfFile) {
|
|
$pdfFilename = basename($pdfFile);
|
|
$thumbFilename = pathinfo($pdfFilename, PATHINFO_FILENAME) . '.jpg';
|
|
$thumbFilePath = $thumbDir . $thumbFilename;
|
|
|
|
if (!file_exists($thumbFilePath)) {
|
|
generateThumbnail($pdfFile, $thumbDir, $thumbFilename);
|
|
}
|
|
}
|
|
|
|
// Générer le HTML pour afficher la mosaïque
|
|
echo '<div class="liste-fiches">';
|
|
foreach ($pdfFiles as $pdfFile) {
|
|
$pdfFilename = basename($pdfFile);
|
|
$thumbFilename = pathinfo($pdfFilename, PATHINFO_FILENAME) . '.jpg';
|
|
$thumbFilePath = $thumbDir . $thumbFilename;
|
|
$pdfFilePath = $pdfDir . $pdfFilename;
|
|
|
|
echo '<div class="fiche">';
|
|
echo '<h3>' . $pdfFilename . '</h3>';
|
|
echo '<a href="' . $pdfFilePath . '" target="_blank">';
|
|
echo '<img src="' . $thumbFilePath . '" alt="' . $pdfFilename . '">';
|
|
echo '</a>';
|
|
echo '</div>';
|
|
}
|
|
echo '</div>';
|
|
?>
|
|
</div>
|
|
</main>
|
|
<footer>
|
|
<div class="panel-content">
|
|
<?php fillFooter($footerText);?>
|
|
</div>
|
|
</footer>
|
|
</body>
|
|
</html>
|