www-thermferm/utilities.php

changeset 137
e4518fd9b626
parent 134
f05601490415
child 155
0d86f3c0a07b
equal deleted inserted replaced
136:264e5ee5abfc 137:e4518fd9b626
44 return !strncmp($haystack, $needle, strlen($needle)); 44 return !strncmp($haystack, $needle, strlen($needle));
45 } 45 }
46 46
47 47
48 48
49 function build_header() 49 function build_header($heading)
50 { 50 {
51 $outstr = '<!DOCTYPE html>'.PHP_EOL; 51 $outstr = '<!DOCTYPE html>'.PHP_EOL;
52 $outstr .= '<html>'.PHP_EOL; 52 $outstr .= '<html>'.PHP_EOL;
53 $outstr .= ' <head>'.PHP_EOL; 53 $outstr .= ' <head>'.PHP_EOL;
54 $outstr .= ' <meta http-equiv="content-type" content="text/html; charset=utf-8" />'.PHP_EOL; 54 $outstr .= ' <meta http-equiv="content-type" content="text/html; charset=utf-8" />'.PHP_EOL;
55 $outstr .= ' <title>ThermFerm monitor</title>'.PHP_EOL; 55 $outstr .= ' <title>'.$heading.'</title>'.PHP_EOL;
56 $outstr .= ' <link type="text/css" href="css/style.css" rel="stylesheet" media="all" />'.PHP_EOL; 56 $outstr .= ' <link type="text/css" href="css/style.css" rel="stylesheet" media="all" />'.PHP_EOL;
57 $outstr .= ' </head>'.PHP_EOL; 57 $outstr .= ' </head>'.PHP_EOL;
58 $outstr .= ' <body class="default">'.PHP_EOL; 58 $outstr .= ' <body class="default">'.PHP_EOL;
59 $outstr .= ' <div id="jqxWidget">'.PHP_EOL; 59 $outstr .= ' <div id="jqxWidget">'.PHP_EOL;
60 $outstr .= ' <div id="header">'.PHP_EOL; 60 $outstr .= ' <div id="header">'.PHP_EOL;
78 78
79 return $outstr; 79 return $outstr;
80 } 80 }
81 81
82 82
83
84 /*
85 * Goto URL. Works also after headers have been sent.
86 */
87 function load($url) {
88 echo'
89 <script>
90 if (top.location != self.location) {
91 top.location = "'.$url.'"
92 }
93 {location.href="'.$url.'";}
94 </script>';
95 }
96

mercurial