<?php
include 'inclydings/golova.php';
include_once("mysql.php");
include 'inclydings/sesi.php';
include_once("inclydings/golova.php");
list($msec,$sec)=explode(chr(32),microtime());
$HeadTime=$sec+$msec;

//////////////////////
$file="L2dbnam/esql2db/online.dat";
$lines=file("$file");
$online=count($lines);
/////////////////////
$online=round($online*9);

$novs = sizeof(file('L2dbnam/esql2db/event.dat'));
echo"Новостей -$novs<br/><hr>";
/////////////////////
$file = @file("L2dbnam/esql2db/event.dat");
$total=count($file);
$file = array_reverse($file);
if (empty($_GET['start'])) $start = 0;
else $start = $_GET['start'];
if ($total < $start + 5){ $end = $total; }
else {$end = $start + 5; }
for ($i = $start; $i < $end; $i++){
$udata = explode("||",$file[$i]);
echo"$udata[0] [$udata[1]]<br/>$udata[2]<hr>";
}

if($total>0){

$ba=ceil($total/5);
$ba2=$ba*5-5;

$asd=$start-(5*3);
$asd2=$start+(5*4);

if($asd<$total && $asd>0){echo ' <a href="event_index.php?start=0&'.$sd.'">1</a> ... ';}
for($i=$asd; $i<$asd2;){
if($i<$total && $i>=0){
$ii=floor(1+$i/5);
if ($start==$i) {
echo ' ('.$ii.')';
}else{
echo ' <a href="event_index.php?start='.$i.'&'.$sd.'">'.$ii.'</a>';
}}
$i=$i+5;}
if($asd2<$total){echo ' ... <a href="event_index.php?start='.$ba2.'&'.$sd.'">'.$ba.'</a>';}
}else{echo"Эвентных Новостей нету<br/>";}
echo"
<br/><a href=\"index.php?$sd\">Главная</a><br/>";

include 'inclydings/nogi.php';

?>

