www/includes/db_recipes.php

changeset 352
9d2a4703bdac
parent 350
c314277905e6
child 359
98354ef399cd
--- a/www/includes/db_recipes.php	Wed May 08 22:23:52 2019 +0200
+++ b/www/includes/db_recipes.php	Thu May 09 14:53:10 2019 +0200
@@ -244,10 +244,10 @@
 				$mash .= ',"step_infuse_amount":0';
 			$mash .= ',"step_temp":' . $item['step_temp'];
 			$mash .= ',"step_time":' . $item['step_time'];
-			$mash .= ',"step_thickness":' . $item['step_thickness'];
 			$mash .= ',"ramp_time":' . $item['ramp_time'];
 			$mash .= ',"end_temp":' . $item['end_temp'] . '}';
 			$mashs .= $mash;
+			syslog(LOG_NOTICE, $mash);
 		}
 	}
 	$mashs .= ']';
@@ -297,7 +297,6 @@
 	$recipes = '[';
 	$comma = FALSE;
 	while ($row = mysqli_fetch_array($result, MYSQLI_ASSOC)) {
-		$mashkg = 0;
 		// Manual encode to JSON.
 		if ($comma) {
 			$recipes .= ',';
@@ -376,9 +375,6 @@
 			// Append stock information.
 			$fermentables = json_decode($row['json_fermentables'], true);
 			for ($i = 0; $i < count($fermentables); $i++) {
-				if ($fermentables[$i]['f_added'] == 0) {
-					$mashkg += $fermentables[$i]['f_amount'];
-				}
 				$fermentables[$i]['f_inventory'] = 0;	// Not in stock
 				$fermentables[$i]['f_avail'] = 0;	// Ingredient not in db
 				$sql2 = "SELECT inventory FROM inventory_fermentables ";
@@ -457,20 +453,7 @@
 			$recipes .= ',"miscs":' . $row['json_miscs'];
 			$recipes .= ',"yeasts":' . $row['json_yeasts'];
 		}
-		if (isset($_GET['record'])) {
-			$volume = 0;
-			$mashs = json_decode($row['json_mashs'], true);
-                        for ($i = 0; $i < count($mashs); $i++) {
-				$volume += $mashs[$i]['step_infuse_amount'];
-				if ($mashkg > 0)
-					$mashs[$i]['step_thickness'] = floatval(sprintf("%.3f", $volume / $mashkg));
-				else
-					$mashs[$i]['step_thickness'] = 0;
-			}
-			$recipes .= ',"mashs":' . json_encode($mashs, JSON_UNESCAPED_UNICODE);
-		} else {
-			$recipes .= ',"mashs":' . $row['json_mashs'];
-		}
+		$recipes .= ',"mashs":' . $row['json_mashs'];
 		$recipes .= '}';
 	}
 	$recipes .= ']';

mercurial