<?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_fournisseur=$_GET['Num_fournisseur'];

//echo "<center>".$Num_fournisseur."<br>" ;

echo "<div class='titre-text'><center>Modification Fournisseurs</div></center><HR size='1' width='500'><br>" ;
echo "<center>";

$myart =new clients;
$select = "SELECT * FROM fournisseurs WHERE Num_fournisseur='$Num_fournisseur'";
$result = mysqli_query($link, $select);
$myart->getnum($result);
while ($myart->z < $myart->num) {
  $myart->readrow($result);
  $Num_fournisseur=$myart->Num_fournisseur ;
  $Ident_four=$myart->Ident_four ;
  $Nom_Fournisseur=$myart->Nom_Fournisseur ;
  $Adr_Client1=$myart->adresse_1 ;
  $Adr_Client2=$myart->Adresse_2 ;
  $Adr_Client3=$myart->Adresse_3 ;
  $Code_Postal=$myart->Code_Postal ;
  $Ville=$myart->Ville ;
  $Telephone=$myart->Telephone ;
  $Portable=$myart->Portable ;
  $note=$myart->Note ;
  $num_cate_four_base=$myart->num_cate_four ;
} 

//echo $num_cate_four_base.' | '.$num_cate_four ;

echo "<form name='FormFour' method='post' action='traitement-fournisseurs.php'>";
echo "<input type='hidden' name='Num_fournisseur' value='$Num_fournisseur'/>"; 
echo "<table class='t-text' width='700' border='0' cellspacing='1' cellpadding='1'>";
echo "<tr>";
echo "<th width='120' align='center' valign='middle' scope='col'>Cat&eacute;gorie</th>";
echo "<th width='120' scope='col'>";
	   

// selection num_categorie_four

echo "<select name='num_cate_four_sel' id='num_cate_four_sel'>";

$myart =new categorie_fournisseurs;
$select = 'select * FROM categorie_fournisseurs';
$result = mysqli_query($link, $select);
$myart->getnum($result);
while ($myart->z < $myart->num) {
  $myart->readrow($result);
  $num_cate_four=$myart->num_cate_four ;
  $categorie_four=$myart->categorie_four ;

if ($num_cate_four==$num_cate_four_base)
	echo "<option value='$num_cate_four' selected='selected'>$categorie_four</option>";
else
	echo "<option value='$num_cate_four'>$categorie_four</option>";
}
echo "</select>";


//

echo "</th> ";
echo "<th width='120' align='center' valign='middle' scope='col'>Ident : </th>
      <th width='117' scope='col'>
	  <input name='Ident_four' type='text' id='Ident_four' accesskey='2' tabindex='2' value='$Ident_four' size='20' maxlength='10'></th>";
echo "</tr>";
echo "<tr>";
echo "<th align='center' valign='middle' scope='row'>Nom </th>
      <td colspan='0'>
      <input name='Nom_client' type='text' id='Nom_client' accesskey='3' tabindex='3' value='$Nom_Fournisseur' size='30' maxlength='30'>
	<td rowspan='4' colspan='3'> 
	<center><span class='t-text'><b>Note</b></span>
	<TEXTAREA name='note' id='note' accesskey='9' tabindex='9' value='$note' rows=6 COLS=25>$note</TEXTAREA></td>
        </center>
      </td>";
echo "</tr>";
echo "<tr>";
echo "<th align='center' valign='middle' scope='row'>Adresse </th>
      <td colspan='0'>
	  <input name='Adresse_1' type='text' id='Adresse_1' accesskey='4' tabindex='4' value='$Adr_Client1' size='30' maxlength='30'></td>";
echo "</tr>";
echo "<tr>";
echo "<th align='center' valign='middle' scope='row'>Adresse</th>
      <td colspan='0'>
	  <input name='Adresse_2' type='text' id='Adresse_2' accesskey='5' tabindex='5' value='$Adr_Client2'  size='30' maxlength='30'></td>";
echo "</tr>";
echo "<tr>";
echo "<th align='center' valign='middle' scope='row'>Adresse</th>
      <td colspan='0'>
	  <input name='Adresse_3' type='text' id='Adresse_3' accesskey='6' tabindex='6' value='$Adr_Client3'  size='30' maxlength='30'></td>";
echo "</tr>";
echo "<tr>";
echo "<th align='center' valign='middle' scope='row'>Code Postal</th>
      <td><input name='Code_postal' type='text' id='Code_postal' accesskey='7' tabindex='7' value='$Code_Postal'></td>";
echo "<th align='center' valign='middle'><strong>Ville</strong></th>
      <td><input type='text' name='Ville' id='Ville' accesskey='8' tabindex='8' value='$Ville'></td>";
echo "</tr>";
echo "<tr>";
echo "<th align='center' valign='middle' scope='row'>T&eacute;l&eacute;phone</th>
      <td><input name='Telephone' type='text' id='Telephone' accesskey='9' tabindex='9' value='$Telephone'></td>";
echo "<th align='center' valign='middle'><strong>Portable</strong></th>
      <td><input type='text' name='Portable' id='Portable' accesskey='10' tabindex='10' value='$Portable'></td>";
echo "</tr>";
echo "<tr>";
echo "<td colspan='2' align='center' valign='middle' scope='row'>
	  <input type='submit' name='ok' id='ok' value='Valider' accesskey='11' tabindex='11'></td>";
echo "<td colspan='2' align='center' valign='middle'>
	  <input name='an' type='button' id='an' accesskey='12' tabindex='12' value='Retour' onClick='history.back()'></td>";
echo " </tr></div>";
echo "</table>";
echo "</form>";

include 'menu/footer.php';
?>
