www/prod_forum.php

branch
stable
changeset 520
d25a1b160dba
parent 516
28670364bd0c
child 537
9dbce45f39b7
child 539
fe9ac6d49c4f
--- a/www/prod_forum.php	Sat Sep 14 10:41:35 2019 +0200
+++ b/www/prod_forum.php	Fri Oct 18 13:12:46 2019 +0200
@@ -1,6 +1,7 @@
 <?php
 require_once($_SERVER['DOCUMENT_ROOT'].'/includes/global.inc.php');
 require_once($_SERVER['DOCUMENT_ROOT'].'/includes/formulas.php');
+require_once($_SERVER['DOCUMENT_ROOT'].'/includes/constants.php');
 
 
 $link = mysqli_connect(DBASE_HOST,DBASE_USER,DBASE_PASS,DBASE_NAME);
@@ -33,19 +34,6 @@
   <pre>
 <?php
 
-$recipetype  = array( 'Extract', 'Deelmaisch', 'Mout' );
-$colormethod = array( 'Morey', 'Mosher', 'Daniels' );
-$ibumethod   = array( 'Tinseth', 'Rager', 'Daniels' );
-$added       = array( 'Maischen', 'Koken', 'Vergisten', 'Nagisten/lageren', 'Bottelen' );
-$hopform     = array( 'Pellets', 'Plugs', 'Bellen', 'Hop nat', 'Cryo Hop' );
-$hopuse      = array( 'Maischen', 'First wort', 'Koken', 'Vlamuit', 'Whirlpool', 'Koudhop' );
-$misctype    = array( 'Specerij', 'Kruid', 'Smaakstof', 'Klaringsmiddel', 'Brouwzout', 'Gistvoeding', 'Anders' );
-$miscuse     = array( 'Starter', 'Maischen', 'Koken', 'Hoofdvergisting', 'Nagisting/lagering', 'Bottelen' );
-$yeastform   = array( 'Vloeibaar', 'Droog', 'Schuine buis', 'Slurry', 'Ingevroren', 'Depot' );
-$yeastuse    = array( 'Hoofdgisting', 'Nagisting', 'Lagering', 'Bottelen' );
-$steptype    = array( 'Infusie', 'Directe verwarming', 'Decoctie' );
-$acidtype    = array( 'Melkzuur', 'Zoutzuur', 'Fosforzuur', 'Zwavelzuur' );
-
 
 function itemline($item, $content) {
 
@@ -113,8 +101,8 @@
 $mashwater = 0;
 
 $arr = json_decode($row['json_fermentables'], true);
-echo "Mout, granen en suikers                  EBC Gewicht kg     % Gebruik tijdens" . PHP_EOL;
-echo "---------------------------------------- --- ---------- ----- ----------------" . PHP_EOL;
+echo "Mout, granen en suikers                   EBC Gewicht kg     % Gebruik tijdens" . PHP_EOL;
+echo "---------------------------------------- ---- ---------- ----- ----------------" . PHP_EOL;
 foreach($arr as $item) {
 	$name = formatstr($item['f_name'] . " (" . $item['f_supplier'] . ")", 40);
 	$amount   = floatval($item['f_amount']);
@@ -124,7 +112,7 @@
                 $sugarsm += $d;
 		$grainabsorbtion += $item['f_amount'];
         }
-	echo sprintf("%s %3.0f %10.3f %5.1f ", $name, floatval($item['f_color']), $amount, floatval($item['f_percentage']));
+	echo sprintf("%s %4.0f %10.3f %5.1f ", $name, floatval($item['f_color']), $amount, floatval($item['f_percentage']));
 	echo $added[$item['f_added']] . PHP_EOL;
 }
 $preboil_sg = estimate_sg($sugarsm, floatval($row['boil_size']));
@@ -180,7 +168,7 @@
 
 	if ($item['y_form'] == 0)       // Liquid
                 $amount = sprintf("%.0f",floatval($item['y_amount']))." pak";
-        else if ($item['y_form'] == 1)  // Dry
+        else if ($item['y_form'] == 1 || $item['y_form'] == 6)  // Dry
                 $amount = sprintf("%.1f",floatval($item['y_amount'])*1000)." gr";
         else
                 $amount = sprintf("%.0f",floatval($item['y_amount'])*1000)." ml";
@@ -210,9 +198,9 @@
 foreach($arr as $item) {
 	
 	if ($item['step_type'] == 1) {
-		$stype = formatstr($steptype[$item['step_type']], 22);
+		$stype = formatstr($mashtype[$item['step_type']], 22);
 	} else {
-		$stype = formatstr($steptype[$item['step_type']].' '.sprintf("%.1f", $item['step_infuse_amount']).' liter', 22);
+		$stype = formatstr($mashtype[$item['step_type']].' '.sprintf("%.1f", $item['step_infuse_amount']).' liter', 22);
 	}
 	echo sprintf("%s %s %s %s %s", 
 		formatstr($item['step_name'], 20), $stype, sprintf("%6.1f &deg;C", $item['step_temp']),

mercurial