<?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_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 ;;
  
}
$Designation="";
$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)   
  $Designation.= " | ".$CategoriePlu." | ";
}

$Eleveur="";
$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) 
$Eleveur.=$Let_Client." | ".$Nom_Client ;
}

$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;

// menu haut new-supp-modif

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

// 1er
echo "<center>";
echo "<table width='800' border='1' cellpadding='0' cellspacing='0'>";
echo "<tr><td><center>";
echo "<table width='800' border='0' cellpadding='1' cellspacing='1'>";
echo "<tr>";
echo "<td class='textfiche' width='800'>$SocieteSite - $CpostalSite $VilleSite - $TelephoneSite </td>";
echo "</tr>";
echo "</table>"; echo "<br>";
echo "<table class='texthaut' width='750' border='0' cellspacing='0' cellpadding='0'>";
echo "<tr>";
echo "<td width='50'align='center' >Eleveur : </td>";
echo "<td width='450'>$Eleveur";
echo "</td>";
echo "<td width='75'align='center'>Date Entre</td>";
echo "<td width='75'align='center'>".$date_e; //.$Date_Entre;
 
echo "</td></tr>";
echo "</table>" ; echo "<br>";

echo "<table class='texthautFicheLot' width='750' border='0' cellspacing='0' cellpadding='0'>";
echo "<tr>";
echo "<td width='200' height='50' align='center' >N&deg; LOT : <hr width=90%></td>";
echo "<td width='550' align='center'>$Num_Lot";
echo "<hr width=90%></td></tr>";
echo "</table>" ;

echo "<table class='texthautFicheLot' width='750' border='0' cellspacing='0' cellpadding='0'>";
echo "<tr>";
echo "<td width='200' height='50' align='center' >D&eacute;signation : <hr width=90%></td>";
Echo "<td width='550' align='center'>$Designation - $NumIdentAn";
echo "<hr width=90%></td></tr>";
echo "</table>" ; echo "<br>";

echo "<table class='texthaut' width='750' border='0' cellspacing='0' cellpadding='0'>";
echo "<tr>";
echo "<td width='75'align='center' >Poids Carcasse : <hr></td>";
if ($Poid_saisie!=0) {
echo "<td width='150'>$Poid -	$Poid_saisie => $Poid_entre Kg<hr></td>";
} else {
echo "<td width='150'>$Poid_entre Kg<hr></td>";  
}
echo "<td width='250'></td>";
echo "<td width='100'align='center'><div id='bcTarget'></div></td>";
echo "</td></tr>";
echo "</table></table>" ;
echo "<br><hr width=50%><br>" ;
// 2eme
echo "<center>";
echo "<table width='800' border='1' cellpadding='0' cellspacing='0'>";
echo "<tr><td><center>";
echo "<table width='800' border='0' cellpadding='1' cellspacing='1'>";
echo "<tr>";
echo "<td class='textfiche' width='800'>$SocieteSite - $CpostalSite $VilleSite - $TelephoneSite </td>";
echo "</tr>";
echo "</table>"; echo "<br>";
echo "<table class='texthaut' width='750' border='0' cellspacing='0' cellpadding='0'>";
echo "<tr>";
echo "<td width='50'align='center' >Eleveur : </td>";
echo "<td width='450'>$Eleveur";
echo "</td>";
echo "<td width='75'align='center'>Date Entre</td>";
echo "<td width='75'align='center'>".$date_e; //.$Date_Entre;
 
echo "</td></tr>";
echo "</table>" ; echo "<br>";

echo "<table class='texthautFicheLot' width='750' border='0' cellspacing='0' cellpadding='0'>";
echo "<tr>";
echo "<td width='200' height='50' align='center' >N&deg; LOT : <hr width=90%></td>";
echo "<td width='550' align='center'>$Num_Lot";
echo "<hr width=90%></td></tr>";
echo "</table>" ;

echo "<table class='texthautFicheLot' width='750' border='0' cellspacing='0' cellpadding='0'>";
echo "<tr>";
echo "<td width='200' height='50' align='center' >D&eacute;signation : <hr width=90%></td>";
Echo "<td width='550' align='center'>$Designation - $NumIdentAn";
echo "<hr width=90%></td></tr>";
echo "</table>" ; echo "<br>";

