www/rec_print.php

changeset 93
357d59d8ec5e
parent 90
d4246abee34e
child 94
295c3af2a421
equal deleted inserted replaced
92:fab98e5c86fc 93:357d59d8ec5e
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 $colorw = 0;
31 $total_ibus = 0;
31 32
32 33
33 class PDF_MySQL_Table extends FPDF 34 class PDF_MySQL_Table extends FPDF
34 { 35 {
35 protected $ProcessingTable=false; 36 protected $ProcessingTable=false;
166 $this->aCols=array(); 167 $this->aCols=array();
167 } 168 }
168 169
169 function TableHops($row) { 170 function TableHops($row) {
170 global $total_hops; 171 global $total_hops;
172 global $total_ibus;
171 global $cost_hops; 173 global $cost_hops;
172 $vul = $this->w - $this->rMargin - $this->lMargin - 135; 174 $vul = $this->w - $this->rMargin - $this->lMargin - 135;
173 $this->AddCol($vul,'Hop','L'); 175 $this->AddCol($vul,'Hop','L');
174 $this->AddCol(35,'Land','L'); 176 $this->AddCol(35,'Land','L');
175 $this->AddCol(15,'Soort','L'); 177 $this->AddCol(15,'Soort','L');
207 $moment = hop_useat_names($useat); 209 $moment = hop_useat_names($useat);
208 if ($useat == "Boil") { 210 if ($useat == "Boil") {
209 $moment = "Kook@".$time; 211 $moment = "Kook@".$time;
210 } 212 }
211 $ibu = calc_IBU($useat, $form, floatval($row['est_og']), floatval($row['batch_size']), $mass, $time, $alpha, $row['ibu_method']); 213 $ibu = calc_IBU($useat, $form, floatval($row['est_og']), floatval($row['batch_size']), $mass, $time, $alpha, $row['ibu_method']);
214 $total_ibus += $ibu;
212 215
213 $this->Cell($vul,5,$name,0,0,'L',true); 216 $this->Cell($vul,5,$name,0,0,'L',true);
214 $this->Cell(35,5,$origin,0,0,'L',true); 217 $this->Cell(35,5,$origin,0,0,'L',true);
215 $this->Cell(15,5,hop_form_names($form),0,0,'L',true); 218 $this->Cell(15,5,hop_form_names($form),0,0,'L',true);
216 $this->Cell(20,5,$moment,0,0,'L',true); 219 $this->Cell(20,5,$moment,0,0,'L',true);
220 $this->Cell(20,5,sprintf("%8.3f",$cost).EURO,0,0,'R',true); 223 $this->Cell(20,5,sprintf("%8.3f",$cost).EURO,0,0,'R',true);
221 $this->Ln(); 224 $this->Ln();
222 } 225 }
223 226
224 $this->SetFillColor(210,245,255); 227 $this->SetFillColor(210,245,255);
225 $this->Cell($vul+97,5,'',0,0,'L',false); 228 $this->Cell($vul+85,5,'',0,0,'L',false);
229 $this->Cell(12,5,sprintf("%.1f",$total_ibus),0,0,'R',true);
226 $this->Cell(18,5,sprintf("%.1f",$total_hops),0,0,'R',true); 230 $this->Cell(18,5,sprintf("%.1f",$total_hops),0,0,'R',true);
227 $this->Cell(20,5,sprintf("%8.3f",$cost_hops).EURO,0,0,'R',true); 231 $this->Cell(20,5,sprintf("%8.3f",$cost_hops).EURO,0,0,'R',true);
228 $this->Ln(10); 232 $this->Ln(10);
229 $this->ProcessingTable=false; 233 $this->ProcessingTable=false;
230 $this->cMargin=$cMargin; 234 $this->cMargin=$cMargin;
357 function TableSummary($row) { 361 function TableSummary($row) {
358 global $pSugar; 362 global $pSugar;
359 global $pCara; 363 global $pCara;
360 global $svg; 364 global $svg;
361 global $colorw; 365 global $colorw;
366 global $cost_fermentables;
367 global $cost_hops;
368 global $cost_miscs;
369 global $cost_yeasts;
362 /* 2 Columns */ 370 /* 2 Columns */
363 $vul = $this->w - $this->rMargin - $this->lMargin - 170; 371 $vul = $this->w - $this->rMargin - $this->lMargin - 170;
364 $cMargin=$this->cMargin; 372 $cMargin=$this->cMargin;
365 $this->cMargin=2; 373 $this->cMargin=2;
366 $this->TableX=$this->lMargin; 374 $this->TableX=$this->lMargin;
409 $this->SetFillColor(210,245,255); 417 $this->SetFillColor(210,245,255);
410 $this->Cell($vul,5,'',0,0,'L',false); 418 $this->Cell($vul,5,'',0,0,'L',false);
411 $this->Cell(35,5,'Bitterheid ('.$row['ibu_method'].')',0,0,'L',true); 419 $this->Cell(35,5,'Bitterheid ('.$row['ibu_method'].')',0,0,'L',true);
412 $this->Cell(25,5,sprintf("%.0f",$row['est_ibu']).' IBU',0,0,'L',true); 420 $this->Cell(25,5,sprintf("%.0f",$row['est_ibu']).' IBU',0,0,'L',true);
413 $this->Cell(25,5,'('.$row['st_ibu_min'].' - '.$row['st_ibu_max'].' IBU)',0,0,'L',true); 421 $this->Cell(25,5,'('.$row['st_ibu_min'].' - '.$row['st_ibu_max'].' IBU)',0,0,'L',true);
414 $this->Ln(10); 422 $this->Ln();
423
424 $this->SetX($this->TableX);
425 $cost_total = $cost_fermentables + $cost_hops + $cost_miscs + $cost_yeasts;
426 $this->Cell(35,5,'Kosten',0,0,'L',true);
427 $this->Cell(25,5,sprintf("%.2f",$cost_total).EURO,0,0,'L',true);
428 $this->Cell(25,5,sprintf("%.2f",$cost_total/$row['batch_size']).EURO.' / liter',0,0,'L',true);
429 $this->Ln(10);
430
431
415 // Kostprijs per liter, calorieren 432 // Kostprijs per liter, calorieren
416 $this->cMargin=$cMargin; 433 $this->cMargin=$cMargin;
417 } 434 }
418 } 435 }
419 436

mercurial