www/prod_print.php

Fri, 31 May 2019 22:58:03 +0200

author
Michiel Broek <mbroek@mbse.eu>
date
Fri, 31 May 2019 22:58:03 +0200
changeset 391
a1bcebc61ddd
parent 357
74d56bed75b9
child 392
544d7d0183b2
permissions
-rw-r--r--

Added mash schedule and brewday data to the product print pages.

165
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1 <?php
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2 require_once($_SERVER['DOCUMENT_ROOT'].'/includes/global.inc.php');
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3 require_once($_SERVER['DOCUMENT_ROOT'].'/includes/formulas.php');
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4 require_once($_SERVER['DOCUMENT_ROOT'].'/fpdf/fpdf.php');
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7 $link = mysqli_connect(DBASE_HOST,DBASE_USER,DBASE_PASS,DBASE_NAME);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8 if (! $link) {
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9 die('Connect Error (' . mysqli_connect_errno() . ') ' . mysqli_connect_error());
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
10 }
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
11 if (! mysqli_set_charset($link, "utf8" )) {
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
12 echo "error";
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
13 return 1;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
14 }
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
15
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
16 setlocale ( LC_ALL, 'nl_NL.UTF-8');
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
17 $record = $_GET["record"];
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
18 $result = mysqli_query($link, "SELECT * FROM products WHERE record='".$record."'");
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
19 $row = mysqli_fetch_array($result);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
20
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
21 $total_fermentables = 0.0;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
22 $cost_fermentables = 0.0;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
23 $total_hops = 0.0;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
24 $cost_hops = 0.0;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
25 $cost_yeasts = 0.0;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
26 $cost_miscs = 0.0;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
27 $pSugar = 0;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
28 $pCara = 0;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
29 $svg = 77;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
30 $colorw = 0;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
31 $total_ibus = 0;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
32 $preboil_sg = 0;
275
fb1e88f1c643 Better fg estimation in product print.
Michiel Broek <mbroek@mbse.eu>
parents: 247
diff changeset
33 $mashkg = 0;
240
a85c1d4c4d12 Depending on the product stage, more or less fields are saved in the database. Added begin of auto stage increase. Added missing inventory columns in the fermentables grid. New product wizzard now works with the indexed values. Product print works with indexed values and prepared for different print modules depending on the product stage.
Michiel Broek <mbroek@mbse.eu>
parents: 165
diff changeset
34 date_default_timezone_set('Europe/Amsterdam');
a85c1d4c4d12 Depending on the product stage, more or less fields are saved in the database. Added begin of auto stage increase. Added missing inventory columns in the fermentables grid. New product wizzard now works with the indexed values. Product print works with indexed values and prepared for different print modules depending on the product stage.
Michiel Broek <mbroek@mbse.eu>
parents: 165
diff changeset
35 $prdate = date(DATE_RFC2822);
a85c1d4c4d12 Depending on the product stage, more or less fields are saved in the database. Added begin of auto stage increase. Added missing inventory columns in the fermentables grid. New product wizzard now works with the indexed values. Product print works with indexed values and prepared for different print modules depending on the product stage.
Michiel Broek <mbroek@mbse.eu>
parents: 165
diff changeset
36
165
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
37
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
38 class PDF_MySQL_Table extends FPDF
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
39 {
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
40 protected $ProcessingTable=false;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
41 protected $aCols=array();
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
42 protected $TableX;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
43
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
44 function Header() {
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
45 // Print the table header if necessary
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
46 if ($this->ProcessingTable)
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
47 $this->TableHeader();
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
48 }
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
49
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
50 function TableHeader() {
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
51 $this->SetFont('Helvetica','B',9);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
52 $this->SetX($this->TableX);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
53 $this->SetFillColor(255,150,100);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
54 foreach($this->aCols as $col)
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
55 $this->Cell($col['w'],5,$col['c'],0,0,$col['a'],true);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
56 $this->Ln();
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
57 }
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
58
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
59 function AddCol($width=-1, $caption='', $align='L') {
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
60 $this->aCols[]=array('c'=>$caption,'w'=>$width,'a'=>$align);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
61 }
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
62
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
63 function TableGlobal($row) {
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
64 /* 2 Columns */
240
a85c1d4c4d12 Depending on the product stage, more or less fields are saved in the database. Added begin of auto stage increase. Added missing inventory columns in the fermentables grid. New product wizzard now works with the indexed values. Product print works with indexed values and prepared for different print modules depending on the product stage.
Michiel Broek <mbroek@mbse.eu>
parents: 165
diff changeset
65 $recipetype = array( 'Extract', 'Deelmaisch', 'Mout' );
165
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
66 $vul = $this->w - $this->rMargin - $this->lMargin - 160;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
67 $cMargin=$this->cMargin;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
68 $this->cMargin=2;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
69 $this->TableX=$this->lMargin;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
70 $this->SetFont('Helvetica','B',9);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
71 $this->SetX($this->TableX);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
72 $this->SetFillColor(255,150,100);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
73 $this->Cell(0, 5, 'Recept overzicht',0,0,'C',true);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
74 $this->Ln();
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
75
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
76 $this->SetFont('Helvetica','',9);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
77 $this->SetFillColor(210,245,255);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
78
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
79 $this->SetX($this->TableX);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
80 $this->Cell(35,5,'Type',0,0,'L',true);
240
a85c1d4c4d12 Depending on the product stage, more or less fields are saved in the database. Added begin of auto stage increase. Added missing inventory columns in the fermentables grid. New product wizzard now works with the indexed values. Product print works with indexed values and prepared for different print modules depending on the product stage.
Michiel Broek <mbroek@mbse.eu>
parents: 165
diff changeset
81 $this->Cell(45,5,$recipetype[$row['type']],0,0,'L',true);
165
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
82 $this->Cell($vul,5,'',0,0,'L',false);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
83 $this->Cell(35,5,'Batch grootte',0,0,'L',true);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
84 $this->Cell(45,5,$row['batch_size'].' liter',0,0,'L',true);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
85 $this->Ln();
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
86
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
87 $this->SetX($this->TableX);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
88 $this->Cell(35,5,'Kooktijd',0,0,'L',true);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
89 $this->Cell(45,5,$row['boil_time'].' minuten',0,0,'L',true);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
90 $this->Cell($vul,5,'',0,0,'L',false);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
91 $this->Cell(35,5,'Brouwzaal rendement',0,0,'L',true);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
92 $this->Cell(45,5,$row['efficiency'].' %',0,0,'L',true);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
93 $this->Ln();
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
94
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
95 $this->SetX($this->TableX);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
96 $this->Cell(35,5,'Bierstijl',0,0,'L',true);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
97 $this->Cell(45,5,$row['st_name'],0,0,'L',true);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
98 $this->Cell($vul,5,'',0,0,'L',false);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
99 $this->Cell(35,5,'Installatie',0,0,'L',true);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
100 $this->Cell(45,5,$row['eq_name'],0,0,'L',true);
391
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
101 $this->Ln();
165
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
102
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
103 $this->cMargin=$cMargin;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
104 }
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
105
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
106 function TableFermentables($row) {
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
107 global $cost_fermentables;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
108 global $total_fermentables;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
109 global $pSugar;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
110 global $pCara;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
111 global $colorw;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
112 global $preboil_sg;
275
fb1e88f1c643 Better fg estimation in product print.
Michiel Broek <mbroek@mbse.eu>
parents: 247
diff changeset
113 global $mashkg;
240
a85c1d4c4d12 Depending on the product stage, more or less fields are saved in the database. Added begin of auto stage increase. Added missing inventory columns in the fermentables grid. New product wizzard now works with the indexed values. Product print works with indexed values and prepared for different print modules depending on the product stage.
Michiel Broek <mbroek@mbse.eu>
parents: 165
diff changeset
114 $added = array( 'Maischen', 'Koken', 'Vergisten', 'Nagisten/lageren', 'Bottelen' );
165
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
115 $vul = $this->w - $this->rMargin - $this->lMargin - 132;
391
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
116 $this->Ln();
165
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
117 $this->AddCol($vul,'Grondstof','L');
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
118 $this->AddCol(30,'Leverancier','L');
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
119 $this->AddCol(15,'EBC','R');
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
120 $this->AddCol(17,'Moment','L');
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
121 $this->AddCol(20,'Kg','R');
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
122 $this->AddCol(15,'Procent','R');
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
123 $this->AddCol(15,'Opbr.','R');
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
124 $this->AddCol(20,'Prijs','R');
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
125
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
126 $cMargin=$this->cMargin;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
127 $this->cMargin=2;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
128 $this->TableX=$this->lMargin;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
129 $this->TableHeader();
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
130 $this->ProcessingTable=true;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
131
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
132 $sugarsf = 0;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
133 $sugarsm = 0;
275
fb1e88f1c643 Better fg estimation in product print.
Michiel Broek <mbroek@mbse.eu>
parents: 247
diff changeset
134 $mashkg = 0;
165
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
135 $this->SetFont('Helvetica','',9);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
136 $this->SetFillColor(250, 195, 65);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
137 $arr = json_decode($row['json_fermentables'], true);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
138 foreach($arr as $item) { //foreach element in $arr
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
139 $name = iconv('UTF-8','windows-1252',$item['f_name']);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
140 $supplier = iconv('UTF-8','windows-1252',$item['f_supplier']);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
141 $amount = floatval($item['f_amount']);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
142 $costkg = floatval($item['f_cost']);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
143 $yield = floatval($item['f_yield']);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
144 $moisture = floatval($item['f_moisture']);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
145 $color = floatval($item['f_color']);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
146 $percent = floatval($item['f_percentage']);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
147
240
a85c1d4c4d12 Depending on the product stage, more or less fields are saved in the database. Added begin of auto stage increase. Added missing inventory columns in the fermentables grid. New product wizzard now works with the indexed values. Product print works with indexed values and prepared for different print modules depending on the product stage.
Michiel Broek <mbroek@mbse.eu>
parents: 165
diff changeset
148 if ($item['f_type'] == 1) // Sugar
165
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
149 $pSugar += $percent;
240
a85c1d4c4d12 Depending on the product stage, more or less fields are saved in the database. Added begin of auto stage increase. Added missing inventory columns in the fermentables grid. New product wizzard now works with the indexed values. Product print works with indexed values and prepared for different print modules depending on the product stage.
Michiel Broek <mbroek@mbse.eu>
parents: 165
diff changeset
150 if ($item['f_graintype'] == 2) // Crystal
165
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
151 $pCara += $percent;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
152
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
153 $cost = $amount * $costkg;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
154 $cost_fermentables += $cost;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
155 $total_fermentables += $amount;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
156 /* Calculate the amount of sugars */
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
157 $d = $amount * ($yield / 100) * (1 - $moisture / 100);
240
a85c1d4c4d12 Depending on the product stage, more or less fields are saved in the database. Added begin of auto stage increase. Added missing inventory columns in the fermentables grid. New product wizzard now works with the indexed values. Product print works with indexed values and prepared for different print modules depending on the product stage.
Michiel Broek <mbroek@mbse.eu>
parents: 165
diff changeset
158 if ($item['f_added'] == 0) {
165
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
159 $d = floatval($row['efficiency']) / 100 * $d;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
160 $sugarsm += $d;
275
fb1e88f1c643 Better fg estimation in product print.
Michiel Broek <mbroek@mbse.eu>
parents: 247
diff changeset
161 $mashkg += $amount;
165
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
162 }
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
163 $sugarsf += $d;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
164 $colorw += ($amount * ebc_to_srm($color) / $row['batch_size']) * 8.34436;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
165
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
166 $this->Cell($vul,5,$name,0,0,'L',true);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
167 $this->Cell(30,5,$supplier,0,0,'L',true);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
168 $this->Cell(15,5,sprintf("%.0f",$color),0,0,'R',true);
240
a85c1d4c4d12 Depending on the product stage, more or less fields are saved in the database. Added begin of auto stage increase. Added missing inventory columns in the fermentables grid. New product wizzard now works with the indexed values. Product print works with indexed values and prepared for different print modules depending on the product stage.
Michiel Broek <mbroek@mbse.eu>
parents: 165
diff changeset
169 $this->Cell(17,5,$added[$item['f_added']],0,0,'L',true);
165
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
170 $this->Cell(20,5,sprintf("%8.3f",$amount),0,0,'R',true);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
171 $this->Cell(15,5,sprintf("%.1f%%",$percent),0,0,'R',true);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
172 $this->Cell(15,5,sprintf("%.1f%%",$yield),0,0,'R',true);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
173 $this->Cell(20,5,sprintf("%8.3f",$cost).EURO,0,0,'R',true);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
174 $this->Ln();
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
175 }
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
176
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
177 $row['est_og'] = estimate_sg($sugarsf, floatval($row['batch_size']));
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
178 $preboil_sg = estimate_sg($sugarsm, floatval($row['boil_size']));
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
179 $this->SetFillColor(210,245,255);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
180 $this->Cell($vul+62,5,'',0,0,'L',false);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
181 $this->Cell(20,5,sprintf("%8.3f",$total_fermentables),0,0,'R',true);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
182 $this->Cell(30,5,'',0,0,'L',false);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
183 $this->Cell(20,5,sprintf("%8.3f",$cost_fermentables).EURO,0,0,'R',true);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
184 $this->ProcessingTable=false;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
185 $this->cMargin=$cMargin;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
186 $this->aCols=array();
391
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
187 $this->Ln();
165
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
188 }
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
189
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
190 function TableHops($row) {
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
191 global $total_hops;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
192 global $total_ibus;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
193 global $cost_hops;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
194 global $preboil_sg;
289
4082c41f45e9 Added the use and calculation of wet hops. Assume 5.5 times more hops needed by weight.
Michiel Broek <mbroek@mbse.eu>
parents: 279
diff changeset
195 $hopform = array( 'Pellets', 'Plugs', 'Bellen', 'Hop nat' );
240
a85c1d4c4d12 Depending on the product stage, more or less fields are saved in the database. Added begin of auto stage increase. Added missing inventory columns in the fermentables grid. New product wizzard now works with the indexed values. Product print works with indexed values and prepared for different print modules depending on the product stage.
Michiel Broek <mbroek@mbse.eu>
parents: 165
diff changeset
196 $hopuse = array( 'Maischen', 'First wort', 'Koken', 'Vlamuit', 'Whirlpool', 'Koudhop' );
165
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
197 $vul = $this->w - $this->rMargin - $this->lMargin - 135;
391
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
198 $this->Ln();
165
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
199 $this->AddCol($vul,'Hop','L');
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
200 $this->AddCol(35,'Land','L');
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
201 $this->AddCol(15,'Soort','L');
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
202 $this->AddCol(20,'Moment','L');
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
203 $this->AddCol(15,'Alpha','R');
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
204 $this->AddCol(12,'IBU','R');
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
205 $this->AddCol(18,'Gram','R');
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
206 $this->AddCol(20,'Prijs','R');
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
207
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
208 $cMargin=$this->cMargin;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
209 $this->cMargin=2;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
210 $this->TableX=$this->lMargin;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
211 $this->TableHeader();
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
212 $this->ProcessingTable=true;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
213
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
214 $this->SetFont('Helvetica','',9);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
215 $this->SetFillColor(100, 250, 65);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
216
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
217 $arr = json_decode($row['json_hops'], true);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
218 foreach($arr as $item) { //foreach element in $arr
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
219 $name = iconv('UTF-8','windows-1252',$item['h_name']);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
220 $origin = iconv('UTF-8','windows-1252',$item['h_origin']);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
221 $amount = floatval($item['h_amount']) * 1000;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
222 $mass = $amount;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
223 $costkg = floatval($item['h_cost']);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
224 $time = floatval($item['h_time']);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
225 $alpha = floatval($item['h_alpha']);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
226
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
227 $cost = ($amount * $costkg) / 1000;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
228 $cost_hops += $cost;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
229 $total_hops += $amount;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
230
240
a85c1d4c4d12 Depending on the product stage, more or less fields are saved in the database. Added begin of auto stage increase. Added missing inventory columns in the fermentables grid. New product wizzard now works with the indexed values. Product print works with indexed values and prepared for different print modules depending on the product stage.
Michiel Broek <mbroek@mbse.eu>
parents: 165
diff changeset
231 $moment = $hopuse[$item['h_useat']];
a85c1d4c4d12 Depending on the product stage, more or less fields are saved in the database. Added begin of auto stage increase. Added missing inventory columns in the fermentables grid. New product wizzard now works with the indexed values. Product print works with indexed values and prepared for different print modules depending on the product stage.
Michiel Broek <mbroek@mbse.eu>
parents: 165
diff changeset
232 if ($item['h_useat'] == 2) { // Boil
165
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
233 $moment = "Kook@".$time;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
234 }
240
a85c1d4c4d12 Depending on the product stage, more or less fields are saved in the database. Added begin of auto stage increase. Added missing inventory columns in the fermentables grid. New product wizzard now works with the indexed values. Product print works with indexed values and prepared for different print modules depending on the product stage.
Michiel Broek <mbroek@mbse.eu>
parents: 165
diff changeset
235 $ibu = calc_IBU($item['h_useat'], $item['h_form'], $preboil_sg, floatval($row['batch_size']), $mass, $time, $alpha, $row['ibu_method']);
165
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
236 $total_ibus += $ibu;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
237
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
238 $this->Cell($vul,5,$name,0,0,'L',true);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
239 $this->Cell(35,5,$origin,0,0,'L',true);
240
a85c1d4c4d12 Depending on the product stage, more or less fields are saved in the database. Added begin of auto stage increase. Added missing inventory columns in the fermentables grid. New product wizzard now works with the indexed values. Product print works with indexed values and prepared for different print modules depending on the product stage.
Michiel Broek <mbroek@mbse.eu>
parents: 165
diff changeset
240 $this->Cell(15,5,$hopform[$item['h_form']],0,0,'L',true);
165
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
241 $this->Cell(20,5,$moment,0,0,'L',true);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
242 $this->Cell(15,5,sprintf("%.1f%%",$alpha),0,0,'R',true);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
243 $this->Cell(12,5,sprintf("%.1f",$ibu),0,0,'R',true);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
244 $this->Cell(18,5,sprintf("%.1f",$amount),0,0,'R',true);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
245 $this->Cell(20,5,sprintf("%8.3f",$cost).EURO,0,0,'R',true);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
246 $this->Ln();
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
247 }
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
248
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
249 $this->SetFillColor(210,245,255);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
250 $this->Cell($vul+85,5,'',0,0,'L',false);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
251 $this->Cell(12,5,sprintf("%.1f",$total_ibus),0,0,'R',true);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
252 $this->Cell(18,5,sprintf("%.1f",$total_hops),0,0,'R',true);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
253 $this->Cell(20,5,sprintf("%8.3f",$cost_hops).EURO,0,0,'R',true);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
254 $this->ProcessingTable=false;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
255 $this->cMargin=$cMargin;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
256 $this->aCols=array();
391
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
257 $this->Ln();
165
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
258 }
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
259
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
260 function TableYeasts($row) {
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
261 global $cost_yeasts;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
262 global $svg;
240
a85c1d4c4d12 Depending on the product stage, more or less fields are saved in the database. Added begin of auto stage increase. Added missing inventory columns in the fermentables grid. New product wizzard now works with the indexed values. Product print works with indexed values and prepared for different print modules depending on the product stage.
Michiel Broek <mbroek@mbse.eu>
parents: 165
diff changeset
263 $yeastform = array( 'Vloeibaar', 'Droog', 'Schuine buis', 'Slurry', 'Ingevroren', 'Depot' );
a85c1d4c4d12 Depending on the product stage, more or less fields are saved in the database. Added begin of auto stage increase. Added missing inventory columns in the fermentables grid. New product wizzard now works with the indexed values. Product print works with indexed values and prepared for different print modules depending on the product stage.
Michiel Broek <mbroek@mbse.eu>
parents: 165
diff changeset
264 $yeastuse = array( 'Hoofdgisting', 'Nagisting', 'Lagering', 'Bottelen' );
165
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
265 $vul = $this->w - $this->rMargin - $this->lMargin - 140;
391
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
266 $this->Ln();
165
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
267 $this->AddCol(27,'Laboratorium','L');
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
268 $this->AddCol(18,'Product','L');
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
269 $this->AddCol($vul,'Gist','L');
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
270 $this->AddCol(20,'Gebruik','L');
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
271 $this->AddCol(15,'Attn','R');
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
272 $this->AddCol(22,'Vorm','L');
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
273 $this->AddCol(18,'Gram','R');
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
274 $this->AddCol(20,'Prijs','R');
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
275
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
276 $cMargin=$this->cMargin;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
277 $this->cMargin=2;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
278 $this->TableX=$this->lMargin;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
279 $this->TableHeader();
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
280 $this->ProcessingTable=true;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
281
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
282 $this->SetFont('Helvetica','',9);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
283 $this->SetFillColor(175, 175, 255);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
284
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
285 $arr = json_decode($row['json_yeasts'], true);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
286 foreach($arr as $item) { //foreach element in $arr
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
287 $name = iconv('UTF-8','windows-1252',$item['y_name']);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
288 $laboratory = iconv('UTF-8','windows-1252',$item['y_laboratory']);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
289 $product_id = iconv('UTF-8','windows-1252',$item['y_product_id']);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
290 $attenuation = floatval($item['y_attenuation']);
240
a85c1d4c4d12 Depending on the product stage, more or less fields are saved in the database. Added begin of auto stage increase. Added missing inventory columns in the fermentables grid. New product wizzard now works with the indexed values. Product print works with indexed values and prepared for different print modules depending on the product stage.
Michiel Broek <mbroek@mbse.eu>
parents: 165
diff changeset
291 $cost = floatval($item['y_amount']) * floatval($item['y_cost']);
165
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
292 $cost_yeasts += $cost;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
293
240
a85c1d4c4d12 Depending on the product stage, more or less fields are saved in the database. Added begin of auto stage increase. Added missing inventory columns in the fermentables grid. New product wizzard now works with the indexed values. Product print works with indexed values and prepared for different print modules depending on the product stage.
Michiel Broek <mbroek@mbse.eu>
parents: 165
diff changeset
294 if ($item['y_use'] == 0) // Primary
165
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
295 $svg = $attenuation;
240
a85c1d4c4d12 Depending on the product stage, more or less fields are saved in the database. Added begin of auto stage increase. Added missing inventory columns in the fermentables grid. New product wizzard now works with the indexed values. Product print works with indexed values and prepared for different print modules depending on the product stage.
Michiel Broek <mbroek@mbse.eu>
parents: 165
diff changeset
296 if ($item['y_form'] == 0) // Liquid
a85c1d4c4d12 Depending on the product stage, more or less fields are saved in the database. Added begin of auto stage increase. Added missing inventory columns in the fermentables grid. New product wizzard now works with the indexed values. Product print works with indexed values and prepared for different print modules depending on the product stage.
Michiel Broek <mbroek@mbse.eu>
parents: 165
diff changeset
297 $amount = sprintf("%.0f",floatval($item['y_amount']))." pak";
a85c1d4c4d12 Depending on the product stage, more or less fields are saved in the database. Added begin of auto stage increase. Added missing inventory columns in the fermentables grid. New product wizzard now works with the indexed values. Product print works with indexed values and prepared for different print modules depending on the product stage.
Michiel Broek <mbroek@mbse.eu>
parents: 165
diff changeset
298 else if ($item['y_form'] == 1) // Dry
a85c1d4c4d12 Depending on the product stage, more or less fields are saved in the database. Added begin of auto stage increase. Added missing inventory columns in the fermentables grid. New product wizzard now works with the indexed values. Product print works with indexed values and prepared for different print modules depending on the product stage.
Michiel Broek <mbroek@mbse.eu>
parents: 165
diff changeset
299 $amount = sprintf("%.1f",floatval($item['y_amount'])*1000)." gr";
a85c1d4c4d12 Depending on the product stage, more or less fields are saved in the database. Added begin of auto stage increase. Added missing inventory columns in the fermentables grid. New product wizzard now works with the indexed values. Product print works with indexed values and prepared for different print modules depending on the product stage.
Michiel Broek <mbroek@mbse.eu>
parents: 165
diff changeset
300 else
a85c1d4c4d12 Depending on the product stage, more or less fields are saved in the database. Added begin of auto stage increase. Added missing inventory columns in the fermentables grid. New product wizzard now works with the indexed values. Product print works with indexed values and prepared for different print modules depending on the product stage.
Michiel Broek <mbroek@mbse.eu>
parents: 165
diff changeset
301 $amount = sprintf("%.0f",floatval($item['y_amount'])*1000)." ml";
165
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
302
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
303 $this->Cell(27,5,$laboratory,0,0,'L',true);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
304 $this->Cell(18,5,$product_id,0,0,'L',true);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
305 $this->Cell($vul,5,$name,0,0,'L',true);
240
a85c1d4c4d12 Depending on the product stage, more or less fields are saved in the database. Added begin of auto stage increase. Added missing inventory columns in the fermentables grid. New product wizzard now works with the indexed values. Product print works with indexed values and prepared for different print modules depending on the product stage.
Michiel Broek <mbroek@mbse.eu>
parents: 165
diff changeset
306 $this->Cell(20,5,$yeastuse[$item['y_use']],0,0,'L',true);
165
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
307 $this->Cell(15,5,sprintf("%.1f%%",$attenuation),0,0,'R',true);
240
a85c1d4c4d12 Depending on the product stage, more or less fields are saved in the database. Added begin of auto stage increase. Added missing inventory columns in the fermentables grid. New product wizzard now works with the indexed values. Product print works with indexed values and prepared for different print modules depending on the product stage.
Michiel Broek <mbroek@mbse.eu>
parents: 165
diff changeset
308 $this->Cell(22,5,$yeastform[$item['y_form']],0,0,'L',true);
a85c1d4c4d12 Depending on the product stage, more or less fields are saved in the database. Added begin of auto stage increase. Added missing inventory columns in the fermentables grid. New product wizzard now works with the indexed values. Product print works with indexed values and prepared for different print modules depending on the product stage.
Michiel Broek <mbroek@mbse.eu>
parents: 165
diff changeset
309 $this->Cell(18,5,$amount,0,0,'R',true);
165
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
310 $this->Cell(20,5,sprintf("%8.3f",$cost).EURO,0,0,'R',true);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
311 $this->Ln();
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
312 }
293
db898ec73277 Show yeast starter on printed page
Michiel Broek <mbroek@mbse.eu>
parents: 289
diff changeset
313 if ($row['starter_enable']) {
db898ec73277 Show yeast starter on printed page
Michiel Broek <mbroek@mbse.eu>
parents: 289
diff changeset
314 $v = floatval($row['prop1_volume']) + floatval($row['prop2_volume']) + floatval($row['prop3_volume']) + floatval($row['prop4_volume']);
db898ec73277 Show yeast starter on printed page
Michiel Broek <mbroek@mbse.eu>
parents: 289
diff changeset
315 if ($v) {
db898ec73277 Show yeast starter on printed page
Michiel Broek <mbroek@mbse.eu>
parents: 289
diff changeset
316 $this->Cell(45,5,'',0,0,'L',true);
db898ec73277 Show yeast starter on printed page
Michiel Broek <mbroek@mbse.eu>
parents: 289
diff changeset
317 $this->Cell($vul,5,"Giststarter ".sprintf("%.2f",$v)." liter",0,0,'L',true);
db898ec73277 Show yeast starter on printed page
Michiel Broek <mbroek@mbse.eu>
parents: 289
diff changeset
318 $this->Cell(20,5,"Tevoren",0,0,'L',true);
db898ec73277 Show yeast starter on printed page
Michiel Broek <mbroek@mbse.eu>
parents: 289
diff changeset
319 $this->Cell(75,5,'',0,0,'L',true);
db898ec73277 Show yeast starter on printed page
Michiel Broek <mbroek@mbse.eu>
parents: 289
diff changeset
320 $this->Ln();
db898ec73277 Show yeast starter on printed page
Michiel Broek <mbroek@mbse.eu>
parents: 289
diff changeset
321 }
db898ec73277 Show yeast starter on printed page
Michiel Broek <mbroek@mbse.eu>
parents: 289
diff changeset
322 }
165
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
323
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
324 $this->SetFillColor(210,245,255);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
325 $this->Cell($vul+120,5,'',0,0,'L',false);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
326 $this->Cell(20,5,sprintf("%8.3f",$cost_yeasts).EURO,0,0,'R',true);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
327 $this->ProcessingTable=false;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
328 $this->cMargin=$cMargin;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
329 $this->aCols=array();
391
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
330 $this->Ln();
165
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
331 }
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
332
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
333 function TableMiscs($row) {
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
334 global $cost_miscs;
240
a85c1d4c4d12 Depending on the product stage, more or less fields are saved in the database. Added begin of auto stage increase. Added missing inventory columns in the fermentables grid. New product wizzard now works with the indexed values. Product print works with indexed values and prepared for different print modules depending on the product stage.
Michiel Broek <mbroek@mbse.eu>
parents: 165
diff changeset
335 $misctype = array( 'Specerij', 'Kruid', 'Smaakstof', 'Klaringsmiddel', 'Brouwzout', 'Gistvoeding', 'Anders' );
a85c1d4c4d12 Depending on the product stage, more or less fields are saved in the database. Added begin of auto stage increase. Added missing inventory columns in the fermentables grid. New product wizzard now works with the indexed values. Product print works with indexed values and prepared for different print modules depending on the product stage.
Michiel Broek <mbroek@mbse.eu>
parents: 165
diff changeset
336 $miscuse = array( 'Starter', 'Maischen', 'Koken', 'Hoofdvergisting', 'Nagisting/lagering', 'Bottelen' );
a85c1d4c4d12 Depending on the product stage, more or less fields are saved in the database. Added begin of auto stage increase. Added missing inventory columns in the fermentables grid. New product wizzard now works with the indexed values. Product print works with indexed values and prepared for different print modules depending on the product stage.
Michiel Broek <mbroek@mbse.eu>
parents: 165
diff changeset
337 $vul = $this->w - $this->rMargin - $this->lMargin - 100;
391
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
338 if ($this->GetY() > 200)
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
339 $this->AddPage();
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
340 else
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
341 $this->Ln();
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
342 $this->AddCol($vul,'Diversen naam','L');
165
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
343 $this->AddCol(30,'Soort','L');
240
a85c1d4c4d12 Depending on the product stage, more or less fields are saved in the database. Added begin of auto stage increase. Added missing inventory columns in the fermentables grid. New product wizzard now works with the indexed values. Product print works with indexed values and prepared for different print modules depending on the product stage.
Michiel Broek <mbroek@mbse.eu>
parents: 165
diff changeset
344 $this->AddCol(30,'Gebruik','L');
165
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
345 $this->AddCol(20,'Hoeveel','R');
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
346 $this->AddCol(20,'Prijs','R');
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
347
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
348 $cMargin=$this->cMargin;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
349 $this->cMargin=2;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
350 $this->TableX=$this->lMargin;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
351 $this->TableHeader();
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
352 $this->ProcessingTable=true;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
353
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
354 $this->SetFont('Helvetica','',9);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
355 $this->SetFillColor(175, 175, 255);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
356
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
357 $arr = json_decode($row['json_miscs'], true);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
358 foreach($arr as $item) {
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
359 $name = iconv('UTF-8','windows-1252',$item['m_name']);
240
a85c1d4c4d12 Depending on the product stage, more or less fields are saved in the database. Added begin of auto stage increase. Added missing inventory columns in the fermentables grid. New product wizzard now works with the indexed values. Product print works with indexed values and prepared for different print modules depending on the product stage.
Michiel Broek <mbroek@mbse.eu>
parents: 165
diff changeset
360 $type = $item['m_type'];
a85c1d4c4d12 Depending on the product stage, more or less fields are saved in the database. Added begin of auto stage increase. Added missing inventory columns in the fermentables grid. New product wizzard now works with the indexed values. Product print works with indexed values and prepared for different print modules depending on the product stage.
Michiel Broek <mbroek@mbse.eu>
parents: 165
diff changeset
361 $use_use = $item['m_use_use'];
165
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
362 $amount = floatval($item['m_amount']) * 1000;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
363 $costg = floatval($item['m_cost']) / 1000;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
364 $time = floatval($item['m_time']);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
365 $aiw = $item['m_amount_is_weight'];
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
366 $cost = $amount * $costg;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
367 $cost_miscs += $cost;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
368
240
a85c1d4c4d12 Depending on the product stage, more or less fields are saved in the database. Added begin of auto stage increase. Added missing inventory columns in the fermentables grid. New product wizzard now works with the indexed values. Product print works with indexed values and prepared for different print modules depending on the product stage.
Michiel Broek <mbroek@mbse.eu>
parents: 165
diff changeset
369 if ($type == 4) // Water agent
165
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
370 $this->SetFillColor(240,140,130);
240
a85c1d4c4d12 Depending on the product stage, more or less fields are saved in the database. Added begin of auto stage increase. Added missing inventory columns in the fermentables grid. New product wizzard now works with the indexed values. Product print works with indexed values and prepared for different print modules depending on the product stage.
Michiel Broek <mbroek@mbse.eu>
parents: 165
diff changeset
371 else if ($type == 3) // Fining
165
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
372 $this->SetFillColor(95,180,25);
240
a85c1d4c4d12 Depending on the product stage, more or less fields are saved in the database. Added begin of auto stage increase. Added missing inventory columns in the fermentables grid. New product wizzard now works with the indexed values. Product print works with indexed values and prepared for different print modules depending on the product stage.
Michiel Broek <mbroek@mbse.eu>
parents: 165
diff changeset
373 else if (($type == 0) || ($type == 1) || ($type == 2) || ($type == 5)) // Spice, Herb, Flavour, Yeast nutrient
165
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
374 $this->SetFillColor(240,250,65);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
375 else
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
376 $this->SetFillColor(210,245,255);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
377
240
a85c1d4c4d12 Depending on the product stage, more or less fields are saved in the database. Added begin of auto stage increase. Added missing inventory columns in the fermentables grid. New product wizzard now works with the indexed values. Product print works with indexed values and prepared for different print modules depending on the product stage.
Michiel Broek <mbroek@mbse.eu>
parents: 165
diff changeset
378 if ($use_use == 2) // Boil
a85c1d4c4d12 Depending on the product stage, more or less fields are saved in the database. Added begin of auto stage increase. Added missing inventory columns in the fermentables grid. New product wizzard now works with the indexed values. Product print works with indexed values and prepared for different print modules depending on the product stage.
Michiel Broek <mbroek@mbse.eu>
parents: 165
diff changeset
379 $gebruik = sprintf("%s %d min",$miscuse[$use_use],$time);
165
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
380 else
240
a85c1d4c4d12 Depending on the product stage, more or less fields are saved in the database. Added begin of auto stage increase. Added missing inventory columns in the fermentables grid. New product wizzard now works with the indexed values. Product print works with indexed values and prepared for different print modules depending on the product stage.
Michiel Broek <mbroek@mbse.eu>
parents: 165
diff changeset
381 $gebruik = $miscuse[$use_use];
165
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
382
357
74d56bed75b9 One more decimal digit for misc ingredients. Updated the README.
Michiel Broek <mbroek@mbse.eu>
parents: 338
diff changeset
383 $hoeveel = sprintf("%.2f %s",$amount,$aiw ? "gr":"ml");
165
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
384 $this->Cell($vul,5,$name,0,0,'L',true);
240
a85c1d4c4d12 Depending on the product stage, more or less fields are saved in the database. Added begin of auto stage increase. Added missing inventory columns in the fermentables grid. New product wizzard now works with the indexed values. Product print works with indexed values and prepared for different print modules depending on the product stage.
Michiel Broek <mbroek@mbse.eu>
parents: 165
diff changeset
385 $this->Cell(30,5,$misctype[$type],0,0,'L',true);
a85c1d4c4d12 Depending on the product stage, more or less fields are saved in the database. Added begin of auto stage increase. Added missing inventory columns in the fermentables grid. New product wizzard now works with the indexed values. Product print works with indexed values and prepared for different print modules depending on the product stage.
Michiel Broek <mbroek@mbse.eu>
parents: 165
diff changeset
386 $this->Cell(30,5,$gebruik,0,0,'L',true);
165
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
387 $this->Cell(20,5,$hoeveel,0,0,'R',true);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
388 $this->Cell(20,5,sprintf("%8.3f",$cost).EURO,0,0,'R',true);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
389 $this->Ln();
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
390 }
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
391
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
392 $this->SetFillColor(210,245,255);
241
e95d2886f49f Added soe extra debug logging in db_product.php. Automatic stage increment in the product editor. On the brewday tab added tooltips.
Michiel Broek <mbroek@mbse.eu>
parents: 240
diff changeset
393 $this->Cell($vul+80,5,'',0,0,'L',false);
165
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
394 $this->Cell(20,5,sprintf("%8.3f",$cost_miscs).EURO,0,0,'R',true);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
395
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
396 $this->ProcessingTable=false;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
397 $this->cMargin=$cMargin;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
398 $this->aCols=array();
391
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
399 $this->Ln();
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
400 }
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
401
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
402 function TableMashs($row) {
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
403 global $cost_yeasts;
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
404 global $svg;
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
405 global $mashkg;
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
406 $mashtype = array( 'Infusie', 'Verwarming', 'Decoctie' );
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
407 $vul = $this->w - $this->rMargin - $this->lMargin - 137;
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
408 if ($this->GetY() > 250)
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
409 $this->AddPage();
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
410 else
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
411 $this->Ln();
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
412 $this->AddCol($vul,'Maisch stap naam','L');
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
413 $this->AddCol(25,'Stap type','L');
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
414 $this->AddCol(18,'Start '.DEG.'C','R');
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
415 $this->AddCol(18,'Eind '.DEG.'C','R');
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
416 $this->AddCol(18,'Rust min','R');
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
417 $this->AddCol(18,'Stap min','R');
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
418 $this->AddCol(20,'L/Kg','R');
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
419 $this->AddCol(20,'Infusie L','R');
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
420
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
421 $cMargin=$this->cMargin;
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
422 $this->cMargin=2;
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
423 $this->TableX=$this->lMargin;
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
424 $this->TableHeader();
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
425 $this->ProcessingTable=true;
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
426
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
427 $this->SetFont('Helvetica','',9);
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
428 $this->SetFillColor(175, 175, 255);
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
429
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
430 $vol = 0;
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
431 $arr = json_decode($row['json_mashs'], true);
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
432 foreach($arr as $item) { //foreach element in $arr
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
433
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
434 if ($item['step_type'] == 0)
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
435 $vol += $item['step_infuse_amount'];
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
436 if ($mashkg > 0)
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
437 $thick = $vol / $mashkg;
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
438 else
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
439 $thick = 0;
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
440 $this->Cell($vul,5,$item['step_name'],0,0,'L',true);
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
441 $this->Cell(25,5,$mashtype[$item['step_type']],0,0,'L',true);
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
442 $this->Cell(18,5,sprintf("%.1f",$item['step_temp']),0,0,'R',true);
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
443 $this->Cell(18,5,sprintf("%.1f",$item['end_temp']),0,0,'R',true);
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
444 $this->Cell(18,5,sprintf("%.0f",$item['step_time']),0,0,'R',true);
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
445 $this->Cell(18,5,sprintf("%.0f",$item['ramp_time']),0,0,'R',true);
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
446 $this->Cell(20,5,sprintf("%.2f",$thick),0,0,'R',true);
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
447 $this->Cell(20,5,sprintf("%.1f",$item['step_infuse_amount']),0,0,'R',true);
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
448 $this->Ln();
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
449 }
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
450 $this->ProcessingTable=false;
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
451 $this->cMargin=$cMargin;
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
452 $this->aCols=array();
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
453 $this->Ln();
165
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
454 }
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
455
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
456 // Watercolor $this->SetFillColor(120,255,250);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
457
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
458 function TableSummary($row) {
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
459 global $pSugar;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
460 global $pCara;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
461 global $svg;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
462 global $colorw;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
463 global $cost_fermentables;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
464 global $cost_hops;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
465 global $cost_miscs;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
466 global $cost_yeasts;
275
fb1e88f1c643 Better fg estimation in product print.
Michiel Broek <mbroek@mbse.eu>
parents: 247
diff changeset
467 global $mashkg;
338
a51b858aacca Fixed color and IBU method display in recipe and product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 319
diff changeset
468 $colormethod = array( 'Morey', 'Mosher', 'Daniels' );
a51b858aacca Fixed color and IBU method display in recipe and product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 319
diff changeset
469 $ibumethod = array( 'Tinseth', 'Rager', 'Daniels' );
165
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
470 /* 2 Columns */
391
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
471 if ($this->GetY() > 200)
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
472 $this->AddPage();
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
473 else
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
474 $this->Ln();
165
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
475 $vul = $this->w - $this->rMargin - $this->lMargin - 170;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
476 $cMargin=$this->cMargin;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
477 $this->cMargin=2;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
478 $this->TableX=$this->lMargin;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
479 $this->SetFont('Helvetica','B',9);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
480 $this->SetX($this->TableX);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
481 $this->SetFillColor(255,150,100);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
482 $this->Cell(0, 5, 'Recept samenvatting',0,0,'C',true);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
483 $this->Ln();
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
484
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
485 $this->SetFont('Helvetica','',9);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
486 $this->SetFillColor(210,245,255);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
487
275
fb1e88f1c643 Better fg estimation in product print.
Michiel Broek <mbroek@mbse.eu>
parents: 247
diff changeset
488 $mashtime = 0;
fb1e88f1c643 Better fg estimation in product print.
Michiel Broek <mbroek@mbse.eu>
parents: 247
diff changeset
489 $mashtemp = 0;
fb1e88f1c643 Better fg estimation in product print.
Michiel Broek <mbroek@mbse.eu>
parents: 247
diff changeset
490 $mash_infuse = 0;
fb1e88f1c643 Better fg estimation in product print.
Michiel Broek <mbroek@mbse.eu>
parents: 247
diff changeset
491 $arr = json_decode($row['json_mashs'], true);
fb1e88f1c643 Better fg estimation in product print.
Michiel Broek <mbroek@mbse.eu>
parents: 247
diff changeset
492 foreach($arr as $item) {
fb1e88f1c643 Better fg estimation in product print.
Michiel Broek <mbroek@mbse.eu>
parents: 247
diff changeset
493 if ($item['step_type'] == 0) { // infusion
fb1e88f1c643 Better fg estimation in product print.
Michiel Broek <mbroek@mbse.eu>
parents: 247
diff changeset
494 $mash_infuse += floatval($item['step_infuse_amount']);
fb1e88f1c643 Better fg estimation in product print.
Michiel Broek <mbroek@mbse.eu>
parents: 247
diff changeset
495 }
fb1e88f1c643 Better fg estimation in product print.
Michiel Broek <mbroek@mbse.eu>
parents: 247
diff changeset
496 if ($item['step_temp'] < 75) { // ignore mashout temps
fb1e88f1c643 Better fg estimation in product print.
Michiel Broek <mbroek@mbse.eu>
parents: 247
diff changeset
497 $mashtime += floatval($item['step_time']);
fb1e88f1c643 Better fg estimation in product print.
Michiel Broek <mbroek@mbse.eu>
parents: 247
diff changeset
498 $mashtemp += floatval($item['step_time']) * floatval($item['step_temp']);
fb1e88f1c643 Better fg estimation in product print.
Michiel Broek <mbroek@mbse.eu>
parents: 247
diff changeset
499 }
fb1e88f1c643 Better fg estimation in product print.
Michiel Broek <mbroek@mbse.eu>
parents: 247
diff changeset
500 }
fb1e88f1c643 Better fg estimation in product print.
Michiel Broek <mbroek@mbse.eu>
parents: 247
diff changeset
501 $mashtemp = $mashtemp / $mashtime;
fb1e88f1c643 Better fg estimation in product print.
Michiel Broek <mbroek@mbse.eu>
parents: 247
diff changeset
502 if (($mashkg > 0) && ($mash_infuse > 0) && ($mashtime > 0) && ($mashtemp > 0)) {
fb1e88f1c643 Better fg estimation in product print.
Michiel Broek <mbroek@mbse.eu>
parents: 247
diff changeset
503 $row['est_fg'] = estimate_fg($pSugar, $pCara, $mash_infuse / $mashkg, $mashtime, $mashtemp, $svg, $row['est_og']);
fb1e88f1c643 Better fg estimation in product print.
Michiel Broek <mbroek@mbse.eu>
parents: 247
diff changeset
504 } else {
fb1e88f1c643 Better fg estimation in product print.
Michiel Broek <mbroek@mbse.eu>
parents: 247
diff changeset
505 $row['est_fg'] = estimate_fg($pSugar, $pCara, 0, 0, 0, $svg, $row['est_og']);
fb1e88f1c643 Better fg estimation in product print.
Michiel Broek <mbroek@mbse.eu>
parents: 247
diff changeset
506 }
165
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
507
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
508 $this->SetX($this->TableX);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
509 $this->Cell(35,5,'Start SG',0,0,'L',true);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
510 $this->Cell(25,5,sprintf("%.3f",$row['est_og']),0,0,'L',true);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
511 $this->Cell(25,5,'('.sprintf("%.3f",$row['st_og_min']).' - '.sprintf("%.3f",$row['st_og_max']).')',0,0,'L',true);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
512 $this->Cell($vul,5,'',0,0,'L',false);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
513 $this->Cell(35,5,'Eind SG',0,0,'L',true);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
514 $this->Cell(25,5,sprintf("%.3f",$row['est_fg']),0,0,'L',true);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
515 $this->Cell(25,5,'('.sprintf("%.3f",$row['st_fg_min']).' - '.sprintf("%.3f",$row['st_fg_max']).')',0,0,'L',true);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
516 $this->Ln();
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
517
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
518 $row['est_abv'] = abvol($row['est_og'], $row['est_fg']);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
519 $this->SetX($this->TableX);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
520 $this->Cell(35,5,'Geschat alcohol',0,0,'L',true);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
521 $this->Cell(25,5,sprintf("%.1f",$row['est_abv']).'%',0,0,'L',true);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
522 $this->Cell(25,5,'('.sprintf("%.1f",$row['st_abv_min']).' - '.sprintf("%.1f",$row['st_abv_max']).'%)',0,0,'L',true);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
523 $this->Cell($vul,5,'',0,0,'L',false);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
524 $this->Cell(35,5,'CO2',0,0,'L',true);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
525 $this->Cell(25,5,sprintf("%.1f",$row['est_carb']).'%',0,0,'L',true);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
526 $this->Cell(25,5,'('.sprintf("%.1f",$row['st_carb_min']).' - '.sprintf("%.1f",$row['st_carb_max']).'%)',0,0,'L',true);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
527 $this->Ln();
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
528
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
529 $row['est_color'] = kw_to_ebc($row['color_method'], $colorw);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
530 $this->SetX($this->TableX);
338
a51b858aacca Fixed color and IBU method display in recipe and product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 319
diff changeset
531 $this->Cell(35,5,'Kleur ('.$colormethod[$row['color_method']].')',0,0,'L',true);
165
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
532 $beercolor = ebc_to_color($row['est_color']);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
533 if ($row['est_color'] > 30)
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
534 $this->SetTextColor(250);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
535 $this->SetFillColor($beercolor[0],$beercolor[1],$beercolor[2]);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
536 $this->Cell(25,5,$row['est_color'].' EBC',0,0,'L',true);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
537 $this->Cell(25,5,'('.$row['st_color_min'].' - '.$row['st_color_max'].' EBC)',0,0,'L',true);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
538 $this->SetTextColor(0);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
539 $this->SetFillColor(210,245,255);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
540 $this->Cell($vul,5,'',0,0,'L',false);
338
a51b858aacca Fixed color and IBU method display in recipe and product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 319
diff changeset
541 $this->Cell(35,5,'Bitterheid ('.$ibumethod[$row['ibu_method']].')',0,0,'L',true);
165
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
542 $this->Cell(25,5,sprintf("%.0f",$row['est_ibu']).' IBU',0,0,'L',true);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
543 $this->Cell(25,5,'('.$row['st_ibu_min'].' - '.$row['st_ibu_max'].' IBU)',0,0,'L',true);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
544 $this->Ln();
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
545
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
546 $this->SetX($this->TableX);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
547 $cost_total = $cost_fermentables + $cost_hops + $cost_miscs + $cost_yeasts;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
548 $this->Cell(35,5,'Kosten',0,0,'L',true);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
549 $this->Cell(25,5,sprintf("%.2f",$cost_total).EURO,0,0,'L',true);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
550 $this->Cell(25,5,sprintf("%.2f",$cost_total/$row['batch_size']).EURO.' / liter',0,0,'L',true);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
551
391
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
552 // calorieen
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
553 $this->ProcessingTable=false;
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
554 $this->cMargin=$cMargin;
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
555 $this->aCols=array();
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
556 $this->Ln();
165
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
557 }
243
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents: 241
diff changeset
558
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents: 241
diff changeset
559 function Checkheader($text) {
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents: 241
diff changeset
560 $this->SetFont('Arial','B',10);
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents: 241
diff changeset
561 $this->Cell(0, 4,$text,0,0,'L',true);
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents: 241
diff changeset
562 $this->SetFont('Arial','',10);
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents: 241
diff changeset
563 $this->Ln(6);
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents: 241
diff changeset
564 }
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents: 241
diff changeset
565
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents: 241
diff changeset
566 function Checkline($text) {
276
08c824a5ffd8 Product print added yeast section.
Michiel Broek <mbroek@mbse.eu>
parents: 275
diff changeset
567 $this->Cell(2, 4,' ',0,0,'L',true);
08c824a5ffd8 Product print added yeast section.
Michiel Broek <mbroek@mbse.eu>
parents: 275
diff changeset
568 $this->Cell(4, 4,' ',1,0,'L',true);
08c824a5ffd8 Product print added yeast section.
Michiel Broek <mbroek@mbse.eu>
parents: 275
diff changeset
569 $this->Cell(0, 4,' '.$text,0,1,'L',true);
243
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents: 241
diff changeset
570 $this->Ln(1);
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents: 241
diff changeset
571 }
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents: 241
diff changeset
572
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents: 241
diff changeset
573 function Checklist($row) {
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents: 241
diff changeset
574
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents: 241
diff changeset
575 global $my_grain_absorbtion;
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents: 241
diff changeset
576 global $my_brix_correction;
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents: 241
diff changeset
577 $mashwater = 0;
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents: 241
diff changeset
578 $numsalts = 0;
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents: 241
diff changeset
579
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents: 241
diff changeset
580 $this->AddPage();
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents: 241
diff changeset
581 $this->SetFillColor(255,255,255);
279
60d56f39e63e Added yeast starter instructions to the printed checklist
Michiel Broek <mbroek@mbse.eu>
parents: 277
diff changeset
582
60d56f39e63e Added yeast starter instructions to the printed checklist
Michiel Broek <mbroek@mbse.eu>
parents: 277
diff changeset
583 if ($row['starter_enable'] && $row['prop1_volume']) {
60d56f39e63e Added yeast starter instructions to the printed checklist
Michiel Broek <mbroek@mbse.eu>
parents: 277
diff changeset
584 $this->Checkheader('Giststarter maken');
60d56f39e63e Added yeast starter instructions to the printed checklist
Michiel Broek <mbroek@mbse.eu>
parents: 277
diff changeset
585 $days = 0;
60d56f39e63e Added yeast starter instructions to the printed checklist
Michiel Broek <mbroek@mbse.eu>
parents: 277
diff changeset
586 $last = 0;
60d56f39e63e Added yeast starter instructions to the printed checklist
Michiel Broek <mbroek@mbse.eu>
parents: 277
diff changeset
587 for ($i = 1; $i < 5; $i++) {
60d56f39e63e Added yeast starter instructions to the printed checklist
Michiel Broek <mbroek@mbse.eu>
parents: 277
diff changeset
588 $pt = "prop".$i."_type";
60d56f39e63e Added yeast starter instructions to the printed checklist
Michiel Broek <mbroek@mbse.eu>
parents: 277
diff changeset
589 $pv = "prop".$i."_volume";
60d56f39e63e Added yeast starter instructions to the printed checklist
Michiel Broek <mbroek@mbse.eu>
parents: 277
diff changeset
590 if (floatval($row[$pv])) {
60d56f39e63e Added yeast starter instructions to the printed checklist
Michiel Broek <mbroek@mbse.eu>
parents: 277
diff changeset
591 $last = $i;
60d56f39e63e Added yeast starter instructions to the printed checklist
Michiel Broek <mbroek@mbse.eu>
parents: 277
diff changeset
592 if ($row[$pt] == 0)
60d56f39e63e Added yeast starter instructions to the printed checklist
Michiel Broek <mbroek@mbse.eu>
parents: 277
diff changeset
593 $days += 2;
60d56f39e63e Added yeast starter instructions to the printed checklist
Michiel Broek <mbroek@mbse.eu>
parents: 277
diff changeset
594 else if ($row[$pt] == 1)
60d56f39e63e Added yeast starter instructions to the printed checklist
Michiel Broek <mbroek@mbse.eu>
parents: 277
diff changeset
595 $days += 4;
60d56f39e63e Added yeast starter instructions to the printed checklist
Michiel Broek <mbroek@mbse.eu>
parents: 277
diff changeset
596 else
60d56f39e63e Added yeast starter instructions to the printed checklist
Michiel Broek <mbroek@mbse.eu>
parents: 277
diff changeset
597 $days += 6;
60d56f39e63e Added yeast starter instructions to the printed checklist
Michiel Broek <mbroek@mbse.eu>
parents: 277
diff changeset
598 }
60d56f39e63e Added yeast starter instructions to the printed checklist
Michiel Broek <mbroek@mbse.eu>
parents: 277
diff changeset
599 }
60d56f39e63e Added yeast starter instructions to the printed checklist
Michiel Broek <mbroek@mbse.eu>
parents: 277
diff changeset
600 $this->Checkline("begin ongeveer ".$days." dagen voor de brouwdag met de giststarter");
60d56f39e63e Added yeast starter instructions to the printed checklist
Michiel Broek <mbroek@mbse.eu>
parents: 277
diff changeset
601 for ($i = 1; $i < 5; $i++) {
60d56f39e63e Added yeast starter instructions to the printed checklist
Michiel Broek <mbroek@mbse.eu>
parents: 277
diff changeset
602 $pt = "prop".$i."_type";
60d56f39e63e Added yeast starter instructions to the printed checklist
Michiel Broek <mbroek@mbse.eu>
parents: 277
diff changeset
603 $pv = "prop".$i."_volume";
60d56f39e63e Added yeast starter instructions to the printed checklist
Michiel Broek <mbroek@mbse.eu>
parents: 277
diff changeset
604 if (floatval($row[$pv])) {
60d56f39e63e Added yeast starter instructions to the printed checklist
Michiel Broek <mbroek@mbse.eu>
parents: 277
diff changeset
605 $s = "Starter stap ".$i.", van ".sprintf("%.3f",floatval($row[$pv]));
60d56f39e63e Added yeast starter instructions to the printed checklist
Michiel Broek <mbroek@mbse.eu>
parents: 277
diff changeset
606 $s .= " liter maken met SG ".sprintf("%.3f",floatval($row['starter_sg']));
60d56f39e63e Added yeast starter instructions to the printed checklist
Michiel Broek <mbroek@mbse.eu>
parents: 277
diff changeset
607 $this->Checkline($s);
60d56f39e63e Added yeast starter instructions to the printed checklist
Michiel Broek <mbroek@mbse.eu>
parents: 277
diff changeset
608 if ($row[$pt] == 0) {
60d56f39e63e Added yeast starter instructions to the printed checklist
Michiel Broek <mbroek@mbse.eu>
parents: 277
diff changeset
609 $s = "ongeveer 24 uur op een magneetroerder";
60d56f39e63e Added yeast starter instructions to the printed checklist
Michiel Broek <mbroek@mbse.eu>
parents: 277
diff changeset
610 } else if ($row[$pt] == 1) {
60d56f39e63e Added yeast starter instructions to the printed checklist
Michiel Broek <mbroek@mbse.eu>
parents: 277
diff changeset
611 $s = "enkele dagen regelmatig schudden";
60d56f39e63e Added yeast starter instructions to the printed checklist
Michiel Broek <mbroek@mbse.eu>
parents: 277
diff changeset
612 } else {
60d56f39e63e Added yeast starter instructions to the printed checklist
Michiel Broek <mbroek@mbse.eu>
parents: 277
diff changeset
613 $s = "bijna een week rustig laten staan";
60d56f39e63e Added yeast starter instructions to the printed checklist
Michiel Broek <mbroek@mbse.eu>
parents: 277
diff changeset
614 }
60d56f39e63e Added yeast starter instructions to the printed checklist
Michiel Broek <mbroek@mbse.eu>
parents: 277
diff changeset
615 $s .= " tot er voldoende gist is";
60d56f39e63e Added yeast starter instructions to the printed checklist
Michiel Broek <mbroek@mbse.eu>
parents: 277
diff changeset
616 $this->Checkline($s);
60d56f39e63e Added yeast starter instructions to the printed checklist
Michiel Broek <mbroek@mbse.eu>
parents: 277
diff changeset
617 if ($i < $last) {
60d56f39e63e Added yeast starter instructions to the printed checklist
Michiel Broek <mbroek@mbse.eu>
parents: 277
diff changeset
618 $this->Checkline("starter minstens 24 uur in de koeling laten uitzakken");
60d56f39e63e Added yeast starter instructions to the printed checklist
Michiel Broek <mbroek@mbse.eu>
parents: 277
diff changeset
619 $this->Checkline("starter uit de koelkast halen en afgieten");
60d56f39e63e Added yeast starter instructions to the printed checklist
Michiel Broek <mbroek@mbse.eu>
parents: 277
diff changeset
620 } else {
60d56f39e63e Added yeast starter instructions to the printed checklist
Michiel Broek <mbroek@mbse.eu>
parents: 277
diff changeset
621 $this->Checkline("starter in de koeling zetten tot de brouwdag");
60d56f39e63e Added yeast starter instructions to the printed checklist
Michiel Broek <mbroek@mbse.eu>
parents: 277
diff changeset
622 $this->Checkline("starter op de brouwdag uit de koelkast halen en afgieten");
60d56f39e63e Added yeast starter instructions to the printed checklist
Michiel Broek <mbroek@mbse.eu>
parents: 277
diff changeset
623 }
60d56f39e63e Added yeast starter instructions to the printed checklist
Michiel Broek <mbroek@mbse.eu>
parents: 277
diff changeset
624 }
60d56f39e63e Added yeast starter instructions to the printed checklist
Michiel Broek <mbroek@mbse.eu>
parents: 277
diff changeset
625 }
60d56f39e63e Added yeast starter instructions to the printed checklist
Michiel Broek <mbroek@mbse.eu>
parents: 277
diff changeset
626 $this->Ln(5);
60d56f39e63e Added yeast starter instructions to the printed checklist
Michiel Broek <mbroek@mbse.eu>
parents: 277
diff changeset
627 }
60d56f39e63e Added yeast starter instructions to the printed checklist
Michiel Broek <mbroek@mbse.eu>
parents: 277
diff changeset
628
243
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents: 241
diff changeset
629 $this->Checkheader('Water en -behandeling');
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents: 241
diff changeset
630 if ($row['w1_name']) {
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents: 241
diff changeset
631 $this->Checkline(sprintf("%.1f",floatval($row['w1_amount'])).' liter water '.$row['w1_name']);
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents: 241
diff changeset
632 $mashwater += floatval($row['w1_amount']);
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents: 241
diff changeset
633 }
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents: 241
diff changeset
634 if ($row['w2_name']) {
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents: 241
diff changeset
635 $this->Checkline(sprintf("%.1f",floatval($row['w2_amount'])).' liter water '.$row['w2_name']);
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents: 241
diff changeset
636 $mashwater += floatval($row['w2_amount']);
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents: 241
diff changeset
637 }
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents: 241
diff changeset
638 $arr = json_decode($row['json_miscs'], true);
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents: 241
diff changeset
639 foreach($arr as $item) {
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents: 241
diff changeset
640 if ($item['m_type'] == 4) { // Only the water agents
276
08c824a5ffd8 Product print added yeast section.
Michiel Broek <mbroek@mbse.eu>
parents: 275
diff changeset
641 $unit = ($item['m_amount_is_weight']) ? " gram ":" ml ";
08c824a5ffd8 Product print added yeast section.
Michiel Broek <mbroek@mbse.eu>
parents: 275
diff changeset
642 $this->Checkline(sprintf("%.1f",floatval($item['m_amount'] * 1000)).$unit.$item['m_name']);
243
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents: 241
diff changeset
643 $numsalts++;
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents: 241
diff changeset
644 }
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents: 241
diff changeset
645 }
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents: 241
diff changeset
646 $this->Ln(5);
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents: 241
diff changeset
647
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents: 241
diff changeset
648 $this->Checkheader('Mout afwegen en schroten');
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents: 241
diff changeset
649 $arr = json_decode($row['json_fermentables'], true);
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents: 241
diff changeset
650 foreach($arr as $item) {
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents: 241
diff changeset
651 if ($item['f_added'] == 0) { // to mash
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents: 241
diff changeset
652 $s = sprintf("%.3f",floatval($item['f_amount'])).' kg ';
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents: 241
diff changeset
653 $s .= iconv('UTF-8','windows-1252',$item['f_name']);
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents: 241
diff changeset
654 $s .= ' ('.iconv('UTF-8','windows-1252',$item['f_supplier']).')';
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents: 241
diff changeset
655 $this->Checkline($s);
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents: 241
diff changeset
656 }
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents: 241
diff changeset
657 }
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents: 241
diff changeset
658 $this->Checkline('mout schroten');
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents: 241
diff changeset
659 $this->Ln(5);
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents: 241
diff changeset
660
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents: 241
diff changeset
661 $this->Checkheader('Maischen');
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents: 241
diff changeset
662 $mvol = 0;
247
792b5ba77a1f The checklist now shows the pre-boil gravity.
Michiel Broek <mbroek@mbse.eu>
parents: 245
diff changeset
663 $msugars = 0; // mash sugars
279
60d56f39e63e Added yeast starter instructions to the printed checklist
Michiel Broek <mbroek@mbse.eu>
parents: 277
diff changeset
664 $grainabsorbtion = 0;
243
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents: 241
diff changeset
665 $arr = json_decode($row['json_mashs'], true);
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents: 241
diff changeset
666 if (count($arr) > 0) {
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents: 241
diff changeset
667 $loop = 0;
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents: 241
diff changeset
668 foreach($arr as $item) {
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents: 241
diff changeset
669 if ($item['step_type'] == 0)
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents: 241
diff changeset
670 $mvol += $item['step_infuse_amount']; // We need this later.
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents: 241
diff changeset
671 if ($loop == 0) {
319
60002c09f78a Fix checklist where there is more than one mash infusion step.
Michiel Broek <mbroek@mbse.eu>
parents: 293
diff changeset
672 if ($item['step_type'] == 0)
60002c09f78a Fix checklist where there is more than one mash infusion step.
Michiel Broek <mbroek@mbse.eu>
parents: 293
diff changeset
673 $l = $item['step_infuse_amount'];
60002c09f78a Fix checklist where there is more than one mash infusion step.
Michiel Broek <mbroek@mbse.eu>
parents: 293
diff changeset
674 else
60002c09f78a Fix checklist where there is more than one mash infusion step.
Michiel Broek <mbroek@mbse.eu>
parents: 293
diff changeset
675 $l = $mashwater;
60002c09f78a Fix checklist where there is more than one mash infusion step.
Michiel Broek <mbroek@mbse.eu>
parents: 293
diff changeset
676 $s = sprintf("%.1f",$l).' liter water opwarmen tot ';
243
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents: 241
diff changeset
677 $s .= sprintf("%.1f",$item['step_temp']).' '.DEG.'C (';
319
60002c09f78a Fix checklist where there is more than one mash infusion step.
Michiel Broek <mbroek@mbse.eu>
parents: 293
diff changeset
678 $s .= sprintf("%.1f",kettle_cm($l,$row['eq_tun_volume'],$row['eq_tun_height']));
243
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents: 241
diff changeset
679 $s .= ' cm onder de rand)';
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents: 241
diff changeset
680 $this->Checkline($s);
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents: 241
diff changeset
681 if ($numsalts > 0)
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents: 241
diff changeset
682 $this->Checkline('brouwzouten en -zuren toevoegen');
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents: 241
diff changeset
683 $this->Checkline('mout storten en inmaischen');
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents: 241
diff changeset
684 $hops = json_decode($row['json_hops'], true);
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents: 241
diff changeset
685 foreach($hops as $item2) {
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents: 241
diff changeset
686 if ($item2['h_useat'] == 0) {
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents: 241
diff changeset
687 $s = sprintf("%.1f",$item2['h_amount']*1000).' gr ';
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents: 241
diff changeset
688 $s .= iconv('UTF-8','windows-1252',$item2['h_name']).' toevoegen';
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents: 241
diff changeset
689 $this->Checkline($s);
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents: 241
diff changeset
690 }
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents: 241
diff changeset
691 }
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents: 241
diff changeset
692 $this->Checkline($item['step_time'].' min. bij '.$item['step_temp'].' '.DEG.'C');
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents: 241
diff changeset
693 $this->Checkline('pH meten en bijstellen (doel pH beslag: '.sprintf("%.1f",$row['mash_ph']).' pH)');
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents: 241
diff changeset
694 } else {
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents: 241
diff changeset
695 if ($item['step_type'] == 0) { // Infusion
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents: 241
diff changeset
696 $s = 'toevoegen '.$item['step_infuse_amount'].' liter water van xx '.DEG.'C';
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents: 241
diff changeset
697 } else if ($item['step_type'] == 1) { // Direct heat
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents: 241
diff changeset
698 $s = 'opwarmen tot '.$item['step_temp'].' '.DEG.'C';
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents: 241
diff changeset
699 } else { // Decoction
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents: 241
diff changeset
700 $s = 'uitnemen, opwarmen, koken en terugstorten van '.$item['step_infuse_amount'].' liter deelbeslag';
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents: 241
diff changeset
701 }
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents: 241
diff changeset
702 $this->Checkline($s);
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents: 241
diff changeset
703 $this->Checkline($item['step_time'].' min. bij '.$item['step_temp'].' '.DEG.'C');
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents: 241
diff changeset
704 }
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents: 241
diff changeset
705 $loop++;
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents: 241
diff changeset
706 }
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents: 241
diff changeset
707 $est_mash_sg = 0;
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents: 241
diff changeset
708 $ferms = json_decode($row['json_fermentables'], true);
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents: 241
diff changeset
709 foreach($ferms as $item) {
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents: 241
diff changeset
710 if ($item['f_added'] == 0) {
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents: 241
diff changeset
711 $d = $item['f_amount'] * ($item['f_yield'] / 100) * (1 - $item['f_moisture'] / 100);
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents: 241
diff changeset
712 $mvol += $item['f_amount'] * $item['f_moisture'] / 100;
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents: 241
diff changeset
713 $grainabsorbtion += $my_grain_absorbtion * $item['f_amount'];
247
792b5ba77a1f The checklist now shows the pre-boil gravity.
Michiel Broek <mbroek@mbse.eu>
parents: 245
diff changeset
714 $msugars += $d;
243
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents: 241
diff changeset
715 }
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents: 241
diff changeset
716 }
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents: 241
diff changeset
717 $sugardensity = 1.611;
247
792b5ba77a1f The checklist now shows the pre-boil gravity.
Michiel Broek <mbroek@mbse.eu>
parents: 245
diff changeset
718 $v = $msugars / $sugardensity + $mvol;
792b5ba77a1f The checklist now shows the pre-boil gravity.
Michiel Broek <mbroek@mbse.eu>
parents: 245
diff changeset
719 $plato = 1000 * $msugars / ($v * 10); // deg. Plato
243
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents: 241
diff changeset
720 $mash_sg = plato_to_sg($plato);
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents: 241
diff changeset
721 $brix = $plato * $my_brix_correction;
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents: 241
diff changeset
722 $s = 'doel sg eind maischen: '.sprintf("%.3f",$mash_sg);
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents: 241
diff changeset
723 $s .= ' SG ('.sprintf("%.1f",$brix).' '.DEG.'Brix, '.sprintf("%.1f",$plato).' '.DEG.'P)';
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents: 241
diff changeset
724 $this->Checkline($s);
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents: 241
diff changeset
725 }
279
60d56f39e63e Added yeast starter instructions to the printed checklist
Michiel Broek <mbroek@mbse.eu>
parents: 277
diff changeset
726 if ($this->GetY() > 200)
60d56f39e63e Added yeast starter instructions to the printed checklist
Michiel Broek <mbroek@mbse.eu>
parents: 277
diff changeset
727 $this->AddPage();
60d56f39e63e Added yeast starter instructions to the printed checklist
Michiel Broek <mbroek@mbse.eu>
parents: 277
diff changeset
728 else
60d56f39e63e Added yeast starter instructions to the printed checklist
Michiel Broek <mbroek@mbse.eu>
parents: 277
diff changeset
729 $this->Ln(5);
243
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents: 241
diff changeset
730
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents: 241
diff changeset
731 $acidtype = array( 'Melkzuur', 'Zoutzuur', 'Fosforzuur', 'Zwavelzuur' );
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents: 241
diff changeset
732 $this->Checkheader('Filteren en spoelen');
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents: 241
diff changeset
733 $s = sprintf("%.1f",$row['sparge_volume']).' liter spoelwater opwarmen tot '.sprintf("%.1f",$row['sparge_temp']).' '.DEG.'C';
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents: 241
diff changeset
734 $this->Checkline($s);
245
3649c3d31d15 Fixed the mousewheel, spinner buttons to use the full min/max ranges. The 1.002 SG block to be precise.
Michiel Broek <mbroek@mbse.eu>
parents: 243
diff changeset
735 $s = 'spoelwater aanzuren tot pH <= '.sprintf("%.1f",$row['sparge_ph']).' met ';
243
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents: 241
diff changeset
736 $s .= sprintf("%.1f",$row['sparge_acid_amount']*1000).' ml. '.$acidtype[$row['sparge_acid_type']];
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents: 241
diff changeset
737 $this->Checkline($s);
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents: 241
diff changeset
738 $spoelw = ($row['boil_size'] - $mashwater + $grainabsorbtion + $row['eq_lauter_deadspace']) * 1.03; // A small heat correction
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents: 241
diff changeset
739 $this->Checkline('spoelen met ongeveer '.sprintf("%.1f",$spoelw).' liter spoelwater');
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents: 241
diff changeset
740 $s = 'doelvolume in kookketel: '.sprintf("%.1f",$row['boil_size'] * 1.04).' liter (';
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents: 241
diff changeset
741 $s .= sprintf("%.1f",kettle_cm($row['boil_size'] * 1.04,$row['eq_kettle_volume'],$row['eq_kettle_height'])).' cm onder de rand)';
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents: 241
diff changeset
742 $this->Checkline($s);
247
792b5ba77a1f The checklist now shows the pre-boil gravity.
Michiel Broek <mbroek@mbse.eu>
parents: 245
diff changeset
743 $pre_sg = estimate_sg($msugars * floatval($row['efficiency']) / 100,floatval($row['boil_size']));
792b5ba77a1f The checklist now shows the pre-boil gravity.
Michiel Broek <mbroek@mbse.eu>
parents: 245
diff changeset
744 $plato = sg_to_plato($pre_sg);
792b5ba77a1f The checklist now shows the pre-boil gravity.
Michiel Broek <mbroek@mbse.eu>
parents: 245
diff changeset
745 $brix = $plato * $my_brix_correction;
792b5ba77a1f The checklist now shows the pre-boil gravity.
Michiel Broek <mbroek@mbse.eu>
parents: 245
diff changeset
746 $s = 'doel SG in kookketel: '.sprintf("%.3f",$pre_sg).' SG ('.sprintf("%.1f",$brix).' '.DEG.'Brix, '.sprintf("%.1f",$plato).' '.DEG.'P)';
792b5ba77a1f The checklist now shows the pre-boil gravity.
Michiel Broek <mbroek@mbse.eu>
parents: 245
diff changeset
747 $this->Checkline($s);
243
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents: 241
diff changeset
748 $hops = json_decode($row['json_hops'], true);
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents: 241
diff changeset
749 foreach($hops as $item2) {
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents: 241
diff changeset
750 if ($item2['h_useat'] == 1) {
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents: 241
diff changeset
751 $s = sprintf("%.1f",$item2['h_amount']*1000).' gr ';
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents: 241
diff changeset
752 $s .= iconv('UTF-8','windows-1252',$item2['h_name']).' toevoegen na het spoelen';
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents: 241
diff changeset
753 $this->Checkline($s);
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents: 241
diff changeset
754 }
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents: 241
diff changeset
755 }
279
60d56f39e63e Added yeast starter instructions to the printed checklist
Michiel Broek <mbroek@mbse.eu>
parents: 277
diff changeset
756 if ($this->GetY() > 200)
60d56f39e63e Added yeast starter instructions to the printed checklist
Michiel Broek <mbroek@mbse.eu>
parents: 277
diff changeset
757 $this->AddPage();
60d56f39e63e Added yeast starter instructions to the printed checklist
Michiel Broek <mbroek@mbse.eu>
parents: 277
diff changeset
758 else
60d56f39e63e Added yeast starter instructions to the printed checklist
Michiel Broek <mbroek@mbse.eu>
parents: 277
diff changeset
759 $this->Ln(5);
243
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents: 241
diff changeset
760
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents: 241
diff changeset
761 $this->Checkheader('Koken');
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents: 241
diff changeset
762 $this->Checkline('totale kooktijd: '.$row['boil_time'].' min.');
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents: 241
diff changeset
763 for ($i = $row['boil_time']; $i >= 0; $i--) {
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents: 241
diff changeset
764 if ($i == 10) {
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents: 241
diff changeset
765 $ferms = json_decode($row['json_fermentables'], true);
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents: 241
diff changeset
766 foreach($ferms as $item1) {
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents: 241
diff changeset
767 if ($item1['f_added'] == 1) {
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents: 241
diff changeset
768 $s = sprintf("%.3f",$item1['f_amount']).' kg ';
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents: 241
diff changeset
769 $s .= iconv('UTF-8','windows-1252',$item1['f_name']).' bij 10 minuten voor einde koken';
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents: 241
diff changeset
770 $this->Checkline($s);
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents: 241
diff changeset
771 }
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents: 241
diff changeset
772 }
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents: 241
diff changeset
773 if ($row['brew_cooling_method'] == 1)
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents: 241
diff changeset
774 $this->Checkline('Plaats dompelkoeler bij 10 minuten voor einde koken');
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents: 241
diff changeset
775 }
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents: 241
diff changeset
776 $hops = json_decode($row['json_hops'], true);
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents: 241
diff changeset
777 foreach($hops as $item2) {
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents: 241
diff changeset
778 if (($item2['h_useat'] == 2 || $item2['h_useat'] == 3) && ($item2['h_time'] == $i)) {
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents: 241
diff changeset
779 $s = sprintf("%.1f",$item2['h_amount']*1000).' gr ';
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents: 241
diff changeset
780 $s .= iconv('UTF-8','windows-1252',$item2['h_name']).' bij ';
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents: 241
diff changeset
781 if ($i > 0)
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents: 241
diff changeset
782 $s .= $i.' minuten voor einde koken';
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents: 241
diff changeset
783 else
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents: 241
diff changeset
784 $s .= 'vlamuit';
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents: 241
diff changeset
785 $this->Checkline($s);
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents: 241
diff changeset
786 }
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents: 241
diff changeset
787 }
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents: 241
diff changeset
788 $miscs = json_decode($row['json_miscs'], true);
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents: 241
diff changeset
789 foreach($miscs as $item3) {
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents: 241
diff changeset
790 if ($item3['m_use_use'] == 2 && $item3['m_time'] == $i) {
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents: 241
diff changeset
791 $s = sprintf("%.1f",$item3['m_amount']*1000).' gr ';
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents: 241
diff changeset
792 $s .= iconv('UTF-8','windows-1252',$item3['m_name']).' bij ';
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents: 241
diff changeset
793 if ($i > 0)
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents: 241
diff changeset
794 $s .= $i.' minuten voor einde koken';
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents: 241
diff changeset
795 else
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents: 241
diff changeset
796 $s .= 'vlamuit';
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents: 241
diff changeset
797 $this->Checkline($s);
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents: 241
diff changeset
798 }
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents: 241
diff changeset
799 }
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents: 241
diff changeset
800
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents: 241
diff changeset
801 }
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents: 241
diff changeset
802 $s = 'doelvolume einde koken: '.sprintf("%.1f",$row['batch_size']*1.04).' liter (';
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents: 241
diff changeset
803 $s .= sprintf("%.1f",kettle_cm($row['batch_size']*1.04,$row['eq_kettle_volume'],$row['eq_kettle_height']));
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents: 241
diff changeset
804 $s .= ' cm onder de rand)';
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents: 241
diff changeset
805 $this->Checkline($s);
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents: 241
diff changeset
806 $plato = sg_to_plato($row['est_og']);
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents: 241
diff changeset
807 $brix = $plato * $my_brix_correction;
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents: 241
diff changeset
808 $s = 'doel SG einde koken: '.sprintf("%.3f",$row['est_og']).' SG (';
247
792b5ba77a1f The checklist now shows the pre-boil gravity.
Michiel Broek <mbroek@mbse.eu>
parents: 245
diff changeset
809 $s .= sprintf("%.1f",$brix).' '.DEG.'Brix, '.sprintf("%.1f",$plato).' '.DEG.'P)';
243
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents: 241
diff changeset
810 $this->Checkline($s);
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents: 241
diff changeset
811 if ($this->GetY() > 200)
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents: 241
diff changeset
812 $this->AddPage();
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents: 241
diff changeset
813 else
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents: 241
diff changeset
814 $this->Ln(5);
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents: 241
diff changeset
815
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents: 241
diff changeset
816 if (($row['brew_whirlpool9'] + $row['brew_whirlpool7'] + $row['brew_whirlpool6'] + $row['brew_whirlpool2']) > 0) {
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents: 241
diff changeset
817 $this->Checkheader('Whirlpool en koelen');
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents: 241
diff changeset
818 if ($row['brew_whirlpool9'] > 0) {
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents: 241
diff changeset
819 $s = 'Whirlpool voor '.$row['brew_whirlpool9'].' min. Temperatuur boven 85 '.DEG.'C houden';
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents: 241
diff changeset
820 $this->Checkline($s);
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents: 241
diff changeset
821 }
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents: 241
diff changeset
822 if ($row['brew_whirlpool7'] > 0) {
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents: 241
diff changeset
823 $this->Checkline('koelen tot 79 '.DEG.'C');
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents: 241
diff changeset
824 $s = 'Whirlpool voor '.$row['brew_whirlpool7'].' min. Temperatuur tussen 72 en 79 '.DEG.'C houden';
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents: 241
diff changeset
825 $this->Checkline($s);
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents: 241
diff changeset
826 }
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents: 241
diff changeset
827 if ($row['brew_whirlpool6'] > 0) {
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents: 241
diff changeset
828 $this->Checkline('koelen tot 66 '.DEG.'C');
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents: 241
diff changeset
829 $s = 'Whirlpool voor '.$row['brew_whirlpool6'].' min. Temperatuur tussen 60 en 66 '.DEG.'C houden';
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents: 241
diff changeset
830 $this->Checkline($s);
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents: 241
diff changeset
831 }
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents: 241
diff changeset
832 $this->Checkline('koelen tot '.sprintf("%.1f",$row['brew_cooling_to']).' '.DEG.'C');
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents: 241
diff changeset
833 if ($row['brew_whirlpool2'] > 0) {
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents: 241
diff changeset
834 $s = 'Whirlpool voor '.$row['brew_whirlpool2'].' min.';
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents: 241
diff changeset
835 $this->Checkline($s);
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents: 241
diff changeset
836 }
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents: 241
diff changeset
837 } else {
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents: 241
diff changeset
838 $this->Checkheader('Koelen');
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents: 241
diff changeset
839 $this->Checkline('koelen tot '.sprintf("%.1f",$row['brew_cooling_to']).' '.DEG.'C');
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents: 241
diff changeset
840 }
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents: 241
diff changeset
841 $this->Checkline('gistvat ontsmetten en evt. pomp en slangen ontsmetten');
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents: 241
diff changeset
842 $this->Checkline('wort naar gistvat overbrengen');
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents: 241
diff changeset
843 if ($this->GetY() > 200)
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents: 241
diff changeset
844 $this->AddPage();
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents: 241
diff changeset
845 else
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents: 241
diff changeset
846 $this->Ln(5);
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents: 241
diff changeset
847
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents: 241
diff changeset
848 $this->Checkheader('Gist enten');
276
08c824a5ffd8 Product print added yeast section.
Michiel Broek <mbroek@mbse.eu>
parents: 275
diff changeset
849 $dry = 0;
08c824a5ffd8 Product print added yeast section.
Michiel Broek <mbroek@mbse.eu>
parents: 275
diff changeset
850 $yeasts = json_decode($row['json_yeasts'], true);
08c824a5ffd8 Product print added yeast section.
Michiel Broek <mbroek@mbse.eu>
parents: 275
diff changeset
851 foreach ($yeasts as $item) {
08c824a5ffd8 Product print added yeast section.
Michiel Broek <mbroek@mbse.eu>
parents: 275
diff changeset
852 if ($item['y_use'] == 0) { // primary
08c824a5ffd8 Product print added yeast section.
Michiel Broek <mbroek@mbse.eu>
parents: 275
diff changeset
853 if ($item['y_form'] == 0) { // Liquid
08c824a5ffd8 Product print added yeast section.
Michiel Broek <mbroek@mbse.eu>
parents: 275
diff changeset
854 $this->Checkline($item['y_amount'].' pak '.$item['y_product_id'].', '.$item['y_name'].' gist');
08c824a5ffd8 Product print added yeast section.
Michiel Broek <mbroek@mbse.eu>
parents: 275
diff changeset
855 } else if ($item['y_form'] == 1) { // Dry
08c824a5ffd8 Product print added yeast section.
Michiel Broek <mbroek@mbse.eu>
parents: 275
diff changeset
856 $s = sprintf("%.1f",$item['y_amount']*1000).' gram '.$item['y_product_id'].', '.$item['y_name'];
08c824a5ffd8 Product print added yeast section.
Michiel Broek <mbroek@mbse.eu>
parents: 275
diff changeset
857 $s .= ' gist';
08c824a5ffd8 Product print added yeast section.
Michiel Broek <mbroek@mbse.eu>
parents: 275
diff changeset
858 $dry += $item['y_amount']*10000;
08c824a5ffd8 Product print added yeast section.
Michiel Broek <mbroek@mbse.eu>
parents: 275
diff changeset
859 $this->Checkline($s);
08c824a5ffd8 Product print added yeast section.
Michiel Broek <mbroek@mbse.eu>
parents: 275
diff changeset
860 } else { // Slant/Culture/Frozen/Bottle
08c824a5ffd8 Product print added yeast section.
Michiel Broek <mbroek@mbse.eu>
parents: 275
diff changeset
861 $s = sprintf("%.0f",$item['y_amount']*1000).' ml '.$item['y_product_id'].', '.$item['y_name'].' gist';
08c824a5ffd8 Product print added yeast section.
Michiel Broek <mbroek@mbse.eu>
parents: 275
diff changeset
862 $this->Checkline($s);
08c824a5ffd8 Product print added yeast section.
Michiel Broek <mbroek@mbse.eu>
parents: 275
diff changeset
863 }
08c824a5ffd8 Product print added yeast section.
Michiel Broek <mbroek@mbse.eu>
parents: 275
diff changeset
864 }
08c824a5ffd8 Product print added yeast section.
Michiel Broek <mbroek@mbse.eu>
parents: 275
diff changeset
865 }
08c824a5ffd8 Product print added yeast section.
Michiel Broek <mbroek@mbse.eu>
parents: 275
diff changeset
866 if ($dry > 0) {
08c824a5ffd8 Product print added yeast section.
Michiel Broek <mbroek@mbse.eu>
parents: 275
diff changeset
867 $this->Checkline(' gist hydrateren in '.$dry.' ml gedesinfecteerd water van 32 '.DEG.'C');
08c824a5ffd8 Product print added yeast section.
Michiel Broek <mbroek@mbse.eu>
parents: 275
diff changeset
868 $this->Checkline(' 15 minuten laten staan bij 32 '.DEG.'C');
08c824a5ffd8 Product print added yeast section.
Michiel Broek <mbroek@mbse.eu>
parents: 275
diff changeset
869 $this->Checkline(' gistmengsel voorzichtig roeren en laten afkoelen tot temperatuur wort');
08c824a5ffd8 Product print added yeast section.
Michiel Broek <mbroek@mbse.eu>
parents: 275
diff changeset
870 $this->Checkline(' gist toevoegen');
08c824a5ffd8 Product print added yeast section.
Michiel Broek <mbroek@mbse.eu>
parents: 275
diff changeset
871 $this->Checkline('Of');
08c824a5ffd8 Product print added yeast section.
Michiel Broek <mbroek@mbse.eu>
parents: 275
diff changeset
872 $this->Checkline(' gist rechtstreeks over het wort strooien');
08c824a5ffd8 Product print added yeast section.
Michiel Broek <mbroek@mbse.eu>
parents: 275
diff changeset
873 } else {
279
60d56f39e63e Added yeast starter instructions to the printed checklist
Michiel Broek <mbroek@mbse.eu>
parents: 277
diff changeset
874 if ($row['starter_enable'] && $row['prop1_volume'])
60d56f39e63e Added yeast starter instructions to the printed checklist
Michiel Broek <mbroek@mbse.eu>
parents: 277
diff changeset
875 $this->Checkline('giststarter toevoegen');
60d56f39e63e Added yeast starter instructions to the printed checklist
Michiel Broek <mbroek@mbse.eu>
parents: 277
diff changeset
876 else
60d56f39e63e Added yeast starter instructions to the printed checklist
Michiel Broek <mbroek@mbse.eu>
parents: 277
diff changeset
877 $this->Checkline('gist toevoegen');
276
08c824a5ffd8 Product print added yeast section.
Michiel Broek <mbroek@mbse.eu>
parents: 275
diff changeset
878 }
08c824a5ffd8 Product print added yeast section.
Michiel Broek <mbroek@mbse.eu>
parents: 275
diff changeset
879 if ($row['brew_fermenter_extrawater'] > 0)
08c824a5ffd8 Product print added yeast section.
Michiel Broek <mbroek@mbse.eu>
parents: 275
diff changeset
880 $this->Checkline(sprintf("%.1f", $row['brew_fermenter_extrawater']).' liter water toevoegen in gistvat');
08c824a5ffd8 Product print added yeast section.
Michiel Broek <mbroek@mbse.eu>
parents: 275
diff changeset
881 if ($row['brew_aeration_type'] > 0) {
08c824a5ffd8 Product print added yeast section.
Michiel Broek <mbroek@mbse.eu>
parents: 275
diff changeset
882 $s = 'wort '.$row['brew_aeration_time'].' minuten beluchten met ';
08c824a5ffd8 Product print added yeast section.
Michiel Broek <mbroek@mbse.eu>
parents: 275
diff changeset
883 $s .= ($row['brew_aeration_type'] == 1) ? "lucht":"zuurstof";
08c824a5ffd8 Product print added yeast section.
Michiel Broek <mbroek@mbse.eu>
parents: 275
diff changeset
884 $this->Checkline($s);
08c824a5ffd8 Product print added yeast section.
Michiel Broek <mbroek@mbse.eu>
parents: 275
diff changeset
885 }
243
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents: 241
diff changeset
886 if ($this->GetY() > 200)
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents: 241
diff changeset
887 $this->AddPage();
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents: 241
diff changeset
888 else
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents: 241
diff changeset
889 $this->Ln(5);
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents: 241
diff changeset
890
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents: 241
diff changeset
891 $this->Checkheader('Vergisting starten');
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents: 241
diff changeset
892 $this->Checkline('klimaatkast instellen op '.sprintf("%.1f",$row['brew_cooling_to']).' '.DEG.'C');
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents: 241
diff changeset
893
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents: 241
diff changeset
894 // 'Toevoegingen tijdens vergisting'
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents: 241
diff changeset
895 // 'Toevoegingen tijdens nagisting/lagering'
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents: 241
diff changeset
896 // fermentables & hops & miscs verdelen over primary/secondary/teriary
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents: 241
diff changeset
897
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents: 241
diff changeset
898 // 'Toevoegingen tijdens bottelen/op fust zetten'
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents: 241
diff changeset
899 }
391
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
900
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
901 function Brewday($row) {
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
902
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
903 global $my_brix_correction;
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
904 global $my_grain_absorbtion;
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
905
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
906 if ($this->GetY() > 180)
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
907 $this->AddPage();
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
908 else
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
909 $this->Ln(10);
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
910
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
911 $vul = $this->w - $this->rMargin - $this->lMargin - 170;
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
912 $cMargin=$this->cMargin;
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
913 $this->cMargin=2;
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
914 $this->TableX=$this->lMargin;
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
915 $this->SetFont('Helvetica','B',9);
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
916 $this->SetX($this->TableX);
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
917 $this->SetFillColor(255,150,100);
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
918 $this->Cell(0, 5, 'Brouwdag gegevens',0,0,'C',true);
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
919 $this->Ln();
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
920
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
921 $this->SetFont('Helvetica','',9);
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
922 $this->SetFillColor(210,245,255);
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
923
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
924 $this->SetX($this->TableX);
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
925 $this->Cell(35,5,'Datum start',0,0,'L',true);
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
926 $this->Cell(50,5,$row['brew_date_start'],0,0,'L',true);
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
927 $this->Cell($vul,5,'',0,0,'L',false);
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
928 $this->Cell(35,5,'Maisch zuurgraad',0,0,'L',true);
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
929 $this->Cell(50,5,sprintf("%.1f", $row['brew_mash_ph']).' pH',0,0,'L',true);
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
930 $this->Ln();
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
931
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
932 $this->SetX($this->TableX);
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
933 $this->Cell(35,5,'Datum eind',0,0,'L',true);
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
934 $this->Cell(50,5,$row['brew_date_end'],0,0,'L',true);
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
935 $this->Cell($vul,5,'',0,0,'L',false);
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
936 $this->Cell(35,5,'Maisch densiteit',0,0,'L',true);
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
937 $plato = sg_to_plato(floatval($row['brew_mash_sg']));
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
938 $brix = $plato * $my_brix_correction;
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
939 $this->Cell(50,5,sprintf("%.3f", floatval($row['brew_mash_sg']))." SG ".sprintf("%.1f",$brix).DEG.'Brix '.sprintf("%.1f",$plato).DEG.'P',0,0,'L',true);
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
940 $this->Ln();
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
941
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
942 $infuse = $mvol = floatval($row['w1_amount']) + floatval($row['w2_amount']);
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
943 $msugars = 0;
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
944 $bsugars = 0;
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
945 $mashkg = 0;
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
946 $ferms = json_decode($row['json_fermentables'], true);
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
947 foreach($ferms as $item) {
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
948 if ($item['f_added'] == 0) { // Mash
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
949 $msugars += floatval($item['f_amount']) * (floatval($item['f_yield']) / 100) * (1 - floatval($item['f_moisture']) / 100);
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
950 $mvol += floatval($item['f_amount']) * floatval($item['f_moisture']) / 100;
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
951 $mashkg += floatval($item['f_amount']);
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
952 }
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
953 if ($item['f_added'] == 1) { // Boil
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
954 $bsugars += floatval($item['f_amount']) * (floatval($item['f_yield']) / 100) * (1 - floatval($item['f_moisture']) / 100);
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
955 }
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
956 }
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
957 $sugardensity = 1.611;
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
958 $v = $msugars / $sugardensity + $mvol;
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
959 $plato = 1000 * $msugars / ($v * 10);
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
960 if ($plato > 0.5)
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
961 $e = 100 * sg_to_plato(floatval($row['brew_mash_sg'])) / $plato;
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
962 else
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
963 $e = 0;
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
964 $this->SetX($this->TableX);
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
965 $this->Cell(85+$vul,5,'',0,0,'L',false);
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
966 $this->Cell(35,5,'Maisch rendement',0,0,'L',true);
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
967 $this->Cell(50,5,sprintf("%.1f", $e)."%",0,0,'L',true);
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
968 $this->Ln(7);
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
969
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
970 $this->SetX($this->TableX);
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
971 $this->Cell(35,5,'Voor koken zuurgraad',0,0,'L',true);
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
972 $this->Cell(50,5,sprintf("%.1f", $row['brew_preboil_ph'])." pH",0,0,'L',true);
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
973 $this->Cell($vul,5,'',0,0,'L',false);
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
974 $this->Cell(35,5,'Na koken zuurgraad',0,0,'L',true);
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
975 $this->Cell(50,5,sprintf("%.1f", $row['brew_aboil_ph'])." pH",0,0,'L',true);
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
976 $this->Ln();
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
977
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
978 $this->SetX($this->TableX);
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
979 $this->Cell(35,5,'Voor koken densiteit',0,0,'L',true);
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
980 $plato = sg_to_plato(floatval($row['brew_preboil_sg']));
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
981 $brix = $plato * $my_brix_correction;
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
982 $this->Cell(50,5,sprintf("%.3f", floatval($row['brew_preboil_sg']))." SG ".sprintf("%.1f",$brix).DEG.'Brix '.sprintf("%.1f",$plato).DEG.'P',0,0,'L',true);
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
983 $this->Cell($vul,5,'',0,0,'L',false);
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
984 $this->Cell(35,5,'Na koken densiteit',0,0,'L',true);
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
985 $plato = sg_to_plato(floatval($row['brew_aboil_sg']));
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
986 $brix = $plato * $my_brix_correction;
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
987 $this->Cell(50,5,sprintf("%.3f", floatval($row['brew_aboil_sg']))." SG ".sprintf("%.1f",$brix).DEG.'Brix '.sprintf("%.1f",$plato).DEG.'P',0,0,'L',true);
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
988 $this->Ln();
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
989
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
990 $this->SetX($this->TableX);
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
991 $this->Cell(35,5,'Voor koken volume',0,0,'L',true);
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
992 $this->Cell(50,5,sprintf("%.1f", $row['brew_preboil_volume'])." liter",0,0,'L',true);
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
993 $this->Cell($vul,5,'',0,0,'L',false);
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
994 $this->Cell(35,5,'Na koken volume',0,0,'L',true);
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
995 $this->Cell(50,5,sprintf("%.1f", $row['brew_aboil_volume'])." liter",0,0,'L',true);
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
996 $this->Ln();
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
997
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
998 $this->SetX($this->TableX);
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
999 $this->Cell(35,5,'Voor koken rendement',0,0,'L',true);
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
1000 $tot = sg_to_plato(floatval($row['brew_preboil_sg'])) * (floatval($row['brew_preboil_volume']) / 1.04) * floatval($row['brew_preboil_sg']) * 10 / 1000;
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
1001 $result = 0;
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
1002 if ($msugars > 0)
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
1003 $result = (($tot / $msugars * 100) * 10) / 10;
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
1004 if ($result < 0)
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
1005 $result = 0;
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
1006 $this->Cell(50,5,sprintf("%.1f", $result)."%",0,0,'L',true);
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
1007 $this->Cell($vul,5,'',0,0,'L',false);
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
1008 $this->Cell(35,5,'Na koken rendement',0,0,'L',true);
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
1009 $tot = sg_to_plato(floatval($row['brew_aboil_sg'])) * (floatval($row['brew_aboil_volume']) / 1.04) * floatval($row['brew_aboil_sg']) * 10 / 1000;
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
1010 $tot -= $bsugars;
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
1011 $result = 0;
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
1012 if ($msugars > 0)
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
1013 $result = (($tot / $msugars * 100) * 10) / 10;
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
1014 if ($result < 0)
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
1015 $result = 0;
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
1016 $this->Cell(50,5,sprintf("%.1f", $result)."%",0,0,'L',true);
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
1017 $this->Ln(7);
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
1018
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
1019 $coolingtype = array( '-', 'Dompelkoeler', 'Tegenstroomkoeler', 'Au bain marie', 'Laten afkoelen' );
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
1020 $this->SetX($this->TableX);
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
1021 $this->Cell(35,5,'Spoelwater temperatuur',0,0,'L',true);
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
1022 $this->Cell(50,5,sprintf("%.1f", $row['brew_sparge_temperature']).DEG.'C',0,0,'L',true);
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
1023 $this->Cell($vul,5,'',0,0,'L',false);
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
1024 $this->Cell(35,5,'Koel methode',0,0,'L',true);
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
1025 $this->Cell(50,5,$coolingtype[$row['brew_cooling_method']],0,0,'L',true);
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
1026 $this->Ln();
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
1027
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
1028 $spoelw = (floatval($row['boil_size']) - $infuse + ($mashkg * $my_grain_absorbtion) + floatval($row['eq_lauter_deadspace'])) * 1.03;
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
1029 $this->SetX($this->TableX);
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
1030 $this->Cell(35,5,'Spoelwater volume',0,0,'L',true);
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
1031 $this->Cell(50,5,sprintf("%.1f", $spoelw).' liter',0,0,'L',true);
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
1032 $this->Cell($vul,5,'',0,0,'L',false);
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
1033 $this->Cell(35,5,'Koel temperatuur',0,0,'L',true);
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
1034 $this->Cell(50,5,sprintf("%.1f", floatval($row['brew_cooling_to'])).DEG.'C',0,0,'L',true);
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
1035 $this->Ln();
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
1036
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
1037 $this->SetX($this->TableX);
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
1038 $this->Cell(35,5,'Spoelwater zuurgraad',0,0,'L',true);
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
1039 $this->Cell(50,5,sprintf("%.1f", $row['brew_sparge_ph']).' pH',0,0,'L',true);
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
1040 $this->Cell($vul,5,'',0,0,'L',false);
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
1041 $this->Cell(35,5,'Koel tijdsduur',0,0,'L',true);
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
1042 $this->Cell(50,5,sprintf("%.0f", floatval($row['brew_cooling_time'])).' minuten',0,0,'L',true);
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
1043 $this->Ln(7);
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
1044
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
1045 $this->SetX($this->TableX);
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
1046 $this->Cell(35,5,'Whirlpool +85'.DEG.'C',0,0,'L',true);
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
1047 $this->Cell(50,5,sprintf("%.0f", $row['brew_whirlpool9']).' minuten',0,0,'L',true);
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
1048 $this->Cell($vul,5,'',0,0,'L',false);
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
1049 $this->Cell(35,5,'Koeler & trub verlies',0,0,'L',true);
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
1050 $this->Cell(50,5,sprintf("%.1f", floatval($row['brew_fermenter_tcloss'])).' liter',0,0,'L',true);
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
1051 $this->Ln();
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
1052
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
1053 $this->SetX($this->TableX);
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
1054 $this->Cell(35,5,'Whirlpool 72..79'.DEG.'C',0,0,'L',true);
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
1055 $this->Cell(50,5,sprintf("%.0f", $row['brew_whirlpool7']).' minuten',0,0,'L',true);
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
1056 $this->Cell($vul,5,'',0,0,'L',false);
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
1057 $this->Cell(35,5,'Extra water in gistvat',0,0,'L',true);
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
1058 $this->Cell(50,5,sprintf("%.1f", floatval($row['brew_fermenter_extrawater'])).' liter',0,0,'L',true);
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
1059 $this->Ln();
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
1060
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
1061 $this->SetX($this->TableX);
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
1062 $this->Cell(35,5,'Whirlpool 60..66'.DEG.'C',0,0,'L',true);
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
1063 $this->Cell(50,5,sprintf("%.0f", $row['brew_whirlpool6']).' minuten',0,0,'L',true);
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
1064 $this->Cell($vul,5,'',0,0,'L',false);
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
1065 $this->Cell(35,5,'Volume naar gistvat',0,0,'L',true);
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
1066 $this->Cell(50,5,sprintf("%.1f", floatval($row['brew_fermenter_volume'])).' liter',0,0,'L',true);
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
1067 $this->Ln();
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
1068
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
1069 $this->SetX($this->TableX);
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
1070 $this->Cell(35,5,'Whirlpool koud',0,0,'L',true);
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
1071 $this->Cell(50,5,sprintf("%.0f", $row['brew_whirlpool2']).' minuten',0,0,'L',true);
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
1072 $this->Cell($vul,5,'',0,0,'L',false);
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
1073 $this->Cell(35,5,'Densiteit in gistvat',0,0,'L',true);
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
1074 $this->Cell(50,5,sprintf("%.3f", floatval($row['brew_fermenter_sg'])).' SG',0,0,'L',true);
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
1075 $this->Ln(7);
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
1076
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
1077 $aerationtype = array( 'Geen', 'Lucht', 'Zuurstof' );
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
1078 $this->SetX($this->TableX);
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
1079 $this->Cell(35,5,'Beluchten met',0,0,'L',true);
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
1080 $this->Cell(50,5,$aerationtype[$row['brew_aeration_type']],0,0,'L',true);
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
1081 $this->Cell($vul,5,'',0,0,'L',false);
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
1082 $this->Cell(35,5,'Kleur in gistvat',0,0,'L',true);
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
1083 $this->Cell(50,5,sprintf("%.0f", floatval($row['brew_fermenter_color'])).' EBC',0,0,'L',true);
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
1084 $this->Ln();
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
1085
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
1086 $this->SetX($this->TableX);
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
1087 $this->Cell(35,5,'Beluchten snelheid/tijd',0,0,'L',true);
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
1088 $this->Cell(50,5,$row['brew_aeration_speed'].'/'.$row['brew_aeration_time'],0,0,'L',true);
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
1089 $this->Cell($vul,5,'',0,0,'L',false);
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
1090 $this->Cell(35,5,'Bitterheid in gistvat',0,0,'L',true);
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
1091 $this->Cell(50,5,sprintf("%.0f", floatval($row['brew_fermenter_ibu'])).' IBU',0,0,'L',true);
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
1092 $this->Ln();
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
1093 }
165
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1094 }
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1095
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1096
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1097
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1098 class PDF extends PDF_MySQL_Table {
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1099 function Header() {
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1100 global $row;
240
a85c1d4c4d12 Depending on the product stage, more or less fields are saved in the database. Added begin of auto stage increase. Added missing inventory columns in the fermentables grid. New product wizzard now works with the indexed values. Product print works with indexed values and prepared for different print modules depending on the product stage.
Michiel Broek <mbroek@mbse.eu>
parents: 165
diff changeset
1101 global $prdate;
a85c1d4c4d12 Depending on the product stage, more or less fields are saved in the database. Added begin of auto stage increase. Added missing inventory columns in the fermentables grid. New product wizzard now works with the indexed values. Product print works with indexed values and prepared for different print modules depending on the product stage.
Michiel Broek <mbroek@mbse.eu>
parents: 165
diff changeset
1102 $stage = array( 'Plan', 'Wacht', 'Brouwen', 'Hoofdgisting', 'Nagisting', 'Lagering', 'Afvullen', 'Hergisten', 'Rijpen', 'Proeven', 'Gereed', 'Afgesloten' );
243
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents: 241
diff changeset
1103 $this->Image('images/logo.png',10,10,30);
165
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1104 // Title
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1105 $this->SetFont('Helvetica','B',18);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1106 $this->SetX(45);
243
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents: 241
diff changeset
1107 $this->Cell(0,8,$row['code'].' '.$row['name'],0,1,'L');
240
a85c1d4c4d12 Depending on the product stage, more or less fields are saved in the database. Added begin of auto stage increase. Added missing inventory columns in the fermentables grid. New product wizzard now works with the indexed values. Product print works with indexed values and prepared for different print modules depending on the product stage.
Michiel Broek <mbroek@mbse.eu>
parents: 165
diff changeset
1108 $this->Ln(1);
a85c1d4c4d12 Depending on the product stage, more or less fields are saved in the database. Added begin of auto stage increase. Added missing inventory columns in the fermentables grid. New product wizzard now works with the indexed values. Product print works with indexed values and prepared for different print modules depending on the product stage.
Michiel Broek <mbroek@mbse.eu>
parents: 165
diff changeset
1109 $this->SetFont('Helvetica','',10);
a85c1d4c4d12 Depending on the product stage, more or less fields are saved in the database. Added begin of auto stage increase. Added missing inventory columns in the fermentables grid. New product wizzard now works with the indexed values. Product print works with indexed values and prepared for different print modules depending on the product stage.
Michiel Broek <mbroek@mbse.eu>
parents: 165
diff changeset
1110 $this->SetX(45);
a85c1d4c4d12 Depending on the product stage, more or less fields are saved in the database. Added begin of auto stage increase. Added missing inventory columns in the fermentables grid. New product wizzard now works with the indexed values. Product print works with indexed values and prepared for different print modules depending on the product stage.
Michiel Broek <mbroek@mbse.eu>
parents: 165
diff changeset
1111 $this->Cell(17,5,'Datum:',0,0,'L');
a85c1d4c4d12 Depending on the product stage, more or less fields are saved in the database. Added begin of auto stage increase. Added missing inventory columns in the fermentables grid. New product wizzard now works with the indexed values. Product print works with indexed values and prepared for different print modules depending on the product stage.
Michiel Broek <mbroek@mbse.eu>
parents: 165
diff changeset
1112 $this->Cell(0,5,$prdate,0,1,'L');
a85c1d4c4d12 Depending on the product stage, more or less fields are saved in the database. Added begin of auto stage increase. Added missing inventory columns in the fermentables grid. New product wizzard now works with the indexed values. Product print works with indexed values and prepared for different print modules depending on the product stage.
Michiel Broek <mbroek@mbse.eu>
parents: 165
diff changeset
1113 $this->SetX(45);
a85c1d4c4d12 Depending on the product stage, more or less fields are saved in the database. Added begin of auto stage increase. Added missing inventory columns in the fermentables grid. New product wizzard now works with the indexed values. Product print works with indexed values and prepared for different print modules depending on the product stage.
Michiel Broek <mbroek@mbse.eu>
parents: 165
diff changeset
1114 $this->Cell(17,5,'Stijl:',0,0,'L');
a85c1d4c4d12 Depending on the product stage, more or less fields are saved in the database. Added begin of auto stage increase. Added missing inventory columns in the fermentables grid. New product wizzard now works with the indexed values. Product print works with indexed values and prepared for different print modules depending on the product stage.
Michiel Broek <mbroek@mbse.eu>
parents: 165
diff changeset
1115 $this->Cell(0,5,$row['st_name'],0,1,'L');
a85c1d4c4d12 Depending on the product stage, more or less fields are saved in the database. Added begin of auto stage increase. Added missing inventory columns in the fermentables grid. New product wizzard now works with the indexed values. Product print works with indexed values and prepared for different print modules depending on the product stage.
Michiel Broek <mbroek@mbse.eu>
parents: 165
diff changeset
1116 $this->SetX(45);
a85c1d4c4d12 Depending on the product stage, more or less fields are saved in the database. Added begin of auto stage increase. Added missing inventory columns in the fermentables grid. New product wizzard now works with the indexed values. Product print works with indexed values and prepared for different print modules depending on the product stage.
Michiel Broek <mbroek@mbse.eu>
parents: 165
diff changeset
1117 $this->Cell(17,5,'Fase:',0,0,'L');
a85c1d4c4d12 Depending on the product stage, more or less fields are saved in the database. Added begin of auto stage increase. Added missing inventory columns in the fermentables grid. New product wizzard now works with the indexed values. Product print works with indexed values and prepared for different print modules depending on the product stage.
Michiel Broek <mbroek@mbse.eu>
parents: 165
diff changeset
1118 $this->Cell(0,5,$stage[$row['stage']],0,1,'L');
a85c1d4c4d12 Depending on the product stage, more or less fields are saved in the database. Added begin of auto stage increase. Added missing inventory columns in the fermentables grid. New product wizzard now works with the indexed values. Product print works with indexed values and prepared for different print modules depending on the product stage.
Michiel Broek <mbroek@mbse.eu>
parents: 165
diff changeset
1119 $this->Ln(6);
165
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1120 // Ensure table header is printed
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1121 parent::Header();
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1122 }
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1123 }
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1124
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1125
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1126 /*
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1127 * Generate PDF from recipe data
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1128 */
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1129 $pdf = new PDF();
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1130 $pdf->AddPage();
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1131 $pdf->TableGlobal($row);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1132 $pdf->TableFermentables($row);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1133 $pdf->TableHops($row);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1134 $pdf->TableYeasts($row);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1135 $pdf->TableMiscs($row);
391
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
1136 $pdf->TableMashs($row);
165
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1137 $pdf->TableSummary($row);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1138 if (strlen($row['notes'])) {
391
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
1139 if ($pdf->GetY() > 200)
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
1140 $pdf->AddPage();
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
1141 else
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
1142 $pdf->Ln(10);
165
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1143 $pdf->SetFillColor(255,150,100);
391
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
1144 $pdf->SetFont('Helvetica','B',9);
165
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1145 $pdf->Cell(0, 5, 'Recept opmerkingen',0,0,'C',true);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1146 $pdf->Ln();
391
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
1147 $pdf->SetFont('Helvetica','',9);
165
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1148 $pdf->SetFillColor(210,245,255);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1149 $pdf->MultiCell(0,4,$row['notes'],0,'L',true);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1150 }
240
a85c1d4c4d12 Depending on the product stage, more or less fields are saved in the database. Added begin of auto stage increase. Added missing inventory columns in the fermentables grid. New product wizzard now works with the indexed values. Product print works with indexed values and prepared for different print modules depending on the product stage.
Michiel Broek <mbroek@mbse.eu>
parents: 165
diff changeset
1151
391
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
1152 if ($row['stage'] > 2) {
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
1153 $pdf->Brewday($row);
240
a85c1d4c4d12 Depending on the product stage, more or less fields are saved in the database. Added begin of auto stage increase. Added missing inventory columns in the fermentables grid. New product wizzard now works with the indexed values. Product print works with indexed values and prepared for different print modules depending on the product stage.
Michiel Broek <mbroek@mbse.eu>
parents: 165
diff changeset
1154 }
391
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
1155
240
a85c1d4c4d12 Depending on the product stage, more or less fields are saved in the database. Added begin of auto stage increase. Added missing inventory columns in the fermentables grid. New product wizzard now works with the indexed values. Product print works with indexed values and prepared for different print modules depending on the product stage.
Michiel Broek <mbroek@mbse.eu>
parents: 165
diff changeset
1156 if ($row['stage'] > 3) {
a85c1d4c4d12 Depending on the product stage, more or less fields are saved in the database. Added begin of auto stage increase. Added missing inventory columns in the fermentables grid. New product wizzard now works with the indexed values. Product print works with indexed values and prepared for different print modules depending on the product stage.
Michiel Broek <mbroek@mbse.eu>
parents: 165
diff changeset
1157 // Vergisting gegevens
a85c1d4c4d12 Depending on the product stage, more or less fields are saved in the database. Added begin of auto stage increase. Added missing inventory columns in the fermentables grid. New product wizzard now works with the indexed values. Product print works with indexed values and prepared for different print modules depending on the product stage.
Michiel Broek <mbroek@mbse.eu>
parents: 165
diff changeset
1158 }
a85c1d4c4d12 Depending on the product stage, more or less fields are saved in the database. Added begin of auto stage increase. Added missing inventory columns in the fermentables grid. New product wizzard now works with the indexed values. Product print works with indexed values and prepared for different print modules depending on the product stage.
Michiel Broek <mbroek@mbse.eu>
parents: 165
diff changeset
1159 if ($row['stage'] > 6) {
a85c1d4c4d12 Depending on the product stage, more or less fields are saved in the database. Added begin of auto stage increase. Added missing inventory columns in the fermentables grid. New product wizzard now works with the indexed values. Product print works with indexed values and prepared for different print modules depending on the product stage.
Michiel Broek <mbroek@mbse.eu>
parents: 165
diff changeset
1160 // Package report
a85c1d4c4d12 Depending on the product stage, more or less fields are saved in the database. Added begin of auto stage increase. Added missing inventory columns in the fermentables grid. New product wizzard now works with the indexed values. Product print works with indexed values and prepared for different print modules depending on the product stage.
Michiel Broek <mbroek@mbse.eu>
parents: 165
diff changeset
1161 }
a85c1d4c4d12 Depending on the product stage, more or less fields are saved in the database. Added begin of auto stage increase. Added missing inventory columns in the fermentables grid. New product wizzard now works with the indexed values. Product print works with indexed values and prepared for different print modules depending on the product stage.
Michiel Broek <mbroek@mbse.eu>
parents: 165
diff changeset
1162 if ($row['stage'] > 9) {
a85c1d4c4d12 Depending on the product stage, more or less fields are saved in the database. Added begin of auto stage increase. Added missing inventory columns in the fermentables grid. New product wizzard now works with the indexed values. Product print works with indexed values and prepared for different print modules depending on the product stage.
Michiel Broek <mbroek@mbse.eu>
parents: 165
diff changeset
1163 // Taste notes
a85c1d4c4d12 Depending on the product stage, more or less fields are saved in the database. Added begin of auto stage increase. Added missing inventory columns in the fermentables grid. New product wizzard now works with the indexed values. Product print works with indexed values and prepared for different print modules depending on the product stage.
Michiel Broek <mbroek@mbse.eu>
parents: 165
diff changeset
1164 }
391
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
1165 if ($row['stage'] == 1 || $row['stage'] == 2) {
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
1166 $pdf->Checklist($row);
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
1167 }
240
a85c1d4c4d12 Depending on the product stage, more or less fields are saved in the database. Added begin of auto stage increase. Added missing inventory columns in the fermentables grid. New product wizzard now works with the indexed values. Product print works with indexed values and prepared for different print modules depending on the product stage.
Michiel Broek <mbroek@mbse.eu>
parents: 165
diff changeset
1168
a85c1d4c4d12 Depending on the product stage, more or less fields are saved in the database. Added begin of auto stage increase. Added missing inventory columns in the fermentables grid. New product wizzard now works with the indexed values. Product print works with indexed values and prepared for different print modules depending on the product stage.
Michiel Broek <mbroek@mbse.eu>
parents: 165
diff changeset
1169
165
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1170 $pdf->Output();

mercurial