<?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 ;
// entete de la page

include 'menu/header.php';

$num_ligne=$_GET['num_ligne'];

$myart =new saisies_abat;
$select ="select * FROM saisies_abat WHERE num_ligne='$num_ligne'";
$result = mysqli_query($link, $select);
$myart->getnum($result);
while ($myart->z < $myart->num) {
  $myart->readrow($result);
  $num_ligne=$myart->num_ligne ;
  $Num_certificat=$myart->num_certificat ;
  $date_saisie=$myart->date_saisie ;
  $Num_abat=$myart->num_abat ;
  $poid_saisie=$myart->poid_saisie ;
}

//$date_saisie=date("d/m/Y", strtotime($date_saisie));
echo "<center><br>";
// titre page
echo "<div class='titre-text'><center>MODIFICATION SAISIE ABATTOIR N&deg;: ".$num_ligne."<br></div><br>" ;


Echo "<table cellspacing=0 cellpadding=0 align=center border=0>";
Echo "<tbody>";
echo "<span class='t-text'><b>Saisies Abattoir</b></span> <b> : </b>";
echo "<a href='saisie_saisieabattoir.php'><b>Saise</b></a> <b> | </b>";
echo "<a href='saisieabat.php?limite=0'><b>Consulter</b></a> <b> | </b>";
echo "<a href='saisieabat.php?limite=0'><b>Modifier</b></a>";
Echo "</td></tr>";
Echo "</tbody>";
Echo "</table><br>";



echo "<form id='form1' name='form1' method='post' action='saisie_modif_Sasieabattoir_verif.php'>";
echo "<table class='t-text' width='400' border='1' cellspacing='1' cellpadding='1'>";
echo "<tr>";
echo "<td>Date Saisie</td>";
echo "<td>";
  
  $class = '';
  $fyear='2010';
  $lyear='2050';
  $name = 'DateSaisie';

  $yr=date("Y",strtotime($date_saisie));
  $mo=date("m",strtotime($date_saisie));
  $dy=date("d",strtotime($date_saisie));

  
 // Jour 
  
  $s="<SELECT NAME=\"${name}_d\" class='$class'>\n"; 
  $s.="<OPTION VALUE=$dy>$dy</OPTION>\n";
  $sclt=""; 
  for ($i=1;$i<=31;$i++) 
  { 
  $i2="0$i"; 
  $i2=substr($i2, -2); 
  if ($i2==$dy) 
  $sclt=" SELECTED"; 
  else 
  $sclt=""; 
  $s.="<OPTION VALUE=\"$i2\"$sclt>$i</OPTION>\n";
  } 
  $s.="</SELECT> / "; 

 // Mois 
  
  $s.="<SELECT NAME=\"${name}_m\" class='$class'>\n"; 
  $s.="<OPTION VALUE=$mo>$mo</OPTION>\n";
  $sclt=""; 
  for ($i=1;$i<=12;$i++) 
  { 
  $i2="0$i"; 
  $i2=substr($i2, -2); 
  if ($i2==$mo) 
  $sclt=" SELECTED"; 
  else 
  $sclt=""; 
  $mon2=date("M", mktime(0, 0, 0, $i, 1, 2001));
  $s.="<OPTION VALUE=\"$i2\"$sclt>$mon2</OPTION>\n";
  } 
  $s.="</SELECT> / "; 

 // 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></tr>";
echo "<tr>";
echo "<td>Num Certificat</td>";
echo "<td><input type='text' name='Num_certificat' value='$Num_certificat' size='15' /></td>";
echo "</tr>";
echo "<tr>";
echo "<td>Num Abat</td>";
echo "<td><select name='Num_abat' id='Num_abat' STYLE='width:90' >";

$myart =new entreabat;
$select = 'select * FROM entreabat';
$select.=" Where IdNumClient='".$IdNumClient."'";
$result = mysqli_query($link, $select);
$myart->getnum($result);
while ($myart->z < $myart->num) {
  $myart->readrow($result);
  $Num_Abatage=$myart->Num_Abatage ;

if ($Num_abat==$Num_Abatage){
echo "<option value='$Num_Abatage' SELECTED >$Num_Abatage</option>";
} Else { 
echo "<option value='$Num_Abatage'>$Num_Abatage</option>";
}
}
echo "</select></td>";
echo "</tr>";
echo "<tr>";
echo "<td>Poid Saisie</td>";
echo "<td><input type='text' name='poid_saisie' value='$poid_saisie' size='5' /></td>";
echo "</tr>";
echo "</table>";
echo "<br>";
echo "<form id='form1' name='form1' method='post' action='saisie_modif_Sasieabattoir_verif.php'>";
echo "<input type='hidden' name='num_ligne' value='$num_ligne'/>";
echo "<input type='submit' value='O.K'>" ;
	  

include 'menu/footer.php';
?>