echo "<table class='texthaut' width='750' border='0' cellspacing='0' cellpadding='0'>";
echo "<tr>";
echo "<td width='75'align='center' >Poids Carcasse : <hr></td>";
if ($Poid_saisie!=0) {
echo "<td width='150'>$Poid -	$Poid_saisie => $Poid_entre Kg<hr></td>";
} else {
echo "<td width='150'>$Poid_entre Kg<hr></td>";  
}
echo "<td width='250'></td>";
echo "<td width='100'align='center'><div id='bcTarget1'></div></td>";
echo "</td></tr>";
echo "</table></table>" ;
echo "<br><hr width=50%><br>" ;
// 3eme
echo "<center>";
echo "<table width='800' border='1' cellpadding='0' cellspacing='0'>";
echo "<tr><td><center>";
echo "<table width='800' border='0' cellpadding='1' cellspacing='1'>";
echo "<tr>";
echo "<td class='textfiche' width='800'>$SocieteSite - $CpostalSite $VilleSite - $TelephoneSite </td>";
echo "</tr>";
echo "</table>"; echo "<br>";
echo "<table class='texthaut' width='750' border='0' cellspacing='0' cellpadding='0'>";
echo "<tr>";
echo "<td width='50'align='center' >Eleveur : </td>";
echo "<td width='450'>$Eleveur";
echo "</td>";
echo "<td width='75'align='center'>Date Entre</td>";
echo "<td width='75'align='center'>".$date_e; //.$Date_Entre;
 
echo "</td></tr>";
echo "</table>" ; echo "<br>";

echo "<table class='texthautFicheLot' width='750' border='0' cellspacing='0' cellpadding='0'>";
echo "<tr>";
echo "<td width='200' height='50' align='center' >N&deg; LOT : <hr width=90%></td>";
echo "<td width='550' align='center'>$Num_Lot";
echo "<hr width=90%></td></tr>";
echo "</table>" ;

echo "<table class='texthautFicheLot' width='750' border='0' cellspacing='0' cellpadding='0'>";
echo "<tr>";
echo "<td width='200' height='50' align='center' >D&eacute;signation : <hr width=90%></td>";
Echo "<td width='550' align='center'>$Designation - $NumIdentAn";
echo "<hr width=90%></td></tr>";
echo "</table>" ; echo "<br>";

echo "<table class='texthaut' width='750' border='0' cellspacing='0' cellpadding='0'>";
echo "<tr>";
echo "<td width='75'align='center' >Poids Carcasse : <hr></td>";
if ($Poid_saisie!=0) {
echo "<td width='150'>$Poid -	$Poid_saisie => $Poid_entre Kg<hr></td>";
} else {
echo "<td width='150'>$Poid_entre Kg<hr></td>";  
}
echo "<td width='250'></td>";
echo "<td width='100'align='center'><div id='bcTarget2'></div></td>";
echo "</td></tr>";
echo "</table></table>" ;
echo "<br><hr width=50%><br>" ;
// 4eme
echo "<center>";
echo "<table width='800' border='1' cellpadding='0' cellspacing='0'>";
echo "<tr><td><center>";
echo "<table width='800' border='0' cellpadding='1' cellspacing='1'>";
echo "<tr>";
echo "<td class='textfiche' width='800'>$SocieteSite - $CpostalSite $VilleSite - $TelephoneSite </td>";
echo "</tr>";
echo "</table>"; echo "<br>";
echo "<table class='texthaut' width='750' border='0' cellspacing='0' cellpadding='0'>";
echo "<tr>";
echo "<td width='50'align='center' >Eleveur : </td>";
echo "<td width='450'>$Eleveur";
echo "</td>";
echo "<td width='75'align='center'>Date Entre</td>";
echo "<td width='75'align='center'>".$date_e; //.$Date_Entre;
 
echo "</td></tr>";
echo "</table>" ; echo "<br>";

echo "<table class='texthautFicheLot' width='750' border='0' cellspacing='0' cellpadding='0'>";
echo "<tr>";
echo "<td width='200' height='50' align='center' >N&deg; LOT : <hr width=90%></td>";
echo "<td width='550' align='center'>$Num_Lot";
echo "<hr width=90%></td></tr>";
echo "</table>" ;

echo "<table class='texthautFicheLot' width='750' border='0' cellspacing='0' cellpadding='0'>";
echo "<tr>";
echo "<td width='200' height='50' align='center' >D&eacute;signation : <hr width=90%></td>";
Echo "<td width='550' align='center'>$Designation - $NumIdentAn";
echo "<hr width=90%></td></tr>";
echo "</table>" ; echo "<br>";

echo "<table class='texthaut' width='750' border='0' cellspacing='0' cellpadding='0'>";
echo "<tr>";
echo "<td width='75'align='center' >Poids Carcasse : <hr></td>";
if ($Poid_saisie!=0) {
echo "<td width='150'>$Poid -	$Poid_saisie => $Poid_entre Kg<hr></td>";
} else {
echo "<td width='150'>$Poid_entre Kg<hr></td>";  
}
echo "<td width='250'></td>";
echo "<td width='100'align='center'><div id='bcTarget3'></div></td>";
echo "</td></tr>";
echo "</table></table>" ;
echo "<br><hr width=50%>" ;
?>