www/rec_print.php

changeset 89
082c23b26055
parent 88
0a39cbdcf085
child 90
d4246abee34e
equal deleted inserted replaced
88:0a39cbdcf085 89:082c23b26055
25 $cost_yeasts = 0.0; 25 $cost_yeasts = 0.0;
26 $cost_miscs = 0.0; 26 $cost_miscs = 0.0;
27 $pSugar = 0; 27 $pSugar = 0;
28 $pCara = 0; 28 $pCara = 0;
29 $svg = 77; 29 $svg = 77;
30 $colorw = 0;
30 31
31 32
32 class PDF_MySQL_Table extends FPDF 33 class PDF_MySQL_Table extends FPDF
33 { 34 {
34 protected $ProcessingTable=false; 35 protected $ProcessingTable=false;
54 $this->aCols[]=array('c'=>$caption,'w'=>$width,'a'=>$align); 55 $this->aCols[]=array('c'=>$caption,'w'=>$width,'a'=>$align);
55 } 56 }
56 57
57 function TableGlobal($row) { 58 function TableGlobal($row) {
58 /* 2 Columns */ 59 /* 2 Columns */
59 $vul = $this->w - $this->rMargin - $this->lMargin - 170; 60 $vul = $this->w - $this->rMargin - $this->lMargin - 120;
60 $cMargin=$this->cMargin; 61 $cMargin=$this->cMargin;
61 $this->cMargin=2; 62 $this->cMargin=2;
62 $this->TableX=$this->lMargin; 63 $this->TableX=$this->lMargin;
63 $this->SetFont('Helvetica','B',9); 64 $this->SetFont('Helvetica','B',9);
64 $this->SetX($this->TableX); 65 $this->SetX($this->TableX);
70 $this->SetFillColor(210,245,255); 71 $this->SetFillColor(210,245,255);
71 72
72 $this->SetX($this->TableX); 73 $this->SetX($this->TableX);
73 $this->Cell(35,5,'Type',0,0,'L',true); 74 $this->Cell(35,5,'Type',0,0,'L',true);
74 $this->Cell(25,5,$row['type'],0,0,'L',true); 75 $this->Cell(25,5,$row['type'],0,0,'L',true);
75 $this->Cell(25,5,'',0,0,'L',true);
76 $this->Cell($vul,5,'',0,0,'L',false); 76 $this->Cell($vul,5,'',0,0,'L',false);
77 $this->Cell(35,5,'Batch grootte',0,0,'L',true); 77 $this->Cell(35,5,'Batch grootte',0,0,'L',true);
78 $this->Cell(25,5,$row['batch_size'].' liter',0,0,'L',true); 78 $this->Cell(25,5,$row['batch_size'].' liter',0,0,'L',true);
79 $this->Cell(25,5,'',0,0,'L',true);
80 $this->Ln(); 79 $this->Ln();
81 80
82 $this->SetX($this->TableX); 81 $this->SetX($this->TableX);
83 $this->Cell(35,5,'Kooktijd',0,0,'L',true); 82 $this->Cell(35,5,'Kooktijd',0,0,'L',true);
84 $this->Cell(25,5,$row['boil_time'].' minuten',0,0,'L',true); 83 $this->Cell(25,5,$row['boil_time'].' minuten',0,0,'L',true);
85 $this->Cell(25,5,'',0,0,'L',true);
86 $this->Cell($vul,5,'',0,0,'L',false); 84 $this->Cell($vul,5,'',0,0,'L',false);
87 $this->Cell(35,5,'Brouwzaal rendement',0,0,'L',true); 85 $this->Cell(35,5,'Brouwzaal rendement',0,0,'L',true);
88 $this->Cell(25,5,$row['efficiency'].' %',0,0,'L',true); 86 $this->Cell(25,5,$row['efficiency'].' %',0,0,'L',true);
89 $this->Cell(25,5,'',0,0,'L',true);
90 $this->Ln(10); 87 $this->Ln(10);
91 88
92 $this->cMargin=$cMargin; 89 $this->cMargin=$cMargin;
93 } 90 }
94 91
95 function TableFermentables($row) { 92 function TableFermentables($row) {
96 global $cost_fermentables; 93 global $cost_fermentables;
97 global $total_fermentables; 94 global $total_fermentables;
98 global $pSugar; 95 global $pSugar;
99 global $pCara; 96 global $pCara;
97 global $colorw;
100 $vul = $this->w - $this->rMargin - $this->lMargin - 132; 98 $vul = $this->w - $this->rMargin - $this->lMargin - 132;
101 $this->AddCol($vul,'Grondstof','L'); 99 $this->AddCol($vul,'Grondstof','L');
102 $this->AddCol(30,'Leverancier','L'); 100 $this->AddCol(30,'Leverancier','L');
103 $this->AddCol(15,'EBC','R'); 101 $this->AddCol(15,'EBC','R');
104 $this->AddCol(17,'Moment','L'); 102 $this->AddCol(17,'Moment','L');
141 /* Calculate the amount of sugars */ 139 /* Calculate the amount of sugars */
142 $d = $amount * ($yield / 100) * (1 - $moisture / 100); 140 $d = $amount * ($yield / 100) * (1 - $moisture / 100);
143 if ($added == "Mash") 141 if ($added == "Mash")
144 $d = floatval($row['efficiency']) / 100 * $d; 142 $d = floatval($row['efficiency']) / 100 * $d;
145 $sugf += $d; 143 $sugf += $d;
144 $colorw += ($amount * ebc_to_srm($color) / $row['batch_size']) * 8.34436;
146 145
147 $this->Cell($vul,5,$name,0,0,'L',true); 146 $this->Cell($vul,5,$name,0,0,'L',true);
148 $this->Cell(30,5,$supplier,0,0,'L',true); 147 $this->Cell(30,5,$supplier,0,0,'L',true);
149 $this->Cell(15,5,sprintf("%.0f",$color),0,0,'R',true); 148 $this->Cell(15,5,sprintf("%.0f",$color),0,0,'R',true);
150 $this->Cell(17,5,added_type_names($added),0,0,'L',true); 149 $this->Cell(17,5,added_type_names($added),0,0,'L',true);
380 379
381 function TableSummary($row) { 380 function TableSummary($row) {
382 global $pSugar; 381 global $pSugar;
383 global $pCara; 382 global $pCara;
384 global $svg; 383 global $svg;
384 global $colorw;
385 /* 2 Columns */ 385 /* 2 Columns */
386 $vul = $this->w - $this->rMargin - $this->lMargin - 170; 386 $vul = $this->w - $this->rMargin - $this->lMargin - 170;
387 $cMargin=$this->cMargin; 387 $cMargin=$this->cMargin;
388 $this->cMargin=2; 388 $this->cMargin=2;
389 $this->TableX=$this->lMargin; 389 $this->TableX=$this->lMargin;
417 $this->Cell(35,5,'CO2',0,0,'L',true); 417 $this->Cell(35,5,'CO2',0,0,'L',true);
418 $this->Cell(25,5,sprintf("%.1f",$row['est_carb']).'%',0,0,'L',true); 418 $this->Cell(25,5,sprintf("%.1f",$row['est_carb']).'%',0,0,'L',true);
419 $this->Cell(25,5,'('.sprintf("%.1f",$row['st_carb_min']).' - '.sprintf("%.1f",$row['st_carb_max']).'%)',0,0,'L',true); 419 $this->Cell(25,5,'('.sprintf("%.1f",$row['st_carb_min']).' - '.sprintf("%.1f",$row['st_carb_max']).'%)',0,0,'L',true);
420 $this->Ln(); 420 $this->Ln();
421 421
422 $row['est_color'] = kw_to_ebc($row['color_method'], $colorw);
422 $this->SetX($this->TableX); 423 $this->SetX($this->TableX);
423 $this->Cell(35,5,'Kleur ('.$row['color_method'].')',0,0,'L',true); 424 $this->Cell(35,5,'Kleur ('.$row['color_method'].')',0,0,'L',true);
424 $beercolor = ebc_to_color($row['est_color']); 425 $beercolor = ebc_to_color($row['est_color']);
426 if ($row['est_color'] > 30)
427 $this->SetTextColor(250);
425 $this->SetFillColor($beercolor[0],$beercolor[1],$beercolor[2]); 428 $this->SetFillColor($beercolor[0],$beercolor[1],$beercolor[2]);
426 $this->Cell(25,5,$row['est_color'].' EBC',0,0,'L',true); 429 $this->Cell(25,5,$row['est_color'].' EBC',0,0,'L',true);
427 $this->Cell(25,5,'('.$row['st_color_min'].' - '.$row['st_color_max'].' EBC)',0,0,'L',true); 430 $this->Cell(25,5,'('.$row['st_color_min'].' - '.$row['st_color_max'].' EBC)',0,0,'L',true);
431 $this->SetTextColor(0);
428 $this->SetFillColor(210,245,255); 432 $this->SetFillColor(210,245,255);
429 $this->Cell($vul,5,'',0,0,'L',false); 433 $this->Cell($vul,5,'',0,0,'L',false);
430 $this->Cell(35,5,'Bitterheid ('.$row['ibu_method'].')',0,0,'L',true); 434 $this->Cell(35,5,'Bitterheid ('.$row['ibu_method'].')',0,0,'L',true);
431 $this->Cell(25,5,sprintf("%.0f",$row['est_ibu']).' IBU',0,0,'L',true); 435 $this->Cell(25,5,sprintf("%.0f",$row['est_ibu']).' IBU',0,0,'L',true);
432 $this->Cell(25,5,'('.$row['st_ibu_min'].' - '.$row['st_ibu_max'].' IBU)',0,0,'L',true); 436 $this->Cell(25,5,'('.$row['st_ibu_min'].' - '.$row['st_ibu_max'].' IBU)',0,0,'L',true);

mercurial