session_start();
/* timeReport-expt1.php - 05/15/2003 - Report of log entries, by person */
/*
$filter = $_GET['filter'];
$rptOrder = $_GET['rptOrder'];
echo "Running report -- settings:
\n";
echo "Filter = $filter
\n";
echo "Order = $rptOrder
\n";
7/22:
Include action: CREATED/WORKED... ??
*/
?>
Activity Log
include('setup.php');
include_once("../lib/proclib.php");
$debug = 0;
$rptFormat = 'table';
// @ $db = mysql_connect( "localhost", $connectUser, $connectPwd);
// mysql_select_db($dbname);
$compid = 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';
}
if ( stristr($rptOrder,'title' ) ){
$rptHeader = ' by Project';
}
echo "Reports Menu
\n";
echo "
Activity Log, $rptHeader
\n";
$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, u.fname, u.lname, u.baseRate, u.loadedRate
FROM ZENTRACK_LOGS a, ZENTRACK_TICKETS p, ZENTRACK_USERS u
WHERE a.ticket_id = p.id and a.user_id = u.user_id and a.action <>'CREATED' and
( $filter ) and $where
ORDER BY $rptOrder ;";
debug('qry: '.$query2);
$result2 = mysql_query($query2);
$num_result2 = mysql_num_rows($result2);
if ( $num_result2 == 0) {
echo "No records found. Try again.
\n";
return 0;
}
/* echo "Number of entries: ".$num_result2."