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

include 'menu/header_edition.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 ;
  $NumTicket=$myart->NumTicket ;
  $Date_Entre=$myart->Date_Entre ;
  $DataAbat=$myart->DataAbat ;
  $SemaineAbat=$myart->SemaineAbat ;
  $NumIdentAn=$myart->NumIdentAn ;
  $Num_Abatage=$myart->Num_Abatage ;
  $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

?>
<BODY onLoad='$("#bcTarget").barcode("<?php echo "10110".$NumTicket."".$IdNumClient ; ?>", "code128",{barWidth:1 , barHeight:30}); window.print();' >
<!--div id="bcTarget"></div>-->
<?php

echo "<center>";
echo "<table width='600' border='0' cellpadding='1' cellspacing='1'>";
echo "<tr>";
echo "<td height='80' width='100'><center><img src='images/$LogoSite' width='80'></center></td>";
echo "<td class='texthaut' width='500'>$SocieteSite<br>$RueSite<br>$CpostalSite $VilleSite
			<br>
			T&eacute;l : $TelephoneSite <br> $MailSite </td>";
echo "<td><center><img src='images/agrem_$IdNumClient.jpg' width='50'></center></td>";
echo "<td height='80' width='100'><center><div id='bcTarget'></center></td>";

echo "</tr>";
echo "</table>";

echo "<center><br>Consultation Ticket pes&eacute; N&deg; $NumTicket<br><br>";

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


$Num_Abattoirs=$Num_Abattoir;


echo "<table class='t-text' width='600' border='1' cellspacing='3' cellpadding='3'>";
echo "<tr>";
echo "<td width='100'>Nom 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 Ident.</td>";
echo "<td>".$NumIdentAn."</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 :</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='window.close()'>Fermer</a>";

include 'menu/footer_edition.php';
?>