<?php
include("include/data.php");
Init_boutique();
global $base, $MySQL_Host, $MySQL_User, $MySQL_Passw, $myart, $result, $NbLigne, $semaine, $limitesuivante, $limiteprecedente, 
$total, $page, $Max_Num_Fabric, $nom_unite_ini, $TotalPoidsM1, $TotalPoidsM2 , $Nom_untie_intrant   ;
// entete de la page
/*
saisie_fabrications_detail.php?
ordre=1
Num_Fabric=3
*/

include 'menu/header.php';
if (!isset($_GET['ordre'])) { 
		// Transmis en POST
		$num_ordre=$_POST['ordre'];
		if (isset($_POST['Num_Fabric'])) { $num_fabric=$_POST['Num_Fabric']; }  else {$num_fabric=''; }
		if (isset($_POST['TypeFabric'])) { $type_fabric=$_POST['TypeFabric']; } else {$type_fabric=''; }
		if (isset($_POST['categorie_plu_intran'])) { $categorie_plu_intran=$_POST['categorie_plu_intran']; } else {$categorie_plu_intran=''; }
		if (isset($_POST['plu_intrant'])) { $plu_intrant=$_POST['plu_intrant']; } else {$plu_intrant=''; }
		if (isset($_POST['num_ligne_lot_intrant'])) { $num_ligne_lot_intrant=$_POST['num_ligne_lot_intrant']; } else {$num_ligne_lot_intrant=''; }
		$valForm="POST" ;
} else {
		// Transmis en GET
		$num_ordre=$_GET['ordre'];
		if (isset($_GET['Num_Fabric'])) { $num_fabric=$_GET['Num_Fabric']; }  else {$num_fabric=''; }
		if (isset($_GET['TypeFabric'])) { $type_fabric=$_GET['TypeFabric']; } else {$type_fabric=''; }
		if (isset($_GET['categorie_plu_intran'])) { $categorie_plu_intran=$_GET['categorie_plu_intran']; } else {$categorie_plu_intran=''; }
		if (isset($_GET['plu_intrant'])) { $plu_intrant=$_GET['plu_intrant']; } else {$plu_intrant=''; }
		if (isset($_GET['num_ligne_lot_intrant'])) { $num_ligne_lot_intrant=$_GET['num_ligne_lot_intrant']; } else {$num_ligne_lot_intrant=''; }
		$valForm="GET" ;
}

//echo "<br>Ordre : $num_ordre | Num Frabric : $num_fabric | Type fabric : $type_fabric<br>" ;

$myart =new fabrications_haut;
$select = "SELECT * FROM fabrications_haut WHERE Num_Fabric='$num_fabric'";
$select.=" AND IdNumClient='".$IdNumClient."'";
$result = mysqli_query($link, $select);
$myart->getnum($result);
while ($myart->z < $myart->num) {
  $myart->readrow($result) ;
  $Num_Fabric =$myart->Num_Fabric ;
  $Num_plu_Fabric =$myart->Num_plu_Fabric ;
  $Cate_Fabric =$myart->Cate_Fabric ;
  $Client_Fabric =$myart->Client_Fabric ;
  $Semaine_Fabric =$myart->Semaine_Fabric ;
  $Date_Fabric_sql =$myart->Date_Fabric ;
  $DLC_Fabric_sql =$myart->DLC_Fabric ;
  $Num_Lot_Fabric =$myart->Num_Lot_Fabric ;
  $Traca_Fabric =$myart->Traca_Fabric ;	
  $Poid_Fabric =$myart->Poid_Fabric ;
  $Unite_Fabric =$myart->Unite_Fabric ;
  $Observation =$myart->Observation ;
  $Etat = $myart->Etat ;
  $Timestamp =$myart->Timestamp ;
}

 $Date_Fabric_y=date("Y", strtotime($Date_Fabric_sql));
 $Date_Fabric_m=date("m", strtotime($Date_Fabric_sql));
 $Date_Fabric_d=date("d", strtotime($Date_Fabric_sql));
 
