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

/*
http://192.168.1.200/horius/modif_base_user.php?num_ordre=1
IdNumClient=10001
SocieteSite=FERMES+DES+PAYS+BOURRIAN
Adresse_1Site=Le+Fournel
Adresse_2Site=
Code_PostalSite=46+310
VilleSite=MONTAMEL
TelephoneSite=05+65+20+17+90
TelecopieSite=
HTTPSite=HTTP%3A%2F%2Fwww.lesfermesdupaysbourian.com
EmailSte=cooperative-les-fermes-du-pays-bourian%40orange.fr
Num_AgrementSite=FR46196001CE
num_pf=10001
num_cde=10001
num_bl=10001
num_br=10001
num_fa=2019
num_av=10001
num_ec=10001
num_import_bl=25487
TxtFactMention=name%3D%27TxtFactMention%27
ok=Valider
*/

if (!isset($_GET['num_ordre'])) { 
		// Transmis en POST
	$num_ordre=$_POST['num_ordre'];
	if (isset($_POST['SocieteSite'])) 	{ $SocieteSite=$_POST['SocieteSite']; }  else {$SocieteSite=''; }
	if (isset($_POST['Adresse_1Site'])) { $Adresse_1Site=$_POST['Adresse_1Site']; }  else {$Adresse_1Site=''; }
	if (isset($_POST['Adresse_2Site'])) { $Adresse_2Site=$_POST['Adresse_2Site']; }  else {$Adresse_2Site=''; }
	if (isset($_POST['Code_PostalSite'])) { $Code_PostalSite=$_POST['Code_PostalSite']; } else {$Code_PostalSite=''; }
	if (isset($_POST['VilleSite'])) { $VilleSite=$_POST['VilleSite']; }  else {$VilleSite=''; }
	if (isset($_POST['TelephoneSite'])) { $TelephoneSite=$_POST['TelephoneSite']; } else {$TelephoneSite=''; }
	if (isset($_POST['TelecopieSite'])) { $TelecopieSite=$_POST['TelecopieSite']; }  else {$TelecopieSite=''; }
	if (isset($_POST['HTTPSite'])) { $HTTPSite=$_POST['HTTPSite']; } else {$HTTPSite=''; }
	if (isset($_POST['EmailSte'])) { $EmailSte=$_POST['EmailSte']; } else {$EmailSte=''; }
	if (isset($_POST['TxtFactMention'])) { $TxtFactMention=$_POST['TxtFactMention']; } else {$TxtFactMention=''; }
	if (isset($_POST['Num_AgrementSite'])) { $Num_AgrementSite=$_POST['Num_AgrementSite']; } else {$Num_AgrementSite=''; }
	if (isset($_POST['num_pf'])) { $num_pf=$_POST['num_pf']; } else {$num_pf=''; }
	if (isset($_POST['num_cde'])) { $num_cde=$_POST['num_cde']; } else {$num_cde=''; }
	if (isset($_POST['num_bl'])) { $num_bl=$_POST['num_bl']; } else {$num_bl=''; }
	if (isset($_POST['num_br'])) { $num_br=$_POST['num_br']; } else {$num_br=''; }		
	if (isset($_POST['num_fa'])) { $num_fa=$_POST['num_fa']; } else {$num_fa=''; }
	if (isset($_POST['num_av'])) { $num_av=$_POST['num_av']; } else {$num_av=''; }
	if (isset($_POST['num_ec'])) { $num_ec=$_POST['num_ec']; } else {$num_ec=''; }
	if (isset($_POST['Capital'])) { $Capital=$_POST['Capital']; } else {$Capital=''; }
	if (isset($_POST['TextCompl'])) { $TextCompl=$_POST['TextCompl']; } else {$TextCompl=''; }
	if (isset($_POST['num_import_bl'])) { $num_import_bl=$_POST['num_import_bl']; } else {$num_import_bl=''; }
	$valForm="POST" ;
} else {
		// Transmis en GET
	$num_ordre=$_GET['num_ordre'];
	if (isset($_GET['SocieteSite'])) { $SocieteSite=$_GET['SocieteSite']; }  else {$SocieteSite=''; }
	if (isset($_GET['Adresse_1Site'])) { $Adresse_1Site=$_GET['Adresse_1Site']; }  else {$Adresse_1Site=''; }
	if (isset($_GET['Adresse_2Site'])) { $Adresse_2Site=$_GET['Adresse_2Site']; }  else {$Adresse_2Site=''; }
	if (isset($_GET['Code_PostalSite'])) { $Code_PostalSite=$_GET['Code_PostalSite']; } else {$Code_PostalSite=''; }
	if (isset($_GET['VilleSite'])) { $VilleSite=$_GET['VilleSite']; }  else {$VilleSite=''; }
	if (isset($_GET['TelephoneSite'])) { $TelephoneSite=$_GET['TelephoneSite']; } else {$TelephoneSite=''; }
	if (isset($_GET['TelecopieSite'])) { $TelecopieSite=$_GET['TelecopieSite']; }  else {$TelecopieSite=''; }
	if (isset($_GET['HTTPSite'])) { $HTTPSite=$_GET['HTTPSite']; } else {$HTTPSite=''; }
	if (isset($_GET['EmailSte'])) { $EmailSte=$_GET['EmailSte']; } else {$EmailSte=''; }
	if (isset($_GET['TxtFactMention'])) { $TxtFactMention=$_GET['TxtFactMention']; } else {$TxtFactMention=''; }
	if (isset($_GET['Num_AgrementSite'])) { $Num_AgrementSite=$_GET['Num_AgrementSite']; } else {$Num_AgrementSite=''; }
	if (isset($_GET['num_pf'])) { $num_pf=$_GET['num_pf']; } else {$num_pf=''; }
	if (isset($_GET['num_cde'])) { $num_cde=$_GET['num_cde']; } else {$num_cde=''; }
	if (isset($_GET['num_bl'])) { $num_bl=$_GET['num_bl']; } else {$num_bl=''; }
	if (isset($_GET['num_br'])) { $num_br=$_GET['num_br']; } else {$num_br=''; }		
	if (isset($_GET['num_fa'])) { $num_fa=$_GET['num_fa']; } else {$num_fa=''; }
	if (isset($_GET['num_av'])) { $num_av=$_GET['num_av']; } else {$num_av=''; }
	if (isset($_GET['num_ec'])) { $num_ec=$_GET['num_ec']; } else {$num_ec=''; }
	if (isset($_GET['Capital'])) { $Capital=$_GET['Capital']; } else {$Capital=''; }
	if (isset($_GET['TextCompl'])) { $TextCompl=$_GET['TextCompl']; } else {$TextCompl=''; }
	if (isset($_GET['num_import_bl'])) { $num_import_bl=$_GET['num_import_bl']; } else {$num_import_bl=''; }
		$valForm="GET" ;
}
echo "$valForm<br>";
// convserson html pour caracteres spéciaux
$SocieteSite = htmlspecialchars($SocieteSite, ENT_QUOTES);
$Adresse_1Site = htmlspecialchars($Adresse_1Site, ENT_QUOTES);
$Adresse_2Site = htmlspecialchars($Adresse_2Site, ENT_QUOTES);
$VilleSite = htmlspecialchars($VilleSite, ENT_QUOTES);
$TxtFactMention= htmlspecialchars($TxtFactMention, ENT_QUOTES);
$Capital= htmlspecialchars($Capital, ENT_QUOTES);
$TextCompl= htmlspecialchars($TextCompl, ENT_QUOTES);
/*
echo " Num Clt : ".$IdNumClient." | ident Clt : ".$Ident_Client."<br> 
nom clt : ".$Nom_Client."<br> adr 1 :".$Adr_Client1."<br>
adr 2 : ".$Adr_Client2."<br> adr 3 : ".$Adr_Client3."<br>
CodePostal : ".$Code_postal."<br> Ville : ".$Ville."<br>
tel : ".$Telephone."<br> Port : ".$Portable."<br> 
num_cate_clt :".$num_cate_clt."<br>Ccpta : ".$Ccpta."<br> 
observations : ".$observations."<br> Code Tarifs : ".$Tarifs."
<br> Email : ".$Email."<br>" ;
*/

$sql = "UPDATE Base_detail_user SET 
`SocieteSite` = '$SocieteSite', 
`Adresse_1Site` = '$Adresse_1Site', 
`Adresse_2Site` = '$Adresse_2Site', 
`Code_PostalSite` = '$Code_PostalSite', 
`VilleSite` = '$VilleSite', 
`TelephoneSite` = '$TelephoneSite', 
`TelecopieSite` = '$TelecopieSite',
`HTTPSite` = '$HTTPSite', 
`EmailSte` = '$EmailSte',
`TxtFactMention` = '$TxtFactMention',
`Num_AgrementSite` = '$Num_AgrementSite',
`num_pf` = '$num_pf',
`num_cde` = '$num_cde',
`num_bl` = '$num_bl',
`num_br` = '$num_br',
`num_fa` = '$num_fa',
`num_av` = '$num_av',
`num_ec` = '$num_ec',
`Capital` = '$Capital',
`TextCompl` = '$TextCompl',
`num_import_bl` = '$num_import_bl'
WHERE `IdNumClient` = '$IdNumClient'";


echo $sql;
 
$res = mysqli_query($link, $sql);

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

Header("Location: index.php");

?>
