www/includes/db_recipes.php

changeset 51
7224109adfe1
parent 50
6d94167c2697
child 52
b1f2a893572f
--- a/www/includes/db_recipes.php	Sat Sep 01 22:24:09 2018 +0200
+++ b/www/includes/db_recipes.php	Tue Sep 04 13:44:02 2018 +0200
@@ -16,7 +16,7 @@
 $replacements = array("\\\\", "\\/", "\\\"", "\\n", "\\r", "\\t", "\\f", "\\b");
 
 // get data and store in a json array
-$query = "SELECT * FROM recipes ORDER BY style_guide,style_letter,style_name,name";
+$query = "SELECT * FROM recipes ORDER BY st_guide,st_letter,st_name,name";
 if (isset($_GET['insert'])) {
 //	// INSERT COMMAND
 //	$sql  = "INSERT INTO `profile_mash` SET name='" . mysqli_real_escape_string($connect, $_GET['name']);
@@ -68,10 +68,22 @@
 		}
 		$comma = TRUE;
 		$recipes .= '{"record":' . $row['record'];
-		$recipes .=  ',"style_guide":"' . str_replace($escapers, $replacements, $row['style_guide']);
-		$recipes .= '","style_letter":"' . str_replace($escapers, $replacements, $row['style_letter']);
-		$recipes .= '","style_name":"'  . str_replace($escapers, $replacements, $row['style_name']);
-		$recipes .= '","name":"' . str_replace($escapers, $replacements, $row['name']);
+		$recipes .=  ',"st_guide":"' . str_replace($escapers, $replacements, $row['st_guide']);
+		$recipes .= '","st_letter":"' . str_replace($escapers, $replacements, $row['st_letter']);
+		$recipes .= '","st_name":"'  . str_replace($escapers, $replacements, $row['st_name']);
+		$recipes .= '","st_og_min":' . floatval($row['st_og_min']);
+		$recipes .= ',"st_og_max":' . floatval($row['st_og_max']);
+		$recipes .= ',"st_fg_min":' . floatval($row['st_fg_min']);
+		$recipes .= ',"st_fg_max":' . floatval($row['st_fg_max']);
+		$recipes .= ',"st_ibu_min":' . floatval($row['st_ibu_min']);
+		$recipes .= ',"st_ibu_max":' . floatval($row['st_ibu_max']);
+		$recipes .= ',"st_color_min":' . floatval($row['st_color_min']);
+		$recipes .= ',"st_color_max":' . floatval($row['st_color_max']);
+		$recipes .= ',"st_carb_min":' . floatval($row['st_carb_min']);
+		$recipes .= ',"st_carb_max":' . floatval($row['st_carb_max']);
+		$recipes .= ',"st_abv_min":' . floatval($row['st_abv_min']);
+		$recipes .= ',"st_abv_max":' . floatval($row['st_abv_max']);
+		$recipes .= ',"name":"' . str_replace($escapers, $replacements, $row['name']);
 		$recipes .= '","notes":"' . str_replace($escapers, $replacements, $row['notes']);
 		$recipes .= '","type":"' . $row['type'];
 		$recipes .= '","batch_size":' . floatval($row['batch_size']);
@@ -83,12 +95,15 @@
 		$recipes .= ',"color_method":"' . $row['color_method'];
 		$recipes .= '","est_ibu":' . floatval($row['est_ibu']);
 		$recipes .= ',"ibu_method":"' . $row['ibu_method'];
+		$recipes .= '","mash_sparge_temp":' . $row['mash_sparge_temp'];
+		$recipes .= ',"mash_ph":' . $row['mash_ph'];
+		$recipes .= ',"mash_name":"' . $row['mash_name'];
 		$recipes .= '","fermentables":' . $row['json_fermentables'];
 		$recipes .= ',"hops":' . $row['json_hops'];
 		$recipes .= ',"miscs":' . $row['json_miscs'];
 		$recipes .= ',"yeasts":' . $row['json_yeasts'];
 		$recipes .= ',"waters":' . $row['json_waters'];
-		$recipes .= ',"mash":' . $row['json_mash'];
+		$recipes .= ',"mashs":' . $row['json_mashs'];
 		$recipes .= '}';
 	}
 	$recipes .= ']';

mercurial