1 <?php |
1 <?php |
2 require_once($_SERVER['DOCUMENT_ROOT'].'/includes/global.inc.php'); |
2 require_once($_SERVER['DOCUMENT_ROOT'].'/includes/global.inc.php'); |
3 require_once($_SERVER['DOCUMENT_ROOT'].'/includes/formulas.php'); |
3 require_once($_SERVER['DOCUMENT_ROOT'].'/includes/formulas.php'); |
|
4 require_once($_SERVER['DOCUMENT_ROOT'].'/includes/constants.php'); |
4 require_once($_SERVER['DOCUMENT_ROOT'].'/fpdf/fpdf.php'); |
5 require_once($_SERVER['DOCUMENT_ROOT'].'/fpdf/fpdf.php'); |
5 |
6 |
6 |
7 |
7 $link = mysqli_connect(DBASE_HOST,DBASE_USER,DBASE_PASS,DBASE_NAME); |
8 $link = mysqli_connect(DBASE_HOST,DBASE_USER,DBASE_PASS,DBASE_NAME); |
8 if (! $link) { |
9 if (! $link) { |
63 function AddCol($width=-1, $caption='', $align='L') { |
64 function AddCol($width=-1, $caption='', $align='L') { |
64 $this->aCols[]=array('c'=>$caption,'w'=>$width,'a'=>$align); |
65 $this->aCols[]=array('c'=>$caption,'w'=>$width,'a'=>$align); |
65 } |
66 } |
66 |
67 |
67 function TableGlobal($row) { |
68 function TableGlobal($row) { |
|
69 global $recipetype; |
68 /* 2 Columns */ |
70 /* 2 Columns */ |
69 $recipetype = array( 'Extract', 'Deelmaisch', 'Mout' ); |
|
70 $vul = $this->w - $this->rMargin - $this->lMargin - 160; |
71 $vul = $this->w - $this->rMargin - $this->lMargin - 160; |
71 $cMargin=$this->cMargin; |
72 $cMargin=$this->cMargin; |
72 $this->cMargin=2; |
73 $this->cMargin=2; |
73 $this->TableX=$this->lMargin; |
74 $this->TableX=$this->lMargin; |
74 $this->SetFont('Helvetica','B',9); |
75 $this->SetFont('Helvetica','B',9); |
117 global $mashkg; |
118 global $mashkg; |
118 global $bottle_sugar; |
119 global $bottle_sugar; |
119 global $bottle_sugar_amount; |
120 global $bottle_sugar_amount; |
120 global $keg_sugar; |
121 global $keg_sugar; |
121 global $keg_sugar_amount; |
122 global $keg_sugar_amount; |
122 $added = array( 'Maischen', 'Koken 10 min', 'Vergisten', 'Nagisten/lageren', 'Bottelen', 'Op fust' ); |
123 global $added; |
123 $ftype = array( 'Mout', 'Suiker', 'Vloeibaar extract', 'Droog extract', 'Ongemout graan' ); |
124 global $fermentabletype; |
124 $mtype = array( 'Basismout', 'Geroosterde mout', 'Cara- of crystalmout', 'Geƫeste mout', 'Zuurmout', 'Speciale mout', 'Geen mout' ); |
125 global $graintype; |
125 $vul = $this->w - $this->rMargin - $this->lMargin - 125; |
126 $vul = $this->w - $this->rMargin - $this->lMargin - 125; |
126 $this->Ln(); |
127 $this->Ln(); |
127 $this->AddCol($vul,'Mout, granen en suikers','L'); |
128 $this->AddCol($vul,'Mout, granen en suikers','L'); |
128 $this->AddCol(15,'Procent','R'); |
129 $this->AddCol(15,'Procent','R'); |
129 $this->AddCol(15,'Opbr.','R'); |
130 $this->AddCol(15,'Opbr.','R'); |
158 $pSugar += $percent; |
159 $pSugar += $percent; |
159 if ($item['f_graintype'] == 2) // Crystal |
160 if ($item['f_graintype'] == 2) // Crystal |
160 $pCara += $percent; |
161 $pCara += $percent; |
161 |
162 |
162 if ($item['f_type'] == 0) |
163 if ($item['f_type'] == 0) |
163 $soort = iconv('UTF-8','windows-1252',$mtype[$item['f_graintype']]); |
164 $soort = iconv('UTF-8','windows-1252',$graintype[$item['f_graintype']]); |
164 else |
165 else |
165 $soort = iconv('UTF-8','windows-1252',$ftype[$item['f_type']]); |
166 $soort = iconv('UTF-8','windows-1252',$fermentabletype[$item['f_type']]); |
166 |
167 |
167 if ($item['f_added'] == 4) { |
168 if ($item['f_added'] == 4) { |
168 $bottle_sugar = $name; |
169 $bottle_sugar = $name; |
169 $bottle_sugar_amount = $amount; |
170 $bottle_sugar_amount = $amount; |
170 } |
171 } |
216 function TableHops($row) { |
217 function TableHops($row) { |
217 global $total_hops; |
218 global $total_hops; |
218 global $total_ibus; |
219 global $total_ibus; |
219 global $cost_hops; |
220 global $cost_hops; |
220 global $preboil_sg; |
221 global $preboil_sg; |
221 $hopform = array( 'Pellets', 'Plugs', 'Bellen', 'Hop nat', 'Cryo Hop' ); |
222 global $hopform; |
222 $hopuse = array( 'Maischen', 'First wort', 'Koken', 'Vlamuit', 'Whirlpool', 'Koudhop' ); |
223 global $hopuse; |
223 $vul = $this->w - $this->rMargin - $this->lMargin - 122; |
224 $vul = $this->w - $this->rMargin - $this->lMargin - 122; |
224 $this->Ln(); |
225 $this->Ln(); |
225 $this->AddCol($vul,'Hop','L'); |
226 $this->AddCol($vul,'Hop','L'); |
226 $this->AddCol(15,'Alpha','R'); |
227 $this->AddCol(15,'Alpha','R'); |
227 $this->AddCol(12,'IBU','R'); |
228 $this->AddCol(12,'IBU','R'); |
287 } |
288 } |
288 |
289 |
289 function TableYeasts($row) { |
290 function TableYeasts($row) { |
290 global $cost_yeasts; |
291 global $cost_yeasts; |
291 global $svg; |
292 global $svg; |
292 $yeastform = array( 'Vloeibaar', 'Droog', 'Schuine buis', 'Slurry', 'Ingevroren', 'Depot' ); |
293 global $yeastform; |
293 $yeastuse = array( 'Hoofdgisting', 'Nagisting', 'Lagering', 'Bottelen' ); |
294 global $yeastuse; |
294 $vul = $this->w - $this->rMargin - $this->lMargin - 110; |
295 $vul = $this->w - $this->rMargin - $this->lMargin - 110; |
295 $this->Ln(); |
296 $this->Ln(); |
296 $this->AddCol($vul,'Gist','L'); |
297 $this->AddCol($vul,'Gist','L'); |
297 $this->AddCol(15,'Attn','R'); |
298 $this->AddCol(15,'Attn','R'); |
298 $this->AddCol(25,'Soort','L'); |
299 $this->AddCol(25,'Soort','L'); |
320 |
321 |
321 if ($item['y_use'] == 0) // Primary |
322 if ($item['y_use'] == 0) // Primary |
322 $svg = $attenuation; |
323 $svg = $attenuation; |
323 if ($item['y_form'] == 0) // Liquid |
324 if ($item['y_form'] == 0) // Liquid |
324 $amount = sprintf("%.0f",floatval($item['y_amount']))." pak"; |
325 $amount = sprintf("%.0f",floatval($item['y_amount']))." pak"; |
325 else if ($item['y_form'] == 1) // Dry |
326 else if ($item['y_form'] == 1 || $item['y_form'] == 6) // Dry |
326 $amount = sprintf("%.1f",floatval($item['y_amount'])*1000)." gr"; |
327 $amount = sprintf("%.1f",floatval($item['y_amount'])*1000)." gr"; |
327 else |
328 else |
328 $amount = sprintf("%.0f",floatval($item['y_amount'])*1000)." ml"; |
329 $amount = sprintf("%.0f",floatval($item['y_amount'])*1000)." ml"; |
329 |
330 |
330 $this->Cell($vul,5,$laboratory.' '.$product_id.' ('.$name.')',0,0,'L',true); |
331 $this->Cell($vul,5,$laboratory.' '.$product_id.' ('.$name.')',0,0,'L',true); |
363 $this->Ln(); |
364 $this->Ln(); |
364 } |
365 } |
365 |
366 |
366 function TableMiscs($row) { |
367 function TableMiscs($row) { |
367 global $cost_miscs; |
368 global $cost_miscs; |
368 $misctype = array( 'Specerij', 'Kruid', 'Smaakstof', 'Klaringsmiddel', 'Brouwzout', 'Gistvoeding', 'Anders' ); |
369 global $misctype; |
369 $miscuse = array( 'Starter', 'Maischen', 'Koken', 'Hoofdvergisting', 'Nagisting/lagering', 'Bottelen' ); |
370 global $miscuse; |
370 $vul = $this->w - $this->rMargin - $this->lMargin - 95; |
371 $vul = $this->w - $this->rMargin - $this->lMargin - 95; |
371 if ($this->GetY() > 200) |
372 if ($this->GetY() > 200) |
372 $this->AddPage(); |
373 $this->AddPage(); |
373 else |
374 else |
374 $this->Ln(); |
375 $this->Ln(); |
733 $this->Cell($vul,5,'',0,0,'L',false); |
736 $this->Cell($vul,5,'',0,0,'L',false); |
734 $this->Cell(35,5,'Na koken rendement',0,0,'L',true); |
737 $this->Cell(35,5,'Na koken rendement',0,0,'L',true); |
735 $this->Cell(50,5,sprintf("%.1f", floatval($row['brew_aboil_efficiency']))."%",0,0,'L',true); |
738 $this->Cell(50,5,sprintf("%.1f", floatval($row['brew_aboil_efficiency']))."%",0,0,'L',true); |
736 $this->Ln(7); |
739 $this->Ln(7); |
737 |
740 |
738 $coolingtype = array( '-', 'Dompelkoeler', 'Tegenstroomkoeler', 'Au bain marie', 'Laten afkoelen' ); |
|
739 $this->SetX($this->TableX); |
741 $this->SetX($this->TableX); |
740 $this->Cell(35,5,'Spoelwater temperatuur',0,0,'L',true); |
742 $this->Cell(35,5,'Spoelwater temperatuur',0,0,'L',true); |
741 $this->Cell(50,5,sprintf("%.1f", $row['sparge_temp']).DEG.'C',0,0,'L',true); |
743 $this->Cell(50,5,sprintf("%.1f", $row['sparge_temp']).DEG.'C',0,0,'L',true); |
742 $this->Cell($vul,5,'',0,0,'L',false); |
744 $this->Cell($vul,5,'',0,0,'L',false); |
743 $this->Cell(35,5,'Koel methode',0,0,'L',true); |
745 $this->Cell(35,5,'Koel methode',0,0,'L',true); |
790 $this->Cell($vul,5,'',0,0,'L',false); |
792 $this->Cell($vul,5,'',0,0,'L',false); |
791 $this->Cell(35,5,'Densiteit in gistvat',0,0,'L',true); |
793 $this->Cell(35,5,'Densiteit in gistvat',0,0,'L',true); |
792 $this->Cell(50,5,density_str(floatval($row['brew_fermenter_sg'])),0,0,'L',true); |
794 $this->Cell(50,5,density_str(floatval($row['brew_fermenter_sg'])),0,0,'L',true); |
793 $this->Ln(7); |
795 $this->Ln(7); |
794 |
796 |
795 $aerationtype = array( 'Geen', 'Lucht', 'Zuurstof' ); |
|
796 $this->SetX($this->TableX); |
797 $this->SetX($this->TableX); |
797 $this->Cell(35,5,'Beluchten met',0,0,'L',true); |
798 $this->Cell(35,5,'Beluchten met',0,0,'L',true); |
798 $this->Cell(50,5,$aerationtype[$row['brew_aeration_type']],0,0,'L',true); |
799 $this->Cell(50,5,$aerationtype[$row['brew_aeration_type']],0,0,'L',true); |
799 $this->Cell($vul,5,'',0,0,'L',false); |
800 $this->Cell($vul,5,'',0,0,'L',false); |
800 $this->Cell(35,5,'Kleur in gistvat',0,0,'L',true); |
801 $this->Cell(35,5,'Kleur in gistvat',0,0,'L',true); |
1090 |
1091 |
1091 class PDF extends PDF_MySQL_Table { |
1092 class PDF extends PDF_MySQL_Table { |
1092 function Header() { |
1093 function Header() { |
1093 global $row; |
1094 global $row; |
1094 global $prdate; |
1095 global $prdate; |
1095 $stage = array( 'Plan', 'Wacht', 'Brouwen', 'Hoofdgisting', 'Nagisting', 'Lagering', 'Afvullen', 'Hergisten', 'Rijpen', 'Proeven', 'Gereed', 'Afgesloten' ); |
1096 global $stage; |
1096 $this->Image('images/logo.png',10,10,30); |
1097 $this->Image('images/logo.png',10,10,30); |
1097 // Title |
1098 // Title |
1098 $this->SetFont('Helvetica','B',18); |
1099 $this->SetFont('Helvetica','B',18); |
1099 $this->SetX(45); |
1100 $this->SetX(45); |
1100 $this->Cell(0,8,$row['code'].' '.$row['name'],0,1,'L'); |
1101 $this->Cell(0,8,$row['code'].' '.$row['name'],0,1,'L'); |