<?php
include("../include/session.php");
if(!$session->logged_in) {
	header("Location: ../main.php");
}
else {
	include("../productionHeader.php");
	$q = "SELECT id, recipieName FROM nam_recipiedepalet";
	$r = execsql($q);
	$n = mysql_num_rows($r);
	$i = 0;
	while($i < $n){
		$recipie[mysql_result($r, $i, "id")] = mysql_result($r, $i, "recipieName");
		$i++;
	}
	?>
	<h3>Packaging Recipie</h3><br />
	<form name="form">
	Category:<select name="URL" onchange="window.location.href= this.form.URL.options[this.form.URL.selectedIndex].value">
			<option value="">Choose me</option>
			<option value="addDepalet.php">New Recipie</option>
			<?php				foreach($recipie as $key => $value){
					?>
					<option value="addDepalet.php?recipieId=<?php echo $key?>"><?php echo $value?></option>
					<?php					
//					echo "<option value\"addDepalet.php?recipieId=$key\">$value</option>";
				}
			?>
			
		</select>
	</form>
	
<?php 	
	include("../footer.html");
}
?>