Skip to content
Snippets Groups Projects
Commit 15f50d07 authored by Callum Massey's avatar Callum Massey
Browse files

Added start date for printer shame script

parent 0b69245c
No related branches found
No related tags found
No related merge requests found
......@@ -6,6 +6,8 @@
*/
$max=10; //Set this to number of users to display in chart
$timestamp = '2012-09-01 00:00:00+00'; //display printer stats since this time
$smarty->assign('title',"Printer Statistics");
$sucsDB = NewADOConnection('postgres8');
$sucsDB->Connect('dbname=sucs user=apache');
......@@ -15,7 +17,7 @@ $sucsDB->SetFetchMode(ADODB_FETCH_ASSOC);
$table="<table border=1 cellpadding=3>\n<tr>\n<th>Username</th>\n<th>Pages</th>\n<th>Projected Monthly Usage</th>\n<th>Printed This Month</th>\n<th>What it would cost in the library</th></tr>\n";
//pull in all the current users (ie not old) who have printed stuff
$res = $sucsDB->Execute("select username, sum(pages) as pages from printer where username != 'old' group by username order by sum(pages) desc");
$res = $sucsDB->Execute("select username, sum(pages) as pages from printer where username != 'old' AND start > '".$timestamp."' group by username order by sum(pages) desc");
$num = $res->RecordCount();
//for each row stuff the infomation into an array, then free up the database resorces
for ($i=0;$i<$num;$i++) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment