Hello,
I am trying out to construct a performance monitoring system (par tof my project at college), I am now trying to create the pages for reports and wish to refine even further with a reporting tool that can display for me performance of staff in a newsroom. I am using their stories as a basis. Below is a a file I called finreport.php. It is supposed to show a general page with totals of staff performance and I wanted to arrange them according to the staff with the highest count of articles. In case this interests you, please help me complete this project. I can supply the other files as well, just to give you a whole picture.
<?php
session_start();
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"><!-- InstanceBegin template="/Templates/index.dwt.php" codeOutsideHTMLIsLocked="false" -->
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<meta name="description" content=" System for Monitoring Performance of Journalists or media house staff" />
<meta name="keywords" content="Newsroom Performance Monitoring System" />
<meta name="author" content="Davis Joseph Weddi (O6/BIT/KC/070)" />
<link rel="stylesheet" type="text/css" href="styles/nptsv1.css" />
<!-- InstanceBeginEditable name="doctitle" -->
<title>NEWSROOM Performance Tracking System</title>
<!-- InstanceEndEditable -->
<!-- InstanceBeginEditable name="head" --><!-- InstanceEndEditable -->
</head>
<body>
<div id="top">
<p class="hide">Skip to: <a href="#sitemenu" accesskey="2">Site menu</a> | <a href="#maincontent" accesskey="3">Main content</a></p>
</div>
<div id="container">
<div id="main">
<div id="logo">
<h1>[<a href="login.php" accesskey="4">NPMS</a>]</h1>
<span id="tagline">Newsroom Performance<br />
Monitoring System</span></div>
<div id="intro">
<h2 id="maincontent">Welcome <?php echo $_SESSION['name'] ; ?> <a href="admin/logout.php"> Logout</a></h2>
<p> </p>
</div>
<!-- InstanceBeginEditable name="EditRegion1" -->
<p> </p>
<p>
</p>
<!-- InstanceEndEditable --><!-- InstanceBeginEditable name="EditRegion2" -->
<h2 class="headerstyle">General Report </h2>
<p><fieldset>
<legend></legend>
<form method="post" action="<?php echo $PHP_SELF;?>">
<tr><td align="right">Username</td><td><select name="uname2">
<option value="">Choose</option>
<?php
require("admin/connections.php");
$q = "select uname from users order by uname";
$result = mysql_query($q) or die("Error");
while($rw = mysql_fetch_row($result))
{
echo"<option value='$rw[0]'>$rw[0]</option>";
}
?></select></td><td><input type="submit" name="viewuser" value="Search" /></td></tr>
</form></p>
<p><?php
require("admin/connections.php");
$use =$_POST['uname2'];
if($_SESSION['role']=='reporter' || $_SESSION['role']=='editor')
{
// select and display the stories for the editor and allow them to add points
$user =$_SESSION['uid'];
$sq ="SELECT * from stories where journalist ='$user' ";
$sq_im = mysql_query($sq);
echo "<table>
<tr><th>Story ID</th><th>Title</th><th>Date</th><th>Page</th><th>Category</th><th>Journalist</th><th>Section</th><th>Amount</th><th>Rating</th><th>Status</th></tr>
";
while($row =mysql_fetch_row($sq_im))
{
$id =$row[0];
$title =$row[1];
$dte =$row[2];
$page =$row[3];
$category =$row[4];
$journalist =$row[5];
$section =$row[6];
$rat =$row[7];
$amount =$row[8];
$status =$row[9];
echo "<tr><td>$id</td><td>$title</td><td>$dte</td><td>$page</td><td>$category</td><td>$journalist</td><td>$section</td><td>$rat</td><td>$amount</td><td>$status</td></tr>";
}
echo "</table>";
}
if($_SESSION['role']=='accounts')
{
$user =$_SESSION['uid'];
if(empty($use))
{
$sq ="SELECT * from stories";
}
else
{
$sq ="SELECT * from stories where journalist ='$use' ";
}
$sq_im = mysql_query($sq);
echo "<table>
<tr><th>Title</th><th>Date</th><th>Page</th><th>Category</th><th>Journalist</th><th>Section</th><th>Rating</th><th>Amount</th><th>Status</th></tr>
";
while($row =mysql_fetch_row($sq_im))
{
$id =$row[0];
$title =$row[1];
$dte =$row[2];
$page =$row[3];
$category =$row[4];
$journalist =$row[5];
$section =$row[6];
$rat =$row[7];
$amount =$row[8];
$status =$row[9];
echo "<tr><td>$title</td><td>$dte</td><td>$page</td><td>$category</td><td>$journalist</td><td>$section</td><td>$amount</td><td>$rat</td><td>$status</td></tr>";
}
echo "</table>";
}
else {
echo "You are not authorised to view this page";
}
?>
</p>
<p class="internallink"> </p>
<!-- InstanceEndEditable --></div>
<div id="sidebar">
<h2 id="sitemenu" class="sidelink menuheader">Menu:</h2>
<a class="sidelink" href="home.php"> Home</a><span class="hide"> | </span><span class="hide"> | </span>
<a class="sidelink" href="summary.php"> Reports</a><span class="hide"> | </span><span class="hide"> | </span>
<a class="hide" href="#top" accesskey="1">Top of page</a>
<h3>Important note</h3>
<p>This platform has been developed for use in Ugandan Newsrooms.</p>
</div>
<div class="clear"> </div>
</div>
<div id="footer">
</div>
</body>
<!-- InstanceEnd --></html>