32 $yeastform = array( 'Liquid', 'Dry', 'Slant', 'Culture', 'Frozen', 'Bottle', 'Dry' ); |
32 $yeastform = array( 'Liquid', 'Dry', 'Slant', 'Culture', 'Frozen', 'Bottle', 'Dry' ); |
33 $yeastuse = array( 'Primary', 'Secondary', 'Tertiary', 'Bottle' ); |
33 $yeastuse = array( 'Primary', 'Secondary', 'Tertiary', 'Bottle' ); |
34 $misctype = array( 'Spice', 'Herb', 'Flavor', 'Fining', 'Water agent', 'Yeast nutrient', 'Other' ); |
34 $misctype = array( 'Spice', 'Herb', 'Flavor', 'Fining', 'Water agent', 'Yeast nutrient', 'Other' ); |
35 $miscuse = array( 'Starter', 'Mash', 'Boil', 'Primary', 'Secondary', 'Bottling' ); |
35 $miscuse = array( 'Starter', 'Mash', 'Boil', 'Primary', 'Secondary', 'Bottling' ); |
36 $mashsteptype = array( 'Infusion', 'Temperature', 'Decoction' ); |
36 $mashsteptype = array( 'Infusion', 'Temperature', 'Decoction' ); |
|
37 $colormethod = array( 'Morey', 'Mosher', 'Daniels', 'Halberstadt', 'Naudts' ); |
|
38 $ibumethod = array( 'Tinseth', 'Rager', 'Daniels', 'Garetz', 'Mosher', 'Noonan' ); |
37 |
39 |
38 |
40 |
39 /* |
41 /* |
40 * Create beerxml output |
42 * Create beerxml output |
41 */ |
43 */ |
105 |
107 |
106 if (floatval($row['est_color']) > 0) { |
108 if (floatval($row['est_color']) > 0) { |
107 xmlwriter_start_element($xw, 'EST_COLOR'); |
109 xmlwriter_start_element($xw, 'EST_COLOR'); |
108 xmlwriter_text($xw, sprintf("%.1f",floatval($row['est_color']))); |
110 xmlwriter_text($xw, sprintf("%.1f",floatval($row['est_color']))); |
109 xmlwriter_end_element($xw); |
111 xmlwriter_end_element($xw); |
|
112 xmlwriter_start_element($xw, 'COLOR_METHOD'); |
|
113 xmlwriter_text($xw, $colormethod[$row['color_method']]); |
|
114 xmlwriter_end_element($xw); |
110 } |
115 } |
111 |
116 |
112 if (floatval($row['est_ibu']) > 0) { |
117 if (floatval($row['est_ibu']) > 0) { |
113 xmlwriter_start_element($xw, 'EST_IBU'); |
118 xmlwriter_start_element($xw, 'EST_IBU'); |
114 xmlwriter_text($xw, sprintf("%.1f",floatval($row['est_ibu']))); |
119 xmlwriter_text($xw, sprintf("%.1f",floatval($row['est_ibu']))); |
115 xmlwriter_end_element($xw); |
120 xmlwriter_end_element($xw); |
|
121 xmlwriter_start_element($xw, 'IBU_METHOD'); |
|
122 xmlwriter_text($xw, $ibumethod[$row['ibu_method']]); |
|
123 xmlwriter_end_element($xw); |
116 } |
124 } |
117 |
125 |
118 |
126 |
119 // Style |
127 // Style |
120 xmlwriter_start_element($xw, 'STYLE'); |
128 xmlwriter_start_element($xw, 'STYLE'); |
477 |
485 |
478 xmlwriter_start_element($xw, 'CALCIUM'); |
486 xmlwriter_start_element($xw, 'CALCIUM'); |
479 xmlwriter_text($xw, sprintf("%.2f",floatval($row['w1_calcium']))); |
487 xmlwriter_text($xw, sprintf("%.2f",floatval($row['w1_calcium']))); |
480 xmlwriter_end_element($xw); |
488 xmlwriter_end_element($xw); |
481 |
489 |
|
490 xmlwriter_start_element($xw, 'MAGNESIUM'); |
|
491 xmlwriter_text($xw, sprintf("%.2f",floatval($row['w1_magnesium']))); |
|
492 xmlwriter_end_element($xw); |
|
493 |
482 xmlwriter_start_element($xw, 'BICARBONATE'); |
494 xmlwriter_start_element($xw, 'BICARBONATE'); |
483 xmlwriter_text($xw, sprintf("%.2f",floatval($row['w1_total_alkalinity']) * 1.22)); |
495 xmlwriter_text($xw, sprintf("%.2f",floatval($row['w1_total_alkalinity']) * 1.22)); |
484 xmlwriter_end_element($xw); |
496 xmlwriter_end_element($xw); |
485 |
497 |
486 xmlwriter_start_element($xw, 'SULFATE'); |
498 xmlwriter_start_element($xw, 'SULFATE'); |
520 xmlwriter_text($xw, sprintf("%.2f",floatval($row['w2_amount']))); |
532 xmlwriter_text($xw, sprintf("%.2f",floatval($row['w2_amount']))); |
521 xmlwriter_end_element($xw); |
533 xmlwriter_end_element($xw); |
522 |
534 |
523 xmlwriter_start_element($xw, 'CALCIUM'); |
535 xmlwriter_start_element($xw, 'CALCIUM'); |
524 xmlwriter_text($xw, sprintf("%.2f",floatval($row['w2_calcium']))); |
536 xmlwriter_text($xw, sprintf("%.2f",floatval($row['w2_calcium']))); |
|
537 xmlwriter_end_element($xw); |
|
538 |
|
539 xmlwriter_start_element($xw, 'MAGNESIUM'); |
|
540 xmlwriter_text($xw, sprintf("%.2f",floatval($row['w2_magnesium']))); |
525 xmlwriter_end_element($xw); |
541 xmlwriter_end_element($xw); |
526 |
542 |
527 xmlwriter_start_element($xw, 'BICARBONATE'); |
543 xmlwriter_start_element($xw, 'BICARBONATE'); |
528 xmlwriter_text($xw, sprintf("%.2f",floatval($row['w2_total_alkalinity']) * 1.22)); |
544 xmlwriter_text($xw, sprintf("%.2f",floatval($row['w2_total_alkalinity']) * 1.22)); |
529 xmlwriter_end_element($xw); |
545 xmlwriter_end_element($xw); |