correction requête index qui ne se fait pas

+ correction logo pour adapter aux droits
master
adplantade 5 years ago
parent 723d6e8382
commit ed4c530f8d

@ -142,18 +142,33 @@
$database = new SQLite3("data.db"); $database = new SQLite3("data.db");
// echo isset($_POST["game_mode"])." ".isset($_POST["difficulty"])." ".isset($_POST["dotsAmount"])." ".isset($_POST["pause"]); //$ph = $_POST["game_mode"]."|".$_POST["difficulty"]."|".$_POST["dotsAmount"]."|".$_POST["pause"];
//echo "<h1 id='aya2' class='texte mode-container' >".$ph."</h1>";
$toDisp=5; $toDisp=5;
if(isset($_POST["game_mode"]) && $_POST["game_mode"]!="" && $_POST["difficulty"]!="" && $_POST["dotsAmount"]!="" && $_POST["pause"]!="") if(isset($_POST["game_mode"]) && $_POST["game_mode"]!="" && $_POST["difficulty"]!="" && $_POST["dotsAmount"]!="" && $_POST["pause"]!="")
{ {
if(stristr($_POST['game_mode'], "p") === FALSE) $db_game_mode=$_POST["game_mode"];
$db_difficulty=$_POST["difficulty"];
$db_dotsAmount=$_POST["dotsAmount"];
$db_pause=$_POST["pause"];
}
else
{
$db_game_mode="5p";
$db_difficulty="easy";
$db_dotsAmount=$_COOKIE["dotsAmount"];
$db_pause=$_COOKIE["pause"];
}
if(stristr($db_game_mode, "p") === FALSE)
{ {
$sql='select score, player from score where game_mode="'.$_POST['game_mode'].'" and difficulty="'.$_POST['difficulty'].'" and dots_amount='.$_POST["dotsAmount"].' and pause='.$_POST["pause"].' order by score desc limit '.$toDisp; $sql='select score, player from score where game_mode="'.$db_game_mode.'" and difficulty="'.$db_difficulty.'" and dots_amount='.$db_dotsAmount.' and pause='.$db_pause.' order by score desc limit '.$toDisp;
$unit="points"; $unit="points";
} }
else else
{ {
$sql='select score, player from score where game_mode="'.$_POST['game_mode'].'" and difficulty="'.$_POST['difficulty'].'" and dots_amount='.$_POST["dotsAmount"].' and pause='.$_POST["pause"].' order by score asc limit '.$toDisp; $sql='select score, player from score where game_mode="'.$db_game_mode.'" and difficulty="'.$db_difficulty.'" and dots_amount='.$db_dotsAmount.' and pause='.$db_pause.' order by score asc limit '.$toDisp;
$unit="secondes"; $unit="secondes";
} }
$result = $database->query($sql); $result = $database->query($sql);
@ -176,11 +191,16 @@ if(isset($_POST["game_mode"]) && $_POST["game_mode"]!="" && $_POST["difficulty"]
} }
echo "<h1 id='aya' class='texte mode-container' >".$phrase."</h1>"; echo "<h1 id='aya' class='texte mode-container' >".$phrase."</h1>";
if(isset($_POST["game_mode"]) && $_POST["game_mode"]!="" && $_POST["difficulty"]!="" && $_POST["dotsAmount"]!="" && $_POST["pause"]!="")
{
echo "<input type='hidden' id='modeSel' value='".$_POST["game_mode"]."'/>"; echo "<input type='hidden' id='modeSel' value='".$_POST["game_mode"]."'/>";
echo "<input type='hidden' id='diffSel' value='".$_POST["difficulty"]."'/>"; echo "<input type='hidden' id='diffSel' value='".$_POST["difficulty"]."'/>";
echo "<input type='hidden' id='dotsAmountSel' value='".$_POST["dotsAmount"]."'/>"; echo "<input type='hidden' id='dotsAmountSel' value='".$_POST["dotsAmount"]."'/>";
echo "<input type='hidden' id='pauseSel' value='".$_POST["pause"]."'/>"; echo "<input type='hidden' id='pauseSel' value='".$_POST["pause"]."'/>";
} }
?> ?>
<div class="mode-container"> <div class="mode-container">
<ul id="btns_play"> <ul id="btns_play">

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 15 KiB

@ -353,17 +353,17 @@ function copyMDArray(array) //permet la copie d'arrays sans copier les référen
function generate(){ function generate(){
tabObj=[copyMDArray(tab1),copyMDArray(tab2),copyMDArray(tab3),copyMDArray(tab4)]; tabObj=[copyMDArray(tab1),copyMDArray(tab2),copyMDArray(tab3),copyMDArray(tab4)];
tabObjCmp=[]; tabObjCmp=[];
var actions=getRandomInt(4)+1; var actions=getRandomInt(4)+1; //2-6
var swapTreshold=11; var swapTreshold=11;
var switchTreshold=11; var switchTreshold=11;
if(difficulty=="med") //70% tournerD, 30% swap if(difficulty=="med") //70% tournerD, 30% swap
{ {
actions+=getRandomInt(3)+3; actions+=getRandomInt(3)+3; //+4-6 6-12
swapTreshold=8; swapTreshold=8;
} }
if(difficulty=="hard") //50% tournerD, 30% swap, 20% switch if(difficulty=="hard") //50% tournerD, 30% swap, 20% switch
{ {
actions+=getRandomInt(5)+5; actions+=getRandomInt(5)+5; //+6-10 12-22
swapTreshold=6; swapTreshold=6;
switchTreshold=9; switchTreshold=9;
} }

Loading…
Cancel
Save