e59-website/html/index.php
2024-08-16 19:44:05 +00:00

147 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, $pageTitle, $darkTheme, $lightTheme);?>
<style>
main {
background: none;
min-height: 0;
}
.video-background {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
overflow: hidden;
z-index: -1;
}
.video-background video {
min-width: 100%;
min-height: 100%;
width: auto;
height: auto;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
z-index: -1;
}
#main-panel {
margin: 8em auto;
text-align: center;
overflow: hidden;
}
#main-panel h1 {
width: 80%;
margin: 1em auto;
}
.second-panel {
background: var(--background);
}
.googleadbox {
margin: 0 auto;
width: 60%;
margin-top: 15em;
}
.adsbygoogle {
display:inline-block;
margin: 0 auto;
width:100%;
height:90px;
}
@media(max-width: 750px) {
.adsbygoogle {
height:50px
}
.googleadbox {
width: 100%;
}
}
</style>
</head>
<body class="body">
<header>
<div class="panel-content">
<?php fillHeader($rootPageURL, $headerTitle, $headerSubtitle, $social);?>
</div>
<meta name="description" content="Rassembler les étudiants dans des projets innovants.">
<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="Association E59">
<meta property="og:description" content="Rassembler les étudiants dans des projets innovants.">
<meta property="og:url" content="https://e59.fr">
<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 id="main-panel">
<div class="video-background">
<video autoplay muted loop id="animation">
<source src="/src/videos/e59-animation.mp4" type="video/mp4">
</video>
</div>
<h1>Rassembler les étudiants dans des projets innovants</h1>
<a href="/don" class="button" style="margin: 5em 0 0 0; font-size: 1.2em;">Faire un don</a>
<!--https://discord.gg/K6WwKYR8EV-->
</div>
<div class="second-panel">
<div class="content">
<!--<iframe src="https://discord.com/widget?id=1029821278330302625&theme=dark" width="350" height="500" allowtransparency="true" frameborder="0" sandbox="allow-popups allow-popups-to-escape-sandbox allow-same-origin allow-scripts"></iframe>-->
<h2>Nos dernières actualités</h2>
<div class="articles-list">
<?php
$sqlRequest = "SELECT articles.ID, articles.title, articles.creation_date, articles.miniature, articles.resume, users.username, users.display_name, roles.badge_svg FROM articles INNER JOIN users ON articles.author = users.ID LEFT JOIN roles ON users.role = roles.ID WHERE articles.classification <= :userAccreditation ORDER BY articles.creation_date DESC LIMIT 3";
$request = $pdo->prepare($sqlRequest);
$request->bindParam(":userAccreditation", $_SESSION['userAccreditation']);
$request->execute();
$result = $request->fetchAll(PDO::FETCH_ASSOC);
if ($result) {
listArticles($result, $rootPageURL);
}
?>
</div>
<div class="googleadbox">
<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-5492094351136590" crossorigin="anonymous"></script>
<ins class="adsbygoogle" data-ad-client="ca-pub-5492094351136590" data-ad-slot="6694793177"></ins>
<script>(adsbygoogle = window.adsbygoogle || []).push({});</script>
</div>
</div>
</main>
<footer>
<div class="panel-content">
<?php fillFooter($footerText);?>
</div>
</footer>
</body>
</html>