www/prod_print.php

Thu, 20 Jun 2019 22:14:42 +0200

author
Michiel Broek <mbroek@mbse.eu>
date
Thu, 20 Jun 2019 22:14:42 +0200
changeset 424
7d231014b301
parent 421
0bc45502144b
child 432
99dcd8488b62
permissions
-rw-r--r--

Added packaging and tasting to print product.

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);
424
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
36 $bottle_sugar = '';
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
37 $keg_sugar = '';
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
38 $bottle_sugar_amount = 0;
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
39 $keg_sugar_amount = 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
40
165
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
41
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
42 class PDF_MySQL_Table extends FPDF
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 protected $ProcessingTable=false;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
45 protected $aCols=array();
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
46 protected $TableX;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
47
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
48 function Header() {
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
49 // Print the table header if necessary
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
50 if ($this->ProcessingTable)
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
51 $this->TableHeader();
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
52 }
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
53
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
54 function TableHeader() {
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
55 $this->SetFont('Helvetica','B',9);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
56 $this->SetX($this->TableX);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
57 $this->SetFillColor(255,150,100);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
58 foreach($this->aCols as $col)
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
59 $this->Cell($col['w'],5,$col['c'],0,0,$col['a'],true);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
60 $this->Ln();
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 AddCol($width=-1, $caption='', $align='L') {
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
64 $this->aCols[]=array('c'=>$caption,'w'=>$width,'a'=>$align);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
65 }
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
66
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
67 function TableGlobal($row) {
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
68 /* 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
69 $recipetype = array( 'Extract', 'Deelmaisch', 'Mout' );
165
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
70 $vul = $this->w - $this->rMargin - $this->lMargin - 160;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
71 $cMargin=$this->cMargin;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
72 $this->cMargin=2;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
73 $this->TableX=$this->lMargin;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
74 $this->SetFont('Helvetica','B',9);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
75 $this->SetX($this->TableX);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
76 $this->SetFillColor(255,150,100);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
77 $this->Cell(0, 5, 'Recept overzicht',0,0,'C',true);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
78 $this->Ln();
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
79
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
80 $this->SetFont('Helvetica','',9);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
81 $this->SetFillColor(210,245,255);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
82
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
83 $this->SetX($this->TableX);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
84 $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
85 $this->Cell(45,5,$recipetype[$row['type']],0,0,'L',true);
165
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
86 $this->Cell($vul,5,'',0,0,'L',false);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
87 $this->Cell(35,5,'Batch grootte',0,0,'L',true);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
88 $this->Cell(45,5,$row['batch_size'].' liter',0,0,'L',true);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
89 $this->Ln();
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
90
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
91 $this->SetX($this->TableX);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
92 $this->Cell(35,5,'Kooktijd',0,0,'L',true);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
93 $this->Cell(45,5,$row['boil_time'].' minuten',0,0,'L',true);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
94 $this->Cell($vul,5,'',0,0,'L',false);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
95 $this->Cell(35,5,'Brouwzaal rendement',0,0,'L',true);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
96 $this->Cell(45,5,$row['efficiency'].' %',0,0,'L',true);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
97 $this->Ln();
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
98
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
99 $this->SetX($this->TableX);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
100 $this->Cell(35,5,'Bierstijl',0,0,'L',true);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
101 $this->Cell(45,5,$row['st_name'],0,0,'L',true);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
102 $this->Cell($vul,5,'',0,0,'L',false);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
103 $this->Cell(35,5,'Installatie',0,0,'L',true);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
104 $this->Cell(45,5,$row['eq_name'],0,0,'L',true);
391
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
105 $this->Ln();
165
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
106
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
107 $this->cMargin=$cMargin;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
108 }
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
109
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
110 function TableFermentables($row) {
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
111 global $cost_fermentables;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
112 global $total_fermentables;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
113 global $pSugar;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
114 global $pCara;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
115 global $colorw;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
116 global $preboil_sg;
275
fb1e88f1c643 Better fg estimation in product print.
Michiel Broek <mbroek@mbse.eu>
parents: 247
diff changeset
117 global $mashkg;
424
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
118 global $bottle_sugar;
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
119 global $bottle_sugar_amount;
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
120 global $keg_sugar;
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
121 global $keg_sugar_amount;
407
9281bbbf26a6 Added fermentablesugars dropdown table. The calcCarbonation function now works with the new dropdown lists. Selecting a priming sugar adds or updates the sugar in the fermentables table.
Michiel Broek <mbroek@mbse.eu>
parents: 398
diff changeset
122 $added = array( 'Maischen', 'Koken 10 min', 'Vergisten', 'Nagisten/lageren', 'Bottelen', 'Op fust' );
392
544d7d0183b2 Added 15 fields to the recipes table. Added 18 fields to the products table. These are calculated values that are now stored in the database so export programs can use these values without calculating them again. Product and recipe print have water and mash schedule added. Product print has brewday results added if the brewday is over. The ingredients layout changed in the product and recipe prints.
Michiel Broek <mbroek@mbse.eu>
parents: 391
diff changeset
123 $ftype = array( 'Mout', 'Suiker', 'Vloeibaar extract', 'Droog extract', 'Ongemout graan' );
544d7d0183b2 Added 15 fields to the recipes table. Added 18 fields to the products table. These are calculated values that are now stored in the database so export programs can use these values without calculating them again. Product and recipe print have water and mash schedule added. Product print has brewday results added if the brewday is over. The ingredients layout changed in the product and recipe prints.
Michiel Broek <mbroek@mbse.eu>
parents: 391
diff changeset
124 $mtype = array( 'Basismout', 'Geroosterde mout', 'Cara- of crystalmout', 'Geëeste mout', 'Zuurmout', 'Speciale mout', 'Geen mout' );
544d7d0183b2 Added 15 fields to the recipes table. Added 18 fields to the products table. These are calculated values that are now stored in the database so export programs can use these values without calculating them again. Product and recipe print have water and mash schedule added. Product print has brewday results added if the brewday is over. The ingredients layout changed in the product and recipe prints.
Michiel Broek <mbroek@mbse.eu>
parents: 391
diff changeset
125 $vul = $this->w - $this->rMargin - $this->lMargin - 125;
544d7d0183b2 Added 15 fields to the recipes table. Added 18 fields to the products table. These are calculated values that are now stored in the database so export programs can use these values without calculating them again. Product and recipe print have water and mash schedule added. Product print has brewday results added if the brewday is over. The ingredients layout changed in the product and recipe prints.
Michiel Broek <mbroek@mbse.eu>
parents: 391
diff changeset
126 $this->Ln();
544d7d0183b2 Added 15 fields to the recipes table. Added 18 fields to the products table. These are calculated values that are now stored in the database so export programs can use these values without calculating them again. Product and recipe print have water and mash schedule added. Product print has brewday results added if the brewday is over. The ingredients layout changed in the product and recipe prints.
Michiel Broek <mbroek@mbse.eu>
parents: 391
diff changeset
127 $this->AddCol($vul,'Mout, granen en suikers','L');
165
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
128 $this->AddCol(15,'Procent','R');
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
129 $this->AddCol(15,'Opbr.','R');
392
544d7d0183b2 Added 15 fields to the recipes table. Added 18 fields to the products table. These are calculated values that are now stored in the database so export programs can use these values without calculating them again. Product and recipe print have water and mash schedule added. Product print has brewday results added if the brewday is over. The ingredients layout changed in the product and recipe prints.
Michiel Broek <mbroek@mbse.eu>
parents: 391
diff changeset
130 $this->AddCol(25,'Soort', 'L');
544d7d0183b2 Added 15 fields to the recipes table. Added 18 fields to the products table. These are calculated values that are now stored in the database so export programs can use these values without calculating them again. Product and recipe print have water and mash schedule added. Product print has brewday results added if the brewday is over. The ingredients layout changed in the product and recipe prints.
Michiel Broek <mbroek@mbse.eu>
parents: 391
diff changeset
131 $this->AddCol(30,'Gebruik moment','L');
544d7d0183b2 Added 15 fields to the recipes table. Added 18 fields to the products table. These are calculated values that are now stored in the database so export programs can use these values without calculating them again. Product and recipe print have water and mash schedule added. Product print has brewday results added if the brewday is over. The ingredients layout changed in the product and recipe prints.
Michiel Broek <mbroek@mbse.eu>
parents: 391
diff changeset
132 $this->AddCol(20,'Hoeveel','R');
165
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
133 $this->AddCol(20,'Prijs','R');
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
134
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
135 $cMargin=$this->cMargin;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
136 $this->cMargin=2;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
137 $this->TableX=$this->lMargin;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
138 $this->TableHeader();
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
139 $this->ProcessingTable=true;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
140
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
141 $sugarsf = 0;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
142 $sugarsm = 0;
275
fb1e88f1c643 Better fg estimation in product print.
Michiel Broek <mbroek@mbse.eu>
parents: 247
diff changeset
143 $mashkg = 0;
165
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
144 $this->SetFont('Helvetica','',9);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
145 $this->SetFillColor(250, 195, 65);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
146 $arr = json_decode($row['json_fermentables'], true);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
147 foreach($arr as $item) { //foreach element in $arr
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
148 $name = iconv('UTF-8','windows-1252',$item['f_name']);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
149 $supplier = iconv('UTF-8','windows-1252',$item['f_supplier']);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
150 $amount = floatval($item['f_amount']);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
151 $costkg = floatval($item['f_cost']);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
152 $yield = floatval($item['f_yield']);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
153 $moisture = floatval($item['f_moisture']);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
154 $color = floatval($item['f_color']);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
155 $percent = floatval($item['f_percentage']);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
156
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_type'] == 1) // Sugar
165
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
158 $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
159 if ($item['f_graintype'] == 2) // Crystal
165
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
160 $pCara += $percent;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
161
392
544d7d0183b2 Added 15 fields to the recipes table. Added 18 fields to the products table. These are calculated values that are now stored in the database so export programs can use these values without calculating them again. Product and recipe print have water and mash schedule added. Product print has brewday results added if the brewday is over. The ingredients layout changed in the product and recipe prints.
Michiel Broek <mbroek@mbse.eu>
parents: 391
diff changeset
162 if ($item['f_type'] == 0)
544d7d0183b2 Added 15 fields to the recipes table. Added 18 fields to the products table. These are calculated values that are now stored in the database so export programs can use these values without calculating them again. Product and recipe print have water and mash schedule added. Product print has brewday results added if the brewday is over. The ingredients layout changed in the product and recipe prints.
Michiel Broek <mbroek@mbse.eu>
parents: 391
diff changeset
163 $soort = iconv('UTF-8','windows-1252',$mtype[$item['f_graintype']]);
544d7d0183b2 Added 15 fields to the recipes table. Added 18 fields to the products table. These are calculated values that are now stored in the database so export programs can use these values without calculating them again. Product and recipe print have water and mash schedule added. Product print has brewday results added if the brewday is over. The ingredients layout changed in the product and recipe prints.
Michiel Broek <mbroek@mbse.eu>
parents: 391
diff changeset
164 else
544d7d0183b2 Added 15 fields to the recipes table. Added 18 fields to the products table. These are calculated values that are now stored in the database so export programs can use these values without calculating them again. Product and recipe print have water and mash schedule added. Product print has brewday results added if the brewday is over. The ingredients layout changed in the product and recipe prints.
Michiel Broek <mbroek@mbse.eu>
parents: 391
diff changeset
165 $soort = iconv('UTF-8','windows-1252',$ftype[$item['f_type']]);
544d7d0183b2 Added 15 fields to the recipes table. Added 18 fields to the products table. These are calculated values that are now stored in the database so export programs can use these values without calculating them again. Product and recipe print have water and mash schedule added. Product print has brewday results added if the brewday is over. The ingredients layout changed in the product and recipe prints.
Michiel Broek <mbroek@mbse.eu>
parents: 391
diff changeset
166
424
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
167 if ($item['f_added'] == 4) {
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
168 $bottle_sugar = $name;
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
169 $bottle_sugar_amount = $amount;
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
170 }
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
171 if ($item['f_added'] == 5) {
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
172 $keg_sugar = $name;
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
173 $keg_sugar_amount = $amount;
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
174 }
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
175
165
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
176 $cost = $amount * $costkg;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
177 $cost_fermentables += $cost;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
178 $total_fermentables += $amount;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
179 /* Calculate the amount of sugars */
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
180 $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
181 if ($item['f_added'] == 0) {
165
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
182 $d = floatval($row['efficiency']) / 100 * $d;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
183 $sugarsm += $d;
275
fb1e88f1c643 Better fg estimation in product print.
Michiel Broek <mbroek@mbse.eu>
parents: 247
diff changeset
184 $mashkg += $amount;
165
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
185 }
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
186 $sugarsf += $d;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
187 $colorw += ($amount * ebc_to_srm($color) / $row['batch_size']) * 8.34436;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
188
392
544d7d0183b2 Added 15 fields to the recipes table. Added 18 fields to the products table. These are calculated values that are now stored in the database so export programs can use these values without calculating them again. Product and recipe print have water and mash schedule added. Product print has brewday results added if the brewday is over. The ingredients layout changed in the product and recipe prints.
Michiel Broek <mbroek@mbse.eu>
parents: 391
diff changeset
189 if ($amount > 100)
544d7d0183b2 Added 15 fields to the recipes table. Added 18 fields to the products table. These are calculated values that are now stored in the database so export programs can use these values without calculating them again. Product and recipe print have water and mash schedule added. Product print has brewday results added if the brewday is over. The ingredients layout changed in the product and recipe prints.
Michiel Broek <mbroek@mbse.eu>
parents: 391
diff changeset
190 $amount = sprintf("%.1f",$amount).' kg';
544d7d0183b2 Added 15 fields to the recipes table. Added 18 fields to the products table. These are calculated values that are now stored in the database so export programs can use these values without calculating them again. Product and recipe print have water and mash schedule added. Product print has brewday results added if the brewday is over. The ingredients layout changed in the product and recipe prints.
Michiel Broek <mbroek@mbse.eu>
parents: 391
diff changeset
191 else if ($amount > 10)
544d7d0183b2 Added 15 fields to the recipes table. Added 18 fields to the products table. These are calculated values that are now stored in the database so export programs can use these values without calculating them again. Product and recipe print have water and mash schedule added. Product print has brewday results added if the brewday is over. The ingredients layout changed in the product and recipe prints.
Michiel Broek <mbroek@mbse.eu>
parents: 391
diff changeset
192 $amount = sprintf("%.2f",$amount).' kg';
544d7d0183b2 Added 15 fields to the recipes table. Added 18 fields to the products table. These are calculated values that are now stored in the database so export programs can use these values without calculating them again. Product and recipe print have water and mash schedule added. Product print has brewday results added if the brewday is over. The ingredients layout changed in the product and recipe prints.
Michiel Broek <mbroek@mbse.eu>
parents: 391
diff changeset
193 else
544d7d0183b2 Added 15 fields to the recipes table. Added 18 fields to the products table. These are calculated values that are now stored in the database so export programs can use these values without calculating them again. Product and recipe print have water and mash schedule added. Product print has brewday results added if the brewday is over. The ingredients layout changed in the product and recipe prints.
Michiel Broek <mbroek@mbse.eu>
parents: 391
diff changeset
194 $amount = sprintf("%.0f",$amount * 1000).' gr';
544d7d0183b2 Added 15 fields to the recipes table. Added 18 fields to the products table. These are calculated values that are now stored in the database so export programs can use these values without calculating them again. Product and recipe print have water and mash schedule added. Product print has brewday results added if the brewday is over. The ingredients layout changed in the product and recipe prints.
Michiel Broek <mbroek@mbse.eu>
parents: 391
diff changeset
195 $this->Cell($vul,5,$name.' ('.$supplier.') '.sprintf("%.0f",$color).' EBC',0,0,'L',true);
165
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
196 $this->Cell(15,5,sprintf("%.1f%%",$percent),0,0,'R',true);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
197 $this->Cell(15,5,sprintf("%.1f%%",$yield),0,0,'R',true);
392
544d7d0183b2 Added 15 fields to the recipes table. Added 18 fields to the products table. These are calculated values that are now stored in the database so export programs can use these values without calculating them again. Product and recipe print have water and mash schedule added. Product print has brewday results added if the brewday is over. The ingredients layout changed in the product and recipe prints.
Michiel Broek <mbroek@mbse.eu>
parents: 391
diff changeset
198 $this->Cell(25,5,$soort,0,0,'L',true);
544d7d0183b2 Added 15 fields to the recipes table. Added 18 fields to the products table. These are calculated values that are now stored in the database so export programs can use these values without calculating them again. Product and recipe print have water and mash schedule added. Product print has brewday results added if the brewday is over. The ingredients layout changed in the product and recipe prints.
Michiel Broek <mbroek@mbse.eu>
parents: 391
diff changeset
199 $this->Cell(30,5,$added[$item['f_added']],0,0,'L',true);
544d7d0183b2 Added 15 fields to the recipes table. Added 18 fields to the products table. These are calculated values that are now stored in the database so export programs can use these values without calculating them again. Product and recipe print have water and mash schedule added. Product print has brewday results added if the brewday is over. The ingredients layout changed in the product and recipe prints.
Michiel Broek <mbroek@mbse.eu>
parents: 391
diff changeset
200 $this->Cell(20,5,$amount,0,0,'R',true);
544d7d0183b2 Added 15 fields to the recipes table. Added 18 fields to the products table. These are calculated values that are now stored in the database so export programs can use these values without calculating them again. Product and recipe print have water and mash schedule added. Product print has brewday results added if the brewday is over. The ingredients layout changed in the product and recipe prints.
Michiel Broek <mbroek@mbse.eu>
parents: 391
diff changeset
201 $this->Cell(20,5,sprintf("%.3f",$cost).EURO,0,0,'R',true);
165
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
202 $this->Ln();
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
203 }
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
204
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
205 $row['est_og'] = estimate_sg($sugarsf, floatval($row['batch_size']));
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
206 $preboil_sg = estimate_sg($sugarsm, floatval($row['boil_size']));
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
207 $this->SetFillColor(210,245,255);
392
544d7d0183b2 Added 15 fields to the recipes table. Added 18 fields to the products table. These are calculated values that are now stored in the database so export programs can use these values without calculating them again. Product and recipe print have water and mash schedule added. Product print has brewday results added if the brewday is over. The ingredients layout changed in the product and recipe prints.
Michiel Broek <mbroek@mbse.eu>
parents: 391
diff changeset
208 $this->Cell($vul+105,5,'',0,0,'L',false);
544d7d0183b2 Added 15 fields to the recipes table. Added 18 fields to the products table. These are calculated values that are now stored in the database so export programs can use these values without calculating them again. Product and recipe print have water and mash schedule added. Product print has brewday results added if the brewday is over. The ingredients layout changed in the product and recipe prints.
Michiel Broek <mbroek@mbse.eu>
parents: 391
diff changeset
209 $this->Cell(20,5,sprintf("%.3f",$cost_fermentables).EURO,0,0,'R',true);
165
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
210 $this->ProcessingTable=false;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
211 $this->cMargin=$cMargin;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
212 $this->aCols=array();
391
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
213 $this->Ln();
165
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
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
216 function TableHops($row) {
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
217 global $total_hops;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
218 global $total_ibus;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
219 global $cost_hops;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
220 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
221 $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
222 $hopuse = array( 'Maischen', 'First wort', 'Koken', 'Vlamuit', 'Whirlpool', 'Koudhop' );
392
544d7d0183b2 Added 15 fields to the recipes table. Added 18 fields to the products table. These are calculated values that are now stored in the database so export programs can use these values without calculating them again. Product and recipe print have water and mash schedule added. Product print has brewday results added if the brewday is over. The ingredients layout changed in the product and recipe prints.
Michiel Broek <mbroek@mbse.eu>
parents: 391
diff changeset
223 $vul = $this->w - $this->rMargin - $this->lMargin - 122;
391
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
224 $this->Ln();
165
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
225 $this->AddCol($vul,'Hop','L');
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
226 $this->AddCol(15,'Alpha','R');
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
227 $this->AddCol(12,'IBU','R');
392
544d7d0183b2 Added 15 fields to the recipes table. Added 18 fields to the products table. These are calculated values that are now stored in the database so export programs can use these values without calculating them again. Product and recipe print have water and mash schedule added. Product print has brewday results added if the brewday is over. The ingredients layout changed in the product and recipe prints.
Michiel Broek <mbroek@mbse.eu>
parents: 391
diff changeset
228 $this->AddCol(25,'Soort','L');
544d7d0183b2 Added 15 fields to the recipes table. Added 18 fields to the products table. These are calculated values that are now stored in the database so export programs can use these values without calculating them again. Product and recipe print have water and mash schedule added. Product print has brewday results added if the brewday is over. The ingredients layout changed in the product and recipe prints.
Michiel Broek <mbroek@mbse.eu>
parents: 391
diff changeset
229 $this->AddCol(30,'Gebruik moment','L');
544d7d0183b2 Added 15 fields to the recipes table. Added 18 fields to the products table. These are calculated values that are now stored in the database so export programs can use these values without calculating them again. Product and recipe print have water and mash schedule added. Product print has brewday results added if the brewday is over. The ingredients layout changed in the product and recipe prints.
Michiel Broek <mbroek@mbse.eu>
parents: 391
diff changeset
230 $this->AddCol(20,'Hoeveel','R');
165
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
231 $this->AddCol(20,'Prijs','R');
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
232
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
233 $cMargin=$this->cMargin;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
234 $this->cMargin=2;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
235 $this->TableX=$this->lMargin;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
236 $this->TableHeader();
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
237 $this->ProcessingTable=true;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
238
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
239 $this->SetFont('Helvetica','',9);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
240 $this->SetFillColor(100, 250, 65);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
241
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
242 $arr = json_decode($row['json_hops'], true);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
243 foreach($arr as $item) { //foreach element in $arr
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
244 $name = iconv('UTF-8','windows-1252',$item['h_name']);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
245 $origin = iconv('UTF-8','windows-1252',$item['h_origin']);
392
544d7d0183b2 Added 15 fields to the recipes table. Added 18 fields to the products table. These are calculated values that are now stored in the database so export programs can use these values without calculating them again. Product and recipe print have water and mash schedule added. Product print has brewday results added if the brewday is over. The ingredients layout changed in the product and recipe prints.
Michiel Broek <mbroek@mbse.eu>
parents: 391
diff changeset
246 $amount = floatval($item['h_amount']);
544d7d0183b2 Added 15 fields to the recipes table. Added 18 fields to the products table. These are calculated values that are now stored in the database so export programs can use these values without calculating them again. Product and recipe print have water and mash schedule added. Product print has brewday results added if the brewday is over. The ingredients layout changed in the product and recipe prints.
Michiel Broek <mbroek@mbse.eu>
parents: 391
diff changeset
247 $mass = $amount * 1000;
165
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
248 $costkg = floatval($item['h_cost']);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
249 $time = floatval($item['h_time']);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
250 $alpha = floatval($item['h_alpha']);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
251
392
544d7d0183b2 Added 15 fields to the recipes table. Added 18 fields to the products table. These are calculated values that are now stored in the database so export programs can use these values without calculating them again. Product and recipe print have water and mash schedule added. Product print has brewday results added if the brewday is over. The ingredients layout changed in the product and recipe prints.
Michiel Broek <mbroek@mbse.eu>
parents: 391
diff changeset
252 $cost = ($amount * $costkg);
165
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
253 $cost_hops += $cost;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
254 $total_hops += $amount;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
255
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
256 $moment = $hopuse[$item['h_useat']];
396
804800d8e885 Added console logging in the grid write callback functions. Removed grid sorting, it is done on the server side. Alert popup for block row edit functions. Better grid live updates. In recipe and product print show the whirlpool time. The checklist now shows misc ingredients added in the mash. Show hops added in the whirlpool. Most ingredient names are now quoted.
Michiel Broek <mbroek@mbse.eu>
parents: 392
diff changeset
257 if (($item['h_useat'] == 2) || ($item['h_useat'] == 4)) { // Boil or Whirlpool
804800d8e885 Added console logging in the grid write callback functions. Removed grid sorting, it is done on the server side. Alert popup for block row edit functions. Better grid live updates. In recipe and product print show the whirlpool time. The checklist now shows misc ingredients added in the mash. Show hops added in the whirlpool. Most ingredient names are now quoted.
Michiel Broek <mbroek@mbse.eu>
parents: 392
diff changeset
258 $moment = $hopuse[$item['h_useat']].' '.$time." min";
392
544d7d0183b2 Added 15 fields to the recipes table. Added 18 fields to the products table. These are calculated values that are now stored in the database so export programs can use these values without calculating them again. Product and recipe print have water and mash schedule added. Product print has brewday results added if the brewday is over. The ingredients layout changed in the product and recipe prints.
Michiel Broek <mbroek@mbse.eu>
parents: 391
diff changeset
259 } else if ($item['h_useat'] == 5) { // Dryhop
396
804800d8e885 Added console logging in the grid write callback functions. Removed grid sorting, it is done on the server side. Alert popup for block row edit functions. Better grid live updates. In recipe and product print show the whirlpool time. The checklist now shows misc ingredients added in the mash. Show hops added in the whirlpool. Most ingredient names are now quoted.
Michiel Broek <mbroek@mbse.eu>
parents: 392
diff changeset
260 $moment = $hopuse[$item['h_useat']].' '.sprintf("%.0f", $time / 1440).' dagen';
165
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
261 }
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
262 $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
263 $total_ibus += $ibu;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
264
392
544d7d0183b2 Added 15 fields to the recipes table. Added 18 fields to the products table. These are calculated values that are now stored in the database so export programs can use these values without calculating them again. Product and recipe print have water and mash schedule added. Product print has brewday results added if the brewday is over. The ingredients layout changed in the product and recipe prints.
Michiel Broek <mbroek@mbse.eu>
parents: 391
diff changeset
265 if ($amount > 1)
544d7d0183b2 Added 15 fields to the recipes table. Added 18 fields to the products table. These are calculated values that are now stored in the database so export programs can use these values without calculating them again. Product and recipe print have water and mash schedule added. Product print has brewday results added if the brewday is over. The ingredients layout changed in the product and recipe prints.
Michiel Broek <mbroek@mbse.eu>
parents: 391
diff changeset
266 $amount = sprintf("%.3f",$amount).' kg';
544d7d0183b2 Added 15 fields to the recipes table. Added 18 fields to the products table. These are calculated values that are now stored in the database so export programs can use these values without calculating them again. Product and recipe print have water and mash schedule added. Product print has brewday results added if the brewday is over. The ingredients layout changed in the product and recipe prints.
Michiel Broek <mbroek@mbse.eu>
parents: 391
diff changeset
267 else
544d7d0183b2 Added 15 fields to the recipes table. Added 18 fields to the products table. These are calculated values that are now stored in the database so export programs can use these values without calculating them again. Product and recipe print have water and mash schedule added. Product print has brewday results added if the brewday is over. The ingredients layout changed in the product and recipe prints.
Michiel Broek <mbroek@mbse.eu>
parents: 391
diff changeset
268 $amount = sprintf("%.1f",$amount * 1000).' gr';
544d7d0183b2 Added 15 fields to the recipes table. Added 18 fields to the products table. These are calculated values that are now stored in the database so export programs can use these values without calculating them again. Product and recipe print have water and mash schedule added. Product print has brewday results added if the brewday is over. The ingredients layout changed in the product and recipe prints.
Michiel Broek <mbroek@mbse.eu>
parents: 391
diff changeset
269
544d7d0183b2 Added 15 fields to the recipes table. Added 18 fields to the products table. These are calculated values that are now stored in the database so export programs can use these values without calculating them again. Product and recipe print have water and mash schedule added. Product print has brewday results added if the brewday is over. The ingredients layout changed in the product and recipe prints.
Michiel Broek <mbroek@mbse.eu>
parents: 391
diff changeset
270 $this->Cell($vul,5,$name.' ('.$origin.')',0,0,'L',true);
165
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
271 $this->Cell(15,5,sprintf("%.1f%%",$alpha),0,0,'R',true);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
272 $this->Cell(12,5,sprintf("%.1f",$ibu),0,0,'R',true);
392
544d7d0183b2 Added 15 fields to the recipes table. Added 18 fields to the products table. These are calculated values that are now stored in the database so export programs can use these values without calculating them again. Product and recipe print have water and mash schedule added. Product print has brewday results added if the brewday is over. The ingredients layout changed in the product and recipe prints.
Michiel Broek <mbroek@mbse.eu>
parents: 391
diff changeset
273 $this->Cell(25,5,$hopform[$item['h_form']],0,0,'L',true);
544d7d0183b2 Added 15 fields to the recipes table. Added 18 fields to the products table. These are calculated values that are now stored in the database so export programs can use these values without calculating them again. Product and recipe print have water and mash schedule added. Product print has brewday results added if the brewday is over. The ingredients layout changed in the product and recipe prints.
Michiel Broek <mbroek@mbse.eu>
parents: 391
diff changeset
274 $this->Cell(30,5,$moment,0,0,'L',true);
544d7d0183b2 Added 15 fields to the recipes table. Added 18 fields to the products table. These are calculated values that are now stored in the database so export programs can use these values without calculating them again. Product and recipe print have water and mash schedule added. Product print has brewday results added if the brewday is over. The ingredients layout changed in the product and recipe prints.
Michiel Broek <mbroek@mbse.eu>
parents: 391
diff changeset
275 $this->Cell(20,5,$amount,0,0,'R',true);
544d7d0183b2 Added 15 fields to the recipes table. Added 18 fields to the products table. These are calculated values that are now stored in the database so export programs can use these values without calculating them again. Product and recipe print have water and mash schedule added. Product print has brewday results added if the brewday is over. The ingredients layout changed in the product and recipe prints.
Michiel Broek <mbroek@mbse.eu>
parents: 391
diff changeset
276 $this->Cell(20,5,sprintf("%.3f",$cost).EURO,0,0,'R',true);
165
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
277 $this->Ln();
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
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
280 $this->SetFillColor(210,245,255);
392
544d7d0183b2 Added 15 fields to the recipes table. Added 18 fields to the products table. These are calculated values that are now stored in the database so export programs can use these values without calculating them again. Product and recipe print have water and mash schedule added. Product print has brewday results added if the brewday is over. The ingredients layout changed in the product and recipe prints.
Michiel Broek <mbroek@mbse.eu>
parents: 391
diff changeset
281 $this->Cell($vul+102,5,'',0,0,'L',false);
544d7d0183b2 Added 15 fields to the recipes table. Added 18 fields to the products table. These are calculated values that are now stored in the database so export programs can use these values without calculating them again. Product and recipe print have water and mash schedule added. Product print has brewday results added if the brewday is over. The ingredients layout changed in the product and recipe prints.
Michiel Broek <mbroek@mbse.eu>
parents: 391
diff changeset
282 $this->Cell(20,5,sprintf("%.3f",$cost_hops).EURO,0,0,'R',true);
165
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
283 $this->ProcessingTable=false;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
284 $this->cMargin=$cMargin;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
285 $this->aCols=array();
391
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
286 $this->Ln();
165
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
287 }
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
288
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
289 function TableYeasts($row) {
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
290 global $cost_yeasts;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
291 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
292 $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
293 $yeastuse = array( 'Hoofdgisting', 'Nagisting', 'Lagering', 'Bottelen' );
392
544d7d0183b2 Added 15 fields to the recipes table. Added 18 fields to the products table. These are calculated values that are now stored in the database so export programs can use these values without calculating them again. Product and recipe print have water and mash schedule added. Product print has brewday results added if the brewday is over. The ingredients layout changed in the product and recipe prints.
Michiel Broek <mbroek@mbse.eu>
parents: 391
diff changeset
294 $vul = $this->w - $this->rMargin - $this->lMargin - 110;
391
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
295 $this->Ln();
165
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
296 $this->AddCol($vul,'Gist','L');
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
297 $this->AddCol(15,'Attn','R');
392
544d7d0183b2 Added 15 fields to the recipes table. Added 18 fields to the products table. These are calculated values that are now stored in the database so export programs can use these values without calculating them again. Product and recipe print have water and mash schedule added. Product print has brewday results added if the brewday is over. The ingredients layout changed in the product and recipe prints.
Michiel Broek <mbroek@mbse.eu>
parents: 391
diff changeset
298 $this->AddCol(25,'Soort','L');
544d7d0183b2 Added 15 fields to the recipes table. Added 18 fields to the products table. These are calculated values that are now stored in the database so export programs can use these values without calculating them again. Product and recipe print have water and mash schedule added. Product print has brewday results added if the brewday is over. The ingredients layout changed in the product and recipe prints.
Michiel Broek <mbroek@mbse.eu>
parents: 391
diff changeset
299 $this->AddCol(30,'Gebruik moment','L');
544d7d0183b2 Added 15 fields to the recipes table. Added 18 fields to the products table. These are calculated values that are now stored in the database so export programs can use these values without calculating them again. Product and recipe print have water and mash schedule added. Product print has brewday results added if the brewday is over. The ingredients layout changed in the product and recipe prints.
Michiel Broek <mbroek@mbse.eu>
parents: 391
diff changeset
300 $this->AddCol(20,'Hoeveel','R');
165
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
301 $this->AddCol(20,'Prijs','R');
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
302
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
303 $cMargin=$this->cMargin;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
304 $this->cMargin=2;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
305 $this->TableX=$this->lMargin;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
306 $this->TableHeader();
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
307 $this->ProcessingTable=true;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
308
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
309 $this->SetFont('Helvetica','',9);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
310 $this->SetFillColor(175, 175, 255);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
311
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
312 $arr = json_decode($row['json_yeasts'], true);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
313 foreach($arr as $item) { //foreach element in $arr
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
314 $name = iconv('UTF-8','windows-1252',$item['y_name']);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
315 $laboratory = iconv('UTF-8','windows-1252',$item['y_laboratory']);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
316 $product_id = iconv('UTF-8','windows-1252',$item['y_product_id']);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
317 $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
318 $cost = floatval($item['y_amount']) * floatval($item['y_cost']);
165
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
319 $cost_yeasts += $cost;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
320
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
321 if ($item['y_use'] == 0) // Primary
165
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
322 $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
323 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
324 $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
325 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
326 $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
327 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
328 $amount = sprintf("%.0f",floatval($item['y_amount'])*1000)." ml";
165
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
329
392
544d7d0183b2 Added 15 fields to the recipes table. Added 18 fields to the products table. These are calculated values that are now stored in the database so export programs can use these values without calculating them again. Product and recipe print have water and mash schedule added. Product print has brewday results added if the brewday is over. The ingredients layout changed in the product and recipe prints.
Michiel Broek <mbroek@mbse.eu>
parents: 391
diff changeset
330 $this->Cell($vul,5,$laboratory.' '.$product_id.' ('.$name.')',0,0,'L',true);
165
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
331 $this->Cell(15,5,sprintf("%.1f%%",$attenuation),0,0,'R',true);
392
544d7d0183b2 Added 15 fields to the recipes table. Added 18 fields to the products table. These are calculated values that are now stored in the database so export programs can use these values without calculating them again. Product and recipe print have water and mash schedule added. Product print has brewday results added if the brewday is over. The ingredients layout changed in the product and recipe prints.
Michiel Broek <mbroek@mbse.eu>
parents: 391
diff changeset
332 $this->Cell(25,5,$yeastform[$item['y_form']],0,0,'L',true);
544d7d0183b2 Added 15 fields to the recipes table. Added 18 fields to the products table. These are calculated values that are now stored in the database so export programs can use these values without calculating them again. Product and recipe print have water and mash schedule added. Product print has brewday results added if the brewday is over. The ingredients layout changed in the product and recipe prints.
Michiel Broek <mbroek@mbse.eu>
parents: 391
diff changeset
333 $this->Cell(30,5,$yeastuse[$item['y_use']],0,0,'L',true);
544d7d0183b2 Added 15 fields to the recipes table. Added 18 fields to the products table. These are calculated values that are now stored in the database so export programs can use these values without calculating them again. Product and recipe print have water and mash schedule added. Product print has brewday results added if the brewday is over. The ingredients layout changed in the product and recipe prints.
Michiel Broek <mbroek@mbse.eu>
parents: 391
diff changeset
334 $this->Cell(20,5,$amount,0,0,'R',true);
165
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
335 $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
336 $this->Ln();
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
337 }
392
544d7d0183b2 Added 15 fields to the recipes table. Added 18 fields to the products table. These are calculated values that are now stored in the database so export programs can use these values without calculating them again. Product and recipe print have water and mash schedule added. Product print has brewday results added if the brewday is over. The ingredients layout changed in the product and recipe prints.
Michiel Broek <mbroek@mbse.eu>
parents: 391
diff changeset
338 if ($row['starter_enable'] && $row['prop1_volume']) {
544d7d0183b2 Added 15 fields to the recipes table. Added 18 fields to the products table. These are calculated values that are now stored in the database so export programs can use these values without calculating them again. Product and recipe print have water and mash schedule added. Product print has brewday results added if the brewday is over. The ingredients layout changed in the product and recipe prints.
Michiel Broek <mbroek@mbse.eu>
parents: 391
diff changeset
339 $sv = 0;
544d7d0183b2 Added 15 fields to the recipes table. Added 18 fields to the products table. These are calculated values that are now stored in the database so export programs can use these values without calculating them again. Product and recipe print have water and mash schedule added. Product print has brewday results added if the brewday is over. The ingredients layout changed in the product and recipe prints.
Michiel Broek <mbroek@mbse.eu>
parents: 391
diff changeset
340 $st = 0;
544d7d0183b2 Added 15 fields to the recipes table. Added 18 fields to the products table. These are calculated values that are now stored in the database so export programs can use these values without calculating them again. Product and recipe print have water and mash schedule added. Product print has brewday results added if the brewday is over. The ingredients layout changed in the product and recipe prints.
Michiel Broek <mbroek@mbse.eu>
parents: 391
diff changeset
341 for ($i = 1; $i < 5; $i++) {
544d7d0183b2 Added 15 fields to the recipes table. Added 18 fields to the products table. These are calculated values that are now stored in the database so export programs can use these values without calculating them again. Product and recipe print have water and mash schedule added. Product print has brewday results added if the brewday is over. The ingredients layout changed in the product and recipe prints.
Michiel Broek <mbroek@mbse.eu>
parents: 391
diff changeset
342 $pv = "prop".$i."_volume";
544d7d0183b2 Added 15 fields to the recipes table. Added 18 fields to the products table. These are calculated values that are now stored in the database so export programs can use these values without calculating them again. Product and recipe print have water and mash schedule added. Product print has brewday results added if the brewday is over. The ingredients layout changed in the product and recipe prints.
Michiel Broek <mbroek@mbse.eu>
parents: 391
diff changeset
343 if (floatval($row[$pv])) {
544d7d0183b2 Added 15 fields to the recipes table. Added 18 fields to the products table. These are calculated values that are now stored in the database so export programs can use these values without calculating them again. Product and recipe print have water and mash schedule added. Product print has brewday results added if the brewday is over. The ingredients layout changed in the product and recipe prints.
Michiel Broek <mbroek@mbse.eu>
parents: 391
diff changeset
344 $st++;
544d7d0183b2 Added 15 fields to the recipes table. Added 18 fields to the products table. These are calculated values that are now stored in the database so export programs can use these values without calculating them again. Product and recipe print have water and mash schedule added. Product print has brewday results added if the brewday is over. The ingredients layout changed in the product and recipe prints.
Michiel Broek <mbroek@mbse.eu>
parents: 391
diff changeset
345 if (floatval($row[$pv]) > $sv)
544d7d0183b2 Added 15 fields to the recipes table. Added 18 fields to the products table. These are calculated values that are now stored in the database so export programs can use these values without calculating them again. Product and recipe print have water and mash schedule added. Product print has brewday results added if the brewday is over. The ingredients layout changed in the product and recipe prints.
Michiel Broek <mbroek@mbse.eu>
parents: 391
diff changeset
346 $sv = floatval($row[$pv]);
544d7d0183b2 Added 15 fields to the recipes table. Added 18 fields to the products table. These are calculated values that are now stored in the database so export programs can use these values without calculating them again. Product and recipe print have water and mash schedule added. Product print has brewday results added if the brewday is over. The ingredients layout changed in the product and recipe prints.
Michiel Broek <mbroek@mbse.eu>
parents: 391
diff changeset
347 }
544d7d0183b2 Added 15 fields to the recipes table. Added 18 fields to the products table. These are calculated values that are now stored in the database so export programs can use these values without calculating them again. Product and recipe print have water and mash schedule added. Product print has brewday results added if the brewday is over. The ingredients layout changed in the product and recipe prints.
Michiel Broek <mbroek@mbse.eu>
parents: 391
diff changeset
348 }
544d7d0183b2 Added 15 fields to the recipes table. Added 18 fields to the products table. These are calculated values that are now stored in the database so export programs can use these values without calculating them again. Product and recipe print have water and mash schedule added. Product print has brewday results added if the brewday is over. The ingredients layout changed in the product and recipe prints.
Michiel Broek <mbroek@mbse.eu>
parents: 391
diff changeset
349 $this->Cell($vul,5,$st." staps giststarter",0,0,'L',true);
544d7d0183b2 Added 15 fields to the recipes table. Added 18 fields to the products table. These are calculated values that are now stored in the database so export programs can use these values without calculating them again. Product and recipe print have water and mash schedule added. Product print has brewday results added if the brewday is over. The ingredients layout changed in the product and recipe prints.
Michiel Broek <mbroek@mbse.eu>
parents: 391
diff changeset
350 $this->Cell(40,5,'',0,0,'R',true);
544d7d0183b2 Added 15 fields to the recipes table. Added 18 fields to the products table. These are calculated values that are now stored in the database so export programs can use these values without calculating them again. Product and recipe print have water and mash schedule added. Product print has brewday results added if the brewday is over. The ingredients layout changed in the product and recipe prints.
Michiel Broek <mbroek@mbse.eu>
parents: 391
diff changeset
351 $this->Cell(30,5,"Vooraf",0,0,'L',true);
544d7d0183b2 Added 15 fields to the recipes table. Added 18 fields to the products table. These are calculated values that are now stored in the database so export programs can use these values without calculating them again. Product and recipe print have water and mash schedule added. Product print has brewday results added if the brewday is over. The ingredients layout changed in the product and recipe prints.
Michiel Broek <mbroek@mbse.eu>
parents: 391
diff changeset
352 $this->Cell(20,5,sprintf("%.2f",$sv)." L",0,0,'R',true);
544d7d0183b2 Added 15 fields to the recipes table. Added 18 fields to the products table. These are calculated values that are now stored in the database so export programs can use these values without calculating them again. Product and recipe print have water and mash schedule added. Product print has brewday results added if the brewday is over. The ingredients layout changed in the product and recipe prints.
Michiel Broek <mbroek@mbse.eu>
parents: 391
diff changeset
353 $this->Cell(20,5,'',0,0,'R',true);
544d7d0183b2 Added 15 fields to the recipes table. Added 18 fields to the products table. These are calculated values that are now stored in the database so export programs can use these values without calculating them again. Product and recipe print have water and mash schedule added. Product print has brewday results added if the brewday is over. The ingredients layout changed in the product and recipe prints.
Michiel Broek <mbroek@mbse.eu>
parents: 391
diff changeset
354 $this->Ln();
293
db898ec73277 Show yeast starter on printed page
Michiel Broek <mbroek@mbse.eu>
parents: 289
diff changeset
355 }
165
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
356
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
357 $this->SetFillColor(210,245,255);
392
544d7d0183b2 Added 15 fields to the recipes table. Added 18 fields to the products table. These are calculated values that are now stored in the database so export programs can use these values without calculating them again. Product and recipe print have water and mash schedule added. Product print has brewday results added if the brewday is over. The ingredients layout changed in the product and recipe prints.
Michiel Broek <mbroek@mbse.eu>
parents: 391
diff changeset
358 $this->Cell($vul+90,5,'',0,0,'L',false);
165
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
359 $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
360 $this->ProcessingTable=false;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
361 $this->cMargin=$cMargin;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
362 $this->aCols=array();
391
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
363 $this->Ln();
165
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
364 }
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
365
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
366 function TableMiscs($row) {
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
367 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
368 $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
369 $miscuse = array( 'Starter', 'Maischen', 'Koken', 'Hoofdvergisting', 'Nagisting/lagering', 'Bottelen' );
392
544d7d0183b2 Added 15 fields to the recipes table. Added 18 fields to the products table. These are calculated values that are now stored in the database so export programs can use these values without calculating them again. Product and recipe print have water and mash schedule added. Product print has brewday results added if the brewday is over. The ingredients layout changed in the product and recipe prints.
Michiel Broek <mbroek@mbse.eu>
parents: 391
diff changeset
370 $vul = $this->w - $this->rMargin - $this->lMargin - 95;
391
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
371 if ($this->GetY() > 200)
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
372 $this->AddPage();
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
373 else
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
374 $this->Ln();
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
375 $this->AddCol($vul,'Diversen naam','L');
392
544d7d0183b2 Added 15 fields to the recipes table. Added 18 fields to the products table. These are calculated values that are now stored in the database so export programs can use these values without calculating them again. Product and recipe print have water and mash schedule added. Product print has brewday results added if the brewday is over. The ingredients layout changed in the product and recipe prints.
Michiel Broek <mbroek@mbse.eu>
parents: 391
diff changeset
376 $this->AddCol(25,'Soort','L');
544d7d0183b2 Added 15 fields to the recipes table. Added 18 fields to the products table. These are calculated values that are now stored in the database so export programs can use these values without calculating them again. Product and recipe print have water and mash schedule added. Product print has brewday results added if the brewday is over. The ingredients layout changed in the product and recipe prints.
Michiel Broek <mbroek@mbse.eu>
parents: 391
diff changeset
377 $this->AddCol(30,'Gebruik moment','L');
165
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
378 $this->AddCol(20,'Hoeveel','R');
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
379 $this->AddCol(20,'Prijs','R');
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
380
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
381 $cMargin=$this->cMargin;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
382 $this->cMargin=2;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
383 $this->TableX=$this->lMargin;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
384 $this->TableHeader();
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
385 $this->ProcessingTable=true;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
386
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
387 $this->SetFont('Helvetica','',9);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
388 $this->SetFillColor(175, 175, 255);
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 $arr = json_decode($row['json_miscs'], true);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
391 foreach($arr as $item) {
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
392 $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
393 $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
394 $use_use = $item['m_use_use'];
165
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
395 $amount = floatval($item['m_amount']) * 1000;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
396 $costg = floatval($item['m_cost']) / 1000;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
397 $time = floatval($item['m_time']);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
398 $aiw = $item['m_amount_is_weight'];
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
399 $cost = $amount * $costg;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
400 $cost_miscs += $cost;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
401
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
402 if ($type == 4) // Water agent
165
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
403 $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
404 else if ($type == 3) // Fining
165
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
405 $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
406 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
407 $this->SetFillColor(240,250,65);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
408 else
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
409 $this->SetFillColor(210,245,255);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
410
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
411 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
412 $gebruik = sprintf("%s %d min",$miscuse[$use_use],$time);
165
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
413 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
414 $gebruik = $miscuse[$use_use];
165
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
415
357
74d56bed75b9 One more decimal digit for misc ingredients. Updated the README.
Michiel Broek <mbroek@mbse.eu>
parents: 338
diff changeset
416 $hoeveel = sprintf("%.2f %s",$amount,$aiw ? "gr":"ml");
165
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
417 $this->Cell($vul,5,$name,0,0,'L',true);
392
544d7d0183b2 Added 15 fields to the recipes table. Added 18 fields to the products table. These are calculated values that are now stored in the database so export programs can use these values without calculating them again. Product and recipe print have water and mash schedule added. Product print has brewday results added if the brewday is over. The ingredients layout changed in the product and recipe prints.
Michiel Broek <mbroek@mbse.eu>
parents: 391
diff changeset
418 $this->Cell(25,5,$misctype[$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
419 $this->Cell(30,5,$gebruik,0,0,'L',true);
165
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
420 $this->Cell(20,5,$hoeveel,0,0,'R',true);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
421 $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
422 $this->Ln();
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
423 }
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
424
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
425 $this->SetFillColor(210,245,255);
392
544d7d0183b2 Added 15 fields to the recipes table. Added 18 fields to the products table. These are calculated values that are now stored in the database so export programs can use these values without calculating them again. Product and recipe print have water and mash schedule added. Product print has brewday results added if the brewday is over. The ingredients layout changed in the product and recipe prints.
Michiel Broek <mbroek@mbse.eu>
parents: 391
diff changeset
426 $this->Cell($vul+75,5,'',0,0,'L',false);
165
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
427 $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
428
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
429 $this->ProcessingTable=false;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
430 $this->cMargin=$cMargin;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
431 $this->aCols=array();
391
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
432 $this->Ln();
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
433 }
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
434
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
435 function TableMashs($row) {
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
436 global $cost_yeasts;
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
437 global $svg;
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
438 global $mashkg;
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
439 $mashtype = array( 'Infusie', 'Verwarming', 'Decoctie' );
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
440 $vul = $this->w - $this->rMargin - $this->lMargin - 137;
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
441 if ($this->GetY() > 250)
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
442 $this->AddPage();
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
443 else
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
444 $this->Ln();
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
445 $this->AddCol($vul,'Maisch stap naam','L');
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
446 $this->AddCol(25,'Stap type','L');
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
447 $this->AddCol(18,'Start '.DEG.'C','R');
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
448 $this->AddCol(18,'Eind '.DEG.'C','R');
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
449 $this->AddCol(18,'Rust min','R');
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
450 $this->AddCol(18,'Stap min','R');
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
451 $this->AddCol(20,'L/Kg','R');
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
452 $this->AddCol(20,'Infusie L','R');
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
453
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
454 $cMargin=$this->cMargin;
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
455 $this->cMargin=2;
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
456 $this->TableX=$this->lMargin;
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
457 $this->TableHeader();
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
458 $this->ProcessingTable=true;
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
459
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
460 $this->SetFont('Helvetica','',9);
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
461 $this->SetFillColor(175, 175, 255);
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
462
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
463 $vol = 0;
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
464 $arr = json_decode($row['json_mashs'], true);
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
465 foreach($arr as $item) { //foreach element in $arr
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
466
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
467 if ($item['step_type'] == 0)
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
468 $vol += $item['step_infuse_amount'];
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
469 if ($mashkg > 0)
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
470 $thick = $vol / $mashkg;
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
471 else
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
472 $thick = 0;
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
473 $this->Cell($vul,5,$item['step_name'],0,0,'L',true);
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
474 $this->Cell(25,5,$mashtype[$item['step_type']],0,0,'L',true);
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
475 $this->Cell(18,5,sprintf("%.1f",$item['step_temp']),0,0,'R',true);
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
476 $this->Cell(18,5,sprintf("%.1f",$item['end_temp']),0,0,'R',true);
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
477 $this->Cell(18,5,sprintf("%.0f",$item['step_time']),0,0,'R',true);
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
478 $this->Cell(18,5,sprintf("%.0f",$item['ramp_time']),0,0,'R',true);
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
479 $this->Cell(20,5,sprintf("%.2f",$thick),0,0,'R',true);
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
480 $this->Cell(20,5,sprintf("%.1f",$item['step_infuse_amount']),0,0,'R',true);
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
481 $this->Ln();
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
482 }
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
483 $this->ProcessingTable=false;
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
484 $this->cMargin=$cMargin;
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
485 $this->aCols=array();
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
486 $this->Ln();
165
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
392
544d7d0183b2 Added 15 fields to the recipes table. Added 18 fields to the products table. These are calculated values that are now stored in the database so export programs can use these values without calculating them again. Product and recipe print have water and mash schedule added. Product print has brewday results added if the brewday is over. The ingredients layout changed in the product and recipe prints.
Michiel Broek <mbroek@mbse.eu>
parents: 391
diff changeset
489 function TableWaters($row) {
544d7d0183b2 Added 15 fields to the recipes table. Added 18 fields to the products table. These are calculated values that are now stored in the database so export programs can use these values without calculating them again. Product and recipe print have water and mash schedule added. Product print has brewday results added if the brewday is over. The ingredients layout changed in the product and recipe prints.
Michiel Broek <mbroek@mbse.eu>
parents: 391
diff changeset
490
544d7d0183b2 Added 15 fields to the recipes table. Added 18 fields to the products table. These are calculated values that are now stored in the database so export programs can use these values without calculating them again. Product and recipe print have water and mash schedule added. Product print has brewday results added if the brewday is over. The ingredients layout changed in the product and recipe prints.
Michiel Broek <mbroek@mbse.eu>
parents: 391
diff changeset
491 $vul = $this->w - $this->rMargin - $this->lMargin - 137;
544d7d0183b2 Added 15 fields to the recipes table. Added 18 fields to the products table. These are calculated values that are now stored in the database so export programs can use these values without calculating them again. Product and recipe print have water and mash schedule added. Product print has brewday results added if the brewday is over. The ingredients layout changed in the product and recipe prints.
Michiel Broek <mbroek@mbse.eu>
parents: 391
diff changeset
492 if ($this->GetY() > 250)
544d7d0183b2 Added 15 fields to the recipes table. Added 18 fields to the products table. These are calculated values that are now stored in the database so export programs can use these values without calculating them again. Product and recipe print have water and mash schedule added. Product print has brewday results added if the brewday is over. The ingredients layout changed in the product and recipe prints.
Michiel Broek <mbroek@mbse.eu>
parents: 391
diff changeset
493 $this->AddPage();
544d7d0183b2 Added 15 fields to the recipes table. Added 18 fields to the products table. These are calculated values that are now stored in the database so export programs can use these values without calculating them again. Product and recipe print have water and mash schedule added. Product print has brewday results added if the brewday is over. The ingredients layout changed in the product and recipe prints.
Michiel Broek <mbroek@mbse.eu>
parents: 391
diff changeset
494 else
544d7d0183b2 Added 15 fields to the recipes table. Added 18 fields to the products table. These are calculated values that are now stored in the database so export programs can use these values without calculating them again. Product and recipe print have water and mash schedule added. Product print has brewday results added if the brewday is over. The ingredients layout changed in the product and recipe prints.
Michiel Broek <mbroek@mbse.eu>
parents: 391
diff changeset
495 $this->Ln();
544d7d0183b2 Added 15 fields to the recipes table. Added 18 fields to the products table. These are calculated values that are now stored in the database so export programs can use these values without calculating them again. Product and recipe print have water and mash schedule added. Product print has brewday results added if the brewday is over. The ingredients layout changed in the product and recipe prints.
Michiel Broek <mbroek@mbse.eu>
parents: 391
diff changeset
496 $this->AddCol($vul,'Water bron','L');
544d7d0183b2 Added 15 fields to the recipes table. Added 18 fields to the products table. These are calculated values that are now stored in the database so export programs can use these values without calculating them again. Product and recipe print have water and mash schedule added. Product print has brewday results added if the brewday is over. The ingredients layout changed in the product and recipe prints.
Michiel Broek <mbroek@mbse.eu>
parents: 391
diff changeset
497 $this->AddCol(20,'Volume','R');
544d7d0183b2 Added 15 fields to the recipes table. Added 18 fields to the products table. These are calculated values that are now stored in the database so export programs can use these values without calculating them again. Product and recipe print have water and mash schedule added. Product print has brewday results added if the brewday is over. The ingredients layout changed in the product and recipe prints.
Michiel Broek <mbroek@mbse.eu>
parents: 391
diff changeset
498 $this->AddCol(15,'Ca','R');
544d7d0183b2 Added 15 fields to the recipes table. Added 18 fields to the products table. These are calculated values that are now stored in the database so export programs can use these values without calculating them again. Product and recipe print have water and mash schedule added. Product print has brewday results added if the brewday is over. The ingredients layout changed in the product and recipe prints.
Michiel Broek <mbroek@mbse.eu>
parents: 391
diff changeset
499 $this->AddCol(15,'Mg','R');
544d7d0183b2 Added 15 fields to the recipes table. Added 18 fields to the products table. These are calculated values that are now stored in the database so export programs can use these values without calculating them again. Product and recipe print have water and mash schedule added. Product print has brewday results added if the brewday is over. The ingredients layout changed in the product and recipe prints.
Michiel Broek <mbroek@mbse.eu>
parents: 391
diff changeset
500 $this->AddCol(15,'Na','R');
544d7d0183b2 Added 15 fields to the recipes table. Added 18 fields to the products table. These are calculated values that are now stored in the database so export programs can use these values without calculating them again. Product and recipe print have water and mash schedule added. Product print has brewday results added if the brewday is over. The ingredients layout changed in the product and recipe prints.
Michiel Broek <mbroek@mbse.eu>
parents: 391
diff changeset
501 $this->AddCol(15,'CaCO3','R');
544d7d0183b2 Added 15 fields to the recipes table. Added 18 fields to the products table. These are calculated values that are now stored in the database so export programs can use these values without calculating them again. Product and recipe print have water and mash schedule added. Product print has brewday results added if the brewday is over. The ingredients layout changed in the product and recipe prints.
Michiel Broek <mbroek@mbse.eu>
parents: 391
diff changeset
502 $this->AddCol(15,'Cl','R');
544d7d0183b2 Added 15 fields to the recipes table. Added 18 fields to the products table. These are calculated values that are now stored in the database so export programs can use these values without calculating them again. Product and recipe print have water and mash schedule added. Product print has brewday results added if the brewday is over. The ingredients layout changed in the product and recipe prints.
Michiel Broek <mbroek@mbse.eu>
parents: 391
diff changeset
503 $this->AddCol(15,'SO4','R');
544d7d0183b2 Added 15 fields to the recipes table. Added 18 fields to the products table. These are calculated values that are now stored in the database so export programs can use these values without calculating them again. Product and recipe print have water and mash schedule added. Product print has brewday results added if the brewday is over. The ingredients layout changed in the product and recipe prints.
Michiel Broek <mbroek@mbse.eu>
parents: 391
diff changeset
504 $this->AddCol(15,'pH','R');
544d7d0183b2 Added 15 fields to the recipes table. Added 18 fields to the products table. These are calculated values that are now stored in the database so export programs can use these values without calculating them again. Product and recipe print have water and mash schedule added. Product print has brewday results added if the brewday is over. The ingredients layout changed in the product and recipe prints.
Michiel Broek <mbroek@mbse.eu>
parents: 391
diff changeset
505
544d7d0183b2 Added 15 fields to the recipes table. Added 18 fields to the products table. These are calculated values that are now stored in the database so export programs can use these values without calculating them again. Product and recipe print have water and mash schedule added. Product print has brewday results added if the brewday is over. The ingredients layout changed in the product and recipe prints.
Michiel Broek <mbroek@mbse.eu>
parents: 391
diff changeset
506 $cMargin=$this->cMargin;
544d7d0183b2 Added 15 fields to the recipes table. Added 18 fields to the products table. These are calculated values that are now stored in the database so export programs can use these values without calculating them again. Product and recipe print have water and mash schedule added. Product print has brewday results added if the brewday is over. The ingredients layout changed in the product and recipe prints.
Michiel Broek <mbroek@mbse.eu>
parents: 391
diff changeset
507 $this->cMargin=2;
544d7d0183b2 Added 15 fields to the recipes table. Added 18 fields to the products table. These are calculated values that are now stored in the database so export programs can use these values without calculating them again. Product and recipe print have water and mash schedule added. Product print has brewday results added if the brewday is over. The ingredients layout changed in the product and recipe prints.
Michiel Broek <mbroek@mbse.eu>
parents: 391
diff changeset
508 $this->TableX=$this->lMargin;
544d7d0183b2 Added 15 fields to the recipes table. Added 18 fields to the products table. These are calculated values that are now stored in the database so export programs can use these values without calculating them again. Product and recipe print have water and mash schedule added. Product print has brewday results added if the brewday is over. The ingredients layout changed in the product and recipe prints.
Michiel Broek <mbroek@mbse.eu>
parents: 391
diff changeset
509 $this->TableHeader();
544d7d0183b2 Added 15 fields to the recipes table. Added 18 fields to the products table. These are calculated values that are now stored in the database so export programs can use these values without calculating them again. Product and recipe print have water and mash schedule added. Product print has brewday results added if the brewday is over. The ingredients layout changed in the product and recipe prints.
Michiel Broek <mbroek@mbse.eu>
parents: 391
diff changeset
510 $this->ProcessingTable=true;
544d7d0183b2 Added 15 fields to the recipes table. Added 18 fields to the products table. These are calculated values that are now stored in the database so export programs can use these values without calculating them again. Product and recipe print have water and mash schedule added. Product print has brewday results added if the brewday is over. The ingredients layout changed in the product and recipe prints.
Michiel Broek <mbroek@mbse.eu>
parents: 391
diff changeset
511
544d7d0183b2 Added 15 fields to the recipes table. Added 18 fields to the products table. These are calculated values that are now stored in the database so export programs can use these values without calculating them again. Product and recipe print have water and mash schedule added. Product print has brewday results added if the brewday is over. The ingredients layout changed in the product and recipe prints.
Michiel Broek <mbroek@mbse.eu>
parents: 391
diff changeset
512 $this->SetFont('Helvetica','',9);
544d7d0183b2 Added 15 fields to the recipes table. Added 18 fields to the products table. These are calculated values that are now stored in the database so export programs can use these values without calculating them again. Product and recipe print have water and mash schedule added. Product print has brewday results added if the brewday is over. The ingredients layout changed in the product and recipe prints.
Michiel Broek <mbroek@mbse.eu>
parents: 391
diff changeset
513 $this->SetFillColor(120, 255, 250);
544d7d0183b2 Added 15 fields to the recipes table. Added 18 fields to the products table. These are calculated values that are now stored in the database so export programs can use these values without calculating them again. Product and recipe print have water and mash schedule added. Product print has brewday results added if the brewday is over. The ingredients layout changed in the product and recipe prints.
Michiel Broek <mbroek@mbse.eu>
parents: 391
diff changeset
514
544d7d0183b2 Added 15 fields to the recipes table. Added 18 fields to the products table. These are calculated values that are now stored in the database so export programs can use these values without calculating them again. Product and recipe print have water and mash schedule added. Product print has brewday results added if the brewday is over. The ingredients layout changed in the product and recipe prints.
Michiel Broek <mbroek@mbse.eu>
parents: 391
diff changeset
515 $this->Cell($vul,5,$row['w1_name'],0,0,'L',true);
544d7d0183b2 Added 15 fields to the recipes table. Added 18 fields to the products table. These are calculated values that are now stored in the database so export programs can use these values without calculating them again. Product and recipe print have water and mash schedule added. Product print has brewday results added if the brewday is over. The ingredients layout changed in the product and recipe prints.
Michiel Broek <mbroek@mbse.eu>
parents: 391
diff changeset
516 $this->Cell(20,5,sprintf("%.1f", $row['w1_amount']).' L',0,0,'R',true);
544d7d0183b2 Added 15 fields to the recipes table. Added 18 fields to the products table. These are calculated values that are now stored in the database so export programs can use these values without calculating them again. Product and recipe print have water and mash schedule added. Product print has brewday results added if the brewday is over. The ingredients layout changed in the product and recipe prints.
Michiel Broek <mbroek@mbse.eu>
parents: 391
diff changeset
517 $this->Cell(15,5,sprintf("%.1f", $row['w1_calcium']),0,0,'R',true);
544d7d0183b2 Added 15 fields to the recipes table. Added 18 fields to the products table. These are calculated values that are now stored in the database so export programs can use these values without calculating them again. Product and recipe print have water and mash schedule added. Product print has brewday results added if the brewday is over. The ingredients layout changed in the product and recipe prints.
Michiel Broek <mbroek@mbse.eu>
parents: 391
diff changeset
518 $this->Cell(15,5,sprintf("%.1f", $row['w1_magnesium']),0,0,'R',true);
544d7d0183b2 Added 15 fields to the recipes table. Added 18 fields to the products table. These are calculated values that are now stored in the database so export programs can use these values without calculating them again. Product and recipe print have water and mash schedule added. Product print has brewday results added if the brewday is over. The ingredients layout changed in the product and recipe prints.
Michiel Broek <mbroek@mbse.eu>
parents: 391
diff changeset
519 $this->Cell(15,5,sprintf("%.1f", $row['w1_sodium']),0,0,'R',true);
544d7d0183b2 Added 15 fields to the recipes table. Added 18 fields to the products table. These are calculated values that are now stored in the database so export programs can use these values without calculating them again. Product and recipe print have water and mash schedule added. Product print has brewday results added if the brewday is over. The ingredients layout changed in the product and recipe prints.
Michiel Broek <mbroek@mbse.eu>
parents: 391
diff changeset
520 $this->Cell(15,5,sprintf("%.1f", $row['w1_total_alkalinity']),0,0,'R',true);
544d7d0183b2 Added 15 fields to the recipes table. Added 18 fields to the products table. These are calculated values that are now stored in the database so export programs can use these values without calculating them again. Product and recipe print have water and mash schedule added. Product print has brewday results added if the brewday is over. The ingredients layout changed in the product and recipe prints.
Michiel Broek <mbroek@mbse.eu>
parents: 391
diff changeset
521 $this->Cell(15,5,sprintf("%.1f", $row['w1_chloride']),0,0,'R',true);
544d7d0183b2 Added 15 fields to the recipes table. Added 18 fields to the products table. These are calculated values that are now stored in the database so export programs can use these values without calculating them again. Product and recipe print have water and mash schedule added. Product print has brewday results added if the brewday is over. The ingredients layout changed in the product and recipe prints.
Michiel Broek <mbroek@mbse.eu>
parents: 391
diff changeset
522 $this->Cell(15,5,sprintf("%.1f", $row['w1_sulfate']),0,0,'R',true);
544d7d0183b2 Added 15 fields to the recipes table. Added 18 fields to the products table. These are calculated values that are now stored in the database so export programs can use these values without calculating them again. Product and recipe print have water and mash schedule added. Product print has brewday results added if the brewday is over. The ingredients layout changed in the product and recipe prints.
Michiel Broek <mbroek@mbse.eu>
parents: 391
diff changeset
523 $this->Cell(15,5,sprintf("%.1f", $row['w1_ph']),0,0,'R',true);
544d7d0183b2 Added 15 fields to the recipes table. Added 18 fields to the products table. These are calculated values that are now stored in the database so export programs can use these values without calculating them again. Product and recipe print have water and mash schedule added. Product print has brewday results added if the brewday is over. The ingredients layout changed in the product and recipe prints.
Michiel Broek <mbroek@mbse.eu>
parents: 391
diff changeset
524 $this->Ln();
544d7d0183b2 Added 15 fields to the recipes table. Added 18 fields to the products table. These are calculated values that are now stored in the database so export programs can use these values without calculating them again. Product and recipe print have water and mash schedule added. Product print has brewday results added if the brewday is over. The ingredients layout changed in the product and recipe prints.
Michiel Broek <mbroek@mbse.eu>
parents: 391
diff changeset
525 $this->Cell($vul,5,$row['w2_name'],0,0,'L',true);
544d7d0183b2 Added 15 fields to the recipes table. Added 18 fields to the products table. These are calculated values that are now stored in the database so export programs can use these values without calculating them again. Product and recipe print have water and mash schedule added. Product print has brewday results added if the brewday is over. The ingredients layout changed in the product and recipe prints.
Michiel Broek <mbroek@mbse.eu>
parents: 391
diff changeset
526 $this->Cell(20,5,sprintf("%.1f", $row['w2_amount']).' L',0,0,'R',true);
544d7d0183b2 Added 15 fields to the recipes table. Added 18 fields to the products table. These are calculated values that are now stored in the database so export programs can use these values without calculating them again. Product and recipe print have water and mash schedule added. Product print has brewday results added if the brewday is over. The ingredients layout changed in the product and recipe prints.
Michiel Broek <mbroek@mbse.eu>
parents: 391
diff changeset
527 $this->Cell(15,5,sprintf("%.1f", $row['w2_calcium']),0,0,'R',true);
544d7d0183b2 Added 15 fields to the recipes table. Added 18 fields to the products table. These are calculated values that are now stored in the database so export programs can use these values without calculating them again. Product and recipe print have water and mash schedule added. Product print has brewday results added if the brewday is over. The ingredients layout changed in the product and recipe prints.
Michiel Broek <mbroek@mbse.eu>
parents: 391
diff changeset
528 $this->Cell(15,5,sprintf("%.1f", $row['w2_magnesium']),0,0,'R',true);
544d7d0183b2 Added 15 fields to the recipes table. Added 18 fields to the products table. These are calculated values that are now stored in the database so export programs can use these values without calculating them again. Product and recipe print have water and mash schedule added. Product print has brewday results added if the brewday is over. The ingredients layout changed in the product and recipe prints.
Michiel Broek <mbroek@mbse.eu>
parents: 391
diff changeset
529 $this->Cell(15,5,sprintf("%.1f", $row['w2_sodium']),0,0,'R',true);
544d7d0183b2 Added 15 fields to the recipes table. Added 18 fields to the products table. These are calculated values that are now stored in the database so export programs can use these values without calculating them again. Product and recipe print have water and mash schedule added. Product print has brewday results added if the brewday is over. The ingredients layout changed in the product and recipe prints.
Michiel Broek <mbroek@mbse.eu>
parents: 391
diff changeset
530 $this->Cell(15,5,sprintf("%.1f", $row['w2_total_alkalinity']),0,0,'R',true);
544d7d0183b2 Added 15 fields to the recipes table. Added 18 fields to the products table. These are calculated values that are now stored in the database so export programs can use these values without calculating them again. Product and recipe print have water and mash schedule added. Product print has brewday results added if the brewday is over. The ingredients layout changed in the product and recipe prints.
Michiel Broek <mbroek@mbse.eu>
parents: 391
diff changeset
531 $this->Cell(15,5,sprintf("%.1f", $row['w2_chloride']),0,0,'R',true);
544d7d0183b2 Added 15 fields to the recipes table. Added 18 fields to the products table. These are calculated values that are now stored in the database so export programs can use these values without calculating them again. Product and recipe print have water and mash schedule added. Product print has brewday results added if the brewday is over. The ingredients layout changed in the product and recipe prints.
Michiel Broek <mbroek@mbse.eu>
parents: 391
diff changeset
532 $this->Cell(15,5,sprintf("%.1f", $row['w2_sulfate']),0,0,'R',true);
544d7d0183b2 Added 15 fields to the recipes table. Added 18 fields to the products table. These are calculated values that are now stored in the database so export programs can use these values without calculating them again. Product and recipe print have water and mash schedule added. Product print has brewday results added if the brewday is over. The ingredients layout changed in the product and recipe prints.
Michiel Broek <mbroek@mbse.eu>
parents: 391
diff changeset
533 $this->Cell(15,5,sprintf("%.1f", $row['w2_ph']),0,0,'R',true);
544d7d0183b2 Added 15 fields to the recipes table. Added 18 fields to the products table. These are calculated values that are now stored in the database so export programs can use these values without calculating them again. Product and recipe print have water and mash schedule added. Product print has brewday results added if the brewday is over. The ingredients layout changed in the product and recipe prints.
Michiel Broek <mbroek@mbse.eu>
parents: 391
diff changeset
534 $this->Ln();
544d7d0183b2 Added 15 fields to the recipes table. Added 18 fields to the products table. These are calculated values that are now stored in the database so export programs can use these values without calculating them again. Product and recipe print have water and mash schedule added. Product print has brewday results added if the brewday is over. The ingredients layout changed in the product and recipe prints.
Michiel Broek <mbroek@mbse.eu>
parents: 391
diff changeset
535 $this->Cell($vul,5,'Gemengd water',0,0,'L',true);
544d7d0183b2 Added 15 fields to the recipes table. Added 18 fields to the products table. These are calculated values that are now stored in the database so export programs can use these values without calculating them again. Product and recipe print have water and mash schedule added. Product print has brewday results added if the brewday is over. The ingredients layout changed in the product and recipe prints.
Michiel Broek <mbroek@mbse.eu>
parents: 391
diff changeset
536 $this->Cell(20,5,sprintf("%.1f", $row['wg_amount']).' L',0,0,'R',true);
544d7d0183b2 Added 15 fields to the recipes table. Added 18 fields to the products table. These are calculated values that are now stored in the database so export programs can use these values without calculating them again. Product and recipe print have water and mash schedule added. Product print has brewday results added if the brewday is over. The ingredients layout changed in the product and recipe prints.
Michiel Broek <mbroek@mbse.eu>
parents: 391
diff changeset
537 $this->Cell(15,5,sprintf("%.1f", $row['wg_calcium']),0,0,'R',true);
544d7d0183b2 Added 15 fields to the recipes table. Added 18 fields to the products table. These are calculated values that are now stored in the database so export programs can use these values without calculating them again. Product and recipe print have water and mash schedule added. Product print has brewday results added if the brewday is over. The ingredients layout changed in the product and recipe prints.
Michiel Broek <mbroek@mbse.eu>
parents: 391
diff changeset
538 $this->Cell(15,5,sprintf("%.1f", $row['wg_magnesium']),0,0,'R',true);
544d7d0183b2 Added 15 fields to the recipes table. Added 18 fields to the products table. These are calculated values that are now stored in the database so export programs can use these values without calculating them again. Product and recipe print have water and mash schedule added. Product print has brewday results added if the brewday is over. The ingredients layout changed in the product and recipe prints.
Michiel Broek <mbroek@mbse.eu>
parents: 391
diff changeset
539 $this->Cell(15,5,sprintf("%.1f", $row['wg_sodium']),0,0,'R',true);
544d7d0183b2 Added 15 fields to the recipes table. Added 18 fields to the products table. These are calculated values that are now stored in the database so export programs can use these values without calculating them again. Product and recipe print have water and mash schedule added. Product print has brewday results added if the brewday is over. The ingredients layout changed in the product and recipe prints.
Michiel Broek <mbroek@mbse.eu>
parents: 391
diff changeset
540 $this->Cell(15,5,sprintf("%.1f", $row['wg_total_alkalinity']),0,0,'R',true);
544d7d0183b2 Added 15 fields to the recipes table. Added 18 fields to the products table. These are calculated values that are now stored in the database so export programs can use these values without calculating them again. Product and recipe print have water and mash schedule added. Product print has brewday results added if the brewday is over. The ingredients layout changed in the product and recipe prints.
Michiel Broek <mbroek@mbse.eu>
parents: 391
diff changeset
541 $this->Cell(15,5,sprintf("%.1f", $row['wg_chloride']),0,0,'R',true);
544d7d0183b2 Added 15 fields to the recipes table. Added 18 fields to the products table. These are calculated values that are now stored in the database so export programs can use these values without calculating them again. Product and recipe print have water and mash schedule added. Product print has brewday results added if the brewday is over. The ingredients layout changed in the product and recipe prints.
Michiel Broek <mbroek@mbse.eu>
parents: 391
diff changeset
542 $this->Cell(15,5,sprintf("%.1f", $row['wg_sulfate']),0,0,'R',true);
544d7d0183b2 Added 15 fields to the recipes table. Added 18 fields to the products table. These are calculated values that are now stored in the database so export programs can use these values without calculating them again. Product and recipe print have water and mash schedule added. Product print has brewday results added if the brewday is over. The ingredients layout changed in the product and recipe prints.
Michiel Broek <mbroek@mbse.eu>
parents: 391
diff changeset
543 $this->Cell(15,5,sprintf("%.1f", $row['wg_ph']),0,0,'R',true);
544d7d0183b2 Added 15 fields to the recipes table. Added 18 fields to the products table. These are calculated values that are now stored in the database so export programs can use these values without calculating them again. Product and recipe print have water and mash schedule added. Product print has brewday results added if the brewday is over. The ingredients layout changed in the product and recipe prints.
Michiel Broek <mbroek@mbse.eu>
parents: 391
diff changeset
544 $this->Ln();
544d7d0183b2 Added 15 fields to the recipes table. Added 18 fields to the products table. These are calculated values that are now stored in the database so export programs can use these values without calculating them again. Product and recipe print have water and mash schedule added. Product print has brewday results added if the brewday is over. The ingredients layout changed in the product and recipe prints.
Michiel Broek <mbroek@mbse.eu>
parents: 391
diff changeset
545 $this->Cell($vul,5,'Behandeld water',0,0,'L',true);
544d7d0183b2 Added 15 fields to the recipes table. Added 18 fields to the products table. These are calculated values that are now stored in the database so export programs can use these values without calculating them again. Product and recipe print have water and mash schedule added. Product print has brewday results added if the brewday is over. The ingredients layout changed in the product and recipe prints.
Michiel Broek <mbroek@mbse.eu>
parents: 391
diff changeset
546 $this->Cell(20,5,'',0,0,'R',true);
544d7d0183b2 Added 15 fields to the recipes table. Added 18 fields to the products table. These are calculated values that are now stored in the database so export programs can use these values without calculating them again. Product and recipe print have water and mash schedule added. Product print has brewday results added if the brewday is over. The ingredients layout changed in the product and recipe prints.
Michiel Broek <mbroek@mbse.eu>
parents: 391
diff changeset
547 $this->Cell(15,5,sprintf("%.1f", $row['wb_calcium']),0,0,'R',true);
544d7d0183b2 Added 15 fields to the recipes table. Added 18 fields to the products table. These are calculated values that are now stored in the database so export programs can use these values without calculating them again. Product and recipe print have water and mash schedule added. Product print has brewday results added if the brewday is over. The ingredients layout changed in the product and recipe prints.
Michiel Broek <mbroek@mbse.eu>
parents: 391
diff changeset
548 $this->Cell(15,5,sprintf("%.1f", $row['wb_magnesium']),0,0,'R',true);
544d7d0183b2 Added 15 fields to the recipes table. Added 18 fields to the products table. These are calculated values that are now stored in the database so export programs can use these values without calculating them again. Product and recipe print have water and mash schedule added. Product print has brewday results added if the brewday is over. The ingredients layout changed in the product and recipe prints.
Michiel Broek <mbroek@mbse.eu>
parents: 391
diff changeset
549 $this->Cell(15,5,sprintf("%.1f", $row['wb_sodium']),0,0,'R',true);
544d7d0183b2 Added 15 fields to the recipes table. Added 18 fields to the products table. These are calculated values that are now stored in the database so export programs can use these values without calculating them again. Product and recipe print have water and mash schedule added. Product print has brewday results added if the brewday is over. The ingredients layout changed in the product and recipe prints.
Michiel Broek <mbroek@mbse.eu>
parents: 391
diff changeset
550 $this->Cell(15,5,sprintf("%.1f", $row['wb_total_alkalinity']),0,0,'R',true);
544d7d0183b2 Added 15 fields to the recipes table. Added 18 fields to the products table. These are calculated values that are now stored in the database so export programs can use these values without calculating them again. Product and recipe print have water and mash schedule added. Product print has brewday results added if the brewday is over. The ingredients layout changed in the product and recipe prints.
Michiel Broek <mbroek@mbse.eu>
parents: 391
diff changeset
551 $this->Cell(15,5,sprintf("%.1f", $row['wb_chloride']),0,0,'R',true);
544d7d0183b2 Added 15 fields to the recipes table. Added 18 fields to the products table. These are calculated values that are now stored in the database so export programs can use these values without calculating them again. Product and recipe print have water and mash schedule added. Product print has brewday results added if the brewday is over. The ingredients layout changed in the product and recipe prints.
Michiel Broek <mbroek@mbse.eu>
parents: 391
diff changeset
552 $this->Cell(15,5,sprintf("%.1f", $row['wb_sulfate']),0,0,'R',true);
544d7d0183b2 Added 15 fields to the recipes table. Added 18 fields to the products table. These are calculated values that are now stored in the database so export programs can use these values without calculating them again. Product and recipe print have water and mash schedule added. Product print has brewday results added if the brewday is over. The ingredients layout changed in the product and recipe prints.
Michiel Broek <mbroek@mbse.eu>
parents: 391
diff changeset
553 $this->Cell(15,5,sprintf("%.1f", $row['wb_ph']),0,0,'R',true);
544d7d0183b2 Added 15 fields to the recipes table. Added 18 fields to the products table. These are calculated values that are now stored in the database so export programs can use these values without calculating them again. Product and recipe print have water and mash schedule added. Product print has brewday results added if the brewday is over. The ingredients layout changed in the product and recipe prints.
Michiel Broek <mbroek@mbse.eu>
parents: 391
diff changeset
554 $this->ProcessingTable=false;
544d7d0183b2 Added 15 fields to the recipes table. Added 18 fields to the products table. These are calculated values that are now stored in the database so export programs can use these values without calculating them again. Product and recipe print have water and mash schedule added. Product print has brewday results added if the brewday is over. The ingredients layout changed in the product and recipe prints.
Michiel Broek <mbroek@mbse.eu>
parents: 391
diff changeset
555 $this->cMargin=$cMargin;
544d7d0183b2 Added 15 fields to the recipes table. Added 18 fields to the products table. These are calculated values that are now stored in the database so export programs can use these values without calculating them again. Product and recipe print have water and mash schedule added. Product print has brewday results added if the brewday is over. The ingredients layout changed in the product and recipe prints.
Michiel Broek <mbroek@mbse.eu>
parents: 391
diff changeset
556 $this->aCols=array();
544d7d0183b2 Added 15 fields to the recipes table. Added 18 fields to the products table. These are calculated values that are now stored in the database so export programs can use these values without calculating them again. Product and recipe print have water and mash schedule added. Product print has brewday results added if the brewday is over. The ingredients layout changed in the product and recipe prints.
Michiel Broek <mbroek@mbse.eu>
parents: 391
diff changeset
557 $this->Ln();
544d7d0183b2 Added 15 fields to the recipes table. Added 18 fields to the products table. These are calculated values that are now stored in the database so export programs can use these values without calculating them again. Product and recipe print have water and mash schedule added. Product print has brewday results added if the brewday is over. The ingredients layout changed in the product and recipe prints.
Michiel Broek <mbroek@mbse.eu>
parents: 391
diff changeset
558 }
165
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
559
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
560 function TableSummary($row) {
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
561 global $pSugar;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
562 global $pCara;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
563 global $svg;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
564 global $colorw;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
565 global $cost_fermentables;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
566 global $cost_hops;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
567 global $cost_miscs;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
568 global $cost_yeasts;
275
fb1e88f1c643 Better fg estimation in product print.
Michiel Broek <mbroek@mbse.eu>
parents: 247
diff changeset
569 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
570 $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
571 $ibumethod = array( 'Tinseth', 'Rager', 'Daniels' );
165
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
572 /* 2 Columns */
391
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
573 if ($this->GetY() > 200)
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
574 $this->AddPage();
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
575 else
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
576 $this->Ln();
165
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
577 $vul = $this->w - $this->rMargin - $this->lMargin - 170;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
578 $cMargin=$this->cMargin;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
579 $this->cMargin=2;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
580 $this->TableX=$this->lMargin;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
581 $this->SetFont('Helvetica','B',9);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
582 $this->SetX($this->TableX);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
583 $this->SetFillColor(255,150,100);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
584 $this->Cell(0, 5, 'Recept samenvatting',0,0,'C',true);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
585 $this->Ln();
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
586
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
587 $this->SetFont('Helvetica','',9);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
588 $this->SetFillColor(210,245,255);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
589
275
fb1e88f1c643 Better fg estimation in product print.
Michiel Broek <mbroek@mbse.eu>
parents: 247
diff changeset
590 $mashtime = 0;
fb1e88f1c643 Better fg estimation in product print.
Michiel Broek <mbroek@mbse.eu>
parents: 247
diff changeset
591 $mashtemp = 0;
fb1e88f1c643 Better fg estimation in product print.
Michiel Broek <mbroek@mbse.eu>
parents: 247
diff changeset
592 $mash_infuse = 0;
fb1e88f1c643 Better fg estimation in product print.
Michiel Broek <mbroek@mbse.eu>
parents: 247
diff changeset
593 $arr = json_decode($row['json_mashs'], true);
fb1e88f1c643 Better fg estimation in product print.
Michiel Broek <mbroek@mbse.eu>
parents: 247
diff changeset
594 foreach($arr as $item) {
fb1e88f1c643 Better fg estimation in product print.
Michiel Broek <mbroek@mbse.eu>
parents: 247
diff changeset
595 if ($item['step_type'] == 0) { // infusion
fb1e88f1c643 Better fg estimation in product print.
Michiel Broek <mbroek@mbse.eu>
parents: 247
diff changeset
596 $mash_infuse += floatval($item['step_infuse_amount']);
fb1e88f1c643 Better fg estimation in product print.
Michiel Broek <mbroek@mbse.eu>
parents: 247
diff changeset
597 }
fb1e88f1c643 Better fg estimation in product print.
Michiel Broek <mbroek@mbse.eu>
parents: 247
diff changeset
598 if ($item['step_temp'] < 75) { // ignore mashout temps
fb1e88f1c643 Better fg estimation in product print.
Michiel Broek <mbroek@mbse.eu>
parents: 247
diff changeset
599 $mashtime += floatval($item['step_time']);
fb1e88f1c643 Better fg estimation in product print.
Michiel Broek <mbroek@mbse.eu>
parents: 247
diff changeset
600 $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
601 }
fb1e88f1c643 Better fg estimation in product print.
Michiel Broek <mbroek@mbse.eu>
parents: 247
diff changeset
602 }
fb1e88f1c643 Better fg estimation in product print.
Michiel Broek <mbroek@mbse.eu>
parents: 247
diff changeset
603 $mashtemp = $mashtemp / $mashtime;
fb1e88f1c643 Better fg estimation in product print.
Michiel Broek <mbroek@mbse.eu>
parents: 247
diff changeset
604 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
605 $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
606 } else {
fb1e88f1c643 Better fg estimation in product print.
Michiel Broek <mbroek@mbse.eu>
parents: 247
diff changeset
607 $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
608 }
165
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
609
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
610 $this->SetX($this->TableX);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
611 $this->Cell(35,5,'Start SG',0,0,'L',true);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
612 $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
613 $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
614 $this->Cell($vul,5,'',0,0,'L',false);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
615 $this->Cell(35,5,'Eind SG',0,0,'L',true);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
616 $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
617 $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
618 $this->Ln();
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
619
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
620 $row['est_abv'] = abvol($row['est_og'], $row['est_fg']);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
621 $this->SetX($this->TableX);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
622 $this->Cell(35,5,'Geschat alcohol',0,0,'L',true);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
623 $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
624 $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
625 $this->Cell($vul,5,'',0,0,'L',false);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
626 $this->Cell(35,5,'CO2',0,0,'L',true);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
627 $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
628 $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
629 $this->Ln();
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
630
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
631 $row['est_color'] = kw_to_ebc($row['color_method'], $colorw);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
632 $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
633 $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
634 $beercolor = ebc_to_color($row['est_color']);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
635 if ($row['est_color'] > 30)
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
636 $this->SetTextColor(250);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
637 $this->SetFillColor($beercolor[0],$beercolor[1],$beercolor[2]);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
638 $this->Cell(25,5,$row['est_color'].' EBC',0,0,'L',true);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
639 $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
640 $this->SetTextColor(0);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
641 $this->SetFillColor(210,245,255);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
642 $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
643 $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
644 $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
645 $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
646 $this->Ln();
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
647
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
648 $this->SetX($this->TableX);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
649 $cost_total = $cost_fermentables + $cost_hops + $cost_miscs + $cost_yeasts;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
650 $this->Cell(35,5,'Kosten',0,0,'L',true);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
651 $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
652 $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
653
391
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
654 // calorieen
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
655 $this->ProcessingTable=false;
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
656 $this->cMargin=$cMargin;
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
657 $this->aCols=array();
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
658 $this->Ln();
165
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
659 }
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
660
391
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
661 function Brewday($row) {
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
662
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
663 global $my_brix_correction;
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
664 global $my_grain_absorbtion;
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
665
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
666 if ($this->GetY() > 180)
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
667 $this->AddPage();
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
668 else
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
669 $this->Ln(10);
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
670
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
671 $vul = $this->w - $this->rMargin - $this->lMargin - 170;
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
672 $cMargin=$this->cMargin;
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
673 $this->cMargin=2;
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
674 $this->TableX=$this->lMargin;
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
675 $this->SetFont('Helvetica','B',9);
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
676 $this->SetX($this->TableX);
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
677 $this->SetFillColor(255,150,100);
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
678 $this->Cell(0, 5, 'Brouwdag gegevens',0,0,'C',true);
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
679 $this->Ln();
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
680
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
681 $this->SetFont('Helvetica','',9);
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
682 $this->SetFillColor(210,245,255);
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
683
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
684 $this->SetX($this->TableX);
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
685 $this->Cell(35,5,'Datum start',0,0,'L',true);
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
686 $this->Cell(50,5,$row['brew_date_start'],0,0,'L',true);
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
687 $this->Cell($vul,5,'',0,0,'L',false);
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
688 $this->Cell(35,5,'Maisch zuurgraad',0,0,'L',true);
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
689 $this->Cell(50,5,sprintf("%.1f", $row['brew_mash_ph']).' pH',0,0,'L',true);
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
690 $this->Ln();
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
691
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
692 $this->SetX($this->TableX);
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
693 $this->Cell(35,5,'Datum eind',0,0,'L',true);
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
694 $this->Cell(50,5,$row['brew_date_end'],0,0,'L',true);
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
695 $this->Cell($vul,5,'',0,0,'L',false);
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
696 $this->Cell(35,5,'Maisch densiteit',0,0,'L',true);
392
544d7d0183b2 Added 15 fields to the recipes table. Added 18 fields to the products table. These are calculated values that are now stored in the database so export programs can use these values without calculating them again. Product and recipe print have water and mash schedule added. Product print has brewday results added if the brewday is over. The ingredients layout changed in the product and recipe prints.
Michiel Broek <mbroek@mbse.eu>
parents: 391
diff changeset
697 $this->Cell(50,5,density_str(floatval($row['brew_mash_sg'])),0,0,'L',true);
391
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
698 $this->Ln();
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
699
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
700 $this->SetX($this->TableX);
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
701 $this->Cell(85+$vul,5,'',0,0,'L',false);
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
702 $this->Cell(35,5,'Maisch rendement',0,0,'L',true);
392
544d7d0183b2 Added 15 fields to the recipes table. Added 18 fields to the products table. These are calculated values that are now stored in the database so export programs can use these values without calculating them again. Product and recipe print have water and mash schedule added. Product print has brewday results added if the brewday is over. The ingredients layout changed in the product and recipe prints.
Michiel Broek <mbroek@mbse.eu>
parents: 391
diff changeset
703 $this->Cell(50,5,sprintf("%.1f", floatval($row['brew_mash_efficiency']))."%",0,0,'L',true);
391
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
704 $this->Ln(7);
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
705
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
706 $this->SetX($this->TableX);
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
707 $this->Cell(35,5,'Voor koken zuurgraad',0,0,'L',true);
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
708 $this->Cell(50,5,sprintf("%.1f", $row['brew_preboil_ph'])." pH",0,0,'L',true);
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
709 $this->Cell($vul,5,'',0,0,'L',false);
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
710 $this->Cell(35,5,'Na koken zuurgraad',0,0,'L',true);
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
711 $this->Cell(50,5,sprintf("%.1f", $row['brew_aboil_ph'])." pH",0,0,'L',true);
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
712 $this->Ln();
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
713
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
714 $this->SetX($this->TableX);
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
715 $this->Cell(35,5,'Voor koken densiteit',0,0,'L',true);
392
544d7d0183b2 Added 15 fields to the recipes table. Added 18 fields to the products table. These are calculated values that are now stored in the database so export programs can use these values without calculating them again. Product and recipe print have water and mash schedule added. Product print has brewday results added if the brewday is over. The ingredients layout changed in the product and recipe prints.
Michiel Broek <mbroek@mbse.eu>
parents: 391
diff changeset
716 $this->Cell(50,5,density_str(floatval($row['brew_preboil_sg'])),0,0,'L',true);
391
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
717 $this->Cell($vul,5,'',0,0,'L',false);
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
718 $this->Cell(35,5,'Na koken densiteit',0,0,'L',true);
392
544d7d0183b2 Added 15 fields to the recipes table. Added 18 fields to the products table. These are calculated values that are now stored in the database so export programs can use these values without calculating them again. Product and recipe print have water and mash schedule added. Product print has brewday results added if the brewday is over. The ingredients layout changed in the product and recipe prints.
Michiel Broek <mbroek@mbse.eu>
parents: 391
diff changeset
719 $this->Cell(50,5,density_str(floatval($row['brew_aboil_sg'])),0,0,'L',true);
391
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
720 $this->Ln();
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
721
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
722 $this->SetX($this->TableX);
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
723 $this->Cell(35,5,'Voor koken volume',0,0,'L',true);
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
724 $this->Cell(50,5,sprintf("%.1f", $row['brew_preboil_volume'])." liter",0,0,'L',true);
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
725 $this->Cell($vul,5,'',0,0,'L',false);
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
726 $this->Cell(35,5,'Na koken volume',0,0,'L',true);
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
727 $this->Cell(50,5,sprintf("%.1f", $row['brew_aboil_volume'])." liter",0,0,'L',true);
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
728 $this->Ln();
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
729
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
730 $this->SetX($this->TableX);
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
731 $this->Cell(35,5,'Voor koken rendement',0,0,'L',true);
392
544d7d0183b2 Added 15 fields to the recipes table. Added 18 fields to the products table. These are calculated values that are now stored in the database so export programs can use these values without calculating them again. Product and recipe print have water and mash schedule added. Product print has brewday results added if the brewday is over. The ingredients layout changed in the product and recipe prints.
Michiel Broek <mbroek@mbse.eu>
parents: 391
diff changeset
732 $this->Cell(50,5,sprintf("%.1f", floatval($row['brew_preboil_efficiency']))."%",0,0,'L',true);
391
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
733 $this->Cell($vul,5,'',0,0,'L',false);
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
734 $this->Cell(35,5,'Na koken rendement',0,0,'L',true);
392
544d7d0183b2 Added 15 fields to the recipes table. Added 18 fields to the products table. These are calculated values that are now stored in the database so export programs can use these values without calculating them again. Product and recipe print have water and mash schedule added. Product print has brewday results added if the brewday is over. The ingredients layout changed in the product and recipe prints.
Michiel Broek <mbroek@mbse.eu>
parents: 391
diff changeset
735 $this->Cell(50,5,sprintf("%.1f", floatval($row['brew_aboil_efficiency']))."%",0,0,'L',true);
391
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
736 $this->Ln(7);
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
737
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
738 $coolingtype = array( '-', 'Dompelkoeler', 'Tegenstroomkoeler', 'Au bain marie', 'Laten afkoelen' );
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
739 $this->SetX($this->TableX);
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
740 $this->Cell(35,5,'Spoelwater temperatuur',0,0,'L',true);
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
741 $this->Cell(50,5,sprintf("%.1f", $row['brew_sparge_temperature']).DEG.'C',0,0,'L',true);
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
742 $this->Cell($vul,5,'',0,0,'L',false);
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
743 $this->Cell(35,5,'Koel methode',0,0,'L',true);
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
744 $this->Cell(50,5,$coolingtype[$row['brew_cooling_method']],0,0,'L',true);
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
745 $this->Ln();
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
746
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
747 $this->SetX($this->TableX);
392
544d7d0183b2 Added 15 fields to the recipes table. Added 18 fields to the products table. These are calculated values that are now stored in the database so export programs can use these values without calculating them again. Product and recipe print have water and mash schedule added. Product print has brewday results added if the brewday is over. The ingredients layout changed in the product and recipe prints.
Michiel Broek <mbroek@mbse.eu>
parents: 391
diff changeset
748 $this->Cell(35,5,'Spoelwater geschat',0,0,'L',true);
544d7d0183b2 Added 15 fields to the recipes table. Added 18 fields to the products table. These are calculated values that are now stored in the database so export programs can use these values without calculating them again. Product and recipe print have water and mash schedule added. Product print has brewday results added if the brewday is over. The ingredients layout changed in the product and recipe prints.
Michiel Broek <mbroek@mbse.eu>
parents: 391
diff changeset
749 $this->Cell(50,5,sprintf("%.1f", floatval($row['brew_sparge_est'])).' liter',0,0,'L',true);
391
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
750 $this->Cell($vul,5,'',0,0,'L',false);
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
751 $this->Cell(35,5,'Koel temperatuur',0,0,'L',true);
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
752 $this->Cell(50,5,sprintf("%.1f", floatval($row['brew_cooling_to'])).DEG.'C',0,0,'L',true);
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
753 $this->Ln();
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
754
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
755 $this->SetX($this->TableX);
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
756 $this->Cell(35,5,'Spoelwater zuurgraad',0,0,'L',true);
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
757 $this->Cell(50,5,sprintf("%.1f", $row['brew_sparge_ph']).' pH',0,0,'L',true);
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
758 $this->Cell($vul,5,'',0,0,'L',false);
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
759 $this->Cell(35,5,'Koel tijdsduur',0,0,'L',true);
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
760 $this->Cell(50,5,sprintf("%.0f", floatval($row['brew_cooling_time'])).' minuten',0,0,'L',true);
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
761 $this->Ln(7);
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
762
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
763 $this->SetX($this->TableX);
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
764 $this->Cell(35,5,'Whirlpool +85'.DEG.'C',0,0,'L',true);
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
765 $this->Cell(50,5,sprintf("%.0f", $row['brew_whirlpool9']).' minuten',0,0,'L',true);
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
766 $this->Cell($vul,5,'',0,0,'L',false);
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
767 $this->Cell(35,5,'Koeler & trub verlies',0,0,'L',true);
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
768 $this->Cell(50,5,sprintf("%.1f", floatval($row['brew_fermenter_tcloss'])).' liter',0,0,'L',true);
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
769 $this->Ln();
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
770
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
771 $this->SetX($this->TableX);
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
772 $this->Cell(35,5,'Whirlpool 72..79'.DEG.'C',0,0,'L',true);
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
773 $this->Cell(50,5,sprintf("%.0f", $row['brew_whirlpool7']).' minuten',0,0,'L',true);
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
774 $this->Cell($vul,5,'',0,0,'L',false);
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
775 $this->Cell(35,5,'Extra water in gistvat',0,0,'L',true);
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
776 $this->Cell(50,5,sprintf("%.1f", floatval($row['brew_fermenter_extrawater'])).' liter',0,0,'L',true);
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
777 $this->Ln();
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
778
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
779 $this->SetX($this->TableX);
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
780 $this->Cell(35,5,'Whirlpool 60..66'.DEG.'C',0,0,'L',true);
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
781 $this->Cell(50,5,sprintf("%.0f", $row['brew_whirlpool6']).' minuten',0,0,'L',true);
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
782 $this->Cell($vul,5,'',0,0,'L',false);
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
783 $this->Cell(35,5,'Volume naar gistvat',0,0,'L',true);
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
784 $this->Cell(50,5,sprintf("%.1f", floatval($row['brew_fermenter_volume'])).' liter',0,0,'L',true);
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
785 $this->Ln();
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
786
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
787 $this->SetX($this->TableX);
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
788 $this->Cell(35,5,'Whirlpool koud',0,0,'L',true);
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
789 $this->Cell(50,5,sprintf("%.0f", $row['brew_whirlpool2']).' minuten',0,0,'L',true);
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
790 $this->Cell($vul,5,'',0,0,'L',false);
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
791 $this->Cell(35,5,'Densiteit in gistvat',0,0,'L',true);
392
544d7d0183b2 Added 15 fields to the recipes table. Added 18 fields to the products table. These are calculated values that are now stored in the database so export programs can use these values without calculating them again. Product and recipe print have water and mash schedule added. Product print has brewday results added if the brewday is over. The ingredients layout changed in the product and recipe prints.
Michiel Broek <mbroek@mbse.eu>
parents: 391
diff changeset
792 $this->Cell(50,5,density_str(floatval($row['brew_fermenter_sg'])),0,0,'L',true);
391
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
793 $this->Ln(7);
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
794
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
795 $aerationtype = array( 'Geen', 'Lucht', 'Zuurstof' );
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
796 $this->SetX($this->TableX);
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
797 $this->Cell(35,5,'Beluchten met',0,0,'L',true);
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
798 $this->Cell(50,5,$aerationtype[$row['brew_aeration_type']],0,0,'L',true);
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
799 $this->Cell($vul,5,'',0,0,'L',false);
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
800 $this->Cell(35,5,'Kleur in gistvat',0,0,'L',true);
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
801 $this->Cell(50,5,sprintf("%.0f", floatval($row['brew_fermenter_color'])).' EBC',0,0,'L',true);
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
802 $this->Ln();
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
803
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
804 $this->SetX($this->TableX);
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
805 $this->Cell(35,5,'Beluchten snelheid/tijd',0,0,'L',true);
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
806 $this->Cell(50,5,$row['brew_aeration_speed'].'/'.$row['brew_aeration_time'],0,0,'L',true);
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
807 $this->Cell($vul,5,'',0,0,'L',false);
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
808 $this->Cell(35,5,'Bitterheid in gistvat',0,0,'L',true);
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
809 $this->Cell(50,5,sprintf("%.0f", floatval($row['brew_fermenter_ibu'])).' IBU',0,0,'L',true);
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
810 $this->Ln();
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
811 }
421
0bc45502144b Print fermentation summary
Michiel Broek <mbroek@mbse.eu>
parents: 407
diff changeset
812
0bc45502144b Print fermentation summary
Michiel Broek <mbroek@mbse.eu>
parents: 407
diff changeset
813 function Fermentation($row) {
424
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
814
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
815 if ($this->GetY() > 230)
421
0bc45502144b Print fermentation summary
Michiel Broek <mbroek@mbse.eu>
parents: 407
diff changeset
816 $this->AddPage();
0bc45502144b Print fermentation summary
Michiel Broek <mbroek@mbse.eu>
parents: 407
diff changeset
817 else
0bc45502144b Print fermentation summary
Michiel Broek <mbroek@mbse.eu>
parents: 407
diff changeset
818 $this->Ln(10);
0bc45502144b Print fermentation summary
Michiel Broek <mbroek@mbse.eu>
parents: 407
diff changeset
819
0bc45502144b Print fermentation summary
Michiel Broek <mbroek@mbse.eu>
parents: 407
diff changeset
820 $vul = $this->w - $this->rMargin - $this->lMargin - 180;
0bc45502144b Print fermentation summary
Michiel Broek <mbroek@mbse.eu>
parents: 407
diff changeset
821 $cMargin=$this->cMargin;
0bc45502144b Print fermentation summary
Michiel Broek <mbroek@mbse.eu>
parents: 407
diff changeset
822 $this->cMargin=2;
0bc45502144b Print fermentation summary
Michiel Broek <mbroek@mbse.eu>
parents: 407
diff changeset
823 $this->TableX=$this->lMargin;
0bc45502144b Print fermentation summary
Michiel Broek <mbroek@mbse.eu>
parents: 407
diff changeset
824 $this->SetFont('Helvetica','B',9);
0bc45502144b Print fermentation summary
Michiel Broek <mbroek@mbse.eu>
parents: 407
diff changeset
825 $this->SetX($this->TableX);
0bc45502144b Print fermentation summary
Michiel Broek <mbroek@mbse.eu>
parents: 407
diff changeset
826 $this->SetFillColor(255,150,100);
0bc45502144b Print fermentation summary
Michiel Broek <mbroek@mbse.eu>
parents: 407
diff changeset
827 $this->Cell(0, 5, 'Vergisting gegevens',0,0,'C',true);
0bc45502144b Print fermentation summary
Michiel Broek <mbroek@mbse.eu>
parents: 407
diff changeset
828 $this->Ln();
0bc45502144b Print fermentation summary
Michiel Broek <mbroek@mbse.eu>
parents: 407
diff changeset
829
0bc45502144b Print fermentation summary
Michiel Broek <mbroek@mbse.eu>
parents: 407
diff changeset
830 $this->SetFont('Helvetica','',9);
0bc45502144b Print fermentation summary
Michiel Broek <mbroek@mbse.eu>
parents: 407
diff changeset
831 $this->SetFillColor(210,245,255);
0bc45502144b Print fermentation summary
Michiel Broek <mbroek@mbse.eu>
parents: 407
diff changeset
832
0bc45502144b Print fermentation summary
Michiel Broek <mbroek@mbse.eu>
parents: 407
diff changeset
833 $this->SetX($this->TableX);
0bc45502144b Print fermentation summary
Michiel Broek <mbroek@mbse.eu>
parents: 407
diff changeset
834 $this->Cell(45,5,'Hoofdvergisting start temp.',0,0,'L',true);
0bc45502144b Print fermentation summary
Michiel Broek <mbroek@mbse.eu>
parents: 407
diff changeset
835 $this->Cell(45,5,sprintf("%.1f",$row['primary_start_temp']).DEG.'C',0,0,'L',true);
0bc45502144b Print fermentation summary
Michiel Broek <mbroek@mbse.eu>
parents: 407
diff changeset
836 $this->Cell($vul,5,'',0,0,'L',false);
0bc45502144b Print fermentation summary
Michiel Broek <mbroek@mbse.eu>
parents: 407
diff changeset
837 $this->Cell(45,5,'Navergisting tempertuur',0,0,'L',true);
0bc45502144b Print fermentation summary
Michiel Broek <mbroek@mbse.eu>
parents: 407
diff changeset
838 $this->Cell(45,5,sprintf("%.1f", $row['secondary_temp']).DEG.'C',0,0,'L',true);
0bc45502144b Print fermentation summary
Michiel Broek <mbroek@mbse.eu>
parents: 407
diff changeset
839 $this->Ln();
0bc45502144b Print fermentation summary
Michiel Broek <mbroek@mbse.eu>
parents: 407
diff changeset
840
0bc45502144b Print fermentation summary
Michiel Broek <mbroek@mbse.eu>
parents: 407
diff changeset
841 $this->SetX($this->TableX);
0bc45502144b Print fermentation summary
Michiel Broek <mbroek@mbse.eu>
parents: 407
diff changeset
842 $this->Cell(45,5,'Hoofdvergisting piek temp.',0,0,'L',true);
0bc45502144b Print fermentation summary
Michiel Broek <mbroek@mbse.eu>
parents: 407
diff changeset
843 $this->Cell(45,5,sprintf("%.1f",$row['primary_max_temp']).DEG.'C',0,0,'L',true);
0bc45502144b Print fermentation summary
Michiel Broek <mbroek@mbse.eu>
parents: 407
diff changeset
844 $this->Cell($vul,5,'',0,0,'L',false);
0bc45502144b Print fermentation summary
Michiel Broek <mbroek@mbse.eu>
parents: 407
diff changeset
845 $this->Cell(45,5,'Navergisting einde',0,0,'L',true);
0bc45502144b Print fermentation summary
Michiel Broek <mbroek@mbse.eu>
parents: 407
diff changeset
846 $this->Cell(45,5,$row['secondary_end_date'],0,0,'L',true);
0bc45502144b Print fermentation summary
Michiel Broek <mbroek@mbse.eu>
parents: 407
diff changeset
847 $this->Ln();
0bc45502144b Print fermentation summary
Michiel Broek <mbroek@mbse.eu>
parents: 407
diff changeset
848
0bc45502144b Print fermentation summary
Michiel Broek <mbroek@mbse.eu>
parents: 407
diff changeset
849 $this->SetX($this->TableX);
0bc45502144b Print fermentation summary
Michiel Broek <mbroek@mbse.eu>
parents: 407
diff changeset
850 $this->Cell(45,5,'Hoofdvergisting eind temp.',0,0,'L',true);
0bc45502144b Print fermentation summary
Michiel Broek <mbroek@mbse.eu>
parents: 407
diff changeset
851 $this->Cell(45,5,sprintf("%.1f",$row['primary_end_temp']).DEG.'C',0,0,'L',true);
0bc45502144b Print fermentation summary
Michiel Broek <mbroek@mbse.eu>
parents: 407
diff changeset
852 $this->Cell($vul,5,'',0,0,'L',false);
0bc45502144b Print fermentation summary
Michiel Broek <mbroek@mbse.eu>
parents: 407
diff changeset
853 $this->Cell(45,5,'Lageren temperatuur',0,0,'L',true);
0bc45502144b Print fermentation summary
Michiel Broek <mbroek@mbse.eu>
parents: 407
diff changeset
854 $this->Cell(45,5,sprintf("%.1f",$row['tertiary_temp']).DEG.'C',0,0,'L',true);
0bc45502144b Print fermentation summary
Michiel Broek <mbroek@mbse.eu>
parents: 407
diff changeset
855 $this->Ln();
0bc45502144b Print fermentation summary
Michiel Broek <mbroek@mbse.eu>
parents: 407
diff changeset
856
0bc45502144b Print fermentation summary
Michiel Broek <mbroek@mbse.eu>
parents: 407
diff changeset
857 $this->SetX($this->TableX);
0bc45502144b Print fermentation summary
Michiel Broek <mbroek@mbse.eu>
parents: 407
diff changeset
858 $this->Cell(45,5,'Hoofdvergisting densiteit',0,0,'L',true);
0bc45502144b Print fermentation summary
Michiel Broek <mbroek@mbse.eu>
parents: 407
diff changeset
859 $this->Cell(45,5,density_str(floatval($row['primary_end_sg'])),0,0,'L',true);
0bc45502144b Print fermentation summary
Michiel Broek <mbroek@mbse.eu>
parents: 407
diff changeset
860 $this->Cell($vul,5,'',0,0,'L',false);
0bc45502144b Print fermentation summary
Michiel Broek <mbroek@mbse.eu>
parents: 407
diff changeset
861 $this->Cell(45,5,'Lageren densiteit',0,0,'L',true);
0bc45502144b Print fermentation summary
Michiel Broek <mbroek@mbse.eu>
parents: 407
diff changeset
862 $this->Cell(45,5,density_str(floatval($row['fg'])),0,0,'L',true);
0bc45502144b Print fermentation summary
Michiel Broek <mbroek@mbse.eu>
parents: 407
diff changeset
863 $this->Ln();
0bc45502144b Print fermentation summary
Michiel Broek <mbroek@mbse.eu>
parents: 407
diff changeset
864
0bc45502144b Print fermentation summary
Michiel Broek <mbroek@mbse.eu>
parents: 407
diff changeset
865 $this->SetX($this->TableX);
0bc45502144b Print fermentation summary
Michiel Broek <mbroek@mbse.eu>
parents: 407
diff changeset
866 $this->Cell(45,5,'Hoofdvergisting einde',0,0,'L',true);
0bc45502144b Print fermentation summary
Michiel Broek <mbroek@mbse.eu>
parents: 407
diff changeset
867 $this->Cell(45,5,$row['primary_end_date'],0,0,'L',true);
0bc45502144b Print fermentation summary
Michiel Broek <mbroek@mbse.eu>
parents: 407
diff changeset
868 $this->Cell($vul,5,'',0,0,'L',false);
0bc45502144b Print fermentation summary
Michiel Broek <mbroek@mbse.eu>
parents: 407
diff changeset
869 $this->Cell(45,5,'Lageren einde',0,0,'L',true);
0bc45502144b Print fermentation summary
Michiel Broek <mbroek@mbse.eu>
parents: 407
diff changeset
870 $this->Cell(45,5,$row['package_date'],0,0,'L',true);
0bc45502144b Print fermentation summary
Michiel Broek <mbroek@mbse.eu>
parents: 407
diff changeset
871 $this->Ln();
0bc45502144b Print fermentation summary
Michiel Broek <mbroek@mbse.eu>
parents: 407
diff changeset
872
0bc45502144b Print fermentation summary
Michiel Broek <mbroek@mbse.eu>
parents: 407
diff changeset
873 $svg = 100 * (floatval($row['brew_fermenter_sg']) - floatval($row['fg'])) / (floatval($row['brew_fermenter_sg']) - 1);
0bc45502144b Print fermentation summary
Michiel Broek <mbroek@mbse.eu>
parents: 407
diff changeset
874 $this->SetX($this->TableX);
0bc45502144b Print fermentation summary
Michiel Broek <mbroek@mbse.eu>
parents: 407
diff changeset
875 $this->Cell($vul+90,5,'',0,0,'L',false);
0bc45502144b Print fermentation summary
Michiel Broek <mbroek@mbse.eu>
parents: 407
diff changeset
876 $this->Cell(45,5,'Schijnbare vergistingsgraad',0,0,'L',true);
0bc45502144b Print fermentation summary
Michiel Broek <mbroek@mbse.eu>
parents: 407
diff changeset
877 $this->Cell(45,5,sprintf("%.1f",$svg).'%',0,0,'L',true);
0bc45502144b Print fermentation summary
Michiel Broek <mbroek@mbse.eu>
parents: 407
diff changeset
878 $this->Ln();
0bc45502144b Print fermentation summary
Michiel Broek <mbroek@mbse.eu>
parents: 407
diff changeset
879 }
0bc45502144b Print fermentation summary
Michiel Broek <mbroek@mbse.eu>
parents: 407
diff changeset
880
0bc45502144b Print fermentation summary
Michiel Broek <mbroek@mbse.eu>
parents: 407
diff changeset
881 function Packaging($row) {
0bc45502144b Print fermentation summary
Michiel Broek <mbroek@mbse.eu>
parents: 407
diff changeset
882
424
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
883 global $bottle_sugar;
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
884 global $bottle_sugar_amount;
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
885 global $keg_sugar;
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
886 global $keg_sugar_amount;
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
887
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
888 if ($this->GetY() > 230)
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
889 $this->AddPage();
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
890 else
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
891 $this->Ln(10);
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
892
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
893 $vul = $this->w - $this->rMargin - $this->lMargin - 180;
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
894 $cMargin=$this->cMargin;
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
895 $this->cMargin=2;
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
896 $this->TableX=$this->lMargin;
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
897 $this->SetFont('Helvetica','B',9);
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
898 $this->SetX($this->TableX);
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
899 $this->SetFillColor(255,150,100);
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
900 $this->Cell(0, 5, 'Verpakken',0,0,'C',true);
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
901 $this->Ln();
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
902
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
903 $this->SetFont('Helvetica','',9);
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
904 $this->SetFillColor(210,245,255);
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
905
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
906 $this->SetX($this->TableX);
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
907 $this->Cell(45,5,'Datum verpakken',0,0,'L',true);
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
908 $this->Cell(45,5,$row['package_date'],0,0,'L',true);
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
909 $this->Cell($vul,5,'',0,0,'L',false);
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
910 $this->Cell(45,5,'Hoeveelheid',0,0,'L',true);
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
911 $this->Cell(45,5,sprintf("%.1f", $row['package_volume']).' liter',0,0,'L',true);
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
912 $this->Ln();
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
913
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
914 $this->SetX($this->TableX);
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
915 $this->Cell(45,5,'Alcohol volume',0,0,'L',true);
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
916 $this->Cell(45,5,sprintf("%.1f",$row['package_abv']).'%',0,0,'L',true);
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
917 if (($row['package_infuse_amount'] > 0) && ($row['package_infuse_abv'] == 0)) {
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
918 $this->Cell($vul,5,'',0,0,'L',false);
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
919 $this->Cell(45,5,'Water toevoegen',0,0,'L',true);
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
920 $this->Cell(45,5,sprintf("%.1f", $row['package_infuse_amount']).' liter',0,0,'L',true);
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
921 }
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
922 $this->Ln(7);
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
923
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
924 if (($row['package_infuse_amount'] > 0) && ($row['package_infuse_abv'] > 0)) {
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
925 $this->SetX($this->TableX);
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
926 $this->Cell(45,5,'Drank toevoegen',0,0,'L',true);
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
927 $this->Cell(45,5,sprintf("%.1f",$row['package_infuse_amount']).' liter',0,0,'L',true);
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
928 $this->Cell($vul,5,'',0,0,'L',false);
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
929 $this->Cell(45,5,'Bevat alcohol volume',0,0,'L',true);
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
930 $this->Cell(45,5,sprintf("%.1f", $row['package_infuse_abv']).'%',0,0,'L',true);
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
931 $this->Ln();
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
932
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
933 $this->SetX($this->TableX);
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
934 $this->Cell(180,5,iconv('UTF-8','windows-1252',$row['package_infuse_notes']),0,0,'L',true);
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
935 $this->Ln(7);
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
936 }
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
937
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
938 $this->SetX($this->TableX);
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
939 $this->Cell(45,5,'Flessen volume',0,0,'L',true);
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
940 $this->Cell(45,5,sprintf("%.1f",$row['bottle_amount']).' liter',0,0,'L',true);
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
941 $this->Cell($vul,5,'',0,0,'L',false);
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
942 $this->Cell(45,5,'Fusten volume',0,0,'L',true);
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
943 $this->Cell(45,5,sprintf("%.1f", $row['keg_amount']).' liter',0,0,'L',true);
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
944 $this->Ln();
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
945
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
946 $this->SetX($this->TableX);
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
947 $this->Cell(45,5,'CO2 volumes',0,0,'L',true);
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
948 $this->Cell(45,5,sprintf("%.2f",$row['bottle_carbonation']),0,0,'L',true);
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
949 $this->Cell($vul,5,'',0,0,'L',false);
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
950 $this->Cell(45,5,'CO2 volumes',0,0,'L',true);
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
951 $this->Cell(45,5,sprintf("%.2f", $row['keg_carbonation']),0,0,'L',true);
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
952 $this->Ln();
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
953
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
954 $this->SetX($this->TableX);
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
955 $this->Cell(45,5,'Suiker',0,0,'L',true);
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
956 $this->Cell(45,5,$bottle_sugar,0,0,'L',true);
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
957 $this->Cell($vul,5,'',0,0,'L',false);
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
958 $this->Cell(45,5,'Suiker',0,0,'L',true);
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
959 $this->Cell(45,5,$keg_sugar,0,0,'L',true);
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
960 $this->Ln();
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
961
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
962 $this->SetX($this->TableX);
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
963 $this->Cell(45,5,'Hoeveelheid',0,0,'L',true);
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
964 $this->Cell(45,5,sprintf("%.1f",$row['bottle_priming_amount']).' gram/liter',0,0,'L',true);
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
965 $this->Cell($vul,5,'',0,0,'L',false);
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
966 if ($row['keg_forced_carb']) {
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
967 $this->Cell(45,5,'Geforceerd op druk zetten',0,0,'L',true);
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
968 $this->Cell(45,5,'Ja',0,0,'L',true);
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
969 } else {
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
970 $this->Cell(45,5,'Hoeveelheid',0,0,'L',true);
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
971 $this->Cell(45,5,sprintf("%.1f", $row['keg_priming_amount']).' gram/liter',0,0,'L',true);
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
972 }
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
973 $this->Ln();
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
974
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
975 $this->SetX($this->TableX);
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
976 $this->Cell(45,5,'Totaal suiker',0,0,'L',true);
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
977 $this->Cell(45,5,sprintf("%.3f",$bottle_sugar_amount).' kg',0,0,'L',true);
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
978 $this->Cell($vul,5,'',0,0,'L',false);
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
979 if ($row['keg_forced_carb']) {
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
980 $this->Cell(45,5,'Druk op fust',0,0,'L',true);
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
981 $this->Cell(45,5,sprintf("%.1f",$row['keg_pressure']).' bar',0,0,'L',true);
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
982 } else {
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
983 $this->Cell(45,5,'Totaal suiker',0,0,'L',true);
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
984 $this->Cell(45,5,sprintf("%.3f",$keg_sugar_amount).' kg',0,0,'L',true);
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
985 }
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
986 $this->Ln();
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
987
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
988 $this->SetX($this->TableX);
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
989 $this->Cell(45,5,'Water oplossen',0,0,'L',true);
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
990 $this->Cell(45,5,sprintf("%.3f",$row['bottle_priming_water']).' liter',0,0,'L',true);
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
991 $this->Cell($vul,5,'',0,0,'L',false);
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
992 if (! $row['keg_forced_carb']) {
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
993 $this->Cell(45,5,'Water oplossen',0,0,'L',true);
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
994 $this->Cell(45,5,sprintf("%.3f",$row['keg_priming_water']).' liter',0,0,'L',true);
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
995 }
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
996 $this->Ln();
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
997
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
998 $this->SetX($this->TableX);
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
999 $this->Cell(45,5,'Alcohol volume',0,0,'L',true);
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
1000 $this->Cell(45,5,sprintf("%.1f",$row['package_abv'] + $row['bottle_priming_amount'] * 0.47 / 7.907).'%',0,0,'L',true);
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
1001 $this->Cell($vul,5,'',0,0,'L',false);
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
1002 $this->Cell(45,5,'Alcohol volume',0,0,'L',true);
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
1003 $this->Cell(45,5,sprintf("%.1f",$row['package_abv'] + $row['keg_priming_amount'] * 0.47 / 7.907).'%',0,0,'L',true);
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
1004 $this->Ln();
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
1005
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
1006 $this->SetX($this->TableX);
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
1007 $this->Cell(45,5,'Hergisting temperatuur',0,0,'L',true);
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
1008 $this->Cell(45,5,sprintf("%.1f",$row['bottle_carbonation_temp']).DEG.'C',0,0,'L',true);
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
1009 $this->Cell($vul,5,'',0,0,'L',false);
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
1010 $this->Cell(45,5,'Hergisting temperatuur',0,0,'L',true);
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
1011 $this->Cell(45,5,sprintf("%.1f", $row['keg_carbonation_temp']).DEG.'C',0,0,'L',true);
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
1012 $this->Ln();
421
0bc45502144b Print fermentation summary
Michiel Broek <mbroek@mbse.eu>
parents: 407
diff changeset
1013 }
0bc45502144b Print fermentation summary
Michiel Broek <mbroek@mbse.eu>
parents: 407
diff changeset
1014
0bc45502144b Print fermentation summary
Michiel Broek <mbroek@mbse.eu>
parents: 407
diff changeset
1015 function Tasting($row) {
0bc45502144b Print fermentation summary
Michiel Broek <mbroek@mbse.eu>
parents: 407
diff changeset
1016
424
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
1017 if ($this->GetY() > 200)
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
1018 $this->AddPage();
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
1019 else
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
1020 $this->Ln(10);
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
1021
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
1022 $vul = $this->w - $this->rMargin - $this->lMargin - 180;
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
1023 $cMargin=$this->cMargin;
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
1024 $this->cMargin=2;
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
1025 $this->TableX=$this->lMargin;
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
1026 $this->SetFont('Helvetica','B',9);
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
1027 $this->SetX($this->TableX);
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
1028 $this->SetFillColor(255,150,100);
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
1029 $this->Cell(0, 5, 'Proef notities',0,0,'C',true);
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
1030 $this->Ln();
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
1031
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
1032 $this->SetFont('Helvetica','',9);
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
1033 $this->SetFillColor(210,245,255);
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
1034
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
1035 $this->SetX($this->TableX);
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
1036 $this->Cell(45,5,'Proeven datum',0,0,'L',true);
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
1037 $this->Cell(45,5,$row['taste_date'],0,0,'L',true);
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
1038 $this->Cell($vul,5,'',0,0,'L',false);
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
1039 $this->Cell(45,5,'Waardering',0,0,'L',true);
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
1040 $this->Cell(45,5,sprintf("%.1f", $row['taste_rate']),0,0,'L',true);
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
1041 $this->Ln();
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
1042
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
1043 $this->SetX($this->TableX);
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
1044 $this->Cell(45,5,'Kleur',0,0,'L',true);
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
1045 $this->Cell($vul+135,5,iconv('UTF-8','windows-1252',$row['taste_color']),0,0,'L',true);
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
1046 $this->Ln();
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
1047
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
1048 $this->SetX($this->TableX);
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
1049 $this->Cell(45,5,'Helderheid',0,0,'L',true);
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
1050 $this->Cell($vul+135,5,iconv('UTF-8','windows-1252',$row['taste_transparency']),0,0,'L',true);
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
1051 $this->Ln();
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
1052
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
1053 $this->SetX($this->TableX);
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
1054 $this->Cell(45,5,'Schuim',0,0,'L',true);
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
1055 $this->Cell($vul+135,5,iconv('UTF-8','windows-1252',$row['taste_head']),0,0,'L',true);
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
1056 $this->Ln();
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
1057
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
1058 $this->SetX($this->TableX);
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
1059 $this->Cell(45,5,'Aroma',0,0,'L',true);
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
1060 $this->Cell($vul+135,5,iconv('UTF-8','windows-1252',$row['taste_aroma']),0,0,'L',true);
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
1061 $this->Ln();
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
1062
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
1063 $this->SetX($this->TableX);
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
1064 $this->Cell(45,5,'Smaak',0,0,'L',true);
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
1065 $this->Cell($vul+135,5,iconv('UTF-8','windows-1252',$row['taste_taste']),0,0,'L',true);
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
1066 $this->Ln();
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
1067
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
1068 $this->SetX($this->TableX);
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
1069 $this->Cell(45,5,'Mondgevoel',0,0,'L',true);
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
1070 $this->Cell($vul+135,5,iconv('UTF-8','windows-1252',$row['taste_mouthfeel']),0,0,'L',true);
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
1071 $this->Ln();
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
1072
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
1073 $this->SetX($this->TableX);
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
1074 $this->Cell(45,5,'Nasmaak',0,0,'L',true);
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
1075 $this->Cell($vul+135,5,iconv('UTF-8','windows-1252',$row['taste_aftertaste']),0,0,'L',true);
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
1076 $this->Ln();
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
1077
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
1078 $this->SetX($this->TableX);
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
1079 $this->Cell(45,5,'Notities',0,0,'L',true);
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
1080 $this->MultiCell(0,5,iconv('UTF-8','windows-1252',$row['taste_notes']),0,'L',true);
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
1081 $this->Ln();
421
0bc45502144b Print fermentation summary
Michiel Broek <mbroek@mbse.eu>
parents: 407
diff changeset
1082 }
165
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1083 }
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1084
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1085
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1086
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1087 class PDF extends PDF_MySQL_Table {
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1088 function Header() {
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1089 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
1090 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
1091 $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
1092 $this->Image('images/logo.png',10,10,30);
165
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1093 // Title
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1094 $this->SetFont('Helvetica','B',18);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1095 $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
1096 $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
1097 $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
1098 $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
1099 $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
1100 $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
1101 $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
1102 $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
1103 $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
1104 $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
1105 $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
1106 $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
1107 $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
1108 $this->Ln(6);
165
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1109 // Ensure table header is printed
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1110 parent::Header();
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1111 }
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1112 }
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1113
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1114
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1115 /*
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1116 * Generate PDF from recipe data
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1117 */
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1118 $pdf = new PDF();
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1119 $pdf->AddPage();
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1120 $pdf->TableGlobal($row);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1121 $pdf->TableFermentables($row);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1122 $pdf->TableHops($row);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1123 $pdf->TableYeasts($row);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1124 $pdf->TableMiscs($row);
391
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
1125 $pdf->TableMashs($row);
392
544d7d0183b2 Added 15 fields to the recipes table. Added 18 fields to the products table. These are calculated values that are now stored in the database so export programs can use these values without calculating them again. Product and recipe print have water and mash schedule added. Product print has brewday results added if the brewday is over. The ingredients layout changed in the product and recipe prints.
Michiel Broek <mbroek@mbse.eu>
parents: 391
diff changeset
1126 $pdf->TableWaters($row);
165
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1127 $pdf->TableSummary($row);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1128 if (strlen($row['notes'])) {
391
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
1129 if ($pdf->GetY() > 200)
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
1130 $pdf->AddPage();
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
1131 else
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
1132 $pdf->Ln(10);
165
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1133 $pdf->SetFillColor(255,150,100);
391
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
1134 $pdf->SetFont('Helvetica','B',9);
165
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1135 $pdf->Cell(0, 5, 'Recept opmerkingen',0,0,'C',true);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1136 $pdf->Ln();
391
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
1137 $pdf->SetFont('Helvetica','',9);
165
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1138 $pdf->SetFillColor(210,245,255);
421
0bc45502144b Print fermentation summary
Michiel Broek <mbroek@mbse.eu>
parents: 407
diff changeset
1139 $pdf->MultiCell(0,4,iconv('UTF-8','windows-1252',$row['notes']),0,'L',true);
165
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1140 }
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
1141
391
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
1142 if ($row['stage'] > 2) {
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
1143 $pdf->Brewday($row);
240
a85c1d4c4d12 Depending on the product stage, more or less fields are saved in the database. Added begin of auto stage increase. Added missing inventory columns in the fermentables grid. New product wizzard now works with the indexed values. Product print works with indexed values and prepared for different print modules depending on the product stage.
Michiel Broek <mbroek@mbse.eu>
parents: 165
diff changeset
1144 }
391
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
1145
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
1146 if ($row['stage'] > 3) {
421
0bc45502144b Print fermentation summary
Michiel Broek <mbroek@mbse.eu>
parents: 407
diff changeset
1147 $pdf->Fermentation($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
1148 }
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
1149 if ($row['stage'] > 6) {
421
0bc45502144b Print fermentation summary
Michiel Broek <mbroek@mbse.eu>
parents: 407
diff changeset
1150 $pdf->Packaging($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
1151 }
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
1152 if ($row['stage'] > 9) {
421
0bc45502144b Print fermentation summary
Michiel Broek <mbroek@mbse.eu>
parents: 407
diff changeset
1153 $pdf->Tasting($row);
240
a85c1d4c4d12 Depending on the product stage, more or less fields are saved in the database. Added begin of auto stage increase. Added missing inventory columns in the fermentables grid. New product wizzard now works with the indexed values. Product print works with indexed values and prepared for different print modules depending on the product stage.
Michiel Broek <mbroek@mbse.eu>
parents: 165
diff changeset
1154 }
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
1155
165
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1156 $pdf->Output();

mercurial