<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>

<?php 
include ("../navigation/header.php");

$page_name = "DF-Production-main";
include ("../navigation/access.php");

if ($permission_num==1) {

include ("../navigation/dry_feed_production_sidebar.php");

 
$table_name = $_SESSION['db_prefix']."_ingredients";	 	
$display_query = "SELECT * FROM $table_name ORDER BY ingredients ASC ";
$display_result = $con->query($display_query);
$display_num = mysqli_num_rows($display_result);
		
?> 

<!--style sheets-->
<link rel="stylesheet" type="text/css" href="../css/scroll_table.css" />
<link rel="stylesheet" type="text/css" href="../css/tooltip.css" />

<!--jscript-->
<script language="JavaScript" src="../jscript/tooltip.js"  type="text/javascript"></script> 

</head>


<body>

<div class="main_frame">
<div class="page_head_frame">
  <label class="label_page_head">Ingredients</label></div>
   
<br />
<br /><br />
<br />
    
<br />
<div class="page_middle_frame" style="overflow:scroll">
<!--jscript-->
<script type="text/javascript" language="javascript" src="../jscript/jquery.dataTables.js"></script>
<script type="text/javascript" charset="utf-8">
			$(document).ready(function() {
				$('#scroll_table').dataTable( {
					"sScrollY": "500px",
					"bPaginate": false,
					"bScrollCollapse": true,
					"aaSorting": [[ 1, "asc" ]],
					"aoColumns": [
								{"bSortable": true},
								{"bSortable": true},
								{"bSortable": false},
								{"bSortable": false},
								{"bSortable": false},
								{"bSortable": false},
								{"bSortable": false},
								{"bSortable": false},
								{"bSortable": false},
								{"bSortable": false},
								{"bSortable": false},
								{"bSortable": false},
								{"bSortable": false},
								{"bSortable": false},
								{"bSortable": false},
								{"bSortable": false},
								{"bSortable": false},
								{"bSortable": false},
								{"bSortable": false},
								{"bSortable": false},
								{"bSortable": false},
								{"bSortable": false},
								{"bSortable": false},
								{"bSortable": false},
								{"bSortable": false},
								{"bSortable": false}
                         	 ]
				} );
			} );
		</script>    	
<table width="572" id="scroll_table" class="data_display" >
	<thead>
		<tr>
		  <th align="center">Code<br>
	      no</th>
		  <th align="center">Ingredients</th>
		  <th align="center">Costs</th>
		  <th align="center">Density</th>
		  <th align="center">DM</th>
          <th align="center">C_prot</th>
		  <th align="center">NDP</th>
		  <th align="center">NPN</th>
		  <th align="center">TDN</th>
		  <th align="center">TDN d</th>
		  <th align="center">C_fibre</th>
		  <th align="center">NDF</th>
		  <th align="center">NSC</th>
		  <th align="center">Fat</th>
		  <th align="center">Ca</th>
		  <th align="center">P</th>
		  <th align="center">K</th>
		  <th align="center">Mg</th>
		  <th align="center">Salt</th>
		  <th align="center">Fe</th>
		  <th align="center">Mn</th>
		  <th align="center">Cu</th>
		  <th align="center">Zn</th>
		  <th align="center">Co</th>
		  <th align="center">I</th>
		  <th align="center">SE</th>
	    </tr>
	</thead>
	<tbody>
  <?php
     	while($row = $display_result->fetch_assoc()) {
		 $b0 = $row["Code"];
		 $b1 = $row["Ingredients"];
		 $b2 = $row["Costs"];
		 $b3 = $row["Density"];
		 $b4 = $row["DM"];
		 $b5 = $row["C_prot"];
		 $b6 = $row["NDP"];
		 $b7 = $row["NPN"];
		 $b8 = $row["TDN"];
		 $b9 = $row["TDN_d"];
		 $b10 = $row["C_fibre"];
		 $b11 = $row["NDF"];
		 $b12 = $row["NSC"];
		 $b13 = $row["Fat"];
		 $b14 = $row["Ca"];
		 $b15 = $row["P"];
		 $b16 = $row["K"];
		 $b17 = $row["Mg"];
		 $b18 = $row["S"];
		 $b19 = $row["Salt"];
		 $b20 = $row["Fe"];
		 $b21 = $row["Mn"];
		 $b22 = $row["Cu"];
		 $b23 = $row["Zn"];
		 $b24 = $row["Co"];
		 $b25 = $row["I"];
		 $b26 = $row["SE"];
		 
								
		?>
		<tr >
		  <td align="left"><?php echo $b0 ?></td>
		  <td align="left" ><?php echo $b1 ?></td>
		  <td align="right"><?php echo number_format($b2, 2, '.', ',') ?></td>
		  <td align="center"><?php echo $b3 ?></td>
		  <td align="center"><?php echo $b4 ?></td>
		  <td align="center"><?php echo $b5 ?></td>
		  <td align="center"><?php echo $b6 ?></td>
		  <td align="center"><?php echo $b7 ?></td>
		  <td align="center"><?php echo $b8 ?></td>
		  <td align="center"><?php echo $b9 ?></td>
		  <td align="center"><?php echo $b10 ?></td>
		  <td align="center"><?php echo $b11 ?></td>
		  <td align="center"><?php echo $b12 ?></td>
		  <td align="center"><?php echo $b13 ?></td>
		  <td align="center"><?php echo $b14 ?></td>
		  <td align="center"><?php echo $b15 ?></td>
		  <td align="center"><?php echo $b16 ?></td>
		  <td align="center"><?php echo $b17 ?></td>
		  <td align="center"><?php echo $b18 ?></td>
		  <td align="center"><?php echo $b19 ?></td>
		  <td align="center"><?php echo $b20 ?></td>
		  <td align="center"><?php echo $b21 ?></td>
		  <td align="center"><?php echo $b22 ?></td>
		  <td align="center"><?php echo $b23 ?></td>
		  <td align="center"><?php echo $b24 ?></td>
		  <td align="center"><?php echo $b25 ?></td>
	    </tr>
	<?php
	}
	?>
	
</table>
<br>
	

</div>    
</div>
</body>
<?php } else {  ?>
<script> needToConfirm = false; </script>
<?php
    $_SESSION['denied_return'] = "dry_feed/dry_feed_main.php?";	?>
<body onLoad="accessdenied(); return false">
</body>
<?php }
?>
<?php include ('../navigation/side_bar.php'); ?>