Skip to content
Snippets Groups Projects
Commit e2c19113 authored by Thomas Lake's avatar Thomas Lake :wrench:
Browse files

Submit changes found on live site

parent 923f51d1
No related branches found
No related tags found
No related merge requests found
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
*/ */
$max=10; //Set this to number of users to display in chart $max=10; //Set this to number of users to display in chart
$timestamp = '2013-09-01 00:00:00+00'; //display printer stats since this time $timestamp = '2014-02-05 18:29:02+00'; //display printer stats since this time
$smarty->assign('title',"Printer Statistics"); $smarty->assign('title',"Printer Statistics");
$sucsDB = NewADOConnection('postgres8'); $sucsDB = NewADOConnection('postgres8');
...@@ -87,18 +87,15 @@ for ($i=0;$i<$num;$i++) { ...@@ -87,18 +87,15 @@ for ($i=0;$i<$num;$i++) {
} else { } else {
$table.="<td>{$data[$i]['month']}</td>\n"; $table.="<td>{$data[$i]['month']}</td>\n";
} }
$table.="<td>".sprintf("£ %01.2f",round(0.1*$data[$i]['pages'],2))."</td>\n"; $table.="<td>".sprintf("£ %01.2f",round(0.05*$data[$i]['pages'],2))."</td>\n";
//add this users useage to the total //add this users useage to the total
$total += $data[$i]['pages']; $total += $data[$i]['pages'];
$table.="</tr>\n"; $table.="</tr>\n";
} }
//get the first print date //get the first print date
//$res = $sucsDB->Execute("select date_part('epoch',start) as first from printer order by start asc limit 1;"); $date['first'] = getdate("1391624942");
//$temp = $res->FetchRow();
//$date['first'] = getdate($temp['first']);
//$res->Close();
$date['first'] = getdate("1377993600");
//get the last print date //get the last print date
$res = $sucsDB->Execute("select date_part('epoch',start) as last from printer order by start desc limit 1;"); $res = $sucsDB->Execute("select date_part('epoch',start) as last from printer order by start desc limit 1;");
$temp = $res->FetchRow(); $temp = $res->FetchRow();
...@@ -145,7 +142,7 @@ $out.="Last Data - ".$date['last'][weekday].", ".$date['last'][mday]." ".$date[ ...@@ -145,7 +142,7 @@ $out.="Last Data - ".$date['last'][weekday].", ".$date['last'][mday]." ".$date[
$paperarea = round(0.21*0.297*$total,3); //area of paper $paperarea = round(0.21*0.297*$total,3); //area of paper
$paperweight = round($paperarea*.08, 3); //how much that would weigh $paperweight = round($paperarea*.08, 3); //how much that would weigh
$numtrees = round($paperweight/730.296, 6); //*very* roughly how many trees that would be $numtrees = round($paperweight/730.296, 6); //*very* roughly how many trees that would be
$cost = sprintf("£%01.2f",round(0.1*$total,2)); $cost = sprintf("£%01.2f",round(0.05*$total,2));
$out.="<p>That's ".$paperarea."m<sup>2</sup> of paper, weighing ".$paperweight."kg!<br>\n"; $out.="<p>That's ".$paperarea."m<sup>2</sup> of paper, weighing ".$paperweight."kg!<br>\n";
$out.="This is equivalent to approximately ".$numtrees." trees.<br>\n"; $out.="This is equivalent to approximately ".$numtrees." trees.<br>\n";
$out.="That would have cost our members a grand total of ".$cost." if it were printed in the library.. not bad for £5 each!"; $out.="That would have cost our members a grand total of ".$cost." if it were printed in the library.. not bad for £5 each!";
......
...@@ -269,9 +269,9 @@ if(isset($_REQUEST['signupid'])&&isset($_REQUEST['signuppw'])){ ...@@ -269,9 +269,9 @@ if(isset($_REQUEST['signupid'])&&isset($_REQUEST['signuppw'])){
} }
$logsmessage = "New user '".$fields['username']."' has been created on SUCS\n"; $logsmessage = "New user '".$fields['username']."' has been created on SUCS\n";
$logsmessage .= "at: ".date("H:i ",mktime())." on ".date("l F jS Y", mktime())."\n"; $logsmessage .= "at: ".date("H:i ",time())." on ".date("l F jS Y", time())."\n";
$logsmessage .= "From: ".$_SERVER['REMOTE_ADDR']."\n"; $logsmessage .= "From: ".$_SERVER['REMOTE_ADDR']."\n";
$logsmessage .= "Useing signup id: ".$signupid."\n"; $logsmessage .= "Using signup id: ".$signupid."\n";
if($override){ if($override){
$logsmessage .= "User ".$session->username." overrode validation.\n"; $logsmessage .= "User ".$session->username." overrode validation.\n";
} }
......
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