1 |
<?php |
---|
2 |
|
---|
3 |
|
---|
4 |
|
---|
5 |
|
---|
6 |
|
---|
7 |
|
---|
8 |
|
---|
9 |
|
---|
10 |
|
---|
11 |
|
---|
12 |
|
---|
13 |
|
---|
14 |
|
---|
15 |
|
---|
16 |
|
---|
17 |
|
---|
18 |
|
---|
19 |
|
---|
20 |
|
---|
21 |
|
---|
22 |
|
---|
23 |
|
---|
24 |
function html_header($title = '', $calendar = False, $refresh = False) { |
---|
25 |
|
---|
26 |
$js = ''; |
---|
27 |
$refresh = ''; |
---|
28 |
|
---|
29 |
if ($calendar == True) { |
---|
30 |
$js .= '<script language="JavaScript" src="js/cal/calendar.js"></script>'; |
---|
31 |
} |
---|
32 |
|
---|
33 |
if ($refresh !== False) { |
---|
34 |
$refresh = '<meta http-equiv="refresh" content="300" />'; |
---|
35 |
} |
---|
36 |
|
---|
37 |
|
---|
38 |
$head = '<?xml version="1.0" encoding="iso-8859-1"?> |
---|
39 |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" |
---|
40 |
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> |
---|
41 |
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> |
---|
42 |
<head> |
---|
43 |
<link rel="stylesheet" href="styles.css" type="text/css" /> |
---|
44 |
'.$refresh.' |
---|
45 |
<title>'.$title.'</title> |
---|
46 |
'.$js.' |
---|
47 |
<meta http-equiv="content-type" content="application/xhtml+xml; charset=iso-8859-1" /> |
---|
48 |
</head> |
---|
49 |
<body> |
---|
50 |
'; |
---|
51 |
|
---|
52 |
return $head; |
---|
53 |
} |
---|
54 |
|
---|
55 |
|
---|
56 |
function html_footer() { |
---|
57 |
global $prog_name, $prog_url, $prog_vers, $date_fmt_str; |
---|
58 |
$foot = '<p><i>This page was generated by <a href="'.$prog_url.'">'.$prog_name.'</a> version '.$prog_vers.' at '.strftime($date_fmt_str).'</i></p> |
---|
59 |
</body> |
---|
60 |
</html> |
---|
61 |
'; |
---|
62 |
return $foot; |
---|
63 |
} |
---|
64 |
|
---|
65 |
|
---|
66 |
function page_header($title = '') { |
---|
67 |
$head = '<table class="head" width="100%"> |
---|
68 |
<tr class="whiteonblack"> |
---|
69 |
<td class="whiteonblack" width="33%" id="left"> <a href="'.$_SERVER['SCRIPT_NAME'].'"><img src="img/net-icon.png" width="48" height="48" alt="Back Home" border="0"></a></td> |
---|
70 |
<td class="whiteonblack" width="33%" id="middle">'.$title.'</td> |
---|
71 |
<td class="whiteonblack" width="33%" id="right"> </td> |
---|
72 |
</tr> |
---|
73 |
|
---|
74 |
<tr class="brownondarkbrown"> |
---|
75 |
<td align="left" class="brownondarkbrown"> |
---|
76 |
|
---|
77 |
</td> |
---|
78 |
<td align="center"> |
---|
79 |
Bugs? Errors? <a class="logintext" href="mailto:andreas@bawue.net">andreas@bawue.net</a>. This is beta™ after all. |
---|
80 |
</td> |
---|
81 |
<td align="right" class="brownondarkbrown"> |
---|
82 |
|
---|
83 |
</td> |
---|
84 |
|
---|
85 |
</tr> |
---|
86 |
</table> |
---|
87 |
'; |
---|
88 |
|
---|
89 |
return $head; |
---|
90 |
} |
---|
91 |
|
---|
92 |
function chartstyle_header() { |
---|
93 |
|
---|
94 |
global $chart_styles; |
---|
95 |
|
---|
96 |
if (@$_REQUEST['nslookup'] == 'on') { |
---|
97 |
$nslookup = 'checked="checked"'; |
---|
98 |
} else { |
---|
99 |
$nslookup = False; |
---|
100 |
} |
---|
101 |
if (@$_REQUEST['rolling'] == 'on') { |
---|
102 |
$rolling = 'checked="checked"'; |
---|
103 |
} else { |
---|
104 |
$rolling = False; |
---|
105 |
} |
---|
106 |
|
---|
107 |
$output = '<div style="margin: 30px auto 30px auto; width: 850px; text-align: left;"><form action='.$_SERVER['SCRIPT_NAME'].'> |
---|
108 |
<table> |
---|
109 |
<tr> |
---|
110 |
<td>Start Date: <input type="text" name="startdate" value="'.$_REQUEST['startdate'].'" size="10" /></td> |
---|
111 |
<td>Start Time: <input type="text" name="starttime" value="'.$_REQUEST['starttime'].'" size="5" /></td> |
---|
112 |
<td>End Date: <input type="text" name="enddate" value="'.$_REQUEST['enddate'].'" size="10" /></td> |
---|
113 |
<td>End Time: <input type="text" name="endtime" value="'.$_REQUEST['endtime'].'" size="5" /></td> |
---|
114 |
<td>Chart Style: <select name="style" size=1>'; |
---|
115 |
|
---|
116 |
foreach ($chart_styles as $style=>$file) { |
---|
117 |
if (@$_REQUEST['style'] == $style) { |
---|
118 |
$output .= '<option selected="selected">'.$style.'</option>'."\n"; |
---|
119 |
} else { |
---|
120 |
$output .= '<option>'.$style.'</option>'."\n"; |
---|
121 |
} |
---|
122 |
} |
---|
123 |
|
---|
124 |
$output .= ' </select><td>Nslookup: <input type="checkbox" name="nslookup" '.$nslookup.'/><td> |
---|
125 |
</select><td>Rolling chart: <input type="checkbox" name="rolling" '.$rolling.'/><td> |
---|
126 |
<td><input type="hidden" name="probe" value="'.$_REQUEST['probe'].'" /><input type="hidden" name="action" value="chart" /><input type="submit" value="Chart!" /></td> |
---|
127 |
</tr> |
---|
128 |
</table> |
---|
129 |
</form></div>'; |
---|
130 |
|
---|
131 |
|
---|
132 |
|
---|
133 |
return $output; |
---|
134 |
|
---|
135 |
|
---|