<?php
#
# Copyright (C) 2008 Red Hat, Inc.
# Author: Andreas Thienemann <athienem@redhat.com>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU Library General Public License as published by
# the Free Software Foundation; version 2 only
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU Library General Public License for more details.
#
# You should have received a copy of the GNU Library General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
# Copyright 2004, 2005 Red Hat, Inc.
#
# AUTHOR: Andreas Thienemann <athienem@redhat.com>
#

// HTML Header
function html_header($title = '', $calendar = False, $refresh = False) {

	$js = '';
	$refresh = '';

	if ($calendar == True) {
		$js .= '<script language="JavaScript" src="js/cal/calendar.js"></script>';
	}

	if ($refresh !== False) {
		$refresh = '<meta http-equiv="refresh" content="300" />';
	}


	$head = '<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
          "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
  <link rel="stylesheet" href="styles.css" type="text/css" /> 
  '.$refresh.'
  <title>'.$title.'</title>
  '.$js.'
  <meta http-equiv="content-type" content="application/xhtml+xml; charset=iso-8859-1" />
</head>
<body>
';

	return $head;
}

// HTML Footer
function html_footer() {
        global $prog_name, $prog_vers, $date_fmt_str;
	$foot = '<p><i>This page was generated by '.$prog_name.' version '.$prog_vers.' at '.strftime($date_fmt_str).'</i></p>
</body>
</html>
';
	return $foot;
}

// The Top-Bar
function page_header($title = '') {
	$head = '<table class="head" width="100%">
   <tr class="whiteonblack">
    <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>
    <td class="whiteonblack" width="33%" id="middle">'.$title.'</td>
    <td class="whiteonblack" width="33%" id="right">&nbsp;</td>
   </tr>

   <tr class="brownondarkbrown">
    <td align="left" class="brownondarkbrown">
     &nbsp;
    </td>
    <td align="center">
     Bugs? Errors? <a class="logintext" href="mailto:andreas@bawue.net">andreas@bawue.net</a>. This is beta&trade; after all.
    </td>
    <td align="right" class="brownondarkbrown">
     &nbsp;
    </td>

   </tr>
  </table>
';

	return $head;
}
