<?php
include("include/data.php");
Init_boutique();
global $base, $MySQL_Host, $MySQL_User, $MySQL_Passw, $myart, $result, $NbLigne, $semaine, $limitesuivante, $limiteprecedente, 
$total, $Nom_plu_intrant, $dlc_plu_intrant, $page ;
// entete de la page

include 'menu/header.php';


echo "<div class='titre-text'><center>Ajout Base Chambre Froide</div></center>" ;

echo "<center><HR size='1' width='500'></center>";
echo "<center><br>" ;
echo "<form name='FormIntrant' method='POST' action='traitement_ajout_base_cf.php'>";
echo "<input type='hidden' name='ordre' value='1'/>";
echo "<table class='t-text' width='500' border='1' cellspacing='1' cellpadding='1'>";
echo "<tr>";
echo "<tr>";
echo "<th align='center' valign='middle'>N&deg; Ch Froide : </th>
      <td colspan='3'>";

$last_num_entre = 0 ;
$sql = "SELECT max(Num_CF) FROM Base_CF";
$sql.=" WHERE `IdNumClient`='".$IdNumClient."'";  
$req = mysqli_query($link, $sql); 
$row = mysqli_fetch_row($req);
$last_num_entre = $row[0];
$last_num_entre = $last_num_entre + 1 ;

echo "<input type='hidden' name='Num_CF' value='$last_num_entre'/>";
      
echo "<center>$last_num_entre<center></td>";
echo "</tr>";
echo "<th width='125' align='center' valign='middle'>Categorie</th>
	  <td colspan='3' width='250' align='left' valign='middle'>";
echo "<select style=' width: 150px;' name='Num_CatPlu' id='Num_CatCF'>";
echo "<option value='0'>Toutes</option>";

$sql = 'select * FROM categorie_CF';
$req = mysqli_query($link, $sql);  
while ($row = mysqli_fetch_assoc($req)) {
        $num_cate_plu_intran = $row["num_cate_cf"];
        $categorie_plu_intran = $row["categorie_cf"];
   echo "<option value='$num_cate_plu_intran'>$num_cate_plu_intran | $categorie_plu_intran</option>";
}

echo "</select>";

echo "</th></tr> ";
echo "<tr>";
echo "<th align='center' valign='middle'>Nom Ch Froide : </th>";
echo "<td colspan='3'><input name='Nom_plu_intrant' type='text' id='Nom_plu_intrant' accesskey='3' tabindex='3' value='$Nom_plu_intrant' size='30' maxlength='30'></td>";
echo "</tr>";
echo "<tr>";
echo "<th align='center' valign='middle'>T&deg; c Min </th>
      <td colspan='0'><select name='temp_min' id='temp_min'>";
      
				$a=6;
				for ($i = -22; $i <= 20; $i+=0.2) {
				$i = number_format($i, 2, '.', ' ')	;
				 	if ($a==$i){
				 	echo "<option value='$i' selected>$i</option>";	
				 	} ELSE {
				 	echo "<option value='$i'>$i</option>";	
				 	}
				 	
				}

echo "</select>";

echo "<th align='center' valign='middle'>T&deg; c Max </th>";
echo "<td colspan='0'><select name='temp_max' id='temp_max'>";
				$a=12;
				for ($i = -22; $i <= 20; $i+=0.2) {
				$i = number_format($i, 2, '.', ' ')	;
				 	if ($a==$i){
				 	echo "<option value='$i' selected>$i</option>";	
				 	} ELSE {
				 	echo "<option value='$i'>$i</option>";	
				 	}
				 	
				}
				
echo "</select>";
echo "</tr>";
echo "<tr>";
echo "<th align='center' valign='middle'>Hydro Min</th>
      <td colspan='0'><select name='hydro_min' id='temp_min'>";
      echo "<option value='0'>Pas Hydro</option>";	
    	
				for ($i = 1; $i <= 100; $i+=0.1) {
				$i = number_format($i, 2, '.', ' ')	;
				 	echo "<option value='$i'>$i</option>";	
				 	}
echo "</select>";

echo "<th align='center' valign='middle'>Hydro Max</th>";
echo "<td colspan='0'><select name='hydro_max' id='temp_max'>";
echo "<option value='0'>Pas Hydro</option>";	
			for ($i = 1; $i <= 100; $i+=0.1) {
				$i = number_format($i, 2, '.', ' ')	;
				 	echo "<option value='$i'>$i</option>";	
				 	}
				 	
				
echo "</select>";
echo "</tr>";

echo "<tr>";
echo "<th colspan='4' align='center' valign='middle'>
	  <input type='submit' name='ok' id='ok' value='Valider' accesskey='11' tabindex='11'>
	  &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;
	  <input name='an' type='button' id='an' accesskey='12' tabindex='12' value='Retour' onClick='history.back()'></th>";
echo " </tr></div>";
echo "</table>";
echo "</form>";
echo "</center><br>" ;


include 'menu/footer.php';
?>