$Date_Fabric = date("d/m/y", mktime(0,0,0,$Date_Fabric_m,$Date_Fabric_d,$Date_Fabric_y));

 $DLC_Fabric_y=date("Y", strtotime($DLC_Fabric_sql));
 $DLC_Fabric_m=date("m", strtotime($DLC_Fabric_sql));
 $DLC_Fabric_d=date("d", strtotime($DLC_Fabric_sql));
 
 $DLC_Fabric = date("d/m/y", mktime(0,0,0,$DLC_Fabric_m,$DLC_Fabric_d,$DLC_Fabric_y));

$sql = "SELECT Nom_Client FROM clients WHERE Num_Client='$Client_Fabric'"; 
$sql.=" AND IdNumClient='".$IdNumClient."'";
$req = mysqli_query($link, $sql);
while ($row = mysqli_fetch_assoc($req)) {
        $Nom_Client_Fabric = $row["Nom_Client"];
    }  

$sql = "SELECT nom_unite_ini FROM unitee WHERE num_unite='$Unite_Fabric'";  
$req = mysqli_query($link, $sql);
while ($row = mysqli_fetch_assoc($req)) {
        $Nom_Untite_Fabric = $row["nom_unite_ini"];
} 

$sql = "SELECT Let_cate_fabric FROM categorie_fabrications WHERE num_cate_fabric='$Cate_Fabric'";  
$req = mysqli_query($link, $sql);
while ($row = mysqli_fetch_assoc($req)) {
        $Nom_Cate_Fabric = $row["Let_cate_fabric"];
} 

$sql = "SELECT PLU FROM plu WHERE Num_PLU='$Num_plu_Fabric'";  
$sql.=" AND IdNumClient='".$IdNumClient."'";
$req = mysqli_query($link, $sql);
while ($row = mysqli_fetch_assoc($req)) {
        $Nom_Plu_Fabric = $row["PLU"];
    } 

/*
echo "<br>num ordre : $ordre | $select<br>" ;
echo "$Date_Fabric | $date_e | $DLC_Fabric | $DLC_Fabric_sql | $date_dlc | $Num_Lot_Fabric | $Traca_Fabric<br>" ;
echo "$Client_Fabric | $Unite_Fabric | $Observation | $Etat | $Timestamp<br>" ;
echo "$num_plu_intant | $nom_plu_intrant | $num_cate_intrant | $num_unite_plu_intrant | $dlc_plu_intrants<br>" ;
//<a class='' href='consult_intrants.php?num_entre=$Num_entre_intrant&ordre=2'></a>
*/

echo "<center><b>Saisie du detail du lot $Num_Lot_Fabric/$Traca_Fabric</b></center>" ;

echo "<center><HR size='1' width='500'></center>";
echo "<center>" ;
echo "<table class='t-text' width='750' border='1' cellspacing='0' cellpadding='0'>";
echo "<tr>";
echo "<td class='t-text12' align='center' valign='middle'>$Nom_Plu_Fabric | $Nom_Client_Fabric</td>";
echo "<td class='t-text12' align='center' valign='middle'>Date Fabrication : $Date_Fabric | Date DLC : $DLC_Fabric</td>";
echo "</table>";
echo "<br>" ;
	
$Max_Num_Fabric = 0 ;
$sql = "SELECT MAX(Num_Fabric) FROM fabrications_detail WHERE Num_Fabric='$num_fabric'"; 
$req = mysqli_query($link, $sql); 
$row = mysqli_fetch_row($req);
$Max_Num_Fabric = $row[0];

	
echo "<table id='t01' class='t-text' width='600' border='1' cellspacing='2' cellpadding='2'>";
echo "<tr>";
echo "<th width='30' height='20' class='t-text' >Ligne</th>";
echo "<th width='50' height='20' class='t-text' >Num</th>";
echo "<th width='150' height='20' class='t-text' >Plu</th>";
echo "<th width='200' height='20' class='t-text' >Lot</th>";
echo "<th width='150' height='20' class='t-text' >Poids</th>";
echo "<th width='20' height='20' class='t-text' ></th>";
echo "<tr><td colspan=5>*-* Mati&egrave;re Premi&egrave;re *-*<td></tr>";

