|
1 <?php |
|
2 require_once($_SERVER['DOCUMENT_ROOT'].'/includes/global.inc.php'); |
|
3 page_header('Hoofdmenu', NULL); |
|
4 ?> |
|
5 |
|
6 <div id="MainPanel"> |
|
7 <div id="ContentPanel"></div> |
|
8 <pre> |
|
9 <?php |
|
10 $mysqli = new mysqli(DBASE_HOST,DBASE_USER,DBASE_PASS,DBASE_NAME); |
|
11 $result = $mysqli->query("SELECT name,inventory,cost FROM inventory_fermentables WHERE inventory > 0"); |
|
12 $tot_fermentables = 0.0; |
|
13 printf("Vergistbaar ingredient Voorraad Prijs/kg Waarde\n"); |
|
14 printf("---------------------------------------- ---------- -------- --------\n"); |
|
15 while($row = $result->fetch_array(MYSQLI_ASSOC)) { |
|
16 $value = $row['inventory'] * $row['cost']; |
|
17 $tot_fermentables += $value; |
|
18 // printf("%-40s %10.5f kg %8.2f %8.2f \n", $row['name'], $row['inventory'], $row['cost'], $value); |
|
19 } |
|
20 printf("---------------------------------------- --------\n"); |
|
21 printf("Totaal %8.2f\n\n", $tot_fermentables); |
|
22 |
|
23 $tot_hops = 0.0; |
|
24 $result = $mysqli->query("SELECT name,inventory,cost FROM inventory_hops WHERE inventory > 0"); |
|
25 $tot_fermentables = 0.0; |
|
26 printf("Hoppen Voorraad Prijs/kg Waarde\n"); |
|
27 printf("---------------------------------------- ---------- -------- --------\n"); |
|
28 while($row = $result->fetch_array(MYSQLI_ASSOC)) { |
|
29 $value = $row['inventory'] * $row['cost']; |
|
30 $tot_hops += $value; |
|
31 printf("%-40s %10.5f kg %8.2f %8.2f \n", $row['name'], $row['inventory'], $row['cost'], $value); |
|
32 } |
|
33 printf("---------------------------------------- --------\n\n"); |
|
34 printf("Totaal %8.2f\n", $tot_hops ); |
|
35 |
|
36 $tot_yeats = 0.0; |
|
37 $result = $mysqli->query("SELECT name,inventory,cost FROM inventory_yeasts WHERE inventory > 0"); |
|
38 $tot_fermentables = 0.0; |
|
39 printf("Hoppen Voorraad Prijs/kg Waarde\n"); |
|
40 printf("---------------------------------------- ---------- -------- --------\n"); |
|
41 while($row = $result->fetch_array(MYSQLI_ASSOC)) { |
|
42 $value = $row['inventory'] * $row['cost']; |
|
43 $tot_yeasts += $value; |
|
44 printf("%-40s %10.5f kg %8.2f %8.2f \n", $row['name'], $row['inventory'], $row['cost'], $value); |
|
45 } |
|
46 printf("---------------------------------------- --------\n\n"); |
|
47 printf("Totaal %8.2f\n", $tot_yeasts ); |
|
48 ?> |
|
49 </pre> |
|
50 </div> |
|
51 |
|
52 <?php |
|
53 page_footer(); |
|
54 ?> |