www/prod_print.php

Mon, 28 Oct 2019 20:52:17 +0100

author
Michiel Broek <mbroek@mbse.eu>
date
Mon, 28 Oct 2019 20:52:17 +0100
changeset 543
c062eb0dd7ce
parent 542
dabe1c854a0f
child 589
b6a73022abe7
permissions
-rw-r--r--

Round total batch volume to 2 ddecimals.

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');
514
3c680d1dea35 Added dutch array strings to a global php script. Changed fermentables, hops, yeast and misc inventory scripts to use these strings between the database scripts and javascript scripts. This makes filtering on types strings useable. Added these changes to the product/recipe forum and print exports too.
Michiel Broek <mbroek@mbse.eu>
parents: 460
diff changeset
4 require_once($_SERVER['DOCUMENT_ROOT'].'/includes/constants.php');
165
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5 require_once($_SERVER['DOCUMENT_ROOT'].'/fpdf/fpdf.php');
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
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8 $link = mysqli_connect(DBASE_HOST,DBASE_USER,DBASE_PASS,DBASE_NAME);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9 if (! $link) {
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
10 die('Connect Error (' . mysqli_connect_errno() . ') ' . mysqli_connect_error());
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
11 }
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
12 if (! mysqli_set_charset($link, "utf8" )) {
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
13 echo "error";
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
14 return 1;
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
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
17 setlocale ( LC_ALL, 'nl_NL.UTF-8');
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
18 $record = $_GET["record"];
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
19 $result = mysqli_query($link, "SELECT * FROM products WHERE record='".$record."'");
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
20 $row = mysqli_fetch_array($result);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
21
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
22 $total_fermentables = 0.0;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
23 $cost_fermentables = 0.0;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
24 $total_hops = 0.0;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
25 $cost_hops = 0.0;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
26 $cost_yeasts = 0.0;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
27 $cost_miscs = 0.0;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
28 $pSugar = 0;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
29 $pCara = 0;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
30 $svg = 77;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
31 $colorw = 0;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
32 $total_ibus = 0;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
33 $preboil_sg = 0;
275
fb1e88f1c643 Better fg estimation in product print.
Michiel Broek <mbroek@mbse.eu>
parents: 247
diff changeset
34 $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
35 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
36 $prdate = date(DATE_RFC2822);
424
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
37 $bottle_sugar = '';
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
38 $keg_sugar = '';
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
39 $bottle_sugar_amount = 0;
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
40 $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
41
534
01fa81a33b70 Product print shows split batch information. All calculations are done on the split batch data, not the whole batch.
Michiel Broek <mbroek@mbse.eu>
parents: 516
diff changeset
42 $divide_parts = $row['divide_parts'];
01fa81a33b70 Product print shows split batch information. All calculations are done on the split batch data, not the whole batch.
Michiel Broek <mbroek@mbse.eu>
parents: 516
diff changeset
43 $divide_part = $row['divide_part'];
01fa81a33b70 Product print shows split batch information. All calculations are done on the split batch data, not the whole batch.
Michiel Broek <mbroek@mbse.eu>
parents: 516
diff changeset
44 $divide_factor = floatval($row['divide_factor']);
165
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
45
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
46 class PDF_MySQL_Table extends FPDF
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 protected $ProcessingTable=false;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
49 protected $aCols=array();
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
50 protected $TableX;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
51
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
52 function Header() {
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
53 // Print the table header if necessary
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
54 if ($this->ProcessingTable)
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
55 $this->TableHeader();
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
56 }
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
57
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
58 function TableHeader() {
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
59 $this->SetFont('Helvetica','B',9);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
60 $this->SetX($this->TableX);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
61 $this->SetFillColor(255,150,100);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
62 foreach($this->aCols as $col)
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
63 $this->Cell($col['w'],5,$col['c'],0,0,$col['a'],true);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
64 $this->Ln();
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 AddCol($width=-1, $caption='', $align='L') {
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
68 $this->aCols[]=array('c'=>$caption,'w'=>$width,'a'=>$align);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
69 }
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
70
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
71 function TableGlobal($row) {
514
3c680d1dea35 Added dutch array strings to a global php script. Changed fermentables, hops, yeast and misc inventory scripts to use these strings between the database scripts and javascript scripts. This makes filtering on types strings useable. Added these changes to the product/recipe forum and print exports too.
Michiel Broek <mbroek@mbse.eu>
parents: 460
diff changeset
72 global $recipetype;
534
01fa81a33b70 Product print shows split batch information. All calculations are done on the split batch data, not the whole batch.
Michiel Broek <mbroek@mbse.eu>
parents: 516
diff changeset
73 global $divide_parts;
01fa81a33b70 Product print shows split batch information. All calculations are done on the split batch data, not the whole batch.
Michiel Broek <mbroek@mbse.eu>
parents: 516
diff changeset
74 global $divide_part;
01fa81a33b70 Product print shows split batch information. All calculations are done on the split batch data, not the whole batch.
Michiel Broek <mbroek@mbse.eu>
parents: 516
diff changeset
75 global $divide_factor;
01fa81a33b70 Product print shows split batch information. All calculations are done on the split batch data, not the whole batch.
Michiel Broek <mbroek@mbse.eu>
parents: 516
diff changeset
76 global $splitat;
165
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
77 /* 2 Columns */
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
78 $vul = $this->w - $this->rMargin - $this->lMargin - 160;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
79 $cMargin=$this->cMargin;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
80 $this->cMargin=2;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
81 $this->TableX=$this->lMargin;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
82 $this->SetFont('Helvetica','B',9);
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->SetFillColor(255,150,100);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
85 $this->Cell(0, 5, 'Recept overzicht',0,0,'C',true);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
86 $this->Ln();
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
87
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
88 $this->SetFont('Helvetica','',9);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
89 $this->SetFillColor(210,245,255);
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);
534
01fa81a33b70 Product print shows split batch information. All calculations are done on the split batch data, not the whole batch.
Michiel Broek <mbroek@mbse.eu>
parents: 516
diff changeset
92 $this->Cell(35,5,'Brouw 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
93 $this->Cell(45,5,$recipetype[$row['type']],0,0,'L',true);
165
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,'Batch grootte',0,0,'L',true);
534
01fa81a33b70 Product print shows split batch information. All calculations are done on the split batch data, not the whole batch.
Michiel Broek <mbroek@mbse.eu>
parents: 516
diff changeset
96 if ($divide_parts == 0)
01fa81a33b70 Product print shows split batch information. All calculations are done on the split batch data, not the whole batch.
Michiel Broek <mbroek@mbse.eu>
parents: 516
diff changeset
97 $this->Cell(45,5,$row['batch_size'].' liter',0,0,'L',true);
01fa81a33b70 Product print shows split batch information. All calculations are done on the split batch data, not the whole batch.
Michiel Broek <mbroek@mbse.eu>
parents: 516
diff changeset
98 else
543
c062eb0dd7ce Round total batch volume to 2 ddecimals.
Michiel Broek <mbroek@mbse.eu>
parents: 542
diff changeset
99 $this->Cell(45,5,$row['batch_size'].' van '.sprintf("%.2f", ($row['batch_size'] * (1 / $divide_factor))).' liter',0,0,'L',true);
165
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
100 $this->Ln();
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
101
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
102 $this->SetX($this->TableX);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
103 $this->Cell(35,5,'Kooktijd',0,0,'L',true);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
104 $this->Cell(45,5,$row['boil_time'].' minuten',0,0,'L',true);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
105 $this->Cell($vul,5,'',0,0,'L',false);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
106 $this->Cell(35,5,'Brouwzaal rendement',0,0,'L',true);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
107 $this->Cell(45,5,$row['efficiency'].' %',0,0,'L',true);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
108 $this->Ln();
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 $this->SetX($this->TableX);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
111 $this->Cell(35,5,'Bierstijl',0,0,'L',true);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
112 $this->Cell(45,5,$row['st_name'],0,0,'L',true);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
113 $this->Cell($vul,5,'',0,0,'L',false);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
114 $this->Cell(35,5,'Installatie',0,0,'L',true);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
115 $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
116 $this->Ln();
165
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
117
534
01fa81a33b70 Product print shows split batch information. All calculations are done on the split batch data, not the whole batch.
Michiel Broek <mbroek@mbse.eu>
parents: 516
diff changeset
118 if ($divide_parts) {
01fa81a33b70 Product print shows split batch information. All calculations are done on the split batch data, not the whole batch.
Michiel Broek <mbroek@mbse.eu>
parents: 516
diff changeset
119 $this->SetX($this->TableX);
01fa81a33b70 Product print shows split batch information. All calculations are done on the split batch data, not the whole batch.
Michiel Broek <mbroek@mbse.eu>
parents: 516
diff changeset
120 $this->Cell(35,5,'Batch splits moment',0,0,'L',true);
01fa81a33b70 Product print shows split batch information. All calculations are done on the split batch data, not the whole batch.
Michiel Broek <mbroek@mbse.eu>
parents: 516
diff changeset
121 $this->Cell(45,5,$splitat[$row['divide_type']],0,0,'L',true);
01fa81a33b70 Product print shows split batch information. All calculations are done on the split batch data, not the whole batch.
Michiel Broek <mbroek@mbse.eu>
parents: 516
diff changeset
122 $this->Ln();
01fa81a33b70 Product print shows split batch information. All calculations are done on the split batch data, not the whole batch.
Michiel Broek <mbroek@mbse.eu>
parents: 516
diff changeset
123 }
01fa81a33b70 Product print shows split batch information. All calculations are done on the split batch data, not the whole batch.
Michiel Broek <mbroek@mbse.eu>
parents: 516
diff changeset
124
165
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
125 $this->cMargin=$cMargin;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
126 }
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
127
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
128 function TableFermentables($row) {
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
129 global $cost_fermentables;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
130 global $total_fermentables;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
131 global $pSugar;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
132 global $pCara;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
133 global $colorw;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
134 global $preboil_sg;
275
fb1e88f1c643 Better fg estimation in product print.
Michiel Broek <mbroek@mbse.eu>
parents: 247
diff changeset
135 global $mashkg;
424
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
136 global $bottle_sugar;
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
137 global $bottle_sugar_amount;
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
138 global $keg_sugar;
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
139 global $keg_sugar_amount;
514
3c680d1dea35 Added dutch array strings to a global php script. Changed fermentables, hops, yeast and misc inventory scripts to use these strings between the database scripts and javascript scripts. This makes filtering on types strings useable. Added these changes to the product/recipe forum and print exports too.
Michiel Broek <mbroek@mbse.eu>
parents: 460
diff changeset
140 global $added;
3c680d1dea35 Added dutch array strings to a global php script. Changed fermentables, hops, yeast and misc inventory scripts to use these strings between the database scripts and javascript scripts. This makes filtering on types strings useable. Added these changes to the product/recipe forum and print exports too.
Michiel Broek <mbroek@mbse.eu>
parents: 460
diff changeset
141 global $fermentabletype;
3c680d1dea35 Added dutch array strings to a global php script. Changed fermentables, hops, yeast and misc inventory scripts to use these strings between the database scripts and javascript scripts. This makes filtering on types strings useable. Added these changes to the product/recipe forum and print exports too.
Michiel Broek <mbroek@mbse.eu>
parents: 460
diff changeset
142 global $graintype;
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
143 $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
144 $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
145 $this->AddCol($vul,'Mout, granen en suikers','L');
165
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
146 $this->AddCol(15,'Procent','R');
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
147 $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
148 $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
149 $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
150 $this->AddCol(20,'Hoeveel','R');
165
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
151 $this->AddCol(20,'Prijs','R');
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
152
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
153 $cMargin=$this->cMargin;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
154 $this->cMargin=2;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
155 $this->TableX=$this->lMargin;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
156 $this->TableHeader();
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
157 $this->ProcessingTable=true;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
158
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
159 $sugarsf = 0;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
160 $sugarsm = 0;
275
fb1e88f1c643 Better fg estimation in product print.
Michiel Broek <mbroek@mbse.eu>
parents: 247
diff changeset
161 $mashkg = 0;
165
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
162 $this->SetFont('Helvetica','',9);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
163 $this->SetFillColor(250, 195, 65);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
164 $arr = json_decode($row['json_fermentables'], true);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
165 foreach($arr as $item) { //foreach element in $arr
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
166 $name = iconv('UTF-8','windows-1252',$item['f_name']);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
167 $supplier = iconv('UTF-8','windows-1252',$item['f_supplier']);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
168 $amount = floatval($item['f_amount']);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
169 $costkg = floatval($item['f_cost']);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
170 $yield = floatval($item['f_yield']);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
171 $moisture = floatval($item['f_moisture']);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
172 $color = floatval($item['f_color']);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
173 $percent = floatval($item['f_percentage']);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
174
534
01fa81a33b70 Product print shows split batch information. All calculations are done on the split batch data, not the whole batch.
Michiel Broek <mbroek@mbse.eu>
parents: 516
diff changeset
175 if ($item['f_type'] == 1) // Sugar
165
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
176 $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
177 if ($item['f_graintype'] == 2) // Crystal
165
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
178 $pCara += $percent;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
179
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
180 if ($item['f_type'] == 0)
514
3c680d1dea35 Added dutch array strings to a global php script. Changed fermentables, hops, yeast and misc inventory scripts to use these strings between the database scripts and javascript scripts. This makes filtering on types strings useable. Added these changes to the product/recipe forum and print exports too.
Michiel Broek <mbroek@mbse.eu>
parents: 460
diff changeset
181 $soort = iconv('UTF-8','windows-1252',$graintype[$item['f_graintype']]);
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
182 else
514
3c680d1dea35 Added dutch array strings to a global php script. Changed fermentables, hops, yeast and misc inventory scripts to use these strings between the database scripts and javascript scripts. This makes filtering on types strings useable. Added these changes to the product/recipe forum and print exports too.
Michiel Broek <mbroek@mbse.eu>
parents: 460
diff changeset
183 $soort = iconv('UTF-8','windows-1252',$fermentabletype[$item['f_type']]);
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
184
424
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
185 if ($item['f_added'] == 4) {
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
186 $bottle_sugar = $name;
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
187 $bottle_sugar_amount = $amount;
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
188 }
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
189 if ($item['f_added'] == 5) {
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
190 $keg_sugar = $name;
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
191 $keg_sugar_amount = $amount;
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
192 }
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
193
165
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
194 $cost = $amount * $costkg;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
195 $cost_fermentables += $cost;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
196 $total_fermentables += $amount;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
197 /* Calculate the amount of sugars */
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
198 $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
199 if ($item['f_added'] == 0) {
165
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
200 $d = floatval($row['efficiency']) / 100 * $d;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
201 $sugarsm += $d;
275
fb1e88f1c643 Better fg estimation in product print.
Michiel Broek <mbroek@mbse.eu>
parents: 247
diff changeset
202 $mashkg += $amount;
165
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 $sugarsf += $d;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
205 $colorw += ($amount * ebc_to_srm($color) / $row['batch_size']) * 8.34436;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
206
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
207 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
208 $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
209 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
210 $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
211 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
212 $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
213 $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
214 $this->Cell(15,5,sprintf("%.1f%%",$percent),0,0,'R',true);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
215 $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
216 $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
217 $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
218 $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
219 $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
220 $this->Ln();
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
221 }
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
222
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
223 $row['est_og'] = estimate_sg($sugarsf, floatval($row['batch_size']));
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
224 $preboil_sg = estimate_sg($sugarsm, floatval($row['boil_size']));
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
225 $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
226 $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
227 $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
228 $this->ProcessingTable=false;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
229 $this->cMargin=$cMargin;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
230 $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
231 $this->Ln();
165
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
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
234 function TableHops($row) {
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
235 global $total_hops;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
236 global $total_ibus;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
237 global $cost_hops;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
238 global $preboil_sg;
514
3c680d1dea35 Added dutch array strings to a global php script. Changed fermentables, hops, yeast and misc inventory scripts to use these strings between the database scripts and javascript scripts. This makes filtering on types strings useable. Added these changes to the product/recipe forum and print exports too.
Michiel Broek <mbroek@mbse.eu>
parents: 460
diff changeset
239 global $hopform;
3c680d1dea35 Added dutch array strings to a global php script. Changed fermentables, hops, yeast and misc inventory scripts to use these strings between the database scripts and javascript scripts. This makes filtering on types strings useable. Added these changes to the product/recipe forum and print exports too.
Michiel Broek <mbroek@mbse.eu>
parents: 460
diff changeset
240 global $hopuse;
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
241 $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
242 $this->Ln();
165
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
243 $this->AddCol($vul,'Hop','L');
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
244 $this->AddCol(15,'Alpha','R');
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
245 $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
246 $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
247 $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
248 $this->AddCol(20,'Hoeveel','R');
165
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
249 $this->AddCol(20,'Prijs','R');
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
250
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
251 $cMargin=$this->cMargin;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
252 $this->cMargin=2;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
253 $this->TableX=$this->lMargin;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
254 $this->TableHeader();
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
255 $this->ProcessingTable=true;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
256
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
257 $this->SetFont('Helvetica','',9);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
258 $this->SetFillColor(100, 250, 65);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
259
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
260 $arr = json_decode($row['json_hops'], true);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
261 foreach($arr as $item) { //foreach element in $arr
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
262 $name = iconv('UTF-8','windows-1252',$item['h_name']);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
263 $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
264 $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
265 $mass = $amount * 1000;
165
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
266 $costkg = floatval($item['h_cost']);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
267 $time = floatval($item['h_time']);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
268 $alpha = floatval($item['h_alpha']);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
269
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
270 $cost = ($amount * $costkg);
165
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
271 $cost_hops += $cost;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
272 $total_hops += $amount;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
273
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
274 $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
275 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
276 $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
277 } 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
278 $moment = $hopuse[$item['h_useat']].' '.sprintf("%.0f", $time / 1440).' dagen';
165
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
279 }
539
fe9ac6d49c4f Printed outputs have IBUs for whirlpool hops. Removed some debug console logs.
Michiel Broek <mbroek@mbse.eu>
parents: 516
diff changeset
280 $ibu = calc_IBU($item['h_useat'], $item['h_form'], $preboil_sg, floatval($row['batch_size']), $mass, $time, $alpha,
fe9ac6d49c4f Printed outputs have IBUs for whirlpool hops. Removed some debug console logs.
Michiel Broek <mbroek@mbse.eu>
parents: 516
diff changeset
281 $row['ibu_method'], $row['brew_whirlpool9'], $row['brew_whirlpool7'], $row['brew_whirlpool6']);
165
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
282 $total_ibus += $ibu;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
283
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
284 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
285 $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
286 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
287 $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
288
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
289 $this->Cell($vul,5,$name.' ('.$origin.')',0,0,'L',true);
165
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
290 $this->Cell(15,5,sprintf("%.1f%%",$alpha),0,0,'R',true);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
291 $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
292 $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
293 $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
294 $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
295 $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
296 $this->Ln();
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
297 }
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
298
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
299 $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
300 $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
301 $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
302 $this->ProcessingTable=false;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
303 $this->cMargin=$cMargin;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
304 $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
305 $this->Ln();
165
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
306 }
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
307
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
308 function TableYeasts($row) {
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
309 global $cost_yeasts;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
310 global $svg;
514
3c680d1dea35 Added dutch array strings to a global php script. Changed fermentables, hops, yeast and misc inventory scripts to use these strings between the database scripts and javascript scripts. This makes filtering on types strings useable. Added these changes to the product/recipe forum and print exports too.
Michiel Broek <mbroek@mbse.eu>
parents: 460
diff changeset
311 global $yeastform;
3c680d1dea35 Added dutch array strings to a global php script. Changed fermentables, hops, yeast and misc inventory scripts to use these strings between the database scripts and javascript scripts. This makes filtering on types strings useable. Added these changes to the product/recipe forum and print exports too.
Michiel Broek <mbroek@mbse.eu>
parents: 460
diff changeset
312 global $yeastuse;
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
313 $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
314 $this->Ln();
165
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
315 $this->AddCol($vul,'Gist','L');
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
316 $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
317 $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
318 $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
319 $this->AddCol(20,'Hoeveel','R');
165
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
320 $this->AddCol(20,'Prijs','R');
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
321
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
322 $cMargin=$this->cMargin;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
323 $this->cMargin=2;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
324 $this->TableX=$this->lMargin;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
325 $this->TableHeader();
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
326 $this->ProcessingTable=true;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
327
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
328 $this->SetFont('Helvetica','',9);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
329 $this->SetFillColor(175, 175, 255);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
330
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
331 $arr = json_decode($row['json_yeasts'], true);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
332 foreach($arr as $item) { //foreach element in $arr
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
333 $name = iconv('UTF-8','windows-1252',$item['y_name']);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
334 $laboratory = iconv('UTF-8','windows-1252',$item['y_laboratory']);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
335 $product_id = iconv('UTF-8','windows-1252',$item['y_product_id']);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
336 $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
337 $cost = floatval($item['y_amount']) * floatval($item['y_cost']);
165
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
338 $cost_yeasts += $cost;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
339
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
340 if ($item['y_use'] == 0) // Primary
165
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
341 $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
342 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
343 $amount = sprintf("%.0f",floatval($item['y_amount']))." pak";
516
28670364bd0c Added dried yeast form.
Michiel Broek <mbroek@mbse.eu>
parents: 514
diff changeset
344 else if ($item['y_form'] == 1 || $item['y_form'] == 6) // Dry
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
345 $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
346 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
347 $amount = sprintf("%.0f",floatval($item['y_amount'])*1000)." ml";
165
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
348
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
349 $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
350 $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
351 $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
352 $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
353 $this->Cell(20,5,$amount,0,0,'R',true);
165
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
354 $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
355 $this->Ln();
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
356 }
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
357 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
358 $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
359 $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
360 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
361 $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
362 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
363 $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
364 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
365 $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
366 }
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
367 }
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
368 $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
369 $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
370 $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
371 $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
372 $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
373 $this->Ln();
293
db898ec73277 Show yeast starter on printed page
Michiel Broek <mbroek@mbse.eu>
parents: 289
diff changeset
374 }
165
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
375
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
376 $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
377 $this->Cell($vul+90,5,'',0,0,'L',false);
165
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
378 $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
379 $this->ProcessingTable=false;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
380 $this->cMargin=$cMargin;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
381 $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
382 $this->Ln();
165
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
383 }
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
384
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
385 function TableMiscs($row) {
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
386 global $cost_miscs;
514
3c680d1dea35 Added dutch array strings to a global php script. Changed fermentables, hops, yeast and misc inventory scripts to use these strings between the database scripts and javascript scripts. This makes filtering on types strings useable. Added these changes to the product/recipe forum and print exports too.
Michiel Broek <mbroek@mbse.eu>
parents: 460
diff changeset
387 global $misctype;
3c680d1dea35 Added dutch array strings to a global php script. Changed fermentables, hops, yeast and misc inventory scripts to use these strings between the database scripts and javascript scripts. This makes filtering on types strings useable. Added these changes to the product/recipe forum and print exports too.
Michiel Broek <mbroek@mbse.eu>
parents: 460
diff changeset
388 global $miscuse;
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
389 $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
390 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
391 $this->AddPage();
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
392 else
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
393 $this->Ln();
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
394 $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
395 $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
396 $this->AddCol(30,'Gebruik moment','L');
165
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
397 $this->AddCol(20,'Hoeveel','R');
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
398 $this->AddCol(20,'Prijs','R');
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
399
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
400 $cMargin=$this->cMargin;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
401 $this->cMargin=2;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
402 $this->TableX=$this->lMargin;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
403 $this->TableHeader();
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
404 $this->ProcessingTable=true;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
405
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
406 $this->SetFont('Helvetica','',9);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
407 $this->SetFillColor(175, 175, 255);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
408
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
409 $arr = json_decode($row['json_miscs'], true);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
410 foreach($arr as $item) {
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
411 $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
412 $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
413 $use_use = $item['m_use_use'];
165
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
414 $amount = floatval($item['m_amount']) * 1000;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
415 $costg = floatval($item['m_cost']) / 1000;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
416 $time = floatval($item['m_time']);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
417 $aiw = $item['m_amount_is_weight'];
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
418 $cost = $amount * $costg;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
419 $cost_miscs += $cost;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
420
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
421 if ($type == 4) // Water agent
165
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
422 $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
423 else if ($type == 3) // Fining
165
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
424 $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
425 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
426 $this->SetFillColor(240,250,65);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
427 else
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
428 $this->SetFillColor(210,245,255);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
429
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
430 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
431 $gebruik = sprintf("%s %d min",$miscuse[$use_use],$time);
165
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
432 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
433 $gebruik = $miscuse[$use_use];
165
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
434
357
74d56bed75b9 One more decimal digit for misc ingredients. Updated the README.
Michiel Broek <mbroek@mbse.eu>
parents: 338
diff changeset
435 $hoeveel = sprintf("%.2f %s",$amount,$aiw ? "gr":"ml");
165
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
436 $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
437 $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
438 $this->Cell(30,5,$gebruik,0,0,'L',true);
165
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
439 $this->Cell(20,5,$hoeveel,0,0,'R',true);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
440 $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
441 $this->Ln();
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
442 }
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
443
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
444 $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
445 $this->Cell($vul+75,5,'',0,0,'L',false);
165
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
446 $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
447
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
448 $this->ProcessingTable=false;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
449 $this->cMargin=$cMargin;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
450 $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
451 $this->Ln();
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
452 }
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 function TableMashs($row) {
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
455 global $cost_yeasts;
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
456 global $svg;
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
457 global $mashkg;
514
3c680d1dea35 Added dutch array strings to a global php script. Changed fermentables, hops, yeast and misc inventory scripts to use these strings between the database scripts and javascript scripts. This makes filtering on types strings useable. Added these changes to the product/recipe forum and print exports too.
Michiel Broek <mbroek@mbse.eu>
parents: 460
diff changeset
458 global $mashtype;
391
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
459 $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
460 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
461 $this->AddPage();
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
462 else
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
463 $this->Ln();
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
464 $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
465 $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
466 $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
467 $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
468 $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
469 $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
470 $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
471 $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
472
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
473 $cMargin=$this->cMargin;
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
474 $this->cMargin=2;
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
475 $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
476 $this->TableHeader();
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
477 $this->ProcessingTable=true;
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
478
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
479 $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
480 $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
481
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
482 $vol = 0;
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
483 $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
484 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
485
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
486 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
487 $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
488 if ($mashkg > 0)
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
489 $thick = $vol / $mashkg;
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
490 else
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
491 $thick = 0;
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
492 $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
493 $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
494 $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
495 $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
496 $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
497 $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
498 $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
499 $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
500 $this->Ln();
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
501 }
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
502 $this->ProcessingTable=false;
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
503 $this->cMargin=$cMargin;
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
504 $this->aCols=array();
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
505 $this->Ln();
165
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
506 }
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
507
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
508 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
509
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 $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
511 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
512 $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
513 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
514 $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
515 $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
516 $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
517 $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
518 $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
519 $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
520 $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
521 $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
522 $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
523 $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
524
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 $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
526 $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
527 $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
528 $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
529 $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
530
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->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
532 $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
533
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->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
535 $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
536 $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
537 $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
538 $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
539 $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
540 $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
541 $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
542 $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
543 $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
544 $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
545 $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
546 $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
547 $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
548 $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
549 $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
550 $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
551 $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
552 $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
553 $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
554 $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
555 $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
556 $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
557 $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
558 $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
559 $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
560 $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
561 $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
562 $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
563 $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
564 $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
565 $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
566 $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
567 $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
568 $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
569 $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
570 $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
571 $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
572 $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
573 $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
574 $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
575 $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
576 $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
577 }
165
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
578
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
579 function TableSummary($row) {
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
580 global $pSugar;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
581 global $pCara;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
582 global $svg;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
583 global $colorw;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
584 global $cost_fermentables;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
585 global $cost_hops;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
586 global $cost_miscs;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
587 global $cost_yeasts;
275
fb1e88f1c643 Better fg estimation in product print.
Michiel Broek <mbroek@mbse.eu>
parents: 247
diff changeset
588 global $mashkg;
514
3c680d1dea35 Added dutch array strings to a global php script. Changed fermentables, hops, yeast and misc inventory scripts to use these strings between the database scripts and javascript scripts. This makes filtering on types strings useable. Added these changes to the product/recipe forum and print exports too.
Michiel Broek <mbroek@mbse.eu>
parents: 460
diff changeset
589 global $colormethod;
3c680d1dea35 Added dutch array strings to a global php script. Changed fermentables, hops, yeast and misc inventory scripts to use these strings between the database scripts and javascript scripts. This makes filtering on types strings useable. Added these changes to the product/recipe forum and print exports too.
Michiel Broek <mbroek@mbse.eu>
parents: 460
diff changeset
590 global $ibumethod;
165
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
591 /* 2 Columns */
391
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
592 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
593 $this->AddPage();
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
594 else
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
595 $this->Ln();
165
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
596 $vul = $this->w - $this->rMargin - $this->lMargin - 170;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
597 $cMargin=$this->cMargin;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
598 $this->cMargin=2;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
599 $this->TableX=$this->lMargin;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
600 $this->SetFont('Helvetica','B',9);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
601 $this->SetX($this->TableX);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
602 $this->SetFillColor(255,150,100);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
603 $this->Cell(0, 5, 'Recept samenvatting',0,0,'C',true);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
604 $this->Ln();
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
605
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
606 $this->SetFont('Helvetica','',9);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
607 $this->SetFillColor(210,245,255);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
608
275
fb1e88f1c643 Better fg estimation in product print.
Michiel Broek <mbroek@mbse.eu>
parents: 247
diff changeset
609 $mashtime = 0;
fb1e88f1c643 Better fg estimation in product print.
Michiel Broek <mbroek@mbse.eu>
parents: 247
diff changeset
610 $mashtemp = 0;
fb1e88f1c643 Better fg estimation in product print.
Michiel Broek <mbroek@mbse.eu>
parents: 247
diff changeset
611 $mash_infuse = 0;
fb1e88f1c643 Better fg estimation in product print.
Michiel Broek <mbroek@mbse.eu>
parents: 247
diff changeset
612 $arr = json_decode($row['json_mashs'], true);
fb1e88f1c643 Better fg estimation in product print.
Michiel Broek <mbroek@mbse.eu>
parents: 247
diff changeset
613 foreach($arr as $item) {
fb1e88f1c643 Better fg estimation in product print.
Michiel Broek <mbroek@mbse.eu>
parents: 247
diff changeset
614 if ($item['step_type'] == 0) { // infusion
fb1e88f1c643 Better fg estimation in product print.
Michiel Broek <mbroek@mbse.eu>
parents: 247
diff changeset
615 $mash_infuse += floatval($item['step_infuse_amount']);
fb1e88f1c643 Better fg estimation in product print.
Michiel Broek <mbroek@mbse.eu>
parents: 247
diff changeset
616 }
fb1e88f1c643 Better fg estimation in product print.
Michiel Broek <mbroek@mbse.eu>
parents: 247
diff changeset
617 if ($item['step_temp'] < 75) { // ignore mashout temps
fb1e88f1c643 Better fg estimation in product print.
Michiel Broek <mbroek@mbse.eu>
parents: 247
diff changeset
618 $mashtime += floatval($item['step_time']);
fb1e88f1c643 Better fg estimation in product print.
Michiel Broek <mbroek@mbse.eu>
parents: 247
diff changeset
619 $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
620 }
fb1e88f1c643 Better fg estimation in product print.
Michiel Broek <mbroek@mbse.eu>
parents: 247
diff changeset
621 }
fb1e88f1c643 Better fg estimation in product print.
Michiel Broek <mbroek@mbse.eu>
parents: 247
diff changeset
622 $mashtemp = $mashtemp / $mashtime;
fb1e88f1c643 Better fg estimation in product print.
Michiel Broek <mbroek@mbse.eu>
parents: 247
diff changeset
623 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
624 $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
625 } else {
fb1e88f1c643 Better fg estimation in product print.
Michiel Broek <mbroek@mbse.eu>
parents: 247
diff changeset
626 $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
627 }
165
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
628
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
629 $this->SetX($this->TableX);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
630 $this->Cell(35,5,'Start SG',0,0,'L',true);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
631 $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
632 $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
633 $this->Cell($vul,5,'',0,0,'L',false);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
634 $this->Cell(35,5,'Eind SG',0,0,'L',true);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
635 $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
636 $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
637 $this->Ln();
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
638
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
639 $row['est_abv'] = abvol($row['est_og'], $row['est_fg']);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
640 $this->SetX($this->TableX);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
641 $this->Cell(35,5,'Geschat alcohol',0,0,'L',true);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
642 $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
643 $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
644 $this->Cell($vul,5,'',0,0,'L',false);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
645 $this->Cell(35,5,'CO2',0,0,'L',true);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
646 $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
647 $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
648 $this->Ln();
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
649
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
650 $row['est_color'] = kw_to_ebc($row['color_method'], $colorw);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
651 $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
652 $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
653 $beercolor = ebc_to_color($row['est_color']);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
654 if ($row['est_color'] > 30)
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
655 $this->SetTextColor(250);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
656 $this->SetFillColor($beercolor[0],$beercolor[1],$beercolor[2]);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
657 $this->Cell(25,5,$row['est_color'].' EBC',0,0,'L',true);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
658 $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
659 $this->SetTextColor(0);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
660 $this->SetFillColor(210,245,255);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
661 $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
662 $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
663 $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
664 $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
665 $this->Ln();
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
666
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
667 $this->SetX($this->TableX);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
668 $cost_total = $cost_fermentables + $cost_hops + $cost_miscs + $cost_yeasts;
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
669 $this->Cell(35,5,'Kosten',0,0,'L',true);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
670 $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
671 $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
672
391
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
673 // calorieen
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
674 $this->ProcessingTable=false;
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
675 $this->cMargin=$cMargin;
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
676 $this->aCols=array();
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
677 $this->Ln();
165
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
678 }
243
b43214d218c0 In stage Plan the brewdate data is saved, but not the brewdate itself. Added kettle_cm() function. Fixed serveral kettle heights when creating a new product. Print product prints a almost complete checklist in stages plan and brew.
Michiel Broek <mbroek@mbse.eu>
parents: 241
diff changeset
679
391
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
680 function Brewday($row) {
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
681
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
682 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
683 global $my_grain_absorbtion;
514
3c680d1dea35 Added dutch array strings to a global php script. Changed fermentables, hops, yeast and misc inventory scripts to use these strings between the database scripts and javascript scripts. This makes filtering on types strings useable. Added these changes to the product/recipe forum and print exports too.
Michiel Broek <mbroek@mbse.eu>
parents: 460
diff changeset
684 global $coolingtype;
3c680d1dea35 Added dutch array strings to a global php script. Changed fermentables, hops, yeast and misc inventory scripts to use these strings between the database scripts and javascript scripts. This makes filtering on types strings useable. Added these changes to the product/recipe forum and print exports too.
Michiel Broek <mbroek@mbse.eu>
parents: 460
diff changeset
685 global $aerationtype;
391
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
686
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
687 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
688 $this->AddPage();
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
689 else
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
690 $this->Ln(10);
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 $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
693 $cMargin=$this->cMargin;
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
694 $this->cMargin=2;
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
695 $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
696 $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
697 $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
698 $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
699 $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
700 $this->Ln();
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
701
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
702 $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
703 $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
704
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
705 $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
706 $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
707 $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
708 $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
709 $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
710 $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
711 $this->Ln();
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
712
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
713 $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
714 $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
715 $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
716 $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
717 $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
718 $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
719 $this->Ln();
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
720
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
721 $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
722 $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
723 $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
724 $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
725 $this->Ln(7);
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
726
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
727 $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
728 $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
729 $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
730 $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
731 $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
732 $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
733 $this->Ln();
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
734
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
735 $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
736 $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
737 $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
738 $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
739 $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
740 $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
741 $this->Ln();
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
742
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
743 $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
744 $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
745 $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
746 $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
747 $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
748 $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
749 $this->Ln();
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
750
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
751 $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
752 $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
753 $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
754 $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
755 $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
756 $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
757 $this->Ln(7);
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
758
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
759 $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
760 $this->Cell(35,5,'Spoelwater temperatuur',0,0,'L',true);
432
99dcd8488b62 Merged brew_sparge_temperature with sparge_temp and brew_sparge_volume with sparge_volume.
Michiel Broek <mbroek@mbse.eu>
parents: 424
diff changeset
761 $this->Cell(50,5,sprintf("%.1f", $row['sparge_temp']).DEG.'C',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
762 $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
763 $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
764 $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
765 $this->Ln();
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
766
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
767 $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
768 $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
769 $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
770 $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
771 $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
772 $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
773 $this->Ln();
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
774
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
775 $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
776 $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
777 $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
778 $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
779 $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
780 $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
781 $this->Ln(7);
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
782
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
783 $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
784 $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
785 $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
786 $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
787 $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
788 $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
789 $this->Ln();
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
790
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
791 $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
792 $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
793 $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
794 $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
795 $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
796 $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
797 $this->Ln();
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
798
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
799 $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
800 $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
801 $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
802 $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
803 $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
804 $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
805 $this->Ln();
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
806
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
807 $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
808 $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
809 $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
810 $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
811 $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
812 $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
813 $this->Ln(7);
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
814
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
815 $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
816 $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
817 $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
818 $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
819 $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
820 $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
821 $this->Ln();
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
822
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
823 $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
824 $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
825 $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
826 $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
827 $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
828 $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
829 $this->Ln();
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
830 }
421
0bc45502144b Print fermentation summary
Michiel Broek <mbroek@mbse.eu>
parents: 407
diff changeset
831
0bc45502144b Print fermentation summary
Michiel Broek <mbroek@mbse.eu>
parents: 407
diff changeset
832 function Fermentation($row) {
424
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
833
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
834 if ($this->GetY() > 230)
421
0bc45502144b Print fermentation summary
Michiel Broek <mbroek@mbse.eu>
parents: 407
diff changeset
835 $this->AddPage();
0bc45502144b Print fermentation summary
Michiel Broek <mbroek@mbse.eu>
parents: 407
diff changeset
836 else
0bc45502144b Print fermentation summary
Michiel Broek <mbroek@mbse.eu>
parents: 407
diff changeset
837 $this->Ln(10);
0bc45502144b Print fermentation summary
Michiel Broek <mbroek@mbse.eu>
parents: 407
diff changeset
838
0bc45502144b Print fermentation summary
Michiel Broek <mbroek@mbse.eu>
parents: 407
diff changeset
839 $vul = $this->w - $this->rMargin - $this->lMargin - 180;
0bc45502144b Print fermentation summary
Michiel Broek <mbroek@mbse.eu>
parents: 407
diff changeset
840 $cMargin=$this->cMargin;
0bc45502144b Print fermentation summary
Michiel Broek <mbroek@mbse.eu>
parents: 407
diff changeset
841 $this->cMargin=2;
0bc45502144b Print fermentation summary
Michiel Broek <mbroek@mbse.eu>
parents: 407
diff changeset
842 $this->TableX=$this->lMargin;
0bc45502144b Print fermentation summary
Michiel Broek <mbroek@mbse.eu>
parents: 407
diff changeset
843 $this->SetFont('Helvetica','B',9);
0bc45502144b Print fermentation summary
Michiel Broek <mbroek@mbse.eu>
parents: 407
diff changeset
844 $this->SetX($this->TableX);
0bc45502144b Print fermentation summary
Michiel Broek <mbroek@mbse.eu>
parents: 407
diff changeset
845 $this->SetFillColor(255,150,100);
0bc45502144b Print fermentation summary
Michiel Broek <mbroek@mbse.eu>
parents: 407
diff changeset
846 $this->Cell(0, 5, 'Vergisting gegevens',0,0,'C',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->SetFont('Helvetica','',9);
0bc45502144b Print fermentation summary
Michiel Broek <mbroek@mbse.eu>
parents: 407
diff changeset
850 $this->SetFillColor(210,245,255);
0bc45502144b Print fermentation summary
Michiel Broek <mbroek@mbse.eu>
parents: 407
diff changeset
851
0bc45502144b Print fermentation summary
Michiel Broek <mbroek@mbse.eu>
parents: 407
diff changeset
852 $this->SetX($this->TableX);
0bc45502144b Print fermentation summary
Michiel Broek <mbroek@mbse.eu>
parents: 407
diff changeset
853 $this->Cell(45,5,'Hoofdvergisting start temp.',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['primary_start_temp']).DEG.'C',0,0,'L',true);
0bc45502144b Print fermentation summary
Michiel Broek <mbroek@mbse.eu>
parents: 407
diff changeset
855 $this->Cell($vul,5,'',0,0,'L',false);
0bc45502144b Print fermentation summary
Michiel Broek <mbroek@mbse.eu>
parents: 407
diff changeset
856 $this->Cell(45,5,'Hoofdvergisting piek temp.',0,0,'L',true);
0bc45502144b Print fermentation summary
Michiel Broek <mbroek@mbse.eu>
parents: 407
diff changeset
857 $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
858 $this->Ln();
0bc45502144b Print fermentation summary
Michiel Broek <mbroek@mbse.eu>
parents: 407
diff changeset
859
0bc45502144b Print fermentation summary
Michiel Broek <mbroek@mbse.eu>
parents: 407
diff changeset
860 $this->SetX($this->TableX);
0bc45502144b Print fermentation summary
Michiel Broek <mbroek@mbse.eu>
parents: 407
diff changeset
861 $this->Cell(45,5,'Hoofdvergisting eind temp.',0,0,'L',true);
0bc45502144b Print fermentation summary
Michiel Broek <mbroek@mbse.eu>
parents: 407
diff changeset
862 $this->Cell(45,5,sprintf("%.1f",$row['primary_end_temp']).DEG.'C',0,0,'L',true);
460
046ff5fdc96c Implemented products.secondary_end_sg field. The missing values are updated by the crontask.
Michiel Broek <mbroek@mbse.eu>
parents: 449
diff changeset
863 $this->Cell($vul,5,'',0,0,'L',false);
046ff5fdc96c Implemented products.secondary_end_sg field. The missing values are updated by the crontask.
Michiel Broek <mbroek@mbse.eu>
parents: 449
diff changeset
864 $this->Cell(45,5,'Hoofdvergisting densiteit',0,0,'L',true);
046ff5fdc96c Implemented products.secondary_end_sg field. The missing values are updated by the crontask.
Michiel Broek <mbroek@mbse.eu>
parents: 449
diff changeset
865 $this->Cell(45,5,sprintf("%.3f",floatval($row['primary_end_sg'])).' SG',0,0,'L',true);
421
0bc45502144b Print fermentation summary
Michiel Broek <mbroek@mbse.eu>
parents: 407
diff changeset
866 $this->Ln();
0bc45502144b Print fermentation summary
Michiel Broek <mbroek@mbse.eu>
parents: 407
diff changeset
867
0bc45502144b Print fermentation summary
Michiel Broek <mbroek@mbse.eu>
parents: 407
diff changeset
868 $this->SetX($this->TableX);
460
046ff5fdc96c Implemented products.secondary_end_sg field. The missing values are updated by the crontask.
Michiel Broek <mbroek@mbse.eu>
parents: 449
diff changeset
869 $this->Cell(45,5,'Hoofdvergisting einde',0,0,'L',true);
046ff5fdc96c Implemented products.secondary_end_sg field. The missing values are updated by the crontask.
Michiel Broek <mbroek@mbse.eu>
parents: 449
diff changeset
870 $this->Cell(45,5,$row['primary_end_date'],0,0,'L',true);
046ff5fdc96c Implemented products.secondary_end_sg field. The missing values are updated by the crontask.
Michiel Broek <mbroek@mbse.eu>
parents: 449
diff changeset
871 $this->Ln();
046ff5fdc96c Implemented products.secondary_end_sg field. The missing values are updated by the crontask.
Michiel Broek <mbroek@mbse.eu>
parents: 449
diff changeset
872
046ff5fdc96c Implemented products.secondary_end_sg field. The missing values are updated by the crontask.
Michiel Broek <mbroek@mbse.eu>
parents: 449
diff changeset
873 $this->SetX($this->TableX);
046ff5fdc96c Implemented products.secondary_end_sg field. The missing values are updated by the crontask.
Michiel Broek <mbroek@mbse.eu>
parents: 449
diff changeset
874 $this->Cell(45,5,'Navergisting tempertuur',0,0,'L',true);
046ff5fdc96c Implemented products.secondary_end_sg field. The missing values are updated by the crontask.
Michiel Broek <mbroek@mbse.eu>
parents: 449
diff changeset
875 $this->Cell(45,5,sprintf("%.1f", $row['secondary_temp']).DEG.'C',0,0,'L',true);
046ff5fdc96c Implemented products.secondary_end_sg field. The missing values are updated by the crontask.
Michiel Broek <mbroek@mbse.eu>
parents: 449
diff changeset
876 $this->Cell($vul,5,'',0,0,'L',false);
046ff5fdc96c Implemented products.secondary_end_sg field. The missing values are updated by the crontask.
Michiel Broek <mbroek@mbse.eu>
parents: 449
diff changeset
877 $this->Cell(45,5,'Nagisten densiteit',0,0,'L',true);
046ff5fdc96c Implemented products.secondary_end_sg field. The missing values are updated by the crontask.
Michiel Broek <mbroek@mbse.eu>
parents: 449
diff changeset
878 $this->Cell(45,5,sprintf("%.3f",floatval($row['secondary_end_sg'])).' SG',0,0,'L',true);
046ff5fdc96c Implemented products.secondary_end_sg field. The missing values are updated by the crontask.
Michiel Broek <mbroek@mbse.eu>
parents: 449
diff changeset
879 $this->Ln();
421
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 $this->SetX($this->TableX);
460
046ff5fdc96c Implemented products.secondary_end_sg field. The missing values are updated by the crontask.
Michiel Broek <mbroek@mbse.eu>
parents: 449
diff changeset
882 $this->Cell(45,5,'Nagisten einde',0,0,'L',true);
046ff5fdc96c Implemented products.secondary_end_sg field. The missing values are updated by the crontask.
Michiel Broek <mbroek@mbse.eu>
parents: 449
diff changeset
883 $this->Cell(45,5,$row['secondary_end_date'],0,0,'L',true);
046ff5fdc96c Implemented products.secondary_end_sg field. The missing values are updated by the crontask.
Michiel Broek <mbroek@mbse.eu>
parents: 449
diff changeset
884 $this->Ln();
046ff5fdc96c Implemented products.secondary_end_sg field. The missing values are updated by the crontask.
Michiel Broek <mbroek@mbse.eu>
parents: 449
diff changeset
885
046ff5fdc96c Implemented products.secondary_end_sg field. The missing values are updated by the crontask.
Michiel Broek <mbroek@mbse.eu>
parents: 449
diff changeset
886 $this->SetX($this->TableX);
046ff5fdc96c Implemented products.secondary_end_sg field. The missing values are updated by the crontask.
Michiel Broek <mbroek@mbse.eu>
parents: 449
diff changeset
887 $this->Cell(45,5,'Lageren temperatuur',0,0,'L',true);
046ff5fdc96c Implemented products.secondary_end_sg field. The missing values are updated by the crontask.
Michiel Broek <mbroek@mbse.eu>
parents: 449
diff changeset
888 $this->Cell(45,5,sprintf("%.1f",$row['tertiary_temp']).DEG.'C',0,0,'L',true);
046ff5fdc96c Implemented products.secondary_end_sg field. The missing values are updated by the crontask.
Michiel Broek <mbroek@mbse.eu>
parents: 449
diff changeset
889 $this->Cell($vul,5,'',0,0,'L',false);
046ff5fdc96c Implemented products.secondary_end_sg field. The missing values are updated by the crontask.
Michiel Broek <mbroek@mbse.eu>
parents: 449
diff changeset
890 $this->Cell(45,5,'Lageren densiteit',0,0,'L',true);
046ff5fdc96c Implemented products.secondary_end_sg field. The missing values are updated by the crontask.
Michiel Broek <mbroek@mbse.eu>
parents: 449
diff changeset
891 $this->Cell(45,5,sprintf("%.3f",floatval($row['fg'])).' SG',0,0,'L',true);
046ff5fdc96c Implemented products.secondary_end_sg field. The missing values are updated by the crontask.
Michiel Broek <mbroek@mbse.eu>
parents: 449
diff changeset
892 $this->Ln();
046ff5fdc96c Implemented products.secondary_end_sg field. The missing values are updated by the crontask.
Michiel Broek <mbroek@mbse.eu>
parents: 449
diff changeset
893
046ff5fdc96c Implemented products.secondary_end_sg field. The missing values are updated by the crontask.
Michiel Broek <mbroek@mbse.eu>
parents: 449
diff changeset
894 $this->SetX($this->TableX);
421
0bc45502144b Print fermentation summary
Michiel Broek <mbroek@mbse.eu>
parents: 407
diff changeset
895 $this->Cell(45,5,'Lageren einde',0,0,'L',true);
0bc45502144b Print fermentation summary
Michiel Broek <mbroek@mbse.eu>
parents: 407
diff changeset
896 $this->Cell(45,5,$row['package_date'],0,0,'L',true);
460
046ff5fdc96c Implemented products.secondary_end_sg field. The missing values are updated by the crontask.
Michiel Broek <mbroek@mbse.eu>
parents: 449
diff changeset
897 $this->Cell($vul,5,'',0,0,'L',false);
421
0bc45502144b Print fermentation summary
Michiel Broek <mbroek@mbse.eu>
parents: 407
diff changeset
898 $svg = 100 * (floatval($row['brew_fermenter_sg']) - floatval($row['fg'])) / (floatval($row['brew_fermenter_sg']) - 1);
460
046ff5fdc96c Implemented products.secondary_end_sg field. The missing values are updated by the crontask.
Michiel Broek <mbroek@mbse.eu>
parents: 449
diff changeset
899 $this->Cell(45,5,'Schijnbare vergistingsgraad',0,0,'L',true);
421
0bc45502144b Print fermentation summary
Michiel Broek <mbroek@mbse.eu>
parents: 407
diff changeset
900 $this->Cell(45,5,sprintf("%.1f",$svg).'%',0,0,'L',true);
0bc45502144b Print fermentation summary
Michiel Broek <mbroek@mbse.eu>
parents: 407
diff changeset
901 $this->Ln();
0bc45502144b Print fermentation summary
Michiel Broek <mbroek@mbse.eu>
parents: 407
diff changeset
902 }
0bc45502144b Print fermentation summary
Michiel Broek <mbroek@mbse.eu>
parents: 407
diff changeset
903
0bc45502144b Print fermentation summary
Michiel Broek <mbroek@mbse.eu>
parents: 407
diff changeset
904 function Packaging($row) {
0bc45502144b Print fermentation summary
Michiel Broek <mbroek@mbse.eu>
parents: 407
diff changeset
905
424
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
906 global $bottle_sugar;
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
907 global $bottle_sugar_amount;
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
908 global $keg_sugar;
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
909 global $keg_sugar_amount;
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
910
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
911 if ($this->GetY() > 230)
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
912 $this->AddPage();
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
913 else
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
914 $this->Ln(10);
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
915
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
916 $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
917 $cMargin=$this->cMargin;
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
918 $this->cMargin=2;
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
919 $this->TableX=$this->lMargin;
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
920 $this->SetFont('Helvetica','B',9);
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
921 $this->SetX($this->TableX);
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
922 $this->SetFillColor(255,150,100);
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
923 $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
924 $this->Ln();
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
925
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
926 $this->SetFont('Helvetica','',9);
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
927 $this->SetFillColor(210,245,255);
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
928
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
929 $this->SetX($this->TableX);
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
930 $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
931 $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
932 $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
933 $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
934 $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
935 $this->Ln();
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 $this->SetX($this->TableX);
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
938 $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
939 $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
940 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
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,'Water toevoegen',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['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
944 }
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
945 $this->Ln(7);
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
946
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
947 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
948 $this->SetX($this->TableX);
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
949 $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
950 $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
951 $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
952 $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
953 $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
954 $this->Ln();
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
955
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
956 $this->SetX($this->TableX);
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
957 $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
958 $this->Ln(7);
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
959 }
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
960
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
961 $this->SetX($this->TableX);
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
962 $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
963 $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
964 $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
965 $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
966 $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
967 $this->Ln();
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
968
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
969 $this->SetX($this->TableX);
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
970 $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
971 $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
972 $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
973 $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
974 $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
975 $this->Ln();
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
976
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
977 $this->SetX($this->TableX);
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
978 $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
979 $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
980 $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
981 $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
982 $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
983 $this->Ln();
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
984
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
985 $this->SetX($this->TableX);
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
986 $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
987 $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
988 $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
989 if ($row['keg_forced_carb']) {
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
990 $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
991 $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
992 } else {
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
993 $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
994 $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
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,'Totaal suiker',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("%.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
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 if ($row['keg_forced_carb']) {
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
1003 $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
1004 $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
1005 } else {
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
1006 $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
1007 $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
1008 }
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
1009 $this->Ln();
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
1010
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
1011 $this->SetX($this->TableX);
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
1012 $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
1013 $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
1014 $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
1015 if (! $row['keg_forced_carb']) {
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
1016 $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
1017 $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
1018 }
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
1019 $this->Ln();
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
1020
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
1021 $this->SetX($this->TableX);
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
1022 $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
1023 $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
1024 $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
1025 $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
1026 $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
1027 $this->Ln();
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
1028
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
1029 $this->SetX($this->TableX);
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
1030 $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
1031 $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
1032 $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
1033 $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
1034 $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
1035 $this->Ln();
421
0bc45502144b Print fermentation summary
Michiel Broek <mbroek@mbse.eu>
parents: 407
diff changeset
1036 }
0bc45502144b Print fermentation summary
Michiel Broek <mbroek@mbse.eu>
parents: 407
diff changeset
1037
0bc45502144b Print fermentation summary
Michiel Broek <mbroek@mbse.eu>
parents: 407
diff changeset
1038 function Tasting($row) {
0bc45502144b Print fermentation summary
Michiel Broek <mbroek@mbse.eu>
parents: 407
diff changeset
1039
424
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
1040 if ($this->GetY() > 200)
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
1041 $this->AddPage();
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
1042 else
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
1043 $this->Ln(10);
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
1044
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
1045 $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
1046 $cMargin=$this->cMargin;
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
1047 $this->cMargin=2;
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
1048 $this->TableX=$this->lMargin;
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
1049 $this->SetFont('Helvetica','B',9);
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
1050 $this->SetX($this->TableX);
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
1051 $this->SetFillColor(255,150,100);
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
1052 $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
1053 $this->Ln();
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
1054
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
1055 $this->SetFont('Helvetica','',9);
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
1056 $this->SetFillColor(210,245,255);
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,'Proeven datum',0,0,'L',true);
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
1060 $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
1061 $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
1062 $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
1063 $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
1064 $this->Ln();
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
1065
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
1066 $this->SetX($this->TableX);
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
1067 $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
1068 $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
1069 $this->Ln();
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
1070
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
1071 $this->SetX($this->TableX);
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
1072 $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
1073 $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
1074 $this->Ln();
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
1075
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
1076 $this->SetX($this->TableX);
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
1077 $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
1078 $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
1079 $this->Ln();
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
1080
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
1081 $this->SetX($this->TableX);
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
1082 $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
1083 $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
1084 $this->Ln();
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
1085
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
1086 $this->SetX($this->TableX);
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
1087 $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
1088 $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
1089 $this->Ln();
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
1090
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
1091 $this->SetX($this->TableX);
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
1092 $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
1093 $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
1094 $this->Ln();
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
1095
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
1096 $this->SetX($this->TableX);
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
1097 $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
1098 $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
1099 $this->Ln();
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
1100
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
1101 $this->SetX($this->TableX);
7d231014b301 Added packaging and tasting to print product.
Michiel Broek <mbroek@mbse.eu>
parents: 421
diff changeset
1102 $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
1103 $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
1104 $this->Ln();
421
0bc45502144b Print fermentation summary
Michiel Broek <mbroek@mbse.eu>
parents: 407
diff changeset
1105 }
165
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1106 }
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1107
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1108
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1109
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1110 class PDF extends PDF_MySQL_Table {
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1111 function Header() {
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1112 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
1113 global $prdate;
514
3c680d1dea35 Added dutch array strings to a global php script. Changed fermentables, hops, yeast and misc inventory scripts to use these strings between the database scripts and javascript scripts. This makes filtering on types strings useable. Added these changes to the product/recipe forum and print exports too.
Michiel Broek <mbroek@mbse.eu>
parents: 460
diff changeset
1114 global $stage;
534
01fa81a33b70 Product print shows split batch information. All calculations are done on the split batch data, not the whole batch.
Michiel Broek <mbroek@mbse.eu>
parents: 516
diff changeset
1115 global $divide_parts;
01fa81a33b70 Product print shows split batch information. All calculations are done on the split batch data, not the whole batch.
Michiel Broek <mbroek@mbse.eu>
parents: 516
diff changeset
1116 global $divide_part;
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
1117 $this->Image('images/logo.png',10,10,30);
165
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1118 // Title
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1119 $this->SetFont('Helvetica','B',18);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1120 $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
1121 $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
1122 $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
1123 $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
1124 $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
1125 $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
1126 $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
1127 $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
1128 $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
1129 $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
1130 $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
1131 $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
1132 $this->Cell(0,5,$stage[$row['stage']],0,1,'L');
534
01fa81a33b70 Product print shows split batch information. All calculations are done on the split batch data, not the whole batch.
Michiel Broek <mbroek@mbse.eu>
parents: 516
diff changeset
1133 $this->SetX(45);
01fa81a33b70 Product print shows split batch information. All calculations are done on the split batch data, not the whole batch.
Michiel Broek <mbroek@mbse.eu>
parents: 516
diff changeset
1134 $this->Cell(17,5,'Batch:',0,0,'L');
01fa81a33b70 Product print shows split batch information. All calculations are done on the split batch data, not the whole batch.
Michiel Broek <mbroek@mbse.eu>
parents: 516
diff changeset
1135 if ($divide_parts == 0)
01fa81a33b70 Product print shows split batch information. All calculations are done on the split batch data, not the whole batch.
Michiel Broek <mbroek@mbse.eu>
parents: 516
diff changeset
1136 $this->Cell(0,5,"Niet gespitst",0,1,'L');
01fa81a33b70 Product print shows split batch information. All calculations are done on the split batch data, not the whole batch.
Michiel Broek <mbroek@mbse.eu>
parents: 516
diff changeset
1137 else
01fa81a33b70 Product print shows split batch information. All calculations are done on the split batch data, not the whole batch.
Michiel Broek <mbroek@mbse.eu>
parents: 516
diff changeset
1138 $this->Cell(0,5,"Split batch ".($divide_part + 1)." van ".($divide_parts + 1),0,1,'L');
01fa81a33b70 Product print shows split batch information. All calculations are done on the split batch data, not the whole batch.
Michiel Broek <mbroek@mbse.eu>
parents: 516
diff changeset
1139 $this->Ln(2);
165
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1140 // Ensure table header is printed
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1141 parent::Header();
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1142 }
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1143 }
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1144
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1145
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1146 /*
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1147 * Generate PDF from recipe data
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1148 */
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1149 $pdf = new PDF();
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1150 $pdf->AddPage();
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1151 $pdf->TableGlobal($row);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1152 $pdf->TableFermentables($row);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1153 $pdf->TableHops($row);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1154 $pdf->TableYeasts($row);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1155 $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
1156 $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
1157 $pdf->TableWaters($row);
165
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1158 $pdf->TableSummary($row);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1159 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
1160 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
1161 $pdf->AddPage();
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
1162 else
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
1163 $pdf->Ln(10);
165
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1164 $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
1165 $pdf->SetFont('Helvetica','B',9);
165
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1166 $pdf->Cell(0, 5, 'Recept opmerkingen',0,0,'C',true);
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1167 $pdf->Ln();
391
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
1168 $pdf->SetFont('Helvetica','',9);
165
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1169 $pdf->SetFillColor(210,245,255);
421
0bc45502144b Print fermentation summary
Michiel Broek <mbroek@mbse.eu>
parents: 407
diff changeset
1170 $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
1171 }
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
1172
391
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
1173 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
1174 $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
1175 }
391
a1bcebc61ddd Added mash schedule and brewday data to the product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 357
diff changeset
1176
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
1177 if ($row['stage'] > 3) {
421
0bc45502144b Print fermentation summary
Michiel Broek <mbroek@mbse.eu>
parents: 407
diff changeset
1178 $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
1179 }
a85c1d4c4d12 Depending on the product stage, more or less fields are saved in the database. Added begin of auto stage increase. Added missing inventory columns in the fermentables grid. New product wizzard now works with the indexed values. Product print works with indexed values and prepared for different print modules depending on the product stage.
Michiel Broek <mbroek@mbse.eu>
parents: 165
diff changeset
1180 if ($row['stage'] > 6) {
421
0bc45502144b Print fermentation summary
Michiel Broek <mbroek@mbse.eu>
parents: 407
diff changeset
1181 $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
1182 }
a85c1d4c4d12 Depending on the product stage, more or less fields are saved in the database. Added begin of auto stage increase. Added missing inventory columns in the fermentables grid. New product wizzard now works with the indexed values. Product print works with indexed values and prepared for different print modules depending on the product stage.
Michiel Broek <mbroek@mbse.eu>
parents: 165
diff changeset
1183 if ($row['stage'] > 9) {
421
0bc45502144b Print fermentation summary
Michiel Broek <mbroek@mbse.eu>
parents: 407
diff changeset
1184 $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
1185 }
a85c1d4c4d12 Depending on the product stage, more or less fields are saved in the database. Added begin of auto stage increase. Added missing inventory columns in the fermentables grid. New product wizzard now works with the indexed values. Product print works with indexed values and prepared for different print modules depending on the product stage.
Michiel Broek <mbroek@mbse.eu>
parents: 165
diff changeset
1186
165
5970c8377b89 Added product print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1187 $pdf->Output();

mercurial