<?php
include("include/data.php");
Init_boutique();
global $base, $MySQL_Host, $MySQL_User, $MySQL_Passw, $myart, $A_NumArt,$i, $result, $NbLigne, $s,
$mygroupeart, $mysousgroupeart, $semaine, $limitesuivante, $limiteprecedente, $limite, $total, 
$page, $Nom_Client, $NumAbat, $mrs ;
// entete de la page

/*
http://192.168.1.100/horius/edition_detail_conformite_imp.php?num_entre=3
*/

include 'menu/header_edition.php';

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

$Num_entre=$_GET['num_entre'];
//echo "<br>Num Entre : ".$Num_entre."<br>" ;

$sql="Select * FROM Table_Non_Conformite WHERE Num_ligne_Conformite='$Num_entre'" ;
$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"];
      }
				$sql1 = "SELECT categorie_cft FROM categorie_conformite WHERE num_cate_cft='$Num_Conformite'";  
				$req1 = mysqli_query($link, $sql1);
				while ($row = mysqli_fetch_assoc($req1)) {$Nom_Conformite = $row["categorie_cft"];} 

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

// menu haut new-supp-modif

?>
<BODY onLoad='$("#bcTarget").barcode("<?php echo "11110".$Num_entre."".$IdNumClient ; ?>", "code128",{barWidth:1 , barHeight:30}); window.print();' >
<!--div id="bcTarget"></div>-->
<?php

echo "<center>";
echo "<table width='600' border='0' cellpadding='1' cellspacing='1'>";
echo "<tr>";
echo "<td height='80' width='100'><center><img src='images/$LogoSite' width='80'></center></td>";
echo "<td class='texthaut' width='500'>$SocieteSite<br>$RueSite<br>$CpostalSite $VilleSite
			<br>
			T&eacute;l : $TelephoneSite <br> $MailSite </td>";
echo "<td><center><img src='images/agrem_$IdNumClient.jpg' width='50'></center></td>";
echo "<td height='80' width='100'><center><div id='bcTarget'></center></td>";

echo "</tr>";
echo "</table>";

echo "<center><br>Consultation de la Non Conformit&eacute;e du $Date_Conformite<br><br>";

echo "<table width='600' class='t-text'>";
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>$Nom_Conformite";
echo "</tr><tr>";
echo "<th width='150'>Titre Non Conformit&eacute;e</th>" ;
echo "<td width='550'>$Conformite_courte</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</td>" ;
	break ;
	case 1 :
	echo "<td width='550'><img src='images/warning.png'> Clotur&eacute;e sans action corretive Clotur&eacute;e</td>" ;
	break ;
	case 2 :
	echo "<td width='550'><img src='images/good_mark.png'> Clotur&eacute;e avec action corretive Clotur&eacute;e</td>" ;
	break ;
}

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


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

include 'menu/footer_edition.php';
?>