Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
S
smradius
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
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
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
shail
smradius
Commits
4abf3cc1
Commit
4abf3cc1
authored
15 years ago
by
Robert Anderson
Browse files
Options
Downloads
Patches
Plain Diff
Code cleanup
parent
f3e7bad4
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
webui/user/index.php
+52
-53
52 additions, 53 deletions
webui/user/index.php
with
52 additions
and
53 deletions
webui/user/index.php
+
52
−
53
View file @
4abf3cc1
...
@@ -31,16 +31,16 @@ function displayDetails() {
...
@@ -31,16 +31,16 @@ function displayDetails() {
global
$DB_TABLE_PREFIX
;
global
$DB_TABLE_PREFIX
;
$username
=
$_SESSION
[
'username'
];
$username
=
$_SESSION
[
'username'
];
# Get user's ID
# Get user's ID
$sql
=
"
$sql
=
"
SELECT
SELECT
ID
ID
FROM
FROM
${DB_TABLE_PREFIX}users
${DB_TABLE_PREFIX}users
WHERE
WHERE
Username = '
$username
'
Username = '
$username
'
"
;
"
;
$res
=
$db
->
query
(
$sql
);
$res
=
$db
->
query
(
$sql
);
$row
=
$res
->
fetchObject
();
$row
=
$res
->
fetchObject
();
...
@@ -51,21 +51,21 @@ function displayDetails() {
...
@@ -51,21 +51,21 @@ function displayDetails() {
$sql
=
"
$sql
=
"
SELECT
SELECT
AcctSessionTime,
AcctSessionTime,
AcctInputOctets,
AcctInputOctets,
AcctInputGigawords,
AcctInputGigawords,
AcctOutputOctets,
AcctOutputOctets,
AcctOutputGigawords
AcctOutputGigawords
FROM
FROM
${DB_TABLE_PREFIX}accounting
${DB_TABLE_PREFIX}accounting
WHERE
WHERE
Username = '
$username
'
Username = '
$username
'
AND
AND
EventTimestamp >= '
$currentMonth
'
EventTimestamp >= '
$currentMonth
'
ORDER BY
ORDER BY
EventTimestamp
EventTimestamp
DESC
DESC
"
;
"
;
$res
=
$db
->
query
(
$sql
);
$res
=
$db
->
query
(
$sql
);
...
@@ -114,13 +114,13 @@ function displayDetails() {
...
@@ -114,13 +114,13 @@ function displayDetails() {
# Fetch user uptime and traffic cap
# Fetch user uptime and traffic cap
$sql
=
"
$sql
=
"
SELECT
SELECT
Name, Value
Name, Value
FROM
FROM
${DB_TABLE_PREFIX}user_attributes
${DB_TABLE_PREFIX}user_attributes
WHERE
WHERE
UserID = '
$userID
'
UserID = '
$userID
'
"
;
"
;
$res
=
$db
->
query
(
$sql
);
$res
=
$db
->
query
(
$sql
);
...
@@ -137,18 +137,18 @@ function displayDetails() {
...
@@ -137,18 +137,18 @@ function displayDetails() {
# Fetch user uptime and traffic summary
# Fetch user uptime and traffic summary
$sql
=
"
$sql
=
"
SELECT
SELECT
SUM(${DB_TABLE_PREFIX}topups_summary.Balance) AS Balance, ${DB_TABLE_PREFIX}topups.Type
SUM(${DB_TABLE_PREFIX}topups_summary.Balance) AS Balance, ${DB_TABLE_PREFIX}topups.Type
FROM
FROM
${DB_TABLE_PREFIX}topups_summary,
${DB_TABLE_PREFIX}topups_summary,
${DB_TABLE_PREFIX}topups
${DB_TABLE_PREFIX}topups
WHERE
WHERE
${DB_TABLE_PREFIX}topups_summary.TopupID = ${DB_TABLE_PREFIX}topups.ID
${DB_TABLE_PREFIX}topups_summary.TopupID = ${DB_TABLE_PREFIX}topups.ID
AND
${DB_TABLE_PREFIX}topups.UserID = '
$userID
'
AND
${DB_TABLE_PREFIX}topups.UserID = '
$userID
'
AND ${DB_TABLE_PREFIX}topups_summary.PeriodKey =
$currentMonth
AND ${DB_TABLE_PREFIX}topups_summary.PeriodKey =
$currentMonth
AND ${DB_TABLE_PREFIX}topups_summary.Depleted = 0
AND ${DB_TABLE_PREFIX}topups_summary.Depleted = 0
GROUP BY
GROUP BY
${DB_TABLE_PREFIX}topups.Type
${DB_TABLE_PREFIX}topups.Type
"
;
"
;
$res
=
$db
->
query
(
$sql
);
$res
=
$db
->
query
(
$sql
);
...
@@ -171,17 +171,17 @@ function displayDetails() {
...
@@ -171,17 +171,17 @@ function displayDetails() {
# Fetch user uptime and traffic topups
# Fetch user uptime and traffic topups
$sql
=
"
$sql
=
"
SELECT
SELECT
SUM(Value) AS Value, Type
SUM(Value) AS Value, Type
FROM
FROM
${DB_TABLE_PREFIX}topups
${DB_TABLE_PREFIX}topups
WHERE
WHERE
${DB_TABLE_PREFIX}topups.UserID = '
$userID
'
${DB_TABLE_PREFIX}topups.UserID = '
$userID
'
AND ${DB_TABLE_PREFIX}topups.ValidFrom >=
$thisMonthUnixTime
AND ${DB_TABLE_PREFIX}topups.ValidFrom >=
$thisMonthUnixTime
AND ${DB_TABLE_PREFIX}topups.ValidTo >
$now
AND ${DB_TABLE_PREFIX}topups.ValidTo >
$now
AND ${DB_TABLE_PREFIX}topups.Depleted = 0
AND ${DB_TABLE_PREFIX}topups.Depleted = 0
GROUP BY
GROUP BY
${DB_TABLE_PREFIX}topups.Type
${DB_TABLE_PREFIX}topups.Type
"
;
"
;
$res
=
$db
->
query
(
$sql
);
$res
=
$db
->
query
(
$sql
);
...
@@ -198,13 +198,13 @@ function displayDetails() {
...
@@ -198,13 +198,13 @@ function displayDetails() {
/*
/*
# Fetch user phone and email info
# Fetch user phone and email info
$sql = "
$sql = "
SELECT
SELECT
Phone, Email
Phone, Email
FROM
FROM
${DB_TABLE_PREFIX}wisp_userdata
${DB_TABLE_PREFIX}wisp_userdata
WHERE
WHERE
UserID = '$userID'
UserID = '$userID'
";
";
$res = $db->query($sql);
$res = $db->query($sql);
...
@@ -271,7 +271,6 @@ function displayDetails() {
...
@@ -271,7 +271,6 @@ function displayDetails() {
<td
class=
"title"
>
Used This Month
</td>
<td
class=
"title"
>
Used This Month
</td>
</tr>
</tr>
<tr>
<tr>
<?php
?>
<?php
<?php
if
(
is_numeric
(
$uptimeCap
))
{
if
(
is_numeric
(
$uptimeCap
))
{
?>
?>
...
...
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