Wed, 05 Jun 2019 20:04:26 +0200
Merged with default branch
294
1e09d1d102a8
Updated crontask to check for fermentation logs and update the products. Added initial brew log graph.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1 | /***************************************************************************** |
1e09d1d102a8
Updated crontask to check for fermentation logs and update the products. Added initial brew log graph.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
2 | * Copyright (C) 2019 |
1e09d1d102a8
Updated crontask to check for fermentation logs and update the products. Added initial brew log graph.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
3 | * |
1e09d1d102a8
Updated crontask to check for fermentation logs and update the products. Added initial brew log graph.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
4 | * Michiel Broek <mbroek at mbse dot eu> |
1e09d1d102a8
Updated crontask to check for fermentation logs and update the products. Added initial brew log graph.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
5 | * |
1e09d1d102a8
Updated crontask to check for fermentation logs and update the products. Added initial brew log graph.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
6 | * This file is part of BMS |
1e09d1d102a8
Updated crontask to check for fermentation logs and update the products. Added initial brew log graph.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
7 | * |
1e09d1d102a8
Updated crontask to check for fermentation logs and update the products. Added initial brew log graph.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
8 | * This is free software; you can redistribute it and/or modify it |
1e09d1d102a8
Updated crontask to check for fermentation logs and update the products. Added initial brew log graph.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
9 | * under the terms of the GNU General Public License as published by the |
1e09d1d102a8
Updated crontask to check for fermentation logs and update the products. Added initial brew log graph.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
10 | * Free Software Foundation; either version 2, or (at your option) any |
1e09d1d102a8
Updated crontask to check for fermentation logs and update the products. Added initial brew log graph.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
11 | * later version. |
1e09d1d102a8
Updated crontask to check for fermentation logs and update the products. Added initial brew log graph.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
12 | * |
1e09d1d102a8
Updated crontask to check for fermentation logs and update the products. Added initial brew log graph.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
13 | * Brewery Managment System is distributed in the hope that it will be useful, |
1e09d1d102a8
Updated crontask to check for fermentation logs and update the products. Added initial brew log graph.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
1e09d1d102a8
Updated crontask to check for fermentation logs and update the products. Added initial brew log graph.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
1e09d1d102a8
Updated crontask to check for fermentation logs and update the products. Added initial brew log graph.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
16 | * General Public License for more details. |
1e09d1d102a8
Updated crontask to check for fermentation logs and update the products. Added initial brew log graph.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
17 | * |
1e09d1d102a8
Updated crontask to check for fermentation logs and update the products. Added initial brew log graph.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
18 | * You should have received a copy of the GNU General Public License |
1e09d1d102a8
Updated crontask to check for fermentation logs and update the products. Added initial brew log graph.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
19 | * along with ThermFerm; see the file COPYING. If not, write to the Free |
1e09d1d102a8
Updated crontask to check for fermentation logs and update the products. Added initial brew log graph.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
20 | * Software Foundation, 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. |
1e09d1d102a8
Updated crontask to check for fermentation logs and update the products. Added initial brew log graph.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
21 | *****************************************************************************/ |
1e09d1d102a8
Updated crontask to check for fermentation logs and update the products. Added initial brew log graph.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
22 | |
1e09d1d102a8
Updated crontask to check for fermentation logs and update the products. Added initial brew log graph.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
23 | |
1e09d1d102a8
Updated crontask to check for fermentation logs and update the products. Added initial brew log graph.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
24 | $(document).ready(function () { |
1e09d1d102a8
Updated crontask to check for fermentation logs and update the products. Added initial brew log graph.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
25 | |
296
69fadd1aded2
Updated design document. Add content header application/json to all scripts that produce json output. Chart prints show the beer code and name in the header. Charts don't display the menu anymore.
Michiel Broek <mbroek@mbse.eu>
parents:
294
diff
changeset
|
26 | $('#jqxMenu').jqxMenu('destroy'); |
69fadd1aded2
Updated design document. Add content header application/json to all scripts that produce json output. Chart prints show the beer code and name in the header. Charts don't display the menu anymore.
Michiel Broek <mbroek@mbse.eu>
parents:
294
diff
changeset
|
27 | |
294
1e09d1d102a8
Updated crontask to check for fermentation logs and update the products. Added initial brew log graph.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
28 | $("#jqxLoader").jqxLoader({ |
1e09d1d102a8
Updated crontask to check for fermentation logs and update the products. Added initial brew log graph.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
29 | width: 250, |
1e09d1d102a8
Updated crontask to check for fermentation logs and update the products. Added initial brew log graph.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
30 | height: 150, |
1e09d1d102a8
Updated crontask to check for fermentation logs and update the products. Added initial brew log graph.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
31 | isModal: true, |
1e09d1d102a8
Updated crontask to check for fermentation logs and update the products. Added initial brew log graph.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
32 | text: "Opmaken grafiek ...", |
1e09d1d102a8
Updated crontask to check for fermentation logs and update the products. Added initial brew log graph.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
33 | theme: theme |
1e09d1d102a8
Updated crontask to check for fermentation logs and update the products. Added initial brew log graph.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
34 | }); |
1e09d1d102a8
Updated crontask to check for fermentation logs and update the products. Added initial brew log graph.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
35 | $('#jqxLoader').jqxLoader('open'); |
1e09d1d102a8
Updated crontask to check for fermentation logs and update the products. Added initial brew log graph.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
36 | |
1e09d1d102a8
Updated crontask to check for fermentation logs and update the products. Added initial brew log graph.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
37 | function getExportServer() { |
1e09d1d102a8
Updated crontask to check for fermentation logs and update the products. Added initial brew log graph.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
38 | return "https://www.jqwidgets.com/export_server/export.php"; |
1e09d1d102a8
Updated crontask to check for fermentation logs and update the products. Added initial brew log graph.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
39 | } |
1e09d1d102a8
Updated crontask to check for fermentation logs and update the products. Added initial brew log graph.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
40 | |
1e09d1d102a8
Updated crontask to check for fermentation logs and update the products. Added initial brew log graph.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
41 | var sourceA = { |
1e09d1d102a8
Updated crontask to check for fermentation logs and update the products. Added initial brew log graph.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
42 | datatype: "json", |
1e09d1d102a8
Updated crontask to check for fermentation logs and update the products. Added initial brew log graph.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
43 | datafields: [ |
1e09d1d102a8
Updated crontask to check for fermentation logs and update the products. Added initial brew log graph.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
44 | { name: "date", type: "date", format: "yyyy-MM-dd HH:mm" }, |
1e09d1d102a8
Updated crontask to check for fermentation logs and update the products. Added initial brew log graph.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
45 | { name: "version", type: "int" }, |
1e09d1d102a8
Updated crontask to check for fermentation logs and update the products. Added initial brew log graph.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
46 | { name: "code", type: "string" }, |
1e09d1d102a8
Updated crontask to check for fermentation logs and update the products. Added initial brew log graph.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
47 | { name: "name", type: "string" }, |
1e09d1d102a8
Updated crontask to check for fermentation logs and update the products. Added initial brew log graph.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
48 | { name: "pv_mlt", type: "float" }, |
1e09d1d102a8
Updated crontask to check for fermentation logs and update the products. Added initial brew log graph.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
49 | { name: "pv_hlt", type: "float" }, |
1e09d1d102a8
Updated crontask to check for fermentation logs and update the products. Added initial brew log graph.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
50 | { name: "pv_room", type: "float" }, |
1e09d1d102a8
Updated crontask to check for fermentation logs and update the products. Added initial brew log graph.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
51 | { name: "sp_mlt", type: "float" }, |
1e09d1d102a8
Updated crontask to check for fermentation logs and update the products. Added initial brew log graph.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
52 | { name: "sp_hlt", type: "float" }, |
297
5e2424bfbc4a
Added import brew json logfiles
Michiel Broek <mbroek@mbse.eu>
parents:
296
diff
changeset
|
53 | { name: "pwm_mlt", type: "int" }, |
5e2424bfbc4a
Added import brew json logfiles
Michiel Broek <mbroek@mbse.eu>
parents:
296
diff
changeset
|
54 | { name: "pwm_hlt", type: "int" }, |
294
1e09d1d102a8
Updated crontask to check for fermentation logs and update the products. Added initial brew log graph.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
55 | { name: "event", type: "string" } |
1e09d1d102a8
Updated crontask to check for fermentation logs and update the products. Added initial brew log graph.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
56 | ], |
1e09d1d102a8
Updated crontask to check for fermentation logs and update the products. Added initial brew log graph.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
57 | url: 'getbrewlog.php?code=' + my_code |
1e09d1d102a8
Updated crontask to check for fermentation logs and update the products. Added initial brew log graph.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
58 | }; |
1e09d1d102a8
Updated crontask to check for fermentation logs and update the products. Added initial brew log graph.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
59 | var dataAdapter = new $.jqx.dataAdapter(sourceA, { |
1e09d1d102a8
Updated crontask to check for fermentation logs and update the products. Added initial brew log graph.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
60 | autoBind: true, |
1e09d1d102a8
Updated crontask to check for fermentation logs and update the products. Added initial brew log graph.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
61 | async: false, |
1e09d1d102a8
Updated crontask to check for fermentation logs and update the products. Added initial brew log graph.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
62 | loadComplete: function () { |
1e09d1d102a8
Updated crontask to check for fermentation logs and update the products. Added initial brew log graph.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
63 | $('#jqxLoader').jqxLoader('close'); |
1e09d1d102a8
Updated crontask to check for fermentation logs and update the products. Added initial brew log graph.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
64 | }, |
1e09d1d102a8
Updated crontask to check for fermentation logs and update the products. Added initial brew log graph.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
65 | loadError: function (jqXHR, status, error) { |
1e09d1d102a8
Updated crontask to check for fermentation logs and update the products. Added initial brew log graph.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
66 | } |
1e09d1d102a8
Updated crontask to check for fermentation logs and update the products. Added initial brew log graph.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
67 | }); |
1e09d1d102a8
Updated crontask to check for fermentation logs and update the products. Added initial brew log graph.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
68 | |
1e09d1d102a8
Updated crontask to check for fermentation logs and update the products. Added initial brew log graph.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
69 | var settings = { |
1e09d1d102a8
Updated crontask to check for fermentation logs and update the products. Added initial brew log graph.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
70 | title: my_code + ' "' + my_name + '"', |
1e09d1d102a8
Updated crontask to check for fermentation logs and update the products. Added initial brew log graph.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
71 | description: "", |
1e09d1d102a8
Updated crontask to check for fermentation logs and update the products. Added initial brew log graph.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
72 | source: dataAdapter, |
1e09d1d102a8
Updated crontask to check for fermentation logs and update the products. Added initial brew log graph.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
73 | xAxis: { |
1e09d1d102a8
Updated crontask to check for fermentation logs and update the products. Added initial brew log graph.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
74 | dataField: 'date', |
1e09d1d102a8
Updated crontask to check for fermentation logs and update the products. Added initial brew log graph.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
75 | type: 'date', |
1e09d1d102a8
Updated crontask to check for fermentation logs and update the products. Added initial brew log graph.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
76 | formatFunction: function (value) { |
1e09d1d102a8
Updated crontask to check for fermentation logs and update the products. Added initial brew log graph.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
77 | return value.getHours() + ':' + value.getMinutes(); |
1e09d1d102a8
Updated crontask to check for fermentation logs and update the products. Added initial brew log graph.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
78 | }, |
1e09d1d102a8
Updated crontask to check for fermentation logs and update the products. Added initial brew log graph.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
79 | toolTipFormatFunction: function (value) { |
1e09d1d102a8
Updated crontask to check for fermentation logs and update the products. Added initial brew log graph.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
80 | var h = value.getHours(); |
1e09d1d102a8
Updated crontask to check for fermentation logs and update the products. Added initial brew log graph.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
81 | var m = value.getMinutes(); |
1e09d1d102a8
Updated crontask to check for fermentation logs and update the products. Added initial brew log graph.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
82 | return value.getDate() + '-' + (value.getMonth() + 1) + '-' + value.getFullYear() |
1e09d1d102a8
Updated crontask to check for fermentation logs and update the products. Added initial brew log graph.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
83 | + ' ' + (h < 10 ? '0' + h : h) + ':' + (m < 10 ? '0' + m : m); |
1e09d1d102a8
Updated crontask to check for fermentation logs and update the products. Added initial brew log graph.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
84 | }, |
1e09d1d102a8
Updated crontask to check for fermentation logs and update the products. Added initial brew log graph.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
85 | textRotationAngle: 300, |
1e09d1d102a8
Updated crontask to check for fermentation logs and update the products. Added initial brew log graph.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
86 | }, |
1e09d1d102a8
Updated crontask to check for fermentation logs and update the products. Added initial brew log graph.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
87 | colorScheme: 'scheme01', |
1e09d1d102a8
Updated crontask to check for fermentation logs and update the products. Added initial brew log graph.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
88 | seriesGroups: [ |
1e09d1d102a8
Updated crontask to check for fermentation logs and update the products. Added initial brew log graph.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
89 | { |
1e09d1d102a8
Updated crontask to check for fermentation logs and update the products. Added initial brew log graph.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
90 | type: 'spline', |
1e09d1d102a8
Updated crontask to check for fermentation logs and update the products. Added initial brew log graph.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
91 | valueAxis: { |
1e09d1d102a8
Updated crontask to check for fermentation logs and update the products. Added initial brew log graph.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
92 | minValue: 0, |
1e09d1d102a8
Updated crontask to check for fermentation logs and update the products. Added initial brew log graph.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
93 | description: 'Graden C' |
1e09d1d102a8
Updated crontask to check for fermentation logs and update the products. Added initial brew log graph.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
94 | }, |
1e09d1d102a8
Updated crontask to check for fermentation logs and update the products. Added initial brew log graph.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
95 | series: [ |
1e09d1d102a8
Updated crontask to check for fermentation logs and update the products. Added initial brew log graph.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
96 | { dataField: "pv_mlt", lineWidth: 2, displayText: "MLT" }, |
1e09d1d102a8
Updated crontask to check for fermentation logs and update the products. Added initial brew log graph.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
97 | { dataField: "sp_mlt", lineWidth: 1, displayText: "mlt", opacity: 0.7 }, |
1e09d1d102a8
Updated crontask to check for fermentation logs and update the products. Added initial brew log graph.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
98 | { dataField: "pv_hlt", lineWidth: 1, displayText: "HLT" }, |
1e09d1d102a8
Updated crontask to check for fermentation logs and update the products. Added initial brew log graph.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
99 | { dataField: "sp_hlt", lineWidth: 1, displayText: "hlt", opacity: 0.7 }, |
1e09d1d102a8
Updated crontask to check for fermentation logs and update the products. Added initial brew log graph.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
100 | { dataField: "pv_room", lineWidth: 1, displayText: "Room", opacity: 0.5 } |
1e09d1d102a8
Updated crontask to check for fermentation logs and update the products. Added initial brew log graph.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
101 | ] |
1e09d1d102a8
Updated crontask to check for fermentation logs and update the products. Added initial brew log graph.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
102 | } |
1e09d1d102a8
Updated crontask to check for fermentation logs and update the products. Added initial brew log graph.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
103 | ] |
1e09d1d102a8
Updated crontask to check for fermentation logs and update the products. Added initial brew log graph.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
104 | }; |
1e09d1d102a8
Updated crontask to check for fermentation logs and update the products. Added initial brew log graph.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
105 | $("#brew_chart").jqxChart(settings); |
1e09d1d102a8
Updated crontask to check for fermentation logs and update the products. Added initial brew log graph.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
106 | |
1e09d1d102a8
Updated crontask to check for fermentation logs and update the products. Added initial brew log graph.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
107 | $("#print").click(function () { |
1e09d1d102a8
Updated crontask to check for fermentation logs and update the products. Added initial brew log graph.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
108 | var content = $("#brew_chart")[0].outerHTML; |
1e09d1d102a8
Updated crontask to check for fermentation logs and update the products. Added initial brew log graph.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
109 | var newWindow = window.open("", "", "width=865, height=425"), |
1e09d1d102a8
Updated crontask to check for fermentation logs and update the products. Added initial brew log graph.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
110 | document = newWindow.document.open(), |
1e09d1d102a8
Updated crontask to check for fermentation logs and update the products. Added initial brew log graph.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
111 | pageContent = |
1e09d1d102a8
Updated crontask to check for fermentation logs and update the products. Added initial brew log graph.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
112 | '<!DOCTYPE html>' + |
1e09d1d102a8
Updated crontask to check for fermentation logs and update the products. Added initial brew log graph.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
113 | '<html>' + |
1e09d1d102a8
Updated crontask to check for fermentation logs and update the products. Added initial brew log graph.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
114 | '<head>' + |
1e09d1d102a8
Updated crontask to check for fermentation logs and update the products. Added initial brew log graph.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
115 | '<link rel="stylesheet" href="jqwidgets/styles/jqx.base.css" type="text/css" />' + |
1e09d1d102a8
Updated crontask to check for fermentation logs and update the products. Added initial brew log graph.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
116 | '<meta charset="utf-8" />' + |
296
69fadd1aded2
Updated design document. Add content header application/json to all scripts that produce json output. Chart prints show the beer code and name in the header. Charts don't display the menu anymore.
Michiel Broek <mbroek@mbse.eu>
parents:
294
diff
changeset
|
117 | '<title>' + my_code + ' ' + my_name + ' brouwdag</title>' + |
294
1e09d1d102a8
Updated crontask to check for fermentation logs and update the products. Added initial brew log graph.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
118 | '</head>' + |
1e09d1d102a8
Updated crontask to check for fermentation logs and update the products. Added initial brew log graph.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
119 | '<body>' + content + '</body></html>'; |
1e09d1d102a8
Updated crontask to check for fermentation logs and update the products. Added initial brew log graph.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
120 | document.write(pageContent); |
1e09d1d102a8
Updated crontask to check for fermentation logs and update the products. Added initial brew log graph.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
121 | document.close(); |
1e09d1d102a8
Updated crontask to check for fermentation logs and update the products. Added initial brew log graph.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
122 | newWindow.print(); |
1e09d1d102a8
Updated crontask to check for fermentation logs and update the products. Added initial brew log graph.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
123 | }); |
1e09d1d102a8
Updated crontask to check for fermentation logs and update the products. Added initial brew log graph.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
124 | $("#print").jqxButton({ template: "primary", width: 125, theme: theme }); |
1e09d1d102a8
Updated crontask to check for fermentation logs and update the products. Added initial brew log graph.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
125 | |
1e09d1d102a8
Updated crontask to check for fermentation logs and update the products. Added initial brew log graph.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
126 | |
1e09d1d102a8
Updated crontask to check for fermentation logs and update the products. Added initial brew log graph.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
127 | $("#pdfButton").click(function () { |
1e09d1d102a8
Updated crontask to check for fermentation logs and update the products. Added initial brew log graph.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
128 | $("#brew_chart").jqxChart("saveAsPDF", "brouw_"+my_code+".pdf", getExportServer()); |
1e09d1d102a8
Updated crontask to check for fermentation logs and update the products. Added initial brew log graph.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
129 | }); |
1e09d1d102a8
Updated crontask to check for fermentation logs and update the products. Added initial brew log graph.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
130 | $("#pdfButton").jqxButton({ template: "primary", width: 125, theme: theme }); |
1e09d1d102a8
Updated crontask to check for fermentation logs and update the products. Added initial brew log graph.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
131 | |
1e09d1d102a8
Updated crontask to check for fermentation logs and update the products. Added initial brew log graph.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
132 | $("#pngButton").click(function () { |
1e09d1d102a8
Updated crontask to check for fermentation logs and update the products. Added initial brew log graph.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
133 | $("#brew_chart").jqxChart("saveAsPNG", "brouw_"+my_code+".png", getExportServer()); |
1e09d1d102a8
Updated crontask to check for fermentation logs and update the products. Added initial brew log graph.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
134 | }); |
1e09d1d102a8
Updated crontask to check for fermentation logs and update the products. Added initial brew log graph.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
135 | $("#pngButton").jqxButton({ template: "primary", width: 125, theme: theme }); |
1e09d1d102a8
Updated crontask to check for fermentation logs and update the products. Added initial brew log graph.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
136 | |
1e09d1d102a8
Updated crontask to check for fermentation logs and update the products. Added initial brew log graph.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
137 | $("#Close").jqxButton({ template: "success", width: 125, theme: theme }); |
1e09d1d102a8
Updated crontask to check for fermentation logs and update the products. Added initial brew log graph.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
138 | $("#Close").click(function () { |
1e09d1d102a8
Updated crontask to check for fermentation logs and update the products. Added initial brew log graph.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
139 | window.close(); |
1e09d1d102a8
Updated crontask to check for fermentation logs and update the products. Added initial brew log graph.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
140 | }); |
1e09d1d102a8
Updated crontask to check for fermentation logs and update the products. Added initial brew log graph.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
141 | }); |
1e09d1d102a8
Updated crontask to check for fermentation logs and update the products. Added initial brew log graph.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
142 |