commit e25fdc247e5da4e0f0f5350f180bb9539bdcc47e
parent 7b5d679233ab32177acb127d284d315fc6fd171b
Author: Yoann Bonavero <yoann.b87@voila.fr>
Date: Thu, 10 Mar 2011 10:30:40 +0100
Correction de l'affichage des relations.
Diffstat:
2 files changed, 12 insertions(+), 6 deletions(-)
diff --git a/code/serveur/php/createGame.php b/code/serveur/php/createGame.php
@@ -44,6 +44,9 @@ if(isset($_POST['nbcloudwords'])) {
$msg = $strings['err_creategame_eq_relations'];
}
}
+ else if($state == 2) {
+
+ }
else {
$err = true;
$msg = $strings['err_creategame_fill_all'];
@@ -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)
diff --git a/code/serveur/php/pticlic.php b/code/serveur/php/pticlic.php
@@ -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;