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
| <html>
<head>
<title>Stock par magasins</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<?php
$link = mysql_connect("localhost","root","");//connexion local
mysql_select_db("bata",$link);
$query = " select num_art,num_mag,type_grille,total_stock,stockpt1,stockpt2,stockpt3,stockpt4,stockpt5,stockpt6,stockpt7,stockpt8,stockpt9,stockpt10,stockpt11,stockpt12,stockpt13,stockpt14 from articles,magasins,stock,grille where
stock.magasin = magasins.num_mag AND stock.ref_art = articles.num_art AND articles.grille_art=grille.type_grille AND num_art = ".$_POST["num_art"];
//.$_POST["num_mag"];
//.$_POST["num_art"];
$result = mysql_query($query,$link);//on interroge la base
$html = "<table width='30%' border='1'><tr>
<td width='20%'><b><font color=red>Articles</font></b></td>
<td width='20%'><b><font color=red>Magasins</font></b></td>
<td width='20%'><b><font color=red>grille</font></b></td>
<td width='20%'><b><font color=#FF0000>Stock total</font></b></td>
<td width='20%'><b><font color=red>stockpt1</font></b></td>
<td width='20%'><b><font color=red>Stockpt2</font></b></td>
<td width='20%'><b><font color=red>Stockpt3</font></b></td>
<td width='20%'><b><font color=red>Stockpt4</font></b></td>
<td width='20%'><b><font color=red>Stockpt5</font></b></td>
<td width='20%'><b><font color=red>Stockpt6</font></b></td>
<td width='20%'><b><font color=red>Stockpt7</font></b></td>
<td width='20%'><b><font color=red>Stockpt8</font></b></td>
<td width='20%'><b><font color=red>Stockpt9</font></b></td>
<td width='20%'><b><font color=red>Stockpt10</font></b></td>
<td width='20%'><b><font color=red>Stockpt11</font></b></td>
<td width='20%'><b><font color=red>Stockpt12</font></b></td>
<td width='20%'><b><font color=red>Stockpt13</font></b></td>
<td width='20%'><b><font color=red>Stockpt14</font></b></td>
</tr>";
while ($row = mysql_fetch_array($result)){
$html .= "<tr>
<td>".$row["num_art"]."</td>
<td>".$row["num_mag"]."</td>
<td>".$row["type_grille"]."</td>
<td>".$row["total_stock"]."</td>
<td>".$row["stockpt1"]."</td>
<td>".$row["stockpt2"]."</td>
<td>".$row["stockpt3"]."</td>
<td>".$row["stockpt4"]."</td>
<td>".$row["stockpt5"]."</td>
<td>".$row["stockpt6"]."</td>
<td>".$row["stockpt7"]."</td>
<td>".$row["stockpt8"]."</td>
<td>".$row["stockpt9"]."</td>
<td>".$row["stockpt10"]."</td>
<td>".$row["stockpt11"]."</td>
<td>".$row["stockpt12"]."</td>
<td>".$row["stockpt13"]."</td>
<td>".$row["stockpt14"]."</td>
</tr>";
}
$html .= "</table>";
echo $html; //On affiche la variable $html
mysql_free_result($result);
mysql_close($link);//on se d�connecte
?>
</body>
</html> |
Partager