<?
include 'mysql.php';
include_once("inclydings/sesi.php");
Error_Reporting(E_ALL & ~E_NOTICE);
include_once("inclydings/antixak.php");
include 'inclydings/ini.php';
$_title = '::Lineage2::';
include 'inclydings/zag.php';
$log = htmlspecialchars(stripslashes($log));
$pas = htmlspecialchars(stripslashes($pas));
/////////////////////////////////////////////////////
$text = @file("L2dbnam/esql2db/reg/$log.dat");
if ($text!=""){
$udata = explode(":||:",$text[0]);
$login=trim($udata[0]);
$password=trim($udata[1]);
$aden=trim($udata[8]);}
////////////////////////////////////////////////////////
if (isset($user)) {

if(@file("L2dbnam/esql2db/rating/olimpiads/$log.dat")){

switch($go) {

default:
if($udata[9]<"60"){echo"Покупать вещи в Эксклюзивном магазине можно только с 60 Уровня.<br/>"; include_once("inclydings/down.php"); exit;}
echo"<b>Эксклюзивный магазин</b><br/>";
echo"Выберите что хотите купить:<br/><br/>";

echo"<img src='pik4erspic/mini/mag.png'> <a href=\"luxsor.php?$sd&go=body\">Купить доспехи</a><br/>";
echo"<img src='pik4erspic/mini/mag.png'> <a href=\"luxsor.php?$sd&go=boots\">Купить Сапоги</a><br/>";
echo"<img src='pik4erspic/mini/mag.png'> <a href=\"luxsor.php?$sd&go=gloves\">Купить Перчатки</a><br/>";
echo"<img src='pik4erspic/mini/mag.png'> <a href=\"luxsor.php?$sd&go=4it\">Купить Щит</a><br/>";
echo"<img src='pik4erspic/mini/mag.png'> <a href=\"luxsor.php?$sd&go=helmet\">Купить Шлем</a><br/>";
echo"<img src='pik4erspic/mini/mag.png'> <a href=\"luxsor.php?$sd&go=weapon\">Купить оружие</a><br/>";
break;
case 'weapon':
$dir = opendir ("L2dbnam/esql2db/shop");
while ($file = readdir ($dir))
{if (( $file != ".") && ($file != ".."))
{$a[]=$file;}}
closedir ($dir);
$total = count($a);

for ($i = 0; $i < $total; $i++){
$tex = @file("L2dbnam/esql2db/shop/$a[$i]");
$data = explode(":||:",$tex[0]);

$a[$i]=str_replace(".dat","",$a[$i]);

if($data[2]=="weapon"){
if($udata[9]<="85"){if($data[3]=="1"){

$dat_id[]=$a[$i];
$dat_cena[]=$data[1];
$dat_sila[]=$data[0];
$dat_gr[]="S";
$dat_name[]=$data[4];}}
}
}
foreach($dat_name as $k=>$v)
{
$gr[]=$dat_gr[$k];
$dat_screen[]="<img src=\"pik4erspic/weapon/$dat_name[$k].gif\" alt=\"pic\"/><a href=\"pokupka2.php?$sd&vesh=$dat_id[$k]&gorod=$udata[20]\">$dat_name[$k]</a><br/>Атака +$dat_sila[$k]<br/>Цена: <img src='pik4erspic/mini/aden.gif' alt='pic'/> ".number_format($dat_cena[$k])." <br/>";
}
$total = count($dat_screen);
if (empty($_GET['start'])) $start = 0;
else $start = $_GET['start'];
if ($total < $start + 10){ $end = $total; }
else {$end = $start + 10; }
for ($i = $start; $i < $end; $i++){
echo"$dat_screen[$i]";

}
if ($start !== 0) {echo '<a href="shops.php?start='.($start - 10).'&'.$sd.'&go=weapon">Назад</a>';}
if ($total > $start + 10) {echo '<a href="shops.php?start='.($start + 10).'&'.$sd.'&go=weapon">Далее</a>';}
break;
case 'body':
$dir = opendir ("L2dbnam/esql2db/shop");
while ($file = readdir ($dir))
{if (( $file != ".") && ($file != ".."))
{$a[]=$file;}}
closedir ($dir);
$total = count($a);

for ($i = 0; $i < $total; $i++){
$tex = @file("L2dbnam/esql2db/shop/$a[$i]");
$data = explode(":||:",$tex[0]);

$a[$i]=str_replace(".dat","",$a[$i]);

if($data[2]=="body"){
if($udata[9]<="85"){if($data[3]=="1"){

$dat_id[]=$a[$i];
$dat_cena[]=$data[1];
$dat_sila[]=$data[0];
$dat_gr[]="S";
$dat_name[]=$data[4];}}
}
}
foreach($dat_name as $k=>$v)
{
$gr[]=$dat_gr[$k];
$dat_screen[]="<img src=\"pik4erspic/robe/$dat_name[$k].gif\" alt=\"pic\"/><a href=\"pokupka2.php?$sd&vesh=$dat_id[$k]&gorod=$udata[20]\">$dat_name[$k]</a><br/>Защита +$dat_sila[$k]<br/>Цена: <img src='pik4erspic/mini/aden.gif' alt='pic'/> ".number_format($dat_cena[$k])." <br/>";
}
$total = count($dat_screen);
if (empty($_GET['start'])) $start = 0;
else $start = $_GET['start'];
if ($total < $start + 10){ $end = $total; }
else {$end = $start + 10; }
for ($i = $start; $i < $end; $i++){
echo"$dat_screen[$i]";

}
if ($start !== 0) {echo '<a href="shops.php?start='.($start - 10).'&'.$sd.'&go=body">Назад</a>';}
if ($total > $start + 10) {echo '<a href="shops.php?start='.($start + 10).'&'.$sd.'&go=body">Далее</a>';}
break;
case 'boots':
$dir = opendir ("L2dbnam/esql2db/shop");
while ($file = readdir ($dir))
{if (( $file != ".") && ($file != ".."))
{$a[]=$file;}}
closedir ($dir);
$total = count($a);

for ($i = 0; $i < $total; $i++){
$tex = @file("L2dbnam/esql2db/shop/$a[$i]");
$data = explode(":||:",$tex[0]);

$a[$i]=str_replace(".dat","",$a[$i]);

if($data[2]=="nogi"){
if($udata[9]<="85"){if($data[3]=="1"){

$dat_id[]=$a[$i];
$dat_cena[]=$data[1];
$dat_sila[]=$data[0];
$dat_gr[]="S";
$dat_name[]=$data[4];}}
}
}
foreach($dat_name as $k=>$v)
{
$gr[]=$dat_gr[$k];
$dat_screen[]="<img src=\"pik4erspic/boots/$dat_name[$k].gif\" alt=\"pic\"/><a href=\"pokupka2.php?$sd&vesh=$dat_id[$k]&gorod=$udata[20]\">$dat_name[$k]</a><br/>Защита +$dat_sila[$k]<br/>Цена: <img src='pik4erspic/mini/aden.gif' alt='pic'/> ".number_format($dat_cena[$k])." <br/>";
}
$total = count($dat_screen);
if (empty($_GET['start'])) $start = 0;
else $start = $_GET['start'];
if ($total < $start + 10){ $end = $total; }
else {$end = $start + 10; }
for ($i = $start; $i < $end; $i++){
echo"$dat_screen[$i]";

}
if ($start !== 0) {echo '<a href="shops.php?start='.($start - 10).'&'.$sd.'&go=boots">Назад</a>';}
if ($total > $start + 10) {echo '<a href="shops.php?start='.($start + 10).'&'.$sd.'&go=boots">Далее</a>';}
break;
case 'gloves':
$dir = opendir ("L2dbnam/esql2db/shop");
while ($file = readdir ($dir))
{if (( $file != ".") && ($file != ".."))
{$a[]=$file;}}
closedir ($dir);
$total = count($a);

for ($i = 0; $i < $total; $i++){
$tex = @file("L2dbnam/esql2db/shop/$a[$i]");
$data = explode(":||:",$tex[0]);

$a[$i]=str_replace(".dat","",$a[$i]);

if($data[2]=="ryki"){
if($udata[9]<="85"){if($data[3]=="1"){

$dat_id[]=$a[$i];
$dat_cena[]=$data[1];
$dat_sila[]=$data[0];
$dat_gr[]="S";
$dat_name[]=$data[4];}}
}
}
foreach($dat_name as $k=>$v)
{
$gr[]=$dat_gr[$k];
$dat_screen[]="<img src=\"pik4erspic/gloves/$dat_name[$k].gif\" alt=\"pic\"/><a href=\"pokupka2.php?$sd&vesh=$dat_id[$k]&gorod=$udata[20]\">$dat_name[$k]</a><br/>Защита +$dat_sila[$k]<br/>Цена: <img src='pik4erspic/mini/aden.gif' alt='pic'/> ".number_format($dat_cena[$k])." <br/>";
}
$total = count($dat_screen);
if (empty($_GET['start'])) $start = 0;
else $start = $_GET['start'];
if ($total < $start + 10){ $end = $total; }
else {$end = $start + 10; }
for ($i = $start; $i < $end; $i++){
echo"$dat_screen[$i]";

}
if ($start !== 0) {echo '<a href="shops.php?start='.($start - 10).'&'.$sd.'&go=gloves">Назад</a>';}
if ($total > $start + 10) {echo '<a href="shops.php?start='.($start + 10).'&'.$sd.'&go=gloves">Далее</a>';}
break;
case '4it':
$dir = opendir ("L2dbnam/esql2db/shop");
while ($file = readdir ($dir))
{if (( $file != ".") && ($file != ".."))
{$a[]=$file;}}
closedir ($dir);
$total = count($a);

for ($i = 0; $i < $total; $i++){
$tex = @file("L2dbnam/esql2db/shop/$a[$i]");
$data = explode(":||:",$tex[0]);

$a[$i]=str_replace(".dat","",$a[$i]);

if($data[2]=="4it"){
if($udata[9]<="85"){if($data[3]=="1"){

$dat_id[]=$a[$i];
$dat_cena[]=$data[1];
$dat_sila[]=$data[0];
$dat_gr[]="S";
$dat_name[]=$data[4];}}
}
}
foreach($dat_name as $k=>$v)
{
$gr[]=$dat_gr[$k];
$dat_screen[]="<img src=\"pik4erspic/4it/$dat_name[$k].gif\" alt=\"pic\"/><a href=\"pokupka2.php?$sd&vesh=$dat_id[$k]&gorod=$udata[20]\">$dat_name[$k]</a><br/>Защита +$dat_sila[$k]<br/>Цена: <img src='pik4erspic/mini/aden.gif' alt='pic'/> ".number_format($dat_cena[$k])." <br/>";
}
$total = count($dat_screen);
if (empty($_GET['start'])) $start = 0;
else $start = $_GET['start'];
if ($total < $start + 10){ $end = $total; }
else {$end = $start + 10; }
for ($i = $start; $i < $end; $i++){
echo"$dat_screen[$i]";

}
if ($start !== 0) {echo '<a href="shops.php?start='.($start - 10).'&'.$sd.'&go=4it">Назад</a>';}
if ($total > $start + 10) {echo '<a href="shops.php?start='.($start + 10).'&'.$sd.'&go=4it">Далее</a>';}
break;
case 'helmet':
$dir = opendir ("L2dbnam/esql2db/shop");
while ($file = readdir ($dir))
{if (( $file != ".") && ($file != ".."))
{$a[]=$file;}}
closedir ($dir);
$total = count($a);

for ($i = 0; $i < $total; $i++){
$tex = @file("L2dbnam/esql2db/shop/$a[$i]");
$data = explode(":||:",$tex[0]);

$a[$i]=str_replace(".dat","",$a[$i]);

if($data[2]=="golova"){
if($udata[9]<="85"){if($data[3]=="1"){

$dat_id[]=$a[$i];
$dat_cena[]=$data[1];
$dat_sila[]=$data[0];
$dat_gr[]="S";
$dat_name[]=$data[4];}}
}
}
foreach($dat_name as $k=>$v)
{
$gr[]=$dat_gr[$k];
$dat_screen[]="<img src=\"pik4erspic/shlem/$dat_name[$k].gif\" alt=\"pic\"/><a href=\"pokupka2.php?$sd&vesh=$dat_id[$k]&gorod=$udata[20]\">$dat_name[$k]</a><br/>Защита +$dat_sila[$k]<br/>Цена: <img src='pik4erspic/mini/aden.gif' alt='pic'/> ".number_format($dat_cena[$k])." <br/>";
}
$total = count($dat_screen);
if (empty($_GET['start'])) $start = 0;
else $start = $_GET['start'];
if ($total < $start + 10){ $end = $total; }
else {$end = $start + 10; }
for ($i = $start; $i < $end; $i++){
echo"$dat_screen[$i]";

}
if ($start !== 0) {echo '<a href="shops.php?start='.($start - 10).'&'.$sd.'&go=helmet">Назад</a>';}
if ($total > $start + 10) {echo '<a href="shops.php?start='.($start + 10).'&'.$sd.'&go=helmet">Далее</a>';}


break;

}
}else{echo"Привет,житель этого мира!<br/>В мою торговую зону могут войти только те герои, кто выиграл олимпиаду.";}


}else{echo"Пароль или ник неверен.Возможно сессия устарела.Попробуйте авторизироваться заново...";}

include_once"inclydings/down.php";
?>
