<?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.100/horius/detail_nonconform.php?ordre=1&numconform=1
*/
if (!isset($_GET['ordre'])) { 
		// Transmis en POST
		$num_ordre=$_POST['ordre'];
		if (isset($_POST['numconform'])) { $numconform=$_POST['numconform']; }  else {$plu=''; }
		$valForm="POST" ;
} else {
		// Transmis en GET
		$num_ordre=$_GET['ordre'];
		if (isset($_GET['numconform'])) { $numconform=$_GET['numconform']; }  else {$numconform=''; }
		$valForm="GET" ;
}
include 'menu/header_lt.php';
// menu haut new-supp-modif

$sql="Select * FROM Table_Non_Conformite WHERE Num_ligne_Conformite=$numconform" ;

$req = mysqli_query($link, $sql);  
while ($row = mysqli_fetch_assoc($req)) {
        $Num_ligne_Conformite = $row["Num_ligne_Conformite"];
        $Date_Conformite = $row["Date_Conformite"];
        $Num_Conformite = $row["Num_Conformite"];
        $Conformite_courte = $row["Conformite_courte"];
        $Conformite_longue = $row["Conformite_longue"];
				$Etat_conformite = $row["Etat_conformite"];
        $action_corrective_courte = $row["action_corrective_courte"];
        $action_corrective_longue = $row["action_corrective_longue"];
      }
				$sql = "SELECT categorie_cft FROM categorie_conformite WHERE num_cate_cft='$Num_Conformite'";  
				$req = mysqli_query($link, $sql);
				while ($row = mysqli_fetch_assoc($req)) {$Nom_Conformite = $row["categorie_cft"];} 

$Date_Conformite=date("d/m/Y", strtotime($Date_Conformite));
$Date_Conformite_lg=DateFr($Date_Conformite) ;

echo "<center>Detail Non Conformit&eacute;e du $Date_Conformite_lg<br><br>";

echo "<center>" ;
echo "<table width='600' id='customers'>";
echo "<tr>";
echo "<th width='50'>Num ligne :</th>" ;
echo "<td width='550'>$Num_ligne_Conformite</td>" ;
echo "</tr><tr>";
echo "<th width='50'>Cat&eacute;gorie :</th>" ;
echo "<td width='550'>$Nom_Conformite</td>" ;
echo "</tr><tr>";
echo "<th width='150'>Non Conformit&eacute;e :</th>" ;
echo "<td width='550'>$Conformite_longue</td>" ;
echo "</tr><tr>";
echo "<th width='150'>Etat non-conformit&eacute;e :</th>" ;
switch ($Etat_conformite) {
	case 0 :
	echo "<td width='550' valign=center><img src='images/Alert.png'> En cours <img src='images/Alert.png'></td>" ;
	break ;
	case 1 :
	echo "<td width='550'><img src='images/warning.png'> Clotur&eacute;e sans action corretive Clotur&eacute;e <img src='images/warning.png'></td>" ;
	break ;
	case 2 :
	echo "<td width='550'><img src='images/good_mark.png'> Clotur&eacute;e avec action corretive Clotur&eacute;e <img src='images/good_mark.png'></td>" ;
	break ;
}

echo "</tr><tr>";
echo "<th width='50'>Action Corrective : </th>" ;
echo "<td width='550'>$action_corrective_longue</td>" ;
echo "</tr></table><br>";



echo "<a href='#' onclick='window.close()'>Fermer</a>";

?>
