www/prod_print.php

changeset 424
7d231014b301
parent 421
0bc45502144b
child 432
99dcd8488b62
equal deleted inserted replaced
423:2230d3faeed9 424:7d231014b301
31 $total_ibus = 0; 31 $total_ibus = 0;
32 $preboil_sg = 0; 32 $preboil_sg = 0;
33 $mashkg = 0; 33 $mashkg = 0;
34 date_default_timezone_set('Europe/Amsterdam'); 34 date_default_timezone_set('Europe/Amsterdam');
35 $prdate = date(DATE_RFC2822); 35 $prdate = date(DATE_RFC2822);
36 $bottle_sugar = '';
37 $keg_sugar = '';
38 $bottle_sugar_amount = 0;
39 $keg_sugar_amount = 0;
36 40
37 41
38 class PDF_MySQL_Table extends FPDF 42 class PDF_MySQL_Table extends FPDF
39 { 43 {
40 protected $ProcessingTable=false; 44 protected $ProcessingTable=false;
109 global $pSugar; 113 global $pSugar;
110 global $pCara; 114 global $pCara;
111 global $colorw; 115 global $colorw;
112 global $preboil_sg; 116 global $preboil_sg;
113 global $mashkg; 117 global $mashkg;
118 global $bottle_sugar;
119 global $bottle_sugar_amount;
120 global $keg_sugar;
121 global $keg_sugar_amount;
114 $added = array( 'Maischen', 'Koken 10 min', 'Vergisten', 'Nagisten/lageren', 'Bottelen', 'Op fust' ); 122 $added = array( 'Maischen', 'Koken 10 min', 'Vergisten', 'Nagisten/lageren', 'Bottelen', 'Op fust' );
115 $ftype = array( 'Mout', 'Suiker', 'Vloeibaar extract', 'Droog extract', 'Ongemout graan' ); 123 $ftype = array( 'Mout', 'Suiker', 'Vloeibaar extract', 'Droog extract', 'Ongemout graan' );
116 $mtype = array( 'Basismout', 'Geroosterde mout', 'Cara- of crystalmout', 'Geëeste mout', 'Zuurmout', 'Speciale mout', 'Geen mout' ); 124 $mtype = array( 'Basismout', 'Geroosterde mout', 'Cara- of crystalmout', 'Geëeste mout', 'Zuurmout', 'Speciale mout', 'Geen mout' );
117 $vul = $this->w - $this->rMargin - $this->lMargin - 125; 125 $vul = $this->w - $this->rMargin - $this->lMargin - 125;
118 $this->Ln(); 126 $this->Ln();
153 161
154 if ($item['f_type'] == 0) 162 if ($item['f_type'] == 0)
155 $soort = iconv('UTF-8','windows-1252',$mtype[$item['f_graintype']]); 163 $soort = iconv('UTF-8','windows-1252',$mtype[$item['f_graintype']]);
156 else 164 else
157 $soort = iconv('UTF-8','windows-1252',$ftype[$item['f_type']]); 165 $soort = iconv('UTF-8','windows-1252',$ftype[$item['f_type']]);
166
167 if ($item['f_added'] == 4) {
168 $bottle_sugar = $name;
169 $bottle_sugar_amount = $amount;
170 }
171 if ($item['f_added'] == 5) {
172 $keg_sugar = $name;
173 $keg_sugar_amount = $amount;
174 }
158 175
159 $cost = $amount * $costkg; 176 $cost = $amount * $costkg;
160 $cost_fermentables += $cost; 177 $cost_fermentables += $cost;
161 $total_fermentables += $amount; 178 $total_fermentables += $amount;
162 /* Calculate the amount of sugars */ 179 /* Calculate the amount of sugars */
792 $this->Cell(50,5,sprintf("%.0f", floatval($row['brew_fermenter_ibu'])).' IBU',0,0,'L',true); 809 $this->Cell(50,5,sprintf("%.0f", floatval($row['brew_fermenter_ibu'])).' IBU',0,0,'L',true);
793 $this->Ln(); 810 $this->Ln();
794 } 811 }
795 812
796 function Fermentation($row) { 813 function Fermentation($row) {
797 /* 814
798 * primary_start_temp primary_max_temp primary_end_temp primary_end_sg primary_end_date 815 if ($this->GetY() > 230)
799 * secondary_temp secondary_end_date
800 * tertiary_temp package_date
801 */
802 if ($this->GetY() > 180)
803 $this->AddPage(); 816 $this->AddPage();
804 else 817 else
805 $this->Ln(10); 818 $this->Ln(10);
806 819
807 $vul = $this->w - $this->rMargin - $this->lMargin - 180; 820 $vul = $this->w - $this->rMargin - $this->lMargin - 180;
865 $this->Ln(); 878 $this->Ln();
866 } 879 }
867 880
868 function Packaging($row) { 881 function Packaging($row) {
869 882
883 global $bottle_sugar;
884 global $bottle_sugar_amount;
885 global $keg_sugar;
886 global $keg_sugar_amount;
887
888 if ($this->GetY() > 230)
889 $this->AddPage();
890 else
891 $this->Ln(10);
892
893 $vul = $this->w - $this->rMargin - $this->lMargin - 180;
894 $cMargin=$this->cMargin;
895 $this->cMargin=2;
896 $this->TableX=$this->lMargin;
897 $this->SetFont('Helvetica','B',9);
898 $this->SetX($this->TableX);
899 $this->SetFillColor(255,150,100);
900 $this->Cell(0, 5, 'Verpakken',0,0,'C',true);
901 $this->Ln();
902
903 $this->SetFont('Helvetica','',9);
904 $this->SetFillColor(210,245,255);
905
906 $this->SetX($this->TableX);
907 $this->Cell(45,5,'Datum verpakken',0,0,'L',true);
908 $this->Cell(45,5,$row['package_date'],0,0,'L',true);
909 $this->Cell($vul,5,'',0,0,'L',false);
910 $this->Cell(45,5,'Hoeveelheid',0,0,'L',true);
911 $this->Cell(45,5,sprintf("%.1f", $row['package_volume']).' liter',0,0,'L',true);
912 $this->Ln();
913
914 $this->SetX($this->TableX);
915 $this->Cell(45,5,'Alcohol volume',0,0,'L',true);
916 $this->Cell(45,5,sprintf("%.1f",$row['package_abv']).'%',0,0,'L',true);
917 if (($row['package_infuse_amount'] > 0) && ($row['package_infuse_abv'] == 0)) {
918 $this->Cell($vul,5,'',0,0,'L',false);
919 $this->Cell(45,5,'Water toevoegen',0,0,'L',true);
920 $this->Cell(45,5,sprintf("%.1f", $row['package_infuse_amount']).' liter',0,0,'L',true);
921 }
922 $this->Ln(7);
923
924 if (($row['package_infuse_amount'] > 0) && ($row['package_infuse_abv'] > 0)) {
925 $this->SetX($this->TableX);
926 $this->Cell(45,5,'Drank toevoegen',0,0,'L',true);
927 $this->Cell(45,5,sprintf("%.1f",$row['package_infuse_amount']).' liter',0,0,'L',true);
928 $this->Cell($vul,5,'',0,0,'L',false);
929 $this->Cell(45,5,'Bevat alcohol volume',0,0,'L',true);
930 $this->Cell(45,5,sprintf("%.1f", $row['package_infuse_abv']).'%',0,0,'L',true);
931 $this->Ln();
932
933 $this->SetX($this->TableX);
934 $this->Cell(180,5,iconv('UTF-8','windows-1252',$row['package_infuse_notes']),0,0,'L',true);
935 $this->Ln(7);
936 }
937
938 $this->SetX($this->TableX);
939 $this->Cell(45,5,'Flessen volume',0,0,'L',true);
940 $this->Cell(45,5,sprintf("%.1f",$row['bottle_amount']).' liter',0,0,'L',true);
941 $this->Cell($vul,5,'',0,0,'L',false);
942 $this->Cell(45,5,'Fusten volume',0,0,'L',true);
943 $this->Cell(45,5,sprintf("%.1f", $row['keg_amount']).' liter',0,0,'L',true);
944 $this->Ln();
945
946 $this->SetX($this->TableX);
947 $this->Cell(45,5,'CO2 volumes',0,0,'L',true);
948 $this->Cell(45,5,sprintf("%.2f",$row['bottle_carbonation']),0,0,'L',true);
949 $this->Cell($vul,5,'',0,0,'L',false);
950 $this->Cell(45,5,'CO2 volumes',0,0,'L',true);
951 $this->Cell(45,5,sprintf("%.2f", $row['keg_carbonation']),0,0,'L',true);
952 $this->Ln();
953
954 $this->SetX($this->TableX);
955 $this->Cell(45,5,'Suiker',0,0,'L',true);
956 $this->Cell(45,5,$bottle_sugar,0,0,'L',true);
957 $this->Cell($vul,5,'',0,0,'L',false);
958 $this->Cell(45,5,'Suiker',0,0,'L',true);
959 $this->Cell(45,5,$keg_sugar,0,0,'L',true);
960 $this->Ln();
961
962 $this->SetX($this->TableX);
963 $this->Cell(45,5,'Hoeveelheid',0,0,'L',true);
964 $this->Cell(45,5,sprintf("%.1f",$row['bottle_priming_amount']).' gram/liter',0,0,'L',true);
965 $this->Cell($vul,5,'',0,0,'L',false);
966 if ($row['keg_forced_carb']) {
967 $this->Cell(45,5,'Geforceerd op druk zetten',0,0,'L',true);
968 $this->Cell(45,5,'Ja',0,0,'L',true);
969 } else {
970 $this->Cell(45,5,'Hoeveelheid',0,0,'L',true);
971 $this->Cell(45,5,sprintf("%.1f", $row['keg_priming_amount']).' gram/liter',0,0,'L',true);
972 }
973 $this->Ln();
974
975 $this->SetX($this->TableX);
976 $this->Cell(45,5,'Totaal suiker',0,0,'L',true);
977 $this->Cell(45,5,sprintf("%.3f",$bottle_sugar_amount).' kg',0,0,'L',true);
978 $this->Cell($vul,5,'',0,0,'L',false);
979 if ($row['keg_forced_carb']) {
980 $this->Cell(45,5,'Druk op fust',0,0,'L',true);
981 $this->Cell(45,5,sprintf("%.1f",$row['keg_pressure']).' bar',0,0,'L',true);
982 } else {
983 $this->Cell(45,5,'Totaal suiker',0,0,'L',true);
984 $this->Cell(45,5,sprintf("%.3f",$keg_sugar_amount).' kg',0,0,'L',true);
985 }
986 $this->Ln();
987
988 $this->SetX($this->TableX);
989 $this->Cell(45,5,'Water oplossen',0,0,'L',true);
990 $this->Cell(45,5,sprintf("%.3f",$row['bottle_priming_water']).' liter',0,0,'L',true);
991 $this->Cell($vul,5,'',0,0,'L',false);
992 if (! $row['keg_forced_carb']) {
993 $this->Cell(45,5,'Water oplossen',0,0,'L',true);
994 $this->Cell(45,5,sprintf("%.3f",$row['keg_priming_water']).' liter',0,0,'L',true);
995 }
996 $this->Ln();
997
998 $this->SetX($this->TableX);
999 $this->Cell(45,5,'Alcohol volume',0,0,'L',true);
1000 $this->Cell(45,5,sprintf("%.1f",$row['package_abv'] + $row['bottle_priming_amount'] * 0.47 / 7.907).'%',0,0,'L',true);
1001 $this->Cell($vul,5,'',0,0,'L',false);
1002 $this->Cell(45,5,'Alcohol volume',0,0,'L',true);
1003 $this->Cell(45,5,sprintf("%.1f",$row['package_abv'] + $row['keg_priming_amount'] * 0.47 / 7.907).'%',0,0,'L',true);
1004 $this->Ln();
1005
1006 $this->SetX($this->TableX);
1007 $this->Cell(45,5,'Hergisting temperatuur',0,0,'L',true);
1008 $this->Cell(45,5,sprintf("%.1f",$row['bottle_carbonation_temp']).DEG.'C',0,0,'L',true);
1009 $this->Cell($vul,5,'',0,0,'L',false);
1010 $this->Cell(45,5,'Hergisting temperatuur',0,0,'L',true);
1011 $this->Cell(45,5,sprintf("%.1f", $row['keg_carbonation_temp']).DEG.'C',0,0,'L',true);
1012 $this->Ln();
870 } 1013 }
871 1014
872 function Tasting($row) { 1015 function Tasting($row) {
873 1016
1017 if ($this->GetY() > 200)
1018 $this->AddPage();
1019 else
1020 $this->Ln(10);
1021
1022 $vul = $this->w - $this->rMargin - $this->lMargin - 180;
1023 $cMargin=$this->cMargin;
1024 $this->cMargin=2;
1025 $this->TableX=$this->lMargin;
1026 $this->SetFont('Helvetica','B',9);
1027 $this->SetX($this->TableX);
1028 $this->SetFillColor(255,150,100);
1029 $this->Cell(0, 5, 'Proef notities',0,0,'C',true);
1030 $this->Ln();
1031
1032 $this->SetFont('Helvetica','',9);
1033 $this->SetFillColor(210,245,255);
1034
1035 $this->SetX($this->TableX);
1036 $this->Cell(45,5,'Proeven datum',0,0,'L',true);
1037 $this->Cell(45,5,$row['taste_date'],0,0,'L',true);
1038 $this->Cell($vul,5,'',0,0,'L',false);
1039 $this->Cell(45,5,'Waardering',0,0,'L',true);
1040 $this->Cell(45,5,sprintf("%.1f", $row['taste_rate']),0,0,'L',true);
1041 $this->Ln();
1042
1043 $this->SetX($this->TableX);
1044 $this->Cell(45,5,'Kleur',0,0,'L',true);
1045 $this->Cell($vul+135,5,iconv('UTF-8','windows-1252',$row['taste_color']),0,0,'L',true);
1046 $this->Ln();
1047
1048 $this->SetX($this->TableX);
1049 $this->Cell(45,5,'Helderheid',0,0,'L',true);
1050 $this->Cell($vul+135,5,iconv('UTF-8','windows-1252',$row['taste_transparency']),0,0,'L',true);
1051 $this->Ln();
1052
1053 $this->SetX($this->TableX);
1054 $this->Cell(45,5,'Schuim',0,0,'L',true);
1055 $this->Cell($vul+135,5,iconv('UTF-8','windows-1252',$row['taste_head']),0,0,'L',true);
1056 $this->Ln();
1057
1058 $this->SetX($this->TableX);
1059 $this->Cell(45,5,'Aroma',0,0,'L',true);
1060 $this->Cell($vul+135,5,iconv('UTF-8','windows-1252',$row['taste_aroma']),0,0,'L',true);
1061 $this->Ln();
1062
1063 $this->SetX($this->TableX);
1064 $this->Cell(45,5,'Smaak',0,0,'L',true);
1065 $this->Cell($vul+135,5,iconv('UTF-8','windows-1252',$row['taste_taste']),0,0,'L',true);
1066 $this->Ln();
1067
1068 $this->SetX($this->TableX);
1069 $this->Cell(45,5,'Mondgevoel',0,0,'L',true);
1070 $this->Cell($vul+135,5,iconv('UTF-8','windows-1252',$row['taste_mouthfeel']),0,0,'L',true);
1071 $this->Ln();
1072
1073 $this->SetX($this->TableX);
1074 $this->Cell(45,5,'Nasmaak',0,0,'L',true);
1075 $this->Cell($vul+135,5,iconv('UTF-8','windows-1252',$row['taste_aftertaste']),0,0,'L',true);
1076 $this->Ln();
1077
1078 $this->SetX($this->TableX);
1079 $this->Cell(45,5,'Notities',0,0,'L',true);
1080 $this->MultiCell(0,5,iconv('UTF-8','windows-1252',$row['taste_notes']),0,'L',true);
1081 $this->Ln();
874 } 1082 }
875 } 1083 }
876 1084
877 1085
878 1086

mercurial