<?php
if (!isset($relativePath))
    $relativePath='';

if (!isset($customBackgroundId))
    $customBackgroundId='';


require_once $relativePath.'classes/dao.php';
require_once $relativePath.'includes/score_functions.php';


?>

<!DOCTYPE html>
<html lang="fr">
<head>
    <meta charset='utf-8'>
    <meta http-equiv="X-UA-Compatible" content="chrome=1">
    <meta name="viewport" content="width=device-width,maximum-scale=2">
    <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.6.3/css/all.css"
          integrity="sha384-UHRtZLI+pbxtHCWp1t77Bi1L4ZtiqrqD80Kn4Z8NTSRyMA2Fd33n5dQ8lWUE00s/" crossorigin="anonymous">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/jquery-confirm/3.3.2/jquery-confirm.min.css">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/animate.css/3.7.0/animate.min.css">
    <link rel="stylesheet" type="text/css" media="screen" href="<?= $relativePath ?>assets/css/style.css">
    <link rel="stylesheet" type="text/css" media="screen" href="<?= $relativePath ?>assets/css/sidenav.css">
    <link rel="stylesheet" type="text/css" media="screen" href="<?= $relativePath ?>assets/css/score.css">
    <link rel="stylesheet" type="text/css" media="screen" href="<?= $relativePath ?>assets/css/baguette.css">
    <link href="https://fonts.googleapis.com/css?family=Vollkorn|Allura" rel="stylesheet">
    <link rel="shortcut icon" href="<?= $relativePath ?>favicon.ico">
    <title><?= $pageTitle ?> | INSAT Accueil</title>
    <!-- Matomo -->
    <script type="text/javascript">
    var _paq = _paq || [];
    /* tracker methods like "setCustomDimension" should be called before "trackPageView" */
    _paq.push(['disableCookies']);
    _paq.push(['trackPageView']);
    _paq.push(['enableLinkTracking']);
    (function() {
        var u="//etud.insa-toulouse.fr/~accueil_insa/analytics/";
        _paq.push(['setTrackerUrl', u+'piwik.php']);
        _paq.push(['setSiteId', '1']);
        var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
        g.type='text/javascript'; g.async=true; g.defer=true; g.src=u+'piwik.js'; s.parentNode.insertBefore(g,s);
    })();
    </script>
    <!-- End Matomo Code -->
</head>
<body id="main">
<div class="background" id="<?= $customBackgroundId?>"></div>
<div id="back-button" onclick="closeNav()"></div>
<?php
include($relativePath."includes/top_bar.php");
include($relativePath . "includes/sidenav.php");
?>
<div id="header-wrap" class="outer">
    <header class="inner">
        <h1 id="title">Semaine d'Accueil 2019</h1>
        <h3 id="timer">Chargement du compte a rebours...</h3>
    </header>
</div>

<?php
$platformID = 'mobile-score';
include($relativePath."includes/score_counter.php");
?>

<div id="main-fading-top-edge"></div>
<div id="main-content-wrap" class="outer">
    <section id="main-content">
        <?= $pageContent // Display content defined in calling file      ?>
    </section>
</div>
<div id="main-fading-bottom-edge"></div>
<div id="footer-wrap" class="outer">
    <footer class="inner">
        <?php
        include($relativePath . "includes/copyright.php");
        ?>
    </footer>
</div>
</body>
<script src="https://code.jquery.com/jquery-3.3.1.min.js"
        integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8="
        crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-confirm/3.3.2/jquery-confirm.min.js"></script>
<script type="text/javascript" src="<?= $relativePath ?>assets/js/init.js"></script>
<script type="text/javascript" src="<?= $relativePath ?>assets/js/timer.js"></script>
<script type="text/javascript" src="<?= $relativePath ?>assets/js/sidenav.js"></script>
<?php if (isset($pageScripts)): ?>
<?= $pageScripts ?>
<?php endif; ?>
</html>
