1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79
| <?php
session_start();
if (isset($_POST) && !empty($_POST)) {
foreach($_POST AS $k => $v) {
$_SESSION[$_POST['form_number']][$k] = $v;
}
echo "<pre>";
print_r($_SESSION);
echo "</pre>";
}
$nombreDoublonPageCourante = 5;
for($i=0;$i<$nombreDoublonPageCourante;$i++){
//$chevaux=dsdeboub_chargerChevaux($doublons[$i]);
$chevaux = array(
array('id' => 1, 'id_race_naissance' => 2, 'race_naissance' => 'pur-sang'),
array('id' => 2, 'id_race_naissance' => 1, 'race_naissance' => 'pur-sang arabe'),
array('id' => 3, 'id_race_naissance' => 5, 'race_naissance' => 'dddddd'),
array('id' => 4, 'id_race_naissance' => 3, 'race_naissance' => 'aaaaa'),
);
?>
<form name="form" method="post" action="<?php print(htmlentities($_SERVER['PHP_SELF'])); ?>">
<table>
<caption><?php print(htmlentities('#'.($i+1)));?></caption>
<tr>
<th>X*</th>
<th>ID*</th>
<th>Race de naissance*</th>
<th>Mere*</th>
<th>Pere*</th>
<th>Sexe*</th>
</tr>
<?php foreach($chevaux as $cheval){ ?>
<tr>
<td>
<input type=checkbox name="id_chevaux_selectionnes[]" value="<?php print($cheval['id']);?>"
<?php
if ($_SESSION[$i]['id_chevaux_selectionnes'][0] == $cheval['id'])
echo ' checked="checked"';
?>
>
</td>
<td>
<input type=radio name="id" value="<?php print($cheval['id']);?>">
<?php print("#".$cheval['id']);?>
</td>
<td>
<input type=radio name="race_naissance" value="<?php print($cheval['id_race_naissance']);?>">
<?php if($cheval['race_naissance']){print($cheval['race_naissance']);}else{print("--");}?>
</td>
<td>
<input type=radio name="mere" value="<?php print($cheval['id_cheval_mere']);?>">
<?php if($cheval['mere']){print($cheval['mere']);}else{print("--");}?>
</td>
<td>
<input type=radio name="pere" value="<?php print($cheval['id_cheval_pere']);?>">
<?php if($cheval['pere']){print($cheval['pere']);}else{print("--");}?>
</td>
<td>
<input type=radio name="sexe" value="<?php print($cheval['id_sexe']);?>">
<?php if($cheval['sexe']){print($cheval['sexe']);}else{print("--");}?>
</td>
</tr><?php }?>
/* Bouttons d'action */
<tr>
<td class="action" colspan="3">
<input rel="dedoub_fusionner" name="fusionner" type="submit" value="Fusionner"/>
</td>
<td class="action" colspan="20">
<input rel="dedoub_voirFiche" name="voirFiche" type="submit" value="Voir la fiche"/>
</td>
</tr>
</table>
<p>
<input name="action" type="hidden" value=""/>
<input name="form_number" type="hidden" value="<?php echo $i; ?>"/>
</p>
</form>
<br/>
<?php } ?> |
Partager