';
$foundfile = 'null';
if (file_exists($queryparts[0])) $foundfile = $queryparts[0];
if ($foundfile == 'null')
{
echo 'Sorry, no data file found.';
}
else
{
$fp = fopen($foundfile,"r") or die("Error Reading File");
$data = fread($fp, filesize($foundfile));
fclose($fp);
$wandataall = explode("\n", $data);
$n = count($wandataall);
$monthintotal = 0;
$monthouttotal = 0;
$monthdaystart = 0;
echo '
';
echo '';
echo 'Date | ';
echo 'Downloaded | ';
echo 'Uploaded | ';
echo 'Total Transfered | ';
echo '
';
for ($i=$queryparts[1] ; $i < $queryparts[2]+1 ; $i++ )
{
$dataset=explode("|", $wandataall[$i]);
$dateset=explode("-", $dataset[0]);
$monthintotal = $monthintotal + $dataset[1];
$monthouttotal = $monthouttotal + $dataset[2];
$total = round((($dataset[1]+$dataset[2])/1024/1024/1024),2);
$dataset[1] = round(($dataset[1]/1024/1024),2);
$dataset[2] = round(($dataset[2]/1024/1024),2);
echo '';
echo ''.$dataset[0].' | ';
echo ''.$dataset[1].'MB | ';
echo ''.$dataset[2].'MB | ';
echo ''.$total.'GB | ';
echo '
';
}
$total = round((($monthintotal + $monthouttotal)/1024/1024/1024),2);
$monthintotal = round(($monthintotal/1024/1024/1024),2);
$monthouttotal = round(($monthouttotal/1024/1024/1024),2);
echo '';
echo 'Month Totals | ';
echo '↓'.$monthintotal.'GB | ';
echo '↑'.$monthouttotal.'GB | ';
echo '↕'.$total.'GB | ';
echo '
';
echo '
';
}
echo '
';
echo '