From 74828cfd3207d079eade655ac598e984d99c6914 Mon Sep 17 00:00:00 2001 From: thaaoblues Date: Thu, 26 Jan 2023 15:53:45 +0100 Subject: [PATCH] finally global team variables :') --- admin/enigma.php | 10 ++++++---- admin/stats.php | 14 ++++++++------ assets/scripts/globals.php | 6 ++++++ enigma.php | 15 +++++++++------ index.php | 7 +++++-- info.php | 4 +++- planning.php | 10 ++++++---- stats.php | 7 +++++-- structure/menu.php | 6 ++++-- team.php | 8 +++++--- vacances.php | 14 ++++++++------ 11 files changed, 65 insertions(+), 36 deletions(-) create mode 100644 assets/scripts/globals.php diff --git a/admin/enigma.php b/admin/enigma.php index e206fbc..664287c 100644 --- a/admin/enigma.php +++ b/admin/enigma.php @@ -1,6 +1,8 @@ @@ -72,10 +74,10 @@ if(isset($_POST['send'])) { diff --git a/admin/stats.php b/admin/stats.php index 8b5dbbf..d2064ed 100644 --- a/admin/stats.php +++ b/admin/stats.php @@ -1,6 +1,8 @@ query('SELECT id, texte, points, team, id_staff FROM scores'); @@ -73,8 +75,8 @@ if(isset($_POST['send'])) { @@ -86,8 +88,8 @@ if(isset($_POST['send'])) {

- - + +


@@ -109,10 +111,10 @@ if(isset($_POST['send'])) { diff --git a/assets/scripts/globals.php b/assets/scripts/globals.php new file mode 100644 index 0000000..f2c21fa --- /dev/null +++ b/assets/scripts/globals.php @@ -0,0 +1,6 @@ + \ No newline at end of file diff --git a/enigma.php b/enigma.php index 2e8f897..177c6a7 100644 --- a/enigma.php +++ b/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'])) {
@@ -30,8 +31,10 @@ include "assets/fonts/color.php"; Si tu as reçu (et lu!) ta , tu sais que tu fais partie d'une #team:

- team2, - ou team1. + ".$TEAM2."," + echo"".$TEAM1."" + ?>

Fais gagner des points à ton équipe durant la semaine pour lui faire remporter les INSA BROS ! diff --git a/info.php b/info.php index df5f48c..807b764 100644 --- a/info.php +++ b/info.php @@ -1,5 +1,7 @@

@@ -13,7 +15,7 @@ ob_start(); // Start reading html Pour avoir les news, rejoins le groupe Facebook de la semaine. On y postera des infos sur les événements à venir.
Et sinon tu peux rejoindre le groupe facebook de ton équipe :
- team2 ou team1 + ou

Tu peux également rejoindre l'Instagram : @insat_accueil_2022 diff --git a/planning.php b/planning.php index 87a42b1..b55edb1 100755 --- a/planning.php +++ b/planning.php @@ -8,6 +8,8 @@ if(isset($_GET['planning']) AND !empty(['planning'])) $planning = (int) htmlspecialchars($_GET['planning']); } +include "assets/scripts/globals.php" + ?>

@@ -247,8 +249,8 @@ if(isset($_GET['planning']) AND !empty(['planning']))
- - + +
@@ -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; } diff --git a/stats.php b/stats.php index 7437a3f..f280e92 100755 --- a/stats.php +++ b/stats.php @@ -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" + ?>
@@ -28,8 +31,8 @@ if(!($r1[0]['s'] > 0)) {
- - + +
team1 - points
team2 - points
- points
- points
diff --git a/structure/menu.php b/structure/menu.php index 489b23d..8cef7fb 100644 --- a/structure/menu.php +++ b/structure/menu.php @@ -2,6 +2,8 @@ if(!isset($relativepath)) { header('Location: ../index.php'); } + +include "assets/scripts/globals.php" ?> @@ -63,8 +65,8 @@ if(!isset($relativepath)) { diff --git a/team.php b/team.php index 7de30dc..c404cc5 100644 --- a/team.php +++ b/team.php @@ -9,11 +9,13 @@ if(isset($_GET['team'])) } else { header('Location: errors/404.php'); } + +include "assets/scripts/globals.php" ?>