Commit 102e4882 authored by Mathieu Loiseau's avatar Mathieu Loiseau
Browse files

Change diviner language bug resolution

parent 9efdde30
...@@ -10,8 +10,9 @@ $db->query($sql); ...@@ -10,8 +10,9 @@ $db->query($sql);
$usedIsos = array(); $usedIsos = array();
while ($usedIso = $db->fetch_assoc()) { while ($usedIso = $db->fetch_assoc()) {
$language = $usedIso['langue']; $code = $usedIso['langue'];
$usedIsos[$language] = $iso[$language]; $usedIsos[$code] = $iso[$code];
} }
sort($usedIsos); //sort($usedIsos);
//removes the associations
\ No newline at end of file
...@@ -11,7 +11,7 @@ include('./sys/load_used_iso.php'); ...@@ -11,7 +11,7 @@ include('./sys/load_used_iso.php');
<select name="chooseLang" size="1" id="chooseLang" onchange="saveLangue()"> <select name="chooseLang" size="1" id="chooseLang" onchange="saveLangue()">
<?php <?php
foreach ($usedIsos as $short => $long) { foreach ($usedIsos as $short => $long) {
echo "<option value=" . $usedIso ; echo "<option value='" . $short."'" ;
if(isset($_SESSION["langDevin"])) if(isset($_SESSION["langDevin"]))
{ {
if(strcmp($_SESSION["langDevin"],$short) == 0){ echo " selected"; } if(strcmp($_SESSION["langDevin"],$short) == 0){ echo " selected"; }
...@@ -34,7 +34,7 @@ include('./sys/load_used_iso.php'); ...@@ -34,7 +34,7 @@ include('./sys/load_used_iso.php');
<script> <script>
function saveLangue() { function saveLangue() {
$.post("devinLangue.php","lang="+$('#chooseLang option:selected').val(),function (response){void window.location.reload(); $.post("devinLangue.php","lang="+$('#chooseLang').val(),function (response){void window.location.reload();
}); });
} }
</script> </script>
......
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