247 $this->SetFillColor(210,245,255); |
249 $this->SetFillColor(210,245,255); |
248 $this->Cell($vul+85,5,'',0,0,'L',false); |
250 $this->Cell($vul+85,5,'',0,0,'L',false); |
249 $this->Cell(12,5,sprintf("%.1f",$total_ibus),0,0,'R',true); |
251 $this->Cell(12,5,sprintf("%.1f",$total_ibus),0,0,'R',true); |
250 $this->Cell(18,5,sprintf("%.1f",$total_hops),0,0,'R',true); |
252 $this->Cell(18,5,sprintf("%.1f",$total_hops),0,0,'R',true); |
251 $this->Cell(20,5,sprintf("%8.3f",$cost_hops).EURO,0,0,'R',true); |
253 $this->Cell(20,5,sprintf("%8.3f",$cost_hops).EURO,0,0,'R',true); |
252 $this->Ln(10); |
|
253 $this->ProcessingTable=false; |
254 $this->ProcessingTable=false; |
254 $this->cMargin=$cMargin; |
255 $this->cMargin=$cMargin; |
255 $this->aCols=array(); |
256 $this->aCols=array(); |
|
257 $this->Ln(); |
256 } |
258 } |
257 |
259 |
258 function TableYeasts($row) { |
260 function TableYeasts($row) { |
259 global $cost_yeasts; |
261 global $cost_yeasts; |
260 global $svg; |
262 global $svg; |
261 $yeastform = array( 'Vloeibaar', 'Droog', 'Schuine buis', 'Slurry', 'Ingevroren', 'Depot' ); |
263 $yeastform = array( 'Vloeibaar', 'Droog', 'Schuine buis', 'Slurry', 'Ingevroren', 'Depot' ); |
262 $yeastuse = array( 'Hoofdgisting', 'Nagisting', 'Lagering', 'Bottelen' ); |
264 $yeastuse = array( 'Hoofdgisting', 'Nagisting', 'Lagering', 'Bottelen' ); |
263 $vul = $this->w - $this->rMargin - $this->lMargin - 140; |
265 $vul = $this->w - $this->rMargin - $this->lMargin - 140; |
|
266 $this->Ln(); |
264 $this->AddCol(27,'Laboratorium','L'); |
267 $this->AddCol(27,'Laboratorium','L'); |
265 $this->AddCol(18,'Product','L'); |
268 $this->AddCol(18,'Product','L'); |
266 $this->AddCol($vul,'Gist','L'); |
269 $this->AddCol($vul,'Gist','L'); |
267 $this->AddCol(20,'Gebruik','L'); |
270 $this->AddCol(20,'Gebruik','L'); |
268 $this->AddCol(15,'Attn','R'); |
271 $this->AddCol(15,'Attn','R'); |
383 } |
390 } |
384 |
391 |
385 $this->SetFillColor(210,245,255); |
392 $this->SetFillColor(210,245,255); |
386 $this->Cell($vul+80,5,'',0,0,'L',false); |
393 $this->Cell($vul+80,5,'',0,0,'L',false); |
387 $this->Cell(20,5,sprintf("%8.3f",$cost_miscs).EURO,0,0,'R',true); |
394 $this->Cell(20,5,sprintf("%8.3f",$cost_miscs).EURO,0,0,'R',true); |
388 $this->Ln(10); |
|
389 |
395 |
390 $this->ProcessingTable=false; |
396 $this->ProcessingTable=false; |
391 $this->cMargin=$cMargin; |
397 $this->cMargin=$cMargin; |
392 $this->aCols=array(); |
398 $this->aCols=array(); |
|
399 $this->Ln(); |
|
400 } |
|
401 |
|
402 function TableMashs($row) { |
|
403 global $cost_yeasts; |
|
404 global $svg; |
|
405 global $mashkg; |
|
406 $mashtype = array( 'Infusie', 'Verwarming', 'Decoctie' ); |
|
407 $vul = $this->w - $this->rMargin - $this->lMargin - 137; |
|
408 if ($this->GetY() > 250) |
|
409 $this->AddPage(); |
|
410 else |
|
411 $this->Ln(); |
|
412 $this->AddCol($vul,'Maisch stap naam','L'); |
|
413 $this->AddCol(25,'Stap type','L'); |
|
414 $this->AddCol(18,'Start '.DEG.'C','R'); |
|
415 $this->AddCol(18,'Eind '.DEG.'C','R'); |
|
416 $this->AddCol(18,'Rust min','R'); |
|
417 $this->AddCol(18,'Stap min','R'); |
|
418 $this->AddCol(20,'L/Kg','R'); |
|
419 $this->AddCol(20,'Infusie L','R'); |
|
420 |
|
421 $cMargin=$this->cMargin; |
|
422 $this->cMargin=2; |
|
423 $this->TableX=$this->lMargin; |
|
424 $this->TableHeader(); |
|
425 $this->ProcessingTable=true; |
|
426 |
|
427 $this->SetFont('Helvetica','',9); |
|
428 $this->SetFillColor(175, 175, 255); |
|
429 |
|
430 $vol = 0; |
|
431 $arr = json_decode($row['json_mashs'], true); |
|
432 foreach($arr as $item) { //foreach element in $arr |
|
433 |
|
434 if ($item['step_type'] == 0) |
|
435 $vol += $item['step_infuse_amount']; |
|
436 if ($mashkg > 0) |
|
437 $thick = $vol / $mashkg; |
|
438 else |
|
439 $thick = 0; |
|
440 $this->Cell($vul,5,$item['step_name'],0,0,'L',true); |
|
441 $this->Cell(25,5,$mashtype[$item['step_type']],0,0,'L',true); |
|
442 $this->Cell(18,5,sprintf("%.1f",$item['step_temp']),0,0,'R',true); |
|
443 $this->Cell(18,5,sprintf("%.1f",$item['end_temp']),0,0,'R',true); |
|
444 $this->Cell(18,5,sprintf("%.0f",$item['step_time']),0,0,'R',true); |
|
445 $this->Cell(18,5,sprintf("%.0f",$item['ramp_time']),0,0,'R',true); |
|
446 $this->Cell(20,5,sprintf("%.2f",$thick),0,0,'R',true); |
|
447 $this->Cell(20,5,sprintf("%.1f",$item['step_infuse_amount']),0,0,'R',true); |
|
448 $this->Ln(); |
|
449 } |
|
450 $this->ProcessingTable=false; |
|
451 $this->cMargin=$cMargin; |
|
452 $this->aCols=array(); |
|
453 $this->Ln(); |
393 } |
454 } |
394 |
455 |
395 // Watercolor $this->SetFillColor(120,255,250); |
456 // Watercolor $this->SetFillColor(120,255,250); |
396 |
457 |
397 function TableSummary($row) { |
458 function TableSummary($row) { |
481 $this->SetX($this->TableX); |
546 $this->SetX($this->TableX); |
482 $cost_total = $cost_fermentables + $cost_hops + $cost_miscs + $cost_yeasts; |
547 $cost_total = $cost_fermentables + $cost_hops + $cost_miscs + $cost_yeasts; |
483 $this->Cell(35,5,'Kosten',0,0,'L',true); |
548 $this->Cell(35,5,'Kosten',0,0,'L',true); |
484 $this->Cell(25,5,sprintf("%.2f",$cost_total).EURO,0,0,'L',true); |
549 $this->Cell(25,5,sprintf("%.2f",$cost_total).EURO,0,0,'L',true); |
485 $this->Cell(25,5,sprintf("%.2f",$cost_total/$row['batch_size']).EURO.' / liter',0,0,'L',true); |
550 $this->Cell(25,5,sprintf("%.2f",$cost_total/$row['batch_size']).EURO.' / liter',0,0,'L',true); |
486 $this->Ln(10); |
551 |
487 |
552 // calorieen |
488 |
553 $this->ProcessingTable=false; |
489 // Kostprijs per liter, calorieren |
554 $this->cMargin=$cMargin; |
490 $this->cMargin=$cMargin; |
555 $this->aCols=array(); |
|
556 $this->Ln(); |
491 } |
557 } |
492 |
558 |
493 function Checkheader($text) { |
559 function Checkheader($text) { |
494 $this->SetFont('Arial','B',10); |
560 $this->SetFont('Arial','B',10); |
495 $this->Cell(0, 4,$text,0,0,'L',true); |
561 $this->Cell(0, 4,$text,0,0,'L',true); |
496 $this->SetFont('Arial','',10); |
562 $this->SetFont('Arial','',10); |
497 $this->Ln(6); |
563 $this->Ln(6); |
498 } |
564 } |
499 |
565 |
500 function Checkline($text) { |
566 function Checkline($text) { |
501 // $this->SetX(5); |
|
502 $this->Cell(2, 4,' ',0,0,'L',true); |
567 $this->Cell(2, 4,' ',0,0,'L',true); |
503 $this->Cell(4, 4,' ',1,0,'L',true); |
568 $this->Cell(4, 4,' ',1,0,'L',true); |
504 // $this->Rect(10,$this->GetY(),4,4); |
|
505 // $this->SetX(15); |
|
506 $this->Cell(0, 4,' '.$text,0,1,'L',true); |
569 $this->Cell(0, 4,' '.$text,0,1,'L',true); |
507 $this->Ln(1); |
570 $this->Ln(1); |
508 } |
571 } |
509 |
572 |
510 function Checklist($row) { |
573 function Checklist($row) { |
832 // 'Toevoegingen tijdens nagisting/lagering' |
895 // 'Toevoegingen tijdens nagisting/lagering' |
833 // fermentables & hops & miscs verdelen over primary/secondary/teriary |
896 // fermentables & hops & miscs verdelen over primary/secondary/teriary |
834 |
897 |
835 // 'Toevoegingen tijdens bottelen/op fust zetten' |
898 // 'Toevoegingen tijdens bottelen/op fust zetten' |
836 } |
899 } |
|
900 |
|
901 function Brewday($row) { |
|
902 |
|
903 global $my_brix_correction; |
|
904 global $my_grain_absorbtion; |
|
905 |
|
906 if ($this->GetY() > 180) |
|
907 $this->AddPage(); |
|
908 else |
|
909 $this->Ln(10); |
|
910 |
|
911 $vul = $this->w - $this->rMargin - $this->lMargin - 170; |
|
912 $cMargin=$this->cMargin; |
|
913 $this->cMargin=2; |
|
914 $this->TableX=$this->lMargin; |
|
915 $this->SetFont('Helvetica','B',9); |
|
916 $this->SetX($this->TableX); |
|
917 $this->SetFillColor(255,150,100); |
|
918 $this->Cell(0, 5, 'Brouwdag gegevens',0,0,'C',true); |
|
919 $this->Ln(); |
|
920 |
|
921 $this->SetFont('Helvetica','',9); |
|
922 $this->SetFillColor(210,245,255); |
|
923 |
|
924 $this->SetX($this->TableX); |
|
925 $this->Cell(35,5,'Datum start',0,0,'L',true); |
|
926 $this->Cell(50,5,$row['brew_date_start'],0,0,'L',true); |
|
927 $this->Cell($vul,5,'',0,0,'L',false); |
|
928 $this->Cell(35,5,'Maisch zuurgraad',0,0,'L',true); |
|
929 $this->Cell(50,5,sprintf("%.1f", $row['brew_mash_ph']).' pH',0,0,'L',true); |
|
930 $this->Ln(); |
|
931 |
|
932 $this->SetX($this->TableX); |
|
933 $this->Cell(35,5,'Datum eind',0,0,'L',true); |
|
934 $this->Cell(50,5,$row['brew_date_end'],0,0,'L',true); |
|
935 $this->Cell($vul,5,'',0,0,'L',false); |
|
936 $this->Cell(35,5,'Maisch densiteit',0,0,'L',true); |
|
937 $plato = sg_to_plato(floatval($row['brew_mash_sg'])); |
|
938 $brix = $plato * $my_brix_correction; |
|
939 $this->Cell(50,5,sprintf("%.3f", floatval($row['brew_mash_sg']))." SG ".sprintf("%.1f",$brix).DEG.'Brix '.sprintf("%.1f",$plato).DEG.'P',0,0,'L',true); |
|
940 $this->Ln(); |
|
941 |
|
942 $infuse = $mvol = floatval($row['w1_amount']) + floatval($row['w2_amount']); |
|
943 $msugars = 0; |
|
944 $bsugars = 0; |
|
945 $mashkg = 0; |
|
946 $ferms = json_decode($row['json_fermentables'], true); |
|
947 foreach($ferms as $item) { |
|
948 if ($item['f_added'] == 0) { // Mash |
|
949 $msugars += floatval($item['f_amount']) * (floatval($item['f_yield']) / 100) * (1 - floatval($item['f_moisture']) / 100); |
|
950 $mvol += floatval($item['f_amount']) * floatval($item['f_moisture']) / 100; |
|
951 $mashkg += floatval($item['f_amount']); |
|
952 } |
|
953 if ($item['f_added'] == 1) { // Boil |
|
954 $bsugars += floatval($item['f_amount']) * (floatval($item['f_yield']) / 100) * (1 - floatval($item['f_moisture']) / 100); |
|
955 } |
|
956 } |
|
957 $sugardensity = 1.611; |
|
958 $v = $msugars / $sugardensity + $mvol; |
|
959 $plato = 1000 * $msugars / ($v * 10); |
|
960 if ($plato > 0.5) |
|
961 $e = 100 * sg_to_plato(floatval($row['brew_mash_sg'])) / $plato; |
|
962 else |
|
963 $e = 0; |
|
964 $this->SetX($this->TableX); |
|
965 $this->Cell(85+$vul,5,'',0,0,'L',false); |
|
966 $this->Cell(35,5,'Maisch rendement',0,0,'L',true); |
|
967 $this->Cell(50,5,sprintf("%.1f", $e)."%",0,0,'L',true); |
|
968 $this->Ln(7); |
|
969 |
|
970 $this->SetX($this->TableX); |
|
971 $this->Cell(35,5,'Voor koken zuurgraad',0,0,'L',true); |
|
972 $this->Cell(50,5,sprintf("%.1f", $row['brew_preboil_ph'])." pH",0,0,'L',true); |
|
973 $this->Cell($vul,5,'',0,0,'L',false); |
|
974 $this->Cell(35,5,'Na koken zuurgraad',0,0,'L',true); |
|
975 $this->Cell(50,5,sprintf("%.1f", $row['brew_aboil_ph'])." pH",0,0,'L',true); |
|
976 $this->Ln(); |
|
977 |
|
978 $this->SetX($this->TableX); |
|
979 $this->Cell(35,5,'Voor koken densiteit',0,0,'L',true); |
|
980 $plato = sg_to_plato(floatval($row['brew_preboil_sg'])); |
|
981 $brix = $plato * $my_brix_correction; |
|
982 $this->Cell(50,5,sprintf("%.3f", floatval($row['brew_preboil_sg']))." SG ".sprintf("%.1f",$brix).DEG.'Brix '.sprintf("%.1f",$plato).DEG.'P',0,0,'L',true); |
|
983 $this->Cell($vul,5,'',0,0,'L',false); |
|
984 $this->Cell(35,5,'Na koken densiteit',0,0,'L',true); |
|
985 $plato = sg_to_plato(floatval($row['brew_aboil_sg'])); |
|
986 $brix = $plato * $my_brix_correction; |
|
987 $this->Cell(50,5,sprintf("%.3f", floatval($row['brew_aboil_sg']))." SG ".sprintf("%.1f",$brix).DEG.'Brix '.sprintf("%.1f",$plato).DEG.'P',0,0,'L',true); |
|
988 $this->Ln(); |
|
989 |
|
990 $this->SetX($this->TableX); |
|
991 $this->Cell(35,5,'Voor koken volume',0,0,'L',true); |
|
992 $this->Cell(50,5,sprintf("%.1f", $row['brew_preboil_volume'])." liter",0,0,'L',true); |
|
993 $this->Cell($vul,5,'',0,0,'L',false); |
|
994 $this->Cell(35,5,'Na koken volume',0,0,'L',true); |
|
995 $this->Cell(50,5,sprintf("%.1f", $row['brew_aboil_volume'])." liter",0,0,'L',true); |
|
996 $this->Ln(); |
|
997 |
|
998 $this->SetX($this->TableX); |
|
999 $this->Cell(35,5,'Voor koken rendement',0,0,'L',true); |
|
1000 $tot = sg_to_plato(floatval($row['brew_preboil_sg'])) * (floatval($row['brew_preboil_volume']) / 1.04) * floatval($row['brew_preboil_sg']) * 10 / 1000; |
|
1001 $result = 0; |
|
1002 if ($msugars > 0) |
|
1003 $result = (($tot / $msugars * 100) * 10) / 10; |
|
1004 if ($result < 0) |
|
1005 $result = 0; |
|
1006 $this->Cell(50,5,sprintf("%.1f", $result)."%",0,0,'L',true); |
|
1007 $this->Cell($vul,5,'',0,0,'L',false); |
|
1008 $this->Cell(35,5,'Na koken rendement',0,0,'L',true); |
|
1009 $tot = sg_to_plato(floatval($row['brew_aboil_sg'])) * (floatval($row['brew_aboil_volume']) / 1.04) * floatval($row['brew_aboil_sg']) * 10 / 1000; |
|
1010 $tot -= $bsugars; |
|
1011 $result = 0; |
|
1012 if ($msugars > 0) |
|
1013 $result = (($tot / $msugars * 100) * 10) / 10; |
|
1014 if ($result < 0) |
|
1015 $result = 0; |
|
1016 $this->Cell(50,5,sprintf("%.1f", $result)."%",0,0,'L',true); |
|
1017 $this->Ln(7); |
|
1018 |
|
1019 $coolingtype = array( '-', 'Dompelkoeler', 'Tegenstroomkoeler', 'Au bain marie', 'Laten afkoelen' ); |
|
1020 $this->SetX($this->TableX); |
|
1021 $this->Cell(35,5,'Spoelwater temperatuur',0,0,'L',true); |
|
1022 $this->Cell(50,5,sprintf("%.1f", $row['brew_sparge_temperature']).DEG.'C',0,0,'L',true); |
|
1023 $this->Cell($vul,5,'',0,0,'L',false); |
|
1024 $this->Cell(35,5,'Koel methode',0,0,'L',true); |
|
1025 $this->Cell(50,5,$coolingtype[$row['brew_cooling_method']],0,0,'L',true); |
|
1026 $this->Ln(); |
|
1027 |
|
1028 $spoelw = (floatval($row['boil_size']) - $infuse + ($mashkg * $my_grain_absorbtion) + floatval($row['eq_lauter_deadspace'])) * 1.03; |
|
1029 $this->SetX($this->TableX); |
|
1030 $this->Cell(35,5,'Spoelwater volume',0,0,'L',true); |
|
1031 $this->Cell(50,5,sprintf("%.1f", $spoelw).' liter',0,0,'L',true); |
|
1032 $this->Cell($vul,5,'',0,0,'L',false); |
|
1033 $this->Cell(35,5,'Koel temperatuur',0,0,'L',true); |
|
1034 $this->Cell(50,5,sprintf("%.1f", floatval($row['brew_cooling_to'])).DEG.'C',0,0,'L',true); |
|
1035 $this->Ln(); |
|
1036 |
|
1037 $this->SetX($this->TableX); |
|
1038 $this->Cell(35,5,'Spoelwater zuurgraad',0,0,'L',true); |
|
1039 $this->Cell(50,5,sprintf("%.1f", $row['brew_sparge_ph']).' pH',0,0,'L',true); |
|
1040 $this->Cell($vul,5,'',0,0,'L',false); |
|
1041 $this->Cell(35,5,'Koel tijdsduur',0,0,'L',true); |
|
1042 $this->Cell(50,5,sprintf("%.0f", floatval($row['brew_cooling_time'])).' minuten',0,0,'L',true); |
|
1043 $this->Ln(7); |
|
1044 |
|
1045 $this->SetX($this->TableX); |
|
1046 $this->Cell(35,5,'Whirlpool +85'.DEG.'C',0,0,'L',true); |
|
1047 $this->Cell(50,5,sprintf("%.0f", $row['brew_whirlpool9']).' minuten',0,0,'L',true); |
|
1048 $this->Cell($vul,5,'',0,0,'L',false); |
|
1049 $this->Cell(35,5,'Koeler & trub verlies',0,0,'L',true); |
|
1050 $this->Cell(50,5,sprintf("%.1f", floatval($row['brew_fermenter_tcloss'])).' liter',0,0,'L',true); |
|
1051 $this->Ln(); |
|
1052 |
|
1053 $this->SetX($this->TableX); |
|
1054 $this->Cell(35,5,'Whirlpool 72..79'.DEG.'C',0,0,'L',true); |
|
1055 $this->Cell(50,5,sprintf("%.0f", $row['brew_whirlpool7']).' minuten',0,0,'L',true); |
|
1056 $this->Cell($vul,5,'',0,0,'L',false); |
|
1057 $this->Cell(35,5,'Extra water in gistvat',0,0,'L',true); |
|
1058 $this->Cell(50,5,sprintf("%.1f", floatval($row['brew_fermenter_extrawater'])).' liter',0,0,'L',true); |
|
1059 $this->Ln(); |
|
1060 |
|
1061 $this->SetX($this->TableX); |
|
1062 $this->Cell(35,5,'Whirlpool 60..66'.DEG.'C',0,0,'L',true); |
|
1063 $this->Cell(50,5,sprintf("%.0f", $row['brew_whirlpool6']).' minuten',0,0,'L',true); |
|
1064 $this->Cell($vul,5,'',0,0,'L',false); |
|
1065 $this->Cell(35,5,'Volume naar gistvat',0,0,'L',true); |
|
1066 $this->Cell(50,5,sprintf("%.1f", floatval($row['brew_fermenter_volume'])).' liter',0,0,'L',true); |
|
1067 $this->Ln(); |
|
1068 |
|
1069 $this->SetX($this->TableX); |
|
1070 $this->Cell(35,5,'Whirlpool koud',0,0,'L',true); |
|
1071 $this->Cell(50,5,sprintf("%.0f", $row['brew_whirlpool2']).' minuten',0,0,'L',true); |
|
1072 $this->Cell($vul,5,'',0,0,'L',false); |
|
1073 $this->Cell(35,5,'Densiteit in gistvat',0,0,'L',true); |
|
1074 $this->Cell(50,5,sprintf("%.3f", floatval($row['brew_fermenter_sg'])).' SG',0,0,'L',true); |
|
1075 $this->Ln(7); |
|
1076 |
|
1077 $aerationtype = array( 'Geen', 'Lucht', 'Zuurstof' ); |
|
1078 $this->SetX($this->TableX); |
|
1079 $this->Cell(35,5,'Beluchten met',0,0,'L',true); |
|
1080 $this->Cell(50,5,$aerationtype[$row['brew_aeration_type']],0,0,'L',true); |
|
1081 $this->Cell($vul,5,'',0,0,'L',false); |
|
1082 $this->Cell(35,5,'Kleur in gistvat',0,0,'L',true); |
|
1083 $this->Cell(50,5,sprintf("%.0f", floatval($row['brew_fermenter_color'])).' EBC',0,0,'L',true); |
|
1084 $this->Ln(); |
|
1085 |
|
1086 $this->SetX($this->TableX); |
|
1087 $this->Cell(35,5,'Beluchten snelheid/tijd',0,0,'L',true); |
|
1088 $this->Cell(50,5,$row['brew_aeration_speed'].'/'.$row['brew_aeration_time'],0,0,'L',true); |
|
1089 $this->Cell($vul,5,'',0,0,'L',false); |
|
1090 $this->Cell(35,5,'Bitterheid in gistvat',0,0,'L',true); |
|
1091 $this->Cell(50,5,sprintf("%.0f", floatval($row['brew_fermenter_ibu'])).' IBU',0,0,'L',true); |
|
1092 $this->Ln(); |
|
1093 } |
837 } |
1094 } |
838 |
1095 |
839 |
1096 |
840 |
1097 |
841 class PDF extends PDF_MySQL_Table { |
1098 class PDF extends PDF_MySQL_Table { |