Location: PHPKode > scripts > AskPeople-Free PHP survey application > AskPeople_2_2_2/includes/header.php
<?php

ob_start();

//print_r($_SERVER);

// special hack - link to Deliverance for sending personalised survey invitations to a sample of respondents, only available on customised installations. Ask hide@address.com for more details
$deliverancelink = (file_exists('deliverance/index.php')) ? "<li class='invitations inactive'><a href='deliverance/index.php'>Send invitations</a></li>\n" : null;

if (strlen($_REQUEST['sid'])>0) { // if a surveyid is specified, then set the session cookie to remember it
	$_SESSION['admin_sid'] = $_REQUEST['sid'];
}

if (strlen($_REQUEST['stitle'])>0) { // if a survey title is specified, then set the session cookie to remember it
	$_SESSION['admin_stitle'] = urldecode($_REQUEST['stitle']);
}

if (!eregi("report",$_SERVER['PHP_SELF']) && ($cookieinfo['level']>0 && $cookieinfo['level']<3)) { // a low access level user trying to access something beyond reports
	header("Location: login.inc.php?logout=true&referer={$globalsettings['logoutURL']}");
}

if (eregi("index",$_SERVER['PHP_SELF'])) {
	$thispage = "My projects";
	$tablinks = "
		<li class='dashboardlink'><a href='index.php'>My Projects</a></li>
	  	<li class='help inactive'><a href='http://www.askpeople.co.uk/help/' target='_blank'>Help</a></li>
	  	<li class='logout inactive'><a href=\"login.inc.php?logout=true&referer={$globalsettings['logoutURL']}\">Logout</a></li>
	";
} elseif (eregi("projmgr",$_SERVER['PHP_SELF'])) {
	$thispage = ($_SESSION['admin_stitle']) ? "Project: " . $_SESSION['admin_stitle'] : "Project Manager";
	$tablinks = "
		<li class='dashboardlink inactive'><a href='index.php'>My Projects</a></li>
	  	<li class='projmgr'><a href='projmgr.php'>Project Manager</a></li>
	  	<li class='help inactive'><a href='http://www.askpeople.co.uk/help/' target='_blank'>Help</a></li>
	  	<li class='logout inactive'><a href=\"login.inc.php?logout=true&referer={$globalsettings['logoutURL']}\">Logout</a></li>
		{$deliverancelink}
	";
} elseif (eregi("templatemgr",$_SERVER['PHP_SELF'])) {
	$thispage = "Template Editor";
	$tablinks = "
		<li class='dashboardlink'><a href='index.php'>My Projects</a></li>
	  	<li class='help inactive'><a href='http://www.askpeople.co.uk/help/' target='_blank'>Help</a></li>
	  	<li class='logout inactive'><a href=\"login.inc.php?logout=true&referer={$globalsettings['logoutURL']}\">Logout</a></li>
	";
} elseif (eregi("usermgr",$_SERVER['PHP_SELF'])) {
	$thispage = "User Manager";
	$tablinks = "
		<li class='dashboardlink'><a href='index.php'>My Projects</a></li>
	  	<li class='help inactive'><a href='http://www.askpeople.co.uk/help/' target='_blank'>Help</a></li>
	  	<li class='logout inactive'><a href=\"login.inc.php?logout=true&referer={$globalsettings['logoutURL']}\">Logout</a></li>
	";
} elseif (eregi("filemgr",$_SERVER['PHP_SELF'])) {
	$thispage = "File Manager";
	$tablinks = "
		<li class='dashboardlink'><a href='index.php'>My Projects</a></li>
	  	<li class='help inactive'><a href='http://www.askpeople.co.uk/help/' target='_blank'>Help</a></li>
	  	<li class='logout inactive'><a href=\"login.inc.php?logout=true&referer={$globalsettings['logoutURL']}\">Logout</a></li>
	";
} elseif (eregi("configmgr",$_SERVER['PHP_SELF'])) {
	$thispage = ($_SESSION['admin_stitle'] && !eregi("apconfig",$_GET['filename'])) ? "Settings Manager: " . $_SESSION['admin_stitle'] : "Settings Manager";

	if (eregi("EditProjectConfig",$_SERVER['QUERY_STRING'])) {
		$tablinks = "
			<li class='dashboardlink inactive'><a href='index.php'>My Projects</a></li>
		  	<li class='projmgr'><a href='projmgr.php'>Project Manager</a></li>
			<li class='help inactive'><a href='http://www.askpeople.co.uk/help/' target='_blank'>Help</a></li>
			<li class='logout inactive'><a href=\"login.inc.php?logout=true&referer={$globalsettings['logoutURL']}\">Logout</a></li>
		";
	} else {
		$tablinks = "
			<li class='dashboardlink'><a href='index.php'>My Projects</a></li>
			<li class='help inactive'><a href='http://www.askpeople.co.uk/help/' target='_blank'>Help</a></li>
			<li class='logout inactive'><a href=\"login.inc.php?logout=true&referer={$globalsettings['logoutURL']}\">Logout</a></li>
		";	
	}
} elseif (eregi("install",$_SERVER['PHP_SELF'])) {
	$thispage = "Install AskPeople";
	$tablinks = "
	  	<li class='help inactive'><a href='http://www.askpeople.co.uk/help/'>Help</a></li>
	";
} elseif (eregi("qeditor",$_SERVER['PHP_SELF'])) {
	$thispage = ($_SESSION['admin_stitle']) ? "Questionnaire: " . $_SESSION['admin_stitle'] : "Questionnaire Editor";
	$tablinks = "
		<li class='dashboardlink inactive'><a href='index.php'>My Projects</a></li>
	  	<li class='projmgr'><a href='projmgr.php'>Project Manager</a></li>
	  	<li class='help inactive'><a href='http://www.askpeople.co.uk/help/' target='_blank'>Help</a></li>
	  	<li class='logout inactive'><a href=\"login.inc.php?logout=true&referer={$globalsettings['logoutURL']}\">Logout</a></li>
	";
} elseif (eregi("report",$_SERVER['PHP_SELF'])) {
	$thispage = ($_SESSION['admin_stitle']) ? "Results: " . $_SESSION['admin_stitle'] : "Survey Results";
	
	if($cookieinfo['level']>=3) { // a higher level of access
	  $tablinks = "
		<li class='dashboardlink inactive'><a href='index.php'>My Projects</a></li>
	  	<li class='projmgr '><a href='projmgr.php'>Project Manager</a></li>
	  	<li class='help inactive'><a href='http://www.askpeople.co.uk/help/' target='_blank'>Help</a></li>
	  	<li class='logout inactive'><a href=\"login.inc.php?logout=true&referer={$globalsettings['logoutURL']}\">Logout</a></li>
	  ";
	} else {
	  $tablinks = "
	  	<li class='help inactive'><a href='http://www.askpeople.co.uk/help/' target='_blank'>Help</a></li>
	  	<li class='logout inactive'><a href=\"login.inc.php?logout=true&referer={$globalsettings['logoutURL']}\">Logout</a></li>
	  ";
	}
} elseif (eregi("launch",$_SERVER['PHP_SELF'])) {
	$thispage = ($_SESSION['admin_stitle']) ? "Launch: " . $_SESSION['admin_stitle'] : "Launch";
	$tablinks = "
		<li class='dashboardlink inactive'><a href='index.php'>My Projects</a></li>
	  	<li class='projmgr'><a href='projmgr.php'>Project Manager</a></li>
	  	<li class='help inactive'><a href='http://www.askpeople.co.uk/help/' target='_blank'>Help</a></li>
	  	<li class='logout inactive'><a href=\"login.inc.php?logout=true&referer={$globalsettings['logoutURL']}\">Logout</a></li>
	";
} else {
	$thispage = (isset($thispage)) ? $thispage : "";
	$tablinks = "
	  	<li class='help inactive'><a href='http://www.askpeople.co.uk/help/' target='_blank'>Help</a></li>
	  	<li class='logout inactive'><a href=\"login.inc.php?logout=true&referer={$globalsettings['logoutURL']}\">Logout</a></li>
	";
}

