Commit ecb42d9c authored by arnaudbey's avatar arnaudbey
Browse files

diviner can only play with existant card languages

parent 358a0b97
<?php
require_once 'sys/db.class.php';
include './sys/load_iso.php';
$db = db::getInstance();
$sql = 'SELECT DISTINCT langue FROM `cartes`';
$db->query($sql);
$usedIsos = array();
while ($usedIso = $db->fetch_assoc()) {
$language = $usedIso['langue'];
$usedIsos[$language] = $iso[$language];
}
sort($usedIsos);
<?php $title = 'Devin_menu';
include('./views/page.header.html');
include('./sys/load_iso.php');
include('./sys/load_used_iso.php');
?>
<div id="main-container">
<div id="center-block">
<!-- cette formulaire sert à choisir la langue de jeu-->
<form id="select_lang">
<h2><?php echo $lang['learning'];?>
<select name="chooseLang" size="1" id="chooseLang" onchange="saveLangue()">
<?php
foreach ($iso as $key => $val) {
echo "<option value=" . $key ;
if(isset($_SESSION["langDevin"]))
{
if(strcmp($_SESSION["langDevin"],$key) == 0){ echo " selected"; }
}
elseif (strcmp($user->langGame,$key) == 0) { echo " selected"; }
echo ">" . $val . "</option>";
}
?>
</select>
</h2>
</form>
<h2><?php echo $lang['start']; ?></h2>
<ul id="modes" class="nav nav-tabs">
<li type="button" id="start" class="btn btn-primary btn-lg btn-block" >
<a href="?mode=diviner.game" title="diviner_game"><?php echo $lang['game']; ?></a>
</li>
</ul>
<!-- cette formulaire sert à choisir la langue de jeu-->
<form id="select_lang">
<h2><?php echo $lang['learning'];?>
<select name="chooseLang" size="1" id="chooseLang" onchange="saveLangue()">
<?php
foreach ($usedIsos as $short => $long) {
echo "<option value=" . $usedIso ;
if(isset($_SESSION["langDevin"]))
{
if(strcmp($_SESSION["langDevin"],$short) == 0){ echo " selected"; }
}
elseif (strcmp($user->langGame,$short) == 0) { echo " selected"; }
echo ">" . $long . "</option>";
}
?>
</select>
</h2>
</form>
<h2><?php echo $lang['start']; ?></h2>
<ul id="modes" class="nav nav-tabs">
<li type="button" id="start" class="btn btn-primary btn-lg btn-block" >
<a href="?mode=diviner.game" title="diviner_game"><?php echo $lang['game']; ?></a>
</li>
</ul>
</div>
</div>
<script>
function saveLangue() {
$.post("devinLangue.php","lang="+$('#chooseLang option:selected').val(),function (response){void window.location.reload();
});
$.post("devinLangue.php","lang="+$('#chooseLang option:selected').val(),function (response){void window.location.reload();
});
}
</script>
<?php
include('./views/page.footer.html');
?>
......
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