<?php
include("include/data.php");
Init_boutique();
global $base, $MySQL_Host, $MySQL_User, $MySQL_Passw, $myart, $A_NumArt,$i, $result, $NbLigne, 
$mygroupeart, $mysousgroupeart, $semaine, $limitesuivante, $limiteprecedente, $limite, $total, 
$page, $Nom_Client, $NumAbat, $mrs ;
// entete de la page
include 'menu/header.php';

$date = date("d-m-Y");

$Num_entre=$_GET['Num_entre'];
//echo "<br>Num Entre : ".$Num_entre."<br>" ;

$myart =new entreabat;
$select = "SELECT * FROM entreabat WHERE Num_entre='$Num_entre'";
$result = mysqli_query($link, $select);
$myart->getnum($result);
while ($myart->z < $myart->num) {
  $myart->readrow($result);
  $Num_entre=$myart->Num_entre ;
  $Num_Abattoir=$myart->Num_Abattoir ;
  $Date_Entre=$myart->Date_Entre ;
  $DataAbat=$myart->DataAbat ;
  $DateDecoupe=$myart->DateDecoupe ;
  $SemaineAbat=$myart->SemaineAbat ;
  $NumIdentAn=$myart->NumIdentAn ;
  $Num_Abatage=$myart->Num_Abatage ;
  $NumTicket=$myart->NumTicket ;
  $Poid=$myart->Poid ;
  $Num_categoriePlu=$myart->Num_categoriePlu ;
  $Observations=$myart->Observations ;
  $Num_Client=$myart->Num_Client ;
  $Num_Plu=$myart->Num_Plu ;
  $Num_Lot=$myart->Num_Lot ;
  $Poid_saisie=$myart->Poid_saisie ;;
  $Poid_entre=$myart->Poid_entre ;;
  
}
// menu haut new-supp-modif

echo "<center><br>Consultation<br><br>";

$date_e=date("d/m/Y", strtotime($Date_Entre));
$date_a=date("d/m/Y", strtotime($DataAbat));
$date_d=date("d/m/Y", strtotime($DateDecoupe));
// echo  date("d/m/Y", strtotime($Date_Entre))." ".$date_e;


$Num_Abattoirs=$Num_Abattoir;


echo "<table class='t-text' width='500' border='1' cellspacing='2' cellpadding='2'>";
echo "<tr>";
echo "<td width='100'>Num Abattoir</td>";
echo "<td width='150'>";

$myart =new abattoir;
$select = 'select * FROM abattoir';
$result = mysqli_query($link, $select);
$myart->getnum($result);
while ($myart->z < $myart->num) {
  $myart->readrow($result);
  $id_abat=$myart->id_abat ;
  $Num_Abattoirf=$myart->Num_Abattoir ;
  $Nom_abattoir=$myart->Nom_abattoir ;
  $Ville_Abat=$myart->Ville_Abat;

if ($id_abat==$Num_Abattoirs)
	echo $Ville_Abat;
}
echo "</td>";
echo "<td width='100'>Date Entre</td>";
echo "<td width='150'>".$date_e; //.$Date_Entre;
 
echo "</td></tr>";
echo "<tr>";
echo "<td>Client :</td>";
echo "<td>";

$myart =new clients;
$select = 'select * FROM clients';
$result = mysqli_query($link, $select);
$myart->getnum($result);
while ($myart->z < $myart->num) {
  $myart->readrow($result);
  $Num_Clientf=$myart->Num_Client ;
  $Let_Client=$myart->Let_Client ;
  $Nom_Client=$myart->Nom_Client ;

if  ($Num_Client==$Num_Clientf) 
echo $Let_Client." | ".$Nom_Client;
}

echo "</td>";
echo "<td>Date abatage</td>";
echo "<td>".$date_a; 
echo "</td>";
echo "</tr>";
echo "<tr>";
echo "<td>Num Identification</td>";
echo "<td>".$NumIdentAn."</td>";
echo "<td>Date decoupe</td>";
echo "<td>".$date_d."</td>";
echo "</tr>";
echo "<tr>";
echo "<td>Num Ticket</td>";
echo "<td>".$NumTicket."</td>";
echo "<td>Num abatage</td>";
echo "<td>".$Num_Abatage."</td>";
echo "</tr>";
echo "<tr>";
echo "<td>Poids</td>";
echo "<td>".$Poid." Kg</td>";
echo "<td>Categorie Plu</td>";
echo "<td>";

$myart =new categorieplu;
$select = 'select * FROM categorieplu';
$result = mysqli_query($link, $select);
$myart->getnum($result);
while ($myart->z < $myart->num) {
  $myart->readrow($result);
  $Num_CatPluf=$myart->Num_CatPlu ;
  $CategoriePlu=$myart->CategoriePlu ;
  
if  ($Num_CatPluf==$Num_categoriePlu)   
  echo $Num_CatPluf." | ".$CategoriePlu;
}

echo "</td>";
echo "</tr>";
echo "<tr>";
echo "<td>Saisie : </td>";
if ($Poid_saisie!=0) {
echo "<td><font color='red'>".$Poid_saisie." Kg</font></td>";
} else {
echo "<td>".$Poid_saisie." Kg</td>";  
}
echo "<td>Semaine abatag : </td>";
echo "<td>$SemaineAbat</td>";
echo "</tr>";
echo "<tr>";
echo "<td>Poid entre : </td>";
echo "<td><font color='green'>".$Poid_entre." Kg</font></td>";

echo "<td>Num Lot : </td>";
echo "<td>$Num_Lot</td>";
echo "</tr>";
echo "<tr>";
echo "<td>Observations</td>";
echo "<td colspan='4'>$Observations</td>";
echo "</tr>";
echo "</table>";
echo "<br><br>";
echo "<a href='#' onclick='javascript:history.go(-1);'>O.K. |</a>";
echo "<A HREF='javascript:Popup(\"edition_abattoir.php?Num_entre=$Num_entre\",700,400,\"location=0,menubar=0,scrollbars=0,statusbar=0\")'>Edition</A>";


include 'menu/footer.php';
?>