?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta name="generator" content="AskPeople Survey Software by Pentri.com" />
<meta name="author" content="Pentri AskPeople" />
<meta name="robots" content="none" />

<title><? echo ($globalsettings['organisationName'] . ": " . $thispage); ?></title>

<style type="text/css">
	@import "includes/adminstyles.css";
</style>

	<!--[if IE]>
		<style type="text/css">
			#status {
			  top: 0;
			}
			#toptabs {
			  height: 21px;
			}
			#toptabs li {
  		      padding-top: 4px;
  		    }
			.qtextbox {
			  margin-left: -10px;
			}
			.questionform h2 {
			  margin-bottom: -10px;
			}	
		</style>
	<![endif]-->

	<!--[if lt IE 7]>
		<style type="text/css">
			div#container {
				width: expression(document.body.clientWidth > 852? "850px" : "90%");
			}
		</style>
	<![endif]-->
	
<script type="text/javascript" src="includes/adminscripts.js"></script>

<?echo($headerstuff);?>
</head>
<body onload="<?echo($onloadfunc);?>">
<!-- 
<?
  //print_r($_SESSION['admin_sid']);
?>
 -->
	<div id='status'>
		<p class='statusmsg'><?echo($_SESSION['statusmsg']);?></p>
	</div>

  <div id="container">

	<div id="header">
	  <div class="logos">  
		  <a href="http://www.askpeople.co.uk">
			<img src="images/application/askpeople_logo.jpg" alt="AskPeople" width="140" height="40" border="0" />
		  </a>
	  </div>
	
<?php
  $thispage = (strlen($thispage)>50) ? substr($thispage,0,48) . "..." : $thispage;
?>
	
	  <h1><?echo($thispage);?></h1>
	  <ul id="toptabs">
		<?echo($tablinks);?>
	  </ul>
	</div>
	
<?php
	echo ("<!-- ");
	//print_r($_SESSION);
	echo (" -->");
?>
Return current item: AskPeople-Free PHP survey application