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


$Ident_four=htmlentities($_POST['ident_four']);
$Nom_Client=htmlentities($_POST['Nom_client']);
$Adr_Client1=htmlentities($_POST['Adresse_1']);
$Adr_Client2=htmlentities($_POST['Adresse_2']);
$Adr_Client3=htmlentities($_POST['Adresse_3']);
$Telephone=htmlentities($_POST['Telephone']);
$Code_postal=htmlentities($_POST['Code_postal']);
$Ville=htmlentities($_POST['Ville']);
$Portable=htmlentities($_POST['Portable']);
$note=htmlentities($_POST['note']);
$num_cate_four_sel= htmlentities($_POST['num_cate_four_sel']);

//include 'menu/header.php';

$last_num_entre = 0 ;
$sql = "SELECT max(Num_fournisseur) FROM fournisseurs";  
$req = mysqli_query($link, $sql); 
$row = mysqli_fetch_row($req);
$last_num_entre = $row[0];
$new_num_entre = $last_num_entre + 1 ;

$Ident_four = strtoupper($Ident_four);

echo "<center>";

echo " Num fournisseur :".$last_num_entre." | ".$new_num_entre."<br> 
ident Four : ".$Ident_four."<br> 
nom clt : ".$Nom_Client." adr 1 :".$Adr_Client1."<br>
adr 2 : ".$Adr_Client2." adr 3 : ".$Adr_Client3."<br>
CodePostal : ".$Code_postal." Ville : ".$Ville."<br>
tel : ".$Telephone." Port : ".$Portable."<br> 
note : ".$note." categorie four : ".$num_cate_four_sel."<br>" ;

$sql = "INSERT INTO fournisseurs VALUES (
'".$new_num_entre."', 
'".$IdNumClient."', 
'".$Ident_four."', 
'".$Nom_Client."', 
'".$Adr_Client1."', 
'".$Adr_Client2."', 
'".$Adr_Client3."', 
'".$Code_postal."', 
'".$Ville."', 
'".$Telephone."', 
'".$Portable."', 
'".$note."', 
'".$num_cate_four_sel."')";


echo "<br>".$sql."<br>";
 
$res = mysqli_query($link, $sql);

echo "<br> Requette : ".$res ;

Header("Location: fournisseurs.php?limite=0");

?>
