<?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, $res, $res1, $res2, $sql, $sql1, $sql2;
// entete de la page

/*
http://192.168.1.200/orius/delette_decoupe.php
num_entre=38
lot=F05454516
trace=143CA143T
*/


if (!isset($_GET['num_entre'])) {
    $Num_entre=($_POST['num_entre']);
		$Num_entre_chek =" Post";
		$lot=($_POST['lot']);
		$trace=($_POST['trace']);

} else {
    	$Num_entre=($_GET['num_entre']);
			$Num_entre_chek =" Get";
			$lot=($_GET['lot']);
			$trace=($_GET['trace']);
}

//include 'menu/header.php';

$date = date("d-m-Y");

// menu haut new-supp-modif
echo "<br>Num Entre : ".$Num_entre.$Num_entre_chek." | Lot : ".$lot."| Trace : ".$trace."<br>";

// Deletel Decoupe Table Decoupe
$sql = "DELETE FROM decoupe WHERE num_decoupe='$Num_entre'";
$sql.=" AND IdNumClient='".$IdNumClient."'";
echo "<br>".$sql."<br>";
$res = mysqli_query($link, $sql);  
echo "<br>Resultat query : ".$res ;

// Delete Lot Table Lot
$sql = "DELETE FROM lot WHERE num_ligne_detail='$Num_entre'";
$sql.=" AND IdNumClient='".$IdNumClient."'";
echo "<br>".$sql."<br>";
$res = mysqli_query($link, $sql);  
echo "<br>Resultat query : ".$res ;

// Delete Lot Dispo Table lot dispo
$sql = "DELETE FROM lot_dispo WHERE num_lot_dispo='$lot' AND num_lot_dispo_trac='$trace'";
$sql.=" AND IdNumClient='".$IdNumClient."'";
echo "<br>".$sql."<br>";
$res = mysqli_query($link, $sql);  
echo "<br>Resultat query : ".$res ;

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