//------------- Matiere Premiere -----------//

$TotalPoids = 0 ;
$myart =new fabrications_detail;
$select = "SELECT * FROM fabrications_detail WHERE Num_Fabric='$num_fabric' AND Type_Fabric='1'";
$select.=" AND IdNumClient='".$IdNumClient."'";
$result = mysqli_query($link, $select);
$myart->getnum($result);
while ($myart->z < $myart->num) {
	$myart->readrow($result) ;
	$Num_Fabric_Ligne=$myart->Num_Fabric_Haut ;
	$Type_Fabric=$myart->Type_Fabric;
	$Num_plu_Intrant=$myart->Num_plu_Intrant;
	$Num_Lot_Intrant=$myart->Num_Lot_Intrant ;
	$Traca_Intrant=$myart->Traca_Intrant ;
	$untie_intrant=$myart->untie_intrant ;
	$Poid_Intrant=$myart->Poid_Intrant ;	

$sql = "SELECT nom_unite_ini FROM unitee WHERE num_unite='$untie_intrant'";  
$req = mysqli_query($link, $sql);
while ($row = mysqli_fetch_assoc($req)) {$Nom_untie_intrant = $row["nom_unite_ini"]; } 

$sql = "SELECT PLU FROM plu WHERE Num_PLU='$Num_plu_Intrant'";
$sql.=" AND IdNumClient='".$IdNumClient."'";  
$req = mysqli_query($link, $sql);
while ($row = mysqli_fetch_assoc($req)) { $Pluintrant = $row["PLU"];} 
	

echo "<tr>";
echo "<td align='center' valign='middle'>$Num_Fabric_Ligne</td>";
echo "<td align='center' valign='middle'>$Num_plu_Intrant </td>";
echo "<td align='left' valign='middle'>$Pluintrant</td>";
echo "<td align='left' valign='middle'>$Num_Lot_Intrant / $Traca_Intrant</td>";
echo "<td align='right' valign='middle' >$Poid_Intrant $Nom_untie_intrant</td>";
switch ($Etat) { 	
	case 0: 		  
echo "<td align='center' valign='middle' width='10%'>
	<form id='form4' name='form4' method='get' action='delete_fabrication_ligne.php'>
	<input type='hidden' name='Num_Fabric_Ligne' value='$Num_Fabric_Ligne'/>
	<input type='hidden' name='num_ordre' value='$num_ordre'/>
	<input type='hidden' name='num_fabric' value='$num_fabric'/>
	<input type='submit' value='-'></form></td>";
	break; 	

	case 1: 		  
echo "<td align='center' valign='middle' width='10%'></td>";
	break; 	
}
echo "</tr>";

$TotalPoidsM1 = $TotalPoidsM1+$Poid_Intrant ;
$TotalPoidsM1 = number_format($TotalPoidsM1, 3, '.', ' ')	;

	
echo "</center>" ;
}
echo "<tr>";
echo "<th class='t-text' colspan='4' align='right' valign='middle'> Total Poids Matiere Premiere : </th>";
echo "<th class='t-text' align='right' valign='middle'>$TotalPoidsM1 $Nom_untie_intrant </th>";
echo "<th class='t-text' ></th>";


echo "<tr><td colspan=5>*-* Intrants *-*<td></tr>";	

//------------- Intrants -----------//

