Skip to content
Snippets Groups Projects
Commit 856df90e authored by Robert Anderson's avatar Robert Anderson
Browse files

Get phone and email from correct table

parent d863579b
No related branches found
No related tags found
No related merge requests found
...@@ -112,6 +112,7 @@ function displayDetails() { ...@@ -112,6 +112,7 @@ function displayDetails() {
} }
# Fetch user uptime and traffic cap
$sql = " $sql = "
SELECT SELECT
Name, Value Name, Value
...@@ -123,32 +124,39 @@ function displayDetails() { ...@@ -123,32 +124,39 @@ function displayDetails() {
$res = $db->query($sql); $res = $db->query($sql);
$userPhone = "Unavailable"; $trafficCap = "None";
$userEmail = "Unavailable"; $uptimeCap = "None";
$userCap = "Unavailable";
$dataCap = "Unavailable";
$timeCap = "Unavailable";
$userService = "Unavailable";
while ($row = $res->fetchObject()) { while ($row = $res->fetchObject()) {
if ($row->name == "SMRadius-Notify-Phone") {
$userPhone = $row->value;
}
if ($row->name == "SMRadius-Notify-Email") {
$userEmail = $row->value;
}
if ($row->name == "SMRadius-Capping-Traffic-Limit") { if ($row->name == "SMRadius-Capping-Traffic-Limit") {
$dataCap = $row->value; $trafficCap = $row->value;
} }
if ($row->name == "SMRadius-Capping-UpTime-Limit") { if ($row->name == "SMRadius-Capping-UpTime-Limit") {
$timeCap = $row->value; $uptimeCap = $row->value;
}
if ($row->name == "SMRadius-User-Service") {
$userService = $row->value;
} }
} }
# Fetch user phone and email info
$sql = "
SELECT
Phone, Email
FROM
${DB_TABLE_PREFIX}wisp_userdata
WHERE
UserID = '$userID'
";
$res = $db->query($sql);
$userPhone = "Not set";
$userEmail = "Not set";
if ($res->rowCount() > 0) {
$row = $res->fetchObject();
$userPhone = $row->phone;
$userEmail = $row->email;
}
$isDialup = 0; $isDialup = 0;
$userService = "Not set";
?> ?>
...@@ -180,7 +188,17 @@ function displayDetails() { ...@@ -180,7 +188,17 @@ function displayDetails() {
<td class="title">Used This Month</td> <td class="title">Used This Month</td>
</tr> </tr>
<tr> <tr>
<td class="value"><?php echo $dataCap; ?> MB</td> <?php
if (is_numeric($trafficCap)) {
?>
<td class="value"><?php echo $trafficCap; ?> MB</td>
<?php
} else {
?>
<td class="value"><?php echo $trafficCap; ?></td>
<?php
}
?>
<td class="value"><?php printf('%.2f', $totalData); ?> MB</td> <td class="value"><?php printf('%.2f', $totalData); ?> MB</td>
</tr> </tr>
<tr> <tr>
...@@ -188,7 +206,17 @@ function displayDetails() { ...@@ -188,7 +206,17 @@ function displayDetails() {
<td class="title">Used This Month</td> <td class="title">Used This Month</td>
</tr> </tr>
<tr> <tr>
<td class="value"><?php echo $timeCap; ?> Min</td> <?php
if (is_numeric($uptimeCap)) {
?>
<td class="value"><?php echo $uptimeCap; ?> Min</td>
<?php
} else {
?>
<td class="value"><?php echo $uptimeCap; ?></td>
<?php
}
?>
<td class="value"><?php echo $totalSessionTime; ?> Min</td> <td class="value"><?php echo $totalSessionTime; ?> Min</td>
</tr> </tr>
<tr> <tr>
......
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