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
| <?php
require_once '../models' . DIRECTORY_SEPARATOR . 'header.php';?>
<h2 style="text-align: center"><u>Détails De L'Entrée</u></h2>
<?php
$id_ent=$_GET['id'];
$type=$_GET['type'];
if($type==="produit d épicerie"){
$queryy= "Select categorie,produits.Id_produit from detail_ent join produits on produits.Id_produit=detail_ent.Id_produit join ent on detail_ent.id_ent=detail_ent.id_ent where detail_ent.id_ent='$id_ent' group by categorie order by Id_produit ";
$rslty= mysqli_query($conn, $queryy);
echo "<br><br><br><table id='customers' border='1' align=center style=' width: 100%'>";
echo "<thead style=' width: 16%'><tr><th>Id produit</th><th>designation</th><th>quantité</th><th>Prix</th><th>DLC</th><th>Valeur</th></tr></thead>\n";
$tot=0;
while ($rows= mysqli_fetch_array($rslty)){
$cat=$rows['categorie']?>
<tr>
<td colspan=7 style="text-align:center; bgcolor='#0000FF';"><u><b><?php print $cat ?><b></u></td></tr>
<?php $query= "select produits.prix,ent.id_ent,produits.id_produit,produits.designation,det_quantite,dlc,site.nom_site from detail_ent INNER join ent on detail_ent.id_ent=ent.id_ent inner join produits on detail_ent.id_produit=produits.Id_produit INNER join site on detail_ent.id_site=site.id_site where detail_ent.id_ent='$id_ent' and produits.categorie='$cat' ";
$rslt= mysqli_query($conn, $query);
$row= mysqli_num_rows($rslt);
if($row>0)
{
while ($row= mysqli_fetch_array($rslt)){
$site= $row['nom_site'];
$valeur = $row['det_quantite']*$row['prix'];
echo"<tr><td style=' width: 16%'>{$row['id_produit']}</td><td style=' width: 16%'>{$row['designation']}</td><td style=' width: 16%'>{$row['det_quantite']}</td><td style=' width: 11%'>{$row['prix']} dh</td><td style=' width: 16%'>{$row['dlc']}</td><td style=' width: 16%'>$valeur MAD</td></tr>\n";
$tot=$tot+$valeur;
}}}
echo "<tr><TD>TOTAL</TD><TD> </TD><TD> </TD><TD> </TD><TD> </TD>
<TD>$tot MAD</TD></tr>" ;
echo"</table>";
}
else{
$query= "select produits.prix,ent.id_ent,produits.id_produit,produits.designation,det_quantite,dlc,site.nom_site from detail_ent INNER join ent on detail_ent.id_ent=ent.id_ent inner join produits on detail_ent.id_produit=produits.Id_produit INNER join site on detail_ent.id_site=site.id_site where detail_ent.id_ent='$id_ent' ";
$rslt= mysqli_query($conn, $query);
$row= mysqli_num_rows($rslt);
if($row>0)
{ echo "<br><br><br><table id='customers' border='1' align=center style=' width: 100%'>";
echo "<thead style=' width: 16%'><tr><th>Id produit</th><th>designation</th><th>quantité</th><th>Prix</th><th>DLC</th><th>Valeur</th></tr></thead>\n";
$tot=0;
while ($row= mysqli_fetch_array($rslt)){
$type= $row['type'];
if($type==="produit d épicerie")
$site= $row['nom_site'];
$valeur = $row['det_quantite']*$row['prix'];
echo"<tr><td style=' width: 16%'>{$row['id_produit']}</td><td style=' width: 16%'>{$row['designation']}</td><td style=' width: 16%'>{$row['det_quantite']}</td><td style=' width: 11%'>{$row['prix']} dh</td><td style=' width: 16%'>{$row['dlc']}</td><td style=' width: 16%'>$valeur MAD</td></tr>\n";
$tot=$tot+$valeur;
}
echo "<tr><TD>TOTAL</TD><TD> </TD><TD> </TD><TD> </TD><TD> </TD>
<TD>$tot MAD</TD></tr>";
echo"</table>";
}
else{
echo "Veuillez contacter l'administrateur";}}?> |
Partager