www/prod_print.php

Mon, 25 Feb 2019 17:29:35 +0100

author
Michiel Broek <mbroek@mbse.eu>
date
Mon, 25 Feb 2019 17:29:35 +0100
changeset 293
db898ec73277
parent 289
4082c41f45e9
child 319
60002c09f78a
permissions
-rw-r--r--

Show yeast starter on printed page

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);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
101 $this->Ln(10);
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;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
116 $this->AddCol($vul,'Grondstof','L');
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
117 $this->AddCol(30,'Leverancier','L');
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
118 $this->AddCol(15,'EBC','R');
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
119 $this->AddCol(17,'Moment','L');
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
120 $this->AddCol(20,'Kg','R');
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
121 $this->AddCol(15,'Procent','R');
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
122 $this->AddCol(15,'Opbr.','R');
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
123 $this->AddCol(20,'Prijs','R');
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
124
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
125 $cMargin=$this->cMargin;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
126 $this->cMargin=2;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
127 $this->TableX=$this->lMargin;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
128 $this->TableHeader();
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
129 $this->ProcessingTable=true;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
130
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
131 $sugarsf = 0;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
132 $sugarsm = 0;
275
fb1e88f1c643 Better fg estimation in product print.
Michiel Broek <mbroek@mbse.eu>
parents: 247
diff changeset
133 $mashkg = 0;
165
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
134 $this->SetFont('Helvetica','',9);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
135 $this->SetFillColor(250, 195, 65);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
136 $arr = json_decode($row['json_fermentables'], true);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
137 foreach($arr as $item) { //foreach element in $arr
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
138 $name = iconv('UTF-8','windows-1252',$item['f_name']);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
139 $supplier = iconv('UTF-8','windows-1252',$item['f_supplier']);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
140 $amount = floatval($item['f_amount']);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
141 $costkg = floatval($item['f_cost']);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
142 $yield = floatval($item['f_yield']);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
143 $moisture = floatval($item['f_moisture']);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
144 $color = floatval($item['f_color']);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
145 $percent = floatval($item['f_percentage']);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
146
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
147 if ($item['f_type'] == 1) // Sugar
165
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
148 $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
149 if ($item['f_graintype'] == 2) // Crystal
165
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
150 $pCara += $percent;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
151
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
152 $cost = $amount * $costkg;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
153 $cost_fermentables += $cost;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
154 $total_fermentables += $amount;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
155 /* Calculate the amount of sugars */
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
156 $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
157 if ($item['f_added'] == 0) {
165
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
158 $d = floatval($row['efficiency']) / 100 * $d;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
159 $sugarsm += $d;
275
fb1e88f1c643 Better fg estimation in product print.
Michiel Broek <mbroek@mbse.eu>
parents: 247
diff changeset
160 $mashkg += $amount;
165
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
161 }
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
162 $sugarsf += $d;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
163 $colorw += ($amount * ebc_to_srm($color) / $row['batch_size']) * 8.34436;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
164
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
165 $this->Cell($vul,5,$name,0,0,'L',true);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
166 $this->Cell(30,5,$supplier,0,0,'L',true);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
167 $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
168 $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
169 $this->Cell(20,5,sprintf("%8.3f",$amount),0,0,'R',true);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
170 $this->Cell(15,5,sprintf("%.1f%%",$percent),0,0,'R',true);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
171 $this->Cell(15,5,sprintf("%.1f%%",$yield),0,0,'R',true);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
172 $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
173 $this->Ln();
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
174 }
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 $row['est_og'] = estimate_sg($sugarsf, floatval($row['batch_size']));
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
177 $preboil_sg = estimate_sg($sugarsm, floatval($row['boil_size']));
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
178 $this->SetFillColor(210,245,255);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
179 $this->Cell($vul+62,5,'',0,0,'L',false);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
180 $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
181 $this->Cell(30,5,'',0,0,'L',false);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
182 $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
183 $this->Ln(10);
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();
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
187 }
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 function TableHops($row) {
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
190 global $total_hops;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
191 global $total_ibus;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
192 global $cost_hops;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
193 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
194 $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
195 $hopuse = array( 'Maischen', 'First wort', 'Koken', 'Vlamuit', 'Whirlpool', 'Koudhop' );
165
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
196 $vul = $this->w - $this->rMargin - $this->lMargin - 135;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
197 $this->AddCol($vul,'Hop','L');
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
198 $this->AddCol(35,'Land','L');
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
199 $this->AddCol(15,'Soort','L');
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
200 $this->AddCol(20,'Moment','L');
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
201 $this->AddCol(15,'Alpha','R');
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
202 $this->AddCol(12,'IBU','R');
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
203 $this->AddCol(18,'Gram','R');
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
204 $this->AddCol(20,'Prijs','R');
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
205
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
206 $cMargin=$this->cMargin;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
207 $this->cMargin=2;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
208 $this->TableX=$this->lMargin;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
209 $this->TableHeader();
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
210 $this->ProcessingTable=true;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
211
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
212 $this->SetFont('Helvetica','',9);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
213 $this->SetFillColor(100, 250, 65);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
214
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
215 $arr = json_decode($row['json_hops'], true);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
216 foreach($arr as $item) { //foreach element in $arr
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
217 $name = iconv('UTF-8','windows-1252',$item['h_name']);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
218 $origin = iconv('UTF-8','windows-1252',$item['h_origin']);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
219 $amount = floatval($item['h_amount']) * 1000;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
220 $mass = $amount;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
221 $costkg = floatval($item['h_cost']);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
222 $time = floatval($item['h_time']);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
223 $alpha = floatval($item['h_alpha']);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
224
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
225 $cost = ($amount * $costkg) / 1000;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
226 $cost_hops += $cost;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
227 $total_hops += $amount;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
228
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
229 $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
230 if ($item['h_useat'] == 2) { // Boil
165
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
231 $moment = "Kook@".$time;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
232 }
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
233 $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
234 $total_ibus += $ibu;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
235
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
236 $this->Cell($vul,5,$name,0,0,'L',true);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
237 $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
238 $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
239 $this->Cell(20,5,$moment,0,0,'L',true);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
240 $this->Cell(15,5,sprintf("%.1f%%",$alpha),0,0,'R',true);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
241 $this->Cell(12,5,sprintf("%.1f",$ibu),0,0,'R',true);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
242 $this->Cell(18,5,sprintf("%.1f",$amount),0,0,'R',true);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
243 $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
244 $this->Ln();
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
245 }
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
246
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
247 $this->SetFillColor(210,245,255);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
248 $this->Cell($vul+85,5,'',0,0,'L',false);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
249 $this->Cell(12,5,sprintf("%.1f",$total_ibus),0,0,'R',true);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
250 $this->Cell(18,5,sprintf("%.1f",$total_hops),0,0,'R',true);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
251 $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
252 $this->Ln(10);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
253 $this->ProcessingTable=false;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
254 $this->cMargin=$cMargin;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
255 $this->aCols=array();
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
256 }
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
257
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
258 function TableYeasts($row) {
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
259 global $cost_yeasts;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
260 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
261 $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
262 $yeastuse = array( 'Hoofdgisting', 'Nagisting', 'Lagering', 'Bottelen' );
165
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
263 $vul = $this->w - $this->rMargin - $this->lMargin - 140;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
264 $this->AddCol(27,'Laboratorium','L');
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
265 $this->AddCol(18,'Product','L');
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
266 $this->AddCol($vul,'Gist','L');
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
267 $this->AddCol(20,'Gebruik','L');
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
268 $this->AddCol(15,'Attn','R');
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
269 $this->AddCol(22,'Vorm','L');
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
270 $this->AddCol(18,'Gram','R');
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
271 $this->AddCol(20,'Prijs','R');
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
272
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
273 $cMargin=$this->cMargin;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
274 $this->cMargin=2;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
275 $this->TableX=$this->lMargin;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
276 $this->TableHeader();
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
277 $this->ProcessingTable=true;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
278
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
279 $this->SetFont('Helvetica','',9);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
280 $this->SetFillColor(175, 175, 255);
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 $arr = json_decode($row['json_yeasts'], true);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
283 foreach($arr as $item) { //foreach element in $arr
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
284 $name = iconv('UTF-8','windows-1252',$item['y_name']);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
285 $laboratory = iconv('UTF-8','windows-1252',$item['y_laboratory']);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
286 $product_id = iconv('UTF-8','windows-1252',$item['y_product_id']);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
287 $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
288 $cost = floatval($item['y_amount']) * floatval($item['y_cost']);
165
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
289 $cost_yeasts += $cost;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
290
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 if ($item['y_use'] == 0) // Primary
165
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
292 $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
293 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
294 $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
295 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
296 $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
297 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
298 $amount = sprintf("%.0f",floatval($item['y_amount'])*1000)." ml";
165
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
299
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
300 $this->Cell(27,5,$laboratory,0,0,'L',true);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
301 $this->Cell(18,5,$product_id,0,0,'L',true);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
302 $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
303 $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
304 $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
305 $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
306 $this->Cell(18,5,$amount,0,0,'R',true);
165
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
307 $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
308 $this->Ln();
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
309 }
293
db898ec73277 Show yeast starter on printed page
Michiel Broek <mbroek@mbse.eu>
parents: 289
diff changeset
310 if ($row['starter_enable']) {
db898ec73277 Show yeast starter on printed page
Michiel Broek <mbroek@mbse.eu>
parents: 289
diff changeset
311 $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
312 if ($v) {
db898ec73277 Show yeast starter on printed page
Michiel Broek <mbroek@mbse.eu>
parents: 289
diff changeset
313 $this->Cell(45,5,'',0,0,'L',true);
db898ec73277 Show yeast starter on printed page
Michiel Broek <mbroek@mbse.eu>
parents: 289
diff changeset
314 $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
315 $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
316 $this->Cell(75,5,'',0,0,'L',true);
db898ec73277 Show yeast starter on printed page
Michiel Broek <mbroek@mbse.eu>
parents: 289
diff changeset
317 $this->Ln();
db898ec73277 Show yeast starter on printed page
Michiel Broek <mbroek@mbse.eu>
parents: 289
diff changeset
318 }
db898ec73277 Show yeast starter on printed page
Michiel Broek <mbroek@mbse.eu>
parents: 289
diff changeset
319 }
165
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
320
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
321 $this->SetFillColor(210,245,255);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
322 $this->Cell($vul+120,5,'',0,0,'L',false);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
323 $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
324 $this->Ln(10);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
325 $this->ProcessingTable=false;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
326 $this->cMargin=$cMargin;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
327 $this->aCols=array();
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
328 }
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
329
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
330 function TableMiscs($row) {
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
331 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
332 $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
333 $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
334 $vul = $this->w - $this->rMargin - $this->lMargin - 100;
165
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
335 $this->AddCol($vul,'Naam','L');
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
336 $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
337 $this->AddCol(30,'Gebruik','L');
165
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
338 $this->AddCol(20,'Hoeveel','R');
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
339 $this->AddCol(20,'Prijs','R');
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
340
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
341 $cMargin=$this->cMargin;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
342 $this->cMargin=2;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
343 $this->TableX=$this->lMargin;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
344 $this->TableHeader();
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
345 $this->ProcessingTable=true;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
346
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
347 $this->SetFont('Helvetica','',9);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
348 $this->SetFillColor(175, 175, 255);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
349
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
350 $arr = json_decode($row['json_miscs'], true);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
351 foreach($arr as $item) {
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
352 $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
353 $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
354 $use_use = $item['m_use_use'];
165
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
355 $amount = floatval($item['m_amount']) * 1000;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
356 $costg = floatval($item['m_cost']) / 1000;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
357 $time = floatval($item['m_time']);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
358 $aiw = $item['m_amount_is_weight'];
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
359 $cost = $amount * $costg;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
360 $cost_miscs += $cost;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
361
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
362 if ($type == 4) // Water agent
165
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
363 $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
364 else if ($type == 3) // Fining
165
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
365 $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
366 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
367 $this->SetFillColor(240,250,65);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
368 else
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
369 $this->SetFillColor(210,245,255);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
370
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 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
372 $gebruik = sprintf("%s %d min",$miscuse[$use_use],$time);
165
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
373 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
374 $gebruik = $miscuse[$use_use];
165
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
375
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
376 $hoeveel = sprintf("%.1f %s",$amount,$aiw ? "gr":"ml");
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
377 $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
378 $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
379 $this->Cell(30,5,$gebruik,0,0,'L',true);
165
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
380 $this->Cell(20,5,$hoeveel,0,0,'R',true);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
381 $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
382 $this->Ln();
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
383 }
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
384
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
385 $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
386 $this->Cell($vul+80,5,'',0,0,'L',false);
165
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
387 $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
388 $this->Ln(10);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
389
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
390 $this->ProcessingTable=false;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
391 $this->cMargin=$cMargin;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
392 $this->aCols=array();
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
393 }
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
394
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
395 // Watercolor $this->SetFillColor(120,255,250);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
396
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
397 function TableSummary($row) {
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
398 global $pSugar;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
399 global $pCara;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
400 global $svg;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
401 global $colorw;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
402 global $cost_fermentables;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
403 global $cost_hops;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
404 global $cost_miscs;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
405 global $cost_yeasts;
275
fb1e88f1c643 Better fg estimation in product print.
Michiel Broek <mbroek@mbse.eu>
parents: 247
diff changeset
406 global $mashkg;
165
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
407 /* 2 Columns */
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
408 $vul = $this->w - $this->rMargin - $this->lMargin - 170;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
409 $cMargin=$this->cMargin;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
410 $this->cMargin=2;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
411 $this->TableX=$this->lMargin;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
412 $this->SetFont('Helvetica','B',9);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
413 $this->SetX($this->TableX);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
414 $this->SetFillColor(255,150,100);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
415 $this->Cell(0, 5, 'Recept samenvatting',0,0,'C',true);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
416 $this->Ln();
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
417
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
418 $this->SetFont('Helvetica','',9);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
419 $this->SetFillColor(210,245,255);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
420
275
fb1e88f1c643 Better fg estimation in product print.
Michiel Broek <mbroek@mbse.eu>
parents: 247
diff changeset
421 $mashtime = 0;
fb1e88f1c643 Better fg estimation in product print.
Michiel Broek <mbroek@mbse.eu>
parents: 247
diff changeset
422 $mashtemp = 0;
fb1e88f1c643 Better fg estimation in product print.
Michiel Broek <mbroek@mbse.eu>
parents: 247
diff changeset
423 $mash_infuse = 0;
fb1e88f1c643 Better fg estimation in product print.
Michiel Broek <mbroek@mbse.eu>
parents: 247
diff changeset
424 $arr = json_decode($row['json_mashs'], true);
fb1e88f1c643 Better fg estimation in product print.
Michiel Broek <mbroek@mbse.eu>
parents: 247
diff changeset
425 foreach($arr as $item) {
fb1e88f1c643 Better fg estimation in product print.
Michiel Broek <mbroek@mbse.eu>
parents: 247
diff changeset
426 if ($item['step_type'] == 0) { // infusion
fb1e88f1c643 Better fg estimation in product print.
Michiel Broek <mbroek@mbse.eu>
parents: 247
diff changeset
427 $mash_infuse += floatval($item['step_infuse_amount']);
fb1e88f1c643 Better fg estimation in product print.
Michiel Broek <mbroek@mbse.eu>
parents: 247
diff changeset
428 }
fb1e88f1c643 Better fg estimation in product print.
Michiel Broek <mbroek@mbse.eu>
parents: 247
diff changeset
429 if ($item['step_temp'] < 75) { // ignore mashout temps
fb1e88f1c643 Better fg estimation in product print.
Michiel Broek <mbroek@mbse.eu>
parents: 247
diff changeset
430 $mashtime += floatval($item['step_time']);
fb1e88f1c643 Better fg estimation in product print.
Michiel Broek <mbroek@mbse.eu>
parents: 247
diff changeset
431 $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
432 }
fb1e88f1c643 Better fg estimation in product print.
Michiel Broek <mbroek@mbse.eu>
parents: 247
diff changeset
433 }
fb1e88f1c643 Better fg estimation in product print.
Michiel Broek <mbroek@mbse.eu>
parents: 247
diff changeset
434 $mashtemp = $mashtemp / $mashtime;
fb1e88f1c643 Better fg estimation in product print.
Michiel Broek <mbroek@mbse.eu>
parents: 247
diff changeset
435 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
436 $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
437 } else {
fb1e88f1c643 Better fg estimation in product print.
Michiel Broek <mbroek@mbse.eu>
parents: 247
diff changeset
438 $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
439 }
165
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
440
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
441 $this->SetX($this->TableX);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
442 $this->Cell(35,5,'Start SG',0,0,'L',true);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
443 $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
444 $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
445 $this->Cell($vul,5,'',0,0,'L',false);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
446 $this->Cell(35,5,'Eind SG',0,0,'L',true);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
447 $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
448 $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
449 $this->Ln();
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
450
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
451 $row['est_abv'] = abvol($row['est_og'], $row['est_fg']);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
452 $this->SetX($this->TableX);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
453 $this->Cell(35,5,'Geschat alcohol',0,0,'L',true);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
454 $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
455 $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
456 $this->Cell($vul,5,'',0,0,'L',false);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
457 $this->Cell(35,5,'CO2',0,0,'L',true);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
458 $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
459 $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
460 $this->Ln();
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
461
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
462 $row['est_color'] = kw_to_ebc($row['color_method'], $colorw);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
463 $this->SetX($this->TableX);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
464 $this->Cell(35,5,'Kleur ('.$row['color_method'].')',0,0,'L',true);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
465 $beercolor = ebc_to_color($row['est_color']);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
466 if ($row['est_color'] > 30)
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
467 $this->SetTextColor(250);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
468 $this->SetFillColor($beercolor[0],$beercolor[1],$beercolor[2]);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
469 $this->Cell(25,5,$row['est_color'].' EBC',0,0,'L',true);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
470 $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
471 $this->SetTextColor(0);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
472 $this->SetFillColor(210,245,255);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
473 $this->Cell($vul,5,'',0,0,'L',false);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
474 $this->Cell(35,5,'Bitterheid ('.$row['ibu_method'].')',0,0,'L',true);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
475 $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
476 $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
477 $this->Ln();
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
478
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
479 $this->SetX($this->TableX);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
480 $cost_total = $cost_fermentables + $cost_hops + $cost_miscs + $cost_yeasts;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
481 $this->Cell(35,5,'Kosten',0,0,'L',true);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
482 $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
483 $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
484 $this->Ln(10);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
485
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
486
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
487 // Kostprijs per liter, calorieren
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
488 $this->cMargin=$cMargin;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
489 }
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
490
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
491 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
492 $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
493 $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
494 $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
495 $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
496 }
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
497
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
498 function Checkline($text) {
276
08c824a5ffd8 Product print added yeast section.
Michiel Broek <mbroek@mbse.eu>
parents: 275
diff changeset
499 // $this->SetX(5);
08c824a5ffd8 Product print added yeast section.
Michiel Broek <mbroek@mbse.eu>
parents: 275
diff changeset
500 $this->Cell(2, 4,' ',0,0,'L',true);
08c824a5ffd8 Product print added yeast section.
Michiel Broek <mbroek@mbse.eu>
parents: 275
diff changeset
501 $this->Cell(4, 4,' ',1,0,'L',true);
08c824a5ffd8 Product print added yeast section.
Michiel Broek <mbroek@mbse.eu>
parents: 275
diff changeset
502 // $this->Rect(10,$this->GetY(),4,4);
08c824a5ffd8 Product print added yeast section.
Michiel Broek <mbroek@mbse.eu>
parents: 275
diff changeset
503 // $this->SetX(15);
08c824a5ffd8 Product print added yeast section.
Michiel Broek <mbroek@mbse.eu>
parents: 275
diff changeset
504 $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
505 $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
506 }
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
507
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
508 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
509
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
510 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
511 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
512 $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
513 $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
514
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
515 $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
516 $this->SetFillColor(255,255,255);
279
60d56f39e63e Added yeast starter instructions to the printed checklist
Michiel Broek <mbroek@mbse.eu>
parents: 277
diff changeset
517
60d56f39e63e Added yeast starter instructions to the printed checklist
Michiel Broek <mbroek@mbse.eu>
parents: 277
diff changeset
518 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
519 $this->Checkheader('Giststarter maken');
60d56f39e63e Added yeast starter instructions to the printed checklist
Michiel Broek <mbroek@mbse.eu>
parents: 277
diff changeset
520 $days = 0;
60d56f39e63e Added yeast starter instructions to the printed checklist
Michiel Broek <mbroek@mbse.eu>
parents: 277
diff changeset
521 $last = 0;
60d56f39e63e Added yeast starter instructions to the printed checklist
Michiel Broek <mbroek@mbse.eu>
parents: 277
diff changeset
522 for ($i = 1; $i < 5; $i++) {
60d56f39e63e Added yeast starter instructions to the printed checklist
Michiel Broek <mbroek@mbse.eu>
parents: 277
diff changeset
523 $pt = "prop".$i."_type";
60d56f39e63e Added yeast starter instructions to the printed checklist
Michiel Broek <mbroek@mbse.eu>
parents: 277
diff changeset
524 $pv = "prop".$i."_volume";
60d56f39e63e Added yeast starter instructions to the printed checklist
Michiel Broek <mbroek@mbse.eu>
parents: 277
diff changeset
525 if (floatval($row[$pv])) {
60d56f39e63e Added yeast starter instructions to the printed checklist
Michiel Broek <mbroek@mbse.eu>
parents: 277
diff changeset
526 $last = $i;
60d56f39e63e Added yeast starter instructions to the printed checklist
Michiel Broek <mbroek@mbse.eu>
parents: 277
diff changeset
527 if ($row[$pt] == 0)
60d56f39e63e Added yeast starter instructions to the printed checklist
Michiel Broek <mbroek@mbse.eu>
parents: 277
diff changeset
528 $days += 2;
60d56f39e63e Added yeast starter instructions to the printed checklist
Michiel Broek <mbroek@mbse.eu>
parents: 277
diff changeset
529 else if ($row[$pt] == 1)
60d56f39e63e Added yeast starter instructions to the printed checklist
Michiel Broek <mbroek@mbse.eu>
parents: 277
diff changeset
530 $days += 4;
60d56f39e63e Added yeast starter instructions to the printed checklist
Michiel Broek <mbroek@mbse.eu>
parents: 277
diff changeset
531 else
60d56f39e63e Added yeast starter instructions to the printed checklist
Michiel Broek <mbroek@mbse.eu>
parents: 277
diff changeset
532 $days += 6;
60d56f39e63e Added yeast starter instructions to the printed checklist
Michiel Broek <mbroek@mbse.eu>
parents: 277
diff changeset
533 }
60d56f39e63e Added yeast starter instructions to the printed checklist
Michiel Broek <mbroek@mbse.eu>
parents: 277
diff changeset
534 }
60d56f39e63e Added yeast starter instructions to the printed checklist
Michiel Broek <mbroek@mbse.eu>
parents: 277
diff changeset
535 $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
536 for ($i = 1; $i < 5; $i++) {
60d56f39e63e Added yeast starter instructions to the printed checklist
Michiel Broek <mbroek@mbse.eu>
parents: 277
diff changeset
537 $pt = "prop".$i."_type";
60d56f39e63e Added yeast starter instructions to the printed checklist
Michiel Broek <mbroek@mbse.eu>
parents: 277
diff changeset
538 $pv = "prop".$i."_volume";
60d56f39e63e Added yeast starter instructions to the printed checklist
Michiel Broek <mbroek@mbse.eu>
parents: 277
diff changeset
539 if (floatval($row[$pv])) {
60d56f39e63e Added yeast starter instructions to the printed checklist
Michiel Broek <mbroek@mbse.eu>
parents: 277
diff changeset
540 $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
541 $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
542 $this->Checkline($s);
60d56f39e63e Added yeast starter instructions to the printed checklist
Michiel Broek <mbroek@mbse.eu>
parents: 277
diff changeset
543 if ($row[$pt] == 0) {
60d56f39e63e Added yeast starter instructions to the printed checklist
Michiel Broek <mbroek@mbse.eu>
parents: 277
diff changeset
544 $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
545 } else if ($row[$pt] == 1) {
60d56f39e63e Added yeast starter instructions to the printed checklist
Michiel Broek <mbroek@mbse.eu>
parents: 277
diff changeset
546 $s = "enkele dagen regelmatig schudden";
60d56f39e63e Added yeast starter instructions to the printed checklist
Michiel Broek <mbroek@mbse.eu>
parents: 277
diff changeset
547 } else {
60d56f39e63e Added yeast starter instructions to the printed checklist
Michiel Broek <mbroek@mbse.eu>
parents: 277
diff changeset
548 $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
549 }
60d56f39e63e Added yeast starter instructions to the printed checklist
Michiel Broek <mbroek@mbse.eu>
parents: 277
diff changeset
550 $s .= " tot er voldoende gist is";
60d56f39e63e Added yeast starter instructions to the printed checklist
Michiel Broek <mbroek@mbse.eu>
parents: 277
diff changeset
551 $this->Checkline($s);
60d56f39e63e Added yeast starter instructions to the printed checklist
Michiel Broek <mbroek@mbse.eu>
parents: 277
diff changeset
552 if ($i < $last) {
60d56f39e63e Added yeast starter instructions to the printed checklist
Michiel Broek <mbroek@mbse.eu>
parents: 277
diff changeset
553 $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
554 $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
555 } else {
60d56f39e63e Added yeast starter instructions to the printed checklist
Michiel Broek <mbroek@mbse.eu>
parents: 277
diff changeset
556 $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
557 $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
558 }
60d56f39e63e Added yeast starter instructions to the printed checklist
Michiel Broek <mbroek@mbse.eu>
parents: 277
diff changeset
559 }
60d56f39e63e Added yeast starter instructions to the printed checklist
Michiel Broek <mbroek@mbse.eu>
parents: 277
diff changeset
560 }
60d56f39e63e Added yeast starter instructions to the printed checklist
Michiel Broek <mbroek@mbse.eu>
parents: 277
diff changeset
561 $this->Ln(5);
60d56f39e63e Added yeast starter instructions to the printed checklist
Michiel Broek <mbroek@mbse.eu>
parents: 277
diff changeset
562 }
60d56f39e63e Added yeast starter instructions to the printed checklist
Michiel Broek <mbroek@mbse.eu>
parents: 277
diff changeset
563
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
564 $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
565 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
566 $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
567 $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
568 }
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
569 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
570 $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
571 $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
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 $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
574 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
575 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
576 $unit = ($item['m_amount_is_weight']) ? " gram ":" ml ";
08c824a5ffd8 Product print added yeast section.
Michiel Broek <mbroek@mbse.eu>
parents: 275
diff changeset
577 $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
578 $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
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 }
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->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
582
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
583 $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
584 $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
585 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
586 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
587 $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
588 $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
589 $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
590 $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
591 }
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
592 }
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
593 $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
594 $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
595
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
596 $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
597 $mvol = 0;
247
792b5ba77a1f The checklist now shows the pre-boil gravity.
Michiel Broek <mbroek@mbse.eu>
parents: 245
diff changeset
598 $msugars = 0; // mash sugars
279
60d56f39e63e Added yeast starter instructions to the printed checklist
Michiel Broek <mbroek@mbse.eu>
parents: 277
diff changeset
599 $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
600 $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
601 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
602 $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
603 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
604 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
605 $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
606 if ($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
607 $s = sprintf("%.1f",$mashwater).' liter water opwarmen tot ';
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
608 $s .= sprintf("%.1f",$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
609 $s .= sprintf("%.1f",kettle_cm($mashwater,$row['eq_tun_volume'],$row['eq_tun_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
610 $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
611 $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
612 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
613 $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
614 $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
615 $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
616 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
617 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
618 $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
619 $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
620 $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
621 }
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
622 }
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
623 $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
624 $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
625 } 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
626 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
627 $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
628 } 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
629 $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
630 } 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
631 $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
632 }
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 $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
634 $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
635 }
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 $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
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 $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
639 $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
640 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
641 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
642 $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
643 $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
644 $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
645 $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
646 }
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 $sugardensity = 1.611;
247
792b5ba77a1f The checklist now shows the pre-boil gravity.
Michiel Broek <mbroek@mbse.eu>
parents: 245
diff changeset
649 $v = $msugars / $sugardensity + $mvol;
792b5ba77a1f The checklist now shows the pre-boil gravity.
Michiel Broek <mbroek@mbse.eu>
parents: 245
diff changeset
650 $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
651 $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
652 $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
653 $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
654 $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
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 }
279
60d56f39e63e Added yeast starter instructions to the printed checklist
Michiel Broek <mbroek@mbse.eu>
parents: 277
diff changeset
657 if ($this->GetY() > 200)
60d56f39e63e Added yeast starter instructions to the printed checklist
Michiel Broek <mbroek@mbse.eu>
parents: 277
diff changeset
658 $this->AddPage();
60d56f39e63e Added yeast starter instructions to the printed checklist
Michiel Broek <mbroek@mbse.eu>
parents: 277
diff changeset
659 else
60d56f39e63e Added yeast starter instructions to the printed checklist
Michiel Broek <mbroek@mbse.eu>
parents: 277
diff changeset
660 $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
661
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 $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
663 $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
664 $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
665 $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
666 $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
667 $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
668 $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
669 $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
670 $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
671 $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
672 $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
673 $this->Checkline($s);
247
792b5ba77a1f The checklist now shows the pre-boil gravity.
Michiel Broek <mbroek@mbse.eu>
parents: 245
diff changeset
674 $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
675 $plato = sg_to_plato($pre_sg);
792b5ba77a1f The checklist now shows the pre-boil gravity.
Michiel Broek <mbroek@mbse.eu>
parents: 245
diff changeset
676 $brix = $plato * $my_brix_correction;
792b5ba77a1f The checklist now shows the pre-boil gravity.
Michiel Broek <mbroek@mbse.eu>
parents: 245
diff changeset
677 $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
678 $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
679 $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
680 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
681 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
682 $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
683 $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
684 $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
685 }
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 }
279
60d56f39e63e Added yeast starter instructions to the printed checklist
Michiel Broek <mbroek@mbse.eu>
parents: 277
diff changeset
687 if ($this->GetY() > 200)
60d56f39e63e Added yeast starter instructions to the printed checklist
Michiel Broek <mbroek@mbse.eu>
parents: 277
diff changeset
688 $this->AddPage();
60d56f39e63e Added yeast starter instructions to the printed checklist
Michiel Broek <mbroek@mbse.eu>
parents: 277
diff changeset
689 else
60d56f39e63e Added yeast starter instructions to the printed checklist
Michiel Broek <mbroek@mbse.eu>
parents: 277
diff changeset
690 $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
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->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
693 $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
694 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
695 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
696 $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
697 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
698 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
699 $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
700 $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
701 $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
702 }
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 }
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 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
705 $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
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 $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
708 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
709 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
710 $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
711 $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
712 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
713 $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
714 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
715 $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
716 $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
717 }
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
718 }
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
719 $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
720 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
721 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
722 $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
723 $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
724 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
725 $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
726 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
727 $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
728 $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
729 }
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
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 }
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 = '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
734 $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
735 $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
736 $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
737 $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
738 $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
739 $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
740 $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
741 $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
742 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
743 $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
744 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
745 $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
746
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
747 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
748 $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
749 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
750 $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
751 $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
752 }
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 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
754 $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
755 $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
756 $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
757 }
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
758 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
759 $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
760 $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
761 $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
762 }
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 $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
764 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
765 $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
766 $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
767 }
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 } 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
769 $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
770 $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
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 $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
773 $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
774 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
775 $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
776 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
777 $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
778
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 $this->Checkheader('Gist enten');
276
08c824a5ffd8 Product print added yeast section.
Michiel Broek <mbroek@mbse.eu>
parents: 275
diff changeset
780 $dry = 0;
08c824a5ffd8 Product print added yeast section.
Michiel Broek <mbroek@mbse.eu>
parents: 275
diff changeset
781 $yeasts = json_decode($row['json_yeasts'], true);
08c824a5ffd8 Product print added yeast section.
Michiel Broek <mbroek@mbse.eu>
parents: 275
diff changeset
782 foreach ($yeasts as $item) {
08c824a5ffd8 Product print added yeast section.
Michiel Broek <mbroek@mbse.eu>
parents: 275
diff changeset
783 if ($item['y_use'] == 0) { // primary
08c824a5ffd8 Product print added yeast section.
Michiel Broek <mbroek@mbse.eu>
parents: 275
diff changeset
784 if ($item['y_form'] == 0) { // Liquid
08c824a5ffd8 Product print added yeast section.
Michiel Broek <mbroek@mbse.eu>
parents: 275
diff changeset
785 $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
786 } else if ($item['y_form'] == 1) { // Dry
08c824a5ffd8 Product print added yeast section.
Michiel Broek <mbroek@mbse.eu>
parents: 275
diff changeset
787 $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
788 $s .= ' gist';
08c824a5ffd8 Product print added yeast section.
Michiel Broek <mbroek@mbse.eu>
parents: 275
diff changeset
789 $dry += $item['y_amount']*10000;
08c824a5ffd8 Product print added yeast section.
Michiel Broek <mbroek@mbse.eu>
parents: 275
diff changeset
790 $this->Checkline($s);
08c824a5ffd8 Product print added yeast section.
Michiel Broek <mbroek@mbse.eu>
parents: 275
diff changeset
791 } else { // Slant/Culture/Frozen/Bottle
08c824a5ffd8 Product print added yeast section.
Michiel Broek <mbroek@mbse.eu>
parents: 275
diff changeset
792 $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
793 $this->Checkline($s);
08c824a5ffd8 Product print added yeast section.
Michiel Broek <mbroek@mbse.eu>
parents: 275
diff changeset
794 }
08c824a5ffd8 Product print added yeast section.
Michiel Broek <mbroek@mbse.eu>
parents: 275
diff changeset
795 }
08c824a5ffd8 Product print added yeast section.
Michiel Broek <mbroek@mbse.eu>
parents: 275
diff changeset
796 }
08c824a5ffd8 Product print added yeast section.
Michiel Broek <mbroek@mbse.eu>
parents: 275
diff changeset
797 if ($dry > 0) {
08c824a5ffd8 Product print added yeast section.
Michiel Broek <mbroek@mbse.eu>
parents: 275
diff changeset
798 $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
799 $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
800 $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
801 $this->Checkline(' gist toevoegen');
08c824a5ffd8 Product print added yeast section.
Michiel Broek <mbroek@mbse.eu>
parents: 275
diff changeset
802 $this->Checkline('Of');
08c824a5ffd8 Product print added yeast section.
Michiel Broek <mbroek@mbse.eu>
parents: 275
diff changeset
803 $this->Checkline(' gist rechtstreeks over het wort strooien');
08c824a5ffd8 Product print added yeast section.
Michiel Broek <mbroek@mbse.eu>
parents: 275
diff changeset
804 } else {
279
60d56f39e63e Added yeast starter instructions to the printed checklist
Michiel Broek <mbroek@mbse.eu>
parents: 277
diff changeset
805 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
806 $this->Checkline('giststarter toevoegen');
60d56f39e63e Added yeast starter instructions to the printed checklist
Michiel Broek <mbroek@mbse.eu>
parents: 277
diff changeset
807 else
60d56f39e63e Added yeast starter instructions to the printed checklist
Michiel Broek <mbroek@mbse.eu>
parents: 277
diff changeset
808 $this->Checkline('gist toevoegen');
276
08c824a5ffd8 Product print added yeast section.
Michiel Broek <mbroek@mbse.eu>
parents: 275
diff changeset
809 }
08c824a5ffd8 Product print added yeast section.
Michiel Broek <mbroek@mbse.eu>
parents: 275
diff changeset
810 if ($row['brew_fermenter_extrawater'] > 0)
08c824a5ffd8 Product print added yeast section.
Michiel Broek <mbroek@mbse.eu>
parents: 275
diff changeset
811 $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
812 if ($row['brew_aeration_type'] > 0) {
08c824a5ffd8 Product print added yeast section.
Michiel Broek <mbroek@mbse.eu>
parents: 275
diff changeset
813 $s = 'wort '.$row['brew_aeration_time'].' minuten beluchten met ';
08c824a5ffd8 Product print added yeast section.
Michiel Broek <mbroek@mbse.eu>
parents: 275
diff changeset
814 $s .= ($row['brew_aeration_type'] == 1) ? "lucht":"zuurstof";
08c824a5ffd8 Product print added yeast section.
Michiel Broek <mbroek@mbse.eu>
parents: 275
diff changeset
815 $this->Checkline($s);
08c824a5ffd8 Product print added yeast section.
Michiel Broek <mbroek@mbse.eu>
parents: 275
diff changeset
816 }
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
817 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
818 $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
819 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
820 $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
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 $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
823 $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
824
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 // '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
826 // '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
827 // 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
828
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 // '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
830 }
165
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
831 }
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
832
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
833
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
834
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
835 class PDF extends PDF_MySQL_Table {
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
836 function Header() {
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
837 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
838 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
839 $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
840 $this->Image('images/logo.png',10,10,30);
165
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
841 // Title
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
842 $this->SetFont('Helvetica','B',18);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
843 $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
844 $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
845 $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
846 $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
847 $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
848 $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
849 $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
850 $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
851 $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
852 $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
853 $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
854 $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
855 $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
856 $this->Ln(6);
165
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
857 // Ensure table header is printed
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
858 parent::Header();
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
859 }
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
860 }
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
861
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
862
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
863 /*
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
864 * Generate PDF from recipe data
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
865 */
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
866 $pdf = new PDF();
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
867 $pdf->AddPage();
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
868 $pdf->TableGlobal($row);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
869 $pdf->TableFermentables($row);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
870 $pdf->TableHops($row);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
871 $pdf->TableYeasts($row);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
872 $pdf->TableMiscs($row);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
873 $pdf->TableSummary($row);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
874 if (strlen($row['notes'])) {
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
875 $pdf->SetFillColor(255,150,100);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
876 $pdf->Cell(0, 5, 'Recept opmerkingen',0,0,'C',true);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
877 $pdf->Ln();
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
878 $pdf->SetFillColor(210,245,255);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
879 $pdf->MultiCell(0,4,$row['notes'],0,'L',true);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
880 }
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
881
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
882 if ($row['stage'] == 1 || $row['stage'] == 2) {
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
883 // Checklist
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
884 $pdf->Checklist($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
885 }
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
886 if ($row['stage'] > 2) {
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
887 // Brouw rapport
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
888 }
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
889 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
890 // 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
891 }
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
892 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
893 // 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
894 }
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
895 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
896 // 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
897 }
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
898
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
899
165
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
900 $pdf->Output();

mercurial