Fri, 17 Jun 2022 16:18:04 +0200
Version 0.3.39. Log ispindel, fermenters and co2pressure in MySQL. Limit logging to at most once per 10 minutes.
563
acdd54144838
Added export inventory and profiles in beerxml format. Small fixes in beerxml recipe and product export.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1 | <?php |
acdd54144838
Added export inventory and profiles in beerxml format. Small fixes in beerxml recipe and product export.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
2 | require_once($_SERVER['DOCUMENT_ROOT'].'/config.php'); |
acdd54144838
Added export inventory and profiles in beerxml format. Small fixes in beerxml recipe and product export.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
3 | require_once($_SERVER['DOCUMENT_ROOT'].'/includes/formulas.php'); |
acdd54144838
Added export inventory and profiles in beerxml format. Small fixes in beerxml recipe and product export.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
4 | |
acdd54144838
Added export inventory and profiles in beerxml format. Small fixes in beerxml recipe and product export.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
5 | |
acdd54144838
Added export inventory and profiles in beerxml format. Small fixes in beerxml recipe and product export.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
6 | $link = mysqli_connect(DBASE_HOST,DBASE_USER,DBASE_PASS,DBASE_NAME); |
acdd54144838
Added export inventory and profiles in beerxml format. Small fixes in beerxml recipe and product export.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
7 | if (! $link) { |
acdd54144838
Added export inventory and profiles in beerxml format. Small fixes in beerxml recipe and product export.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
8 | die('Connect Error (' . mysqli_connect_errno() . ') ' . mysqli_connect_error()); |
acdd54144838
Added export inventory and profiles in beerxml format. Small fixes in beerxml recipe and product export.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
9 | } |
acdd54144838
Added export inventory and profiles in beerxml format. Small fixes in beerxml recipe and product export.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
10 | if (! mysqli_set_charset($link, "utf8" )) { |
acdd54144838
Added export inventory and profiles in beerxml format. Small fixes in beerxml recipe and product export.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
11 | echo "error"; |
acdd54144838
Added export inventory and profiles in beerxml format. Small fixes in beerxml recipe and product export.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
12 | return 1; |
acdd54144838
Added export inventory and profiles in beerxml format. Small fixes in beerxml recipe and product export.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
13 | } |
acdd54144838
Added export inventory and profiles in beerxml format. Small fixes in beerxml recipe and product export.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
14 | |
acdd54144838
Added export inventory and profiles in beerxml format. Small fixes in beerxml recipe and product export.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
15 | $result = mysqli_query($link, "SELECT * FROM inventory_hops ORDER BY origin,name"); |
acdd54144838
Added export inventory and profiles in beerxml format. Small fixes in beerxml recipe and product export.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
16 | |
acdd54144838
Added export inventory and profiles in beerxml format. Small fixes in beerxml recipe and product export.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
17 | |
acdd54144838
Added export inventory and profiles in beerxml format. Small fixes in beerxml recipe and product export.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
18 | $hoptype = array( 'Bittering', 'Aroma', 'Both' ); |
acdd54144838
Added export inventory and profiles in beerxml format. Small fixes in beerxml recipe and product export.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
19 | $hopform = array( 'Pellet', 'Plug', 'Leaf', 'Leaf', 'Leaf' ); |
acdd54144838
Added export inventory and profiles in beerxml format. Small fixes in beerxml recipe and product export.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
20 | |
acdd54144838
Added export inventory and profiles in beerxml format. Small fixes in beerxml recipe and product export.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
21 | |
acdd54144838
Added export inventory and profiles in beerxml format. Small fixes in beerxml recipe and product export.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
22 | |
acdd54144838
Added export inventory and profiles in beerxml format. Small fixes in beerxml recipe and product export.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
23 | /* |
acdd54144838
Added export inventory and profiles in beerxml format. Small fixes in beerxml recipe and product export.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
24 | * Create beerxml output |
acdd54144838
Added export inventory and profiles in beerxml format. Small fixes in beerxml recipe and product export.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
25 | */ |
acdd54144838
Added export inventory and profiles in beerxml format. Small fixes in beerxml recipe and product export.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
26 | $xw = xmlwriter_open_memory(); |
acdd54144838
Added export inventory and profiles in beerxml format. Small fixes in beerxml recipe and product export.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
27 | xmlwriter_set_indent($xw, 1); |
acdd54144838
Added export inventory and profiles in beerxml format. Small fixes in beerxml recipe and product export.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
28 | $res = xmlwriter_set_indent_string($xw, ' '); |
acdd54144838
Added export inventory and profiles in beerxml format. Small fixes in beerxml recipe and product export.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
29 | |
acdd54144838
Added export inventory and profiles in beerxml format. Small fixes in beerxml recipe and product export.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
30 | xmlwriter_start_document($xw, '1.0', 'UTF-8'); |
acdd54144838
Added export inventory and profiles in beerxml format. Small fixes in beerxml recipe and product export.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
31 | |
acdd54144838
Added export inventory and profiles in beerxml format. Small fixes in beerxml recipe and product export.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
32 | |
acdd54144838
Added export inventory and profiles in beerxml format. Small fixes in beerxml recipe and product export.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
33 | xmlwriter_start_element($xw, 'HOPS'); |
acdd54144838
Added export inventory and profiles in beerxml format. Small fixes in beerxml recipe and product export.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
34 | while ($row = mysqli_fetch_array($result)) { |
acdd54144838
Added export inventory and profiles in beerxml format. Small fixes in beerxml recipe and product export.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
35 | |
acdd54144838
Added export inventory and profiles in beerxml format. Small fixes in beerxml recipe and product export.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
36 | xmlwriter_start_element($xw, 'HOP'); |
acdd54144838
Added export inventory and profiles in beerxml format. Small fixes in beerxml recipe and product export.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
37 | |
acdd54144838
Added export inventory and profiles in beerxml format. Small fixes in beerxml recipe and product export.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
38 | xmlwriter_start_element($xw, 'VERSION'); |
acdd54144838
Added export inventory and profiles in beerxml format. Small fixes in beerxml recipe and product export.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
39 | xmlwriter_text($xw, '1'); |
acdd54144838
Added export inventory and profiles in beerxml format. Small fixes in beerxml recipe and product export.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
40 | xmlwriter_end_element($xw); |
acdd54144838
Added export inventory and profiles in beerxml format. Small fixes in beerxml recipe and product export.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
41 | |
acdd54144838
Added export inventory and profiles in beerxml format. Small fixes in beerxml recipe and product export.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
42 | xmlwriter_start_element($xw, 'NAME'); |
acdd54144838
Added export inventory and profiles in beerxml format. Small fixes in beerxml recipe and product export.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
43 | xmlwriter_text($xw, $row['name']); |
acdd54144838
Added export inventory and profiles in beerxml format. Small fixes in beerxml recipe and product export.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
44 | xmlwriter_end_element($xw); |
acdd54144838
Added export inventory and profiles in beerxml format. Small fixes in beerxml recipe and product export.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
45 | |
acdd54144838
Added export inventory and profiles in beerxml format. Small fixes in beerxml recipe and product export.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
46 | if (strlen($row['notes'])) { |
acdd54144838
Added export inventory and profiles in beerxml format. Small fixes in beerxml recipe and product export.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
47 | xmlwriter_start_element($xw, 'NOTES'); |
acdd54144838
Added export inventory and profiles in beerxml format. Small fixes in beerxml recipe and product export.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
48 | xmlwriter_text($xw, $row['notes']); |
acdd54144838
Added export inventory and profiles in beerxml format. Small fixes in beerxml recipe and product export.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
49 | xmlwriter_end_element($xw); |
acdd54144838
Added export inventory and profiles in beerxml format. Small fixes in beerxml recipe and product export.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
50 | } |
acdd54144838
Added export inventory and profiles in beerxml format. Small fixes in beerxml recipe and product export.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
51 | |
acdd54144838
Added export inventory and profiles in beerxml format. Small fixes in beerxml recipe and product export.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
52 | xmlwriter_start_element($xw, 'ALWAYS_ON_STOCK'); |
acdd54144838
Added export inventory and profiles in beerxml format. Small fixes in beerxml recipe and product export.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
53 | ($row['always_on_stock']) ? xmlwriter_text($xw, 'TRUE') : xmlwriter_text($xw, 'FALSE'); |
acdd54144838
Added export inventory and profiles in beerxml format. Small fixes in beerxml recipe and product export.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
54 | xmlwriter_end_element($xw); |
acdd54144838
Added export inventory and profiles in beerxml format. Small fixes in beerxml recipe and product export.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
55 | |
acdd54144838
Added export inventory and profiles in beerxml format. Small fixes in beerxml recipe and product export.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
56 | xmlwriter_start_element($xw, 'ALPHA'); |
acdd54144838
Added export inventory and profiles in beerxml format. Small fixes in beerxml recipe and product export.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
57 | xmlwriter_text($xw, sprintf("%.4f",floatval($row['alpha']))); |
acdd54144838
Added export inventory and profiles in beerxml format. Small fixes in beerxml recipe and product export.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
58 | xmlwriter_end_element($xw); |
acdd54144838
Added export inventory and profiles in beerxml format. Small fixes in beerxml recipe and product export.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
59 | |
acdd54144838
Added export inventory and profiles in beerxml format. Small fixes in beerxml recipe and product export.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
60 | xmlwriter_start_element($xw, 'BETA'); |
acdd54144838
Added export inventory and profiles in beerxml format. Small fixes in beerxml recipe and product export.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
61 | xmlwriter_text($xw, sprintf("%.4f",floatval($row['beta']))); |
acdd54144838
Added export inventory and profiles in beerxml format. Small fixes in beerxml recipe and product export.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
62 | xmlwriter_end_element($xw); |
acdd54144838
Added export inventory and profiles in beerxml format. Small fixes in beerxml recipe and product export.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
63 | |
acdd54144838
Added export inventory and profiles in beerxml format. Small fixes in beerxml recipe and product export.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
64 | xmlwriter_start_element($xw, 'HUMULENE'); |
acdd54144838
Added export inventory and profiles in beerxml format. Small fixes in beerxml recipe and product export.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
65 | xmlwriter_text($xw, sprintf("%.4f",floatval($row['humulene']))); |
acdd54144838
Added export inventory and profiles in beerxml format. Small fixes in beerxml recipe and product export.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
66 | xmlwriter_end_element($xw); |
acdd54144838
Added export inventory and profiles in beerxml format. Small fixes in beerxml recipe and product export.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
67 | |
acdd54144838
Added export inventory and profiles in beerxml format. Small fixes in beerxml recipe and product export.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
68 | xmlwriter_start_element($xw, 'CAROPHYLLENE'); |
acdd54144838
Added export inventory and profiles in beerxml format. Small fixes in beerxml recipe and product export.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
69 | xmlwriter_text($xw, sprintf("%.4f",floatval($row['caryophyllene']))); |
acdd54144838
Added export inventory and profiles in beerxml format. Small fixes in beerxml recipe and product export.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
70 | xmlwriter_end_element($xw); |
acdd54144838
Added export inventory and profiles in beerxml format. Small fixes in beerxml recipe and product export.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
71 | |
acdd54144838
Added export inventory and profiles in beerxml format. Small fixes in beerxml recipe and product export.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
72 | xmlwriter_start_element($xw, 'COHUMULONE'); |
acdd54144838
Added export inventory and profiles in beerxml format. Small fixes in beerxml recipe and product export.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
73 | xmlwriter_text($xw, sprintf("%.4f",floatval($row['cohumulone']))); |
acdd54144838
Added export inventory and profiles in beerxml format. Small fixes in beerxml recipe and product export.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
74 | xmlwriter_end_element($xw); |
acdd54144838
Added export inventory and profiles in beerxml format. Small fixes in beerxml recipe and product export.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
75 | |
acdd54144838
Added export inventory and profiles in beerxml format. Small fixes in beerxml recipe and product export.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
76 | xmlwriter_start_element($xw, 'MYRCENE'); |
acdd54144838
Added export inventory and profiles in beerxml format. Small fixes in beerxml recipe and product export.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
77 | xmlwriter_text($xw, sprintf("%.4f",floatval($row['myrcene']))); |
acdd54144838
Added export inventory and profiles in beerxml format. Small fixes in beerxml recipe and product export.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
78 | xmlwriter_end_element($xw); |
acdd54144838
Added export inventory and profiles in beerxml format. Small fixes in beerxml recipe and product export.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
79 | |
acdd54144838
Added export inventory and profiles in beerxml format. Small fixes in beerxml recipe and product export.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
80 | xmlwriter_start_element($xw, 'TOTAL_OIL'); |
acdd54144838
Added export inventory and profiles in beerxml format. Small fixes in beerxml recipe and product export.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
81 | xmlwriter_text($xw, sprintf("%.4f",floatval($row['total_oil']))); |
acdd54144838
Added export inventory and profiles in beerxml format. Small fixes in beerxml recipe and product export.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
82 | xmlwriter_end_element($xw); |
acdd54144838
Added export inventory and profiles in beerxml format. Small fixes in beerxml recipe and product export.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
83 | |
acdd54144838
Added export inventory and profiles in beerxml format. Small fixes in beerxml recipe and product export.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
84 | xmlwriter_start_element($xw, 'HSI'); |
acdd54144838
Added export inventory and profiles in beerxml format. Small fixes in beerxml recipe and product export.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
85 | xmlwriter_text($xw, sprintf("%.4f",floatval($row['hsi']))); |
acdd54144838
Added export inventory and profiles in beerxml format. Small fixes in beerxml recipe and product export.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
86 | xmlwriter_end_element($xw); |
acdd54144838
Added export inventory and profiles in beerxml format. Small fixes in beerxml recipe and product export.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
87 | |
acdd54144838
Added export inventory and profiles in beerxml format. Small fixes in beerxml recipe and product export.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
88 | xmlwriter_start_element($xw, 'TYPE'); |
acdd54144838
Added export inventory and profiles in beerxml format. Small fixes in beerxml recipe and product export.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
89 | xmlwriter_text($xw, $hoptype[$row['type']]); |
acdd54144838
Added export inventory and profiles in beerxml format. Small fixes in beerxml recipe and product export.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
90 | xmlwriter_end_element($xw); |
acdd54144838
Added export inventory and profiles in beerxml format. Small fixes in beerxml recipe and product export.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
91 | |
acdd54144838
Added export inventory and profiles in beerxml format. Small fixes in beerxml recipe and product export.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
92 | xmlwriter_start_element($xw, 'FORM'); |
acdd54144838
Added export inventory and profiles in beerxml format. Small fixes in beerxml recipe and product export.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
93 | xmlwriter_text($xw, $hopform[$row['form']]); |
acdd54144838
Added export inventory and profiles in beerxml format. Small fixes in beerxml recipe and product export.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
94 | xmlwriter_end_element($xw); |
acdd54144838
Added export inventory and profiles in beerxml format. Small fixes in beerxml recipe and product export.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
95 | |
acdd54144838
Added export inventory and profiles in beerxml format. Small fixes in beerxml recipe and product export.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
96 | xmlwriter_start_element($xw, 'ORIGIN'); |
acdd54144838
Added export inventory and profiles in beerxml format. Small fixes in beerxml recipe and product export.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
97 | xmlwriter_text($xw, $row['origin']); |
acdd54144838
Added export inventory and profiles in beerxml format. Small fixes in beerxml recipe and product export.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
98 | xmlwriter_end_element($xw); |
acdd54144838
Added export inventory and profiles in beerxml format. Small fixes in beerxml recipe and product export.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
99 | |
acdd54144838
Added export inventory and profiles in beerxml format. Small fixes in beerxml recipe and product export.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
100 | if (strlen($row['substitutes'])) { |
acdd54144838
Added export inventory and profiles in beerxml format. Small fixes in beerxml recipe and product export.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
101 | xmlwriter_start_element($xw, 'SUBSTITUTES'); |
acdd54144838
Added export inventory and profiles in beerxml format. Small fixes in beerxml recipe and product export.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
102 | xmlwriter_text($xw, $row['substitutes']); |
acdd54144838
Added export inventory and profiles in beerxml format. Small fixes in beerxml recipe and product export.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
103 | xmlwriter_end_element($xw); |
acdd54144838
Added export inventory and profiles in beerxml format. Small fixes in beerxml recipe and product export.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
104 | } |
acdd54144838
Added export inventory and profiles in beerxml format. Small fixes in beerxml recipe and product export.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
105 | |
acdd54144838
Added export inventory and profiles in beerxml format. Small fixes in beerxml recipe and product export.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
106 | if (floatval($row['cost']) > 0) { |
acdd54144838
Added export inventory and profiles in beerxml format. Small fixes in beerxml recipe and product export.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
107 | xmlwriter_start_element($xw, 'COST'); |
acdd54144838
Added export inventory and profiles in beerxml format. Small fixes in beerxml recipe and product export.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
108 | xmlwriter_text($xw, sprintf("%.4f",floatval($row['cost']))); |
acdd54144838
Added export inventory and profiles in beerxml format. Small fixes in beerxml recipe and product export.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
109 | xmlwriter_end_element($xw); |
acdd54144838
Added export inventory and profiles in beerxml format. Small fixes in beerxml recipe and product export.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
110 | } |
acdd54144838
Added export inventory and profiles in beerxml format. Small fixes in beerxml recipe and product export.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
111 | |
acdd54144838
Added export inventory and profiles in beerxml format. Small fixes in beerxml recipe and product export.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
112 | xmlwriter_end_element($xw); // HOP |
acdd54144838
Added export inventory and profiles in beerxml format. Small fixes in beerxml recipe and product export.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
113 | } |
acdd54144838
Added export inventory and profiles in beerxml format. Small fixes in beerxml recipe and product export.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
114 | xmlwriter_end_element($xw); // HOPS |
acdd54144838
Added export inventory and profiles in beerxml format. Small fixes in beerxml recipe and product export.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
115 | |
acdd54144838
Added export inventory and profiles in beerxml format. Small fixes in beerxml recipe and product export.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
116 | $beerxml = xmlwriter_output_memory($xw); |
acdd54144838
Added export inventory and profiles in beerxml format. Small fixes in beerxml recipe and product export.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
117 | |
acdd54144838
Added export inventory and profiles in beerxml format. Small fixes in beerxml recipe and product export.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
118 | Header('Content-type: text/xml'); |
acdd54144838
Added export inventory and profiles in beerxml format. Small fixes in beerxml recipe and product export.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
119 | header('Content-Disposition: attachment; filename="hops.xml"'); |
acdd54144838
Added export inventory and profiles in beerxml format. Small fixes in beerxml recipe and product export.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
120 | header('Content-Transfer-Encoding: binary'); |
acdd54144838
Added export inventory and profiles in beerxml format. Small fixes in beerxml recipe and product export.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
121 | header('Expires: 0'); |
acdd54144838
Added export inventory and profiles in beerxml format. Small fixes in beerxml recipe and product export.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
122 | header('Pragma: no-cache'); |
acdd54144838
Added export inventory and profiles in beerxml format. Small fixes in beerxml recipe and product export.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
123 | header('Content-Length: '.strlen($beerxml)); |
acdd54144838
Added export inventory and profiles in beerxml format. Small fixes in beerxml recipe and product export.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
124 | exit($beerxml); |