|
// Включаем конфигурационный файл
include "config.php";
// Извлекаем параметр start из командной строки
$start = $_GET["start"];
$dir_rec = dir("records");
$i = 0;
while($entry = $dir_rec->read())
{
if (substr($entry,0,3)=="rec")
{
$names[$i]=substr($entry,4);
$i++;
}
}
$dir_rec->close();
@rsort($names);
$count = $i;
$count1 = $count;
if (empty($start)) $start = 0;
if ($start < 0) $start = 0;
print "";
if ($count > $start + $pnumber) $count = $start + $pnumber;
if ($start != 0)
{
print " Предыдущие ";
}
if ($count1 > $start + 10)
{
print " Следующие \n";
}
print " ";
for ($i = $start; $i < $count; $i++)
{
$entry = $names[$i];
$data = file("records/rec.".$entry);
$date = $entry;
$name = trim($data[0]);
$city = trim($data[1]);
$email = trim($data[2]);
$url = trim($data[3]);
$msg = trim($data[4]);
$answer = trim($data[5]);
//
?>
echo $name?> if (!empty($city)) print "($city)"; ?> |
от: print date("d-m-Y H - i",$date); ?> |
|
 |
if (!empty($email)) print "e-mail: $email "; ?>
if (!empty($url)) print "www: $url"; ?> |
|
echo $msg; ?>
if (!empty($answer))
{
print " Аdmin: $answer ";
}
?>
|
//
}
print "";
if ($count > $start + $pnumber) $count = $start + $pnumber;
print " Добавить запись ";
if ($start != 0)
{
print " Предыдущие ";
}
if ($count1 > $start + $pnumber)
{
print " Следующие \n";
}
?>
|