Wed, 30 Jul 2014 23:06:46 +0200
Update LCD even when unit is off
97
4a9dbee41a6c
Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1 | <?php |
4a9dbee41a6c
Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
2 | /***************************************************************************** |
4a9dbee41a6c
Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
3 | * Copyright (C) 2014 |
4a9dbee41a6c
Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
4 | * |
4a9dbee41a6c
Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
5 | * Michiel Broek <mbroek at mbse dot eu> |
4a9dbee41a6c
Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
6 | * |
4a9dbee41a6c
Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
7 | * This file is part of ThermFerm |
4a9dbee41a6c
Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
8 | * |
4a9dbee41a6c
Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
9 | * This is free software; you can redistribute it and/or modify it |
4a9dbee41a6c
Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
10 | * under the terms of the GNU General Public License as published by the |
4a9dbee41a6c
Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
11 | * Free Software Foundation; either version 2, or (at your option) any |
4a9dbee41a6c
Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
12 | * later version. |
4a9dbee41a6c
Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
13 | * |
4a9dbee41a6c
Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
14 | * ThermFerm is distributed in the hope that it will be useful, but |
4a9dbee41a6c
Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
15 | * WITHOUT ANY WARRANTY; without even the implied warranty of |
4a9dbee41a6c
Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
4a9dbee41a6c
Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
17 | * General Public License for more details. |
4a9dbee41a6c
Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
18 | * |
4a9dbee41a6c
Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
19 | * You should have received a copy of the GNU General Public License |
4a9dbee41a6c
Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
20 | * along with ThermFerm; see the file COPYING. If not, write to the Free |
4a9dbee41a6c
Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
21 | * Software Foundation, 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. |
4a9dbee41a6c
Added initial set for the thermferm web interface
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
22 | *****************************************************************************/ |
99 | 23 | |
117 | 24 | /* |
25 | * Look for the style names in the jqwidgets/styles directory. | |
26 | */ | |
118
7c8f35a43cec
Added maintenance window with only two buttons yet
Michiel Broek <mbroek@mbse.eu>
parents:
117
diff
changeset
|
27 | $my_style = 'ui-redmond'; |
99 | 28 | |
155
0d86f3c0a07b
Unit mode can switch between OFF and NONE.
Michiel Broek <mbroek@mbse.eu>
parents:
134
diff
changeset
|
29 | require_once('utilities.php'); |
100 | 30 | require_once('liveview.php'); |
31 | ||
32 | ||
155
0d86f3c0a07b
Unit mode can switch between OFF and NONE.
Michiel Broek <mbroek@mbse.eu>
parents:
134
diff
changeset
|
33 | |
0d86f3c0a07b
Unit mode can switch between OFF and NONE.
Michiel Broek <mbroek@mbse.eu>
parents:
134
diff
changeset
|
34 | /* |
0d86f3c0a07b
Unit mode can switch between OFF and NONE.
Michiel Broek <mbroek@mbse.eu>
parents:
134
diff
changeset
|
35 | * Handle the post events |
0d86f3c0a07b
Unit mode can switch between OFF and NONE.
Michiel Broek <mbroek@mbse.eu>
parents:
134
diff
changeset
|
36 | */ |
0d86f3c0a07b
Unit mode can switch between OFF and NONE.
Michiel Broek <mbroek@mbse.eu>
parents:
134
diff
changeset
|
37 | if (isset($_POST['mode']) && isset($_POST['UUID'])) { |
0d86f3c0a07b
Unit mode can switch between OFF and NONE.
Michiel Broek <mbroek@mbse.eu>
parents:
134
diff
changeset
|
38 | send_cmd('UNIT '.$_POST['UUID']); |
0d86f3c0a07b
Unit mode can switch between OFF and NONE.
Michiel Broek <mbroek@mbse.eu>
parents:
134
diff
changeset
|
39 | send_cmd('MODE '.$_POST['mode']); |
0d86f3c0a07b
Unit mode can switch between OFF and NONE.
Michiel Broek <mbroek@mbse.eu>
parents:
134
diff
changeset
|
40 | } |
0d86f3c0a07b
Unit mode can switch between OFF and NONE.
Michiel Broek <mbroek@mbse.eu>
parents:
134
diff
changeset
|
41 | |
0d86f3c0a07b
Unit mode can switch between OFF and NONE.
Michiel Broek <mbroek@mbse.eu>
parents:
134
diff
changeset
|
42 | |
0d86f3c0a07b
Unit mode can switch between OFF and NONE.
Michiel Broek <mbroek@mbse.eu>
parents:
134
diff
changeset
|
43 | |
99 | 44 | $outstr = '<!DOCTYPE html>'.PHP_EOL; |
45 | $outstr .= '<html>'.PHP_EOL; | |
46 | $outstr .= ' <head>'.PHP_EOL; | |
47 | $outstr .= ' <meta http-equiv="content-type" content="text/html; charset=utf-8" />'.PHP_EOL; | |
48 | $outstr .= ' <title>ThermFerm monitor</title>'.PHP_EOL; | |
49 | $outstr .= ' <link type="text/css" href="css/style.css" rel="stylesheet" media="all" />'.PHP_EOL; | |
117 | 50 | $outstr .= ' <link type="text/css" href="jqwidgets/styles/jqx.base.css" rel="stylesheet" />'.PHP_EOL; |
51 | $outstr .= ' <link type="text/css" href="jqwidgets/styles/jqx.'.$my_style.'.css" rel="stylesheet" />'.PHP_EOL; | |
52 | $outstr .= ' <script type="text/javascript" src="js/jquery-2.1.1.min.js"></script>'.PHP_EOL; | |
53 | $outstr .= ' <script type="text/javascript" src="jqwidgets/jqxcore.js"></script>'.PHP_EOL; | |
118
7c8f35a43cec
Added maintenance window with only two buttons yet
Michiel Broek <mbroek@mbse.eu>
parents:
117
diff
changeset
|
54 | $outstr .= ' <script type="text/javascript" src="jqwidgets/jqxwindow.js"></script>'.PHP_EOL; |
117 | 55 | $outstr .= ' <script type="text/javascript" src="jqwidgets/jqxtabs.js"></script>'.PHP_EOL; |
56 | $outstr .= ' <script type="text/javascript" src="jqwidgets/jqxcheckbox.js"></script>'.PHP_EOL; | |
57 | $outstr .= ' <script type="text/javascript" src="jqwidgets/jqxbuttons.js"></script>'.PHP_EOL; | |
58 | $outstr .= ' <script type="text/javascript" src="jqwidgets/jqxradiobutton.js"></script>'.PHP_EOL; | |
121
03306c3bfd60
Initial setup to draw charts
Michiel Broek <mbroek@mbse.eu>
parents:
118
diff
changeset
|
59 | $outstr .= ' <script type="text/javascript" src="jqwidgets/jqxchart.core.js"></script>'.PHP_EOL; |
03306c3bfd60
Initial setup to draw charts
Michiel Broek <mbroek@mbse.eu>
parents:
118
diff
changeset
|
60 | $outstr .= ' <script type="text/javascript" src="jqwidgets/jqxdraw.js"></script>'.PHP_EOL; |
03306c3bfd60
Initial setup to draw charts
Michiel Broek <mbroek@mbse.eu>
parents:
118
diff
changeset
|
61 | $outstr .= ' <script type="text/javascript" src="jqwidgets/jqxdata.js"></script>'.PHP_EOL; |
127
f2f45c44942f
Added the maintenance 1-Wire display tab
Michiel Broek <mbroek@mbse.eu>
parents:
124
diff
changeset
|
62 | $outstr .= ' </head>'.PHP_EOL; |
118
7c8f35a43cec
Added maintenance window with only two buttons yet
Michiel Broek <mbroek@mbse.eu>
parents:
117
diff
changeset
|
63 | |
117 | 64 | $outstr .= ' <body class="default">'.PHP_EOL; |
65 | $outstr .= ' <div id="jqxWidget">'.PHP_EOL; | |
99 | 66 | $outstr .= ' <div id="header">'.PHP_EOL; |
134
f05601490415
Redesigned the web interface, one single app is too slow. The main dashboard will be a shiny ajax driven page, the setup pages will be simple and php only. Keep It Simple, Stupid.
Michiel Broek <mbroek@mbse.eu>
parents:
131
diff
changeset
|
67 | $outstr .= ' <form action="maintenance.php" style="margin:30px; float:right">'.PHP_EOL; |
f05601490415
Redesigned the web interface, one single app is too slow. The main dashboard will be a shiny ajax driven page, the setup pages will be simple and php only. Keep It Simple, Stupid.
Michiel Broek <mbroek@mbse.eu>
parents:
131
diff
changeset
|
68 | $outstr .= ' <input type="submit" id="maintenance" value="Maintenance panel" />'.PHP_EOL; |
f05601490415
Redesigned the web interface, one single app is too slow. The main dashboard will be a shiny ajax driven page, the setup pages will be simple and php only. Keep It Simple, Stupid.
Michiel Broek <mbroek@mbse.eu>
parents:
131
diff
changeset
|
69 | $outstr .= ' </form>'.PHP_EOL; |
99 | 70 | $outstr .= ' </div> <!-- header -->'.PHP_EOL; |
100 | 71 | $outstr .= liveview(); |
118
7c8f35a43cec
Added maintenance window with only two buttons yet
Michiel Broek <mbroek@mbse.eu>
parents:
117
diff
changeset
|
72 | |
121
03306c3bfd60
Initial setup to draw charts
Michiel Broek <mbroek@mbse.eu>
parents:
118
diff
changeset
|
73 | /* Create the tabs */ |
134
f05601490415
Redesigned the web interface, one single app is too slow. The main dashboard will be a shiny ajax driven page, the setup pages will be simple and php only. Keep It Simple, Stupid.
Michiel Broek <mbroek@mbse.eu>
parents:
131
diff
changeset
|
74 | $outstr .= ' <script type="text/javascript" src="js/index.js"></script>'.PHP_EOL; |
117 | 75 | $outstr .= ' </div> <!-- jqxWidget -->'.PHP_EOL; |
99 | 76 | $outstr .= ' </body>'.PHP_EOL; |
77 | $outstr .= '</html>'.PHP_EOL; | |
78 | ||
79 | echo $outstr; | |
80 | ||
155
0d86f3c0a07b
Unit mode can switch between OFF and NONE.
Michiel Broek <mbroek@mbse.eu>
parents:
134
diff
changeset
|
81 | echo "_GET "; |
0d86f3c0a07b
Unit mode can switch between OFF and NONE.
Michiel Broek <mbroek@mbse.eu>
parents:
134
diff
changeset
|
82 | print_r ($_GET); |
0d86f3c0a07b
Unit mode can switch between OFF and NONE.
Michiel Broek <mbroek@mbse.eu>
parents:
134
diff
changeset
|
83 | echo "<br> _POST "; |
0d86f3c0a07b
Unit mode can switch between OFF and NONE.
Michiel Broek <mbroek@mbse.eu>
parents:
134
diff
changeset
|
84 | print_r ($_POST); |
0d86f3c0a07b
Unit mode can switch between OFF and NONE.
Michiel Broek <mbroek@mbse.eu>
parents:
134
diff
changeset
|
85 |