$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;");