geforkt von rebillar/site-accueil-insa
finally global team variables :')
Dieser Commit ist enthalten in:
Ursprung
ae163eded6
Commit
74828cfd32
11 geänderte Dateien mit 65 neuen und 36 gelöschten Zeilen
|
@ -1,6 +1,8 @@
|
|||
<?php
|
||||
include "script.php";
|
||||
|
||||
include "assets/scripts/globals.php"
|
||||
|
||||
if($user['perm'] < 3) {
|
||||
header('Location: deco.php');
|
||||
}
|
||||
|
@ -53,8 +55,8 @@ if(isset($_POST['send'])) {
|
|||
<input type="number" name ="points" placeholder="points" class="input_inline">
|
||||
<select name="team" class="input_inline">
|
||||
<option value="t">NULL</option>
|
||||
<option value="t0">team1</option>
|
||||
<option value="t1">team2</option>
|
||||
<option value="t0"><?=$TEAM1?></option>
|
||||
<option value="t1"><?=$TEAM2?></option>
|
||||
</select>
|
||||
<input type="submit" name="send" value="Mettre à jour" class="submit_inline">
|
||||
</form>
|
||||
|
@ -72,10 +74,10 @@ if(isset($_POST['send'])) {
|
|||
<td><?php
|
||||
switch ($r[0]['team']) {
|
||||
case "0":
|
||||
echo "team1";
|
||||
echo $TEAM1;
|
||||
break;
|
||||
case "1":
|
||||
echo "team2";
|
||||
echo $TEAM2;
|
||||
break;
|
||||
}
|
||||
?></td>
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
<?php
|
||||
include "script.php";
|
||||
|
||||
include "assets/scripts/globals.php"
|
||||
|
||||
$req = $db->query('SELECT id, texte, points, team, id_staff FROM scores');
|
||||
|
||||
|
||||
|
@ -73,8 +75,8 @@ if(isset($_POST['send'])) {
|
|||
<input type="text" placeholder="Texte" name="texte" class="input_inline">
|
||||
<input type="number" placeholder="point" name="point" class="input_inline">
|
||||
<select name="team" class="input_inline">
|
||||
<option value="t0">team1</option>
|
||||
<option value="t1">team2</option>
|
||||
<option value="t0"><?=$TEAM1?></option>
|
||||
<option value="t1"><?=$TEAM1?></option>
|
||||
</select>
|
||||
<input type="submit" name="send" value="Ajouter" class="submit_inline">
|
||||
</form>
|
||||
|
@ -86,8 +88,8 @@ if(isset($_POST['send'])) {
|
|||
<br><br>
|
||||
<form method="POST">
|
||||
<input type="submit" name="teamall" value="All" class="submit_inline">
|
||||
<input type="submit" name="team0" value="team1" class="submit_inline">
|
||||
<input type="submit" name="team1" value="team2" class="submit_inline">
|
||||
<input type="submit" name="team0" value="<?=$TEAM1?>" class="submit_inline">
|
||||
<input type="submit" name="team1" value="<?=$TEAM1?>" class="submit_inline">
|
||||
</form>
|
||||
<br><br>
|
||||
<table class="acces">
|
||||
|
@ -109,10 +111,10 @@ if(isset($_POST['send'])) {
|
|||
<td><?php
|
||||
switch ($stat['team']) {
|
||||
case "0":
|
||||
echo "team1";
|
||||
echo $TEAM1;
|
||||
break;
|
||||
case "1":
|
||||
echo "team2";
|
||||
echo $TEAM2;
|
||||
break;
|
||||
}
|
||||
?></td>
|
||||
|
|
6
assets/scripts/globals.php
Normale Datei
6
assets/scripts/globals.php
Normale Datei
|
@ -0,0 +1,6 @@
|
|||
<?php
|
||||
|
||||
$TEAM1 = "teamtest1";
|
||||
$TEAM2 = "teamtest2";
|
||||
|
||||
?>
|
15
enigma.php
15
enigma.php
|
@ -2,6 +2,7 @@
|
|||
ob_start(); // Start reading html
|
||||
|
||||
include "script/db.php";
|
||||
include "assets/scripts/globals.php"
|
||||
|
||||
if(isset($_POST['send'])) {
|
||||
if(!empty($_POST['answer']) AND !empty($_POST['team'])) {
|
||||
|
@ -14,9 +15,9 @@ if(isset($_POST['send'])) {
|
|||
|
||||
if($reponse[0]['team'] == NULL) {
|
||||
//le "if" ici c'est parce que le 0 => $team = NULL du coup on doit genre faire une conversion relou
|
||||
if($team == "team1") {
|
||||
if($team == $TEAM1) {
|
||||
$team = 0;
|
||||
} elseif($team == "team2") {
|
||||
} elseif($team == $TEAM2) {
|
||||
$team = 1;
|
||||
} else {
|
||||
header('Refresh: 0');
|
||||
|
@ -54,17 +55,19 @@ if(isset($_POST['send'])) {
|
|||
<input type="text" placeholder="Réponse à l'énigme" name="answer" class="input">
|
||||
<select name="team" class="input">
|
||||
<option value="">Choisissez votre équipe</option>
|
||||
<option value="team1">team1</option>
|
||||
<option value="team2">team2</option>
|
||||
<?php
|
||||
echo"<option value=".$TEAM1.">".$TEAM1."</option>"
|
||||
echo"<option value=".$TEAM2.">".$TEAM2."</option>"
|
||||
?>
|
||||
</select>
|
||||
<input type="submit" name="send" value="Valider votre réponse" class="submit">
|
||||
</form>
|
||||
<?php
|
||||
} else {
|
||||
if($reponse[0]['team'] == 0) {
|
||||
echo "La réponse de l'énigme de la plaquette à déja été trouvé par team1 !";
|
||||
echo "La réponse de l'énigme de la plaquette à déja été trouvé par ".$TEAM1." !";
|
||||
} else {
|
||||
echo "La réponse de l'énigme de la plaquette à déja été trouvé team2 !";
|
||||
echo "La réponse de l'énigme de la plaquette à déja été trouvé ".$TEAM2." !";
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
ob_start(); // Start reading html
|
||||
|
||||
include "assets/fonts/color.php";
|
||||
include "assets/scripts/globals.php"
|
||||
|
||||
?>
|
||||
<main>
|
||||
|
@ -30,8 +31,10 @@ include "assets/fonts/color.php";
|
|||
Si tu as reçu (et lu!) ta <?= colored_text("plaquette") ?>, tu sais que tu fais partie d'une #team:
|
||||
</p>
|
||||
<p>
|
||||
<a href="team.php?team=team2" class="link">team2</a>,
|
||||
ou <a href="team.php?team=team1" class="link">team1</a>.
|
||||
<?php
|
||||
echo"<a href=\"team.php?team=".$TEAM2."\" class=\"link\">".$TEAM2."</a>,"
|
||||
echo"<a href=\"team.php?team=".$TEAM1."\" class=\"link\">".$TEAM1."</a>"
|
||||
?>
|
||||
</p>
|
||||
<p>
|
||||
Fais gagner des points à ton équipe durant la semaine pour lui faire remporter les INSA BROS !
|
||||
|
|
4
info.php
4
info.php
|
@ -1,5 +1,7 @@
|
|||
<?php
|
||||
ob_start(); // Start reading html
|
||||
|
||||
include "assets/scripts/globals.php"
|
||||
?>
|
||||
<main>
|
||||
|
||||
|
@ -13,7 +15,7 @@ ob_start(); // Start reading html
|
|||
Pour avoir les news, rejoins le groupe <a href="https://www.facebook.com/groups/3305135659705279/" class="link">Facebook</a> de la
|
||||
semaine. On y postera des infos sur les événements à venir.<br>
|
||||
Et sinon tu peux rejoindre le <font color="red">groupe facebook de ton équipe</font> :<br>
|
||||
<a href="https://www.facebook.com/groups/554998889637787" class="link">team2</a> ou <a href="https://www.facebook.com/groups/1440974243018687" class="link">team1</a>
|
||||
<a href="https://www.facebook.com/groups/554998889637787" class="link"><?php $TEAM2?></a> ou <a href="https://www.facebook.com/groups/1440974243018687" class="link"><?php $TEAM1?></a>
|
||||
</p>
|
||||
<p>
|
||||
Tu peux également rejoindre l'Instagram : <a href="https://www.instagram.com/insat_accueil_2022/" class="link">@insat_accueil_2022</a>
|
||||
|
|
10
planning.php
10
planning.php
|
@ -8,6 +8,8 @@ if(isset($_GET['planning']) AND !empty(['planning']))
|
|||
$planning = (int) htmlspecialchars($_GET['planning']);
|
||||
}
|
||||
|
||||
include "assets/scripts/globals.php"
|
||||
|
||||
?>
|
||||
<main>
|
||||
|
||||
|
@ -247,8 +249,8 @@ if(isset($_GET['planning']) AND !empty(['planning']))
|
|||
|
||||
<section>
|
||||
<form method="POST">
|
||||
<input type="submit" name="p2" value="Planning team1" class="submit">
|
||||
<input type="submit" name="p3" value="Planning team2" class="submit">
|
||||
<input type="submit" name="p2" value="Planning <?=$TEAM1?>" class="submit">
|
||||
<input type="submit" name="p3" value="Planning <?=$TEAM1?>" class="submit">
|
||||
<input type="submit" name="p1" value="Planning général" class="submit">
|
||||
</form>
|
||||
</section>
|
||||
|
@ -267,10 +269,10 @@ if(isset($planning)) {
|
|||
$team_name = "général";
|
||||
break;
|
||||
case 2:
|
||||
$team_name = "team1";
|
||||
$team_name = $TEAM1;
|
||||
break;
|
||||
case 3:
|
||||
$team_name = "team2";
|
||||
$team_name = $TEAM2;
|
||||
break;
|
||||
|
||||
}
|
||||
|
|
|
@ -15,6 +15,9 @@ $r1 = $req_p1->fetchAll(PDO::FETCH_ASSOC);
|
|||
if(!($r1[0]['s'] > 0)) {
|
||||
$r1[0]['s'] = 0;
|
||||
}
|
||||
|
||||
include "assets/scripts/globals.php"
|
||||
|
||||
?>
|
||||
<main>
|
||||
<section>
|
||||
|
@ -28,8 +31,8 @@ if(!($r1[0]['s'] > 0)) {
|
|||
|
||||
<table class="out">
|
||||
<tr>
|
||||
<td><div class="title_in">team1 - <?= $r0[0]['s'] ?> points</div></td>
|
||||
<td><div class="title_in">team2 - <?= $r1[0]['s'] ?> points</div></td>
|
||||
<td><div class="title_in"><?=$TEAM1?> - <?= $r0[0]['s'] ?> points</div></td>
|
||||
<td><div class="title_in"><?=$TEAM2?>- <?= $r1[0]['s'] ?> points</div></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
|
|
|
@ -2,6 +2,8 @@
|
|||
if(!isset($relativepath)) {
|
||||
header('Location: ../index.php');
|
||||
}
|
||||
|
||||
include "assets/scripts/globals.php"
|
||||
?>
|
||||
|
||||
<!-- The actual menu * desktop -->
|
||||
|
@ -63,8 +65,8 @@ if(!isset($relativepath)) {
|
|||
<!-- Top layer (LtR) -->
|
||||
<?php
|
||||
$co_y_0 = [0, 48.85, 97.7, 146.55, 195.4, 244.25, 293.1, 341.95, 390.8, 439.65, 488.5];
|
||||
$texte_y_0 = ["Accueil", "Planning", "Plan", "Lydia/Izly", "Blouse", "team1", "team2", "Les stats", "INSARIO", "Prévention", ""];
|
||||
$lien_y_0 = ["index.php", "planning.php", "map.php", "lydia.php", "blouse.php", "team.php?team=team1", "team.php?team=team2", "stats.php", "game.php", "prevs.php", ""];
|
||||
$texte_y_0 = ["Accueil", "Planning", "Plan", "Lydia/Izly", "Blouse", $TEAM1, $TEAM2, "Les stats", "INSARIO", "Prévention", ""];
|
||||
$lien_y_0 = ["index.php", "planning.php", "map.php", "lydia.php", "blouse.php", "team.php?team=".$TEAM1, "team.php?team=".$TEAM2, "stats.php", "game.php", "prevs.php", ""];
|
||||
for($i = 0; $i <= 10; $i++) {
|
||||
echo
|
||||
'<a href="'.$lien_y_0[$i].'" class="menu-link">
|
||||
|
|
8
team.php
8
team.php
|
@ -9,11 +9,13 @@ if(isset($_GET['team']))
|
|||
} else {
|
||||
header('Location: errors/404.php');
|
||||
}
|
||||
|
||||
include "assets/scripts/globals.php"
|
||||
?>
|
||||
<main>
|
||||
|
||||
<?php
|
||||
if($team === "team2") {
|
||||
if($team === $TEAM2) {
|
||||
?>
|
||||
|
||||
<style>
|
||||
|
@ -29,7 +31,7 @@ if($team === "team2") {
|
|||
</section>
|
||||
|
||||
<?php
|
||||
} elseif($team === "team1") {
|
||||
} elseif($team === $TEAM1) {
|
||||
?>
|
||||
|
||||
<style>
|
||||
|
@ -66,6 +68,6 @@ if($team === "team2") {
|
|||
|
||||
</main>
|
||||
<?php
|
||||
$infopage = ["", "team", ob_get_clean(), "", "team","team1"]; //relativepath, pagetitle, pagecontent, pagescript, pagename | cf structure/template.php ligne 2 à 6
|
||||
$infopage = ["", "team", ob_get_clean(), "", "team",$team]; //relativepath, pagetitle, pagecontent, pagescript, pagename | cf structure/template.php ligne 2 à 6
|
||||
include("structure/template.php");
|
||||
?>
|
14
vacances.php
14
vacances.php
|
@ -3,6 +3,8 @@ ob_start(); // Start reading html
|
|||
|
||||
include "script/db.php";
|
||||
|
||||
include "assets/scripts/globals.php"
|
||||
|
||||
$end = false;
|
||||
|
||||
if(isset($_POST['send'])) {
|
||||
|
@ -37,9 +39,9 @@ if(isset($_POST['send'])) {
|
|||
if(isset($_POST['team']) AND !empty($_POST['team'])) {
|
||||
|
||||
$team = htmlspecialchars($_POST['team']);
|
||||
if($team == "team1") {
|
||||
if($team == $TEAM1) {
|
||||
$team = 0;
|
||||
} elseif($team == "team2") {
|
||||
} elseif($team == $TEAM2) {
|
||||
$team = 1;
|
||||
} else {
|
||||
header('Refresh: 0');
|
||||
|
@ -85,8 +87,8 @@ if(isset($_POST['send'])) {
|
|||
Franchement GG à vous, choisissez votre équipe ci-dessous pour lui faire remporter les points :<br>
|
||||
<select name="team" class="input">
|
||||
<option value="">Choisissez votre équipe</option>
|
||||
<option value="team1">Team1</option>
|
||||
<option value="team2">Team2</option>
|
||||
<option value="<?=$TEAM1?>"><?=$TEAM1?></option>
|
||||
<option value="<?=$TEAM2?>"><?=$TEAM2?></option>
|
||||
</select>
|
||||
<?php
|
||||
}
|
||||
|
@ -106,9 +108,9 @@ if(isset($_POST['send'])) {
|
|||
echo "Aucune des deux équipes n'a réussi à trouver tous les mots";
|
||||
} else {
|
||||
if($team_gg[0]['team'] == 0) {
|
||||
echo "Team1 à déjà tout trouvé";
|
||||
echo $TEAM1." à déjà tout trouvé";
|
||||
} else {
|
||||
echo "Team2 à déjà tout trouvé";
|
||||
echo $TEAM2." à déjà tout trouvé";
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
|
Laden …
In neuem Issue referenzieren