www-thermferm/utilities.php

changeset 397
00ca08f5a6f8
parent 379
50675fd80fed
equal deleted inserted replaced
396:66d4e137b99d 397:00ca08f5a6f8
19 * You should have received a copy of the GNU General Public License 19 * You should have received a copy of the GNU General Public License
20 * along with ThermFerm; see the file COPYING. If not, write to the Free 20 * along with ThermFerm; see the file COPYING. If not, write to the Free
21 * Software Foundation, 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. 21 * Software Foundation, 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
22 *****************************************************************************/ 22 *****************************************************************************/
23 23
24 $my_style = 'ui-redmond';
25
24 26
25 function open_socket() 27 function open_socket()
26 { 28 {
27 $sock = socket_create(AF_INET, SOCK_STREAM, SOL_TCP); 29 $sock = socket_create(AF_INET, SOCK_STREAM, SOL_TCP);
28 30
135 } 137 }
136 138
137 139
138 function build_header($heading) 140 function build_header($heading)
139 { 141 {
142 global $my_style;
143
140 $answer = send_cmd('GLOBAL GET'); 144 $answer = send_cmd('GLOBAL GET');
141 $arr = explode("\r\n", $answer); 145 $arr = explode("\r\n", $answer);
142 $version = "?"; 146 $version = "?";
143 147
144 if (startsWith($arr[0], "213")) { 148 if (startsWith($arr[0], "213")) {
158 $outstr .= '<html>'.PHP_EOL; 162 $outstr .= '<html>'.PHP_EOL;
159 $outstr .= ' <head>'.PHP_EOL; 163 $outstr .= ' <head>'.PHP_EOL;
160 $outstr .= ' <meta http-equiv="content-type" content="text/html; charset=utf-8" />'.PHP_EOL; 164 $outstr .= ' <meta http-equiv="content-type" content="text/html; charset=utf-8" />'.PHP_EOL;
161 $outstr .= ' <title>'.$heading.'</title>'.PHP_EOL; 165 $outstr .= ' <title>'.$heading.'</title>'.PHP_EOL;
162 $outstr .= ' <link type="text/css" href="css/style.css" rel="stylesheet" media="all" />'.PHP_EOL; 166 $outstr .= ' <link type="text/css" href="css/style.css" rel="stylesheet" media="all" />'.PHP_EOL;
167 $outstr .= ' <link type="text/css" href="jqwidgets/styles/jqx.base.css" rel="stylesheet" />'.PHP_EOL;
168 $outstr .= ' <link type="text/css" href="jqwidgets/styles/jqx.'.$my_style.'.css" rel="stylesheet" />'.PHP_EOL;
169 $outstr .= ' <script type="text/javascript" src="js/jquery-2.1.1.min.js"></script>'.PHP_EOL;
170 $outstr .= ' <script type="text/javascript" src="jqwidgets/jqxcore.js"></script>'.PHP_EOL;
171 $outstr .= ' <script type="text/javascript" src="jqwidgets/jqxwindow.js"></script>'.PHP_EOL;
172 $outstr .= ' <script type="text/javascript" src="jqwidgets/jqxbuttons.js"></script>'.PHP_EOL;
163 $outstr .= ' </head>'.PHP_EOL; 173 $outstr .= ' </head>'.PHP_EOL;
164 $outstr .= ' <body class="default">'.PHP_EOL; 174 $outstr .= ' <body class="default">'.PHP_EOL;
165 $outstr .= ' <div id="jqxWidget">'.PHP_EOL; 175 $outstr .= ' <div id="jqxWidget">'.PHP_EOL;
166 $outstr .= ' <div id="header">'.PHP_EOL; 176 $outstr .= ' <div id="header">'.PHP_EOL;
167 $outstr .= ' <div id="title">'.PHP_EOL; 177 $outstr .= ' <div id="title">'.PHP_EOL;
168 $outstr .= ' ThermFerm '.$version.PHP_EOL; 178 $outstr .= ' ThermFerm '.$version.PHP_EOL;
169 $outstr .= ' </div>'.PHP_EOL; 179 $outstr .= ' </div>'.PHP_EOL;
170 $outstr .= ' <form action="maintenance.php" style="margin:30px; float:right">'.PHP_EOL; 180 $outstr .= ' <form action="maintenance.php" style="margin:30px; float:right">'.PHP_EOL;
171 $outstr .= ' <input type="submit" style="width: 150px; height: 25px;" value="Maintenance Panel" />'.PHP_EOL; 181 $outstr .= ' <input type="submit" id="maintenance" value="Maintenance panel" />'.PHP_EOL;
172 $outstr .= ' </form>'.PHP_EOL; 182 $outstr .= ' </form>'.PHP_EOL;
173 $outstr .= ' </div> <!-- header -->'.PHP_EOL; 183 $outstr .= ' </div> <!-- header -->'.PHP_EOL;
174 $outstr .= ' <div id="content">'.PHP_EOL; 184 $outstr .= ' <div id="content">'.PHP_EOL;
175 185
176 return $outstr; 186 return $outstr;

mercurial