diff --git a/components/printer.php b/components/printer.php index 661eb884763c3a2f04246c156db0326072912d03..83a77ace70971a4512c2e766c918cbaa76ffb4c6 100644 --- a/components/printer.php +++ b/components/printer.php @@ -6,7 +6,7 @@ */ $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"); $sucsDB = NewADOConnection('postgres8'); @@ -87,18 +87,15 @@ for ($i=0;$i<$num;$i++) { } else { $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 $total += $data[$i]['pages']; $table.="</tr>\n"; } //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(); -$date['first'] = getdate("1377993600"); +$date['first'] = getdate("1391624942"); + //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(); @@ -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 $paperweight = round($paperarea*.08, 3); //how much that would weigh $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.="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!"; diff --git a/components/signup.php b/components/signup.php index 0286d216dd99bad06b41005699c7d5170c23b958..b1644087fe59201a4d71dde0bc05c9264c72601b 100644 --- a/components/signup.php +++ b/components/signup.php @@ -269,9 +269,9 @@ if(isset($_REQUEST['signupid'])&&isset($_REQUEST['signuppw'])){ } $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 .= "Useing signup id: ".$signupid."\n"; + $logsmessage .= "Using signup id: ".$signupid."\n"; if($override){ $logsmessage .= "User ".$session->username." overrode validation.\n"; }