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

// Reporting Menu

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

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

// Connect to Database
require_once ('../includes/mysql_connect.php');
	
// Calculate current month.
$month = date("Y-m");

// Output query results in a table.
echo ("<H1>Report Functions</H1>");
echo ("<P>Options are shown in the menu below. ");
if($_SESSION['Role'] == 'Helpdesk Manager')
		{
echo ("<UL>
<H4><A HREF='dailysummary.php'>Today's Daily Summary</A></H4>
<H4><A HREF='monthsummary.php?month=$month'>Current Month Summary</A></H4>
<H4><A HREF='myreport-today.php'>My Performance Report - Today</A></H4>
<H4><A HREF='myreport-month.php?month=$month'>My Performance Report - This Month</A></H4>
<P><b>Individual Engineer Reports</b></P>
<FORM ACTION='engrreport.php' METHOD='post'>
<select name='engineer'>");
	$sql = "SELECT * FROM systemusers WHERE Role != 'Senior Management' AND Role != 'Administrator' ORDER BY HOWLogin;";
	$catlist = mysql_query($sql)
	   or die("Invalid query: " . mysql_error());
	while($i = mysql_fetch_row($catlist)) 
		{ 
		echo ("<OPTION>$i[0]</OPTION>");
		}
echo ("</SELECT></td>&nbsp;&nbsp;<INPUT TYPE='submit' NAME='submit' VALUE='View Report'></td></tr></table></form>");
echo ("<td>&nbsp;&nbsp;
</UL>");
} elseif($_SESSION['Role'] == 'Senior Management')
		{
echo ("<UL>
<H4><A HREF='dailysummary.php'>Today's Daily Summary</A></H4>
<H4><A HREF='monthsummary.php?month=$month'>Current Month Summary</A></H4>
<P><b>Individual Engineer Reports</b></P>
<FORM ACTION='engrreport.php' METHOD='post'>
<select name='engineer'>");
	$sql = "SELECT * FROM systemusers WHERE Role != 'Senior Management' AND Role != 'Administrator' ORDER BY HOWLogin;";
	$catlist = mysql_query($sql)
	   or die("Invalid query: " . mysql_error());
	while($i = mysql_fetch_row($catlist)) 
		{ 
		echo ("<OPTION>$i[0]</OPTION>");
		}
echo ("</SELECT></td><td>&nbsp;&nbsp;<INPUT TYPE='submit' NAME='submit' VALUE='View Report'></td></tr></table></form>
</UL>");
} elseif ($_SESSION['Role'] == 'Engineer')
	{
echo ("<UL>
<H4><A HREF='myreport-today.php'>My Performance Report - Today</A></H4>
<H4><A HREF='myreport-month.php?month=$month'>My Performance Report - This Month</A></H4>
</UL>");
}

echo "<P>[ <A HREF='../index.php'>Main Menu</A> ]</P>";
// Include standard HTML footer
include ('../includes/footer.html');
?>
Return current item: Helpdesk Over Web