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
| <?php
$query_mat = "SELECT id_type, qt FROM demande where n_bonfour = '$bn' ";
$rr_mat = mysql_query($query_mat,$connexion) or die("insertion impossible: $query_mat <br>".mysql_error());
?>
<table width="260" border="1">
<tr>
<th width="151" scope="col">Article</th>
<th width="93" scope="col">Quantité</th>
</tr>
<?php
while ($result_cons = mysql_fetch_assoc($rr_mat)) {
?><tr>
<td>
<?php
$query = "SELECT nom_type, tp FROM type where id_type = '{$result_cons['id_type']}' ";
$rr = mysql_query($query,$connexion) or die("insertion impossible: $query <br>".mysql_error());
while ($result = mysql_fetch_assoc($rr)) {
if( $result['tp'] == 'mat' )
{ echo $result['nom_type'] ; ?></td>
<td> <?php echo $result_cons['qt'] ; }
}
}?></td>
<?php
elseif( $result['tp'] == 'mat' )
{
$que = "SELECT n_inv, nom FROM materiel where id_type = '{$result_cons['id_type']}' ";
$r = mysql_query($que,$connexion) or die("insertion impossible: $que <br>".mysql_error());
while ($n = mysql_fetch_assoc($r)) {
echo $n['nom_type']. ( $n['n_inv'] ); ?></td>
<td> <?php echo $result_cons['qt'] ; } ?></td>
<?php
}
else {echo 'dire rien ' ; } ?>
</tr> <?php }
}
?>
</table> |
Partager