| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110 |
- <?php
- require_once "libs/fnMain.php";
- /**************************
- * Contrôle du token JWT
- **************************/
- if (!isset($_GET["jwt"], $_SETTINGS["jwt_secret"])) {
- echo "Manque d'arguments";
- die();
- }
- verifyJWTtoken($_GET["jwt"], $_SETTINGS["jwt_secret"]);
- /**************************
- * Contrôle du statut premium de l'utilisateur
- **************************/
- verifyUserPremium($_GET["jwt"]);
- /**************************
- * GENERATION DES CLASSEMENTS
- **************************/
- $isClassementValid = isset($_GET["classement"]) && (int) $_GET["classement"] !== 0;
- if ($isClassementValid) {
- $rangMoyen = (int) $_GET["classement"];
- // HTML renvoyé au site
- $html = <<<EOF
- <!doctype html>
- <html lang="fr">
- <head>
- <meta charset="UTF-8">
- <meta name="viewport"
- content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
- <meta http-equiv="X-UA-Compatible" content="ie=edge">
- <title>RangLimier</title>
- <link rel="stylesheet" href="assets/bootstrap.min.css">
- <link rel="stylesheet" href="assets/divers.css">
- </head>
- <body>
- <h1>RangLimier</h1>
- <p>Cet outil permet, en entrant un classement (réel ou supposé), de voir les choix disponibles à ce classement. <br>
- <i>Attention : Cet outil est à but purement indicatif !</i>
- </p>
- <style>
- /* Tableau */
- table {
- font-size: 13px;
- text-align: center;
- border-collapse: collapse;
- white-space: nowrap;
- overflow: auto;
- }
-
- th, td {
- padding: 2px;
- border: 1px solid black;
- --text-color: lightgrey;
- }
-
- .all-choices {
- background-color: #28a745;
- /* color: #8fd19e; */
- color: white;
- }
-
- .half-choices {
- background-color: #8fd19e;
- color: black;
- }
-
- .last-choice {
- background-color: #ffdf7e;
- color: grey;
- }
-
- .no-choice {
- background-color: #ed969e;
- }
-
- .never-available {
- background-color: lightgrey;
- }
- </style>
- <h2>Tableau de classement pour le rang {$rangMoyen}</h2>
- <!--
- <h3>Légende</h3>
- <table>
- <thead>
- <th colspan="5">Légende (sur toutes les années)</th>
- </thead>
- <tbody>
- <tr>
- <td>Jamais proposé</td>
- <td class="no-choice">Aucun choix</td>
- <td class="last-choice">Une seule année</td>
- <td class="half-choices">Plusieurs choix</td>
- <td class="all-choices">Tous les choix</td>
- </tr>
- </tbody>
- </table> -->
- <p>
- Chaque nombre dans chaque case correspond au nombre d'années où ce choix était dispo au classement rentré <br>
- </p>
- EOF;
-
- require "apiDisplay.php";
- } else {
- echo "Classement entré incorrect.";
- }
|