<?php
include("include/data.php");
Init_boutique();
global $base, $MySQL_Host, $MySQL_User, $MySQL_Passw, $CodeArt, $myart, $NomArticle, $PrixArt, 
$PrixArtPd, $NumArt, $CodeArts, $A_NumArt,$i, $result, $NbLigne, $mygroupeart, $mysousgroupeart, $semaine, $s ;
// entete de la page
include 'menu/header.php';
echo "<center><HR size='2' width='500'>";
echo "Editions Mouvements Abattoirs";
echo "<HR size='2' width='500'></center>";
echo "<form id='form1' name='form1' method='get' action='edition_abattoirs_imp.php' TARGET=_BLANK>";
echo "<input type='hidden' name='ordre' value='5'/>"; 
Echo "<table width='800' cellpadding='2' cellspacing='2' align=center border=1><tr>";
Echo "<tr height='30'><td colspan=5><span class='t-text'><center>FILTRES<br></center></td></tr>";
echo "<tr height='30' class='text'>";
echo "<td>Par ann&eacute;e :";

  $class = '';
  $fyear='2011';
  $lyear='2050';
  $name = 'SelAnne';

  $yr=date("Y");
  // Année 
  
  $s.="<SELECT NAME=\"${name}_y\" class='$class'>\n"; 
  $s.="<OPTION VALUE=$yr>$yr</OPTION>\n";
  $sclt=""; 
  for ($i=$fyear;$i<=$lyear;$i++)
  { 
  $i2="$i"; 
  if ($i2==$yr) 
  $sclt=" SELECTED"; 
  else 
  $sclt=""; 
  $s.="<OPTION VALUE=\"$i\"$sclt>$i</OPTION>\n"; 
  } 
  $s.="</SELECT>\n"; 
    echo"$s";
echo "</td>";
echo "<td>Par semaine :";

  $class = '';
  $fyear='1';
  $lyear='53';
  $name = 'SelSem';

  $yr=date("W");
  // Année 
  
  $s="<SELECT style=' width: 65px;' NAME=\"${name}_w\" class='$class'>\n";
  $s.="<OPTION VALUE='0' SELECTED>Toutes</OPTION>\n";
  $s.="<OPTION VALUE=$yr>$yr</OPTION>\n";
  $sclt=""; 
  for ($i=$fyear;$i<=$lyear;$i++)
  { 
  $i2="$i"; 
  if ($i2==$yr) 
  //$sclt=" SELECTED";
  $sclt=""; 
  else 
  $sclt=""; 
  $s.="<OPTION VALUE=\"$i\"$sclt>$i</OPTION>\n"; 
  } 
  $s.="</SELECT>\n"; 
    echo"$s";
echo "</td>";
echo "<td>Par Cat&eacute;gorie : <select style=' width: 60px;' name='Num_CatPlu' id='Num_CatPlu'>";
echo "<option value='0'>Toutes</option>";
$myart =new categorieplu;
$select = 'select * FROM categorieplu';
$result = mysqli_query($link, $select);
$myart->getnum($result);
while ($myart->z < $myart->num) {
  $myart->readrow($result);
  $Num_CatPlu=$myart->Num_CatPlu ;
  $CategoriePlu=$myart->CategoriePlu ;
  echo "<option value='$Num_CatPlu'>$Num_CatPlu | $CategoriePlu</option>";
}

echo "</select>";
echo "</td>";
echo "<td rowspan='3'>Par Client : <select style=' width: 60px;' name='Num_Client' id='Num_Client'>";
echo "<option value='0'>Tous</option>";
$myart =new clients;
$select = 'select * FROM clients';
$select.=" WHERE `IdNumClient`='".$IdNumClient."'";
$result = mysqli_query($link, $select);
$myart->getnum($result);
while ($myart->z < $myart->num) {
  $myart->readrow($result);
  $Num_Client=$myart->Num_Client ;
  $Let_Client=$myart->Let_Client ;
  $Nom_Client=$myart->Nom_Client ;
echo "<option value='$Num_Client'>$Num_Client | $Let_Client | $Nom_Client</option>";
}
echo "</select>";
echo "</td></tr>";
echo "<tr>";
echo "<tr height='30' class='text'>";
echo "<td class='text'> intrerval de date : </td>";
echo "<td class='text'> Date D&eacute;but : <input type='date' name='date_debut'> </td>";
echo "<td class='text'> Date Fin : <input type='date' name='date_fin'> </td>";
echo "</td></tr>";
echo "<td colspan='4' align='center'><input type='submit' value='ok'></td>";
Echo "</tr>";
Echo "</table>";
echo "</form></center>";


include 'menu/footer.php';
?>