www/prod_checklist.php

changeset 398
7e8f1a7ddeeb
child 399
6f1cde4215d3
equal deleted inserted replaced
397:d3d2b277075b 398:7e8f1a7ddeeb
1 <?php
2 require_once($_SERVER['DOCUMENT_ROOT'].'/includes/global.inc.php');
3 require_once($_SERVER['DOCUMENT_ROOT'].'/includes/formulas.php');
4 require_once($_SERVER['DOCUMENT_ROOT'].'/fpdf/fpdf.php');
5
6
7 $link = mysqli_connect(DBASE_HOST,DBASE_USER,DBASE_PASS,DBASE_NAME);
8 if (! $link) {
9 die('Connect Error (' . mysqli_connect_errno() . ') ' . mysqli_connect_error());
10 }
11 if (! mysqli_set_charset($link, "utf8" )) {
12 echo "error";
13 return 1;
14 }
15
16 setlocale ( LC_ALL, 'nl_NL.UTF-8');
17 $record = $_GET["record"];
18 $result = mysqli_query($link, "SELECT * FROM products WHERE record='".$record."'");
19 $row = mysqli_fetch_array($result);
20
21 date_default_timezone_set('Europe/Amsterdam');
22 $prdate = date(DATE_RFC2822);
23
24
25 class PDF_MySQL_Table extends FPDF
26 {
27 function Checkheader($text) {
28 $this->SetFont('Arial','B',10);
29 $this->Cell(0, 4,$text,0,0,'L',true);
30 $this->SetFont('Arial','',10);
31 $this->Ln(6);
32 }
33
34 function Checkline($text) {
35 $this->Cell(2, 4,' ',0,0,'L',true);
36 $this->Cell(4, 4,' ',1,0,'L',true);
37 $this->Cell(0, 4,' '.$text,0,1,'L',true);
38 $this->Ln(1);
39 }
40
41 function Checklist($row) {
42
43 global $my_grain_absorbtion;
44 global $my_brix_correction;
45 $mashwater = 0;
46 $numsalts = 0;
47
48 $this->AddPage();
49 $this->SetFillColor(255,255,255);
50
51 $ferms = json_decode($row['json_fermentables'], true);
52 $hops = json_decode($row['json_hops'], true);
53 $miscs = json_decode($row['json_miscs'], true);
54 $yeasts = json_decode($row['json_yeasts'], true);
55
56 if ($row['starter_enable'] && $row['prop1_volume']) {
57 $this->Checkheader('Giststarter maken');
58 $days = 0;
59 $last = 0;
60 for ($i = 1; $i < 5; $i++) {
61 $pt = "prop".$i."_type";
62 $pv = "prop".$i."_volume";
63 if (floatval($row[$pv])) {
64 $last = $i;
65 if ($row[$pt] == 0)
66 $days += 2;
67 else if ($row[$pt] == 1)
68 $days += 4;
69 else
70 $days += 6;
71 }
72 }
73 $this->Checkline("begin ongeveer ".$days." dagen voor de brouwdag met de giststarter");
74 for ($i = 1; $i < 5; $i++) {
75 $pt = "prop".$i."_type";
76 $pv = "prop".$i."_volume";
77 if (floatval($row[$pv])) {
78 $s = "Starter stap ".$i.", van ".sprintf("%.3f",floatval($row[$pv]));
79 $s .= " liter maken met SG ".sprintf("%.3f",floatval($row['starter_sg']));
80 $this->Checkline($s);
81 if ($row[$pt] == 0) {
82 $s = "ongeveer 24 uur op een magneetroerder";
83 } else if ($row[$pt] == 1) {
84 $s = "enkele dagen regelmatig schudden";
85 } else {
86 $s = "bijna een week rustig laten staan";
87 }
88 $s .= " tot er voldoende gist is";
89 $this->Checkline($s);
90 if ($i < $last) {
91 $this->Checkline("starter minstens 24 uur in de koeling laten uitzakken");
92 $this->Checkline("starter uit de koelkast halen en afgieten");
93 } else {
94 $this->Checkline("starter in de koeling zetten tot de brouwdag");
95 $this->Checkline("starter op de brouwdag uit de koelkast halen en afgieten");
96 }
97 }
98 }
99 $this->Ln(5);
100 }
101
102 $this->Checkheader('Water en -behandeling');
103 if ($row['w1_name']) {
104 $this->Checkline(sprintf("%.1f",floatval($row['w1_amount'])).' liter water '.$row['w1_name']);
105 $mashwater += floatval($row['w1_amount']);
106 }
107 if ($row['w2_name']) {
108 $this->Checkline(sprintf("%.1f",floatval($row['w2_amount'])).' liter water '.$row['w2_name']);
109 $mashwater += floatval($row['w2_amount']);
110 }
111 foreach($miscs as $item) {
112 if ($item['m_type'] == 4) { // Only the water agents
113 $unit = ($item['m_amount_is_weight']) ? " gram ":" ml ";
114 $this->Checkline(sprintf("%.1f",floatval($item['m_amount'] * 1000)).$unit.$item['m_name']);
115 $numsalts++;
116 }
117 }
118 $this->Ln(5);
119
120 $this->Checkheader('Mout afwegen en schroten');
121 foreach($ferms as $item) {
122 if ($item['f_added'] == 0) { // to mash
123 $s = sprintf("%.3f",floatval($item['f_amount'])).' kg `';
124 $s .= iconv('UTF-8','windows-1252',$item['f_name']);
125 $s .= '` ('.iconv('UTF-8','windows-1252',$item['f_supplier']).')';
126 $this->Checkline($s);
127 }
128 }
129 $this->Checkline('mout schroten');
130 $this->Ln(5);
131
132 $this->Checkheader('Maischen');
133 $mvol = 0;
134 $msugars = 0; // mash sugars
135 $grainabsorbtion = 0;
136 $arr = json_decode($row['json_mashs'], true);
137 if (count($arr) > 0) {
138 $loop = 0;
139 foreach($arr as $item) {
140 if ($item['step_type'] == 0)
141 $mvol += $item['step_infuse_amount']; // We need this later.
142 if ($loop == 0) {
143 if ($item['step_type'] == 0)
144 $l = $item['step_infuse_amount'];
145 else
146 $l = $mashwater;
147 $s = sprintf("%.1f",$l).' liter water opwarmen tot ';
148 $s .= sprintf("%.1f",$item['step_temp']).' '.DEG.'C (';
149 $s .= sprintf("%.1f",kettle_cm($l,$row['eq_tun_volume'],$row['eq_tun_height']));
150 $s .= ' cm onder de rand)';
151 $this->Checkline($s);
152 if ($numsalts > 0)
153 $this->Checkline('brouwzouten en -zuren toevoegen');
154 $this->Checkline('mout storten en inmaischen');
155 foreach($hops as $item2) {
156 if ($item2['h_useat'] == 0) {
157 $s = sprintf("%.1f",$item2['h_amount']*1000).' gr `';
158 $s .= iconv('UTF-8','windows-1252',$item2['h_name']).'` toevoegen';
159 $this->Checkline($s);
160 }
161 }
162 foreach($miscs as $item3) {
163 if ($item3['m_use_use'] == 1 && $item3['m_type'] != 4) { // Only if not a water agent
164 $s = sprintf("%.2f",$item3['m_amount']*1000).' gr `';
165 $s .= iconv('UTF-8','windows-1252',$item3['m_name']).'` toevoegen';
166 $this->Checkline($s);
167 }
168 }
169 $this->Checkline($item['step_time'].' min. bij '.$item['step_temp'].' '.DEG.'C');
170 $this->Checkline('pH meten en bijstellen (doel pH beslag: '.sprintf("%.1f",$row['mash_ph']).' pH)');
171 } else {
172 if ($item['step_type'] == 0) { // Infusion
173 $s = 'toevoegen '.$item['step_infuse_amount'].' liter water van xx '.DEG.'C';
174 } else if ($item['step_type'] == 1) { // Direct heat
175 $s = 'opwarmen tot '.$item['step_temp'].' '.DEG.'C';
176 } else { // Decoction
177 $s = 'uitnemen, opwarmen, koken en terugstorten van '.$item['step_infuse_amount'].' liter deelbeslag';
178 }
179 $this->Checkline($s);
180 $this->Checkline($item['step_time'].' min. bij '.$item['step_temp'].' '.DEG.'C');
181 }
182 $loop++;
183 }
184 $est_mash_sg = 0;
185 foreach($ferms as $item) {
186 if ($item['f_added'] == 0) {
187 $d = $item['f_amount'] * ($item['f_yield'] / 100) * (1 - $item['f_moisture'] / 100);
188 $mvol += $item['f_amount'] * $item['f_moisture'] / 100;
189 $grainabsorbtion += $my_grain_absorbtion * $item['f_amount'];
190 $msugars += $d;
191 }
192 }
193 $sugardensity = 1.611;
194 $v = $msugars / $sugardensity + $mvol;
195 $plato = 1000 * $msugars / ($v * 10); // deg. Plato
196 $mash_sg = plato_to_sg($plato);
197 $this->Checkline('doel SG eind maischen: '.density_str($mash_sg));
198 }
199 if ($this->GetY() > 200)
200 $this->AddPage();
201 else
202 $this->Ln(5);
203
204 $acidtype = array( 'Melkzuur', 'Zoutzuur', 'Fosforzuur', 'Zwavelzuur' );
205 $this->Checkheader('Filteren en spoelen');
206 $s = sprintf("%.1f",$row['sparge_volume']).' liter spoelwater opwarmen tot '.sprintf("%.1f",$row['sparge_temp']).' '.DEG.'C';
207 $this->Checkline($s);
208 $s = 'spoelwater aanzuren tot pH <= '.sprintf("%.1f",$row['sparge_ph']).' met ';
209 $s .= sprintf("%.1f",$row['sparge_acid_amount']*1000).' ml. '.$acidtype[$row['sparge_acid_type']];
210 $this->Checkline($s);
211 $spoelw = ($row['boil_size'] - $mashwater + $grainabsorbtion + $row['eq_lauter_deadspace']) * 1.03; // A small heat correction
212 $this->Checkline('spoelen met ongeveer '.sprintf("%.1f",$spoelw).' liter spoelwater');
213 $s = 'doelvolume in kookketel: '.sprintf("%.1f",$row['boil_size'] * 1.04).' liter (';
214 $s .= sprintf("%.1f",kettle_cm($row['boil_size'] * 1.04,$row['eq_kettle_volume'],$row['eq_kettle_height'])).' cm onder de rand)';
215 $this->Checkline($s);
216 $pre_sg = estimate_sg($msugars * floatval($row['efficiency']) / 100,floatval($row['boil_size']));
217 $this->Checkline('doel SG in kookketel: '.density_str($pre_sg));
218 foreach($hops as $item2) {
219 if ($item2['h_useat'] == 1) {
220 $s = sprintf("%.1f",$item2['h_amount']*1000).' gr `';
221 $s .= iconv('UTF-8','windows-1252',$item2['h_name']).'` toevoegen na het spoelen';
222 $this->Checkline($s);
223 }
224 }
225 if ($this->GetY() > 200)
226 $this->AddPage();
227 else
228 $this->Ln(5);
229
230 $this->Checkheader('Koken');
231 $this->Checkline('totale kooktijd: '.$row['boil_time'].' min.');
232 for ($i = $row['boil_time']; $i >= 0; $i--) {
233 if ($i == 10) {
234 foreach($ferms as $item1) {
235 if ($item1['f_added'] == 1) {
236 $s = sprintf("%.3f",$item1['f_amount']).' kg `';
237 $s .= iconv('UTF-8','windows-1252',$item1['f_name']).'` bij 10 minuten voor einde koken';
238 $this->Checkline($s);
239 }
240 }
241 if ($row['brew_cooling_method'] == 1)
242 $this->Checkline('Plaats dompelkoeler bij 10 minuten voor einde koken');
243 }
244 foreach($hops as $item2) {
245 if (($item2['h_useat'] == 2 || $item2['h_useat'] == 3) && ($item2['h_time'] == $i)) {
246 $s = sprintf("%.1f",$item2['h_amount']*1000).' gr `';
247 $s .= iconv('UTF-8','windows-1252',$item2['h_name']).'` bij ';
248 if ($i > 0)
249 $s .= $i.' minuten voor einde koken';
250 else
251 $s .= 'vlamuit';
252 $this->Checkline($s);
253 }
254 }
255 foreach($miscs as $item3) {
256 if ($item3['m_use_use'] == 2 && $item3['m_time'] == $i) {
257 $s = sprintf("%.1f",$item3['m_amount']*1000).' gr `';
258 $s .= iconv('UTF-8','windows-1252',$item3['m_name']).'` bij ';
259 if ($i > 0)
260 $s .= $i.' minuten voor einde koken';
261 else
262 $s .= 'vlamuit';
263 $this->Checkline($s);
264 }
265 }
266
267 }
268 $s = 'doelvolume einde koken: '.sprintf("%.1f",$row['batch_size']*1.04).' liter (';
269 $s .= sprintf("%.1f",kettle_cm($row['batch_size']*1.04,$row['eq_kettle_volume'],$row['eq_kettle_height']));
270 $s .= ' cm onder de rand)';
271 $this->Checkline($s);
272 $this->Checkline('doel SG einde koken: '.density_str($row['est_og']));
273 if ($this->GetY() > 200)
274 $this->AddPage();
275 else
276 $this->Ln(5);
277
278 if (($row['brew_whirlpool9'] + $row['brew_whirlpool7'] + $row['brew_whirlpool6'] + $row['brew_whirlpool2']) > 0) {
279 $this->Checkheader('Whirlpool en koelen');
280 if ($row['brew_whirlpool9'] > 0) {
281 $s = 'Whirlpool voor '.$row['brew_whirlpool9'].' min. Temperatuur boven 85 '.DEG.'C houden';
282 $this->Checkline($s);
283 }
284 if ($row['brew_whirlpool7'] > 0) {
285 $this->Checkline('koelen tot 79 '.DEG.'C');
286 $s = 'Whirlpool voor '.$row['brew_whirlpool7'].' min. Temperatuur tussen 72 en 79 '.DEG.'C houden';
287 $this->Checkline($s);
288 }
289 if ($row['brew_whirlpool6'] > 0) {
290 $this->Checkline('koelen tot 66 '.DEG.'C');
291 $s = 'Whirlpool voor '.$row['brew_whirlpool6'].' min. Temperatuur tussen 60 en 66 '.DEG.'C houden';
292 $this->Checkline($s);
293 }
294 foreach($hops as $item2) {
295 if ($item2['h_useat'] == 4) {
296 $s = sprintf("%.1f",$item2['h_amount']*1000).' gr `';
297 $s .= iconv('UTF-8','windows-1252',$item2['h_name']).'` voor ';
298 $s .= $item2['h_time'].' minuten in de whirlpool';
299 $this->Checkline($s);
300 }
301 }
302 $this->Checkline('koelen tot '.sprintf("%.1f",$row['brew_cooling_to']).' '.DEG.'C');
303 if ($row['brew_whirlpool2'] > 0) {
304 $s = 'Whirlpool voor '.$row['brew_whirlpool2'].' min.';
305 $this->Checkline($s);
306 }
307 } else {
308 $this->Checkheader('Koelen');
309 $this->Checkline('koelen tot '.sprintf("%.1f",$row['brew_cooling_to']).' '.DEG.'C');
310 }
311 $this->Checkline('gistvat ontsmetten en evt. pomp en slangen ontsmetten');
312 $this->Checkline('wort naar gistvat overbrengen');
313 if ($this->GetY() > (300 - (5 * $lines)))
314 $this->AddPage();
315 else
316 $this->Ln(5);
317
318 $this->Checkheader('Gist enten');
319 $dry = 0;
320 foreach ($yeasts as $item) {
321 if ($item['y_use'] == 0) { // primary
322 if ($item['y_form'] == 0) { // Liquid
323 $this->Checkline($item['y_amount'].' pak '.$item['y_product_id'].', '.$item['y_name'].' gist');
324 } else if ($item['y_form'] == 1) { // Dry
325 $s = sprintf("%.1f",$item['y_amount']*1000).' gram '.$item['y_product_id'].', '.$item['y_name'];
326 $s .= ' gist';
327 $dry += $item['y_amount']*10000;
328 $this->Checkline($s);
329 } else { // Slant/Culture/Frozen/Bottle
330 $s = sprintf("%.0f",$item['y_amount']*1000).' ml '.$item['y_product_id'].', '.$item['y_name'].' gist';
331 $this->Checkline($s);
332 }
333 }
334 }
335 if ($dry > 0) {
336 $this->Checkline(' gist hydrateren in '.$dry.' ml gedesinfecteerd water van 32 '.DEG.'C');
337 $this->Checkline(' 15 minuten laten staan bij 32 '.DEG.'C');
338 $this->Checkline(' gistmengsel voorzichtig roeren en laten afkoelen tot temperatuur wort');
339 $this->Checkline(' gist toevoegen');
340 $this->Checkline('Of');
341 $this->Checkline(' gist rechtstreeks over het wort strooien');
342 } else {
343 if ($row['starter_enable'] && $row['prop1_volume'])
344 $this->Checkline('giststarter toevoegen');
345 else
346 $this->Checkline('gist toevoegen');
347 }
348 if ($row['brew_fermenter_extrawater'] > 0)
349 $this->Checkline(sprintf("%.1f", $row['brew_fermenter_extrawater']).' liter water toevoegen in gistvat');
350 if ($row['brew_aeration_type'] > 0) {
351 $s = 'wort '.$row['brew_aeration_time'].' minuten beluchten met ';
352 $s .= ($row['brew_aeration_type'] == 1) ? "lucht":"zuurstof";
353 $this->Checkline($s);
354 }
355 if ($this->GetY() > 200)
356 $this->AddPage();
357 else
358 $this->Ln(5);
359
360 $this->Checkheader('Vergisting starten');
361 $this->Checkline('klimaatkast instellen op '.sprintf("%.1f",$row['brew_cooling_to']).' '.DEG.'C');
362
363 /*
364 * During primary fermentation: fermentables, misc
365 */
366 $lines = 0;
367 foreach($ferms as $item1) {
368 if ($item1['f_added'] == 2)
369 $lines++;
370 }
371 foreach($miscs as $item3) {
372 if ($item3['m_use_use'] == 3)
373 $lines++;
374 }
375 if ($lines) {
376 if ($this->GetY() > (270 - (5 * $lines)))
377 $this->AddPage();
378 else
379 $this->Ln(5);
380 $this->Checkheader('Hoofdgisting');
381 }
382 foreach($ferms as $item1) {
383 if ($item1['f_added'] == 2) {
384 $s = sprintf("%.3f",$item1['f_amount']).' kg `';
385 $s .= iconv('UTF-8','windows-1252',$item1['f_name']).'` op dag 3 of 4 toevoegen';
386 $this->Checkline($s);
387 }
388 }
389 foreach($miscs as $item3) {
390 if ($item3['m_use_use'] == 3) {
391 $s = sprintf("%.1f",$item3['m_amount']*1000).' gr `';
392 $s .= iconv('UTF-8','windows-1252',$item3['m_name']).'` op dag 3 of 4 toevoegen';
393 $this->Checkline($s);
394 }
395 }
396
397 /*
398 * During secondary fermentation: yeast
399 */
400 $lines = 0;
401 foreach ($yeasts as $item4) {
402 if ($item4['y_use'] == 1)
403 $lines++;
404 }
405 if ($lines) {
406 if ($this->GetY() > (270 - (5 * $lines)))
407 $this->AddPage();
408 else
409 $this->Ln(5);
410 $this->Checkheader('Nagisting');
411 }
412 foreach ($yeasts as $item4) {
413 if ($item4['y_use'] == 1) {
414 if ($item4['y_form'] == 0) { // Liquid
415 $this->Checkline($item4['y_amount'].' pak '.$item4['y_product_id'].', '.$item4['y_name'].' gist (eventueel met starter)');
416 } else if ($item['y_form'] == 1) { // Dry
417 $s = sprintf("%.1f",$item4['y_amount']*1000).' gram '.$item4['y_product_id'].', '.$item4['y_name'];
418 $s .= ' gist';
419 $this->Checkline($s);
420 } else { // Slant/Culture/Frozen/Bottle
421 $s = sprintf("%.0f",$item4['y_amount']*1000).' ml '.$item4['y_product_id'].', '.$item4['y_name'].' gist (eventueel met starter)';
422 $this->Checkline($s);
423 }
424 }
425 }
426
427 /*
428 * During tertiary fermentation: fermentables, hop, yeast, misc
429 */
430 $lines = 0;
431 foreach($ferms as $item1) {
432 if ($item1['f_added'] == 3)
433 $lines++;
434 }
435 foreach($hops as $item2) {
436 if ($item2['h_useat'] == 5)
437 $lines++;
438 }
439 foreach ($yeasts as $item4) {
440 if ($item4['y_use'] == 2)
441 $lines++;
442 }
443 foreach($miscs as $item3) {
444 if ($item3['m_use_use'] == 4)
445 $lines++;
446 }
447 if ($lines) {
448 if ($this->GetY() > (270 - (5 * $lines)))
449 $this->AddPage();
450 else
451 $this->Ln(5);
452 $this->Checkheader('Lagering');
453 }
454 foreach($ferms as $item1) {
455 if ($item1['f_added'] == 3) {
456 $s = sprintf("%.3f",$item1['f_amount']).' kg `';
457 $s .= iconv('UTF-8','windows-1252',$item1['f_name']).'` toevoegen';
458 $this->Checkline($s);
459 }
460 }
461 foreach($hops as $item2) {
462 if ($item2['h_useat'] == 5) {
463 $s = sprintf("%.1f",$item2['h_amount']*1000).' gr `';
464 $s .= iconv('UTF-8','windows-1252',$item2['h_name']).'` voor';
465 $s .= sprintf("%.0f",$item2['h_time']/1440).' dagen toevoegen';
466 $this->Checkline($s);
467 }
468 }
469 foreach ($yeasts as $item4) {
470 if ($item4['y_use'] == 2) {
471 if ($item4['y_form'] == 0) { // Liquid
472 $s = $item4['y_amount'].' pak '.$item4['y_product_id'].', '.$item4['y_name'].' gist (eventueel met starter)';
473 } else if ($item4['y_form'] == 1) { // Dry
474 $s = sprintf("%.1f",$item4['y_amount']*1000).' gram '.$item4['y_product_id'].', '.$item4['y_name'];
475 $s .= ' gist';
476 } else { // Slant/Culture/Frozen/Bottle
477 $s = sprintf("%.0f",$item4['y_amount']*1000).' ml '.$item4['y_product_id'].', '.$item4['y_name'];
478 $s .= ' gist (eventueel met starter)';
479 }
480 $this->Checkline($s);
481 }
482 }
483 foreach($miscs as $item3) {
484 if ($item3['m_use_use'] == 4) {
485 $s = sprintf("%.1f",$item3['m_amount']*1000).' gr `';
486 $s .= iconv('UTF-8','windows-1252',$item3['m_name']).'` voor ';
487 $s .= sprintf("%.0f",$item3['m_time']/1440).' dagen toevoegen';
488 $this->Checkline($s);
489 }
490 }
491
492 /*
493 * During packaging: fermentables, yeast, misc
494 */
495 $lines = 0;
496 foreach($ferms as $item1) {
497 if ($item1['f_added'] == 4)
498 $lines++;
499 }
500 $yeasts = json_decode($row['json_yeasts'], true);
501 foreach ($yeasts as $item4) {
502 if ($item4['y_use'] == 3)
503 $lines++;
504 }
505 $miscs = json_decode($row['json_miscs'], true);
506 foreach($miscs as $item3) {
507 if ($item3['m_use_use'] == 5)
508 $lines++;
509 }
510 if ($lines) {
511 if ($this->GetY() > (270 - (5 * $lines)))
512 $this->AddPage();
513 else
514 $this->Ln(5);
515 $this->Checkheader('Verpakken');
516 }
517 foreach($ferms as $item1) {
518 if ($item1['f_added'] == 4) {
519 $s = sprintf("%.3f",$item1['f_amount']).' kg `';
520 $s .= iconv('UTF-8','windows-1252',$item1['f_name']).'` bij bottelen';
521 $this->Checkline($s);
522 }
523 }
524 foreach ($yeasts as $item4) {
525 if ($item4['y_use'] == 3) {
526 if ($item4['y_form'] == 0) { // Liquid
527 $s = '`'.$item4['y_product_id'].', '.$item4['y_name'];
528 } else if ($item4['y_form'] == 1) { // Dry
529 $s = sprintf("%.1f",$item4['y_amount']*1000).' gram `'.$item4['y_product_id'].', '.$item4['y_name'];
530 } else { // Slant/Culture/Frozen/Bottle
531 $s = sprintf("%.0f",$item4['y_amount']*1000).' ml `'.$item4['y_product_id'].', '.$item4['y_name'];
532 }
533 $s .= '` als bottelgist';
534 $this->Checkline($s);
535 }
536 }
537 foreach($miscs as $item3) {
538 if ($item3['m_use_use'] == 5) {
539 $s = sprintf("%.1f",$item3['m_amount']*1000).' gr `';
540 $s .= iconv('UTF-8','windows-1252',$item3['m_name']).'` bij bottelen toevoegen';
541 $this->Checkline($s);
542 }
543 }
544 }
545
546 }
547
548
549
550 class PDF extends PDF_MySQL_Table {
551 function Header() {
552 global $row;
553 global $prdate;
554 $stage = array( 'Plan', 'Wacht', 'Brouwen', 'Hoofdgisting', 'Nagisting', 'Lagering', 'Afvullen', 'Hergisten', 'Rijpen', 'Proeven', 'Gereed', 'Afgesloten' );
555 $this->Image('images/logo.png',10,10,30);
556 // Title
557 $this->SetFont('Helvetica','B',18);
558 $this->SetX(45);
559 $this->Cell(0,8,$row['code'].' '.$row['name'],0,1,'L');
560 $this->Ln(1);
561 $this->SetFont('Helvetica','',10);
562 $this->SetX(45);
563 $this->Cell(17,5,'Datum:',0,0,'L');
564 $this->Cell(0,5,$prdate,0,1,'L');
565 $this->SetX(45);
566 $this->Cell(17,5,'Stijl:',0,0,'L');
567 $this->Cell(0,5,$row['st_name'],0,1,'L');
568 $this->SetX(45);
569 $this->Cell(17,5,'Fase:',0,0,'L');
570 $this->Cell(0,5,$stage[$row['stage']],0,1,'L');
571 $this->Ln(6);
572 // Ensure table header is printed
573 parent::Header();
574 }
575 }
576
577
578 /*
579 * Generate checklist PDF from recipe data
580 */
581 $pdf = new PDF();
582 $pdf->Checklist($row);
583 $pdf->Output();

mercurial