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

Printer shame now shows this years data

parent 2d9d51b8
No related branches found
No related tags found
No related merge requests found
......@@ -6,7 +6,7 @@
*/
$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
$timestamp = '2013-09-01 00:00:00+00'; //display printer stats since this time
$smarty->assign('title',"Printer Statistics");
$sucsDB = NewADOConnection('postgres8');
......@@ -27,7 +27,7 @@ for ($i=0;$i<$num;$i++) {
$res->Close();
//get the second since epoch
$thisSecond = gmmktime();
$thisSecond = time();
//for each user who has printed stuff add the first printed time (since epoch) to the array
for ($i=0;$i<$num;$i++) {
$res = $sucsDB->Execute("select date_part('epoch',start) as first from printer where username ='".$data[$i]['username']."' order by start asc limit 1;");
......@@ -94,10 +94,11 @@ for ($i=0;$i<$num;$i++) {
}
//get the first print date
$res = $sucsDB->Execute("select date_part('epoch',start) as first from printer order by start asc limit 1;");
$temp = $res->FetchRow();
$date['first'] = getdate($temp['first']);
$res->Close();
//$res = $sucsDB->Execute("select date_part('epoch',start) as first from printer order by start asc limit 1;");
//$temp = $res->FetchRow();
//$date['first'] = getdate($temp['first']);
//$res->Close();
$date['first'] = getdate("1377993600");
//get the last print date
$res = $sucsDB->Execute("select date_part('epoch',start) as last from printer order by start desc limit 1;");
$temp = $res->FetchRow();
......
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