Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
sucs-site
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Alexander Moras
sucs-site
Commits
e2c19113
Commit
e2c19113
authored
10 years ago
by
Thomas Lake
Browse files
Options
Downloads
Patches
Plain Diff
Submit changes found on live site
parent
923f51d1
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
components/printer.php
+5
-8
5 additions, 8 deletions
components/printer.php
components/signup.php
+2
-2
2 additions, 2 deletions
components/signup.php
with
7 additions
and
10 deletions
components/printer.php
+
5
−
8
View file @
e2c19113
...
@@ -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
=
'201
3
-0
9
-0
1 00:00
:0
0
+00'
;
//display printer stats since this time
$timestamp
=
'201
4
-0
2
-0
5 18:29
:0
2
+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!"
;
...
...
This diff is collapsed.
Click to expand it.
components/signup.php
+
2
−
2
View file @
e2c19113
...
@@ -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 "
,
mk
time
())
.
" on "
.
date
(
"l F jS Y"
,
mk
time
())
.
"
\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
.
=
"Us
e
ing 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
"
;
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment