Location: PHPKode > projects > Helpdesk Over Web > how/index.php
<?php

// Main Index Page

// Include Configuration File
require_once ('../how/includes/config.inc'); 

// Set the page title and include the HTML header.
$page_title = 'Helpdesk Over Web - Main Menu';
include ('../how/includes/header.html');

// Connect to Database
require_once ('includes/mysql_connect.php');

echo ("<H1>System Main Menu</H1>");

// Echo organisation details, tel no, etc.
$sqlorgdetails = "SELECT OrgName, HelpdeskTel, HelpdeskEmail FROM sysconfig";
$records = range(1, 500);
$result = mysql_query($sqlorgdetails)
   or die("Invalid query: " . mysql_error());
list($orgname, $helpdesktel, $helpdeskemail) = mysql_fetch_row($result);

echo "<H2>$orgname Helpdesk</H2>";

// Check user is logged in. If not present option for logging in.
if(isset($_SESSION['FullName'])) {
	echo "<P><FONT SIZE='-1'><B>Logged In User:</B> {$_SESSION['FullName']}<BR><B>User ID: </B>{$_SESSION['LoggedInUser']}</FONT>";	
	
	// Print menu options depending on user's defined role.
	if($_SESSION['Role'] == 'Administrator')
		{
			echo ("<H4>User Functions</H4><UL>
			<LI TYPE='square'><A HREF='calls/calladmin.php'>Call Management</A>
			<LI TYPE='square'><A HREF='kb/kbadmin.php'>Solutions Knowledgebase</A>
			<LI TYPE='square'><A HREF='users/useradmin.php?sortorder=UserSurname'>Users Database</A>
			<LI TYPE='square'><A HREF='assets/assetadmin.php'>Asset Database</A>			
			<LI TYPE='square'><A HREF='reports/reports.php'>Reporting Functions</A></UL>
			<H4>System Functions</H4><UL>
			<LI TYPE='square'><A HREF='sysmgmt/sysusers.php'>System User Administration</A>
			<LI TYPE='square'><A HREF='sysmgmt/config.php'>Helpdesk Configuration</A>
			</UL>");
		}
		elseif($_SESSION['Role'] == 'Helpdesk Manager')
		{
			echo ("<H4>User Functions</H4><UL>
			<LI TYPE='square'><A HREF='calls/calladmin.php'>Call Management</A>
			<LI TYPE='square'><A HREF='kb/kbadmin.php'>Solutions Knowledgebase</A>
			<LI TYPE='square'><A HREF='users/useradmin.php?sortorder=UserSurname'>Users Database</A>
			<LI TYPE='square'><A HREF='assets/assetadmin.php'>Asset Database</A>			
			<LI TYPE='square'><A HREF='reports/reports.php'>Reporting Functions</A></UL>
			<H4>System Functions</H4><UL>
			<LI TYPE='square'><A HREF='sysmgmt/sysusers.php'>System User Administration</A>
			<LI TYPE='square'><A HREF='sysmgmt/config.php'>Helpdesk Configuration</A>
			</UL>");
		} elseif ($_SESSION['Role'] == 'Engineer')
		{
			echo ("<H4>User Functions</H4><UL>
			<LI TYPE='square'><A HREF='calls/calladmin.php'>Call Management</A>
			<LI TYPE='square'><A HREF='kb/kbadmin.php'>Solutions Knowledgebase</A>
			<LI TYPE='square'><A HREF='users/useradmin.php?sortorder=UserSurname'>Users Database</A>
			<LI TYPE='square'><A HREF='assets/assetadmin.php'>Asset Database</A>			
			<LI TYPE='square'><A HREF='reports/reports.php'>Reporting Functions</A></UL>
			</UL>");
		} elseif ($_SESSION['Role'] == 'Senior Management')
		{
			echo ("<UL>
			<LI TYPE='square'><A HREF='reports/reports.php'>Reporting</A>
			</UL>");
		}

echo "<P>[ <A HREF='logout.php'>Logout</A> ]</P>";
} else {
echo ("
<P>Welcome to <B>H</B>elpdesk <B>O</B>ver <B>W</B>eb (HOW).
<P><B>Instructions:</B>
<UL>
<P>Authorised System Users with an active account should <A HREF='login.php'>login</A> to access full functionality.
<P>Guest Users may browse the <A HREF='kb/kbsearch.php'>Solutions Knowledgebase</A>.
<P>Please contact the Helpdesk Team on $helpdesktel or via email to <A HREF='mailto:$helpdeskemail'>$helpdeskemail</A>.
</UL>
");
}
include_once('includes/footer.html');
?>
Return current item: Helpdesk Over Web