diff --git a/.htaccess b/.htaccess
index 48a8884..5c45ecf 100644
--- a/.htaccess
+++ b/.htaccess
@@ -18,6 +18,7 @@ RewriteRule ^connexion/(.*?)$ server_files/connexion.php?$1 [L]
RewriteRule ^deconnexion$ server_files/deconnexion.php [L]
RewriteRule ^equipe/(.*?)$ server_files/equipe.php?trigram=$1 [L]
RewriteRule ^file/(.*?)$ server_files/view_file.php?file_id=$1 [L]
+RewriteRule ^informations/(.*?)/.*?$ server_files/informations.php?id=$1 [L]
RewriteRule ^inscription$ server_files/inscription.php [L]
RewriteRule ^mon_compte$ server_files/mon_compte.php [L]
RewriteRule ^mon_equipe/(.*?)$ server_files/mon_equipe.php?$1 [L]
diff --git a/server_files/equipe.php b/server_files/equipe.php
index 73d2993..6e70360 100644
--- a/server_files/equipe.php
+++ b/server_files/equipe.php
@@ -12,7 +12,7 @@ $team_data = $DB->query("SELECT * FROM `teams` WHERE `trigram` = '$trigram' AND
$tournament_data = $DB->query("SELECT `name`, `date_start` FROM `tournaments` WHERE `id` = '" . $team_data["tournament"] . "' AND `year` = '$YEAR';")->fetch();
-$documents_req = $DB->prepare("SELECT `file_id`, `user`, `type`, COUNT(`type`) AS `version` FROM `documents` WHERE `team` = ? GROUP BY `type` ORDER BY `user`, `type` ASC, `uploaded_at` DESC;");
+$documents_req = $DB->prepare("SELECT `file_id`, `user`, `type`, COUNT(`type`) AS `version` FROM `documents` WHERE `team` = ? GROUP BY `user`, `type` ORDER BY `user`, `type` ASC, MAX(`uploaded_at`) DESC;");
$documents_req->execute([$team_data["id"]]);
?>
@@ -28,14 +28,16 @@ Tournoi :
for ($i = 1; $i <= 2; ++$i) {
if ($team_data["encadrant_" . $i] == NULL)
continue;
- $user_data = $DB->query("SELECT `surname`, `first_name` FROM `users` WHERE `id` = " . $team_data["encadrant_" . $i] . " AND `year` = '$YEAR';")->fetch();
- echo "Encadrant $i : " . $user_data["first_name"] . " " . $user_data["surname"] . "
";
+ $user_data = $DB->query("SELECT `id`, `surname`, `first_name` FROM `users` WHERE `id` = " . $team_data["encadrant_" . $i] . " AND `year` = '$YEAR';")->fetch();
+ $id = $user_data["id"];
+ echo "Encadrant $i : " . $user_data["first_name"] . " " . $user_data["surname"] . "
";
}
for ($i = 1; $i <= 6; ++$i) {
if ($team_data["participant_" . $i] == NULL)
continue;
- $user_data = $DB->query("SELECT `surname`, `first_name` FROM `users` WHERE `id` = " . $team_data["participant_" . $i] . " AND `year` = '$YEAR';")->fetch();
- echo "Participant $i : " . $user_data["first_name"] . " " . $user_data["surname"] . "
";
+ $user_data = $DB->query("SELECT `id`, `surname`, `first_name` FROM `users` WHERE `id` = " . $team_data["participant_" . $i] . " AND `year` = '$YEAR';")->fetch();
+ $id = $user_data["id"];
+ echo "Participant $i : " . $user_data["first_name"] . " " . $user_data["surname"] . "
";
}
?>
diff --git a/server_files/informations.php b/server_files/informations.php
new file mode 100644
index 0000000..c02d3d7
--- /dev/null
+++ b/server_files/informations.php
@@ -0,0 +1,94 @@
+query("SELECT * FROM `users` WHERE `id` = $id;")->fetch();
+
+if ($user_data === false) {
+ include "../404.php";
+}
+
+$team_data = false;
+if ($user_data["team_id"] !== NULL)
+ $team_data = $DB->query("SELECT `name`, `trigram` FROM `teams` WHERE `id` = " . $user_data["team_id"] . ";")->fetch();
+
+$documents_req = $DB->query("SELECT * FROM `documents` WHERE `user` = $id;");
+$tournaments_req = $DB->query("SELECT `tournament`, `name` FROM `organizers` JOIN `tournaments` ON `tournaments`.`id` = `tournament` WHERE `organizer` = $id ORDER BY `name`;");
+
+?>
+
+
+
+