Enigme Liberation v0

This commit is contained in:
Ronan 2021-08-16 21:05:46 +02:00
parent a213713eba
commit b2fe837b79
19 changed files with 0 additions and 391 deletions

View file

@ -1,24 +0,0 @@
<?php
require_once '../../classes/dao.php';
if (isset($_GET['function'])) {
if ($_GET['function'] == "save_day_activities")
save_day_activities();
} else
show_error();
function save_day_activities() {
if (isset($_GET['day']) && isset($_GET['entries'])) {
$dao = new Dao();
$dao->save_day_activities($_GET['day'], $_GET['entries']);
echo "Réussite";
} else {
show_error();
}
}
function show_error() {
echo "Échec : ";
var_dump($_GET);
}

View file

@ -1,59 +0,0 @@
<?php
ob_start(); // Start reading html
$relativePath = "../../";
?>
<div class="inner">
<h1>ADMIN</h1>
<h2>Edition du planning</h2>
<select id="daySelect">
<option value="1">Lundi</option>
<option value="2">Mardi</option>
<option value="3">Mercredi</option>
<option value="4">Jeudi</option>
<option value="5">Vendredi</option>
<option value="6">Samedi</option>
<option value="7">Dimanche</option>
</select>
<br>
<div class="add-line">
<i class="fas fa-plus"></i>
</div>
<div class="edit-header">
<div class="planning-start">Début</div>
<div class="planning-length">Durée</div>
<div class="planning-name">Nom</div>
<div class="planning-trash"><i class='fas fa-trash'></i></div>
</div>
<table id="activityTable">
</table>
<div class="save">
<i class="fas fa-save"></i> Enregistrer
</div>
<br>
<div class="buttons-container">
<a href="../index.php" class="admin-back-button">
<i class="fas fa-chevron-left"></i>
Retour sur la page admin
</a>
<a href="<?= $relativePath ?>planning.php" class="website-back-button">
Voir sur le site
</a>
</div>
</div>
<link rel="stylesheet" type="text/css" media="screen" href="<?= $relativePath ?>assets/css/adminEdit.css"/>
<?php
$pageContent = ob_get_clean(); // Store html content in variable
$pageTitle = "Édition planning";
$pageScripts = "<script type=\"text/javascript\" src=\"".$relativePath."assets/js/admin/planningManager.js\"></script>";
include($relativePath . "includes/template.php"); // Display template with variable content
?>

View file

@ -1,24 +0,0 @@
<?php
require_once '../../classes/dao.php';
if (isset($_GET['function'])) {
if ($_GET['function'] == "save_scores")
save_scores();
} else
show_error();
function save_scores()
{
if (isset($_GET['lines']) && isset($_GET['team'])) {
$dao = new Dao();
$dao->save_scores($_GET['lines'], $_GET['team']);
echo "Réussite";
} else
show_error();
}
function show_error() {
echo "Échec : ";
var_dump($_GET);
}

View file

