Jul 31 07 3:10 am
<style type="text/css">
<!--
body,td,th {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 10px;
}
-->
</style>
<table width="100%" border="1" cellspacing="2" cellpadding="2">
<?php
/* BEGIN SCRIPT CONFIGURATION */
//Location of exported accounts file
$exported_accounts = "accounts.txt";
//Translation of column headers
$translation[0] = "Timestamp"; //Timestamp
$translation[1] = "Account"; //Username
$translation[2] = "Full Name"; //Real Name
$translation[3] = "Downloaded"; //Client Send (b)
$translation[4] = "Uploaded"; //Client Recv (b)
$translation[5] = "Uploaded For"; //Server Send (b)
$translation[6] = "Downloaded For"; //Server Recv (b)
$translation[7] = "Time Online"; //Time (s)
$translation[8] = "Opening Balance"; //Opening
$translation[9] = "Closing Balance"; //Closing
// Other Translation
$hours = "hours"; // hours
$minutes = "min"; // minutes
$GB = "GB"; // Gigabytes
$MB = "MB"; // Megabytes
$KB = "KB"; // Kilobytes
$Bytes = "Bytes"; // Bytes
$device = "USD";
/* END SCRIPT CONFIGURATION */
$header = array("Timestamp", "Username", "Real Name", "Client Send (b)", "Client Recv (b)", "Server Send (b)", "Server Recv (b)", "Time (s)", "Opening", "Closing");
$handle = fopen($exported_accounts, "r");
$row = 0;
while (($data = fgetcsv($handle, 1000, " ")) !== FALSE) {
$num = count($data);
$data = str_replace($header, $translation, $data);
$row++;
echo "<tr>";
for ($c=0; $c < $num; $c++) {
If ($data[$c] == "" or $data[$c] == "<system>")
echo "<td> </td>";
else {
If ($c == 7 and $row > 1)
// Time Function
If ($data[$c] < 3600)
{$data[$c] = round($data[$c] / 60, 2)." ".$minutes;}
else
{$data[$c] = round($data[$c] / 3600, 2)." ".$hours;}
// Datas Transfered Function
If ($c > 2 and $c < 7 and $row > 1)
if ($data[$c] > 1073741824)
{$data[$c] = round($data[$c] / 1073741824, 2)." ".$GB;}
else If ($data[$c] > 1048576)
{$data[$c] = round($data[$c] / 1048576, 2)." ".$MB;}
else If ($data[$c] > 1024)
{$data[$c] = round($data[$c] / 1024, 2)." ".$KB;}
else If ($data[$c] < 1024)
{$data[$c] = round($data[$c], 2)." ".$Bytes;}
// Balance Function
If ($c > 7 and $c < 10 and $row > 1) $data[$c] = round($data[$c], 2)." ".$device;
echo "<td>".$data[$c]."</td>";
}
}
echo "</tr>";
}
fclose($handle);
?>
</table>
Aug 01 07 12:03 pm
Aug 01 07 3:17 pm
while (($data = fgetcsv($handle, 1000, " ")) !== FALSE) {
for ($c=0; $c < $num; $c++)
{
echo "<td>".$data[$c]."</td>";
}
for ($c=0; $c < $num; $c++)
{
If ($data[$c] == "" or $data[$c] == "<system>")
echo "<td> </td>";
else
echo "<td>".$data[$c]."</td>";
}
Aug 01 07 8:24 pm
Aug 02 07 7:30 am
Why $edit ?
Aug 02 07 8:53 pm
Aug 08 07 8:31 pm
Aug 23 07 10:14 am
Aug 23 07 10:23 am
//Location of exported accounts file
$exported_accounts = "accounts.txt";
while (($data = fgetcsv($handle, 1000, " ")) !== FALSE) {
Aug 24 07 9:13 am
Aug 24 07 2:40 pm
Aug 25 07 12:04 am
Aug 25 07 5:38 am
stlony wrote:should i open "accounts.php" with internet explorer or another program?
sorry about this question but it didn't worked with internet explorer? what should i do?