mirror of
				https://gitlab.com/animath/si/plateforme.git
				synced 2025-10-31 23:04:30 +01:00 
			
		
		
		
	Problèmes de date
This commit is contained in:
		| @@ -120,7 +120,7 @@ class MyTeam | |||||||
| 		ensure(preg_match("#^[A-Z]{3}$#", $this->trigram), "Le trigramme n'est pas valide."); | 		ensure(preg_match("#^[A-Z]{3}$#", $this->trigram), "Le trigramme n'est pas valide."); | ||||||
| 		ensure($this->trigram == $this->team->getTrigram() || !trigramExists($this->trigram), "Une équipe a déjà choisi ce trigramme."); | 		ensure($this->trigram == $this->team->getTrigram() || !trigramExists($this->trigram), "Une équipe a déjà choisi ce trigramme."); | ||||||
| 		ensure($this->tournament != null, "Le tournoi indiqué n'existe pas."); | 		ensure($this->tournament != null, "Le tournoi indiqué n'existe pas."); | ||||||
| 		ensure(date("y-m-d H:i:s") <= $this->tournament->getInscriptionDate(), "Les inscriptions sont terminées."); | 		ensure(date("Y-m-d H:i:s") <= $this->tournament->getInscriptionDate(), "Les inscriptions sont terminées."); | ||||||
| 		ensure($this->team->getValidationStatus() == ValidationStatus::NOT_READY, "Votre équipe est déjà validée ou en cours de validation."); | 		ensure($this->team->getValidationStatus() == ValidationStatus::NOT_READY, "Votre équipe est déjà validée ou en cours de validation."); | ||||||
| 	} | 	} | ||||||
|  |  | ||||||
|   | |||||||
| @@ -9,14 +9,14 @@ function ensure($bool, $error_msg = "") | |||||||
| function formatDate($date = NULL, $with_time = false) | function formatDate($date = NULL, $with_time = false) | ||||||
| { | { | ||||||
| 	if ($date == NULL) | 	if ($date == NULL) | ||||||
| 		$date = date("yyyy-mm-dd"); | 		$date = date("Y-m-d H:i:s"); | ||||||
|  |  | ||||||
| 	return strftime("%d %B %G" . ($with_time ? " %H:%M" : ""), strtotime($date)); | 	return strftime("%d %B %G" . ($with_time ? " %H:%M" : ""), strtotime($date)); | ||||||
| } | } | ||||||
|  |  | ||||||
| function dateWellFormed($date, $with_time = false) | function dateWellFormed($date, $with_time = false) | ||||||
| { | { | ||||||
| 	return date_parse_from_format($with_time ? "yyyy-mm-dd HH-MM:ss" : "yy-mm-dd", $date) !== false; | 	return date_parse_from_format($with_time ? "Y-m-d H:i:s" : "Y-m-d", $date) !== false; | ||||||
| } | } | ||||||
|  |  | ||||||
| function genRandomPhrase($size, $uppercase = false) | function genRandomPhrase($size, $uppercase = false) | ||||||
|   | |||||||
| @@ -19,7 +19,7 @@ require_once "header.php"; | |||||||
|     <div class="alert alert-info"> |     <div class="alert alert-info"> | ||||||
|         <?php |         <?php | ||||||
|         for ($i = 1; $i <= 2; ++$i) { |         for ($i = 1; $i <= 2; ++$i) { | ||||||
|             if ($team->getEncadrants()[$i] == NULL) |             if ($team->getEncadrants()[$i - 1] == NULL) | ||||||
|                 continue; |                 continue; | ||||||
|             $encadrant = User::fromId($team->getEncadrants()[$i - 1]); |             $encadrant = User::fromId($team->getEncadrants()[$i - 1]); | ||||||
|             $id = $encadrant->getId(); |             $id = $encadrant->getId(); | ||||||
| @@ -113,7 +113,7 @@ require_once "header.php"; | |||||||
| 		<?php } else { ?> | 		<?php } else { ?> | ||||||
|             <hr /> |             <hr /> | ||||||
|             <div class="alert alert-warning"> |             <div class="alert alert-warning"> | ||||||
|                 Pour demander à valider votre équipe, vous devez avoir au moins un encadrant, trois participants, |                 Pour demander à valider votre équipe, vous devez avoir au moins un encadrant, quatre participants, | ||||||
|                 choisi un problème et soumis une autorisation de droit à l'image par participant. |                 choisi un problème et soumis une autorisation de droit à l'image par participant. | ||||||
|             </div> |             </div> | ||||||
| 		<?php } ?> | 		<?php } ?> | ||||||
|   | |||||||
| @@ -7,7 +7,7 @@ if (!$has_error && isset($save_solution)) { ?> | |||||||
|     </div> |     </div> | ||||||
| <?php } ?> | <?php } ?> | ||||||
|  |  | ||||||
| <?php if (date("yyyy-mm-dd") < $tournament->getSolutionsDate()) { ?> | <?php if (date("Y-m-d H:i:s") < $tournament->getSolutionsDate()) { ?> | ||||||
|     <form method="post" enctype="multipart/form-data"> |     <form method="post" enctype="multipart/form-data"> | ||||||
|         <input type="hidden" name="MAX_FILE_SIZE" value="5000000"/> |         <input type="hidden" name="MAX_FILE_SIZE" value="5000000"/> | ||||||
|         <div class="form-row"> |         <div class="form-row"> | ||||||
|   | |||||||
| @@ -1,8 +1,7 @@ | |||||||
| <?php | <?php | ||||||
| require_once "header.php"; | require_once "header.php"; | ||||||
|  |  | ||||||
|  | if (date("Y-m-d H:i:s") < $tournament->getSolutionsDate()) { | ||||||
| if (date("yyyy-mm-dd") < $tournament->getSolutionsDate()) { |  | ||||||
| 	echo "<div class=\"alert alert-danger\"><h4>Il est trop tôt pour se préoccuper des notes de synthèse, attendez le tirage des poules.</h4></div>"; | 	echo "<div class=\"alert alert-danger\"><h4>Il est trop tôt pour se préoccuper des notes de synthèse, attendez le tirage des poules.</h4></div>"; | ||||||
| 	require_once "server_files/views/footer.php"; | 	require_once "server_files/views/footer.php"; | ||||||
| } | } | ||||||
| @@ -13,7 +12,7 @@ if (isset($save_synthesis) && !$has_error) { ?> | |||||||
|     </div> |     </div> | ||||||
| <?php } ?> | <?php } ?> | ||||||
|  |  | ||||||
| <?php if (date("yyyy-mm-dd") < $tournament->getSynthesesDate()) { ?> | <?php if (date("Y-m-d H:i:s") < $tournament->getSynthesesDate()) { ?> | ||||||
|     <form method="post" enctype="multipart/form-data"> |     <form method="post" enctype="multipart/form-data"> | ||||||
|         <input type="hidden" name="MAX_FILE_SIZE" value="5000000"/> |         <input type="hidden" name="MAX_FILE_SIZE" value="5000000"/> | ||||||
|         <div class="form-row"> |         <div class="form-row"> | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user