www/prod_forum.php

Tue, 10 Dec 2019 20:11:37 +0100

author
Michiel Broek <mbroek@mbse.eu>
date
Tue, 10 Dec 2019 20:11:37 +0100
changeset 565
dfc850e6ee1f
parent 542
dabe1c854a0f
child 666
029e65ca3678
permissions
-rw-r--r--

Fix upgrade of the yeast data in products and recipes if the original yeast is not found. Export product or recipe for forum is now coded in forum format and copied to the clipboard ready to paste on a forum.

341
9c4bc199be9e Added product forum export and changed the export menu.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1 <?php
9c4bc199be9e Added product forum export and changed the export menu.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2 require_once($_SERVER['DOCUMENT_ROOT'].'/includes/global.inc.php');
9c4bc199be9e Added product forum export and changed the export menu.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3 require_once($_SERVER['DOCUMENT_ROOT'].'/includes/formulas.php');
514
3c680d1dea35 Added dutch array strings to a global php script. Changed fermentables, hops, yeast and misc inventory scripts to use these strings between the database scripts and javascript scripts. This makes filtering on types strings useable. Added these changes to the product/recipe forum and print exports too.
Michiel Broek <mbroek@mbse.eu>
parents: 449
diff changeset
4 require_once($_SERVER['DOCUMENT_ROOT'].'/includes/constants.php');
341
9c4bc199be9e Added product forum export and changed the export menu.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5
9c4bc199be9e Added product forum export and changed the export menu.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6 $link = mysqli_connect(DBASE_HOST,DBASE_USER,DBASE_PASS,DBASE_NAME);
9c4bc199be9e Added product forum export and changed the export menu.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7 if (! $link) {
565
dfc850e6ee1f Fix upgrade of the yeast data in products and recipes if the original yeast is not found. Export product or recipe for forum is now coded in forum format and copied to the clipboard ready to paste on a forum.
Michiel Broek <mbroek@mbse.eu>
parents: 542
diff changeset
8 die('Connect Error ('.mysqli_connect_errno().') '.mysqli_connect_error());
341
9c4bc199be9e Added product forum export and changed the export menu.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9 }
9c4bc199be9e Added product forum export and changed the export menu.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
10 if (! mysqli_set_charset($link, "utf8" )) {
9c4bc199be9e Added product forum export and changed the export menu.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
11 echo "error";
9c4bc199be9e Added product forum export and changed the export menu.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
12 return 1;
9c4bc199be9e Added product forum export and changed the export menu.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
13 }
9c4bc199be9e Added product forum export and changed the export menu.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
14
9c4bc199be9e Added product forum export and changed the export menu.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
15 setlocale ( LC_ALL, 'nl_NL.UTF-8');
9c4bc199be9e Added product forum export and changed the export menu.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
16 $record = $_GET["record"];
9c4bc199be9e Added product forum export and changed the export menu.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
17 $result = mysqli_query($link, "SELECT * FROM products WHERE record='".$record."'");
9c4bc199be9e Added product forum export and changed the export menu.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
18 $row = mysqli_fetch_array($result);
9c4bc199be9e Added product forum export and changed the export menu.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
19
9c4bc199be9e Added product forum export and changed the export menu.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
20 $preboil_sg = 0;
9c4bc199be9e Added product forum export and changed the export menu.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
21 date_default_timezone_set('Europe/Amsterdam');
9c4bc199be9e Added product forum export and changed the export menu.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
22 $prdate = date(DATE_RFC2822);
9c4bc199be9e Added product forum export and changed the export menu.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
23
9c4bc199be9e Added product forum export and changed the export menu.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
24
565
dfc850e6ee1f Fix upgrade of the yeast data in products and recipes if the original yeast is not found. Export product or recipe for forum is now coded in forum format and copied to the clipboard ready to paste on a forum.
Michiel Broek <mbroek@mbse.eu>
parents: 542
diff changeset
25 /*
dfc850e6ee1f Fix upgrade of the yeast data in products and recipes if the original yeast is not found. Export product or recipe for forum is now coded in forum format and copied to the clipboard ready to paste on a forum.
Michiel Broek <mbroek@mbse.eu>
parents: 542
diff changeset
26 * Generate the output in a string.
dfc850e6ee1f Fix upgrade of the yeast data in products and recipes if the original yeast is not found. Export product or recipe for forum is now coded in forum format and copied to the clipboard ready to paste on a forum.
Michiel Broek <mbroek@mbse.eu>
parents: 542
diff changeset
27 */
dfc850e6ee1f Fix upgrade of the yeast data in products and recipes if the original yeast is not found. Export product or recipe for forum is now coded in forum format and copied to the clipboard ready to paste on a forum.
Michiel Broek <mbroek@mbse.eu>
parents: 542
diff changeset
28 $tabus = '[tabular]';
dfc850e6ee1f Fix upgrade of the yeast data in products and recipes if the original yeast is not found. Export product or recipe for forum is now coded in forum format and copied to the clipboard ready to paste on a forum.
Michiel Broek <mbroek@mbse.eu>
parents: 542
diff changeset
29 $tabue = '[/tabular]';
dfc850e6ee1f Fix upgrade of the yeast data in products and recipes if the original yeast is not found. Export product or recipe for forum is now coded in forum format and copied to the clipboard ready to paste on a forum.
Michiel Broek <mbroek@mbse.eu>
parents: 542
diff changeset
30 $heads = '[head]';
dfc850e6ee1f Fix upgrade of the yeast data in products and recipes if the original yeast is not found. Export product or recipe for forum is now coded in forum format and copied to the clipboard ready to paste on a forum.
Michiel Broek <mbroek@mbse.eu>
parents: 542
diff changeset
31 $heade = '[/head]';
dfc850e6ee1f Fix upgrade of the yeast data in products and recipes if the original yeast is not found. Export product or recipe for forum is now coded in forum format and copied to the clipboard ready to paste on a forum.
Michiel Broek <mbroek@mbse.eu>
parents: 542
diff changeset
32 $rows = '[row]';
dfc850e6ee1f Fix upgrade of the yeast data in products and recipes if the original yeast is not found. Export product or recipe for forum is now coded in forum format and copied to the clipboard ready to paste on a forum.
Michiel Broek <mbroek@mbse.eu>
parents: 542
diff changeset
33 $rowe = '[/row]';
dfc850e6ee1f Fix upgrade of the yeast data in products and recipes if the original yeast is not found. Export product or recipe for forum is now coded in forum format and copied to the clipboard ready to paste on a forum.
Michiel Broek <mbroek@mbse.eu>
parents: 542
diff changeset
34 $datas = '[data]';
dfc850e6ee1f Fix upgrade of the yeast data in products and recipes if the original yeast is not found. Export product or recipe for forum is now coded in forum format and copied to the clipboard ready to paste on a forum.
Michiel Broek <mbroek@mbse.eu>
parents: 542
diff changeset
35 $datae = '[/data]';
341
9c4bc199be9e Added product forum export and changed the export menu.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
36
565
dfc850e6ee1f Fix upgrade of the yeast data in products and recipes if the original yeast is not found. Export product or recipe for forum is now coded in forum format and copied to the clipboard ready to paste on a forum.
Michiel Broek <mbroek@mbse.eu>
parents: 542
diff changeset
37 $memo = "[u][b]BMS v".$my_version." - Datum export: ".$prdate.'[/b][/u]'.PHP_EOL;
dfc850e6ee1f Fix upgrade of the yeast data in products and recipes if the original yeast is not found. Export product or recipe for forum is now coded in forum format and copied to the clipboard ready to paste on a forum.
Michiel Broek <mbroek@mbse.eu>
parents: 542
diff changeset
38 $memo .= PHP_EOL;
dfc850e6ee1f Fix upgrade of the yeast data in products and recipes if the original yeast is not found. Export product or recipe for forum is now coded in forum format and copied to the clipboard ready to paste on a forum.
Michiel Broek <mbroek@mbse.eu>
parents: 542
diff changeset
39 $memo .= PHP_EOL;
dfc850e6ee1f Fix upgrade of the yeast data in products and recipes if the original yeast is not found. Export product or recipe for forum is now coded in forum format and copied to the clipboard ready to paste on a forum.
Michiel Broek <mbroek@mbse.eu>
parents: 542
diff changeset
40 $memo .= '[u][b]Basis[/b][/u]'.PHP_EOL;
dfc850e6ee1f Fix upgrade of the yeast data in products and recipes if the original yeast is not found. Export product or recipe for forum is now coded in forum format and copied to the clipboard ready to paste on a forum.
Michiel Broek <mbroek@mbse.eu>
parents: 542
diff changeset
41 $memo .= $tabus.PHP_EOL;
dfc850e6ee1f Fix upgrade of the yeast data in products and recipes if the original yeast is not found. Export product or recipe for forum is now coded in forum format and copied to the clipboard ready to paste on a forum.
Michiel Broek <mbroek@mbse.eu>
parents: 542
diff changeset
42 $memo .= $heads.'Omschrijving'.$heade.$heads.'Waarde'.$heade.PHP_EOL;
dfc850e6ee1f Fix upgrade of the yeast data in products and recipes if the original yeast is not found. Export product or recipe for forum is now coded in forum format and copied to the clipboard ready to paste on a forum.
Michiel Broek <mbroek@mbse.eu>
parents: 542
diff changeset
43 $memo .= $rows.$datas.'Bier naam'.$datae.$datas.$row['code'].' '.$row['name'].$datae.$rowe.PHP_EOL;
dfc850e6ee1f Fix upgrade of the yeast data in products and recipes if the original yeast is not found. Export product or recipe for forum is now coded in forum format and copied to the clipboard ready to paste on a forum.
Michiel Broek <mbroek@mbse.eu>
parents: 542
diff changeset
44 $memo .= $rows.$datas.'Bier stijl'.$datae.$datas.$row['st_name'].$datae.$rowe.PHP_EOL;
dfc850e6ee1f Fix upgrade of the yeast data in products and recipes if the original yeast is not found. Export product or recipe for forum is now coded in forum format and copied to the clipboard ready to paste on a forum.
Michiel Broek <mbroek@mbse.eu>
parents: 542
diff changeset
45 $memo .= $rows.$datas.'Recept type'.$datae.$datas.$recipetype[$row['type']].$datae.$rowe.PHP_EOL;
dfc850e6ee1f Fix upgrade of the yeast data in products and recipes if the original yeast is not found. Export product or recipe for forum is now coded in forum format and copied to the clipboard ready to paste on a forum.
Michiel Broek <mbroek@mbse.eu>
parents: 542
diff changeset
46 $memo .= $rows.$datas.'Batch grootte'.$datae.$datas.$row['batch_size'].' liter'.$datae.$rowe.PHP_EOL;
dfc850e6ee1f Fix upgrade of the yeast data in products and recipes if the original yeast is not found. Export product or recipe for forum is now coded in forum format and copied to the clipboard ready to paste on a forum.
Michiel Broek <mbroek@mbse.eu>
parents: 542
diff changeset
47 $memo .= $rows.$datas.'Kooktijd'.$datae.$datas.$row['boil_time'].' minuten'.$datae.$rowe.PHP_EOL;
dfc850e6ee1f Fix upgrade of the yeast data in products and recipes if the original yeast is not found. Export product or recipe for forum is now coded in forum format and copied to the clipboard ready to paste on a forum.
Michiel Broek <mbroek@mbse.eu>
parents: 542
diff changeset
48 $memo .= $rows.$datas.'Brouwzaal rendement'.$datae.$datas.$row['efficiency'].' %'.$datae.$rowe.PHP_EOL;
dfc850e6ee1f Fix upgrade of the yeast data in products and recipes if the original yeast is not found. Export product or recipe for forum is now coded in forum format and copied to the clipboard ready to paste on a forum.
Michiel Broek <mbroek@mbse.eu>
parents: 542
diff changeset
49 $memo .= $rows.$datas.'Geschatte begin densiteit'.$datae.$datas.sprintf("%.3f",$row['est_og']).' SG/ '.sprintf("%.1f", sg_to_plato($row['est_og'])).'°P'.$datae.$rowe.PHP_EOL;
dfc850e6ee1f Fix upgrade of the yeast data in products and recipes if the original yeast is not found. Export product or recipe for forum is now coded in forum format and copied to the clipboard ready to paste on a forum.
Michiel Broek <mbroek@mbse.eu>
parents: 542
diff changeset
50 $memo .= $rows.$datas.'Geschatte eind densiteit'.$datae.$datas.sprintf("%.3f",$row['est_fg']).' SG/ '.sprintf("%.1f", sg_to_plato($row['est_fg'])).'°P'.$datae.$rowe.PHP_EOL;
dfc850e6ee1f Fix upgrade of the yeast data in products and recipes if the original yeast is not found. Export product or recipe for forum is now coded in forum format and copied to the clipboard ready to paste on a forum.
Michiel Broek <mbroek@mbse.eu>
parents: 542
diff changeset
51 $memo .= $rows.$datas.'Geschat alcohol'.$datae.$datas.sprintf("%.1f",$row['est_abv']).'% vol'.$datae.$rowe.PHP_EOL;
dfc850e6ee1f Fix upgrade of the yeast data in products and recipes if the original yeast is not found. Export product or recipe for forum is now coded in forum format and copied to the clipboard ready to paste on a forum.
Michiel Broek <mbroek@mbse.eu>
parents: 542
diff changeset
52 $memo .= $rows.$datas.'Kleur ('.$colormethod[$row['color_method']].')'.$datae.$datas.$row['est_color'].' EBC'.$datae.$rowe.PHP_EOL;
dfc850e6ee1f Fix upgrade of the yeast data in products and recipes if the original yeast is not found. Export product or recipe for forum is now coded in forum format and copied to the clipboard ready to paste on a forum.
Michiel Broek <mbroek@mbse.eu>
parents: 542
diff changeset
53 $memo .= $rows.$datas.'Bitterheid ('.$ibumethod[$row['ibu_method']].')'.$datae.$datas.$row['est_ibu'].' IBU'.$datae.$rowe.PHP_EOL;
dfc850e6ee1f Fix upgrade of the yeast data in products and recipes if the original yeast is not found. Export product or recipe for forum is now coded in forum format and copied to the clipboard ready to paste on a forum.
Michiel Broek <mbroek@mbse.eu>
parents: 542
diff changeset
54 if ($row['divide_parts'])
dfc850e6ee1f Fix upgrade of the yeast data in products and recipes if the original yeast is not found. Export product or recipe for forum is now coded in forum format and copied to the clipboard ready to paste on a forum.
Michiel Broek <mbroek@mbse.eu>
parents: 542
diff changeset
55 $memo .= $rows.$datas.'Split batch (' .$splitat[$row['divide_type']].')'.$datae.$datas.($row['divide_part'] + 1)." van ".($row['divide_parts'] + 1).$datae.$rowe.PHP_EOL;
dfc850e6ee1f Fix upgrade of the yeast data in products and recipes if the original yeast is not found. Export product or recipe for forum is now coded in forum format and copied to the clipboard ready to paste on a forum.
Michiel Broek <mbroek@mbse.eu>
parents: 542
diff changeset
56 $memo .= $tabue.PHP_EOL;
dfc850e6ee1f Fix upgrade of the yeast data in products and recipes if the original yeast is not found. Export product or recipe for forum is now coded in forum format and copied to the clipboard ready to paste on a forum.
Michiel Broek <mbroek@mbse.eu>
parents: 542
diff changeset
57 $memo .= PHP_EOL;
341
9c4bc199be9e Added product forum export and changed the export menu.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
58
9c4bc199be9e Added product forum export and changed the export menu.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
59
9c4bc199be9e Added product forum export and changed the export menu.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
60 $sugarsm = 0;
9c4bc199be9e Added product forum export and changed the export menu.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
61 $grainabsorbtion = 0;
9c4bc199be9e Added product forum export and changed the export menu.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
62 $mashwater = 0;
9c4bc199be9e Added product forum export and changed the export menu.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
63
565
dfc850e6ee1f Fix upgrade of the yeast data in products and recipes if the original yeast is not found. Export product or recipe for forum is now coded in forum format and copied to the clipboard ready to paste on a forum.
Michiel Broek <mbroek@mbse.eu>
parents: 542
diff changeset
64 $memo .= '[u][b]Vergistbare ingrediënten[/b][/u]'.PHP_EOL;
dfc850e6ee1f Fix upgrade of the yeast data in products and recipes if the original yeast is not found. Export product or recipe for forum is now coded in forum format and copied to the clipboard ready to paste on a forum.
Michiel Broek <mbroek@mbse.eu>
parents: 542
diff changeset
65 $memo .= $tabus.PHP_EOL;
dfc850e6ee1f Fix upgrade of the yeast data in products and recipes if the original yeast is not found. Export product or recipe for forum is now coded in forum format and copied to the clipboard ready to paste on a forum.
Michiel Broek <mbroek@mbse.eu>
parents: 542
diff changeset
66 $memo .= $heads.'Mout, granen en suikers'.$heade.$heads.'EBC'. $heade.$heads.'Gewicht kg'.$heade.$heads.'%'.$heade.$heads.'Gebruik tijdens'.$heade.PHP_EOL;
dfc850e6ee1f Fix upgrade of the yeast data in products and recipes if the original yeast is not found. Export product or recipe for forum is now coded in forum format and copied to the clipboard ready to paste on a forum.
Michiel Broek <mbroek@mbse.eu>
parents: 542
diff changeset
67
341
9c4bc199be9e Added product forum export and changed the export menu.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
68 $arr = json_decode($row['json_fermentables'], true);
9c4bc199be9e Added product forum export and changed the export menu.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
69 foreach($arr as $item) {
565
dfc850e6ee1f Fix upgrade of the yeast data in products and recipes if the original yeast is not found. Export product or recipe for forum is now coded in forum format and copied to the clipboard ready to paste on a forum.
Michiel Broek <mbroek@mbse.eu>
parents: 542
diff changeset
70 $name = $item['f_name']." (".$item['f_supplier'].")";
341
9c4bc199be9e Added product forum export and changed the export menu.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
71 $amount = floatval($item['f_amount']);
9c4bc199be9e Added product forum export and changed the export menu.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
72 $d = $amount * (floatval($item['f_yield']) / 100) * (1 - floatval($item['f_moisture']) / 100);
9c4bc199be9e Added product forum export and changed the export menu.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
73 if ($item['f_added'] == 0) {
9c4bc199be9e Added product forum export and changed the export menu.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
74 $d = floatval($row['efficiency']) / 100 * $d;
9c4bc199be9e Added product forum export and changed the export menu.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
75 $sugarsm += $d;
9c4bc199be9e Added product forum export and changed the export menu.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
76 $grainabsorbtion += $item['f_amount'];
9c4bc199be9e Added product forum export and changed the export menu.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
77 }
565
dfc850e6ee1f Fix upgrade of the yeast data in products and recipes if the original yeast is not found. Export product or recipe for forum is now coded in forum format and copied to the clipboard ready to paste on a forum.
Michiel Broek <mbroek@mbse.eu>
parents: 542
diff changeset
78 $pct = '';
dfc850e6ee1f Fix upgrade of the yeast data in products and recipes if the original yeast is not found. Export product or recipe for forum is now coded in forum format and copied to the clipboard ready to paste on a forum.
Michiel Broek <mbroek@mbse.eu>
parents: 542
diff changeset
79 if ($item['f_added'] < 4)
dfc850e6ee1f Fix upgrade of the yeast data in products and recipes if the original yeast is not found. Export product or recipe for forum is now coded in forum format and copied to the clipboard ready to paste on a forum.
Michiel Broek <mbroek@mbse.eu>
parents: 542
diff changeset
80 $pct = sprintf("%.1f", floatval($item['f_percentage']));
dfc850e6ee1f Fix upgrade of the yeast data in products and recipes if the original yeast is not found. Export product or recipe for forum is now coded in forum format and copied to the clipboard ready to paste on a forum.
Michiel Broek <mbroek@mbse.eu>
parents: 542
diff changeset
81
dfc850e6ee1f Fix upgrade of the yeast data in products and recipes if the original yeast is not found. Export product or recipe for forum is now coded in forum format and copied to the clipboard ready to paste on a forum.
Michiel Broek <mbroek@mbse.eu>
parents: 542
diff changeset
82 $memo .= $rows.$datas.$name.$datae.$datas.sprintf("%.0f", floatval($item['f_color'])).$datae.$datas;
dfc850e6ee1f Fix upgrade of the yeast data in products and recipes if the original yeast is not found. Export product or recipe for forum is now coded in forum format and copied to the clipboard ready to paste on a forum.
Michiel Broek <mbroek@mbse.eu>
parents: 542
diff changeset
83 $memo .= sprintf("%.3f", $amount).$datae.$datas.$pct.$datae.$datas;
dfc850e6ee1f Fix upgrade of the yeast data in products and recipes if the original yeast is not found. Export product or recipe for forum is now coded in forum format and copied to the clipboard ready to paste on a forum.
Michiel Broek <mbroek@mbse.eu>
parents: 542
diff changeset
84 $memo .= $added[$item['f_added']].$datae.$rowe .PHP_EOL;
341
9c4bc199be9e Added product forum export and changed the export menu.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
85 }
9c4bc199be9e Added product forum export and changed the export menu.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
86 $preboil_sg = estimate_sg($sugarsm, floatval($row['boil_size']));
565
dfc850e6ee1f Fix upgrade of the yeast data in products and recipes if the original yeast is not found. Export product or recipe for forum is now coded in forum format and copied to the clipboard ready to paste on a forum.
Michiel Broek <mbroek@mbse.eu>
parents: 542
diff changeset
87 $memo .= $tabue.PHP_EOL;
dfc850e6ee1f Fix upgrade of the yeast data in products and recipes if the original yeast is not found. Export product or recipe for forum is now coded in forum format and copied to the clipboard ready to paste on a forum.
Michiel Broek <mbroek@mbse.eu>
parents: 542
diff changeset
88 $memo .= PHP_EOL;
341
9c4bc199be9e Added product forum export and changed the export menu.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
89
9c4bc199be9e Added product forum export and changed the export menu.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
90
565
dfc850e6ee1f Fix upgrade of the yeast data in products and recipes if the original yeast is not found. Export product or recipe for forum is now coded in forum format and copied to the clipboard ready to paste on a forum.
Michiel Broek <mbroek@mbse.eu>
parents: 542
diff changeset
91 $memo .= '[u][b]Hop[/b][/u]'.PHP_EOL;
dfc850e6ee1f Fix upgrade of the yeast data in products and recipes if the original yeast is not found. Export product or recipe for forum is now coded in forum format and copied to the clipboard ready to paste on a forum.
Michiel Broek <mbroek@mbse.eu>
parents: 542
diff changeset
92 $memo .= $tabus.PHP_EOL;
dfc850e6ee1f Fix upgrade of the yeast data in products and recipes if the original yeast is not found. Export product or recipe for forum is now coded in forum format and copied to the clipboard ready to paste on a forum.
Michiel Broek <mbroek@mbse.eu>
parents: 542
diff changeset
93 $memo .= $heads.'Hop'.$heade.$heads.'Vorm'.$heade.$heads.'Alpha'.$heade.$heads.'IBU'.$heade.$heads.'Gram'.$heade.$heads.'Toevoegen moment'.$heade.PHP_EOL;
dfc850e6ee1f Fix upgrade of the yeast data in products and recipes if the original yeast is not found. Export product or recipe for forum is now coded in forum format and copied to the clipboard ready to paste on a forum.
Michiel Broek <mbroek@mbse.eu>
parents: 542
diff changeset
94
341
9c4bc199be9e Added product forum export and changed the export menu.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
95 $arr = json_decode($row['json_hops'], true);
9c4bc199be9e Added product forum export and changed the export menu.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
96 foreach($arr as $item) {
565
dfc850e6ee1f Fix upgrade of the yeast data in products and recipes if the original yeast is not found. Export product or recipe for forum is now coded in forum format and copied to the clipboard ready to paste on a forum.
Michiel Broek <mbroek@mbse.eu>
parents: 542
diff changeset
97 $name = $item['h_name']." (".$item['h_origin'].")";
341
9c4bc199be9e Added product forum export and changed the export menu.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
98 $amount = floatval($item['h_amount']) * 1000;
9c4bc199be9e Added product forum export and changed the export menu.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
99 $time = floatval($item['h_time']);
9c4bc199be9e Added product forum export and changed the export menu.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
100 $alpha = floatval($item['h_alpha']);
539
fe9ac6d49c4f Printed outputs have IBUs for whirlpool hops. Removed some debug console logs.
Michiel Broek <mbroek@mbse.eu>
parents: 516
diff changeset
101 $ibu = calc_IBU($item['h_useat'], $item['h_form'], $preboil_sg, floatval($row['batch_size']), $amount, $time, $alpha,
fe9ac6d49c4f Printed outputs have IBUs for whirlpool hops. Removed some debug console logs.
Michiel Broek <mbroek@mbse.eu>
parents: 516
diff changeset
102 $row['ibu_method'], $row['brew_whirlpool9'], $row['brew_whirlpool7'], $row['brew_whirlpool6']);
341
9c4bc199be9e Added product forum export and changed the export menu.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
103 $moment = $hopuse[$item['h_useat']];
399
6f1cde4215d3 In the checklist misc ingredients shows liquid or weight. In forum output whirlpool hops show the time in minutes.
Michiel Broek <mbroek@mbse.eu>
parents: 392
diff changeset
104 if (($item['h_useat'] == 2) || ($item['h_useat'] == 4)) { // Boil or Whirlpool
6f1cde4215d3 In the checklist misc ingredients shows liquid or weight. In forum output whirlpool hops show the time in minutes.
Michiel Broek <mbroek@mbse.eu>
parents: 392
diff changeset
105 $moment = $hopuse[$item['h_useat']].' '.$time." minuten";
392
544d7d0183b2 Added 15 fields to the recipes table. Added 18 fields to the products table. These are calculated values that are now stored in the database so export programs can use these values without calculating them again. Product and recipe print have water and mash schedule added. Product print has brewday results added if the brewday is over. The ingredients layout changed in the product and recipe prints.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
106 } else if ($item['h_useat'] == 5) { // Dryhop
399
6f1cde4215d3 In the checklist misc ingredients shows liquid or weight. In forum output whirlpool hops show the time in minutes.
Michiel Broek <mbroek@mbse.eu>
parents: 392
diff changeset
107 $moment = $hopuse[$item['h_useat']].' '.sprintf("%.0f", $time / 1440).' dagen';
341
9c4bc199be9e Added product forum export and changed the export menu.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
108 }
9c4bc199be9e Added product forum export and changed the export menu.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
109
565
dfc850e6ee1f Fix upgrade of the yeast data in products and recipes if the original yeast is not found. Export product or recipe for forum is now coded in forum format and copied to the clipboard ready to paste on a forum.
Michiel Broek <mbroek@mbse.eu>
parents: 542
diff changeset
110 $memo .= $rows.$datas.$name.$datae.$datas.$hopform[$item['h_form']].$datae.$datas.sprintf("%.1f", $alpha).'%'.$datae.$datas;
dfc850e6ee1f Fix upgrade of the yeast data in products and recipes if the original yeast is not found. Export product or recipe for forum is now coded in forum format and copied to the clipboard ready to paste on a forum.
Michiel Broek <mbroek@mbse.eu>
parents: 542
diff changeset
111 $memo .= sprintf("%.1f", $ibu).$datae.$datas.sprintf("%.1f", $amount).$datae.$datas.$moment.$datae.$rowe.PHP_EOL;
341
9c4bc199be9e Added product forum export and changed the export menu.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
112 }
565
dfc850e6ee1f Fix upgrade of the yeast data in products and recipes if the original yeast is not found. Export product or recipe for forum is now coded in forum format and copied to the clipboard ready to paste on a forum.
Michiel Broek <mbroek@mbse.eu>
parents: 542
diff changeset
113 $memo .= $tabue.PHP_EOL;
dfc850e6ee1f Fix upgrade of the yeast data in products and recipes if the original yeast is not found. Export product or recipe for forum is now coded in forum format and copied to the clipboard ready to paste on a forum.
Michiel Broek <mbroek@mbse.eu>
parents: 542
diff changeset
114 $memo .= PHP_EOL;
341
9c4bc199be9e Added product forum export and changed the export menu.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
115
565
dfc850e6ee1f Fix upgrade of the yeast data in products and recipes if the original yeast is not found. Export product or recipe for forum is now coded in forum format and copied to the clipboard ready to paste on a forum.
Michiel Broek <mbroek@mbse.eu>
parents: 542
diff changeset
116 $memo .= '[u][b]Diversen[/b][/u]'.PHP_EOL;
dfc850e6ee1f Fix upgrade of the yeast data in products and recipes if the original yeast is not found. Export product or recipe for forum is now coded in forum format and copied to the clipboard ready to paste on a forum.
Michiel Broek <mbroek@mbse.eu>
parents: 542
diff changeset
117 $memo .= $tabus.PHP_EOL;
dfc850e6ee1f Fix upgrade of the yeast data in products and recipes if the original yeast is not found. Export product or recipe for forum is now coded in forum format and copied to the clipboard ready to paste on a forum.
Michiel Broek <mbroek@mbse.eu>
parents: 542
diff changeset
118 $memo .= $heads.'Specerij, kruid, brouwzout'.$heade.$heads.'Type grondstof'.$heade.$heads.'Gebruik tijdens'.$heade.$heads.'Hoeveel'.$heade.PHP_EOL;
dfc850e6ee1f Fix upgrade of the yeast data in products and recipes if the original yeast is not found. Export product or recipe for forum is now coded in forum format and copied to the clipboard ready to paste on a forum.
Michiel Broek <mbroek@mbse.eu>
parents: 542
diff changeset
119
341
9c4bc199be9e Added product forum export and changed the export menu.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
120 $arr = json_decode($row['json_miscs'], true);
9c4bc199be9e Added product forum export and changed the export menu.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
121 foreach($arr as $item) {
565
dfc850e6ee1f Fix upgrade of the yeast data in products and recipes if the original yeast is not found. Export product or recipe for forum is now coded in forum format and copied to the clipboard ready to paste on a forum.
Michiel Broek <mbroek@mbse.eu>
parents: 542
diff changeset
122 if ($item['m_use_use'] == 2) // Boil
dfc850e6ee1f Fix upgrade of the yeast data in products and recipes if the original yeast is not found. Export product or recipe for forum is now coded in forum format and copied to the clipboard ready to paste on a forum.
Michiel Broek <mbroek@mbse.eu>
parents: 542
diff changeset
123 $gebruik = sprintf("%s %d min",$miscuse[$item['m_use_use']],floatval($item['m_time']));
341
9c4bc199be9e Added product forum export and changed the export menu.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
124 else
565
dfc850e6ee1f Fix upgrade of the yeast data in products and recipes if the original yeast is not found. Export product or recipe for forum is now coded in forum format and copied to the clipboard ready to paste on a forum.
Michiel Broek <mbroek@mbse.eu>
parents: 542
diff changeset
125 $gebruik = $miscuse[$item['m_use_use']];
dfc850e6ee1f Fix upgrade of the yeast data in products and recipes if the original yeast is not found. Export product or recipe for forum is now coded in forum format and copied to the clipboard ready to paste on a forum.
Michiel Broek <mbroek@mbse.eu>
parents: 542
diff changeset
126 $hoeveel = sprintf("%.2f %s",floatval($item['m_amount']) * 1000,$item['m_amount_is_weight'] ? "gr":"ml");
341
9c4bc199be9e Added product forum export and changed the export menu.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
127
565
dfc850e6ee1f Fix upgrade of the yeast data in products and recipes if the original yeast is not found. Export product or recipe for forum is now coded in forum format and copied to the clipboard ready to paste on a forum.
Michiel Broek <mbroek@mbse.eu>
parents: 542
diff changeset
128 $memo .= $rows.$datas.$item['m_name'].$datae.$datas.$misctype[$item['m_type']].$datae.$datas;
dfc850e6ee1f Fix upgrade of the yeast data in products and recipes if the original yeast is not found. Export product or recipe for forum is now coded in forum format and copied to the clipboard ready to paste on a forum.
Michiel Broek <mbroek@mbse.eu>
parents: 542
diff changeset
129 $memo .= $gebruik.$datae.$datas.$hoeveel.$datae.$rowe.PHP_EOL;
341
9c4bc199be9e Added product forum export and changed the export menu.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
130 }
565
dfc850e6ee1f Fix upgrade of the yeast data in products and recipes if the original yeast is not found. Export product or recipe for forum is now coded in forum format and copied to the clipboard ready to paste on a forum.
Michiel Broek <mbroek@mbse.eu>
parents: 542
diff changeset
131 $memo .= $tabue.PHP_EOL;
dfc850e6ee1f Fix upgrade of the yeast data in products and recipes if the original yeast is not found. Export product or recipe for forum is now coded in forum format and copied to the clipboard ready to paste on a forum.
Michiel Broek <mbroek@mbse.eu>
parents: 542
diff changeset
132 $memo .= PHP_EOL;
341
9c4bc199be9e Added product forum export and changed the export menu.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
133
565
dfc850e6ee1f Fix upgrade of the yeast data in products and recipes if the original yeast is not found. Export product or recipe for forum is now coded in forum format and copied to the clipboard ready to paste on a forum.
Michiel Broek <mbroek@mbse.eu>
parents: 542
diff changeset
134 $memo .= '[u][b]Gist[/b][/u]'.PHP_EOL;
dfc850e6ee1f Fix upgrade of the yeast data in products and recipes if the original yeast is not found. Export product or recipe for forum is now coded in forum format and copied to the clipboard ready to paste on a forum.
Michiel Broek <mbroek@mbse.eu>
parents: 542
diff changeset
135 $memo .= $tabus.PHP_EOL;
dfc850e6ee1f Fix upgrade of the yeast data in products and recipes if the original yeast is not found. Export product or recipe for forum is now coded in forum format and copied to the clipboard ready to paste on a forum.
Michiel Broek <mbroek@mbse.eu>
parents: 542
diff changeset
136 $memo .= $heads.'Gistlab en code'.$heade.$heads.'Omschrijving'.$heade.$heads.'Gebruik'.$heade.$heads.'Vorm'.$heade.$heads.'Hoeveel'.$heade.PHP_EOL;
dfc850e6ee1f Fix upgrade of the yeast data in products and recipes if the original yeast is not found. Export product or recipe for forum is now coded in forum format and copied to the clipboard ready to paste on a forum.
Michiel Broek <mbroek@mbse.eu>
parents: 542
diff changeset
137
341
9c4bc199be9e Added product forum export and changed the export menu.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
138 $arr = json_decode($row['json_yeasts'], true);
9c4bc199be9e Added product forum export and changed the export menu.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
139 foreach($arr as $item) {
565
dfc850e6ee1f Fix upgrade of the yeast data in products and recipes if the original yeast is not found. Export product or recipe for forum is now coded in forum format and copied to the clipboard ready to paste on a forum.
Michiel Broek <mbroek@mbse.eu>
parents: 542
diff changeset
140 $product = $item['y_laboratory']." ".$item['y_product_id'];
341
9c4bc199be9e Added product forum export and changed the export menu.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
141
9c4bc199be9e Added product forum export and changed the export menu.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
142 if ($item['y_form'] == 0) // Liquid
9c4bc199be9e Added product forum export and changed the export menu.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
143 $amount = sprintf("%.0f",floatval($item['y_amount']))." pak";
516
28670364bd0c Added dried yeast form.
Michiel Broek <mbroek@mbse.eu>
parents: 514
diff changeset
144 else if ($item['y_form'] == 1 || $item['y_form'] == 6) // Dry
341
9c4bc199be9e Added product forum export and changed the export menu.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
145 $amount = sprintf("%.1f",floatval($item['y_amount'])*1000)." gr";
9c4bc199be9e Added product forum export and changed the export menu.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
146 else
9c4bc199be9e Added product forum export and changed the export menu.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
147 $amount = sprintf("%.0f",floatval($item['y_amount'])*1000)." ml";
9c4bc199be9e Added product forum export and changed the export menu.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
148
565
dfc850e6ee1f Fix upgrade of the yeast data in products and recipes if the original yeast is not found. Export product or recipe for forum is now coded in forum format and copied to the clipboard ready to paste on a forum.
Michiel Broek <mbroek@mbse.eu>
parents: 542
diff changeset
149 $memo .= $rows.$datas.$product.$datae.$datas.$item['y_name'].$datae.$datas.$yeastuse[$item['y_use']].$datae.$datas;
dfc850e6ee1f Fix upgrade of the yeast data in products and recipes if the original yeast is not found. Export product or recipe for forum is now coded in forum format and copied to the clipboard ready to paste on a forum.
Michiel Broek <mbroek@mbse.eu>
parents: 542
diff changeset
150 $memo .= $yeastform[$item['y_form']].$datae.$datas.$amount.$datae.$rowe.PHP_EOL;
341
9c4bc199be9e Added product forum export and changed the export menu.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
151 }
565
dfc850e6ee1f Fix upgrade of the yeast data in products and recipes if the original yeast is not found. Export product or recipe for forum is now coded in forum format and copied to the clipboard ready to paste on a forum.
Michiel Broek <mbroek@mbse.eu>
parents: 542
diff changeset
152 $memo .= $tabue.PHP_EOL;
341
9c4bc199be9e Added product forum export and changed the export menu.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
153 if ($row['starter_enable'] && $row['prop1_volume']) {
9c4bc199be9e Added product forum export and changed the export menu.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
154 $sv = 0;
9c4bc199be9e Added product forum export and changed the export menu.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
155 for ($i = 1; $i < 5; $i++) {
9c4bc199be9e Added product forum export and changed the export menu.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
156 $pv = "prop".$i."_volume";
9c4bc199be9e Added product forum export and changed the export menu.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
157 if (floatval($row[$pv]) && (floatval($row[$pv]) > $sv)) {
9c4bc199be9e Added product forum export and changed the export menu.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
158 $sv = floatval($row[$pv]);
9c4bc199be9e Added product forum export and changed the export menu.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
159 }
9c4bc199be9e Added product forum export and changed the export menu.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
160 }
565
dfc850e6ee1f Fix upgrade of the yeast data in products and recipes if the original yeast is not found. Export product or recipe for forum is now coded in forum format and copied to the clipboard ready to paste on a forum.
Michiel Broek <mbroek@mbse.eu>
parents: 542
diff changeset
161 $memo .= "Maak een giststarter van ".sprintf("%.1f", $sv)." liter.".PHP_EOL;
341
9c4bc199be9e Added product forum export and changed the export menu.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
162 }
565
dfc850e6ee1f Fix upgrade of the yeast data in products and recipes if the original yeast is not found. Export product or recipe for forum is now coded in forum format and copied to the clipboard ready to paste on a forum.
Michiel Broek <mbroek@mbse.eu>
parents: 542
diff changeset
163 $memo .= PHP_EOL;
dfc850e6ee1f Fix upgrade of the yeast data in products and recipes if the original yeast is not found. Export product or recipe for forum is now coded in forum format and copied to the clipboard ready to paste on a forum.
Michiel Broek <mbroek@mbse.eu>
parents: 542
diff changeset
164
341
9c4bc199be9e Added product forum export and changed the export menu.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
165
9c4bc199be9e Added product forum export and changed the export menu.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
166 if ($row['w1_name'])
9c4bc199be9e Added product forum export and changed the export menu.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
167 $mashwater += floatval($row['w1_amount']);
9c4bc199be9e Added product forum export and changed the export menu.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
168 if ($row['w2_name'])
9c4bc199be9e Added product forum export and changed the export menu.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
169 $mashwater += floatval($row['w2_amount']);
9c4bc199be9e Added product forum export and changed the export menu.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
170
565
dfc850e6ee1f Fix upgrade of the yeast data in products and recipes if the original yeast is not found. Export product or recipe for forum is now coded in forum format and copied to the clipboard ready to paste on a forum.
Michiel Broek <mbroek@mbse.eu>
parents: 542
diff changeset
171 $memo .= '[u][b]Maischschema[/b][/u]'.PHP_EOL;
dfc850e6ee1f Fix upgrade of the yeast data in products and recipes if the original yeast is not found. Export product or recipe for forum is now coded in forum format and copied to the clipboard ready to paste on a forum.
Michiel Broek <mbroek@mbse.eu>
parents: 542
diff changeset
172 $memo .= $tabus.PHP_EOL;
dfc850e6ee1f Fix upgrade of the yeast data in products and recipes if the original yeast is not found. Export product or recipe for forum is now coded in forum format and copied to the clipboard ready to paste on a forum.
Michiel Broek <mbroek@mbse.eu>
parents: 542
diff changeset
173 $memo .= $heads.'Maisch stap'.$heade.$heads.'Stap type'.$heade.$heads.'Temperatuur'.$heade.$heads.'Rust tijd'.$heade.$heads.'Opwarmen tijd'.$heade.PHP_EOL;
dfc850e6ee1f Fix upgrade of the yeast data in products and recipes if the original yeast is not found. Export product or recipe for forum is now coded in forum format and copied to the clipboard ready to paste on a forum.
Michiel Broek <mbroek@mbse.eu>
parents: 542
diff changeset
174
341
9c4bc199be9e Added product forum export and changed the export menu.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
175 $arr = json_decode($row['json_mashs'], true);
9c4bc199be9e Added product forum export and changed the export menu.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
176 foreach($arr as $item) {
9c4bc199be9e Added product forum export and changed the export menu.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
177
9c4bc199be9e Added product forum export and changed the export menu.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
178 if ($item['step_type'] == 1) {
565
dfc850e6ee1f Fix upgrade of the yeast data in products and recipes if the original yeast is not found. Export product or recipe for forum is now coded in forum format and copied to the clipboard ready to paste on a forum.
Michiel Broek <mbroek@mbse.eu>
parents: 542
diff changeset
179 $stype = $mashtype[$item['step_type']];
341
9c4bc199be9e Added product forum export and changed the export menu.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
180 } else {
565
dfc850e6ee1f Fix upgrade of the yeast data in products and recipes if the original yeast is not found. Export product or recipe for forum is now coded in forum format and copied to the clipboard ready to paste on a forum.
Michiel Broek <mbroek@mbse.eu>
parents: 542
diff changeset
181 $stype = $mashtype[$item['step_type']].' '.sprintf("%.1f", $item['step_infuse_amount']).' liter';
341
9c4bc199be9e Added product forum export and changed the export menu.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
182 }
565
dfc850e6ee1f Fix upgrade of the yeast data in products and recipes if the original yeast is not found. Export product or recipe for forum is now coded in forum format and copied to the clipboard ready to paste on a forum.
Michiel Broek <mbroek@mbse.eu>
parents: 542
diff changeset
183 $memo .= $rows.$datas.$item['step_name'].$datae.$datas.$stype.$datae.$datas.sprintf("%.1f °C", $item['step_temp']);
dfc850e6ee1f Fix upgrade of the yeast data in products and recipes if the original yeast is not found. Export product or recipe for forum is now coded in forum format and copied to the clipboard ready to paste on a forum.
Michiel Broek <mbroek@mbse.eu>
parents: 542
diff changeset
184 $memo .= $datae.$datas.sprintf("%.0f min.", $item['step_time']).$datae.$datas.sprintf("%.0f min.", $item['ramp_time']);
dfc850e6ee1f Fix upgrade of the yeast data in products and recipes if the original yeast is not found. Export product or recipe for forum is now coded in forum format and copied to the clipboard ready to paste on a forum.
Michiel Broek <mbroek@mbse.eu>
parents: 542
diff changeset
185 $memo .= $datae.$rowe.PHP_EOL;
341
9c4bc199be9e Added product forum export and changed the export menu.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
186 }
565
dfc850e6ee1f Fix upgrade of the yeast data in products and recipes if the original yeast is not found. Export product or recipe for forum is now coded in forum format and copied to the clipboard ready to paste on a forum.
Michiel Broek <mbroek@mbse.eu>
parents: 542
diff changeset
187 $memo .= $tabue.PHP_EOL;
dfc850e6ee1f Fix upgrade of the yeast data in products and recipes if the original yeast is not found. Export product or recipe for forum is now coded in forum format and copied to the clipboard ready to paste on a forum.
Michiel Broek <mbroek@mbse.eu>
parents: 542
diff changeset
188 $memo .= PHP_EOL;
dfc850e6ee1f Fix upgrade of the yeast data in products and recipes if the original yeast is not found. Export product or recipe for forum is now coded in forum format and copied to the clipboard ready to paste on a forum.
Michiel Broek <mbroek@mbse.eu>
parents: 542
diff changeset
189
dfc850e6ee1f Fix upgrade of the yeast data in products and recipes if the original yeast is not found. Export product or recipe for forum is now coded in forum format and copied to the clipboard ready to paste on a forum.
Michiel Broek <mbroek@mbse.eu>
parents: 542
diff changeset
190 $memo .= '[u][b]Brouwwater[/b][/u]'.PHP_EOL;
dfc850e6ee1f Fix upgrade of the yeast data in products and recipes if the original yeast is not found. Export product or recipe for forum is now coded in forum format and copied to the clipboard ready to paste on a forum.
Michiel Broek <mbroek@mbse.eu>
parents: 542
diff changeset
191 $memo .= $tabus.PHP_EOL;
dfc850e6ee1f Fix upgrade of the yeast data in products and recipes if the original yeast is not found. Export product or recipe for forum is now coded in forum format and copied to the clipboard ready to paste on a forum.
Michiel Broek <mbroek@mbse.eu>
parents: 542
diff changeset
192 $memo .= $heads.'Omschrijving'.$heade.$heads.'Waarde'.$heade.PHP_EOL;
dfc850e6ee1f Fix upgrade of the yeast data in products and recipes if the original yeast is not found. Export product or recipe for forum is now coded in forum format and copied to the clipboard ready to paste on a forum.
Michiel Broek <mbroek@mbse.eu>
parents: 542
diff changeset
193
341
9c4bc199be9e Added product forum export and changed the export menu.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
194 if ($row['w1_name'] && $row['w2_name']) {
565
dfc850e6ee1f Fix upgrade of the yeast data in products and recipes if the original yeast is not found. Export product or recipe for forum is now coded in forum format and copied to the clipboard ready to paste on a forum.
Michiel Broek <mbroek@mbse.eu>
parents: 542
diff changeset
195 $memo .= $rows.$datas.'Maischwater 1'.$datae.$datas.sprintf("%.1f",floatval($row['w1_amount'])).' liter water '.$row['w1_name'].$datae.$rowe.PHP_EOL;
dfc850e6ee1f Fix upgrade of the yeast data in products and recipes if the original yeast is not found. Export product or recipe for forum is now coded in forum format and copied to the clipboard ready to paste on a forum.
Michiel Broek <mbroek@mbse.eu>
parents: 542
diff changeset
196 $memo .= $rows.$datas.'Maischwater 2'.$datae.$datas.sprintf("%.1f",floatval($row['w2_amount'])).' liter water '.$row['w2_name'].$datae.$rowe.PHP_EOL;
341
9c4bc199be9e Added product forum export and changed the export menu.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
197 } else {
565
dfc850e6ee1f Fix upgrade of the yeast data in products and recipes if the original yeast is not found. Export product or recipe for forum is now coded in forum format and copied to the clipboard ready to paste on a forum.
Michiel Broek <mbroek@mbse.eu>
parents: 542
diff changeset
198 $memo .= $rows.$datas.'Maischwater'.$datae.$datas.sprintf("%.1f",floatval($row['w1_amount'])).' liter water '.$row['w1_name'].$datae.$rowe.PHP_EOL;
341
9c4bc199be9e Added product forum export and changed the export menu.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
199 }
565
dfc850e6ee1f Fix upgrade of the yeast data in products and recipes if the original yeast is not found. Export product or recipe for forum is now coded in forum format and copied to the clipboard ready to paste on a forum.
Michiel Broek <mbroek@mbse.eu>
parents: 542
diff changeset
200 $memo .= $rows.$datas.'Maischwater aanzuren tot pH'.$datae.$datas.$row['mash_ph'].' pH'.$datae.$rowe.PHP_EOL;
dfc850e6ee1f Fix upgrade of the yeast data in products and recipes if the original yeast is not found. Export product or recipe for forum is now coded in forum format and copied to the clipboard ready to paste on a forum.
Michiel Broek <mbroek@mbse.eu>
parents: 542
diff changeset
201 $memo .= $rows.$datas.'Spoelwater geschat'.$datae.$datas.sprintf("%.1f",$row['brew_sparge_est'])." liter".$datae.$rowe.PHP_EOL;
dfc850e6ee1f Fix upgrade of the yeast data in products and recipes if the original yeast is not found. Export product or recipe for forum is now coded in forum format and copied to the clipboard ready to paste on a forum.
Michiel Broek <mbroek@mbse.eu>
parents: 542
diff changeset
202 $memo .= $rows.$datas.'Spoelwater temperatuur'.$datae.$datas.$row['sparge_temp'].' °C'.$datae.$rowe.PHP_EOL;
dfc850e6ee1f Fix upgrade of the yeast data in products and recipes if the original yeast is not found. Export product or recipe for forum is now coded in forum format and copied to the clipboard ready to paste on a forum.
Michiel Broek <mbroek@mbse.eu>
parents: 542
diff changeset
203 $memo .= $rows.$datas.'Spoelwater aanzuren tot pH'.$datae.$datas.sprintf("%.1f",$row['sparge_ph']).' pH'.$datae.$rowe.PHP_EOL;
dfc850e6ee1f Fix upgrade of the yeast data in products and recipes if the original yeast is not found. Export product or recipe for forum is now coded in forum format and copied to the clipboard ready to paste on a forum.
Michiel Broek <mbroek@mbse.eu>
parents: 542
diff changeset
204 $memo .= $tabue.PHP_EOL;
341
9c4bc199be9e Added product forum export and changed the export menu.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
205
9c4bc199be9e Added product forum export and changed the export menu.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
206
565
dfc850e6ee1f Fix upgrade of the yeast data in products and recipes if the original yeast is not found. Export product or recipe for forum is now coded in forum format and copied to the clipboard ready to paste on a forum.
Michiel Broek <mbroek@mbse.eu>
parents: 542
diff changeset
207 page_header('Product naar forum', 'prod_forum');
341
9c4bc199be9e Added product forum export and changed the export menu.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
208 ?>
565
dfc850e6ee1f Fix upgrade of the yeast data in products and recipes if the original yeast is not found. Export product or recipe for forum is now coded in forum format and copied to the clipboard ready to paste on a forum.
Michiel Broek <mbroek@mbse.eu>
parents: 542
diff changeset
209 <script>
dfc850e6ee1f Fix upgrade of the yeast data in products and recipes if the original yeast is not found. Export product or recipe for forum is now coded in forum format and copied to the clipboard ready to paste on a forum.
Michiel Broek <mbroek@mbse.eu>
parents: 542
diff changeset
210 // json_encode() seems to do the right thing.
dfc850e6ee1f Fix upgrade of the yeast data in products and recipes if the original yeast is not found. Export product or recipe for forum is now coded in forum format and copied to the clipboard ready to paste on a forum.
Michiel Broek <mbroek@mbse.eu>
parents: 542
diff changeset
211 var forumstr = <?= json_encode($memo) ?>;
dfc850e6ee1f Fix upgrade of the yeast data in products and recipes if the original yeast is not found. Export product or recipe for forum is now coded in forum format and copied to the clipboard ready to paste on a forum.
Michiel Broek <mbroek@mbse.eu>
parents: 542
diff changeset
212 </script>
dfc850e6ee1f Fix upgrade of the yeast data in products and recipes if the original yeast is not found. Export product or recipe for forum is now coded in forum format and copied to the clipboard ready to paste on a forum.
Michiel Broek <mbroek@mbse.eu>
parents: 542
diff changeset
213 <div id="MainPanel">
dfc850e6ee1f Fix upgrade of the yeast data in products and recipes if the original yeast is not found. Export product or recipe for forum is now coded in forum format and copied to the clipboard ready to paste on a forum.
Michiel Broek <mbroek@mbse.eu>
parents: 542
diff changeset
214 <div class="section">
dfc850e6ee1f Fix upgrade of the yeast data in products and recipes if the original yeast is not found. Export product or recipe for forum is now coded in forum format and copied to the clipboard ready to paste on a forum.
Michiel Broek <mbroek@mbse.eu>
parents: 542
diff changeset
215 <div style="overflow: hidden; margin: 25px;"><br>
dfc850e6ee1f Fix upgrade of the yeast data in products and recipes if the original yeast is not found. Export product or recipe for forum is now coded in forum format and copied to the clipboard ready to paste on a forum.
Michiel Broek <mbroek@mbse.eu>
parents: 542
diff changeset
216 <p>Het product met alle gegevens staan gereed.</p>
dfc850e6ee1f Fix upgrade of the yeast data in products and recipes if the original yeast is not found. Export product or recipe for forum is now coded in forum format and copied to the clipboard ready to paste on a forum.
Michiel Broek <mbroek@mbse.eu>
parents: 542
diff changeset
217 <p>Zodra je de "Klembord" toets gebruikt zullen deze gegevens naar het klembord gekopieerd<br>
dfc850e6ee1f Fix upgrade of the yeast data in products and recipes if the original yeast is not found. Export product or recipe for forum is now coded in forum format and copied to the clipboard ready to paste on a forum.
Michiel Broek <mbroek@mbse.eu>
parents: 542
diff changeset
218 worden. In het scherm van het forum kun je deze gegevens vervolgens "plakken".</p>
dfc850e6ee1f Fix upgrade of the yeast data in products and recipes if the original yeast is not found. Export product or recipe for forum is now coded in forum format and copied to the clipboard ready to paste on a forum.
Michiel Broek <mbroek@mbse.eu>
parents: 542
diff changeset
219 <p>Na het drukken van de toets wordt dit scherm gesloten.</p>
dfc850e6ee1f Fix upgrade of the yeast data in products and recipes if the original yeast is not found. Export product or recipe for forum is now coded in forum format and copied to the clipboard ready to paste on a forum.
Michiel Broek <mbroek@mbse.eu>
parents: 542
diff changeset
220 <p><input type="button" value="Klembord" id="copytoClipboard" /></p>
dfc850e6ee1f Fix upgrade of the yeast data in products and recipes if the original yeast is not found. Export product or recipe for forum is now coded in forum format and copied to the clipboard ready to paste on a forum.
Michiel Broek <mbroek@mbse.eu>
parents: 542
diff changeset
221 </div>
dfc850e6ee1f Fix upgrade of the yeast data in products and recipes if the original yeast is not found. Export product or recipe for forum is now coded in forum format and copied to the clipboard ready to paste on a forum.
Michiel Broek <mbroek@mbse.eu>
parents: 542
diff changeset
222 </div>
dfc850e6ee1f Fix upgrade of the yeast data in products and recipes if the original yeast is not found. Export product or recipe for forum is now coded in forum format and copied to the clipboard ready to paste on a forum.
Michiel Broek <mbroek@mbse.eu>
parents: 542
diff changeset
223 </div>
dfc850e6ee1f Fix upgrade of the yeast data in products and recipes if the original yeast is not found. Export product or recipe for forum is now coded in forum format and copied to the clipboard ready to paste on a forum.
Michiel Broek <mbroek@mbse.eu>
parents: 542
diff changeset
224
dfc850e6ee1f Fix upgrade of the yeast data in products and recipes if the original yeast is not found. Export product or recipe for forum is now coded in forum format and copied to the clipboard ready to paste on a forum.
Michiel Broek <mbroek@mbse.eu>
parents: 542
diff changeset
225 <?php
dfc850e6ee1f Fix upgrade of the yeast data in products and recipes if the original yeast is not found. Export product or recipe for forum is now coded in forum format and copied to the clipboard ready to paste on a forum.
Michiel Broek <mbroek@mbse.eu>
parents: 542
diff changeset
226 page_footer();
dfc850e6ee1f Fix upgrade of the yeast data in products and recipes if the original yeast is not found. Export product or recipe for forum is now coded in forum format and copied to the clipboard ready to paste on a forum.
Michiel Broek <mbroek@mbse.eu>
parents: 542
diff changeset
227 ?>

mercurial