Correction de l'affichage des relations.

This commit is contained in:
Yoann Bonavero 2011-03-10 10:30:40 +01:00
parent 7b5d679233
commit e25fdc247e
2 changed files with 12 additions and 6 deletions

View File

@ -43,6 +43,9 @@ if(isset($_POST['nbcloudwords'])) {
$err = true;
$msg = $strings['err_creategame_eq_relations'];
}
}
else if($state == 2) {
}
else {
$err = true;
@ -93,7 +96,7 @@ else
echo '<tr><td><label for="relation1">Relation 1 : </label></td>';
echo '<td class="inputcell"><select name="relation1">';
foreach($relations as $key=>$r)
echo '<option value="'.$ey.'">'.$r[1].'</option>';
echo '<option value="'.$key.'">'.$r[1].'</option>';
echo '</select></td>';
echo '<td><label for="relation2">Relation 2 : </label></td>';
echo '<td class="inputcell"><select name="relation2">';
@ -129,13 +132,13 @@ else
foreach($words as $key=>$w) {
echo '<td>'.$w.'</td><td class="inputcell">';
echo '<input type="radio" name="'.$key.'" id="'.$key.'_r1" value="0">';
echo '<input type="radio" name="rd'.$key.'" id="'.$key.'_r1" value="0">';
echo '<label for="'.$key.'_r1">'.$rels[0].'</label><br />';
echo '<input type="radio" name="'.$key.'" id="'.$key.'_r2" value="1">';
echo '<input type="radio" name="rd'.$key.'" id="'.$key.'_r2" value="1">';
echo '<label for="'.$key.'_r2">'.$rels[1].'</label><br />';
echo '<input type="radio" name="'.$key.'" id="'.$key.'_r3" value="2">';
echo '<input type="radio" name="rd'.$key.'" id="'.$key.'_r3" value="2">';
echo '<label for="'.$key.'_r3">'.$rels[2].'</label><br />';
echo '<input type="radio" name="'.$key.'" id="'.$key.'_r4" value="3">';
echo '<input type="radio" name="rd'.$key.'" id="'.$key.'_r4" value="3">';
echo '<label for="'.$key.'_r4">'.$rels[3].'</label></td>';
if($key%2 != 0)

View File

@ -557,7 +557,10 @@ function get_game_relations()
$db = getDB();
// TODO modifier la requête pour ne sélectionner que les relations pertinentes.
$res = $db->query("SELECT num,name FROM type_relation");
$res = $db->query("SELECT num,extended_name
FROM type_relation
WHERE num=5 OR num=7 OR num=9
OR num=10 OR num=13 OR num=14 OR num=22");
while($r = $res->fetchArray())
$relations[] = $r;