<?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/delete_ligne_bl_temps_import.php?ordre=1&num_plu=18&num_lot=CO51HACH18&num_traca=352T&num_clt=99%20150&Rsi=0&Rsl=0&Rss=0


*/

$refere = $_SERVER['HTTP_REFERER'] ;


if (!isset($_GET['ordre'])) { 
		// Transmis en POST
		$num_ordre=$_POST['ordre'];
		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=''; }
		if (isset($_POST['valid'])) { $valid=$_POST['valid']; }  else {$valid='Non'; }
		$valForm="POST" ;
} else {
		// Transmis en GET
		$num_ordre=$_GET['ordre'];
		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=''; }
		if (isset($_GET['valid'])) { $valid=$_GET['valid']; }  else {$valid="non"; }
		$valForm="GET" ;
}
include 'menu/header_lt.php';

// menu haut new-supp-modif

if ($valid== "non") {

echo "<center><h1>Effacement d'une ligne sur un import de  BL </h1><br><br>";
echo "Voulez-vous supprimer cette ligne <br><br>";
echo "<a href='delete_ligne_bl_temps_import.php?ordre=1&num_plu=$num_plu&num_lot=$num_lot&num_traca=$num_traca&num_clt=$num_clt&Rsi=$Rsi&Rsl=$Rsl&Rss=$Rss&valid=oui'>
			<button type='button'>Oui</a></button>
			&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
			<a href='$refere'>
			<button type='button'>Non</a></button>";


} else {
	

//


	$sql ="DELETE FROM `temp_import_csv`";
	$sql.=" WHERE `IdNumClient`='".$IdNumClient."'";
	$sql.=" AND `num_plu`=".$num_plu;
	$sql.=" AND `num_client`='".$num_clt."'" ;
	$sql.=" AND `num_lot`='".$num_lot."' AND `num_lot_trace`='".$num_traca."'" ;
	$sql.=" AND `RsltImport`=".$Rsi." AND`RsltLot`=".$Rsl." AND `RsltStock`=".$Rss ;
	

//echo "Sql : ".$sql ;

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

//echo "<br>Resultat query : ".$res ;

Header("Location: detail_bl_temp_liste_import.php?ordre=1&num_clt=$num_clt&Rsi=$Rsi&Rsl=$Rsl&Rss=$Rss") ;
}


?>
