<?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, $NumAbat;
// entete de la page

/*
http://192.168.1.200/horius/modif_art_bl_temps_import.php?ordre=1
num_clt=88%20888
num_ligne_import=4502
num_plu=1
num_lot=M28990119
num_traca=196D
Rsi=0
Rsl=0&Rss=0



http://192.168.1.200/horius/modif_ligne_bl_temps_import.php?num_clt=88+888&num_plu=6&num_lot=H50276918&num_traca=354D&Rsi=0&Rsl=0&Rss=0&ordre=1&num_clt_modif=99+999
*/

$refere = $_SERVER['HTTP_REFERER'] ;

if (!isset($_GET['ordre'])) { 
		// Transmis en POST
		$num_ordre=$_POST['ordre'];
		if (isset($_POST['num_ligne_import'])) { $num_ligne_import=$_POST['num_ligne_import']; }  else {$num_ligne_import=''; }
		if (isset($_POST['num_clt'])) { $num_clt=$_POST['num_clt']; }  else {$num_clt=''; }
		if (isset($_POST['num_plu'])) { $num_plu=$_POST['num_plu']; }  else {$num_plu=''; }
		if (isset($_POST['num_lot'])) { $num_lot=$_POST['num_lot']; }  else {$num_lot=''; }
		if (isset($_POST['num_traca'])) { $num_traca=$_POST['num_traca']; }  else {$num_traca=''; }
		if (isset($_POST['Rsi'])) { $Rsi=$_POST['Rsi']; }  else {$Rsi=''; }
		if (isset($_POST['Rsl'])) { $Rsl=$_POST['Rsl']; }  else {$Rsl=''; }
		if (isset($_POST['Rss'])) { $Rss=$_POST['Rss']; }  else {$Rss=''; }
		if (isset($_POST['num_clt_modif'])) { $num_clt_modif=$_POST['num_clt_modif']; }  else {$num_clt_modif=''; }
		$valForm="POST" ;
} else {
		// Transmis en GET
		$num_ordre=$_GET['ordre'];
		if (isset($_GET['num_ligne_import'])) { $num_ligne_import=$_GET['num_ligne_import']; }  else {$num_ligne_import=''; }
		if (isset($_GET['num_clt'])) { $num_clt=$_GET['num_clt']; }  else {$num_clt=''; }
		if (isset($_GET['num_plu'])) { $num_plu=$_GET['num_plu']; }  else {$num_plu=''; }
		if (isset($_GET['num_lot'])) { $num_lot=$_GET['num_lot']; }  else {$num_lot=''; }
		if (isset($_GET['num_traca'])) { $num_traca=$_GET['num_traca']; }  else {$num_traca=''; }
		if (isset($_GET['Rsi'])) { $Rsi=$_GET['Rsi']; }  else {$Rsi=''; }
		if (isset($_GET['Rsl'])) { $Rsl=$_GET['Rsl']; }  else {$Rsl=''; }
		if (isset($_GET['Rss'])) { $Rss=$_GET['Rss']; }  else {$Rss=''; }
		if (isset($_GET['num_clt_modif'])) { $num_clt_modif=$_GET['num_clt_modif']; }  else {$num_clt_modif=''; }
		$valForm="GET" ;
}
include 'menu/header_lt.php';

// menu haut new-supp-modif

if (!$num_clt_modif>0) {

echo "<center>Transfert d'un Plus vers un autre client <br><br>";

//
echo "<br>Num Client : ".$num_clt."<br>";

echo "<form id='modifcltimport' name ='modifcltimport' method='GET' action='".$_SERVER['PHP_SELF']."'>";
echo "<input type='hidden' name='num_clt' value='$num_clt'/>"; 
echo "<input type='hidden' name='num_plu' value='$num_plu'/>"; 
echo "<input type='hidden' name='num_lot' value='$num_lot'/>"; 
echo "<input type='hidden' name='num_traca' value='$num_traca'/>"; 
echo "<input type='hidden' name='Rsi' value='$Rsi'/>";
echo "<input type='hidden' name='Rsl' value='$Rsl'/>"; 
echo "<input type='hidden' name='Rss' value='$Rss'/>"; 
Echo "<input type='hidden' name='num_ligne_import' value='$num_ligne_import'/>"; 
echo "<input type='hidden' name='ordre' value='$num_ordre'/>";
echo "N&deg; Client Destination : <input name='num_clt_modif' type='text' id='let_client' accesskey='2' tabindex='2' size='5' autofocus>";
echo "<br><a href='$refere'><button type='button'>Retout</a></button>";
echo "</form>";



} else {

echo "<center>Transfert d'un Plus vers un autre client <br><br>";

//
echo "<br>Du Num Client : ".$num_clt." vers => ".$num_clt_modif."<br><br>";


	$sql ="UPDATE `temp_import_csv` SET";
	$sql.=" `num_client`='".$num_clt_modif."'" ;
	$sql.=" WHERE `IdNumClient`='".$IdNumClient."'";
	$sql.=" AND `num_ligne_import`=".$num_ligne_import;
	

echo "Sql : ".$sql ;

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

echo "<br>Resultat query : ".$res ;
Header("Location: detail_bl_temp_liste_detail_import.php?ordre=$num_ordre&num_clt=$num_clt&&num_lot=$num_lot&num_traca=$num_traca&num_plu=$num_plu&Rsi=$Rsi&Rsl=$Rsl&Rss=$Rss") ;

}

?>
