Mon, 21 Jul 2014 17:16:08 +0200
Added maintenance window with only two buttons yet
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 | |
100 | 29 | require_once('liveview.php'); |
30 | ||
31 | ||
99 | 32 | $outstr = '<!DOCTYPE html>'.PHP_EOL; |
33 | $outstr .= '<html>'.PHP_EOL; | |
34 | $outstr .= ' <head>'.PHP_EOL; | |
35 | $outstr .= ' <meta http-equiv="content-type" content="text/html; charset=utf-8" />'.PHP_EOL; | |
36 | $outstr .= ' <title>ThermFerm monitor</title>'.PHP_EOL; | |
37 | $outstr .= ' <link type="text/css" href="css/style.css" rel="stylesheet" media="all" />'.PHP_EOL; | |
117 | 38 | $outstr .= ' <link type="text/css" href="jqwidgets/styles/jqx.base.css" rel="stylesheet" />'.PHP_EOL; |
39 | $outstr .= ' <link type="text/css" href="jqwidgets/styles/jqx.'.$my_style.'.css" rel="stylesheet" />'.PHP_EOL; | |
40 | $outstr .= ' <script type="text/javascript" src="js/jquery-2.1.1.min.js"></script>'.PHP_EOL; | |
41 | $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
|
42 | $outstr .= ' <script type="text/javascript" src="jqwidgets/jqxwindow.js"></script>'.PHP_EOL; |
117 | 43 | $outstr .= ' <script type="text/javascript" src="jqwidgets/jqxtabs.js"></script>'.PHP_EOL; |
44 | $outstr .= ' <script type="text/javascript" src="jqwidgets/jqxcheckbox.js"></script>'.PHP_EOL; | |
45 | $outstr .= ' <script type="text/javascript" src="jqwidgets/jqxbuttons.js"></script>'.PHP_EOL; | |
46 | $outstr .= ' <script type="text/javascript" src="jqwidgets/jqxradiobutton.js"></script>'.PHP_EOL; | |
47 | $outstr .= ' <script type="text/javascript">'.PHP_EOL; | |
118
7c8f35a43cec
Added maintenance window with only two buttons yet
Michiel Broek <mbroek@mbse.eu>
parents:
117
diff
changeset
|
48 | |
7c8f35a43cec
Added maintenance window with only two buttons yet
Michiel Broek <mbroek@mbse.eu>
parents:
117
diff
changeset
|
49 | $outstr .= ' function addEventListeners() {'.PHP_EOL; |
7c8f35a43cec
Added maintenance window with only two buttons yet
Michiel Broek <mbroek@mbse.eu>
parents:
117
diff
changeset
|
50 | $outstr .= ' $("#maintenance").mousedown(function () {'.PHP_EOL; |
7c8f35a43cec
Added maintenance window with only two buttons yet
Michiel Broek <mbroek@mbse.eu>
parents:
117
diff
changeset
|
51 | $outstr .= ' $("#maintenance_window").jqxWindow(\'open\');'.PHP_EOL; |
7c8f35a43cec
Added maintenance window with only two buttons yet
Michiel Broek <mbroek@mbse.eu>
parents:
117
diff
changeset
|
52 | $outstr .= ' });'.PHP_EOL; |
7c8f35a43cec
Added maintenance window with only two buttons yet
Michiel Broek <mbroek@mbse.eu>
parents:
117
diff
changeset
|
53 | |
7c8f35a43cec
Added maintenance window with only two buttons yet
Michiel Broek <mbroek@mbse.eu>
parents:
117
diff
changeset
|
54 | $outstr .= ' }'.PHP_EOL; |
7c8f35a43cec
Added maintenance window with only two buttons yet
Michiel Broek <mbroek@mbse.eu>
parents:
117
diff
changeset
|
55 | |
7c8f35a43cec
Added maintenance window with only two buttons yet
Michiel Broek <mbroek@mbse.eu>
parents:
117
diff
changeset
|
56 | $outstr .= ' function createMaintenance() {'.PHP_EOL; |
7c8f35a43cec
Added maintenance window with only two buttons yet
Michiel Broek <mbroek@mbse.eu>
parents:
117
diff
changeset
|
57 | $outstr .= ' $("#maintenance_window").jqxWindow({'.PHP_EOL; |
7c8f35a43cec
Added maintenance window with only two buttons yet
Michiel Broek <mbroek@mbse.eu>
parents:
117
diff
changeset
|
58 | $outstr .= ' height: 400, width: 800, autoOpen: false, theme: \''.$my_style.'\', '.PHP_EOL; |
7c8f35a43cec
Added maintenance window with only two buttons yet
Michiel Broek <mbroek@mbse.eu>
parents:
117
diff
changeset
|
59 | $outstr .= ' position: { x:100, y:50 }, '.PHP_EOL; |
7c8f35a43cec
Added maintenance window with only two buttons yet
Michiel Broek <mbroek@mbse.eu>
parents:
117
diff
changeset
|
60 | $outstr .= ' resizable: false, isModal: true, modalOpacity: 0.5, '.PHP_EOL; |
7c8f35a43cec
Added maintenance window with only two buttons yet
Michiel Broek <mbroek@mbse.eu>
parents:
117
diff
changeset
|
61 | $outstr .= ' okButton: $("#maintenance_ok"), cancelButton: $("#maintenance_cancel"),'.PHP_EOL; |
7c8f35a43cec
Added maintenance window with only two buttons yet
Michiel Broek <mbroek@mbse.eu>
parents:
117
diff
changeset
|
62 | $outstr .= ' initContent: function () {'.PHP_EOL; |
7c8f35a43cec
Added maintenance window with only two buttons yet
Michiel Broek <mbroek@mbse.eu>
parents:
117
diff
changeset
|
63 | $outstr .= ' $("#maintenance_ok").jqxButton({ width: \'65px\', height: \'25\', theme: \''.$my_style.'\' });'.PHP_EOL; |
7c8f35a43cec
Added maintenance window with only two buttons yet
Michiel Broek <mbroek@mbse.eu>
parents:
117
diff
changeset
|
64 | $outstr .= ' $("#maintenance_cancel").jqxButton({ width: \'65px\', height: \'25\', theme: \''.$my_style.'\' });'.PHP_EOL; |
7c8f35a43cec
Added maintenance window with only two buttons yet
Michiel Broek <mbroek@mbse.eu>
parents:
117
diff
changeset
|
65 | //$outstr .= ' $("#ok").focus();'.PHP_EOL; |
7c8f35a43cec
Added maintenance window with only two buttons yet
Michiel Broek <mbroek@mbse.eu>
parents:
117
diff
changeset
|
66 | $outstr .= ' }'.PHP_EOL; |
7c8f35a43cec
Added maintenance window with only two buttons yet
Michiel Broek <mbroek@mbse.eu>
parents:
117
diff
changeset
|
67 | $outstr .= ' });'.PHP_EOL; |
7c8f35a43cec
Added maintenance window with only two buttons yet
Michiel Broek <mbroek@mbse.eu>
parents:
117
diff
changeset
|
68 | $outstr .= ' $("#maintenance").jqxButton({ width: \'150\', height: \'25\', theme: \''.$my_style.'\'});'.PHP_EOL; |
7c8f35a43cec
Added maintenance window with only two buttons yet
Michiel Broek <mbroek@mbse.eu>
parents:
117
diff
changeset
|
69 | $outstr .= ' }'.PHP_EOL; |
7c8f35a43cec
Added maintenance window with only two buttons yet
Michiel Broek <mbroek@mbse.eu>
parents:
117
diff
changeset
|
70 | |
117 | 71 | $outstr .= ' $(document).ready(function () {'.PHP_EOL; |
72 | $outstr .= ' // Create jqxTabs.'.PHP_EOL; | |
118
7c8f35a43cec
Added maintenance window with only two buttons yet
Michiel Broek <mbroek@mbse.eu>
parents:
117
diff
changeset
|
73 | $outstr .= ' $(\'#jqxTabs\').jqxTabs({ width: \'978\', height: 428, position: \'top\', theme: \''.$my_style.'\'});'.PHP_EOL; |
7c8f35a43cec
Added maintenance window with only two buttons yet
Michiel Broek <mbroek@mbse.eu>
parents:
117
diff
changeset
|
74 | $outstr .= ' addEventListeners();'.PHP_EOL; |
7c8f35a43cec
Added maintenance window with only two buttons yet
Michiel Broek <mbroek@mbse.eu>
parents:
117
diff
changeset
|
75 | $outstr .= ' createMaintenance();'.PHP_EOL; |
117 | 76 | $outstr .= ' });'.PHP_EOL; |
118
7c8f35a43cec
Added maintenance window with only two buttons yet
Michiel Broek <mbroek@mbse.eu>
parents:
117
diff
changeset
|
77 | |
117 | 78 | $outstr .= ' </script>'.PHP_EOL; |
99 | 79 | $outstr .= ' </head>'.PHP_EOL; |
117 | 80 | $outstr .= ' <body class="default">'.PHP_EOL; |
81 | $outstr .= ' <div id="jqxWidget">'.PHP_EOL; | |
99 | 82 | $outstr .= ' <div id="header">'.PHP_EOL; |
112 | 83 | $outstr .= ' <button class="script-status ui-state-error">Status</button>'.PHP_EOL; |
118
7c8f35a43cec
Added maintenance window with only two buttons yet
Michiel Broek <mbroek@mbse.eu>
parents:
117
diff
changeset
|
84 | $outstr .= ' <input type="button" id="maintenance" value="Maintenance panel" />'.PHP_EOL; |
99 | 85 | $outstr .= ' </div> <!-- header -->'.PHP_EOL; |
100 | 86 | $outstr .= liveview(); |
118
7c8f35a43cec
Added maintenance window with only two buttons yet
Michiel Broek <mbroek@mbse.eu>
parents:
117
diff
changeset
|
87 | |
7c8f35a43cec
Added maintenance window with only two buttons yet
Michiel Broek <mbroek@mbse.eu>
parents:
117
diff
changeset
|
88 | /* The maintenance popup window */ |
7c8f35a43cec
Added maintenance window with only two buttons yet
Michiel Broek <mbroek@mbse.eu>
parents:
117
diff
changeset
|
89 | $outstr .= ' <div id="maintenance_window">'.PHP_EOL; |
7c8f35a43cec
Added maintenance window with only two buttons yet
Michiel Broek <mbroek@mbse.eu>
parents:
117
diff
changeset
|
90 | $outstr .= ' <div id="maintenance_header">'.PHP_EOL; |
7c8f35a43cec
Added maintenance window with only two buttons yet
Michiel Broek <mbroek@mbse.eu>
parents:
117
diff
changeset
|
91 | $outstr .= ' Maintenance panel'.PHP_EOL; |
7c8f35a43cec
Added maintenance window with only two buttons yet
Michiel Broek <mbroek@mbse.eu>
parents:
117
diff
changeset
|
92 | $outstr .= ' </div>'.PHP_EOL; |
7c8f35a43cec
Added maintenance window with only two buttons yet
Michiel Broek <mbroek@mbse.eu>
parents:
117
diff
changeset
|
93 | $outstr .= ' <div id="maintenance_content">'.PHP_EOL; |
7c8f35a43cec
Added maintenance window with only two buttons yet
Michiel Broek <mbroek@mbse.eu>
parents:
117
diff
changeset
|
94 | $outstr .= ' Maintenancecontent'.PHP_EOL; |
7c8f35a43cec
Added maintenance window with only two buttons yet
Michiel Broek <mbroek@mbse.eu>
parents:
117
diff
changeset
|
95 | $outstr .= ' <input type="button" id="maintenance_ok" value="OK" style="margin-right: 10px" />'.PHP_EOL; |
7c8f35a43cec
Added maintenance window with only two buttons yet
Michiel Broek <mbroek@mbse.eu>
parents:
117
diff
changeset
|
96 | $outstr .= ' <input type="button" id="maintenance_cancel" value="Cancel" />'.PHP_EOL; |
7c8f35a43cec
Added maintenance window with only two buttons yet
Michiel Broek <mbroek@mbse.eu>
parents:
117
diff
changeset
|
97 | $outstr .= ' </div>'.PHP_EOL; |
7c8f35a43cec
Added maintenance window with only two buttons yet
Michiel Broek <mbroek@mbse.eu>
parents:
117
diff
changeset
|
98 | $outstr .= ' </div> <!-- maintenance_window -->'.PHP_EOL; |
7c8f35a43cec
Added maintenance window with only two buttons yet
Michiel Broek <mbroek@mbse.eu>
parents:
117
diff
changeset
|
99 | |
117 | 100 | $outstr .= ' </div> <!-- jqxWidget -->'.PHP_EOL; |
99 | 101 | $outstr .= ' </body>'.PHP_EOL; |
102 | $outstr .= '</html>'.PHP_EOL; | |
103 | ||
104 | echo $outstr; | |
105 |