mode.innerHTML+=modeString+", "+(get["diff"]=="easy"?"facile":(get["diff"]=="med"?"moyen":"difficile"))+"\n"+(getCookie("pause")==0?"pas de pause":"pause");
mode.innerHTML+=modeString+", "+(get["diff"]=="easy"?"facile":(get["diff"]=="med"?"moyen":"difficile"))+"\n"+(getCookie("pause")==0?"pas de pause":"avec pause");
$sql='select score, player from score where game_mode="'.$_GET['mode'].'" and difficulty="'.$_GET['diff'].'" and dots_amount='.$_COOKIE["dotsAmount"].' and pause='.$_COOKIE["pause"].' and score=(select max(score) from score where game_mode="'.$_GET['mode'].'" and difficulty="'.$_GET['diff'].'" and dots_amount='.$_COOKIE["dotsAmount"].' and pause='.$_COOKIE["pause"].')';
$sql='select score, player from score where game_mode="'.$_GET['mode'].'" and difficulty="'.$_GET['diff'].'" and dots_amount='.$_COOKIE["dotsAmount"].' and pause='.$_COOKIE["pause"].' order by score desc limit '.$toDisp;
}
$unit="points";
else
}
{
else
$sql='select score, player from score where game_mode="'.$_GET['mode'].'" and difficulty="'.$_GET['diff'].'" and dots_amount='.$_COOKIE["dotsAmount"].' and pause='.$_COOKIE["pause"].' and score=(select min(score) from score where game_mode="'.$_GET['mode'].'" and difficulty="'.$_GET['diff'].'" and dots_amount='.$_COOKIE["dotsAmount"].' and pause='.$_COOKIE["pause"].')';
{
}
$sql='select score, player from score where game_mode="'.$_GET['mode'].'" and difficulty="'.$_GET['diff'].'" and dots_amount='.$_COOKIE["dotsAmount"].' and pause='.$_COOKIE["pause"].' order by score asc limit '.$toDisp;
$unit="secondes";
}
$result = $database->query($sql);
$result = $database->query($sql);
$a=$result->fetchArray();
$a=$result->fetchArray();
@ -36,11 +37,15 @@ if($a==false)
}
}
else
else
{
{
$phrase="<pclass='texteG'>Le record est ".$a[0].", tenu par ".$a["player"]."</p>";
$phrase="1° place : ".$a["player"].", ".$a[0]." ".$unit;
$cpt=2;
while ($row = $result->fetchArray()) {
while ($row = $result->fetchArray()) {
$phrase=$phrase.", ".$row["player"];
$phrase=$phrase."</br>".$cpt."° place : ".$row["player"].", ".$row["score"]." ".$unit;
phrase+= (document.getElementById("rec").value==get['pts'] ? " et c'est votre record" : " et votre record est "+ document.getElementById("rec").value +" "+(get['mode'].includes('p') ? "secondes" : "points"));