<?
Error_Reporting(E_ALL & ~E_NOTICE);
Error_Reporting (ERROR | WARNING);
include_once("include/antixak.php");
include_once("include/zag.php");

$log = htmlspecialchars(stripslashes($log));
$pas = htmlspecialchars(stripslashes($pas));
$mob = htmlspecialchars(stripslashes($mob));
/////////////////////////////////////////////////////
$text = @file("MySql/base123/reg/$log.dat");
if ($text!=""){
$udata = explode(":||:",$text[0]);
$login=trim($udata[0]);
$password=trim($udata[1]);}
////////////////////////////////////////////////////////
include_once("include/sesi.php");
if (isset($user)) {

$file = @file("MySql/base123/item/$log.dat");
$total = count($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++){

$file = @file("MySql/base123/item/$log.dat");
$file = @array_reverse($file);
$data = explode(":||:",$file[$i]);
$i2=round($i+1);

$id=$i;
$cena=$data[1]/2;
$cena=(int)$cena;
if($data[4]!=""){
if ($data[5]!=="vesh"){
echo"<b><a href=\"sell.php?$sd&vesh=$data[4]&id=$id&num=$cena&tip=$data[2]\">$data[4]</a></b> - ($data[3] штук) [$cena ADEN]<br/>";}
if ($data[5]=="vesh"){
echo"<b><a href=\"sell.php?$sd&vesh=$data[4]&id=$id&num=$cena&tip=$data[5]\">$data[4]</a></b> - ($data[3] штук) [$cena ADEN]<br/>";
}
}}

if($total=="0"){echo"У вас нет вещей.";}
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="listsell.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 ' <b>('.$ii.')</b>';
}else{
echo ' <a href="listsell.php?start='.$i.'&'.$sd.'">'.$ii.'</a>';
}}
$i=$i+5;}
if($asd2<$total){echo ' ... <a href="listsell.php?start='.$ba2.'&'.$sd.'">'.$ba.'</a>';}
}

}else{echo"Пароль или логин неверен!";}

include_once"include/down.php";
?>