@ -1,61 +0,0 @@
<?php
ob_start(); // Start reading html
$relativePath = "../../";
?>
<div class="inner">
<h1>ADMIN</h1>
<h2>Edition des scores</h2>
<ul>
<strong style="color: #ee293d">Quelques règles pour les scores</strong>
<li>Pas de score total négatif pour une équipe</li>
<li>A priori les scores supérieurs à 1000 marchent, mais au cas restez à
moins de 1000 (comme l'année dernière quoi)</li>
</ul>
Si jamais y'a un quelconque problème, envoyez-moi un message.
<br>
<br>
<select id="teamSelect">
<option value="boo">Boomiflore</option>
<option value="pek">Peksureau</option>
</select>
<div class="add-line">
<i class="fas fa-plus"></i>
</div>
<div class="edit-header">
<div class="stat-log">Log</div>
<div class="stat-points">Points</div>
<div class="stat-trash"><i class='fas fa-trash'></i></div>
</div>
<table class="stats-table edit-stats">
</table>
<div class="save">
<i class="fas fa-save"></i> Enregistrer
</div>
<br>
<div class="buttons-container">
<a href="../index.php" class="admin-back-button">
<i class="fas fa-chevron-left"></i>
Retour sur la page admin
</a>
<a href="<?= $relativePath ?>stats.php" class="website-back-button">
Voir sur le site
</a>
</div>
</div>
<link rel="stylesheet" type="text/css" media="screen" href="<?= $relativePath ?>assets/css/adminEdit.css"/>
<?php
$pageContent = ob_get_clean(); // Store html content in variable
$pageTitle = "Édition scores";
$pageScripts = "<script type=\"text/javascript\" src=\"".$relativePath."assets/js/admin/statsManager.js\"></script>";
include($relativePath . "includes/template.php"); // Display template with variable content
?>

View file

@ -1,62 +0,0 @@
<?php
ob_start(); // Start reading html
$relativePath = "../";
?>
<div class="inner">
<h1>ADMIN</h1>
<h2>Bienvenue sur la page d'administration</h2>
<p>
Sur cette page, tu vas pouvoir animer le site en changeant les scores, le planning ou les informations de la
carte.
<br/>
Attention, tu dois avoir le compte approprié pour pouvoir modifier ces informations.
<br/>
Les comptes sont les suivants (le numéro indique le niveau de privilèges) :
</p>
<ol>
<li>
GDA
</li>
<li>
Admin
</li>
<li>
Webmaster
</li>
</ol>
<p>
Un compte hérite des privilèges de tous ceux ayant un niveau inférieur.
<br/>
Donc ici, Webmaster les possède tous.
</p>
<div class="admin-container">
<h4>
Action des GDA
</h4>
<a href="gda/scores.php">Editer les scores</a>
</div>
<div class="admin-container">
<h4>
Action des admins
</h4>
<a href="admin/planning.php">Editer le planning</a>
</div>
<div class="admin-container">
<h4>
Action des webmasters
</h4>
<a href="webmaster/map.php">Editer le texte de la carte</a>
<br/>
<a href="webmaster/update.php">Mises à jour</a>
</div>
</div>
<link rel="stylesheet" type="text/css" media="screen" href="<?= $relativePath ?>assets/css/adminEdit.css"/>
<?php
$pageContent = ob_get_clean(); // Store html content in variable
$pageTitle = "ADMIN";
include($relativePath . "includes/template.php"); // Display template with variable content
?>

View file

@ -1,47 +0,0 @@
<?php
require_once '../../classes/dao.php';
$rest_json = file_get_contents("php://input");
$_POST = json_decode($rest_json, true);
//var_dump($_POST);
if (isset($_GET['function']) || isset($_POST['function'])) {
if ($_GET['function'] == "save_map_info")
save_map_info();
elseif ($_POST['function'] == "update_website")
update_website();
} else
show_error();
function save_map_info() {
if (isset($_GET['selector']) && isset($_GET['info'])) {
$dao = new Dao();
$dao->save_map_info($_GET['selector'], $_GET['info']);
echo "Réussite";
} else {
show_error();
}
}
function update_website() {
// if (isset($_POST['login']) && isset($_POST['password'])) {
// $login = $_POST['login'];
// $password = $_POST['password'];
// echo $login . ":" . $password."\n";
// // Cannot write because php cannot write as user www-data
// // be sure to escape characters
// // Do not remove the space before the command (prevent command from being saved in history)
//// system(" git pull https://".$login.":".$password."@git.srv-falcon.etud.insa-toulouse.fr/vergnet/site-accueil-insa.git");
// } else {
// show_error();
// }
}
function show_error() {
echo "Échec :\n";
echo "GET\n";
var_dump($_GET);
echo "POST\n";
var_dump($_POST);
}

View file

@ -1,57 +0,0 @@
<?php
ob_start(); // Start reading html
$relativePath = "../../";
require_once $relativePath . 'classes/dao.php';
?>
<div class="inner">
<h1>ADMIN</h1>
<h2>Edition de la carte</h2>
<select id="mapSelect">
<?php setup_map_dropdown() ?>
</select>
<br>
<label for="titleInput">Titre</label>
<input type="text" id="titleInput">
<label for="descriptionInput">Description</label>
<textarea rows="15" id="descriptionInput"></textarea>
<div class="save">
<i class="fas fa-save"></i> Enregistrer
</div>
<br>
<div class="buttons-container">
<a href="../index.php" class="admin-back-button">
<i class="fas fa-chevron-left"></i>
Retour sur la page admin
</a>
<a href="<?= $relativePath ?>map.php" class="website-back-button">
Voir sur le site
</a>
</div>
</div>
<link rel="stylesheet" type="text/css" media="screen" href="<?= $relativePath ?>assets/css/adminEdit.css"/>
<?php
$pageContent = ob_get_clean(); // Store html content in variable
$pageTitle = "Édition carte";
$pageScripts = "<script type=\"text/javascript\" src=\"".$relativePath."assets/js/admin/mapManager.js\"></script>";
include($relativePath . "includes/template.php"); // Display template with variable content
function setup_map_dropdown()
{
$dao = new Dao();
foreach ($dao->get_map_selectors() as $row) {
echo "<option value='" . $row['selector'] . "'>" . $row['selector'] . "</option>";
}
}
?>

View file

@ -1,57 +0,0 @@
<?php
ob_start(); // Start reading html
$relativePath = "../../";
require_once $relativePath . 'classes/dao.php';
$log = shell_exec("git log | head -50"); // Show the first few commits
?>
<div class="inner">
<h1>ADMIN</h1>
<h2>Mise a jour du site</h2>
<!-- <label for="usernameInput">Login</label>-->
<!-- <input type="text" id="usernameInput">-->
<!---->
<!-- <label for="passwordInput">Password</label>-->
<!-- <input type="password" id="passwordInput">-->
<!---->
<!-- <div class="save">-->
<!-- <i class="fas fa-save"></i> Mettre à Jour-->
<!-- </div>-->
<div id="gitButton">
<a href="https://git.srv-falcon.etud.insa-toulouse.fr/vergnet/site-accueil-insa" target="_blank">
Voir sur Gitea
</a>
</div>
<h3>Log</h3>
<p>
<?php
echo nl2br($log)
?>
</p>
<div class="buttons-container">
<a href="../index.php" class="admin-back-button">
<i class="fas fa-chevron-left"></i>
Retour sur la page admin
</a>
<a href="<?= $relativePath ?>index.php" class="website-back-button">
Voir sur le site
</a>
</div>
</div>
<link rel="stylesheet" type="text/css" media="screen" href="<?= $relativePath ?>assets/css/adminEdit.css"/>
<?php
$pageContent = ob_get_clean(); // Store html content in variable
$pageTitle = "Mise à jour";
$pageScripts = "<script type=\"text/javascript\" src=\"".$relativePath."assets/js/admin/updateManager.js\"></script>";
include($relativePath . "includes/template.php"); // Display template with variable content
?>

Binary file not shown.

After

Width:  |  Height:  |  Size: 176 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 160 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 305 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 73 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 395 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 281 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 193 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 114 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 395 KiB

Binary file not shown.