Skip to content

Commit 7dd8e80

Browse files
authored
Version finale
1 parent 2bdf028 commit 7dd8e80

File tree

17 files changed

+132
-24
lines changed

17 files changed

+132
-24
lines changed

css/dark.css

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,10 @@ body {
2929
margin: 0;
3030
}
3131

32+
abbr{
33+
cursor: help;
34+
}
35+
3236
.navbar {
3337
position: fixed;
3438
left: 0;
@@ -95,7 +99,6 @@ body {
9599
font-size: 3vh;
96100
}
97101

98-
99102
p {
100103
overflow: hidden;
101104
margin: 0;

libs/requetes.php

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,7 @@ function supprimerCompte($username, $password){
3636
//Ne pas oublier de supprimer les données de session (le déconnecter)
3737
}
3838
}
39-
// petite fonction pour autoriser les caractères spéciaux à être dans une string
40-
// en les rendant normalisés en rajoutant des backslashes devant (marche pas pour < et >, il faut les remplacer par &lt et &gt
39+
// petite fonction pour autoriser les caractères spéciaux à être dans une string en les rendant normalisés en rajoutant des backslashes devant (marche pas pour < et >, il faut les remplacer par &lt et &gt)
4140
function html_special_chars($str) {
4241
$invalid_characters = array("'", '"', '/', '&', '\\'); // "$", "%", "#", "|", '\'', "\"", "\\");
4342
$str2 = "";
@@ -89,10 +88,14 @@ function creerPrediction($name,$user,$endDate,$choix){//La variable choix sera u
8988
}
9089

9190
function parier($user,$prediction,$choice,$points){
92-
$SQL = "UPDATE users SET points = points - $points WHERE username = '$user';";
93-
SQLUpdate($SQL);
94-
$SQL = "INSERT INTO usersChoices VALUES ('$user',$prediction,$choice,$points);";
95-
SQLInsert($SQL);
91+
$now = date('Y-m-d')." ".date('H:i:s');
92+
$end = SQLGetChamp("SELECT endDate FROM predictions WHERE id='$prediction';");
93+
if($now < $end){
94+
$SQL = "UPDATE users SET points = points - $points WHERE username = '$user';";
95+
SQLUpdate($SQL);
96+
$SQL = "INSERT INTO usersChoices VALUES ('$user',$prediction,$choice,$points);";
97+
SQLInsert($SQL);
98+
}
9699
return $prediction;
97100
}
98101

Lines changed: 1 addition & 0 deletions
Loading

ressources/svg/createProfile.svg

Lines changed: 1 addition & 0 deletions
Loading

ressources/svg/login.svg

Lines changed: 1 addition & 0 deletions
Loading

ressources/svg/logout.svg

Lines changed: 1 addition & 0 deletions
Loading

ressources/svg/persons.svg

Lines changed: 8 additions & 0 deletions
Loading

ressources/svg/podium.svg

Lines changed: 6 additions & 0 deletions
Loading

ressources/svg/points.svg

Lines changed: 7 additions & 0 deletions
Loading

ressources/svg/profile.svg

Lines changed: 1 addition & 0 deletions
Loading

0 commit comments

Comments
 (0)