root/trunk/flowmon-web/common.inc.php

Revision 1, 2.7 kB (checked in by ixs, 16 years ago)

initial checkin of RH revision

Line 
1 <?php
2 #
3 # Copyright (C) 2008 Red Hat, Inc.
4 # Author: Andreas Thienemann <athienem@redhat.com>
5 #
6 # This program is free software; you can redistribute it and/or modify
7 # it under the terms of the GNU Library General Public License as published by
8 # the Free Software Foundation; version 2 only
9 #
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13 # GNU Library General Public License for more details.
14 #
15 # You should have received a copy of the GNU Library General Public License
16 # along with this program; if not, write to the Free Software
17 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 # Copyright 2004, 2005 Red Hat, Inc.
19 #
20 # AUTHOR: Andreas Thienemann <athienem@redhat.com>
21 #
22
23 // HTML Header
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 // HTML Footer
56 function html_footer() {
57         global $prog_name, $prog_vers, $date_fmt_str;
58     $foot = '<p><i>This page was generated by '.$prog_name.' version '.$prog_vers.' at '.strftime($date_fmt_str).'</i></p>
59 </body>
60 </html>
61 ';
62     return $foot;
63 }
64
65 // The Top-Bar
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/head.png" width="113" height="31" alt="Back Home" border="0">-->flowmon</a></td>
70     <td class="whiteonblack" width="33%" id="middle">'.$title.'</td>
71     <td class="whiteonblack" width="33%" id="right">&nbsp;</td>
72    </tr>
73
74    <tr class="brownondarkbrown">
75     <td align="left" class="brownondarkbrown">
76      &nbsp;
77     </td>
78     <td align="center">
79      Bugs? Errors? <a class="logintext" href="mailto:andreas@bawue.net">andreas@bawue.net</a>. This is beta&trade; after all.
80     </td>
81     <td align="right" class="brownondarkbrown">
82      &nbsp;
83     </td>
84
85    </tr>
86   </table>
87 ';
88
89     return $head;
90 }
91
Note: See TracBrowser for help on using the browser.