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 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102
| <?php
include("configuration.php");
$result = mysql_query("SELECT sbbproduit.id, sbbproduit.nom, sbbproduit.ancienprix, sbbproduit.spec, sbbproduit.photoarticle, sbbproduit.frais, sbbproduit.prix, sbbproduit.frsid, sbbfrs.frsid FROM sbbproduit, sbbfrs WHERE sbbproduit.frsid= sbbfrs.frsid AND sbbproduit.id=$id");
$row = mysql_fetch_row($result) or die('Erreur SQL !<br />'.$result.'<br />'.mysql_error());
?>
<table border="0" width="100%">
<tr><?php
if ($row[4] != "nul") {
$split = explode("../", $row[4]);
$row[4] = $split[1];
$img = "<img src=\"$row[4]\" width='120' height='120' target='blank'>";
$image2 = "<a href='$row[4]' target='blank'><b>Agrandir la photo</b></a><br>";
} else {
$img = "<img src=\"$images/na.jpg\" width=100 border=0>";
}
echo "<td colspan='2'>$img</a><br>$image2</td>";
?></tr><tr>
<td valign="top"><b>Article : </b></td>
<td><?php echo "$row[1]"; ?></td>
</tr>
<tr>
<td valign="top"><b>Descriptif : </b></td>
<?php
$descriptif = $row[3];
$descriptif = str_replace("[retour]","<br>",$descriptif);
$descriptif = str_replace("[gras]","<b>",$descriptif);
$descriptif = str_replace("[/gras]","</b>",$descriptif);
?>
<td><?php echo "$descriptif"; ?></td>
</tr>
<tr>
<td valign="top"></td>
<td></td>
</tr>
<?php
$fraisproduit1 = $row[5];
$fraisproduit2 = sprintf("%0.2f", $fraisproduit1);
?>
<tr>
<td valign="top"><b>Frais :</b></td>
<td><?php echo "$fraisproduit2"; ?> <?php echo "$devises"; ?></td>
</tr>
<tr>
<td valign="top"><b>Prix TTC : </b></td>
<?php
$price = $row[6];
$price = sprintf("%0.2f", $price);
$totalgeneral1 = ($price + $fraisproduit2);
$totalgeneral2 = sprintf("%0.2f", $totalgeneral1);
?>
<td><font color=navy><b><?php echo "$price"; ?> <?php echo "$devises"; ?> TTC</font></b></td>
<tr><td><b>Total TTC :</b></td><td><font class=grand><b><?php echo "$totalgeneral2"; ?> <?php echo "$devises"; ?></b></font></td>
</tr>
<?php
$ancienprix = $row[2];
$ancienprix = sprintf("%0.2f", $ancienprix);
echo "</tr><tr><td>Prix public :</td>";
echo "<td><font class=\"promo\">$ancienprix</font><font color=red> $devises TTC</td>";
$fournisseur = $row[7];
?>
<tr>
<td>Fournisseur : </td>
<td><?php echo $fournisseur; ?></td>
</tr>
</tr>
</table>
<form action="commande.php" method="post">
<input type="hidden" value="<?php echo "$row[0]"; ?>" name="id">
<table border="0">
<tr>
<td>Quantité: </td>
<td><input type="text" size="3" name="montant" value="1"></td>
<td colspan="2"><input type="submit" value="Commander"></td>
</tr>
</table>
</form>
<?php
// deconnexion de la base
mysql_close();
?> |