session_start();
/* thp-logReport.php - 05/15/2003 - Report of log entries, by person */
?>
Activity Log
$rptFormat = 'table';
$rptFormat = 'std';
@ $db = mysql_connect( "localhost", $connectUser, $connectPwd);
mysql_select_db($dbname);
$teamid = 1;
$sDate = '2003-01-01';
/** show only own log unless administrator or proj manager **/
include_once("proclib.php");
$where = checkUserRights($valid_accessLevel);
if (! $where ) { return;}
if ( stristr($rptOrder,'Date' ) ){
$rptHeader = ' by Date';
}
if ( stristr($rptOrder,'lname' ) ){
$rptHeader = ' by User & Date';
$rptOrder = 'a.tDate DESC';
}
if ( stristr($rptOrder,'title' ) ){
$rptHeader = ' by Project';
}
echo "Reports Menu
\n";
echo "
Activity Log, $rptHeader
\n";
$query = "select user_id, login,fname,lname from ZENTRACK_USERS where $where order by lname, fname;";
$result = mysql_query($query);
$num_results = mysql_num_rows($result);
/* LOOP FOR EACH PERSON: */
for ( $i1=0; $i1<$num_results; $i1++){
$row = mysql_fetch_array($result);
$user_id = $row["user_id"];
echo "".$row['fname'].' '.$row['lname']." ";
/* LOOP FOR EACH PERSON */
$query2 = "SELECT a.lid, a.ticket_id, a.user_id, a.bin_id, a.created, a.action, a.hours, a.entry, a.tDate, p.title as projname FROM ZENTRACK_LOGS a, ZENTRACK_TICKETS p WHERE a.ticket_id = p.id and a.user_id = $user_id and a.action <>'CREATED' and $filter ORDER BY $rptOrder ;";
$result2 = mysql_query($query2);
$num_result2 = mysql_num_rows($result2);
/* echo "Number of entries: ".$num_result2.""; */
if ( $rptFormat == 'table') {
echo "