$TotalPoids = 0 ;
$myart =new fabrications_detail;
$select = "SELECT * FROM fabrications_detail WHERE Num_Fabric='$num_fabric' AND Type_Fabric='2'";
$select.=" AND IdNumClient='".$IdNumClient."'";
$result = mysqli_query($link, $select);
$myart->getnum($result);
while ($myart->z < $myart->num) {
	$myart->readrow($result) ;
	$Num_Fabric_Ligne=$myart->Num_Fabric_Haut ;
	$Type_Fabric=$myart->Type_Fabric;
	$Num_plu_Intrant=$myart->Num_plu_Intrant;
	$Num_Lot_Intrant=$myart->Num_Lot_Intrant ;
	$Traca_Intrant=$myart->Traca_Intrant ;
	$untie_intrant=$myart->untie_intrant ;
	$Poid_Intrant=$myart->Poid_Intrant ;	

$sql = "SELECT nom_unite_ini FROM unitee WHERE num_unite='$untie_intrant'";  
$req = mysqli_query($link, $sql);
while ($row = mysqli_fetch_assoc($req)) {$Nom_untie_intrant = $row["nom_unite_ini"]; } 

$sql = "SELECT * FROM plu_intrant WHERE num_plu_intrant='$Num_plu_Intrant'";
$sql.=" AND IdNumClient='".$IdNumClient."'";  
$req = mysqli_query($link, $sql);
while ($row = mysqli_fetch_assoc($req)) { $Pluintrant = $row["nom_plu_intrant"];} 

echo "<tr>";
echo "<td align='center' valign='middle'>$Num_Fabric_Ligne</td>";
echo "<td align='center' valign='middle'>$Num_plu_Intrant </td>";
echo "<td align='left' valign='middle'>$Pluintrant</td>";
echo "<td align='left' valign='middle'>$Num_Lot_Intrant</td>";
echo "<td align='right' valign='middle' >$Poid_Intrant $Nom_untie_intrant</td>";

switch ($Etat) { 	
	case 0: 		  
echo "<td align='center' valign='middle' width='10%'>
	<form id='form4' name='form4' method='get' action='delete_fabrication_ligne.php'>
	<input type='hidden' name='Num_Fabric_Ligne' value='$Num_Fabric_Ligne'/>
	<input type='hidden' name='num_ordre' value='$num_ordre'/>
	<input type='hidden' name='num_fabric' value='$num_fabric'/>
	<input type='submit' value='-'></form></td>";
	break; 	

	case 1: 		  
echo "<td align='center' valign='middle' width='10%'></td>";
	break; 	
}

echo "</tr>";

$TotalPoidsM2 = $TotalPoidsM2+$Poid_Intrant ;
$TotalPoidsM2 = number_format($TotalPoidsM2, 3, '.', ' ')	;
	
echo "</center>" ;
}
// Total fabrication
echo "<tr>";
echo "<th class='t-text' colspan='4' align='right' valign='middle'> Total Poids Intrants : </th>";
echo "<th class='t-text' align='right' valign='middle'>$TotalPoidsM2 $Nom_untie_intrant </th>";
echo "<th class='t-text' ></th>";
echo "<tr>";
$TotalPoids = $TotalPoidsM1 + $TotalPoidsM2 ;
$TotalPoids = number_format($TotalPoids, 3, '.', ' ')	;
echo "<td class='t-text' colspan='4' align='right' valign='middle'> Total Fabrication : </td>";
echo "<td class='t-text' align='right' valign='middle'>$TotalPoids $Nom_untie_intrant </td>";
echo "<td class='t-text' ></td>";
echo "</tr>";
echo "</table>";







echo "</table>";
echo "<br><br>";

