Location: PHPKode > projects > Centralized Timeregistration System > website/includes/header.php
<?php
/***************************************************************************
          header.php  -  Common header. prints header (well duh )
                             -------------------
    begin                : May 6, 2002
    copyright            : (C) 2002 by Harm Kolk & Onno de Jong 
    email                : hide@address.com 
                         : hide@address.com 

    $Id: header.php,v 1.14 2002/06/13 14:22:45 onnozel Exp $

    This file is part of the myCts project, specifically it belongs to
    the website.
 ***************************************************************************/

/***************************************************************************
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 ***************************************************************************/

define('INC_HEADER', true);
class header
{

	var $title;
	var $help;
	var $user_id;

	function header($title='MyCTS Default Title', $user_id=0)
	{
		if(!defined('HEADER_PUTOUT'))
		{
			define('HEADER_PUTOUT', TRUE);
		}

		global $HTTP_SESSION_VARS;
		$this->title = $title;
		if($user_id != 0)
		{
			$this->user_id=$user_id;
		}
		else
		{
			$this->user_id = (isset($HTTP_SESSION_VARS['user_id'])) ? $HTTP_SESSION_VARS['user_id'] : 0;
		}
		$this->help = '';
	}

	function set_help($help_var)
	{
		$this->help = $help_var;
	}

	function set_title($title_var)
	{
		$this->title = $title_var;
	}

	function do_print()
	{
		global $template;
		global $lang;
		global $db;
		if(strcmp($this->help, '') == 0 )
		{
			$this->help = $lang['global']['no_help'];
		}
		$template->set_filenames(
			array(
				'header' => 'head.tpl.htm'
				)
			);
		
		
		if($this->user_id != 0)
		{
			$query = "SELECT rhs_rightid FROM auth WHERE usr_userid=" . $this->user_id . " AND rhs_rightid=" . AUTH_ADMIN;
			$result = $db->query($query);
			if( $row = $result->fetchRow())
			{
				$template->assign_block_vars("switch_project_admin", array());
				$template->assign_vars(
					array(
						'LANG_PROJECT_ADMIN' => $lang[MENU]['project_admin']
					)
				);
			}
			$template->assign_block_vars("switch_logged_in", array());
		}
		else
		{
			$template->assign_block_vars("switch_logged_out", array());
		}

		$template->assign_vars(
				array(
				'SIDEBAR' => $this->help,
				'title' => $this->title,
				'LANG_SEARCH_FOR' => $lang[HEADER]['search_for'],
				'LANG_IN_THE' => $lang[HEADER]['in_the'],
				'LANG_MEMBERS_AREA' => $lang[HEADER]['members'],
				'LANG_ACTIVITY_AREA' => $lang[HEADER]['activity'],
				'LANG_GO' => $lang[HEADER]['go'],
				'LANG_LOGIN' => $lang[MENU]['login'],
				'LANG_REGISTRATION' => $lang[MENU]['registration'],
				'LANG_DOWNLOADS' => $lang[MENU]['downloads'],
				'LANG_FAQ' => $lang[MENU]['faq'],
				'LANG_MODIFY_PROFILE' => $lang[MENU]['modify_profile'],
				'LANG_STATISTICS' => $lang[MENU]['statistics'],
				'LANG_LOGOUT' => $lang[MENU]['logout']	,
				)
			);

		$template->pparse('header');


	}

} /* end of class */
?>
Return current item: Centralized Timeregistration System