<?php
include("include/data.php");
Init_boutique();
global $base, $MySQL_Host, $MySQL_User, $MySQL_Passw, $myart, $result, $NbLigne, $semaine, $limitesuivante, $limiteprecedente, $total, $page ;
// entete de la page

include 'menu/header.php';
$num_entre=$_GET['Num_entre'];

$myart =new plu_intrant;
$select = "SELECT * FROM plu_intrant WHERE num_plu_intrant='$num_entre'";
$result = mysqli_query($link, $select);
$myart->getnum($result);
while ($myart->z < $myart->num) {
  $myart->readrow($result);
  $num_plu_intant=$myart->num_plu_intrant ;
  $nom_plu_intrant=$myart->nom_plu_intrant ;
  $num_cate_intrant=$myart->num_cate_intrant ;
  $num_unite_plu_intrant=$myart->num_unite ;
  $dlc_plu_intrant=$myart->dlc_plu_intrant ;
}
/**
echo "<br>num entre : $num_entre | $select<br>" ;
echo "$num_plu_intant | $nom_plu_intrant | $num_cate_intrant | $num_unite_plu_intrant | $dlc_plu_intrants<br>" ;
**/

echo "<br><center><b>Modification Plu Intrants</b></center>" ;

echo "<center><HR size='1' width='500'></center>";
echo "<center><br>" ;
echo "<form name='FormIntrant' method='POST' action='traitement_modif_plu_intrant.php'>";
echo "<input type='hidden' name='num_entre' value='$num_entre'/>";
echo "<table class='t-text' width='370' border='1' cellspacing='1' cellpadding='1'>";
echo "<tr>";
echo "<th width='120' align='center' valign='middle'>Categorie</th>
	  <th width='120' align='left' valign='middle'>";
echo "<select name='num_cate_plu_intran' id='num_cate_plu_intran'>";

$myart =new categorie_intrant;
$select = 'select * FROM categorie_intrant';
$result = mysqli_query($link, $select);
$myart->getnum($result);
while ($myart->z < $myart->num) {
  $myart->readrow($result);
  $num_cate_plu_intrant=$myart->num_cate_plu_intran ;
  $categorie_plu_intrant=$myart->categorie_plu_intran ;

 if ($num_cate_intrant==$num_cate_plu_intrant) {
	echo "<option value='$num_cate_plu_intrant' selected='selected'>$categorie_plu_intrant</option>";
 } else {
	echo "<option value='$num_cate_plu_intrant'>$categorie_plu_intrant</option>";
}


}
echo "</select>";

echo "</th></tr> ";
echo "<tr>";
echo "<th align='center' valign='middle'>Nom plu intrant : </th>
      <td colspan='0'>
      <input name='nom_plu_intrant' type='text' id='nom_plu_intrant' accesskey='3' tabindex='3' value='$nom_plu_intrant' size='30' maxlength='30'>
	 </td>";
echo "</tr>";
echo "<tr>";
echo "<th align='center' valign='middle'>unit&#233;e </th>
      <td colspan='0'>" ;
echo "<select name='num_unitee_plu_intran' id='num_unitee_plu_intran'>";

$myart =new unitee ;
$select = 'select * FROM unitee';
$result = mysqli_query($link, $select);
$myart->getnum($result);
while ($myart->z < $myart->num) {
  $myart->readrow($result);
  $num_unitee=$myart->num_unite ;
  $nom_unite_long=$myart->nom_unite_long ;
  $nom_unite_ini=$myart->nom_unite_ini ;
  $conversion=$myart->conversion ;

  if ($num_unite_plu_intrant==$num_unitee) {
	echo "<option value='$num_unitee' selected='selected'>$nom_unite_ini | $nom_unite_long</option>";
 } else {
	echo "<option value='$num_unitee'>$nom_unite_ini | $nom_unite_long</option>";
 }
}
echo "</select>";
echo "</tr>";
echo "<tr>";
echo "<th align='center' valign='middle'>D.L.C </th>
      <td colspan='0'>
	  <input name='dlc_plu_intrant' type='text' id='dlc_plu_intrant' accesskey='5' tabindex='5' value='$dlc_plu_intrant'  size='20' maxlength='20'> jours</td>";
echo "</tr>";
echo "<tr>";
echo "<th colspan='2' align='center' valign='middle'>
	  <input type='submit' name='ok' id='ok' value='Valider' accesskey='11' tabindex='11'>
	  &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;
	  <input name='an' type='button' id='an' accesskey='12' tabindex='12' value='Retour' onClick='history.back()'></th>";
echo " </tr></div>";
echo "</table>";
echo "</form>";
echo "</center>" ;


include 'menu/footer.php';
?>
