<?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';

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

$num_mrs=$_GET['num_mrs'];

$myart =new saisies_abat;
$select ="select * FROM table_mrs_haut WHERE num_mrs='$num_mrs'";
$result = mysql_query($select);
$myart->getnum($result);
while ($myart->z < $myart->num) {
  $myart->readrow($result);
  $num_mrs=$myart->num_mrs ;
  $Num_Bon=$myart->Num_Bon ;
  $Date_Bon=$myart->Date_Bon ;
  $PoidMrs=$myart->PoidMrs ;
  $Prestataire=$myart->Prestataire ;
  $enleve=$myart->enleve ;
}

// menu haut new-supp-modif

echo "<center>";
Echo "<table cellspacing=0 cellpadding=0 align=center border=0>";
Echo "<tbody>";
echo "<a href='saisie_ajout_mrs.php'><b>Nouveau</b></a> <b> | </b>";
echo "<a href=''><b>Consulter</b></a> <b> | </b>";
echo "<a href=''><b>Supprimer</b></a> <b> | </b>";
echo "<a href=''><b>Modifier</b></a>";
Echo "</td></tr>";
Echo "</tbody>";
Echo "</table>";

//echo "total : ".$total."| limite  ".$limite."<br> limite suivante ".$limitesuivante."| limite precedente".$limiteprecedente ."<br>";
echo "<br> Modification des M.R.S.<br><br>" ;
echo "<form id='form1' name='form1' method='post' action='modif_haut_mrs.php'>";
echo "<table align='top' width='500' cellpadding='1' cellspacing='1' border='1'>";
echo "<tr>";
echo "<td><span class='t-text'>Num Bon </td></span>";
echo "<td><span class='t-text'><input type='text' size='10' maxlength='10' name='Num_Bon' value=$Num_Bon /></span></td>";
echo "<td><span class='t-text'>Date Bon</td>";
echo "<td><span class='t-text'>";

  $class = '';
  $fyear='2010';
  $lyear='2050';
  $name = 'Date_Bon';

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

  
 // 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 "</span></td></td>";
echo "</tr>";
echo "<tr>";
echo "<td><span class='t-text'>Poids </td></span>";
echo "<td><span class='t-text'><input type='text' size='10' maxlength='10' name='PoidMrs' value=$PoidMrs /></span></td>";
echo "<td><span class='t-text'>Etat</span></td>";
echo "<td><select size='1' name='etatenlev'><span class='t-text'>";
echo "<option value='1'>Enleve</option>";
echo "<option value='0'>Non eneleve</option>";
echo "</select></span></td>";
echo "</tr>";
echo "</table>";
echo "<input type='hidden' name='num_mrs' value='$num_mrs'/>";
echo "<br><input type='submit' value='Modifier'>";
echo "</form>";


include 'menu/footer.php';
?>