1 <?php |
1 <?php |
2 require_once($_SERVER['DOCUMENT_ROOT'].'/includes/global.inc.php'); |
2 require_once($_SERVER['DOCUMENT_ROOT'].'/includes/global.inc.php'); |
3 require_once($_SERVER['DOCUMENT_ROOT'].'/includes/formulas.php'); |
3 require_once($_SERVER['DOCUMENT_ROOT'].'/includes/formulas.php'); |
|
4 require_once($_SERVER['DOCUMENT_ROOT'].'/includes/constants.php'); |
4 |
5 |
5 |
6 |
6 $link = mysqli_connect(DBASE_HOST,DBASE_USER,DBASE_PASS,DBASE_NAME); |
7 $link = mysqli_connect(DBASE_HOST,DBASE_USER,DBASE_PASS,DBASE_NAME); |
7 if (! $link) { |
8 if (! $link) { |
8 die('Connect Error (' . mysqli_connect_errno() . ') ' . mysqli_connect_error()); |
9 die('Connect Error (' . mysqli_connect_errno() . ') ' . mysqli_connect_error()); |
30 <meta name="viewport" content="width=device-width, initial-scale=1 maximum-scale=1 minimum-scale=1" /> |
31 <meta name="viewport" content="width=device-width, initial-scale=1 maximum-scale=1 minimum-scale=1" /> |
31 </head> |
32 </head> |
32 <body> |
33 <body> |
33 <pre> |
34 <pre> |
34 <?php |
35 <?php |
35 |
|
36 $recipetype = array( 'Extract', 'Deelmaisch', 'Mout' ); |
|
37 $colormethod = array( 'Morey', 'Mosher', 'Daniels' ); |
|
38 $ibumethod = array( 'Tinseth', 'Rager', 'Daniels' ); |
|
39 $added = array( 'Maischen', 'Koken', 'Vergisten', 'Nagisten/lageren', 'Bottelen' ); |
|
40 $hopform = array( 'Pellets', 'Plugs', 'Bellen', 'Hop nat', 'Cryo Hop' ); |
|
41 $hopuse = array( 'Maischen', 'First wort', 'Koken', 'Vlamuit', 'Whirlpool', 'Koudhop' ); |
|
42 $misctype = array( 'Specerij', 'Kruid', 'Smaakstof', 'Klaringsmiddel', 'Brouwzout', 'Gistvoeding', 'Anders' ); |
|
43 $miscuse = array( 'Starter', 'Maischen', 'Koken', 'Hoofdvergisting', 'Nagisting/lagering', 'Bottelen' ); |
|
44 $yeastform = array( 'Vloeibaar', 'Droog', 'Schuine buis', 'Slurry', 'Ingevroren', 'Depot' ); |
|
45 $yeastuse = array( 'Hoofdgisting', 'Nagisting', 'Lagering', 'Bottelen' ); |
|
46 $steptype = array( 'Infusie', 'Directe verwarming', 'Decoctie' ); |
|
47 $acidtype = array( 'Melkzuur', 'Zoutzuur', 'Fosforzuur', 'Zwavelzuur' ); |
|
48 |
36 |
49 |
37 |
50 function itemline($item, $content) { |
38 function itemline($item, $content) { |
51 |
39 |
52 echo $item . " "; |
40 echo $item . " "; |
111 $sugarsm = 0; |
99 $sugarsm = 0; |
112 $grainabsorbtion = 0; |
100 $grainabsorbtion = 0; |
113 $mashwater = 0; |
101 $mashwater = 0; |
114 |
102 |
115 $arr = json_decode($row['json_fermentables'], true); |
103 $arr = json_decode($row['json_fermentables'], true); |
116 echo "Mout, granen en suikers EBC Gewicht kg % Gebruik tijdens" . PHP_EOL; |
104 echo "Mout, granen en suikers EBC Gewicht kg % Gebruik tijdens" . PHP_EOL; |
117 echo "---------------------------------------- --- ---------- ----- ----------------" . PHP_EOL; |
105 echo "---------------------------------------- ---- ---------- ----- ----------------" . PHP_EOL; |
118 foreach($arr as $item) { |
106 foreach($arr as $item) { |
119 $name = formatstr($item['f_name'] . " (" . $item['f_supplier'] . ")", 40); |
107 $name = formatstr($item['f_name'] . " (" . $item['f_supplier'] . ")", 40); |
120 $amount = floatval($item['f_amount']); |
108 $amount = floatval($item['f_amount']); |
121 $d = $amount * (floatval($item['f_yield']) / 100) * (1 - floatval($item['f_moisture']) / 100); |
109 $d = $amount * (floatval($item['f_yield']) / 100) * (1 - floatval($item['f_moisture']) / 100); |
122 if ($item['f_added'] == 0) { |
110 if ($item['f_added'] == 0) { |
123 $d = floatval($row['efficiency']) / 100 * $d; |
111 $d = floatval($row['efficiency']) / 100 * $d; |
124 $sugarsm += $d; |
112 $sugarsm += $d; |
125 $grainabsorbtion += $item['f_amount']; |
113 $grainabsorbtion += $item['f_amount']; |
126 } |
114 } |
127 echo sprintf("%s %3.0f %10.3f %5.1f ", $name, floatval($item['f_color']), $amount, floatval($item['f_percentage'])); |
115 echo sprintf("%s %4.0f %10.3f %5.1f ", $name, floatval($item['f_color']), $amount, floatval($item['f_percentage'])); |
128 echo $added[$item['f_added']] . PHP_EOL; |
116 echo $added[$item['f_added']] . PHP_EOL; |
129 } |
117 } |
130 $preboil_sg = estimate_sg($sugarsm, floatval($row['boil_size'])); |
118 $preboil_sg = estimate_sg($sugarsm, floatval($row['boil_size'])); |
131 echo PHP_EOL . PHP_EOL; |
119 echo PHP_EOL . PHP_EOL; |
132 |
120 |
208 echo "-------------------- ---------------------- --------- --------- ---------" . PHP_EOL; |
196 echo "-------------------- ---------------------- --------- --------- ---------" . PHP_EOL; |
209 $arr = json_decode($row['json_mashs'], true); |
197 $arr = json_decode($row['json_mashs'], true); |
210 foreach($arr as $item) { |
198 foreach($arr as $item) { |
211 |
199 |
212 if ($item['step_type'] == 1) { |
200 if ($item['step_type'] == 1) { |
213 $stype = formatstr($steptype[$item['step_type']], 22); |
201 $stype = formatstr($mashtype[$item['step_type']], 22); |
214 } else { |
202 } else { |
215 $stype = formatstr($steptype[$item['step_type']].' '.sprintf("%.1f", $item['step_infuse_amount']).' liter', 22); |
203 $stype = formatstr($mashtype[$item['step_type']].' '.sprintf("%.1f", $item['step_infuse_amount']).' liter', 22); |
216 } |
204 } |
217 echo sprintf("%s %s %s %s %s", |
205 echo sprintf("%s %s %s %s %s", |
218 formatstr($item['step_name'], 20), $stype, sprintf("%6.1f °C", $item['step_temp']), |
206 formatstr($item['step_name'], 20), $stype, sprintf("%6.1f °C", $item['step_temp']), |
219 sprintf("%4.0f min.", $item['step_time']), sprintf("%4.0f min.", $item['ramp_time'])) . PHP_EOL; |
207 sprintf("%4.0f min.", $item['step_time']), sprintf("%4.0f min.", $item['ramp_time'])) . PHP_EOL; |
220 } |
208 } |