www/prod_print.php

Sat, 11 May 2019 17:25:58 +0200

author
Michiel Broek <mbroek@mbse.eu>
date
Sat, 11 May 2019 17:25:58 +0200
changeset 357
74d56bed75b9
parent 338
a51b858aacca
child 391
a1bcebc61ddd
permissions
-rw-r--r--

One more decimal digit for misc ingredients. Updated the README.

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
357
74d56bed75b9 One more decimal digit for misc ingredients. Updated the README.
Michiel Broek <mbroek@mbse.eu>
parents: 338
diff changeset
376 $hoeveel = sprintf("%.2f %s",$amount,$aiw ? "gr":"ml");
165
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;
338
a51b858aacca Fixed color and IBU method display in recipe and product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 319
diff changeset
407 $colormethod = array( 'Morey', 'Mosher', 'Daniels' );
a51b858aacca Fixed color and IBU method display in recipe and product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 319
diff changeset
408 $ibumethod = array( 'Tinseth', 'Rager', 'Daniels' );
165
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
409 /* 2 Columns */
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
410 $vul = $this->w - $this->rMargin - $this->lMargin - 170;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
411 $cMargin=$this->cMargin;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
412 $this->cMargin=2;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
413 $this->TableX=$this->lMargin;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
414 $this->SetFont('Helvetica','B',9);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
415 $this->SetX($this->TableX);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
416 $this->SetFillColor(255,150,100);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
417 $this->Cell(0, 5, 'Recept samenvatting',0,0,'C',true);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
418 $this->Ln();
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
419
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
420 $this->SetFont('Helvetica','',9);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
421 $this->SetFillColor(210,245,255);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
422
275
fb1e88f1c643 Better fg estimation in product print.
Michiel Broek <mbroek@mbse.eu>
parents: 247
diff changeset
423 $mashtime = 0;
fb1e88f1c643 Better fg estimation in product print.
Michiel Broek <mbroek@mbse.eu>
parents: 247
diff changeset
424 $mashtemp = 0;
fb1e88f1c643 Better fg estimation in product print.
Michiel Broek <mbroek@mbse.eu>
parents: 247
diff changeset
425 $mash_infuse = 0;
fb1e88f1c643 Better fg estimation in product print.
Michiel Broek <mbroek@mbse.eu>
parents: 247
diff changeset
426 $arr = json_decode($row['json_mashs'], true);
fb1e88f1c643 Better fg estimation in product print.
Michiel Broek <mbroek@mbse.eu>
parents: 247
diff changeset
427 foreach($arr as $item) {
fb1e88f1c643 Better fg estimation in product print.
Michiel Broek <mbroek@mbse.eu>
parents: 247
diff changeset
428 if ($item['step_type'] == 0) { // infusion
fb1e88f1c643 Better fg estimation in product print.
Michiel Broek <mbroek@mbse.eu>
parents: 247
diff changeset
429 $mash_infuse += floatval($item['step_infuse_amount']);
fb1e88f1c643 Better fg estimation in product print.
Michiel Broek <mbroek@mbse.eu>
parents: 247
diff changeset
430 }
fb1e88f1c643 Better fg estimation in product print.
Michiel Broek <mbroek@mbse.eu>
parents: 247
diff changeset
431 if ($item['step_temp'] < 75) { // ignore mashout temps
fb1e88f1c643 Better fg estimation in product print.
Michiel Broek <mbroek@mbse.eu>
parents: 247
diff changeset
432 $mashtime += floatval($item['step_time']);
fb1e88f1c643 Better fg estimation in product print.
Michiel Broek <mbroek@mbse.eu>
parents: 247
diff changeset
433 $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
434 }
fb1e88f1c643 Better fg estimation in product print.
Michiel Broek <mbroek@mbse.eu>
parents: 247
diff changeset
435 }
fb1e88f1c643 Better fg estimation in product print.
Michiel Broek <mbroek@mbse.eu>
parents: 247
diff changeset
436 $mashtemp = $mashtemp / $mashtime;
fb1e88f1c643 Better fg estimation in product print.
Michiel Broek <mbroek@mbse.eu>
parents: 247
diff changeset
437 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
438 $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
439 } else {
fb1e88f1c643 Better fg estimation in product print.
Michiel Broek <mbroek@mbse.eu>
parents: 247
diff changeset
440 $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
441 }
165
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
442
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
443 $this->SetX($this->TableX);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
444 $this->Cell(35,5,'Start SG',0,0,'L',true);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
445 $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
446 $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
447 $this->Cell($vul,5,'',0,0,'L',false);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
448 $this->Cell(35,5,'Eind SG',0,0,'L',true);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
449 $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
450 $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
451 $this->Ln();
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
452
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
453 $row['est_abv'] = abvol($row['est_og'], $row['est_fg']);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
454 $this->SetX($this->TableX);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
455 $this->Cell(35,5,'Geschat alcohol',0,0,'L',true);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
456 $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
457 $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
458 $this->Cell($vul,5,'',0,0,'L',false);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
459 $this->Cell(35,5,'CO2',0,0,'L',true);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
460 $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
461 $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
462 $this->Ln();
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
463
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
464 $row['est_color'] = kw_to_ebc($row['color_method'], $colorw);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
465 $this->SetX($this->TableX);
338
a51b858aacca Fixed color and IBU method display in recipe and product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 319
diff changeset
466 $this->Cell(35,5,'Kleur ('.$colormethod[$row['color_method']].')',0,0,'L',true);
165
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
467 $beercolor = ebc_to_color($row['est_color']);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
468 if ($row['est_color'] > 30)
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
469 $this->SetTextColor(250);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
470 $this->SetFillColor($beercolor[0],$beercolor[1],$beercolor[2]);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
471 $this->Cell(25,5,$row['est_color'].' EBC',0,0,'L',true);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
472 $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
473 $this->SetTextColor(0);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
474 $this->SetFillColor(210,245,255);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
475 $this->Cell($vul,5,'',0,0,'L',false);
338
a51b858aacca Fixed color and IBU method display in recipe and product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 319
diff changeset
476 $this->Cell(35,5,'Bitterheid ('.$ibumethod[$row['ibu_method']].')',0,0,'L',true);
165
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
477 $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
478 $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
479 $this->Ln();
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
480
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
481 $this->SetX($this->TableX);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
482 $cost_total = $cost_fermentables + $cost_hops + $cost_miscs + $cost_yeasts;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
483 $this->Cell(35,5,'Kosten',0,0,'L',true);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
484 $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
485 $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
486 $this->Ln(10);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
487
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
488
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
489 // Kostprijs per liter, calorieren
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
490 $this->cMargin=$cMargin;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
491 }
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
492
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating 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 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
494 $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
495 $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
496 $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
497 $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
498 }
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents: 241
diff changeset
499
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents: 241
diff changeset
500 function Checkline($text) {
276
08c824a5ffd8 Product print added yeast section.
Michiel Broek <mbroek@mbse.eu>
parents: 275
diff changeset
501 // $this->SetX(5);
08c824a5ffd8 Product print added yeast section.
Michiel Broek <mbroek@mbse.eu>
parents: 275
diff changeset
502 $this->Cell(2, 4,' ',0,0,'L',true);
08c824a5ffd8 Product print added yeast section.
Michiel Broek <mbroek@mbse.eu>
parents: 275
diff changeset
503 $this->Cell(4, 4,' ',1,0,'L',true);
08c824a5ffd8 Product print added yeast section.
Michiel Broek <mbroek@mbse.eu>
parents: 275
diff changeset
504 // $this->Rect(10,$this->GetY(),4,4);
08c824a5ffd8 Product print added yeast section.
Michiel Broek <mbroek@mbse.eu>
parents: 275
diff changeset
505 // $this->SetX(15);
08c824a5ffd8 Product print added yeast section.
Michiel Broek <mbroek@mbse.eu>
parents: 275
diff changeset
506 $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
507 $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
508 }
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating 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 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
511
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating 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 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
513 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
514 $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
515 $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
516
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents: 241
diff changeset
517 $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
518 $this->SetFillColor(255,255,255);
279
60d56f39e63e Added yeast starter instructions to the printed checklist
Michiel Broek <mbroek@mbse.eu>
parents: 277
diff changeset
519
60d56f39e63e Added yeast starter instructions to the printed checklist
Michiel Broek <mbroek@mbse.eu>
parents: 277
diff changeset
520 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
521 $this->Checkheader('Giststarter maken');
60d56f39e63e Added yeast starter instructions to the printed checklist
Michiel Broek <mbroek@mbse.eu>
parents: 277
diff changeset
522 $days = 0;
60d56f39e63e Added yeast starter instructions to the printed checklist
Michiel Broek <mbroek@mbse.eu>
parents: 277
diff changeset
523 $last = 0;
60d56f39e63e Added yeast starter instructions to the printed checklist
Michiel Broek <mbroek@mbse.eu>
parents: 277
diff changeset
524 for ($i = 1; $i < 5; $i++) {
60d56f39e63e Added yeast starter instructions to the printed checklist
Michiel Broek <mbroek@mbse.eu>
parents: 277
diff changeset
525 $pt = "prop".$i."_type";
60d56f39e63e Added yeast starter instructions to the printed checklist
Michiel Broek <mbroek@mbse.eu>
parents: 277
diff changeset
526 $pv = "prop".$i."_volume";
60d56f39e63e Added yeast starter instructions to the printed checklist
Michiel Broek <mbroek@mbse.eu>
parents: 277
diff changeset
527 if (floatval($row[$pv])) {
60d56f39e63e Added yeast starter instructions to the printed checklist
Michiel Broek <mbroek@mbse.eu>
parents: 277
diff changeset
528 $last = $i;
60d56f39e63e Added yeast starter instructions to the printed checklist
Michiel Broek <mbroek@mbse.eu>
parents: 277
diff changeset
529 if ($row[$pt] == 0)
60d56f39e63e Added yeast starter instructions to the printed checklist
Michiel Broek <mbroek@mbse.eu>
parents: 277
diff changeset
530 $days += 2;
60d56f39e63e Added yeast starter instructions to the printed checklist
Michiel Broek <mbroek@mbse.eu>
parents: 277
diff changeset
531 else if ($row[$pt] == 1)
60d56f39e63e Added yeast starter instructions to the printed checklist
Michiel Broek <mbroek@mbse.eu>
parents: 277
diff changeset
532 $days += 4;
60d56f39e63e Added yeast starter instructions to the printed checklist
Michiel Broek <mbroek@mbse.eu>
parents: 277
diff changeset
533 else
60d56f39e63e Added yeast starter instructions to the printed checklist
Michiel Broek <mbroek@mbse.eu>
parents: 277
diff changeset
534 $days += 6;
60d56f39e63e Added yeast starter instructions to the printed checklist
Michiel Broek <mbroek@mbse.eu>
parents: 277
diff changeset
535 }
60d56f39e63e Added yeast starter instructions to the printed checklist
Michiel Broek <mbroek@mbse.eu>
parents: 277
diff changeset
536 }
60d56f39e63e Added yeast starter instructions to the printed checklist
Michiel Broek <mbroek@mbse.eu>
parents: 277
diff changeset
537 $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
538 for ($i = 1; $i < 5; $i++) {
60d56f39e63e Added yeast starter instructions to the printed checklist
Michiel Broek <mbroek@mbse.eu>
parents: 277
diff changeset
539 $pt = "prop".$i."_type";
60d56f39e63e Added yeast starter instructions to the printed checklist
Michiel Broek <mbroek@mbse.eu>
parents: 277
diff changeset
540 $pv = "prop".$i."_volume";
60d56f39e63e Added yeast starter instructions to the printed checklist
Michiel Broek <mbroek@mbse.eu>
parents: 277
diff changeset
541 if (floatval($row[$pv])) {
60d56f39e63e Added yeast starter instructions to the printed checklist
Michiel Broek <mbroek@mbse.eu>
parents: 277
diff changeset
542 $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
543 $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
544 $this->Checkline($s);
60d56f39e63e Added yeast starter instructions to the printed checklist
Michiel Broek <mbroek@mbse.eu>
parents: 277
diff changeset
545 if ($row[$pt] == 0) {
60d56f39e63e Added yeast starter instructions to the printed checklist
Michiel Broek <mbroek@mbse.eu>
parents: 277
diff changeset
546 $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
547 } else if ($row[$pt] == 1) {
60d56f39e63e Added yeast starter instructions to the printed checklist
Michiel Broek <mbroek@mbse.eu>
parents: 277
diff changeset
548 $s = "enkele dagen regelmatig schudden";
60d56f39e63e Added yeast starter instructions to the printed checklist
Michiel Broek <mbroek@mbse.eu>
parents: 277
diff changeset
549 } else {
60d56f39e63e Added yeast starter instructions to the printed checklist
Michiel Broek <mbroek@mbse.eu>
parents: 277
diff changeset
550 $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
551 }
60d56f39e63e Added yeast starter instructions to the printed checklist
Michiel Broek <mbroek@mbse.eu>
parents: 277
diff changeset
552 $s .= " tot er voldoende gist is";
60d56f39e63e Added yeast starter instructions to the printed checklist
Michiel Broek <mbroek@mbse.eu>
parents: 277
diff changeset
553 $this->Checkline($s);
60d56f39e63e Added yeast starter instructions to the printed checklist
Michiel Broek <mbroek@mbse.eu>
parents: 277
diff changeset
554 if ($i < $last) {
60d56f39e63e Added yeast starter instructions to the printed checklist
Michiel Broek <mbroek@mbse.eu>
parents: 277
diff changeset
555 $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
556 $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
557 } else {
60d56f39e63e Added yeast starter instructions to the printed checklist
Michiel Broek <mbroek@mbse.eu>
parents: 277
diff changeset
558 $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
559 $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
560 }
60d56f39e63e Added yeast starter instructions to the printed checklist
Michiel Broek <mbroek@mbse.eu>
parents: 277
diff changeset
561 }
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 $this->Ln(5);
60d56f39e63e Added yeast starter instructions to the printed checklist
Michiel Broek <mbroek@mbse.eu>
parents: 277
diff changeset
564 }
60d56f39e63e Added yeast starter instructions to the printed checklist
Michiel Broek <mbroek@mbse.eu>
parents: 277
diff changeset
565
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
566 $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
567 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
568 $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
569 $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
570 }
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating 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 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
572 $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
573 $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
574 }
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents: 241
diff changeset
575 $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
576 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
577 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
578 $unit = ($item['m_amount_is_weight']) ? " gram ":" ml ";
08c824a5ffd8 Product print added yeast section.
Michiel Broek <mbroek@mbse.eu>
parents: 275
diff changeset
579 $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
580 $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
581 }
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating 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->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
584
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating 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 $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
586 $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
587 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
588 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
589 $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
590 $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
591 $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
592 $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
593 }
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating 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 }
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating 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 $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
596 $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
597
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents: 241
diff changeset
598 $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
599 $mvol = 0;
247
792b5ba77a1f The checklist now shows the pre-boil gravity.
Michiel Broek <mbroek@mbse.eu>
parents: 245
diff changeset
600 $msugars = 0; // mash sugars
279
60d56f39e63e Added yeast starter instructions to the printed checklist
Michiel Broek <mbroek@mbse.eu>
parents: 277
diff changeset
601 $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
602 $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
603 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
604 $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
605 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
606 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
607 $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
608 if ($loop == 0) {
319
60002c09f78a Fix checklist where there is more than one mash infusion step.
Michiel Broek <mbroek@mbse.eu>
parents: 293
diff changeset
609 if ($item['step_type'] == 0)
60002c09f78a Fix checklist where there is more than one mash infusion step.
Michiel Broek <mbroek@mbse.eu>
parents: 293
diff changeset
610 $l = $item['step_infuse_amount'];
60002c09f78a Fix checklist where there is more than one mash infusion step.
Michiel Broek <mbroek@mbse.eu>
parents: 293
diff changeset
611 else
60002c09f78a Fix checklist where there is more than one mash infusion step.
Michiel Broek <mbroek@mbse.eu>
parents: 293
diff changeset
612 $l = $mashwater;
60002c09f78a Fix checklist where there is more than one mash infusion step.
Michiel Broek <mbroek@mbse.eu>
parents: 293
diff changeset
613 $s = sprintf("%.1f",$l).' liter water opwarmen tot ';
243
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents: 241
diff changeset
614 $s .= sprintf("%.1f",$item['step_temp']).' '.DEG.'C (';
319
60002c09f78a Fix checklist where there is more than one mash infusion step.
Michiel Broek <mbroek@mbse.eu>
parents: 293
diff changeset
615 $s .= sprintf("%.1f",kettle_cm($l,$row['eq_tun_volume'],$row['eq_tun_height']));
243
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents: 241
diff changeset
616 $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
617 $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
618 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
619 $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
620 $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
621 $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
622 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
623 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
624 $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
625 $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
626 $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
627 }
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating 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 }
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents: 241
diff changeset
629 $this->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
630 $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
631 } 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
632 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
633 $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
634 } 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
635 $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
636 } 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
637 $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
638 }
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating 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 $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
640 $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
641 }
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating 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 $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
643 }
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating 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 $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
645 $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
646 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
647 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
648 $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
649 $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
650 $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
651 $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
652 }
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating 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 }
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating 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 $sugardensity = 1.611;
247
792b5ba77a1f The checklist now shows the pre-boil gravity.
Michiel Broek <mbroek@mbse.eu>
parents: 245
diff changeset
655 $v = $msugars / $sugardensity + $mvol;
792b5ba77a1f The checklist now shows the pre-boil gravity.
Michiel Broek <mbroek@mbse.eu>
parents: 245
diff changeset
656 $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
657 $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
658 $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
659 $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
660 $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
661 $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
662 }
279
60d56f39e63e Added yeast starter instructions to the printed checklist
Michiel Broek <mbroek@mbse.eu>
parents: 277
diff changeset
663 if ($this->GetY() > 200)
60d56f39e63e Added yeast starter instructions to the printed checklist
Michiel Broek <mbroek@mbse.eu>
parents: 277
diff changeset
664 $this->AddPage();
60d56f39e63e Added yeast starter instructions to the printed checklist
Michiel Broek <mbroek@mbse.eu>
parents: 277
diff changeset
665 else
60d56f39e63e Added yeast starter instructions to the printed checklist
Michiel Broek <mbroek@mbse.eu>
parents: 277
diff changeset
666 $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
667
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating 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 $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
669 $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
670 $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
671 $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
672 $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
673 $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
674 $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
675 $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
676 $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
677 $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
678 $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
679 $this->Checkline($s);
247
792b5ba77a1f The checklist now shows the pre-boil gravity.
Michiel Broek <mbroek@mbse.eu>
parents: 245
diff changeset
680 $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
681 $plato = sg_to_plato($pre_sg);
792b5ba77a1f The checklist now shows the pre-boil gravity.
Michiel Broek <mbroek@mbse.eu>
parents: 245
diff changeset
682 $brix = $plato * $my_brix_correction;
792b5ba77a1f The checklist now shows the pre-boil gravity.
Michiel Broek <mbroek@mbse.eu>
parents: 245
diff changeset
683 $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
684 $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
685 $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
686 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
687 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
688 $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
689 $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
690 $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
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 }
279
60d56f39e63e Added yeast starter instructions to the printed checklist
Michiel Broek <mbroek@mbse.eu>
parents: 277
diff changeset
693 if ($this->GetY() > 200)
60d56f39e63e Added yeast starter instructions to the printed checklist
Michiel Broek <mbroek@mbse.eu>
parents: 277
diff changeset
694 $this->AddPage();
60d56f39e63e Added yeast starter instructions to the printed checklist
Michiel Broek <mbroek@mbse.eu>
parents: 277
diff changeset
695 else
60d56f39e63e Added yeast starter instructions to the printed checklist
Michiel Broek <mbroek@mbse.eu>
parents: 277
diff changeset
696 $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
697
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating 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 $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
699 $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
700 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
701 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
702 $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
703 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
704 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
705 $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
706 $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
707 $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
708 }
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating 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 }
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents: 241
diff changeset
710 if ($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
711 $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
712 }
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating 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 $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
714 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
715 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
716 $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
717 $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
718 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
719 $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
720 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
721 $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
722 $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
723 }
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating 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 }
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating 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 $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
726 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
727 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
728 $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
729 $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
730 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
731 $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
732 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
733 $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
734 $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
735 }
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating 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 }
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating 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
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating 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 }
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating 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 = '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
740 $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
741 $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
742 $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
743 $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
744 $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
745 $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
746 $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
747 $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
748 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
749 $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
750 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
751 $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
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_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
754 $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
755 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
756 $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
757 $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
758 }
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating 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 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
760 $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
761 $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
762 $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
763 }
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating 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_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
765 $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
766 $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
767 $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
768 }
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating 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->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
770 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
771 $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
772 $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
773 }
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating 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 } 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
775 $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
776 $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
777 }
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating 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 $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
779 $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
780 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
781 $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
782 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
783 $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
784
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents: 241
diff changeset
785 $this->Checkheader('Gist enten');
276
08c824a5ffd8 Product print added yeast section.
Michiel Broek <mbroek@mbse.eu>
parents: 275
diff changeset
786 $dry = 0;
08c824a5ffd8 Product print added yeast section.
Michiel Broek <mbroek@mbse.eu>
parents: 275
diff changeset
787 $yeasts = json_decode($row['json_yeasts'], true);
08c824a5ffd8 Product print added yeast section.
Michiel Broek <mbroek@mbse.eu>
parents: 275
diff changeset
788 foreach ($yeasts as $item) {
08c824a5ffd8 Product print added yeast section.
Michiel Broek <mbroek@mbse.eu>
parents: 275
diff changeset
789 if ($item['y_use'] == 0) { // primary
08c824a5ffd8 Product print added yeast section.
Michiel Broek <mbroek@mbse.eu>
parents: 275
diff changeset
790 if ($item['y_form'] == 0) { // Liquid
08c824a5ffd8 Product print added yeast section.
Michiel Broek <mbroek@mbse.eu>
parents: 275
diff changeset
791 $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
792 } else if ($item['y_form'] == 1) { // Dry
08c824a5ffd8 Product print added yeast section.
Michiel Broek <mbroek@mbse.eu>
parents: 275
diff changeset
793 $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
794 $s .= ' gist';
08c824a5ffd8 Product print added yeast section.
Michiel Broek <mbroek@mbse.eu>
parents: 275
diff changeset
795 $dry += $item['y_amount']*10000;
08c824a5ffd8 Product print added yeast section.
Michiel Broek <mbroek@mbse.eu>
parents: 275
diff changeset
796 $this->Checkline($s);
08c824a5ffd8 Product print added yeast section.
Michiel Broek <mbroek@mbse.eu>
parents: 275
diff changeset
797 } else { // Slant/Culture/Frozen/Bottle
08c824a5ffd8 Product print added yeast section.
Michiel Broek <mbroek@mbse.eu>
parents: 275
diff changeset
798 $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
799 $this->Checkline($s);
08c824a5ffd8 Product print added yeast section.
Michiel Broek <mbroek@mbse.eu>
parents: 275
diff changeset
800 }
08c824a5ffd8 Product print added yeast section.
Michiel Broek <mbroek@mbse.eu>
parents: 275
diff changeset
801 }
08c824a5ffd8 Product print added yeast section.
Michiel Broek <mbroek@mbse.eu>
parents: 275
diff changeset
802 }
08c824a5ffd8 Product print added yeast section.
Michiel Broek <mbroek@mbse.eu>
parents: 275
diff changeset
803 if ($dry > 0) {
08c824a5ffd8 Product print added yeast section.
Michiel Broek <mbroek@mbse.eu>
parents: 275
diff changeset
804 $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
805 $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
806 $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
807 $this->Checkline(' gist toevoegen');
08c824a5ffd8 Product print added yeast section.
Michiel Broek <mbroek@mbse.eu>
parents: 275
diff changeset
808 $this->Checkline('Of');
08c824a5ffd8 Product print added yeast section.
Michiel Broek <mbroek@mbse.eu>
parents: 275
diff changeset
809 $this->Checkline(' gist rechtstreeks over het wort strooien');
08c824a5ffd8 Product print added yeast section.
Michiel Broek <mbroek@mbse.eu>
parents: 275
diff changeset
810 } else {
279
60d56f39e63e Added yeast starter instructions to the printed checklist
Michiel Broek <mbroek@mbse.eu>
parents: 277
diff changeset
811 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
812 $this->Checkline('giststarter toevoegen');
60d56f39e63e Added yeast starter instructions to the printed checklist
Michiel Broek <mbroek@mbse.eu>
parents: 277
diff changeset
813 else
60d56f39e63e Added yeast starter instructions to the printed checklist
Michiel Broek <mbroek@mbse.eu>
parents: 277
diff changeset
814 $this->Checkline('gist toevoegen');
276
08c824a5ffd8 Product print added yeast section.
Michiel Broek <mbroek@mbse.eu>
parents: 275
diff changeset
815 }
08c824a5ffd8 Product print added yeast section.
Michiel Broek <mbroek@mbse.eu>
parents: 275
diff changeset
816 if ($row['brew_fermenter_extrawater'] > 0)
08c824a5ffd8 Product print added yeast section.
Michiel Broek <mbroek@mbse.eu>
parents: 275
diff changeset
817 $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
818 if ($row['brew_aeration_type'] > 0) {
08c824a5ffd8 Product print added yeast section.
Michiel Broek <mbroek@mbse.eu>
parents: 275
diff changeset
819 $s = 'wort '.$row['brew_aeration_time'].' minuten beluchten met ';
08c824a5ffd8 Product print added yeast section.
Michiel Broek <mbroek@mbse.eu>
parents: 275
diff changeset
820 $s .= ($row['brew_aeration_type'] == 1) ? "lucht":"zuurstof";
08c824a5ffd8 Product print added yeast section.
Michiel Broek <mbroek@mbse.eu>
parents: 275
diff changeset
821 $this->Checkline($s);
08c824a5ffd8 Product print added yeast section.
Michiel Broek <mbroek@mbse.eu>
parents: 275
diff changeset
822 }
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
823 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
824 $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
825 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
826 $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
827
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents: 241
diff changeset
828 $this->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
829 $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
830
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents: 241
diff changeset
831 // '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
832 // '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
833 // 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
834
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents: 241
diff changeset
835 // '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
836 }
165
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
837 }
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
838
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
839
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
840
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
841 class PDF extends PDF_MySQL_Table {
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
842 function Header() {
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
843 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
844 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
845 $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
846 $this->Image('images/logo.png',10,10,30);
165
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
847 // Title
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
848 $this->SetFont('Helvetica','B',18);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
849 $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
850 $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
851 $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
852 $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
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,'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
855 $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
856 $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
857 $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
858 $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
859 $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
860 $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
861 $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
862 $this->Ln(6);
165
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
863 // Ensure table header is printed
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
864 parent::Header();
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 }
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
867
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
868
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
869 /*
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
870 * Generate PDF from recipe data
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
871 */
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
872 $pdf = new PDF();
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
873 $pdf->AddPage();
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
874 $pdf->TableGlobal($row);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
875 $pdf->TableFermentables($row);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
876 $pdf->TableHops($row);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
877 $pdf->TableYeasts($row);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
878 $pdf->TableMiscs($row);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
879 $pdf->TableSummary($row);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
880 if (strlen($row['notes'])) {
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
881 $pdf->SetFillColor(255,150,100);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
882 $pdf->Cell(0, 5, 'Recept opmerkingen',0,0,'C',true);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
883 $pdf->Ln();
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
884 $pdf->SetFillColor(210,245,255);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
885 $pdf->MultiCell(0,4,$row['notes'],0,'L',true);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
886 }
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
887
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
888 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
889 // 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
890 $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
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'] > 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
893 // 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
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'] > 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
896 // 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
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 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
899 // 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
900 }
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
901 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
902 // 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
903 }
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
904
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
905
165
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
906 $pdf->Output();

mercurial