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

Use $_SESSION['username']

Cleanup
parent 8d64a361
No related branches found
No related tags found
No related merge requests found
...@@ -35,10 +35,7 @@ function displayLogs() { ...@@ -35,10 +35,7 @@ function displayLogs() {
global $db; global $db;
global $DB_TABLE_PREFIX; global $DB_TABLE_PREFIX;
$username = $_SESSION['username'];
?> ?>
<table class="blockcenter" width="750"> <table class="blockcenter" width="750">
<tr> <tr>
<td colspan="4" class="title"> <td colspan="4" class="title">
...@@ -85,9 +82,7 @@ function displayLogs() { ...@@ -85,9 +82,7 @@ function displayLogs() {
<td class="section">Upload</td> <td class="section">Upload</td>
<td class="section">Download</td> <td class="section">Download</td>
</tr> </tr>
<?php <?php
# Extra SQL # Extra SQL
$extraSQL = ""; $extraSQL = "";
$extraSQLVals = array(); $extraSQLVals = array();
...@@ -114,7 +109,7 @@ function displayLogs() { ...@@ -114,7 +109,7 @@ function displayLogs() {
FROM FROM
${DB_TABLE_PREFIX}accounting ${DB_TABLE_PREFIX}accounting
WHERE WHERE
Username = '$username' Username = ".$db->quote($_SESSION['username'])."
$extraSQL $extraSQL
ORDER BY ORDER BY
EventTimestamp EventTimestamp
...@@ -143,7 +138,6 @@ function displayLogs() { ...@@ -143,7 +138,6 @@ function displayLogs() {
} }
$totalInputData += $inputDataItem; $totalInputData += $inputDataItem;
# Output data calculation # Output data calculation
$outputDataItem = 0; $outputDataItem = 0;
...@@ -157,7 +151,6 @@ function displayLogs() { ...@@ -157,7 +151,6 @@ function displayLogs() {
$totalData += $totalOutputData + $totalInputData; $totalData += $totalOutputData + $totalInputData;
# Time calculation # Time calculation
$sessionTimeItem = 0; $sessionTimeItem = 0;
if (isset($row->acctsessiontime) && $row->acctsessiontime > 0) { if (isset($row->acctsessiontime) && $row->acctsessiontime > 0) {
...@@ -165,9 +158,7 @@ function displayLogs() { ...@@ -165,9 +158,7 @@ function displayLogs() {
} }
$totalSessionTime += $sessionTimeItem; $totalSessionTime += $sessionTimeItem;
?> ?>
<tr> <tr>
<td class="desc"><?php echo $row->eventtimestamp; ?></td> <td class="desc"><?php echo $row->eventtimestamp; ?></td>
<td class="desc"><?php echo $row->acctsessiontime; ?></td> <td class="desc"><?php echo $row->acctsessiontime; ?></td>
...@@ -178,24 +169,16 @@ function displayLogs() { ...@@ -178,24 +169,16 @@ function displayLogs() {
<td class="right desc"><?php printf('%.2f',$inputDataItem); ?></td> <td class="right desc"><?php printf('%.2f',$inputDataItem); ?></td>
<td class="right desc"><?php printf('%.2f',$outputDataItem); ?></td> <td class="right desc"><?php printf('%.2f',$outputDataItem); ?></td>
</tr> </tr>
<?php <?php
} }
if ($res->rowCount() == 0) { if ($res->rowCount() == 0) {
?> ?>
<tr> <tr>
<td colspan="8" class="info">There are no logs for the selected dates</td> <td colspan="8" class="info">There are no logs for the selected dates</td>
</tr> </tr>
<?php <?php
} else { } else {
?> ?>
<tr> <tr>
<td colspan="6" class="right">Sub Total:</td> <td colspan="6" class="right">Sub Total:</td>
<td class="right desc"><?php printf('%.2f',$totalInputData); ?></td> <td class="right desc"><?php printf('%.2f',$totalInputData); ?></td>
...@@ -205,42 +188,25 @@ function displayLogs() { ...@@ -205,42 +188,25 @@ function displayLogs() {
<td colspan="6" class="right">Total:</td> <td colspan="6" class="right">Total:</td>
<td colspan="2" class="center desc"><?php printf('%.2f',$totalData); ?></td> <td colspan="2" class="center desc"><?php printf('%.2f',$totalData); ?></td>
</tr> </tr>
<?php <?php
} }
} else { } else {
?> ?>
<tr> <tr>
<td colspan="8" class="info">Please specify dates above in YYYY-MM-DD format and click "search".</td> <td colspan="8" class="info">Please specify dates above in YYYY-MM-DD format and click "search".</td>
</tr> </tr>
<?php <?php
} }
?> ?>
</table> </table>
<?php <?php
} }
?> ?>
<a href=".">Back</a><br> <a href=".">Back</a><br>
<?php <?php
displayLogs(); displayLogs();
?> ?>
<a href=".">Back</a><br><br> <a href=".">Back</a><br><br>
<?php <?php
......
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