From e2c1911304be60d2ca5e913d1cc71e5e65b5275f Mon Sep 17 00:00:00 2001
From: Tom Lake <tswsl1989@sucs.org>
Date: Mon, 31 Mar 2014 15:10:35 +0000
Subject: [PATCH] Submit changes found on live site

---
 components/printer.php | 13 +++++--------
 components/signup.php  |  4 ++--
 2 files changed, 7 insertions(+), 10 deletions(-)

diff --git a/components/printer.php b/components/printer.php
index 661eb88..83a77ac 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 0286d21..b164408 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";
 						    }
-- 
GitLab