Commit 3bcaa85a authored by Mathieu Loiseau's avatar Mathieu Loiseau
Browse files

minor bug corrections

parent 090183f5
...@@ -48,5 +48,7 @@ enregistrements/* ...@@ -48,5 +48,7 @@ enregistrements/*
sys/db.config.php sys/db.config.php
sys/config.php sys/config.php
/add_cards.php /add_cards.php
/profil/*/*.jpg
/profil/*/*.png
/debug.html
/debug.txt /debug.txt
/profil/test1/mimas.jpg
...@@ -134,9 +134,6 @@ class druid_arbitrage ...@@ -134,9 +134,6 @@ class druid_arbitrage
require_once('./sys/load_iso.php'); require_once('./sys/load_iso.php');
$lang_iso = new IsoLang(); $lang_iso = new IsoLang();
require_once('./controllers/update_score_coeff.php'); require_once('./controllers/update_score_coeff.php');
if(isset($this->card)){
$sh = new ScoreHandler($this->druid, ScoreHandler::DRUID,(int) $this->enregistrement);
}
//connexion à la BD //connexion à la BD
$db = db::getInstance(); $db = db::getInstance();
...@@ -144,6 +141,9 @@ class druid_arbitrage ...@@ -144,6 +141,9 @@ class druid_arbitrage
$this->enregistrement = $_POST["enregistrement1"]; $this->enregistrement = $_POST["enregistrement1"];
$this->oracle = $_POST['oracle']; $this->oracle = $_POST['oracle'];
} }
if(isset($this->enregistrement)){
$sh = new ScoreHandler($this->druid, ScoreHandler::DRUID,(int) $this->enregistrement);
}
// après avoir cliqué sur "au bûcher" = description vide ou fautive // après avoir cliqué sur "au bûcher" = description vide ou fautive
if(isset($_POST['invalidate'])) if(isset($_POST['invalidate']))
{ {
......
<?php <?php
session_start(); session_start();
require_once("../sys/db.class.php"); require_once("../sys/db.class.php");
require_once("../models/user.class.php"); if(($_SESSION['userid'] == $_GET['user_id'])
$user = user::getInstance(); && isset($_GET['card_id'])){
if(($user->id == $_GET['user_id']) && isset($_GET['card_id'])){
$db = db::getInstance(); $db = db::getInstance();
$db->query("UPDATE `cartes` SET `dateSuppression` = CURRENT_TIMESTAMP, `idEraser` = '".$user->id."' WHERE `cartes`.`idCarte` = '".$_GET['card_id']."';"); $db->query("UPDATE `cartes` SET `dateSuppression` = CURRENT_TIMESTAMP, `idEraser` = '".$_SESSION['userid']."' WHERE `cartes`.`idCarte` = '".$_GET['card_id']."';");
if($db->affected_rows() == 1){ if($db->affected_rows() == 1){
echo "OK"; echo "OK";
} }
...@@ -17,4 +16,4 @@ ...@@ -17,4 +16,4 @@
print_r($lang); print_r($lang);
echo $user->id." ≠ ".$_GET['user_id']." : Problème de connexion, vous n'êtes plus vous-même…"; echo $user->id." ≠ ".$_GET['user_id']." : Problème de connexion, vous n'êtes plus vous-même…";
} }
?> ?>
\ No newline at end of file
...@@ -75,7 +75,7 @@ class IsoLang{ ...@@ -75,7 +75,7 @@ class IsoLang{
$this->db->query("SELECT `iso_code`,`$language` FROM `langues`"); $this->db->query("SELECT `iso_code`,`$language` FROM `langues`");
if($this->db->affected_rows() >= 1){ if($this->db->affected_rows() >= 1){
while($tmpObj = $this->db->fetch_object()){ while($tmpObj = $this->db->fetch_object()){
$res[$tmpObj->iso_code]=$tmpObj->language; $res[$tmpObj->iso_code]=$tmpObj->{$language};
} }
} }
else{ else{
......
...@@ -8,8 +8,9 @@ include('./sys/load_used_iso.php'); ...@@ -8,8 +8,9 @@ include('./sys/load_used_iso.php');
<!-- cette formulaire sert à choisir la langue de jeu--> <!-- cette formulaire sert à choisir la langue de jeu-->
<form id="select_lang"> <form id="select_lang">
<h2><?php echo $lang['learning'];?> <h2><?php echo $lang['learning'];?>
<select name="chooseLang" size="1" id="chooseLang" onchange="saveLangue()"> <!--select name="chooseLang" size="1" id="chooseLang" onchange="saveLangue()">
<?php <?php
//keep for when we want to have people play languages they don't speak…
foreach ($usedIsos as $short => $long) { foreach ($usedIsos as $short => $long) {
echo "<option value='" . $short."'" ; echo "<option value='" . $short."'" ;
if(isset($_SESSION["langDevin"])) if(isset($_SESSION["langDevin"]))
...@@ -20,6 +21,18 @@ include('./sys/load_used_iso.php'); ...@@ -20,6 +21,18 @@ include('./sys/load_used_iso.php');
echo ">" . $long . "</option>"; echo ">" . $long . "</option>";
} }
?> ?>
</select-->
<select name="chooseLang" size="1" id="chooseLang" onchange="changeParameters('Devin','lang')">
<?php
foreach (explode(';',$user->spoken_lang) as $l) {
if (strlen($l) > 0) {
$code = $lang_iso->language_code_for($l);
echo "<option value=" . $code ;
if (strcmp($user->langGame,$code) == 0) { echo " selected"; }
echo ">" . $l . "</option>";
}
}
?>
</select> </select>
<?php include_once("./views/level.menu.php"); <?php include_once("./views/level.menu.php");
print_level_choice('Devin',$lang,$user); print_level_choice('Devin',$lang,$user);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment