diff -r a12d0a4d621e -r f5ab22446aa5 www/inv_instock.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/www/inv_instock.php Sun Aug 19 15:36:13 2018 +0200 @@ -0,0 +1,54 @@ + + +
+
+
+query("SELECT name,inventory,cost FROM inventory_fermentables WHERE inventory > 0");
+$tot_fermentables = 0.0;
+printf("Vergistbaar ingredient                     Voorraad     Prijs/kg    Waarde\n");
+printf("---------------------------------------- ----------     --------  --------\n");
+while($row = $result->fetch_array(MYSQLI_ASSOC)) {
+	$value = $row['inventory'] * $row['cost'];
+	$tot_fermentables += $value;
+//	printf("%-40s %10.5f kg  %8.2f  %8.2f \n", $row['name'], $row['inventory'], $row['cost'], $value);
+}
+printf("----------------------------------------                          --------\n");
+printf("Totaal                                                            %8.2f\n\n", $tot_fermentables);
+
+$tot_hops = 0.0;
+$result = $mysqli->query("SELECT name,inventory,cost FROM inventory_hops WHERE inventory > 0");
+$tot_fermentables = 0.0;
+printf("Hoppen                                     Voorraad     Prijs/kg    Waarde\n");
+printf("---------------------------------------- ----------     --------  --------\n");
+while($row = $result->fetch_array(MYSQLI_ASSOC)) {
+        $value = $row['inventory'] * $row['cost'];
+        $tot_hops += $value;
+	printf("%-40s %10.5f kg  %8.2f  %8.2f \n", $row['name'], $row['inventory'], $row['cost'], $value);
+}
+printf("----------------------------------------                          --------\n\n");
+printf("Totaal                                                            %8.2f\n", $tot_hops );
+
+$tot_yeats = 0.0;
+$result = $mysqli->query("SELECT name,inventory,cost FROM inventory_yeasts WHERE inventory > 0");
+$tot_fermentables = 0.0;
+printf("Hoppen                                     Voorraad     Prijs/kg    Waarde\n");
+printf("---------------------------------------- ----------     --------  --------\n");
+while($row = $result->fetch_array(MYSQLI_ASSOC)) {
+        $value = $row['inventory'] * $row['cost'];
+        $tot_yeasts += $value;
+        printf("%-40s %10.5f kg  %8.2f  %8.2f \n", $row['name'], $row['inventory'], $row['cost'], $value);
+}
+printf("----------------------------------------                          --------\n\n");
+printf("Totaal                                                            %8.2f\n", $tot_yeasts );
+?>
+    
+
+ +