From 3cc66ef7839e89199900fd64ed911b64d8b09a4d Mon Sep 17 00:00:00 2001 From: galaxyoyo Date: Sat, 7 Sep 2019 21:06:49 +0200 Subject: [PATCH] =?UTF-8?q?Les=20notes=20de=20synth=C3=A8ses=20n'ont=20pas?= =?UTF-8?q?=20=C3=A0=20=C3=AAtre=20copi=C3=A9es=20pour=20la=20finale?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server_files/controllers/equipe.php | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/server_files/controllers/equipe.php b/server_files/controllers/equipe.php index 629b6dd..02d2462 100644 --- a/server_files/controllers/equipe.php +++ b/server_files/controllers/equipe.php @@ -39,26 +39,6 @@ if (isset($_POST["select"])) { VALUES (?, ?, ?, ?);"); $req->execute([$id, $team->getId(), $_SESSION["final_id"], $sol_data["problem"]]); } - - $syntheses_req = $DB->prepare("SELECT `file_id`, `dest`, COUNT(`dest`) AS `version` FROM `syntheses` WHERE `team` = ? AND `tournament` = ? GROUP BY `dest`, `uploaded_at` ORDER BY `dest`, `uploaded_at` DESC;"); - $syntheses_req->execute([$team->getId(), $team->getTournamentId()]); - while (($synthese_data = $syntheses_req->fetch()) !== false) { - $old_id = $synthese_data["file_id"]; - $alphabet = "abcdefghijklmnopqrstuvwxyz0123456789"; - - do { - $id = ""; - for ($i = 0; $i < 64; ++$i) { - $id .= $alphabet[rand(0, strlen($alphabet) - 1)]; - } - } - while (file_exists("$LOCAL_PATH/files/$id")); - - copy("$LOCAL_PATH/files/$old_id", "$LOCAL_PATH/files/$id"); - - $req = $DB->prepare("INSERT INTO `syntheses`(`file_id`, `team`, `tournament`, `dest`) VALUES (?, ?, ?, ?);"); - $req->execute([$id, $team->getId(), $FINAL->getId(), $synthese_data["dest"]]); - } } $documents_req = $DB->prepare("SELECT `file_id`, `user`, `type`, COUNT(`type`) AS `version` FROM `documents` WHERE `team` = ? AND `tournament` = ? GROUP BY `user`, `type` ORDER BY `user`, `type` ASC, MAX(`uploaded_at`) DESC;");