www/rec_print.php

Wed, 08 Jan 2020 23:32:16 +0100

author
Michiel Broek <mbroek@mbse.eu>
date
Wed, 08 Jan 2020 23:32:16 +0100
changeset 589
b6a73022abe7
parent 539
fe9ac6d49c4f
child 667
1246550451ca
permissions
-rw-r--r--

Fix encoding of the beerstyle name.

80
75b9227fb98c Added beginning of recipe print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1 <?php
75b9227fb98c Added beginning of recipe print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2 require_once($_SERVER['DOCUMENT_ROOT'].'/includes/global.inc.php');
83
85521c6e0022 Added recipe print yeasts section.
Michiel Broek <mbroek@mbse.eu>
parents: 80
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: 449
diff changeset
4 require_once($_SERVER['DOCUMENT_ROOT'].'/includes/constants.php');
80
75b9227fb98c Added beginning of recipe print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5 require_once($_SERVER['DOCUMENT_ROOT'].'/fpdf/fpdf.php');
75b9227fb98c Added beginning of recipe print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6
75b9227fb98c Added beginning of recipe print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7
75b9227fb98c Added beginning of recipe print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8 $link = mysqli_connect(DBASE_HOST,DBASE_USER,DBASE_PASS,DBASE_NAME);
83
85521c6e0022 Added recipe print yeasts section.
Michiel Broek <mbroek@mbse.eu>
parents: 80
diff changeset
9 if (! $link) {
85521c6e0022 Added recipe print yeasts section.
Michiel Broek <mbroek@mbse.eu>
parents: 80
diff changeset
10 die('Connect Error (' . mysqli_connect_errno() . ') ' . mysqli_connect_error());
85521c6e0022 Added recipe print yeasts section.
Michiel Broek <mbroek@mbse.eu>
parents: 80
diff changeset
11 }
85521c6e0022 Added recipe print yeasts section.
Michiel Broek <mbroek@mbse.eu>
parents: 80
diff changeset
12 if (! mysqli_set_charset($link, "utf8" )) {
85521c6e0022 Added recipe print yeasts section.
Michiel Broek <mbroek@mbse.eu>
parents: 80
diff changeset
13 echo "error";
85521c6e0022 Added recipe print yeasts section.
Michiel Broek <mbroek@mbse.eu>
parents: 80
diff changeset
14 return 1;
85521c6e0022 Added recipe print yeasts section.
Michiel Broek <mbroek@mbse.eu>
parents: 80
diff changeset
15 }
85521c6e0022 Added recipe print yeasts section.
Michiel Broek <mbroek@mbse.eu>
parents: 80
diff changeset
16
80
75b9227fb98c Added beginning of recipe print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
17 setlocale ( LC_ALL, 'nl_NL.UTF-8');
75b9227fb98c Added beginning of recipe print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
18 $record = $_GET["record"];
75b9227fb98c Added beginning of recipe print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
19 $result = mysqli_query($link, "SELECT * FROM recipes WHERE record='".$record."'");
75b9227fb98c Added beginning of recipe print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
20 $row = mysqli_fetch_array($result);
75b9227fb98c Added beginning of recipe print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
21
83
85521c6e0022 Added recipe print yeasts section.
Michiel Broek <mbroek@mbse.eu>
parents: 80
diff changeset
22 $total_fermentables = 0.0;
85521c6e0022 Added recipe print yeasts section.
Michiel Broek <mbroek@mbse.eu>
parents: 80
diff changeset
23 $cost_fermentables = 0.0;
85521c6e0022 Added recipe print yeasts section.
Michiel Broek <mbroek@mbse.eu>
parents: 80
diff changeset
24 $total_hops = 0.0;
85521c6e0022 Added recipe print yeasts section.
Michiel Broek <mbroek@mbse.eu>
parents: 80
diff changeset
25 $cost_hops = 0.0;
85521c6e0022 Added recipe print yeasts section.
Michiel Broek <mbroek@mbse.eu>
parents: 80
diff changeset
26 $cost_yeasts = 0.0;
85521c6e0022 Added recipe print yeasts section.
Michiel Broek <mbroek@mbse.eu>
parents: 80
diff changeset
27 $cost_miscs = 0.0;
87
7f1d0abe5571 OG and FG are now calculated from the grist. The printed report has a summary an notes section at the end. The formulas are in the global formulas script.
Michiel Broek <mbroek@mbse.eu>
parents: 86
diff changeset
28 $pSugar = 0;
7f1d0abe5571 OG and FG are now calculated from the grist. The printed report has a summary an notes section at the end. The formulas are in the global formulas script.
Michiel Broek <mbroek@mbse.eu>
parents: 86
diff changeset
29 $pCara = 0;
7f1d0abe5571 OG and FG are now calculated from the grist. The printed report has a summary an notes section at the end. The formulas are in the global formulas script.
Michiel Broek <mbroek@mbse.eu>
parents: 86
diff changeset
30 $svg = 77;
89
082c23b26055 Missing Water agent costs from Brouwhulp import are now added from the imported miscs database. The printed recipe report now calculates the beer color from the ingredients. Also set during recipes import. This will later allow to set the color method for each recipe individually.
Michiel Broek <mbroek@mbse.eu>
parents: 88
diff changeset
31 $colorw = 0;
93
357d59d8ec5e Added IBU and cost totals.
Michiel Broek <mbroek@mbse.eu>
parents: 90
diff changeset
32 $total_ibus = 0;
94
295c3af2a421 Include boil_size field in the recipes table. Calculate pre-boil SG. Use that in the IBU calculation.
Michiel Broek <mbroek@mbse.eu>
parents: 93
diff changeset
33 $preboil_sg = 0;
233
14a84d42031d In recipe report added the date and beer style to the page header.
Michiel Broek <mbroek@mbse.eu>
parents: 232
diff changeset
34 date_default_timezone_set('Europe/Amsterdam');
14a84d42031d In recipe report added the date and beer style to the page header.
Michiel Broek <mbroek@mbse.eu>
parents: 232
diff changeset
35 $prdate = date(DATE_RFC2822);
80
75b9227fb98c Added beginning of recipe print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
36
75b9227fb98c Added beginning of recipe print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
37 class PDF_MySQL_Table extends FPDF
75b9227fb98c Added beginning of recipe print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
38 {
75b9227fb98c Added beginning of recipe print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
39 protected $ProcessingTable=false;
75b9227fb98c Added beginning of recipe print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
40 protected $aCols=array();
75b9227fb98c Added beginning of recipe print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
41 protected $TableX;
75b9227fb98c Added beginning of recipe print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
42
75b9227fb98c Added beginning of recipe print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
43 function Header() {
75b9227fb98c Added beginning of recipe print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
44 // Print the table header if necessary
75b9227fb98c Added beginning of recipe print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
45 if ($this->ProcessingTable)
75b9227fb98c Added beginning of recipe print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
46 $this->TableHeader();
75b9227fb98c Added beginning of recipe print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
47 }
75b9227fb98c Added beginning of recipe print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
48
75b9227fb98c Added beginning of recipe print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
49 function TableHeader() {
75b9227fb98c Added beginning of recipe print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
50 $this->SetFont('Helvetica','B',9);
75b9227fb98c Added beginning of recipe print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
51 $this->SetX($this->TableX);
83
85521c6e0022 Added recipe print yeasts section.
Michiel Broek <mbroek@mbse.eu>
parents: 80
diff changeset
52 $this->SetFillColor(255,150,100);
80
75b9227fb98c Added beginning of recipe print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
53 foreach($this->aCols as $col)
75b9227fb98c Added beginning of recipe print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
54 $this->Cell($col['w'],5,$col['c'],0,0,$col['a'],true);
75b9227fb98c Added beginning of recipe print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
55 $this->Ln();
75b9227fb98c Added beginning of recipe print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
56 }
75b9227fb98c Added beginning of recipe print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
57
75b9227fb98c Added beginning of recipe print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
58 function AddCol($width=-1, $caption='', $align='L') {
75b9227fb98c Added beginning of recipe print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
59 $this->aCols[]=array('c'=>$caption,'w'=>$width,'a'=>$align);
75b9227fb98c Added beginning of recipe print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
60 }
75b9227fb98c Added beginning of recipe print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
61
83
85521c6e0022 Added recipe print yeasts section.
Michiel Broek <mbroek@mbse.eu>
parents: 80
diff changeset
62 function TableGlobal($row) {
80
75b9227fb98c Added beginning of recipe print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
63 /* 2 Columns */
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: 449
diff changeset
64 global $recipetype;
89
082c23b26055 Missing Water agent costs from Brouwhulp import are now added from the imported miscs database. The printed recipe report now calculates the beer color from the ingredients. Also set during recipes import. This will later allow to set the color method for each recipe individually.
Michiel Broek <mbroek@mbse.eu>
parents: 88
diff changeset
65 $vul = $this->w - $this->rMargin - $this->lMargin - 120;
80
75b9227fb98c Added beginning of recipe print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
66 $cMargin=$this->cMargin;
83
85521c6e0022 Added recipe print yeasts section.
Michiel Broek <mbroek@mbse.eu>
parents: 80
diff changeset
67 $this->cMargin=2;
80
75b9227fb98c Added beginning of recipe print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
68 $this->TableX=$this->lMargin;
83
85521c6e0022 Added recipe print yeasts section.
Michiel Broek <mbroek@mbse.eu>
parents: 80
diff changeset
69 $this->SetFont('Helvetica','B',9);
80
75b9227fb98c Added beginning of recipe print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
70 $this->SetX($this->TableX);
83
85521c6e0022 Added recipe print yeasts section.
Michiel Broek <mbroek@mbse.eu>
parents: 80
diff changeset
71 $this->SetFillColor(255,150,100);
85521c6e0022 Added recipe print yeasts section.
Michiel Broek <mbroek@mbse.eu>
parents: 80
diff changeset
72 $this->Cell(0, 5, 'Recept overzicht',0,0,'C',true);
80
75b9227fb98c Added beginning of recipe print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
73 $this->Ln();
75b9227fb98c Added beginning of recipe print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
74
75b9227fb98c Added beginning of recipe print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
75 $this->SetFont('Helvetica','',9);
83
85521c6e0022 Added recipe print yeasts section.
Michiel Broek <mbroek@mbse.eu>
parents: 80
diff changeset
76 $this->SetFillColor(210,245,255);
80
75b9227fb98c Added beginning of recipe print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
77
75b9227fb98c Added beginning of recipe print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
78 $this->SetX($this->TableX);
75b9227fb98c Added beginning of recipe print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
79 $this->Cell(35,5,'Type',0,0,'L',true);
233
14a84d42031d In recipe report added the date and beer style to the page header.
Michiel Broek <mbroek@mbse.eu>
parents: 232
diff changeset
80 $this->Cell(25,5,$recipetype[$row['type']],0,0,'L',true);
80
75b9227fb98c Added beginning of recipe print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
81 $this->Cell($vul,5,'',0,0,'L',false);
75b9227fb98c Added beginning of recipe print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
82 $this->Cell(35,5,'Batch grootte',0,0,'L',true);
75b9227fb98c Added beginning of recipe print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
83 $this->Cell(25,5,$row['batch_size'].' liter',0,0,'L',true);
75b9227fb98c Added beginning of recipe print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
84 $this->Ln();
75b9227fb98c Added beginning of recipe print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
85
75b9227fb98c Added beginning of recipe print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
86 $this->SetX($this->TableX);
75b9227fb98c Added beginning of recipe print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
87 $this->Cell(35,5,'Kooktijd',0,0,'L',true);
75b9227fb98c Added beginning of recipe print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
88 $this->Cell(25,5,$row['boil_time'].' minuten',0,0,'L',true);
75b9227fb98c Added beginning of recipe print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
89 $this->Cell($vul,5,'',0,0,'L',false);
75b9227fb98c Added beginning of recipe print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
90 $this->Cell(35,5,'Brouwzaal rendement',0,0,'L',true);
75b9227fb98c Added beginning of recipe print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
91 $this->Cell(25,5,$row['efficiency'].' %',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: 338
diff changeset
92 $this->Ln();
80
75b9227fb98c Added beginning of recipe print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
93
75b9227fb98c Added beginning of recipe print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
94 $this->cMargin=$cMargin;
75b9227fb98c Added beginning of recipe print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
95 }
75b9227fb98c Added beginning of recipe print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
96
83
85521c6e0022 Added recipe print yeasts section.
Michiel Broek <mbroek@mbse.eu>
parents: 80
diff changeset
97 function TableFermentables($row) {
85521c6e0022 Added recipe print yeasts section.
Michiel Broek <mbroek@mbse.eu>
parents: 80
diff changeset
98 global $cost_fermentables;
85521c6e0022 Added recipe print yeasts section.
Michiel Broek <mbroek@mbse.eu>
parents: 80
diff changeset
99 global $total_fermentables;
87
7f1d0abe5571 OG and FG are now calculated from the grist. The printed report has a summary an notes section at the end. The formulas are in the global formulas script.
Michiel Broek <mbroek@mbse.eu>
parents: 86
diff changeset
100 global $pSugar;
7f1d0abe5571 OG and FG are now calculated from the grist. The printed report has a summary an notes section at the end. The formulas are in the global formulas script.
Michiel Broek <mbroek@mbse.eu>
parents: 86
diff changeset
101 global $pCara;
89
082c23b26055 Missing Water agent costs from Brouwhulp import are now added from the imported miscs database. The printed recipe report now calculates the beer color from the ingredients. Also set during recipes import. This will later allow to set the color method for each recipe individually.
Michiel Broek <mbroek@mbse.eu>
parents: 88
diff changeset
102 global $colorw;
94
295c3af2a421 Include boil_size field in the recipes table. Calculate pre-boil SG. Use that in the IBU calculation.
Michiel Broek <mbroek@mbse.eu>
parents: 93
diff changeset
103 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: 449
diff changeset
104 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: 449
diff changeset
105 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: 449
diff changeset
106 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: 338
diff changeset
107 $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: 338
diff changeset
108 $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: 338
diff changeset
109 $this->AddCol($vul,'Mout, granen en suikers','L');
83
85521c6e0022 Added recipe print yeasts section.
Michiel Broek <mbroek@mbse.eu>
parents: 80
diff changeset
110 $this->AddCol(15,'Procent','R');
85521c6e0022 Added recipe print yeasts section.
Michiel Broek <mbroek@mbse.eu>
parents: 80
diff changeset
111 $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: 338
diff changeset
112 $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: 338
diff changeset
113 $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: 338
diff changeset
114 $this->AddCol(20,'Hoeveel','R');
83
85521c6e0022 Added recipe print yeasts section.
Michiel Broek <mbroek@mbse.eu>
parents: 80
diff changeset
115 $this->AddCol(20,'Prijs','R');
80
75b9227fb98c Added beginning of recipe print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
116
75b9227fb98c Added beginning of recipe print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
117 $cMargin=$this->cMargin;
83
85521c6e0022 Added recipe print yeasts section.
Michiel Broek <mbroek@mbse.eu>
parents: 80
diff changeset
118 $this->cMargin=2;
80
75b9227fb98c Added beginning of recipe print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
119 $this->TableX=$this->lMargin;
75b9227fb98c Added beginning of recipe print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
120 $this->TableHeader();
75b9227fb98c Added beginning of recipe print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
121 $this->ProcessingTable=true;
75b9227fb98c Added beginning of recipe print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
122
98
92d6bc8a4cdd Added javascript formulas for color calculations. Added IBU total calculation. Better IBI calculation for the hop entries. Blocked selection of IBU calculation for Garetz, Mosher and Noonan. Better sg calculation in the recipe print.
Michiel Broek <mbroek@mbse.eu>
parents: 96
diff changeset
123 $sugarsf = 0;
92d6bc8a4cdd Added javascript formulas for color calculations. Added IBU total calculation. Better IBI calculation for the hop entries. Blocked selection of IBU calculation for Garetz, Mosher and Noonan. Better sg calculation in the recipe print.
Michiel Broek <mbroek@mbse.eu>
parents: 96
diff changeset
124 $sugarsm = 0;
80
75b9227fb98c Added beginning of recipe print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
125 $this->SetFont('Helvetica','',9);
83
85521c6e0022 Added recipe print yeasts section.
Michiel Broek <mbroek@mbse.eu>
parents: 80
diff changeset
126 $this->SetFillColor(250, 195, 65);
80
75b9227fb98c Added beginning of recipe print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
127 $arr = json_decode($row['json_fermentables'], true);
75b9227fb98c Added beginning of recipe print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
128 foreach($arr as $item) { //foreach element in $arr
83
85521c6e0022 Added recipe print yeasts section.
Michiel Broek <mbroek@mbse.eu>
parents: 80
diff changeset
129 $name = iconv('UTF-8','windows-1252',$item['f_name']);
85521c6e0022 Added recipe print yeasts section.
Michiel Broek <mbroek@mbse.eu>
parents: 80
diff changeset
130 $supplier = iconv('UTF-8','windows-1252',$item['f_supplier']);
80
75b9227fb98c Added beginning of recipe print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
131 $amount = floatval($item['f_amount']);
75b9227fb98c Added beginning of recipe print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
132 $costkg = floatval($item['f_cost']);
75b9227fb98c Added beginning of recipe print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
133 $yield = floatval($item['f_yield']);
85
ca7a37586551 Added SG/Plato formulas for PHP. Added OG calculation in the recipe print.
Michiel Broek <mbroek@mbse.eu>
parents: 84
diff changeset
134 $moisture = floatval($item['f_moisture']);
80
75b9227fb98c Added beginning of recipe print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
135 $color = floatval($item['f_color']);
75b9227fb98c Added beginning of recipe print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
136 $percent = floatval($item['f_percentage']);
87
7f1d0abe5571 OG and FG are now calculated from the grist. The printed report has a summary an notes section at the end. The formulas are in the global formulas script.
Michiel Broek <mbroek@mbse.eu>
parents: 86
diff changeset
137
231
9881453a49b3 Recipe print and export afjusted to use array indexes.
Michiel Broek <mbroek@mbse.eu>
parents: 98
diff changeset
138 if ($item['f_type'] == 1) // Sugar
87
7f1d0abe5571 OG and FG are now calculated from the grist. The printed report has a summary an notes section at the end. The formulas are in the global formulas script.
Michiel Broek <mbroek@mbse.eu>
parents: 86
diff changeset
139 $pSugar += $percent;
231
9881453a49b3 Recipe print and export afjusted to use array indexes.
Michiel Broek <mbroek@mbse.eu>
parents: 98
diff changeset
140 if ($item['f_graintype'] == 2) // Crystal
87
7f1d0abe5571 OG and FG are now calculated from the grist. The printed report has a summary an notes section at the end. The formulas are in the global formulas script.
Michiel Broek <mbroek@mbse.eu>
parents: 86
diff changeset
141 $pCara += $percent;
7f1d0abe5571 OG and FG are now calculated from the grist. The printed report has a summary an notes section at the end. The formulas are in the global formulas script.
Michiel Broek <mbroek@mbse.eu>
parents: 86
diff changeset
142
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: 338
diff changeset
143 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: 449
diff changeset
144 $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: 338
diff changeset
145 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: 449
diff changeset
146 $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: 338
diff changeset
147
80
75b9227fb98c Added beginning of recipe print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
148 $cost = $amount * $costkg;
83
85521c6e0022 Added recipe print yeasts section.
Michiel Broek <mbroek@mbse.eu>
parents: 80
diff changeset
149 $cost_fermentables += $cost;
85521c6e0022 Added recipe print yeasts section.
Michiel Broek <mbroek@mbse.eu>
parents: 80
diff changeset
150 $total_fermentables += $amount;
85
ca7a37586551 Added SG/Plato formulas for PHP. Added OG calculation in the recipe print.
Michiel Broek <mbroek@mbse.eu>
parents: 84
diff changeset
151 /* Calculate the amount of sugars */
ca7a37586551 Added SG/Plato formulas for PHP. Added OG calculation in the recipe print.
Michiel Broek <mbroek@mbse.eu>
parents: 84
diff changeset
152 $d = $amount * ($yield / 100) * (1 - $moisture / 100);
231
9881453a49b3 Recipe print and export afjusted to use array indexes.
Michiel Broek <mbroek@mbse.eu>
parents: 98
diff changeset
153 if ($item['f_added'] == 0) { // Mash
85
ca7a37586551 Added SG/Plato formulas for PHP. Added OG calculation in the recipe print.
Michiel Broek <mbroek@mbse.eu>
parents: 84
diff changeset
154 $d = floatval($row['efficiency']) / 100 * $d;
98
92d6bc8a4cdd Added javascript formulas for color calculations. Added IBU total calculation. Better IBI calculation for the hop entries. Blocked selection of IBU calculation for Garetz, Mosher and Noonan. Better sg calculation in the recipe print.
Michiel Broek <mbroek@mbse.eu>
parents: 96
diff changeset
155 $sugarsm += $d;
92d6bc8a4cdd Added javascript formulas for color calculations. Added IBU total calculation. Better IBI calculation for the hop entries. Blocked selection of IBU calculation for Garetz, Mosher and Noonan. Better sg calculation in the recipe print.
Michiel Broek <mbroek@mbse.eu>
parents: 96
diff changeset
156 }
92d6bc8a4cdd Added javascript formulas for color calculations. Added IBU total calculation. Better IBI calculation for the hop entries. Blocked selection of IBU calculation for Garetz, Mosher and Noonan. Better sg calculation in the recipe print.
Michiel Broek <mbroek@mbse.eu>
parents: 96
diff changeset
157 $sugarsf += $d;
89
082c23b26055 Missing Water agent costs from Brouwhulp import are now added from the imported miscs database. The printed recipe report now calculates the beer color from the ingredients. Also set during recipes import. This will later allow to set the color method for each recipe individually.
Michiel Broek <mbroek@mbse.eu>
parents: 88
diff changeset
158 $colorw += ($amount * ebc_to_srm($color) / $row['batch_size']) * 8.34436;
85
ca7a37586551 Added SG/Plato formulas for PHP. Added OG calculation in the recipe print.
Michiel Broek <mbroek@mbse.eu>
parents: 84
diff changeset
159
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: 338
diff changeset
160 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: 338
diff changeset
161 $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: 338
diff changeset
162 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: 338
diff changeset
163 $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: 338
diff changeset
164 else
544d7d0183b2 Added 15 fields to the recipes table. Added 18 fields to the products table. These are calculated values that are now stored in the database so export programs can use these values without calculating them again. Product and recipe print have water and mash schedule added. Product print has brewday results added if the brewday is over. The ingredients layout changed in the product and recipe prints.
Michiel Broek <mbroek@mbse.eu>
parents: 338
diff changeset
165 $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: 338
diff changeset
166 $this->Cell($vul,5,$name.' ('.$supplier.') '.sprintf("%.0f",$color).' EBC',0,0,'L',true);
80
75b9227fb98c Added beginning of recipe print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
167 $this->Cell(15,5,sprintf("%.1f%%",$percent),0,0,'R',true);
75b9227fb98c Added beginning of recipe print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
168 $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: 338
diff changeset
169 $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: 338
diff changeset
170 $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: 338
diff changeset
171 $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: 338
diff changeset
172 $this->Cell(20,5,sprintf("%.3f",$cost).EURO,0,0,'R',true);
80
75b9227fb98c Added beginning of recipe print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
173 $this->Ln();
75b9227fb98c Added beginning of recipe print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
174 }
75b9227fb98c Added beginning of recipe print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
175
98
92d6bc8a4cdd Added javascript formulas for color calculations. Added IBU total calculation. Better IBI calculation for the hop entries. Blocked selection of IBU calculation for Garetz, Mosher and Noonan. Better sg calculation in the recipe print.
Michiel Broek <mbroek@mbse.eu>
parents: 96
diff changeset
176 $row['est_og'] = estimate_sg($sugarsf, floatval($row['batch_size']));
92d6bc8a4cdd Added javascript formulas for color calculations. Added IBU total calculation. Better IBI calculation for the hop entries. Blocked selection of IBU calculation for Garetz, Mosher and Noonan. Better sg calculation in the recipe print.
Michiel Broek <mbroek@mbse.eu>
parents: 96
diff changeset
177 $preboil_sg = estimate_sg($sugarsm, floatval($row['boil_size']));
83
85521c6e0022 Added recipe print yeasts section.
Michiel Broek <mbroek@mbse.eu>
parents: 80
diff changeset
178 $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: 338
diff changeset
179 $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: 338
diff changeset
180 $this->Cell(20,5,sprintf("%.3f",$cost_fermentables).EURO,0,0,'R',true);
80
75b9227fb98c Added beginning of recipe print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
181 $this->ProcessingTable=false;
75b9227fb98c Added beginning of recipe print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
182 $this->cMargin=$cMargin;
75b9227fb98c Added beginning of recipe print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
183 $this->aCols=array();
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: 338
diff changeset
184 $this->Ln();
80
75b9227fb98c Added beginning of recipe print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
185 }
83
85521c6e0022 Added recipe print yeasts section.
Michiel Broek <mbroek@mbse.eu>
parents: 80
diff changeset
186
85521c6e0022 Added recipe print yeasts section.
Michiel Broek <mbroek@mbse.eu>
parents: 80
diff changeset
187 function TableHops($row) {
85521c6e0022 Added recipe print yeasts section.
Michiel Broek <mbroek@mbse.eu>
parents: 80
diff changeset
188 global $total_hops;
93
357d59d8ec5e Added IBU and cost totals.
Michiel Broek <mbroek@mbse.eu>
parents: 90
diff changeset
189 global $total_ibus;
83
85521c6e0022 Added recipe print yeasts section.
Michiel Broek <mbroek@mbse.eu>
parents: 80
diff changeset
190 global $cost_hops;
94
295c3af2a421 Include boil_size field in the recipes table. Calculate pre-boil SG. Use that in the IBU calculation.
Michiel Broek <mbroek@mbse.eu>
parents: 93
diff changeset
191 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: 449
diff changeset
192 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: 449
diff changeset
193 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: 338
diff changeset
194 $vul = $this->w - $this->rMargin - $this->lMargin - 122;
544d7d0183b2 Added 15 fields to the recipes table. Added 18 fields to the products table. These are calculated values that are now stored in the database so export programs can use these values without calculating them again. Product and recipe print have water and mash schedule added. Product print has brewday results added if the brewday is over. The ingredients layout changed in the product and recipe prints.
Michiel Broek <mbroek@mbse.eu>
parents: 338
diff changeset
195 $this->Ln();
83
85521c6e0022 Added recipe print yeasts section.
Michiel Broek <mbroek@mbse.eu>
parents: 80
diff changeset
196 $this->AddCol($vul,'Hop','L');
85521c6e0022 Added recipe print yeasts section.
Michiel Broek <mbroek@mbse.eu>
parents: 80
diff changeset
197 $this->AddCol(15,'Alpha','R');
85521c6e0022 Added recipe print yeasts section.
Michiel Broek <mbroek@mbse.eu>
parents: 80
diff changeset
198 $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: 338
diff changeset
199 $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: 338
diff changeset
200 $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: 338
diff changeset
201 $this->AddCol(20,'Hoeveel','R');
83
85521c6e0022 Added recipe print yeasts section.
Michiel Broek <mbroek@mbse.eu>
parents: 80
diff changeset
202 $this->AddCol(20,'Prijs','R');
85521c6e0022 Added recipe print yeasts section.
Michiel Broek <mbroek@mbse.eu>
parents: 80
diff changeset
203
85521c6e0022 Added recipe print yeasts section.
Michiel Broek <mbroek@mbse.eu>
parents: 80
diff changeset
204 $cMargin=$this->cMargin;
85521c6e0022 Added recipe print yeasts section.
Michiel Broek <mbroek@mbse.eu>
parents: 80
diff changeset
205 $this->cMargin=2;
85521c6e0022 Added recipe print yeasts section.
Michiel Broek <mbroek@mbse.eu>
parents: 80
diff changeset
206 $this->TableX=$this->lMargin;
85521c6e0022 Added recipe print yeasts section.
Michiel Broek <mbroek@mbse.eu>
parents: 80
diff changeset
207 $this->TableHeader();
85521c6e0022 Added recipe print yeasts section.
Michiel Broek <mbroek@mbse.eu>
parents: 80
diff changeset
208 $this->ProcessingTable=true;
85521c6e0022 Added recipe print yeasts section.
Michiel Broek <mbroek@mbse.eu>
parents: 80
diff changeset
209
85521c6e0022 Added recipe print yeasts section.
Michiel Broek <mbroek@mbse.eu>
parents: 80
diff changeset
210 $this->SetFont('Helvetica','',9);
85521c6e0022 Added recipe print yeasts section.
Michiel Broek <mbroek@mbse.eu>
parents: 80
diff changeset
211 $this->SetFillColor(100, 250, 65);
85521c6e0022 Added recipe print yeasts section.
Michiel Broek <mbroek@mbse.eu>
parents: 80
diff changeset
212
85521c6e0022 Added recipe print yeasts section.
Michiel Broek <mbroek@mbse.eu>
parents: 80
diff changeset
213 $arr = json_decode($row['json_hops'], true);
85521c6e0022 Added recipe print yeasts section.
Michiel Broek <mbroek@mbse.eu>
parents: 80
diff changeset
214 foreach($arr as $item) { //foreach element in $arr
85521c6e0022 Added recipe print yeasts section.
Michiel Broek <mbroek@mbse.eu>
parents: 80
diff changeset
215 $name = iconv('UTF-8','windows-1252',$item['h_name']);
85521c6e0022 Added recipe print yeasts section.
Michiel Broek <mbroek@mbse.eu>
parents: 80
diff changeset
216 $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: 338
diff changeset
217 $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: 338
diff changeset
218 $mass = $amount * 1000;
83
85521c6e0022 Added recipe print yeasts section.
Michiel Broek <mbroek@mbse.eu>
parents: 80
diff changeset
219 $costkg = floatval($item['h_cost']);
85521c6e0022 Added recipe print yeasts section.
Michiel Broek <mbroek@mbse.eu>
parents: 80
diff changeset
220 $time = floatval($item['h_time']);
85521c6e0022 Added recipe print yeasts section.
Michiel Broek <mbroek@mbse.eu>
parents: 80
diff changeset
221 $alpha = floatval($item['h_alpha']);
85521c6e0022 Added recipe print yeasts section.
Michiel Broek <mbroek@mbse.eu>
parents: 80
diff changeset
222
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: 338
diff changeset
223 $cost = ($amount * $costkg);
83
85521c6e0022 Added recipe print yeasts section.
Michiel Broek <mbroek@mbse.eu>
parents: 80
diff changeset
224 $cost_hops += $cost;
85521c6e0022 Added recipe print yeasts section.
Michiel Broek <mbroek@mbse.eu>
parents: 80
diff changeset
225 $total_hops += $amount;
85521c6e0022 Added recipe print yeasts section.
Michiel Broek <mbroek@mbse.eu>
parents: 80
diff changeset
226
231
9881453a49b3 Recipe print and export afjusted to use array indexes.
Michiel Broek <mbroek@mbse.eu>
parents: 98
diff changeset
227 $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
228 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
229 $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: 338
diff changeset
230 } 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
231 $moment = $hopuse[$item['h_useat']].' '.sprintf("%.0f", $time / 1440).' dagen';
83
85521c6e0022 Added recipe print yeasts section.
Michiel Broek <mbroek@mbse.eu>
parents: 80
diff changeset
232 }
539
fe9ac6d49c4f Printed outputs have IBUs for whirlpool hops. Removed some debug console logs.
Michiel Broek <mbroek@mbse.eu>
parents: 516
diff changeset
233 $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
234 $row['ibu_method'], $row['brew_whirlpool9'], $row['brew_whirlpool7'], $row['brew_whirlpool6']);
93
357d59d8ec5e Added IBU and cost totals.
Michiel Broek <mbroek@mbse.eu>
parents: 90
diff changeset
235 $total_ibus += $ibu;
83
85521c6e0022 Added recipe print yeasts section.
Michiel Broek <mbroek@mbse.eu>
parents: 80
diff changeset
236
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: 338
diff changeset
237 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: 338
diff changeset
238 $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: 338
diff changeset
239 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: 338
diff changeset
240 $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: 338
diff changeset
241
544d7d0183b2 Added 15 fields to the recipes table. Added 18 fields to the products table. These are calculated values that are now stored in the database so export programs can use these values without calculating them again. Product and recipe print have water and mash schedule added. Product print has brewday results added if the brewday is over. The ingredients layout changed in the product and recipe prints.
Michiel Broek <mbroek@mbse.eu>
parents: 338
diff changeset
242 $this->Cell($vul,5,$name.' ('.$origin.')',0,0,'L',true);
83
85521c6e0022 Added recipe print yeasts section.
Michiel Broek <mbroek@mbse.eu>
parents: 80
diff changeset
243 $this->Cell(15,5,sprintf("%.1f%%",$alpha),0,0,'R',true);
85521c6e0022 Added recipe print yeasts section.
Michiel Broek <mbroek@mbse.eu>
parents: 80
diff changeset
244 $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: 338
diff changeset
245 $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: 338
diff changeset
246 $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: 338
diff changeset
247 $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: 338
diff changeset
248 $this->Cell(20,5,sprintf("%.3f",$cost).EURO,0,0,'R',true);
83
85521c6e0022 Added recipe print yeasts section.
Michiel Broek <mbroek@mbse.eu>
parents: 80
diff changeset
249 $this->Ln();
85521c6e0022 Added recipe print yeasts section.
Michiel Broek <mbroek@mbse.eu>
parents: 80
diff changeset
250 }
85521c6e0022 Added recipe print yeasts section.
Michiel Broek <mbroek@mbse.eu>
parents: 80
diff changeset
251
85521c6e0022 Added recipe print yeasts section.
Michiel Broek <mbroek@mbse.eu>
parents: 80
diff changeset
252 $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: 338
diff changeset
253 $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: 338
diff changeset
254 $this->Cell(20,5,sprintf("%.3f",$cost_hops).EURO,0,0,'R',true);
83
85521c6e0022 Added recipe print yeasts section.
Michiel Broek <mbroek@mbse.eu>
parents: 80
diff changeset
255 $this->ProcessingTable=false;
85521c6e0022 Added recipe print yeasts section.
Michiel Broek <mbroek@mbse.eu>
parents: 80
diff changeset
256 $this->cMargin=$cMargin;
85521c6e0022 Added recipe print yeasts section.
Michiel Broek <mbroek@mbse.eu>
parents: 80
diff changeset
257 $this->aCols=array();
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: 338
diff changeset
258 $this->Ln();
83
85521c6e0022 Added recipe print yeasts section.
Michiel Broek <mbroek@mbse.eu>
parents: 80
diff changeset
259 }
85521c6e0022 Added recipe print yeasts section.
Michiel Broek <mbroek@mbse.eu>
parents: 80
diff changeset
260
85521c6e0022 Added recipe print yeasts section.
Michiel Broek <mbroek@mbse.eu>
parents: 80
diff changeset
261 function TableYeasts($row) {
85521c6e0022 Added recipe print yeasts section.
Michiel Broek <mbroek@mbse.eu>
parents: 80
diff changeset
262 global $cost_yeasts;
87
7f1d0abe5571 OG and FG are now calculated from the grist. The printed report has a summary an notes section at the end. The formulas are in the global formulas script.
Michiel Broek <mbroek@mbse.eu>
parents: 86
diff changeset
263 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: 449
diff changeset
264 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: 449
diff changeset
265 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: 338
diff changeset
266 $vul = $this->w - $this->rMargin - $this->lMargin - 110;
544d7d0183b2 Added 15 fields to the recipes table. Added 18 fields to the products table. These are calculated values that are now stored in the database so export programs can use these values without calculating them again. Product and recipe print have water and mash schedule added. Product print has brewday results added if the brewday is over. The ingredients layout changed in the product and recipe prints.
Michiel Broek <mbroek@mbse.eu>
parents: 338
diff changeset
267 $this->Ln();
83
85521c6e0022 Added recipe print yeasts section.
Michiel Broek <mbroek@mbse.eu>
parents: 80
diff changeset
268 $this->AddCol($vul,'Gist','L');
85521c6e0022 Added recipe print yeasts section.
Michiel Broek <mbroek@mbse.eu>
parents: 80
diff changeset
269 $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: 338
diff changeset
270 $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: 338
diff changeset
271 $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: 338
diff changeset
272 $this->AddCol(20,'Hoeveel','R');
83
85521c6e0022 Added recipe print yeasts section.
Michiel Broek <mbroek@mbse.eu>
parents: 80
diff changeset
273 $this->AddCol(20,'Prijs','R');
85521c6e0022 Added recipe print yeasts section.
Michiel Broek <mbroek@mbse.eu>
parents: 80
diff changeset
274
85521c6e0022 Added recipe print yeasts section.
Michiel Broek <mbroek@mbse.eu>
parents: 80
diff changeset
275 $cMargin=$this->cMargin;
85521c6e0022 Added recipe print yeasts section.
Michiel Broek <mbroek@mbse.eu>
parents: 80
diff changeset
276 $this->cMargin=2;
85521c6e0022 Added recipe print yeasts section.
Michiel Broek <mbroek@mbse.eu>
parents: 80
diff changeset
277 $this->TableX=$this->lMargin;
85521c6e0022 Added recipe print yeasts section.
Michiel Broek <mbroek@mbse.eu>
parents: 80
diff changeset
278 $this->TableHeader();
85521c6e0022 Added recipe print yeasts section.
Michiel Broek <mbroek@mbse.eu>
parents: 80
diff changeset
279 $this->ProcessingTable=true;
85521c6e0022 Added recipe print yeasts section.
Michiel Broek <mbroek@mbse.eu>
parents: 80
diff changeset
280
85521c6e0022 Added recipe print yeasts section.
Michiel Broek <mbroek@mbse.eu>
parents: 80
diff changeset
281 $this->SetFont('Helvetica','',9);
85521c6e0022 Added recipe print yeasts section.
Michiel Broek <mbroek@mbse.eu>
parents: 80
diff changeset
282 $this->SetFillColor(175, 175, 255);
85521c6e0022 Added recipe print yeasts section.
Michiel Broek <mbroek@mbse.eu>
parents: 80
diff changeset
283
85521c6e0022 Added recipe print yeasts section.
Michiel Broek <mbroek@mbse.eu>
parents: 80
diff changeset
284 $arr = json_decode($row['json_yeasts'], true);
85521c6e0022 Added recipe print yeasts section.
Michiel Broek <mbroek@mbse.eu>
parents: 80
diff changeset
285 foreach($arr as $item) { //foreach element in $arr
85521c6e0022 Added recipe print yeasts section.
Michiel Broek <mbroek@mbse.eu>
parents: 80
diff changeset
286 $name = iconv('UTF-8','windows-1252',$item['y_name']);
85521c6e0022 Added recipe print yeasts section.
Michiel Broek <mbroek@mbse.eu>
parents: 80
diff changeset
287 $laboratory = iconv('UTF-8','windows-1252',$item['y_laboratory']);
85521c6e0022 Added recipe print yeasts section.
Michiel Broek <mbroek@mbse.eu>
parents: 80
diff changeset
288 $product_id = iconv('UTF-8','windows-1252',$item['y_product_id']);
85521c6e0022 Added recipe print yeasts section.
Michiel Broek <mbroek@mbse.eu>
parents: 80
diff changeset
289 $attenuation = floatval($item['y_attenuation']);
232
daf2d9d6fa18 When adding yeast the flocculation and cells fields were not added. Possible fix for double water agents in the miscs grid. Better efforts to set the initial water infuse amount. The new recipe wizzard now uses indexed fields. In recipe print fixed the yeast amount and cost.
Michiel Broek <mbroek@mbse.eu>
parents: 231
diff changeset
290 $cost = floatval($item['y_amount']) * floatval($item['y_cost']);
83
85521c6e0022 Added recipe print yeasts section.
Michiel Broek <mbroek@mbse.eu>
parents: 80
diff changeset
291 $cost_yeasts += $cost;
85521c6e0022 Added recipe print yeasts section.
Michiel Broek <mbroek@mbse.eu>
parents: 80
diff changeset
292
231
9881453a49b3 Recipe print and export afjusted to use array indexes.
Michiel Broek <mbroek@mbse.eu>
parents: 98
diff changeset
293 if ($item['y_use'] == 0) // Primary
83
85521c6e0022 Added recipe print yeasts section.
Michiel Broek <mbroek@mbse.eu>
parents: 80
diff changeset
294 $svg = $attenuation;
85521c6e0022 Added recipe print yeasts section.
Michiel Broek <mbroek@mbse.eu>
parents: 80
diff changeset
295
232
daf2d9d6fa18 When adding yeast the flocculation and cells fields were not added. Possible fix for double water agents in the miscs grid. Better efforts to set the initial water infuse amount. The new recipe wizzard now uses indexed fields. In recipe print fixed the yeast amount and cost.
Michiel Broek <mbroek@mbse.eu>
parents: 231
diff changeset
296 if ($item['y_form'] == 0) // Liquid
daf2d9d6fa18 When adding yeast the flocculation and cells fields were not added. Possible fix for double water agents in the miscs grid. Better efforts to set the initial water infuse amount. The new recipe wizzard now uses indexed fields. In recipe print fixed the yeast amount and cost.
Michiel Broek <mbroek@mbse.eu>
parents: 231
diff changeset
297 $amount = sprintf("%.0f",floatval($item['y_amount']))." pak";
516
28670364bd0c Added dried yeast form.
Michiel Broek <mbroek@mbse.eu>
parents: 514
diff changeset
298 else if ($item['y_form'] == 1 || $item['y_form'] == 6) // Dry
232
daf2d9d6fa18 When adding yeast the flocculation and cells fields were not added. Possible fix for double water agents in the miscs grid. Better efforts to set the initial water infuse amount. The new recipe wizzard now uses indexed fields. In recipe print fixed the yeast amount and cost.
Michiel Broek <mbroek@mbse.eu>
parents: 231
diff changeset
299 $amount = sprintf("%.1f",floatval($item['y_amount'])*1000)." gr";
daf2d9d6fa18 When adding yeast the flocculation and cells fields were not added. Possible fix for double water agents in the miscs grid. Better efforts to set the initial water infuse amount. The new recipe wizzard now uses indexed fields. In recipe print fixed the yeast amount and cost.
Michiel Broek <mbroek@mbse.eu>
parents: 231
diff changeset
300 else
daf2d9d6fa18 When adding yeast the flocculation and cells fields were not added. Possible fix for double water agents in the miscs grid. Better efforts to set the initial water infuse amount. The new recipe wizzard now uses indexed fields. In recipe print fixed the yeast amount and cost.
Michiel Broek <mbroek@mbse.eu>
parents: 231
diff changeset
301 $amount = sprintf("%.0f",floatval($item['y_amount'])*1000)." ml";
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: 338
diff changeset
302 $this->Cell($vul,5,$laboratory.' '.$product_id.' ('.$name.')',0,0,'L',true);
83
85521c6e0022 Added recipe print yeasts section.
Michiel Broek <mbroek@mbse.eu>
parents: 80
diff changeset
303 $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: 338
diff changeset
304 $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: 338
diff changeset
305 $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: 338
diff changeset
306 $this->Cell(20,5,$amount,0,0,'R',true);
83
85521c6e0022 Added recipe print yeasts section.
Michiel Broek <mbroek@mbse.eu>
parents: 80
diff changeset
307 $this->Cell(20,5,sprintf("%8.3f",$cost).EURO,0,0,'R',true);
85521c6e0022 Added recipe print yeasts section.
Michiel Broek <mbroek@mbse.eu>
parents: 80
diff changeset
308 $this->Ln();
85521c6e0022 Added recipe print yeasts section.
Michiel Broek <mbroek@mbse.eu>
parents: 80
diff changeset
309 }
85521c6e0022 Added recipe print yeasts section.
Michiel Broek <mbroek@mbse.eu>
parents: 80
diff changeset
310
85521c6e0022 Added recipe print yeasts section.
Michiel Broek <mbroek@mbse.eu>
parents: 80
diff changeset
311 $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: 338
diff changeset
312 $this->Cell($vul+90,5,'',0,0,'L',false);
83
85521c6e0022 Added recipe print yeasts section.
Michiel Broek <mbroek@mbse.eu>
parents: 80
diff changeset
313 $this->Cell(20,5,sprintf("%8.3f",$cost_yeasts).EURO,0,0,'R',true);
85521c6e0022 Added recipe print yeasts section.
Michiel Broek <mbroek@mbse.eu>
parents: 80
diff changeset
314 $this->ProcessingTable=false;
85521c6e0022 Added recipe print yeasts section.
Michiel Broek <mbroek@mbse.eu>
parents: 80
diff changeset
315 $this->cMargin=$cMargin;
85521c6e0022 Added recipe print yeasts section.
Michiel Broek <mbroek@mbse.eu>
parents: 80
diff changeset
316 $this->aCols=array();
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: 338
diff changeset
317 $this->Ln();
83
85521c6e0022 Added recipe print yeasts section.
Michiel Broek <mbroek@mbse.eu>
parents: 80
diff changeset
318 }
85521c6e0022 Added recipe print yeasts section.
Michiel Broek <mbroek@mbse.eu>
parents: 80
diff changeset
319
85521c6e0022 Added recipe print yeasts section.
Michiel Broek <mbroek@mbse.eu>
parents: 80
diff changeset
320 function TableMiscs($row) {
85521c6e0022 Added recipe print yeasts section.
Michiel Broek <mbroek@mbse.eu>
parents: 80
diff changeset
321 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: 449
diff changeset
322 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: 449
diff changeset
323 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: 338
diff changeset
324 $vul = $this->w - $this->rMargin - $this->lMargin - 95;
544d7d0183b2 Added 15 fields to the recipes table. Added 18 fields to the products table. These are calculated values that are now stored in the database so export programs can use these values without calculating them again. Product and recipe print have water and mash schedule added. Product print has brewday results added if the brewday is over. The ingredients layout changed in the product and recipe prints.
Michiel Broek <mbroek@mbse.eu>
parents: 338
diff changeset
325 if ($this->GetY() > 200)
544d7d0183b2 Added 15 fields to the recipes table. Added 18 fields to the products table. These are calculated values that are now stored in the database so export programs can use these values without calculating them again. Product and recipe print have water and mash schedule added. Product print has brewday results added if the brewday is over. The ingredients layout changed in the product and recipe prints.
Michiel Broek <mbroek@mbse.eu>
parents: 338
diff changeset
326 $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: 338
diff changeset
327 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: 338
diff changeset
328 $this->Ln();
84
3e5e87f1818d Added miscs ingredients to the recipe print.
Michiel Broek <mbroek@mbse.eu>
parents: 83
diff changeset
329 $this->AddCol($vul,'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: 338
diff changeset
330 $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: 338
diff changeset
331 $this->AddCol(30,'Gebruik moment','L');
84
3e5e87f1818d Added miscs ingredients to the recipe print.
Michiel Broek <mbroek@mbse.eu>
parents: 83
diff changeset
332 $this->AddCol(20,'Hoeveel','R');
3e5e87f1818d Added miscs ingredients to the recipe print.
Michiel Broek <mbroek@mbse.eu>
parents: 83
diff changeset
333 $this->AddCol(20,'Prijs','R');
3e5e87f1818d Added miscs ingredients to the recipe print.
Michiel Broek <mbroek@mbse.eu>
parents: 83
diff changeset
334
3e5e87f1818d Added miscs ingredients to the recipe print.
Michiel Broek <mbroek@mbse.eu>
parents: 83
diff changeset
335 $cMargin=$this->cMargin;
3e5e87f1818d Added miscs ingredients to the recipe print.
Michiel Broek <mbroek@mbse.eu>
parents: 83
diff changeset
336 $this->cMargin=2;
3e5e87f1818d Added miscs ingredients to the recipe print.
Michiel Broek <mbroek@mbse.eu>
parents: 83
diff changeset
337 $this->TableX=$this->lMargin;
3e5e87f1818d Added miscs ingredients to the recipe print.
Michiel Broek <mbroek@mbse.eu>
parents: 83
diff changeset
338 $this->TableHeader();
3e5e87f1818d Added miscs ingredients to the recipe print.
Michiel Broek <mbroek@mbse.eu>
parents: 83
diff changeset
339 $this->ProcessingTable=true;
3e5e87f1818d Added miscs ingredients to the recipe print.
Michiel Broek <mbroek@mbse.eu>
parents: 83
diff changeset
340
3e5e87f1818d Added miscs ingredients to the recipe print.
Michiel Broek <mbroek@mbse.eu>
parents: 83
diff changeset
341 $this->SetFont('Helvetica','',9);
3e5e87f1818d Added miscs ingredients to the recipe print.
Michiel Broek <mbroek@mbse.eu>
parents: 83
diff changeset
342 $this->SetFillColor(175, 175, 255);
3e5e87f1818d Added miscs ingredients to the recipe print.
Michiel Broek <mbroek@mbse.eu>
parents: 83
diff changeset
343
3e5e87f1818d Added miscs ingredients to the recipe print.
Michiel Broek <mbroek@mbse.eu>
parents: 83
diff changeset
344 $arr = json_decode($row['json_miscs'], true);
3e5e87f1818d Added miscs ingredients to the recipe print.
Michiel Broek <mbroek@mbse.eu>
parents: 83
diff changeset
345 foreach($arr as $item) {
3e5e87f1818d Added miscs ingredients to the recipe print.
Michiel Broek <mbroek@mbse.eu>
parents: 83
diff changeset
346 $name = iconv('UTF-8','windows-1252',$item['m_name']);
231
9881453a49b3 Recipe print and export afjusted to use array indexes.
Michiel Broek <mbroek@mbse.eu>
parents: 98
diff changeset
347 $type = $item['m_type'];
9881453a49b3 Recipe print and export afjusted to use array indexes.
Michiel Broek <mbroek@mbse.eu>
parents: 98
diff changeset
348 $use_use = $item['m_use_use'];
84
3e5e87f1818d Added miscs ingredients to the recipe print.
Michiel Broek <mbroek@mbse.eu>
parents: 83
diff changeset
349 $amount = floatval($item['m_amount']) * 1000;
3e5e87f1818d Added miscs ingredients to the recipe print.
Michiel Broek <mbroek@mbse.eu>
parents: 83
diff changeset
350 $costg = floatval($item['m_cost']) / 1000;
3e5e87f1818d Added miscs ingredients to the recipe print.
Michiel Broek <mbroek@mbse.eu>
parents: 83
diff changeset
351 $time = floatval($item['m_time']);
3e5e87f1818d Added miscs ingredients to the recipe print.
Michiel Broek <mbroek@mbse.eu>
parents: 83
diff changeset
352 $aiw = $item['m_amount_is_weight'];
3e5e87f1818d Added miscs ingredients to the recipe print.
Michiel Broek <mbroek@mbse.eu>
parents: 83
diff changeset
353 $cost = $amount * $costg;
3e5e87f1818d Added miscs ingredients to the recipe print.
Michiel Broek <mbroek@mbse.eu>
parents: 83
diff changeset
354 $cost_miscs += $cost;
3e5e87f1818d Added miscs ingredients to the recipe print.
Michiel Broek <mbroek@mbse.eu>
parents: 83
diff changeset
355
231
9881453a49b3 Recipe print and export afjusted to use array indexes.
Michiel Broek <mbroek@mbse.eu>
parents: 98
diff changeset
356 if ($type == 4) // Water agent
84
3e5e87f1818d Added miscs ingredients to the recipe print.
Michiel Broek <mbroek@mbse.eu>
parents: 83
diff changeset
357 $this->SetFillColor(240,140,130);
231
9881453a49b3 Recipe print and export afjusted to use array indexes.
Michiel Broek <mbroek@mbse.eu>
parents: 98
diff changeset
358 else if ($type == 3) // Fining
84
3e5e87f1818d Added miscs ingredients to the recipe print.
Michiel Broek <mbroek@mbse.eu>
parents: 83
diff changeset
359 $this->SetFillColor(95,180,25);
231
9881453a49b3 Recipe print and export afjusted to use array indexes.
Michiel Broek <mbroek@mbse.eu>
parents: 98
diff changeset
360 else if (($type == 0) || ($type == 1) || ($type == 2) || ($type == 5)) // Spice, Herb, Flavour, Yeast nutrient
84
3e5e87f1818d Added miscs ingredients to the recipe print.
Michiel Broek <mbroek@mbse.eu>
parents: 83
diff changeset
361 $this->SetFillColor(240,250,65);
3e5e87f1818d Added miscs ingredients to the recipe print.
Michiel Broek <mbroek@mbse.eu>
parents: 83
diff changeset
362 else
3e5e87f1818d Added miscs ingredients to the recipe print.
Michiel Broek <mbroek@mbse.eu>
parents: 83
diff changeset
363 $this->SetFillColor(210,245,255);
3e5e87f1818d Added miscs ingredients to the recipe print.
Michiel Broek <mbroek@mbse.eu>
parents: 83
diff changeset
364
231
9881453a49b3 Recipe print and export afjusted to use array indexes.
Michiel Broek <mbroek@mbse.eu>
parents: 98
diff changeset
365 if ($use_use == 2) // Boil
9881453a49b3 Recipe print and export afjusted to use array indexes.
Michiel Broek <mbroek@mbse.eu>
parents: 98
diff changeset
366 $gebruik = sprintf("%s %d min",$miscuse[$use_use],$time);
84
3e5e87f1818d Added miscs ingredients to the recipe print.
Michiel Broek <mbroek@mbse.eu>
parents: 83
diff changeset
367 else
231
9881453a49b3 Recipe print and export afjusted to use array indexes.
Michiel Broek <mbroek@mbse.eu>
parents: 98
diff changeset
368 $gebruik = $miscuse[$use_use];
84
3e5e87f1818d Added miscs ingredients to the recipe print.
Michiel Broek <mbroek@mbse.eu>
parents: 83
diff changeset
369
3e5e87f1818d Added miscs ingredients to the recipe print.
Michiel Broek <mbroek@mbse.eu>
parents: 83
diff changeset
370 $hoeveel = sprintf("%.1f %s",$amount,$aiw ? "gr":"ml");
3e5e87f1818d Added miscs ingredients to the recipe print.
Michiel Broek <mbroek@mbse.eu>
parents: 83
diff changeset
371 $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: 338
diff changeset
372 $this->Cell(25,5,$misctype[$type],0,0,'L',true);
231
9881453a49b3 Recipe print and export afjusted to use array indexes.
Michiel Broek <mbroek@mbse.eu>
parents: 98
diff changeset
373 $this->Cell(30,5,$gebruik,0,0,'L',true);
84
3e5e87f1818d Added miscs ingredients to the recipe print.
Michiel Broek <mbroek@mbse.eu>
parents: 83
diff changeset
374 $this->Cell(20,5,$hoeveel,0,0,'R',true);
3e5e87f1818d Added miscs ingredients to the recipe print.
Michiel Broek <mbroek@mbse.eu>
parents: 83
diff changeset
375 $this->Cell(20,5,sprintf("%8.3f",$cost).EURO,0,0,'R',true);
3e5e87f1818d Added miscs ingredients to the recipe print.
Michiel Broek <mbroek@mbse.eu>
parents: 83
diff changeset
376 $this->Ln();
3e5e87f1818d Added miscs ingredients to the recipe print.
Michiel Broek <mbroek@mbse.eu>
parents: 83
diff changeset
377 }
3e5e87f1818d Added miscs ingredients to the recipe print.
Michiel Broek <mbroek@mbse.eu>
parents: 83
diff changeset
378
3e5e87f1818d Added miscs ingredients to the recipe print.
Michiel Broek <mbroek@mbse.eu>
parents: 83
diff changeset
379 $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: 338
diff changeset
380 $this->Cell($vul+75,5,'',0,0,'L',false);
84
3e5e87f1818d Added miscs ingredients to the recipe print.
Michiel Broek <mbroek@mbse.eu>
parents: 83
diff changeset
381 $this->Cell(20,5,sprintf("%8.3f",$cost_miscs).EURO,0,0,'R',true);
3e5e87f1818d Added miscs ingredients to the recipe print.
Michiel Broek <mbroek@mbse.eu>
parents: 83
diff changeset
382
3e5e87f1818d Added miscs ingredients to the recipe print.
Michiel Broek <mbroek@mbse.eu>
parents: 83
diff changeset
383 $this->ProcessingTable=false;
3e5e87f1818d Added miscs ingredients to the recipe print.
Michiel Broek <mbroek@mbse.eu>
parents: 83
diff changeset
384 $this->cMargin=$cMargin;
3e5e87f1818d Added miscs ingredients to the recipe print.
Michiel Broek <mbroek@mbse.eu>
parents: 83
diff changeset
385 $this->aCols=array();
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: 338
diff changeset
386 $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: 338
diff changeset
387 }
544d7d0183b2 Added 15 fields to the recipes table. Added 18 fields to the products table. These are calculated values that are now stored in the database so export programs can use these values without calculating them again. Product and recipe print have water and mash schedule added. Product print has brewday results added if the brewday is over. The ingredients layout changed in the product and recipe prints.
Michiel Broek <mbroek@mbse.eu>
parents: 338
diff changeset
388
544d7d0183b2 Added 15 fields to the recipes table. Added 18 fields to the products table. These are calculated values that are now stored in the database so export programs can use these values without calculating them again. Product and recipe print have water and mash schedule added. Product print has brewday results added if the brewday is over. The ingredients layout changed in the product and recipe prints.
Michiel Broek <mbroek@mbse.eu>
parents: 338
diff changeset
389 function TableMashs($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: 338
diff changeset
390 global $cost_yeasts;
544d7d0183b2 Added 15 fields to the recipes table. Added 18 fields to the products table. These are calculated values that are now stored in the database so export programs can use these values without calculating them again. Product and recipe print have water and mash schedule added. Product print has brewday results added if the brewday is over. The ingredients layout changed in the product and recipe prints.
Michiel Broek <mbroek@mbse.eu>
parents: 338
diff changeset
391 global $svg;
544d7d0183b2 Added 15 fields to the recipes table. Added 18 fields to the products table. These are calculated values that are now stored in the database so export programs can use these values without calculating them again. Product and recipe print have water and mash schedule added. Product print has brewday results added if the brewday is over. The ingredients layout changed in the product and recipe prints.
Michiel Broek <mbroek@mbse.eu>
parents: 338
diff changeset
392 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: 449
diff changeset
393 global $mashtype;
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: 338
diff changeset
394 $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: 338
diff changeset
395 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: 338
diff changeset
396 $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: 338
diff changeset
397 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: 338
diff changeset
398 $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: 338
diff changeset
399 $this->AddCol($vul,'Maisch stap naam','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: 338
diff changeset
400 $this->AddCol(25,'Stap type','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: 338
diff changeset
401 $this->AddCol(18,'Start '.DEG.'C','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: 338
diff changeset
402 $this->AddCol(18,'Eind '.DEG.'C','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: 338
diff changeset
403 $this->AddCol(18,'Rust min','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: 338
diff changeset
404 $this->AddCol(18,'Stap min','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: 338
diff changeset
405 $this->AddCol(20,'L/Kg','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: 338
diff changeset
406 $this->AddCol(20,'Infusie L','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: 338
diff changeset
407
544d7d0183b2 Added 15 fields to the recipes table. Added 18 fields to the products table. These are calculated values that are now stored in the database so export programs can use these values without calculating them again. Product and recipe print have water and mash schedule added. Product print has brewday results added if the brewday is over. The ingredients layout changed in the product and recipe prints.
Michiel Broek <mbroek@mbse.eu>
parents: 338
diff changeset
408 $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: 338
diff changeset
409 $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: 338
diff changeset
410 $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: 338
diff changeset
411 $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: 338
diff changeset
412 $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: 338
diff changeset
413
544d7d0183b2 Added 15 fields to the recipes table. Added 18 fields to the products table. These are calculated values that are now stored in the database so export programs can use these values without calculating them again. Product and recipe print have water and mash schedule added. Product print has brewday results added if the brewday is over. The ingredients layout changed in the product and recipe prints.
Michiel Broek <mbroek@mbse.eu>
parents: 338
diff changeset
414 $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: 338
diff changeset
415 $this->SetFillColor(175, 175, 255);
544d7d0183b2 Added 15 fields to the recipes table. Added 18 fields to the products table. These are calculated values that are now stored in the database so export programs can use these values without calculating them again. Product and recipe print have water and mash schedule added. Product print has brewday results added if the brewday is over. The ingredients layout changed in the product and recipe prints.
Michiel Broek <mbroek@mbse.eu>
parents: 338
diff changeset
416
544d7d0183b2 Added 15 fields to the recipes table. Added 18 fields to the products table. These are calculated values that are now stored in the database so export programs can use these values without calculating them again. Product and recipe print have water and mash schedule added. Product print has brewday results added if the brewday is over. The ingredients layout changed in the product and recipe prints.
Michiel Broek <mbroek@mbse.eu>
parents: 338
diff changeset
417 $vol = 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: 338
diff changeset
418 $arr = json_decode($row['json_mashs'], 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: 338
diff changeset
419 foreach($arr as $item) { //foreach element in $arr
544d7d0183b2 Added 15 fields to the recipes table. Added 18 fields to the products table. These are calculated values that are now stored in the database so export programs can use these values without calculating them again. Product and recipe print have water and mash schedule added. Product print has brewday results added if the brewday is over. The ingredients layout changed in the product and recipe prints.
Michiel Broek <mbroek@mbse.eu>
parents: 338
diff changeset
420
544d7d0183b2 Added 15 fields to the recipes table. Added 18 fields to the products table. These are calculated values that are now stored in the database so export programs can use these values without calculating them again. Product and recipe print have water and mash schedule added. Product print has brewday results added if the brewday is over. The ingredients layout changed in the product and recipe prints.
Michiel Broek <mbroek@mbse.eu>
parents: 338
diff changeset
421 if ($item['step_type'] == 0)
544d7d0183b2 Added 15 fields to the recipes table. Added 18 fields to the products table. These are calculated values that are now stored in the database so export programs can use these values without calculating them again. Product and recipe print have water and mash schedule added. Product print has brewday results added if the brewday is over. The ingredients layout changed in the product and recipe prints.
Michiel Broek <mbroek@mbse.eu>
parents: 338
diff changeset
422 $vol += $item['step_infuse_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: 338
diff changeset
423 if ($mashkg > 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: 338
diff changeset
424 $thick = $vol / $mashkg;
544d7d0183b2 Added 15 fields to the recipes table. Added 18 fields to the products table. These are calculated values that are now stored in the database so export programs can use these values without calculating them again. Product and recipe print have water and mash schedule added. Product print has brewday results added if the brewday is over. The ingredients layout changed in the product and recipe prints.
Michiel Broek <mbroek@mbse.eu>
parents: 338
diff changeset
425 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: 338
diff changeset
426 $thick = 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: 338
diff changeset
427 $this->Cell($vul,5,$item['step_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: 338
diff changeset
428 $this->Cell(25,5,$mashtype[$item['step_type']],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: 338
diff changeset
429 $this->Cell(18,5,sprintf("%.1f",$item['step_temp']),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: 338
diff changeset
430 $this->Cell(18,5,sprintf("%.1f",$item['end_temp']),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: 338
diff changeset
431 $this->Cell(18,5,sprintf("%.0f",$item['step_time']),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: 338
diff changeset
432 $this->Cell(18,5,sprintf("%.0f",$item['ramp_time']),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: 338
diff changeset
433 $this->Cell(20,5,sprintf("%.2f",$thick),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: 338
diff changeset
434 $this->Cell(20,5,sprintf("%.1f",$item['step_infuse_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: 338
diff changeset
435 $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: 338
diff changeset
436 }
544d7d0183b2 Added 15 fields to the recipes table. Added 18 fields to the products table. These are calculated values that are now stored in the database so export programs can use these values without calculating them again. Product and recipe print have water and mash schedule added. Product print has brewday results added if the brewday is over. The ingredients layout changed in the product and recipe prints.
Michiel Broek <mbroek@mbse.eu>
parents: 338
diff changeset
437 $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: 338
diff changeset
438 $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: 338
diff changeset
439 $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: 338
diff changeset
440 $this->Ln();
83
85521c6e0022 Added recipe print yeasts section.
Michiel Broek <mbroek@mbse.eu>
parents: 80
diff changeset
441 }
84
3e5e87f1818d Added miscs ingredients to the recipe print.
Michiel Broek <mbroek@mbse.eu>
parents: 83
diff changeset
442
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: 338
diff changeset
443 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: 338
diff changeset
444
544d7d0183b2 Added 15 fields to the recipes table. Added 18 fields to the products table. These are calculated values that are now stored in the database so export programs can use these values without calculating them again. Product and recipe print have water and mash schedule added. Product print has brewday results added if the brewday is over. The ingredients layout changed in the product and recipe prints.
Michiel Broek <mbroek@mbse.eu>
parents: 338
diff changeset
445 $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: 338
diff changeset
446 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: 338
diff changeset
447 $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: 338
diff changeset
448 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: 338
diff changeset
449 $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: 338
diff changeset
450 $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: 338
diff changeset
451 $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: 338
diff changeset
452 $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: 338
diff changeset
453 $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: 338
diff changeset
454 $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: 338
diff changeset
455 $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: 338
diff changeset
456 $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: 338
diff changeset
457 $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: 338
diff changeset
458 $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: 338
diff changeset
459
544d7d0183b2 Added 15 fields to the recipes table. Added 18 fields to the products table. These are calculated values that are now stored in the database so export programs can use these values without calculating them again. Product and recipe print have water and mash schedule added. Product print has brewday results added if the brewday is over. The ingredients layout changed in the product and recipe prints.
Michiel Broek <mbroek@mbse.eu>
parents: 338
diff changeset
460 $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: 338
diff changeset
461 $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: 338
diff changeset
462 $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: 338
diff changeset
463 $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: 338
diff changeset
464 $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: 338
diff changeset
465
544d7d0183b2 Added 15 fields to the recipes table. Added 18 fields to the products table. These are calculated values that are now stored in the database so export programs can use these values without calculating them again. Product and recipe print have water and mash schedule added. Product print has brewday results added if the brewday is over. The ingredients layout changed in the product and recipe prints.
Michiel Broek <mbroek@mbse.eu>
parents: 338
diff changeset
466 $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: 338
diff changeset
467 $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: 338
diff changeset
468
544d7d0183b2 Added 15 fields to the recipes table. Added 18 fields to the products table. These are calculated values that are now stored in the database so export programs can use these values without calculating them again. Product and recipe print have water and mash schedule added. Product print has brewday results added if the brewday is over. The ingredients layout changed in the product and recipe prints.
Michiel Broek <mbroek@mbse.eu>
parents: 338
diff changeset
469 $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: 338
diff changeset
470 $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: 338
diff changeset
471 $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: 338
diff changeset
472 $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: 338
diff changeset
473 $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: 338
diff changeset
474 $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: 338
diff changeset
475 $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: 338
diff changeset
476 $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: 338
diff changeset
477 $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: 338
diff changeset
478 $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: 338
diff changeset
479 $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: 338
diff changeset
480 $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: 338
diff changeset
481 $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: 338
diff changeset
482 $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: 338
diff changeset
483 $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: 338
diff changeset
484 $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: 338
diff changeset
485 $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: 338
diff changeset
486 $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: 338
diff changeset
487 $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: 338
diff changeset
488 $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: 338
diff changeset
489 $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: 338
diff changeset
490 $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: 338
diff changeset
491 $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: 338
diff changeset
492 $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: 338
diff changeset
493 $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: 338
diff changeset
494 $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: 338
diff changeset
495 $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: 338
diff changeset
496 $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: 338
diff changeset
497 $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: 338
diff changeset
498 $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: 338
diff changeset
499 $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: 338
diff changeset
500 $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: 338
diff changeset
501 $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: 338
diff changeset
502 $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: 338
diff changeset
503 $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: 338
diff changeset
504 $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: 338
diff changeset
505 $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: 338
diff changeset
506 $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: 338
diff changeset
507 $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: 338
diff changeset
508 $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: 338
diff changeset
509 $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: 338
diff changeset
510 $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: 338
diff changeset
511 $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: 338
diff changeset
512 }
87
7f1d0abe5571 OG and FG are now calculated from the grist. The printed report has a summary an notes section at the end. The formulas are in the global formulas script.
Michiel Broek <mbroek@mbse.eu>
parents: 86
diff changeset
513
7f1d0abe5571 OG and FG are now calculated from the grist. The printed report has a summary an notes section at the end. The formulas are in the global formulas script.
Michiel Broek <mbroek@mbse.eu>
parents: 86
diff changeset
514 function TableSummary($row) {
7f1d0abe5571 OG and FG are now calculated from the grist. The printed report has a summary an notes section at the end. The formulas are in the global formulas script.
Michiel Broek <mbroek@mbse.eu>
parents: 86
diff changeset
515 global $pSugar;
7f1d0abe5571 OG and FG are now calculated from the grist. The printed report has a summary an notes section at the end. The formulas are in the global formulas script.
Michiel Broek <mbroek@mbse.eu>
parents: 86
diff changeset
516 global $pCara;
7f1d0abe5571 OG and FG are now calculated from the grist. The printed report has a summary an notes section at the end. The formulas are in the global formulas script.
Michiel Broek <mbroek@mbse.eu>
parents: 86
diff changeset
517 global $svg;
89
082c23b26055 Missing Water agent costs from Brouwhulp import are now added from the imported miscs database. The printed recipe report now calculates the beer color from the ingredients. Also set during recipes import. This will later allow to set the color method for each recipe individually.
Michiel Broek <mbroek@mbse.eu>
parents: 88
diff changeset
518 global $colorw;
93
357d59d8ec5e Added IBU and cost totals.
Michiel Broek <mbroek@mbse.eu>
parents: 90
diff changeset
519 global $cost_fermentables;
357d59d8ec5e Added IBU and cost totals.
Michiel Broek <mbroek@mbse.eu>
parents: 90
diff changeset
520 global $cost_hops;
357d59d8ec5e Added IBU and cost totals.
Michiel Broek <mbroek@mbse.eu>
parents: 90
diff changeset
521 global $cost_miscs;
357d59d8ec5e Added IBU and cost totals.
Michiel Broek <mbroek@mbse.eu>
parents: 90
diff changeset
522 global $cost_yeasts;
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: 449
diff changeset
523 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: 449
diff changeset
524 global $ibumethod;
87
7f1d0abe5571 OG and FG are now calculated from the grist. The printed report has a summary an notes section at the end. The formulas are in the global formulas script.
Michiel Broek <mbroek@mbse.eu>
parents: 86
diff changeset
525 /* 2 Columns */
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: 338
diff changeset
526 if ($this->GetY() > 200)
544d7d0183b2 Added 15 fields to the recipes table. Added 18 fields to the products table. These are calculated values that are now stored in the database so export programs can use these values without calculating them again. Product and recipe print have water and mash schedule added. Product print has brewday results added if the brewday is over. The ingredients layout changed in the product and recipe prints.
Michiel Broek <mbroek@mbse.eu>
parents: 338
diff changeset
527 $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: 338
diff changeset
528 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: 338
diff changeset
529 $this->Ln();
87
7f1d0abe5571 OG and FG are now calculated from the grist. The printed report has a summary an notes section at the end. The formulas are in the global formulas script.
Michiel Broek <mbroek@mbse.eu>
parents: 86
diff changeset
530 $vul = $this->w - $this->rMargin - $this->lMargin - 170;
7f1d0abe5571 OG and FG are now calculated from the grist. The printed report has a summary an notes section at the end. The formulas are in the global formulas script.
Michiel Broek <mbroek@mbse.eu>
parents: 86
diff changeset
531 $cMargin=$this->cMargin;
7f1d0abe5571 OG and FG are now calculated from the grist. The printed report has a summary an notes section at the end. The formulas are in the global formulas script.
Michiel Broek <mbroek@mbse.eu>
parents: 86
diff changeset
532 $this->cMargin=2;
7f1d0abe5571 OG and FG are now calculated from the grist. The printed report has a summary an notes section at the end. The formulas are in the global formulas script.
Michiel Broek <mbroek@mbse.eu>
parents: 86
diff changeset
533 $this->TableX=$this->lMargin;
7f1d0abe5571 OG and FG are now calculated from the grist. The printed report has a summary an notes section at the end. The formulas are in the global formulas script.
Michiel Broek <mbroek@mbse.eu>
parents: 86
diff changeset
534 $this->SetFont('Helvetica','B',9);
7f1d0abe5571 OG and FG are now calculated from the grist. The printed report has a summary an notes section at the end. The formulas are in the global formulas script.
Michiel Broek <mbroek@mbse.eu>
parents: 86
diff changeset
535 $this->SetX($this->TableX);
7f1d0abe5571 OG and FG are now calculated from the grist. The printed report has a summary an notes section at the end. The formulas are in the global formulas script.
Michiel Broek <mbroek@mbse.eu>
parents: 86
diff changeset
536 $this->SetFillColor(255,150,100);
7f1d0abe5571 OG and FG are now calculated from the grist. The printed report has a summary an notes section at the end. The formulas are in the global formulas script.
Michiel Broek <mbroek@mbse.eu>
parents: 86
diff changeset
537 $this->Cell(0, 5, 'Recept samenvatting',0,0,'C',true);
7f1d0abe5571 OG and FG are now calculated from the grist. The printed report has a summary an notes section at the end. The formulas are in the global formulas script.
Michiel Broek <mbroek@mbse.eu>
parents: 86
diff changeset
538 $this->Ln();
7f1d0abe5571 OG and FG are now calculated from the grist. The printed report has a summary an notes section at the end. The formulas are in the global formulas script.
Michiel Broek <mbroek@mbse.eu>
parents: 86
diff changeset
539
7f1d0abe5571 OG and FG are now calculated from the grist. The printed report has a summary an notes section at the end. The formulas are in the global formulas script.
Michiel Broek <mbroek@mbse.eu>
parents: 86
diff changeset
540 $this->SetFont('Helvetica','',9);
7f1d0abe5571 OG and FG are now calculated from the grist. The printed report has a summary an notes section at the end. The formulas are in the global formulas script.
Michiel Broek <mbroek@mbse.eu>
parents: 86
diff changeset
541 $this->SetFillColor(210,245,255);
7f1d0abe5571 OG and FG are now calculated from the grist. The printed report has a summary an notes section at the end. The formulas are in the global formulas script.
Michiel Broek <mbroek@mbse.eu>
parents: 86
diff changeset
542
7f1d0abe5571 OG and FG are now calculated from the grist. The printed report has a summary an notes section at the end. The formulas are in the global formulas script.
Michiel Broek <mbroek@mbse.eu>
parents: 86
diff changeset
543 $row['est_fg'] = estimate_fg($pSugar, $pCara, 0, 0, 0, $svg, $row['est_og']);
7f1d0abe5571 OG and FG are now calculated from the grist. The printed report has a summary an notes section at the end. The formulas are in the global formulas script.
Michiel Broek <mbroek@mbse.eu>
parents: 86
diff changeset
544
7f1d0abe5571 OG and FG are now calculated from the grist. The printed report has a summary an notes section at the end. The formulas are in the global formulas script.
Michiel Broek <mbroek@mbse.eu>
parents: 86
diff changeset
545 $this->SetX($this->TableX);
7f1d0abe5571 OG and FG are now calculated from the grist. The printed report has a summary an notes section at the end. The formulas are in the global formulas script.
Michiel Broek <mbroek@mbse.eu>
parents: 86
diff changeset
546 $this->Cell(35,5,'Start SG',0,0,'L',true);
7f1d0abe5571 OG and FG are now calculated from the grist. The printed report has a summary an notes section at the end. The formulas are in the global formulas script.
Michiel Broek <mbroek@mbse.eu>
parents: 86
diff changeset
547 $this->Cell(25,5,sprintf("%.3f",$row['est_og']),0,0,'L',true);
7f1d0abe5571 OG and FG are now calculated from the grist. The printed report has a summary an notes section at the end. The formulas are in the global formulas script.
Michiel Broek <mbroek@mbse.eu>
parents: 86
diff changeset
548 $this->Cell(25,5,'('.sprintf("%.3f",$row['st_og_min']).' - '.sprintf("%.3f",$row['st_og_max']).')',0,0,'L',true);
7f1d0abe5571 OG and FG are now calculated from the grist. The printed report has a summary an notes section at the end. The formulas are in the global formulas script.
Michiel Broek <mbroek@mbse.eu>
parents: 86
diff changeset
549 $this->Cell($vul,5,'',0,0,'L',false);
7f1d0abe5571 OG and FG are now calculated from the grist. The printed report has a summary an notes section at the end. The formulas are in the global formulas script.
Michiel Broek <mbroek@mbse.eu>
parents: 86
diff changeset
550 $this->Cell(35,5,'Eind SG',0,0,'L',true);
7f1d0abe5571 OG and FG are now calculated from the grist. The printed report has a summary an notes section at the end. The formulas are in the global formulas script.
Michiel Broek <mbroek@mbse.eu>
parents: 86
diff changeset
551 $this->Cell(25,5,sprintf("%.3f",$row['est_fg']),0,0,'L',true);
7f1d0abe5571 OG and FG are now calculated from the grist. The printed report has a summary an notes section at the end. The formulas are in the global formulas script.
Michiel Broek <mbroek@mbse.eu>
parents: 86
diff changeset
552 $this->Cell(25,5,'('.sprintf("%.3f",$row['st_fg_min']).' - '.sprintf("%.3f",$row['st_fg_max']).')',0,0,'L',true);
7f1d0abe5571 OG and FG are now calculated from the grist. The printed report has a summary an notes section at the end. The formulas are in the global formulas script.
Michiel Broek <mbroek@mbse.eu>
parents: 86
diff changeset
553 $this->Ln();
7f1d0abe5571 OG and FG are now calculated from the grist. The printed report has a summary an notes section at the end. The formulas are in the global formulas script.
Michiel Broek <mbroek@mbse.eu>
parents: 86
diff changeset
554
88
0a39cbdcf085 Added ABV clculation.
Michiel Broek <mbroek@mbse.eu>
parents: 87
diff changeset
555 $row['est_abv'] = abvol($row['est_og'], $row['est_fg']);
87
7f1d0abe5571 OG and FG are now calculated from the grist. The printed report has a summary an notes section at the end. The formulas are in the global formulas script.
Michiel Broek <mbroek@mbse.eu>
parents: 86
diff changeset
556 $this->SetX($this->TableX);
7f1d0abe5571 OG and FG are now calculated from the grist. The printed report has a summary an notes section at the end. The formulas are in the global formulas script.
Michiel Broek <mbroek@mbse.eu>
parents: 86
diff changeset
557 $this->Cell(35,5,'Geschat alcohol',0,0,'L',true);
7f1d0abe5571 OG and FG are now calculated from the grist. The printed report has a summary an notes section at the end. The formulas are in the global formulas script.
Michiel Broek <mbroek@mbse.eu>
parents: 86
diff changeset
558 $this->Cell(25,5,sprintf("%.1f",$row['est_abv']).'%',0,0,'L',true);
7f1d0abe5571 OG and FG are now calculated from the grist. The printed report has a summary an notes section at the end. The formulas are in the global formulas script.
Michiel Broek <mbroek@mbse.eu>
parents: 86
diff changeset
559 $this->Cell(25,5,'('.sprintf("%.1f",$row['st_abv_min']).' - '.sprintf("%.1f",$row['st_abv_max']).'%)',0,0,'L',true);
7f1d0abe5571 OG and FG are now calculated from the grist. The printed report has a summary an notes section at the end. The formulas are in the global formulas script.
Michiel Broek <mbroek@mbse.eu>
parents: 86
diff changeset
560 $this->Cell($vul,5,'',0,0,'L',false);
7f1d0abe5571 OG and FG are now calculated from the grist. The printed report has a summary an notes section at the end. The formulas are in the global formulas script.
Michiel Broek <mbroek@mbse.eu>
parents: 86
diff changeset
561 $this->Cell(35,5,'CO2',0,0,'L',true);
7f1d0abe5571 OG and FG are now calculated from the grist. The printed report has a summary an notes section at the end. The formulas are in the global formulas script.
Michiel Broek <mbroek@mbse.eu>
parents: 86
diff changeset
562 $this->Cell(25,5,sprintf("%.1f",$row['est_carb']).'%',0,0,'L',true);
7f1d0abe5571 OG and FG are now calculated from the grist. The printed report has a summary an notes section at the end. The formulas are in the global formulas script.
Michiel Broek <mbroek@mbse.eu>
parents: 86
diff changeset
563 $this->Cell(25,5,'('.sprintf("%.1f",$row['st_carb_min']).' - '.sprintf("%.1f",$row['st_carb_max']).'%)',0,0,'L',true);
7f1d0abe5571 OG and FG are now calculated from the grist. The printed report has a summary an notes section at the end. The formulas are in the global formulas script.
Michiel Broek <mbroek@mbse.eu>
parents: 86
diff changeset
564 $this->Ln();
7f1d0abe5571 OG and FG are now calculated from the grist. The printed report has a summary an notes section at the end. The formulas are in the global formulas script.
Michiel Broek <mbroek@mbse.eu>
parents: 86
diff changeset
565
89
082c23b26055 Missing Water agent costs from Brouwhulp import are now added from the imported miscs database. The printed recipe report now calculates the beer color from the ingredients. Also set during recipes import. This will later allow to set the color method for each recipe individually.
Michiel Broek <mbroek@mbse.eu>
parents: 88
diff changeset
566 $row['est_color'] = kw_to_ebc($row['color_method'], $colorw);
87
7f1d0abe5571 OG and FG are now calculated from the grist. The printed report has a summary an notes section at the end. The formulas are in the global formulas script.
Michiel Broek <mbroek@mbse.eu>
parents: 86
diff changeset
567 $this->SetX($this->TableX);
338
a51b858aacca Fixed color and IBU method display in recipe and product print pages.
Michiel Broek <mbroek@mbse.eu>
parents: 289
diff changeset
568 $this->Cell(35,5,'Kleur ('.$colormethod[$row['color_method']].')',0,0,'L',true);
87
7f1d0abe5571 OG and FG are now calculated from the grist. The printed report has a summary an notes section at the end. The formulas are in the global formulas script.
Michiel Broek <mbroek@mbse.eu>
parents: 86
diff changeset
569 $beercolor = ebc_to_color($row['est_color']);
89
082c23b26055 Missing Water agent costs from Brouwhulp import are now added from the imported miscs database. The printed recipe report now calculates the beer color from the ingredients. Also set during recipes import. This will later allow to set the color method for each recipe individually.
Michiel Broek <mbroek@mbse.eu>
parents: 88
diff changeset
570 if ($row['est_color'] > 30)
082c23b26055 Missing Water agent costs from Brouwhulp import are now added from the imported miscs database. The printed recipe report now calculates the beer color from the ingredients. Also set during recipes import. This will later allow to set the color method for each recipe individually.
Michiel Broek <mbroek@mbse.eu>
parents: 88
diff changeset
571 $this->SetTextColor(250);
87
7f1d0abe5571 OG and FG are now calculated from the grist. The printed report has a summary an notes section at the end. The formulas are in the global formulas script.
Michiel Broek <mbroek@mbse.eu>
parents: 86
diff changeset
572 $this->SetFillColor($beercolor[0],$beercolor[1],$beercolor[2]);
7f1d0abe5571 OG and FG are now calculated from the grist. The printed report has a summary an notes section at the end. The formulas are in the global formulas script.
Michiel Broek <mbroek@mbse.eu>
parents: 86
diff changeset
573 $this->Cell(25,5,$row['est_color'].' EBC',0,0,'L',true);
7f1d0abe5571 OG and FG are now calculated from the grist. The printed report has a summary an notes section at the end. The formulas are in the global formulas script.
Michiel Broek <mbroek@mbse.eu>
parents: 86
diff changeset
574 $this->Cell(25,5,'('.$row['st_color_min'].' - '.$row['st_color_max'].' EBC)',0,0,'L',true);
89
082c23b26055 Missing Water agent costs from Brouwhulp import are now added from the imported miscs database. The printed recipe report now calculates the beer color from the ingredients. Also set during recipes import. This will later allow to set the color method for each recipe individually.
Michiel Broek <mbroek@mbse.eu>
parents: 88
diff changeset
575 $this->SetTextColor(0);
87
7f1d0abe5571 OG and FG are now calculated from the grist. The printed report has a summary an notes section at the end. The formulas are in the global formulas script.
Michiel Broek <mbroek@mbse.eu>
parents: 86
diff changeset
576 $this->SetFillColor(210,245,255);
7f1d0abe5571 OG and FG are now calculated from the grist. The printed report has a summary an notes section at the end. The formulas are in the global formulas script.
Michiel Broek <mbroek@mbse.eu>
parents: 86
diff changeset
577 $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: 289
diff changeset
578 $this->Cell(35,5,'Bitterheid ('.$ibumethod[$row['ibu_method']].')',0,0,'L',true);
87
7f1d0abe5571 OG and FG are now calculated from the grist. The printed report has a summary an notes section at the end. The formulas are in the global formulas script.
Michiel Broek <mbroek@mbse.eu>
parents: 86
diff changeset
579 $this->Cell(25,5,sprintf("%.0f",$row['est_ibu']).' IBU',0,0,'L',true);
7f1d0abe5571 OG and FG are now calculated from the grist. The printed report has a summary an notes section at the end. The formulas are in the global formulas script.
Michiel Broek <mbroek@mbse.eu>
parents: 86
diff changeset
580 $this->Cell(25,5,'('.$row['st_ibu_min'].' - '.$row['st_ibu_max'].' IBU)',0,0,'L',true);
93
357d59d8ec5e Added IBU and cost totals.
Michiel Broek <mbroek@mbse.eu>
parents: 90
diff changeset
581 $this->Ln();
357d59d8ec5e Added IBU and cost totals.
Michiel Broek <mbroek@mbse.eu>
parents: 90
diff changeset
582
357d59d8ec5e Added IBU and cost totals.
Michiel Broek <mbroek@mbse.eu>
parents: 90
diff changeset
583 $this->SetX($this->TableX);
357d59d8ec5e Added IBU and cost totals.
Michiel Broek <mbroek@mbse.eu>
parents: 90
diff changeset
584 $cost_total = $cost_fermentables + $cost_hops + $cost_miscs + $cost_yeasts;
357d59d8ec5e Added IBU and cost totals.
Michiel Broek <mbroek@mbse.eu>
parents: 90
diff changeset
585 $this->Cell(35,5,'Kosten',0,0,'L',true);
357d59d8ec5e Added IBU and cost totals.
Michiel Broek <mbroek@mbse.eu>
parents: 90
diff changeset
586 $this->Cell(25,5,sprintf("%.2f",$cost_total).EURO,0,0,'L',true);
357d59d8ec5e Added IBU and cost totals.
Michiel Broek <mbroek@mbse.eu>
parents: 90
diff changeset
587 $this->Cell(25,5,sprintf("%.2f",$cost_total/$row['batch_size']).EURO.' / liter',0,0,'L',true);
357d59d8ec5e Added IBU and cost totals.
Michiel Broek <mbroek@mbse.eu>
parents: 90
diff changeset
588
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: 338
diff changeset
589 // calorieen
544d7d0183b2 Added 15 fields to the recipes table. Added 18 fields to the products table. These are calculated values that are now stored in the database so export programs can use these values without calculating them again. Product and recipe print have water and mash schedule added. Product print has brewday results added if the brewday is over. The ingredients layout changed in the product and recipe prints.
Michiel Broek <mbroek@mbse.eu>
parents: 338
diff changeset
590 $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: 338
diff changeset
591 $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: 338
diff changeset
592 $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: 338
diff changeset
593 $this->Ln();
87
7f1d0abe5571 OG and FG are now calculated from the grist. The printed report has a summary an notes section at the end. The formulas are in the global formulas script.
Michiel Broek <mbroek@mbse.eu>
parents: 86
diff changeset
594 }
80
75b9227fb98c Added beginning of recipe print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
595 }
75b9227fb98c Added beginning of recipe print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
596
75b9227fb98c Added beginning of recipe print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
597
75b9227fb98c Added beginning of recipe print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
598
75b9227fb98c Added beginning of recipe print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
599 class PDF extends PDF_MySQL_Table {
75b9227fb98c Added beginning of recipe print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
600 function Header() {
75b9227fb98c Added beginning of recipe print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
601 global $row;
233
14a84d42031d In recipe report added the date and beer style to the page header.
Michiel Broek <mbroek@mbse.eu>
parents: 232
diff changeset
602 global $prdate;
80
75b9227fb98c Added beginning of recipe print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
603 $this->Image('images/logo.png',10,6,30);
75b9227fb98c Added beginning of recipe print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
604 // Title
75b9227fb98c Added beginning of recipe print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
605 $this->SetFont('Helvetica','B',18);
75b9227fb98c Added beginning of recipe print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
606 $this->SetX(45);
233
14a84d42031d In recipe report added the date and beer style to the page header.
Michiel Broek <mbroek@mbse.eu>
parents: 232
diff changeset
607 $this->Cell(0,8,$row['name'],0,1,'L');
14a84d42031d In recipe report added the date and beer style to the page header.
Michiel Broek <mbroek@mbse.eu>
parents: 232
diff changeset
608 $this->Ln(1);
14a84d42031d In recipe report added the date and beer style to the page header.
Michiel Broek <mbroek@mbse.eu>
parents: 232
diff changeset
609 $this->SetFont('Helvetica','',10);
14a84d42031d In recipe report added the date and beer style to the page header.
Michiel Broek <mbroek@mbse.eu>
parents: 232
diff changeset
610 $this->SetX(45);
14a84d42031d In recipe report added the date and beer style to the page header.
Michiel Broek <mbroek@mbse.eu>
parents: 232
diff changeset
611 $this->Cell(17,5,'Datum:',0,0,'L');
14a84d42031d In recipe report added the date and beer style to the page header.
Michiel Broek <mbroek@mbse.eu>
parents: 232
diff changeset
612 $this->Cell(0,5,$prdate,0,1,'L');
14a84d42031d In recipe report added the date and beer style to the page header.
Michiel Broek <mbroek@mbse.eu>
parents: 232
diff changeset
613 $this->SetX(45);
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: 233
diff changeset
614 $this->Cell(17,5,'Stijl:',0,0,'L');
589
b6a73022abe7 Fix encoding of the beerstyle name.
Michiel Broek <mbroek@mbse.eu>
parents: 539
diff changeset
615 $st_name = iconv('UTF-8','windows-1252',$row['st_name']);
b6a73022abe7 Fix encoding of the beerstyle name.
Michiel Broek <mbroek@mbse.eu>
parents: 539
diff changeset
616 $this->Cell(0,5,$st_name,0,1,'L');
233
14a84d42031d In recipe report added the date and beer style to the page header.
Michiel Broek <mbroek@mbse.eu>
parents: 232
diff changeset
617 $this->Ln(7);
80
75b9227fb98c Added beginning of recipe print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
618 // Ensure table header is printed
75b9227fb98c Added beginning of recipe print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
619 parent::Header();
75b9227fb98c Added beginning of recipe print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
620 }
75b9227fb98c Added beginning of recipe print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
621 }
75b9227fb98c Added beginning of recipe print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
622
75b9227fb98c Added beginning of recipe print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
623
75b9227fb98c Added beginning of recipe print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
624 /*
75b9227fb98c Added beginning of recipe print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
625 * Generate PDF from recipe data
75b9227fb98c Added beginning of recipe print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
626 */
75b9227fb98c Added beginning of recipe print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
627 $pdf = new PDF();
75b9227fb98c Added beginning of recipe print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
628 $pdf->AddPage();
83
85521c6e0022 Added recipe print yeasts section.
Michiel Broek <mbroek@mbse.eu>
parents: 80
diff changeset
629 $pdf->TableGlobal($row);
85521c6e0022 Added recipe print yeasts section.
Michiel Broek <mbroek@mbse.eu>
parents: 80
diff changeset
630 $pdf->TableFermentables($row);
85521c6e0022 Added recipe print yeasts section.
Michiel Broek <mbroek@mbse.eu>
parents: 80
diff changeset
631 $pdf->TableHops($row);
85521c6e0022 Added recipe print yeasts section.
Michiel Broek <mbroek@mbse.eu>
parents: 80
diff changeset
632 $pdf->TableYeasts($row);
85521c6e0022 Added recipe print yeasts section.
Michiel Broek <mbroek@mbse.eu>
parents: 80
diff changeset
633 $pdf->TableMiscs($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: 338
diff changeset
634 $pdf->TableMashs($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: 338
diff changeset
635 $pdf->TableWaters($row);
87
7f1d0abe5571 OG and FG are now calculated from the grist. The printed report has a summary an notes section at the end. The formulas are in the global formulas script.
Michiel Broek <mbroek@mbse.eu>
parents: 86
diff changeset
636 $pdf->TableSummary($row);
7f1d0abe5571 OG and FG are now calculated from the grist. The printed report has a summary an notes section at the end. The formulas are in the global formulas script.
Michiel Broek <mbroek@mbse.eu>
parents: 86
diff changeset
637 if (strlen($row['notes'])) {
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: 338
diff changeset
638 if ($pdf->GetY() > 200)
544d7d0183b2 Added 15 fields to the recipes table. Added 18 fields to the products table. These are calculated values that are now stored in the database so export programs can use these values without calculating them again. Product and recipe print have water and mash schedule added. Product print has brewday results added if the brewday is over. The ingredients layout changed in the product and recipe prints.
Michiel Broek <mbroek@mbse.eu>
parents: 338
diff changeset
639 $pdf->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: 338
diff changeset
640 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: 338
diff changeset
641 $pdf->Ln(10);
87
7f1d0abe5571 OG and FG are now calculated from the grist. The printed report has a summary an notes section at the end. The formulas are in the global formulas script.
Michiel Broek <mbroek@mbse.eu>
parents: 86
diff changeset
642 $pdf->SetFillColor(255,150,100);
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: 338
diff changeset
643 $pdf->SetFont('Helvetica','B',9);
87
7f1d0abe5571 OG and FG are now calculated from the grist. The printed report has a summary an notes section at the end. The formulas are in the global formulas script.
Michiel Broek <mbroek@mbse.eu>
parents: 86
diff changeset
644 $pdf->Cell(0, 5, 'Recept opmerkingen',0,0,'C',true);
7f1d0abe5571 OG and FG are now calculated from the grist. The printed report has a summary an notes section at the end. The formulas are in the global formulas script.
Michiel Broek <mbroek@mbse.eu>
parents: 86
diff changeset
645 $pdf->Ln();
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: 338
diff changeset
646 $pdf->SetFont('Helvetica','',9);
87
7f1d0abe5571 OG and FG are now calculated from the grist. The printed report has a summary an notes section at the end. The formulas are in the global formulas script.
Michiel Broek <mbroek@mbse.eu>
parents: 86
diff changeset
647 $pdf->SetFillColor(210,245,255);
7f1d0abe5571 OG and FG are now calculated from the grist. The printed report has a summary an notes section at the end. The formulas are in the global formulas script.
Michiel Broek <mbroek@mbse.eu>
parents: 86
diff changeset
648 $pdf->MultiCell(0,4,$row['notes'],0,'L',true);
7f1d0abe5571 OG and FG are now calculated from the grist. The printed report has a summary an notes section at the end. The formulas are in the global formulas script.
Michiel Broek <mbroek@mbse.eu>
parents: 86
diff changeset
649 }
7f1d0abe5571 OG and FG are now calculated from the grist. The printed report has a summary an notes section at the end. The formulas are in the global formulas script.
Michiel Broek <mbroek@mbse.eu>
parents: 86
diff changeset
650 // Disclaimer toevoegen dat dit alleen recept ontwikkeling is. Uitkomsten zoals IBU zijn een berekende schatting.
7f1d0abe5571 OG and FG are now calculated from the grist. The printed report has a summary an notes section at the end. The formulas are in the global formulas script.
Michiel Broek <mbroek@mbse.eu>
parents: 86
diff changeset
651 // Footer sectie met berekende/geschatte uitkomsten zoals ABV, kostprijs per liter enz.
80
75b9227fb98c Added beginning of recipe print.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
652 $pdf->Output();

mercurial