// Saisie //
switch ($Etat) { 	
	case 0: 
echo "<table class='t-text' width='800' id='tableauintrantsaisie'>";
echo "<form name='FormSaisie' method='GET' action='".$_SERVER['PHP_SELF']."'>";
echo "<input type='hidden' name='ordre' value='$num_ordre'/>";
echo "<input type='hidden' name='Num_Fabric' value='$Num_Fabric'/>";
echo "<tr>";
echo "<td class='t-text' width='75'><select name='TypeFabric' STYLE='width:70' onchange='submit()'>";
echo "<option value='0' selected='selected'>*-*</option>";
switch ($type_fabric) {
     case 0:
   	echo "<option value='1'>Matiere Premiere</option>";
		echo "<option value='2'>Intrant</option>";
		echo "</select> ";
        break ;
	case 1:
   	echo "<option value='1' selected='selected'>Matiere Premiere</option>";
		echo "<option value='2'>Intrant</option>";
		echo "</select> ";
        break ;
    case 2:
    echo "<option value='1'>Matiere Premiere</option>";
		echo "<option value='2' selected='selected'>Intrant</option>";
		echo "</select> "; 
        break ;
 } 

	echo "</form></td><td class='t-text' width='100'>";
switch ($type_fabric) {
	case 1:
	echo "<form name='FormSaisieFabric' method='GET' action='ajout_fabrication_detail.php'>";
	echo "<input type='hidden' name='ordre' value='$num_ordre'>";
	echo "<input type='hidden' name='Num_Fabric' value='$Num_Fabric'>";
	echo "<input type='hidden' name='TypeFabric' value='$type_fabric'>";
	echo "<select name='Plu_Fabric' id='Plu_Fabric' STYLE='width:70'>";
	echo "<option value='0'>*-*</option>";
	$myart =new lot;
	$select = "SELECT * FROM lot WHERE `num_cate_decoupe`=3 and `solde_decoupe`=0 ";
	$select.=" AND IdNumClient='".$IdNumClient."'";
	$select.= " ORDER BY date_lot_decoupe DESC";
	$result = mysqli_query($link, $select);
	$myart->getnum($result);
	while ($myart->z < $myart->num) {
	$myart->readrow($result);
	$Num_ligne_plu=$myart->num_ligne_lot ;
	$Num_lot_plu=$myart->num_lot_decoupe ;
	$Num_lot_plu_trace=$myart->num_lot_tace_decoupe ;
	$Poids_decoupe_lot=$myart->poid_decoupe;

		$sql1 = "SELECT Num_categoriePlu FROM entreabat WHERE `Num_Lot`='$Num_lot_plu' AND IdNumClient='".$IdNumClient."'";
		$req = mysqli_query($link, $sql1);
		while ($row = mysqli_fetch_assoc($req)) {$NumTypeLot = $row["Num_categoriePlu"];} 

		$sql2 = "SELECT CategoriePlu FROM categorieplu WHERE `Num_CatPlu`='$NumTypeLot'";  
		$req = mysqli_query($link, $sql2);
		while ($row = mysqli_fetch_assoc($req)) {$TypeLotnom = $row["CategoriePlu"];} 
	

	echo "<option value='$Num_ligne_plu'>$TypeLotnom | $Num_lot_plu | $Num_lot_plu_trace | $Poids_decoupe_lot Kg</option>";
	}

	echo "</select></td>";
	echo "<td class='t-text' width='225'><input type='checkbox' name='TotalLot' value=1 />Totalite ? &nbsp;";
	echo "Poids :<input type='text' name='PoidLot' size='5' /</td>";
	
	echo "<td class='t-text' width='100'><select name='num_unitee_plu_intran' id='num_unitee_plu_intran'>";

	$myart =new unitee ;
	$select = 'select * FROM unitee';
	$result = mysqli_query($link, $select);
	$myart->getnum($result);
	while ($myart->z < $myart->num) {
	$myart->readrow($result);
	$num_unitee=$myart->num_unite ;
	$nom_unite_long=$myart->nom_unite_long ;
	$nom_unite_ini=$myart->nom_unite_ini ;
	$conversion=$myart->conversion ;

	if ($Unite_Fabric==$num_unitee) {
		echo "<option value='$num_unitee' selected='selected'>$nom_unite_ini | $nom_unite_long</option>";
	} else {
		echo "<option value='$num_unitee'>$nom_unite_ini | $nom_unite_long</option>";
		}
	}
	echo "</td>";
	echo "<td align='center' valign='middle' width='100'>
			<input type='submit' name='ok' value='+' accesskey='11' tabindex='11' >";
	echo "</form>";
	break ;
		
	case 2:
//echo "cit : $categorie_plu_intran | Fc : $Num_Fabric | TyF: $type_fabric ";
	echo "<form name='FormSaisie1' method='GET' action='".$_SERVER['PHP_SELF']."'>";
	echo "<input type='hidden' name='ordre' value='$num_ordre'/>";
	echo "<input type='hidden' name='Num_Fabric' value='$Num_Fabric'/>";
	echo "<input type='hidden' name='TypeFabric' value='$type_fabric'>";
	
	echo "<select name='categorie_plu_intran' id='categorie_plu_intran' style='width:100px' onchange='submit()'>";
	echo "<option value='0'>*-*</option>";
	// Categorie intrant
	$myart =new categorie_intrant;
	$select = "SELECT * FROM categorie_intrant";
	$result = mysqli_query($link, $select);
	$myart->getnum($result);
	while ($myart->z < $myart->num) {
	$myart->readrow($result);
	$num_cate_plu_intran_sel=$myart->num_cate_plu_intran ;
	$categorie_plu_intran_sel=$myart->categorie_plu_intran ;

	if ($categorie_plu_intran==$num_cate_plu_intran_sel) {
	echo "<option value='$num_cate_plu_intran_sel' selected >$categorie_plu_intran_sel</option>";
	} ELSE {
	echo "<option value='$num_cate_plu_intran_sel'>$categorie_plu_intran_sel</option>";	
	}

	}
	echo "</select></td>";	
	echo "</form>";
// Intrant
	echo "<form name='FormSaisie2' method='GET' action='".$_SERVER['PHP_SELF']."'>";
	echo "<input type='hidden' name='ordre' value='$num_ordre'/>";
	echo "<input type='hidden' name='Num_Fabric' value='$Num_Fabric'/>";
	echo "<input type='hidden' name='TypeFabric' value='$type_fabric'>";
	echo "<input type='hidden' name='categorie_plu_intran' value='$categorie_plu_intran'>";
	echo "<td class='t-text' width='100'><select name='plu_intrant' id='plu_intrant' style='width:100px' onchange='submit()'>";
	echo "<option value='0'>*-*</option>";
	$myart =new plu_intrant ;
	$select = "select * FROM plu_intrant WHERE num_cate_intrant='$categorie_plu_intran'";
	$select.=" AND IdNumClient='".$IdNumClient."'";
	$result = mysqli_query($link, $select);
	$myart->getnum($result);
	while ($myart->z < $myart->num) {
	$myart->readrow($result);
	$num_plu_intrant_sel=$myart->num_plu_intrant ;
	$nom_plu_intrant_sel=$myart->nom_plu_intrant ;

	if ($num_plu_intrant_sel==$plu_intrant) {
		echo "<option value='$num_plu_intrant_sel' selected='selected'>$nom_plu_intrant_sel</option>";
	} else {
		echo "<option value='$num_plu_intrant_sel'>$nom_plu_intrant_sel</option>";
		}
	}
	echo "</select></form></td>";
// Lot Intrant
	echo "<form name='FormSaisie3' method='GET' action='".$_SERVER['PHP_SELF']."'>";
	echo "<input type='hidden' name='ordre' value='$num_ordre'/>";
	echo "<input type='hidden' name='Num_Fabric' value='$Num_Fabric'/>";
	echo "<input type='hidden' name='TypeFabric' value='$type_fabric'>";
	echo "<input type='hidden' name='categorie_plu_intran' value='$categorie_plu_intran'>";
	echo "<input type='hidden' name='plu_intrant' value='$plu_intrant'>";
	echo "<td class='t-text' width='100'><select name='num_ligne_lot_intrant' id='num_ligne_lot_intrant' onchange='submit()'>";
	echo "<option value='0'>*-*</option>";
	$myart =new intrants ;
	$select = "select * FROM intrants WHERE Num_Plu='$plu_intrant' AND etat='0'";
	$select.=" AND IdNumClient='".$IdNumClient."'";
	$result = mysqli_query($link, $select);
	$myart->getnum($result);
	while ($myart->z < $myart->num) {
	$myart->readrow($result);
	$num_ligne_lot_intrant_sel=$myart->Num_entre_intrant ;
	$num_lot_intrant_sel=$myart->Num_Lot ;

	if ($num_ligne_lot_intrant_sel==$num_ligne_lot_intrant) {
		echo "<option value='$num_ligne_lot_intrant_sel' selected='selected'>$num_lot_intrant_sel</option>";
	} else {
		echo "<option value='$num_ligne_lot_intrant_sel'>$num_lot_intrant_sel</option>";
		}
	}
	echo "</select></form></td>";	
	echo "<form name='FormSaisieFabric' method='GET' action='ajout_fabrication_detail.php'>";
	echo "<input type='hidden' name='ordre' value='$num_ordre'/>";
	echo "<input type='hidden' name='Num_Fabric' value='$Num_Fabric'/>";
	echo "<input type='hidden' name='TypeFabric' value='$type_fabric'>";
	echo "<input type='hidden' name='categorie_plu_intran' value='$categorie_plu_intran'>";
	echo "<input type='hidden' name='plu_intrant' value='$plu_intrant'>";
	echo "<input type='hidden' name='num_ligne_lot_intrant' value='$num_ligne_lot_intrant'>";
				
	echo "<td class='t-text' width='100'>Poids :<input type='text' name='PoidLot' size='5' /</td>";
	echo "<td class='t-text' width='100'><select name='num_unitee_plu_intran' id='num_unitee_plu_intran'>";
	$myart =new unitee ;
	$select = 'select * FROM unitee';
	$result = mysqli_query($link, $select);
	$myart->getnum($result);
	while ($myart->z < $myart->num) {
	$myart->readrow($result);
	$num_unitee=$myart->num_unite ;
	$nom_unite_long=$myart->nom_unite_long ;
	$nom_unite_ini=$myart->nom_unite_ini ;
	$conversion=$myart->conversion ;

	if ($Unite_Fabric==$num_unitee) {
		echo "<option value='$num_unitee' selected='selected'>$nom_unite_ini | $nom_unite_long</option>";
	} else {
		echo "<option value='$num_unitee'>$nom_unite_ini | $nom_unite_long</option>";
		}
	}
	echo "</select>";
	echo "</td>";
	echo "<td align='center' valign='middle' width='100'>
			<input type='submit' name='ok' value='+' accesskey='11' tabindex='11' >";
			echo "</form>";
	break ;
	echo "</form>";
}
echo "</td></tr>";
echo "</center>" ;
echo "</table>";
echo "</form>";
	break; 	
	case 1: 		  
echo "<br>";
	break; 	
}


switch ($Etat) { 	
	case 0: 		  
echo "<form name='validationSaisieFabric' method='GET' action='validation_fabrication.php'>";
	echo "<input type='hidden' name='ordre' value='$num_ordre'/>";
	echo "<input type='hidden' name='Num_Fabric' value='$Num_Fabric'/>";
echo "<br><input type='submit' name='valid' value='Validation de Fabricaiton' accesskey='12' tabindex='12' ><br><br>";
echo "</form>";	
	break; 	
	case 1: 		  
echo "<br>";
	break; 	
}
include 'menu/footer.php';
?>
