", $datain);
$outCount = count($out) - 1;
$j = $outCount-1;
if ($order == "desc")
{
for ($i=0; $i<=$outCount; $i++)
{
$lines[$j] = unserialize($out[$i]);
$j = $j - 1;
}
}
else
{
for ($i=0; $i<=$outCount; $i++)
{
$lines[$i] = unserialize($out[$i]);
}
}
// Counting the total number of entries (lines) in the data text file ----------------
$result = count($lines);
$count = $result-1;
//echo $count."
";
// Caclulate how many pages there are ----------------------------------------
if ($count == 0) { $totalpages = 0; }
else { $totalpages = intval(($count - 1) / $perpage) + 1; }
$page = $totalpages - ($page - 1);
$end = $count - (($totalpages - $page) * $perpage);
$start = $end - ($perpage - 1); if ($start < 1) { $start = 1; }
//$end = ($perpage * $page) - 1;
//$start = $end - $perpage;
if ($start < 0) { $start = 0; }
//for ($i = $end; $i>=($start-1); $i--)
//for ($i = 0; $i<$outCount; $i++)
//for ($i=$start-1; $i<$end; $i++)
for ($i=$end-1; $i>$start-2; $i--)
{
//echo $i."
end-".$end."-start-".$start;
echo "
";
echo "$listDatetxt: ";
$lines[$i]->showDate();
echo " $listnametxt: "; $lines[$i]->showFrom(); echo " $listemailtxt: showEmail(); echo "\">"; $lines[$i]->showEmail(); echo " $listMessagetxt: "; $lines[$i]->showMessage(); echo " |