134 { |
134 { |
135 return !strncmp($haystack, $needle, strlen($needle)); |
135 return !strncmp($haystack, $needle, strlen($needle)); |
136 } |
136 } |
137 |
137 |
138 |
138 |
139 |
|
140 function build_header($heading) |
139 function build_header($heading) |
141 { |
140 { |
|
141 $answer = send_cmd('GLOBAL GET'); |
|
142 $arr = explode("\r\n", $answer); |
|
143 $version = "?"; |
|
144 |
|
145 if (startsWith($arr[0], "213")) { |
|
146 $j = 1; |
|
147 while (1) { |
|
148 if (strcmp($arr[$j], ".") == 0) |
|
149 break; |
|
150 $f = explode(",", $arr[$j]); |
|
151 |
|
152 if ($f[0] == "RELEASE") |
|
153 $version = $f[1]; |
|
154 $j++; |
|
155 } |
|
156 } |
|
157 |
142 $outstr = '<!DOCTYPE html>'.PHP_EOL; |
158 $outstr = '<!DOCTYPE html>'.PHP_EOL; |
143 $outstr .= '<html>'.PHP_EOL; |
159 $outstr .= '<html>'.PHP_EOL; |
144 $outstr .= ' <head>'.PHP_EOL; |
160 $outstr .= ' <head>'.PHP_EOL; |
145 $outstr .= ' <meta http-equiv="content-type" content="text/html; charset=utf-8" />'.PHP_EOL; |
161 $outstr .= ' <meta http-equiv="content-type" content="text/html; charset=utf-8" />'.PHP_EOL; |
146 $outstr .= ' <title>'.$heading.'</title>'.PHP_EOL; |
162 $outstr .= ' <title>'.$heading.'</title>'.PHP_EOL; |
147 $outstr .= ' <link type="text/css" href="css/style.css" rel="stylesheet" media="all" />'.PHP_EOL; |
163 $outstr .= ' <link type="text/css" href="css/style.css" rel="stylesheet" media="all" />'.PHP_EOL; |
148 $outstr .= ' </head>'.PHP_EOL; |
164 $outstr .= ' </head>'.PHP_EOL; |
149 $outstr .= ' <body class="default">'.PHP_EOL; |
165 $outstr .= ' <body class="default">'.PHP_EOL; |
150 $outstr .= ' <div id="jqxWidget">'.PHP_EOL; |
166 $outstr .= ' <div id="jqxWidget">'.PHP_EOL; |
151 $outstr .= ' <div id="header">'.PHP_EOL; |
167 $outstr .= ' <div id="header">'.PHP_EOL; |
|
168 $outstr .= ' <div id="title">'.PHP_EOL; |
|
169 $outstr .= ' ThermFerm '.$version.PHP_EOL; |
|
170 $outstr .= ' </div>'.PHP_EOL; |
152 $outstr .= ' <form action="maintenance.php" style="margin:30px; float:right">'.PHP_EOL; |
171 $outstr .= ' <form action="maintenance.php" style="margin:30px; float:right">'.PHP_EOL; |
153 $outstr .= ' <input type="submit" style="width: 150px; height: 25px;" value="Maintenance Panel" />'.PHP_EOL; |
172 $outstr .= ' <input type="submit" style="width: 150px; height: 25px;" value="Maintenance Panel" />'.PHP_EOL; |
154 $outstr .= ' </form>'.PHP_EOL; |
173 $outstr .= ' </form>'.PHP_EOL; |
155 $outstr .= ' </div> <!-- header -->'.PHP_EOL; |
174 $outstr .= ' </div> <!-- header -->'.PHP_EOL; |
156 $outstr .= ' <div id="content">'.PHP_EOL; |
175 $outstr .= ' <div id="content">'.PHP_EOL; |