correction accent + meilleur choix des records

upgrade-menu
adplantade 5 years ago
parent b0939a1475
commit 0b106bc457

@ -29,7 +29,7 @@
<input type="radio" id="hard" name="diff" value="hard"> <input type="radio" id="hard" name="diff" value="hard">
<label for="5pts">difficile</label><br> <label for="5pts">difficile</label><br>
Entrez votre pseudo (optionnel, mais nécessaire si vous voulez sauvegarder votre score): Entrez votre pseudo (optionnel, mais n&eacute;coul&eacute;cessaire si vous voulez sauvegarder votre score):
<input type="text" name="pseudo" /> <input type="text" name="pseudo" />

@ -9,7 +9,15 @@ Votre score est : <h1 id="points"></h1>
</br> </br>
<?php <?php
$database = new SQLite3("data.db"); $database = new SQLite3("data.db");
$sql='select min(points) from scores where mode="'.$_GET['mode'].'" and diff="'.$_GET['diff'].'"'; if(str_contains($_GET['mode'],"p")
{
$sql='select min(points) from scores where mode="'.$_GET['mode'].'" and diff="'.$_GET['diff'].'"';
}
else
{
$sql='select max(points) from scores where mode="'.$_GET['mode'].'" and diff="'.$_GET['diff'].'"';
}
$result = $database->query($sql); $result = $database->query($sql);
$a=$result->fetchArray(); $a=$result->fetchArray();
if($a[0]==null) if($a[0]==null)
@ -25,7 +33,15 @@ else
<?php <?php
if($_GET['pseudo']!="") if($_GET['pseudo']!="")
{ {
if(str_contains($_GET['mode'],"p")
{
$sqlScore='select min(points) from scores where mode="'.$_GET['mode'].'" and diff="'.$_GET['diff'].'" and player="'.$_GET['pseudo'].'"'; $sqlScore='select min(points) from scores where mode="'.$_GET['mode'].'" and diff="'.$_GET['diff'].'" and player="'.$_GET['pseudo'].'"';
}
else
{
$sqlScore='select max(points) from scores where mode="'.$_GET['mode'].'" and diff="'.$_GET['diff'].'" and player="'.$_GET['pseudo'].'"';
}
$result = $database->query($sqlScore); $result = $database->query($sqlScore);
$data = $result->fetchArray()[0]; $data = $result->fetchArray()[0];
if($data==null) if($data==null)

Loading…
Cancel
Save