<?
include_once("mysql.php");
include_once("include/antixak.php");
include_once("include/zag.php");
include_once("include/ini.php");
include 'include/sesi.php';
if (isset($user)) {

switch($go) {

default:
echo"<b>Магазин</b><br/>";
echo"Выберите что хотите купить<br/>";
echo"<u>Украшение:</u><br/>";
echo"[<a href=\"shops.php?$sd&go=prikras\">Украшение</a>]<br/>";
echo"<u>Боевая екипировка:</u><br/>";
echo"[<a href=\"shops.php?$sd&go=body\">Торговец доспехами</a>]<br/>";
echo"[<a href=\"shops.php?$sd&go=boots\">Торговец Сапогами</a>]<br/>";
echo"[<a href=\"shops.php?$sd&go=gloves\">Торговец Перчатками</a>]<br/>";
echo"[<a href=\"shops.php?$sd&go=4it\">Торговец Щитами</a>]<br/>";
echo"[<a href=\"shops.php?$sd&go=helmet\">Торговец Шлемами</a>]<br/>";
echo"[<a href=\"shops.php?$sd&go=weapon\">Торговец оружием</a>]<br/>";
echo"- - -<br/>[<a href=\"listsell.php?$sd\">Продать вещи</a>]<br/>";
break;
case 'serga1':
echo"<u>Выберите У меня многи изделий:</u><br/>";
echo"[<a href=\"shops.php?$sd&go=serg1ang\">NG</a>] (до 20 ур)<br/>";
echo"[<a href=\"shops.php?$sd&go=serg1ad\">D</a>] (до 40 ур)<br/>";
echo"[<a href=\"shops.php?$sd&go=serg1ac\">C</a>] (до 52 ур)<br/>";
echo"[<a href=\"shops.php?$sd&go=serg1ab\">B</a>] (до 62 ур)<br/>";
echo"[<a href=\"shops.php?$sd&go=serg1aa\">A</a>] (до 76 ур)<br/>";
echo"[<a href=\"shops.php?$sd&go=serg1as\">S</a>] (от 76 ур)<br/>";
break;
case 'serga1s':
$dir = opendir ("MySql/base123/shop");
while ($file = readdir ($dir))
{if (( $file != ".") && ($file != ".."))
{$a[]=$file;}}
closedir ($dir);
$total = count($a);

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

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

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

$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[]="<b><img src=\"pic/serga/$dat_name[$k].gif\" alt=\"pic\"/><a href=\"pokupka2.php?$sd&vesh=$dat_id[$k]&gorod=$udata[20]\">$dat_name[$k]</a></b><br/>Защита: M+$dat_sila[$k]<br/>Цена: ".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=serg1as">Назад</a>';}
if ($total > $start + 10) {echo '<a href="shops.php?start='.($start + 10).'&'.$sd.'&go=serg1as">Далее</a>';}
break;
case 'serga1a':
$dir = opendir ("MySql/base123/shop");
while ($file = readdir ($dir))
{if (( $file != ".") && ($file != ".."))
{$a[]=$file;}}
closedir ($dir);
$total = count($a);

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

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

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

$dat_id[]=$a[$i];
$dat_cena[]=$data[1];
$dat_sila[]=$data[0];
$dat_gr[]="A";
$dat_name[]=$data[4];}}
}
}
foreach($dat_name as $k=>$v)
{
$gr[]=$dat_gr[$k];
$dat_screen[]="<b><img src=\"pic/serga/$dat_name[$k].gif\" alt=\"pic\"/><a href=\"pokupka2.php?$sd&vesh=$dat_id[$k]&gorod=$udata[20]\">$dat_name[$k]</a></b><br/>Защита: M+$dat_sila[$k]<br/>Цена: ".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=serga1a">Назад</a>';}
if ($total > $start + 10) {echo '<a href="shops.php?start='.($start + 10).'&'.$sd.'&go=serga1a">Далее</a>';}
break;
case 'serga1b':
$dir = opendir ("MySql/base123/shop");
while ($file = readdir ($dir))
{if (( $file != ".") && ($file != ".."))
{$a[]=$file;}}
closedir ($dir);
$total = count($a);

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

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

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

$dat_id[]=$a[$i];
$dat_cena[]=$data[1];
$dat_sila[]=$data[0];
$dat_gr[]="B";
$dat_name[]=$data[4];}}
}
}
foreach($dat_name as $k=>$v)
{
$gr[]=$dat_gr[$k];
$dat_screen[]="<b><img src=\"pic/serga/$dat_name[$k].gif\" alt=\"pic\"/><a href=\"pokupka2.php?$sd&vesh=$dat_id[$k]&gorod=$udata[20]\">$dat_name[$k]</a></b><br/>Защита: M+$dat_sila[$k]<br/>Цена: ".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=serga1b">Назад</a>';}
if ($total > $start + 10) {echo '<a href="shops.php?start='.($start + 10).'&'.$sd.'&go=serga1b">Далее</a>';}
break;
case 'serga1c':
$dir = opendir ("MySql/base123/shop");
while ($file = readdir ($dir))
{if (( $file != ".") && ($file != ".."))
{$a[]=$file;}}
closedir ($dir);
$total = count($a);

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

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

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

$dat_id[]=$a[$i];
$dat_cena[]=$data[1];
$dat_sila[]=$data[0];
$dat_gr[]="C";
$dat_name[]=$data[4];}}
}
}
foreach($dat_name as $k=>$v)
{
$gr[]=$dat_gr[$k];
$dat_screen[]="<b><img src=\"pic/serga/$dat_name[$k].gif\" alt=\"pic\"/><a href=\"pokupka2.php?$sd&vesh=$dat_id[$k]&gorod=$udata[20]\">$dat_name[$k]</a></b><br/>Защита: M+$dat_sila[$k]<br/>Цена: ".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=serga1c">Назад</a>';}
if ($total > $start + 10) {echo '<a href="shops.php?start='.($start + 10).'&'.$sd.'&go=serga1c">Далее</a>';}
break;
case 'serga1d':
$dir = opendir ("MySql/base123/shop");
while ($file = readdir ($dir))
{if (( $file != ".") && ($file != ".."))
{$a[]=$file;}}
closedir ($dir);
$total = count($a);

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

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

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

$dat_id[]=$a[$i];
$dat_cena[]=$data[1];
$dat_sila[]=$data[0];
$dat_gr[]="D";
$dat_name[]=$data[4];}}
}
}
foreach($dat_name as $k=>$v)
{
$gr[]=$dat_gr[$k];
$dat_screen[]="<b><img src=\"pic/serga/$dat_name[$k].gif\" alt=\"pic\"/><a href=\"pokupka2.php?$sd&vesh=$dat_id[$k]&gorod=$udata[20]\">$dat_name[$k]</a></b><br/>Защита: M+$dat_sila[$k]<br/>Цена: ".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=serga1d">Назад</a>';}
if ($total > $start + 10) {echo '<a href="shops.php?start='.($start + 10).'&'.$sd.'&go=serga1d">Далее</a>';}
break;
case 'serga1ng':
$dir = opendir ("MySql/base123/shop");
while ($file = readdir ($dir))
{if (( $file != ".") && ($file != ".."))
{$a[]=$file;}}
closedir ($dir);
$total = count($a);

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

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

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

$dat_id[]=$a[$i];
$dat_cena[]=$data[1];
$dat_sila[]=$data[0];
$dat_gr[]="NG";
$dat_name[]=$data[4];}}
}
}
foreach($dat_name as $k=>$v)
{
$gr[]=$dat_gr[$k];
$dat_screen[]="<b><img src=\"pic/serga/$dat_name[$k].gif\" alt=\"pic\"/><a href=\"pokupka2.php?$sd&vesh=$dat_id[$k]&gorod=$udata[20]\">$dat_name[$k]</a></b><br/>Защита: M+$dat_sila[$k]<br/>Цена: ".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=serga1ng">Назад</a>';}
if ($total > $start + 10) {echo '<a href="shops.php?start='.($start + 10).'&'.$sd.'&go=serga1ng">Далее</a>';}
break;
case 'serga':
echo"<u>Выберите У меня многи изделий:</u><br/>";
echo"[<a href=\"shops.php?$sd&go=sergang\">NG</a>] (до 20 ур)<br/>";
echo"[<a href=\"shops.php?$sd&go=sergad\">D</a>] (до 40 ур)<br/>";
echo"[<a href=\"shops.php?$sd&go=sergac\">C</a>] (до 52 ур)<br/>";
echo"[<a href=\"shops.php?$sd&go=sergab\">B</a>] (до 62 ур)<br/>";
echo"[<a href=\"shops.php?$sd&go=sergaa\">A</a>] (до 76 ур)<br/>";
echo"[<a href=\"shops.php?$sd&go=sergas\">S</a>] (от 76 ур)<br/>";
break;
case 'sergas':
$dir = opendir ("MySql/base123/shop");
while ($file = readdir ($dir))
{if (( $file != ".") && ($file != ".."))
{$a[]=$file;}}
closedir ($dir);
$total = count($a);

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

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

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

$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[]="<b><img src=\"pic/serga/$dat_name[$k].gif\" alt=\"pic\"/><a href=\"pokupka2.php?$sd&vesh=$dat_id[$k]&gorod=$udata[20]\">$dat_name[$k]</a></b><br/>Защита: M+$dat_sila[$k]<br/>Цена: ".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=sergas">Назад</a>';}
if ($total > $start + 10) {echo '<a href="shops.php?start='.($start + 10).'&'.$sd.'&go=sergas">Далее</a>';}
break;
case 'sergaa':
$dir = opendir ("MySql/base123/shop");
while ($file = readdir ($dir))
{if (( $file != ".") && ($file != ".."))
{$a[]=$file;}}
closedir ($dir);
$total = count($a);

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

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

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

$dat_id[]=$a[$i];
$dat_cena[]=$data[1];
$dat_sila[]=$data[0];
$dat_gr[]="A";
$dat_name[]=$data[4];}}
}
}
foreach($dat_name as $k=>$v)
{
$gr[]=$dat_gr[$k];
$dat_screen[]="<b><img src=\"pic/serga/$dat_name[$k].gif\" alt=\"pic\"/><a href=\"pokupka2.php?$sd&vesh=$dat_id[$k]&gorod=$udata[20]\">$dat_name[$k]</a></b><br/>Защита: M+$dat_sila[$k]<br/>Цена: ".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=sergaa">Назад</a>';}
if ($total > $start + 10) {echo '<a href="shops.php?start='.($start + 10).'&'.$sd.'&go=sergaa">Далее</a>';}
break;
case 'sergab':
$dir = opendir ("MySql/base123/shop");
while ($file = readdir ($dir))
{if (( $file != ".") && ($file != ".."))
{$a[]=$file;}}
closedir ($dir);
$total = count($a);

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

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

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

$dat_id[]=$a[$i];
$dat_cena[]=$data[1];
$dat_sila[]=$data[0];
$dat_gr[]="B";
$dat_name[]=$data[4];}}
}
}
foreach($dat_name as $k=>$v)
{
$gr[]=$dat_gr[$k];
$dat_screen[]="<b><img src=\"pic/serga/$dat_name[$k].gif\" alt=\"pic\"/><a href=\"pokupka2.php?$sd&vesh=$dat_id[$k]&gorod=$udata[20]\">$dat_name[$k]</a></b><br/>Защита: M+$dat_sila[$k]<br/>Цена: ".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=sergab">Назад</a>';}
if ($total > $start + 10) {echo '<a href="shops.php?start='.($start + 10).'&'.$sd.'&go=sergab">Далее</a>';}
break;
case 'sergac':
$dir = opendir ("MySql/base123/shop");
while ($file = readdir ($dir))
{if (( $file != ".") && ($file != ".."))
{$a[]=$file;}}
closedir ($dir);
$total = count($a);

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

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

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

$dat_id[]=$a[$i];
$dat_cena[]=$data[1];
$dat_sila[]=$data[0];
$dat_gr[]="C";
$dat_name[]=$data[4];}}
}
}
foreach($dat_name as $k=>$v)
{
$gr[]=$dat_gr[$k];
$dat_screen[]="<b><img src=\"pic/serga/$dat_name[$k].gif\" alt=\"pic\"/><a href=\"pokupka2.php?$sd&vesh=$dat_id[$k]&gorod=$udata[20]\">$dat_name[$k]</a></b><br/>Защита: M+$dat_sila[$k]<br/>Цена: ".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=sergac">Назад</a>';}
if ($total > $start + 10) {echo '<a href="shops.php?start='.($start + 10).'&'.$sd.'&go=sergac">Далее</a>';}
break;
case 'sergad':
$dir = opendir ("MySql/base123/shop");
while ($file = readdir ($dir))
{if (( $file != ".") && ($file != ".."))
{$a[]=$file;}}
closedir ($dir);
$total = count($a);

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

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

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

$dat_id[]=$a[$i];
$dat_cena[]=$data[1];
$dat_sila[]=$data[0];
$dat_gr[]="D";
$dat_name[]=$data[4];}}
}
}
foreach($dat_name as $k=>$v)
{
$gr[]=$dat_gr[$k];
$dat_screen[]="<b><img src=\"pic/serga/$dat_name[$k].gif\" alt=\"pic\"/><a href=\"pokupka2.php?$sd&vesh=$dat_id[$k]&gorod=$udata[20]\">$dat_name[$k]</a></b><br/>Защита: M+$dat_sila[$k]<br/>Цена: ".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=sergad">Назад</a>';}
if ($total > $start + 10) {echo '<a href="shops.php?start='.($start + 10).'&'.$sd.'&go=sergad">Далее</a>';}
break;
case 'sergang':
$dir = opendir ("MySql/base123/shop");
while ($file = readdir ($dir))
{if (( $file != ".") && ($file != ".."))
{$a[]=$file;}}
closedir ($dir);
$total = count($a);

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

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

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

$dat_id[]=$a[$i];
$dat_cena[]=$data[1];
$dat_sila[]=$data[0];
$dat_gr[]="NG";
$dat_name[]=$data[4];}}
}
}
foreach($dat_name as $k=>$v)
{
$gr[]=$dat_gr[$k];
$dat_screen[]="<b><img src=\"pic/serga/$dat_name[$k].gif\" alt=\"pic\"/><a href=\"pokupka2.php?$sd&vesh=$dat_id[$k]&gorod=$udata[20]\">$dat_name[$k]</a></b><br/>Защита: M+$dat_sila[$k]<br/>Цена: ".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=sergang">Назад</a>';}
if ($total > $start + 10) {echo '<a href="shops.php?start='.($start + 10).'&'.$sd.'&go=sergang">Далее</a>';}
break;
case 'ring1':
echo"<u>Выберите У меня многи изделий:</u><br/>";
echo"[<a href=\"shops.php?$sd&go=ring1ng\">NG</a>] (до 20 ур)<br/>";
echo"[<a href=\"shops.php?$sd&go=ring1d\">D</a>] (до 40 ур)<br/>";
echo"[<a href=\"shops.php?$sd&go=ring1c\">C</a>] (до 52 ур)<br/>";
echo"[<a href=\"shops.php?$sd&go=ring1b\">B</a>] (до 62 ур)<br/>";
echo"[<a href=\"shops.php?$sd&go=ring1a\">A</a>] (до 76 ур)<br/>";
echo"[<a href=\"shops.php?$sd&go=ring1s\">S</a>] (от 76 ур)<br/>";
break;
case 'ring1s':
$dir = opendir ("MySql/base123/shop");
while ($file = readdir ($dir))
{if (( $file != ".") && ($file != ".."))
{$a[]=$file;}}
closedir ($dir);
$total = count($a);

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

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

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

$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[]="<b><img src=\"pic/kolco2/$dat_name[$k].gif\" alt=\"pic\"/><a href=\"pokupka2.php?$sd&vesh=$dat_id[$k]&gorod=$udata[20]\">$dat_name[$k]</a></b><br/>Защита: M+$dat_sila[$k]<br/>Цена: ".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=ring1s">Назад</a>';}
if ($total > $start + 10) {echo '<a href="shops.php?start='.($start + 10).'&'.$sd.'&go=ring1s">Далее</a>';}
break;
case 'ring1a':
$dir = opendir ("MySql/base123/shop");
while ($file = readdir ($dir))
{if (( $file != ".") && ($file != ".."))
{$a[]=$file;}}
closedir ($dir);
$total = count($a);

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

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

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

$dat_id[]=$a[$i];
$dat_cena[]=$data[1];
$dat_sila[]=$data[0];
$dat_gr[]="A";
$dat_name[]=$data[4];}}
}
}
foreach($dat_name as $k=>$v)
{
$gr[]=$dat_gr[$k];
$dat_screen[]="<b><img src=\"pic/kolco2/$dat_name[$k].gif\" alt=\"pic\"/><a href=\"pokupka2.php?$sd&vesh=$dat_id[$k]&gorod=$udata[20]\">$dat_name[$k]</a></b><br/>Защита: M+$dat_sila[$k]<br/>Цена: ".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=ring1a">Назад</a>';}
if ($total > $start + 10) {echo '<a href="shops.php?start='.($start + 10).'&'.$sd.'&go=ring1a">Далее</a>';}
break;
case 'ring1b':
$dir = opendir ("MySql/base123/shop");
while ($file = readdir ($dir))
{if (( $file != ".") && ($file != ".."))
{$a[]=$file;}}
closedir ($dir);
$total = count($a);

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

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

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

$dat_id[]=$a[$i];
$dat_cena[]=$data[1];
$dat_sila[]=$data[0];
$dat_gr[]="B";
$dat_name[]=$data[4];}}
}
}
foreach($dat_name as $k=>$v)
{
$gr[]=$dat_gr[$k];
$dat_screen[]="<b><img src=\"pic/kolco2/$dat_name[$k].gif\" alt=\"pic\"/><a href=\"pokupka2.php?$sd&vesh=$dat_id[$k]&gorod=$udata[20]\">$dat_name[$k]</a></b><br/>Защита: M+$dat_sila[$k]<br/>Цена: ".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=ring1b">Назад</a>';}
if ($total > $start + 10) {echo '<a href="shops.php?start='.($start + 10).'&'.$sd.'&go=ring1b">Далее</a>';}
break;
case 'ring1ng':
$dir = opendir ("MySql/base123/shop");
while ($file = readdir ($dir))
{if (( $file != ".") && ($file != ".."))
{$a[]=$file;}}
closedir ($dir);
$total = count($a);

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

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

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

$dat_id[]=$a[$i];
$dat_cena[]=$data[1];
$dat_sila[]=$data[0];
$dat_gr[]="NG";
$dat_name[]=$data[4];}}
}
}
foreach($dat_name as $k=>$v)
{
$gr[]=$dat_gr[$k];
$dat_screen[]="<b><img src=\"pic/kolco2/$dat_name[$k].gif\" alt=\"pic\"/><a href=\"pokupka2.php?$sd&vesh=$dat_id[$k]&gorod=$udata[20]\">$dat_name[$k]</a></b><br/>Защита: M+$dat_sila[$k]<br/>Цена: ".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=ring1ng">Назад</a>';}
if ($total > $start + 10) {echo '<a href="shops.php?start='.($start + 10).'&'.$sd.'&go=ring1ng">Далее</a>';}
break;
case 'ring1d':
$dir = opendir ("MySql/base123/shop");
while ($file = readdir ($dir))
{if (( $file != ".") && ($file != ".."))
{$a[]=$file;}}
closedir ($dir);
$total = count($a);

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

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

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

$dat_id[]=$a[$i];
$dat_cena[]=$data[1];
$dat_sila[]=$data[0];
$dat_gr[]="D";
$dat_name[]=$data[4];}}
}
}
foreach($dat_name as $k=>$v)
{
$gr[]=$dat_gr[$k];
$dat_screen[]="<b><img src=\"pic/kolco2/$dat_name[$k].gif\" alt=\"pic\"/><a href=\"pokupka2.php?$sd&vesh=$dat_id[$k]&gorod=$udata[20]\">$dat_name[$k]</a></b><br/>Защита: M+$dat_sila[$k]<br/>Цена: ".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=ring1d">Назад</a>';}
if ($total > $start + 10) {echo '<a href="shops.php?start='.($start + 10).'&'.$sd.'&go=ring1d">Далее</a>';}
break;
case 'ring1c':
$dir = opendir ("MySql/base123/shop");
while ($file = readdir ($dir))
{if (( $file != ".") && ($file != ".."))
{$a[]=$file;}}
closedir ($dir);
$total = count($a);

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

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

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

$dat_id[]=$a[$i];
$dat_cena[]=$data[1];
$dat_sila[]=$data[0];
$dat_gr[]="C";
$dat_name[]=$data[4];}}
}
}
foreach($dat_name as $k=>$v)
{
$gr[]=$dat_gr[$k];
$dat_screen[]="<b><img src=\"pic/kolco2/$dat_name[$k].gif\" alt=\"pic\"/><a href=\"pokupka2.php?$sd&vesh=$dat_id[$k]&gorod=$udata[20]\">$dat_name[$k]</a></b><br/>Защита: M+$dat_sila[$k]<br/>Цена: ".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=ring1c">Назад</a>';}
if ($total > $start + 10) {echo '<a href="shops.php?start='.($start + 10).'&'.$sd.'&go=ring1c">Далее</a>';}break;
break;
case 'ring':
echo"<u>Выберите У меня многи изделий:</u><br/>";
echo"[<a href=\"shops.php?$sd&go=ringng\">NG</a>] (до 20 ур)<br/>";
echo"[<a href=\"shops.php?$sd&go=ringd\">D</a>] (до 40 ур)<br/>";
echo"[<a href=\"shops.php?$sd&go=ringc\">C</a>] (до 52 ур)<br/>";
echo"[<a href=\"shops.php?$sd&go=ringb\">B</a>] (до 62 ур)<br/>";
echo"[<a href=\"shops.php?$sd&go=ringa\">A</a>] (до 76 ур)<br/>";
echo"[<a href=\"shops.php?$sd&go=rings\">S</a>] (от 76 ур)<br/>";
break;
case 'ringng':
$dir = opendir ("MySql/base123/shop");
while ($file = readdir ($dir))
{if (( $file != ".") && ($file != ".."))
{$a[]=$file;}}
closedir ($dir);
$total = count($a);

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

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

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

$dat_id[]=$a[$i];
$dat_cena[]=$data[1];
$dat_sila[]=$data[0];
$dat_gr[]="NG";
$dat_name[]=$data[4];}}
}
}
foreach($dat_name as $k=>$v)
{
$gr[]=$dat_gr[$k];
$dat_screen[]="<b><img src=\"pic/kolco/$dat_name[$k].gif\" alt=\"pic\"/><a href=\"pokupka2.php?$sd&vesh=$dat_id[$k]&gorod=$udata[20]\">$dat_name[$k]</a></b><br/>Защита: M+$dat_sila[$k]<br/>Цена: ".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=ringng">Назад</a>';}
if ($total > $start + 10) {echo '<a href="shops.php?start='.($start + 10).'&'.$sd.'&go=ringng">Далее</a>';}
break;
case 'ringd':
$dir = opendir ("MySql/base123/shop");
while ($file = readdir ($dir))
{if (( $file != ".") && ($file != ".."))
{$a[]=$file;}}
closedir ($dir);
$total = count($a);

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

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

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

$dat_id[]=$a[$i];
$dat_cena[]=$data[1];
$dat_sila[]=$data[0];
$dat_gr[]="D";
$dat_name[]=$data[4];}}
}
}
foreach($dat_name as $k=>$v)
{
$gr[]=$dat_gr[$k];
$dat_screen[]="<b><img src=\"pic/kolco/$dat_name[$k].gif\" alt=\"pic\"/><a href=\"pokupka2.php?$sd&vesh=$dat_id[$k]&gorod=$udata[20]\">$dat_name[$k]</a></b><br/>Защита: M+$dat_sila[$k]<br/>Цена: ".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=ringd">Назад</a>';}
if ($total > $start + 10) {echo '<a href="shops.php?start='.($start + 10).'&'.$sd.'&go=ringd">Далее</a>';}
break;
case 'ringc':
$dir = opendir ("MySql/base123/shop");
while ($file = readdir ($dir))
{if (( $file != ".") && ($file != ".."))
{$a[]=$file;}}
closedir ($dir);
$total = count($a);

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

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

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

$dat_id[]=$a[$i];
$dat_cena[]=$data[1];
$dat_sila[]=$data[0];
$dat_gr[]="C";
$dat_name[]=$data[4];}}
}
}
foreach($dat_name as $k=>$v)
{
$gr[]=$dat_gr[$k];
$dat_screen[]="<b><img src=\"pic/kolco/$dat_name[$k].gif\" alt=\"pic\"/><a href=\"pokupka2.php?$sd&vesh=$dat_id[$k]&gorod=$udata[20]\">$dat_name[$k]</a></b><br/>Защита: M+$dat_sila[$k]<br/>Цена: ".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=ringc">Назад</a>';}
if ($total > $start + 10) {echo '<a href="shops.php?start='.($start + 10).'&'.$sd.'&go=ringc">Далее</a>';}
break;
case 'ringb':
$dir = opendir ("MySql/base123/shop");
while ($file = readdir ($dir))
{if (( $file != ".") && ($file != ".."))
{$a[]=$file;}}
closedir ($dir);
$total = count($a);

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

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

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

$dat_id[]=$a[$i];
$dat_cena[]=$data[1];
$dat_sila[]=$data[0];
$dat_gr[]="B";
$dat_name[]=$data[4];}}
}
}
foreach($dat_name as $k=>$v)
{
$gr[]=$dat_gr[$k];
$dat_screen[]="<b><img src=\"pic/kolco/$dat_name[$k].gif\" alt=\"pic\"/><a href=\"pokupka2.php?$sd&vesh=$dat_id[$k]&gorod=$udata[20]\">$dat_name[$k]</a></b><br/>Защита: M+$dat_sila[$k]<br/>Цена: ".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=ringb">Назад</a>';}
if ($total > $start + 10) {echo '<a href="shops.php?start='.($start + 10).'&'.$sd.'&go=ringb">Далее</a>';}
break;
case 'ringa':
$dir = opendir ("MySql/base123/shop");
while ($file = readdir ($dir))
{if (( $file != ".") && ($file != ".."))
{$a[]=$file;}}
closedir ($dir);
$total = count($a);

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

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

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

$dat_id[]=$a[$i];
$dat_cena[]=$data[1];
$dat_sila[]=$data[0];
$dat_gr[]="A";
$dat_name[]=$data[4];}}
}
}
foreach($dat_name as $k=>$v)
{
$gr[]=$dat_gr[$k];
$dat_screen[]="<b><img src=\"pic/kolco/$dat_name[$k].gif\" alt=\"pic\"/><a href=\"pokupka2.php?$sd&vesh=$dat_id[$k]&gorod=$udata[20]\">$dat_name[$k]</a></b><br/>Защита: M+$dat_sila[$k]<br/>Цена: ".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=ringa">Назад</a>';}
if ($total > $start + 10) {echo '<a href="shops.php?start='.($start + 10).'&'.$sd.'&go=ringa">Далее</a>';}
break;
case 'rings':
$dir = opendir ("MySql/base123/shop");
while ($file = readdir ($dir))
{if (( $file != ".") && ($file != ".."))
{$a[]=$file;}}
closedir ($dir);
$total = count($a);

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

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

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

$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[]="<b><img src=\"pic/kolco/$dat_name[$k].gif\" alt=\"pic\"/><a href=\"pokupka2.php?$sd&vesh=$dat_id[$k]&gorod=$udata[20]\">$dat_name[$k]</a></b><br/>Защита: M+$dat_sila[$k]<br/>Цена: ".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=rings">Назад</a>';}
if ($total > $start + 10) {echo '<a href="shops.php?start='.($start + 10).'&'.$sd.'&go=rings">Далее</a>';}
break;
case 'sheya':
echo"<u>Выберите У меня многи изделий:</u><br/>";
echo"[<a href=\"shops.php?$sd&go=sheyang\">NG</a>] (до 20 ур)<br/>";
echo"[<a href=\"shops.php?$sd&go=sheyad\">D</a>] (до 40 ур)<br/>";
echo"[<a href=\"shops.php?$sd&go=sheyac\">C</a>] (до 52 ур)<br/>";
echo"[<a href=\"shops.php?$sd&go=sheyab\">B</a>] (до 62 ур)<br/>";
echo"[<a href=\"shops.php?$sd&go=sheyaa\">A</a>] (до 76 ур)<br/>";
echo"[<a href=\"shops.php?$sd&go=sheyas\">S</a>] (от 76 ур)<br/>";
break;
case 'sheyang':
$dir = opendir ("MySql/base123/shop");
while ($file = readdir ($dir))
{if (( $file != ".") && ($file != ".."))
{$a[]=$file;}}
closedir ($dir);
$total = count($a);

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

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

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

$dat_id[]=$a[$i];
$dat_cena[]=$data[1];
$dat_sila[]=$data[0];
$dat_gr[]="NG";
$dat_name[]=$data[4];}}
}
}
foreach($dat_name as $k=>$v)
{
$gr[]=$dat_gr[$k];
$dat_screen[]="<b><img src=\"pic/sheya/$dat_name[$k].gif\" alt=\"pic\"/><a href=\"pokupka2.php?$sd&vesh=$dat_id[$k]&gorod=$udata[20]\">$dat_name[$k]</a></b><br/>Защита: M+$dat_sila[$k]<br/>Цена: ".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=sheyang">Назад</a>';}
if ($total > $start + 10) {echo '<a href="shops.php?start='.($start + 10).'&'.$sd.'&go=sheyang">Далее</a>';}
break;



case 'sheyad':
$dir = opendir ("MySql/base123/shop");
while ($file = readdir ($dir))
{if (( $file != ".") && ($file != ".."))
{$a[]=$file;}}
closedir ($dir);
$total = count($a);

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

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

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

$dat_id[]=$a[$i];
$dat_cena[]=$data[1];
$dat_sila[]=$data[0];
$dat_gr[]="D";
$dat_name[]=$data[4];}}
}
}
foreach($dat_name as $k=>$v)
{
$gr[]=$dat_gr[$k];
$dat_screen[]="<b><img src=\"pic/sheya/$dat_name[$k].gif\" alt=\"pic\"/><a href=\"pokupka2.php?$sd&vesh=$dat_id[$k]&gorod=$udata[20]\">$dat_name[$k]</a></b><br/>Защита: M+$dat_sila[$k]<br/>Цена: ".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=bodyd">Назад</a>';}
if ($total > $start + 10) {echo '<a href="shops.php?start='.($start + 10).'&'.$sd.'&go=bodyd">Далее</a>';}
break;



case 'sheyaa':
$dir = opendir ("MySql/base123/shop");
while ($file = readdir ($dir))
{if (( $file != ".") && ($file != ".."))
{$a[]=$file;}}
closedir ($dir);
$total = count($a);

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

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

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

$dat_id[]=$a[$i];
$dat_cena[]=$data[1];
$dat_sila[]=$data[0];
$dat_gr[]="A";
$dat_name[]=$data[4];}}
}
}
foreach($dat_name as $k=>$v)
{
$gr[]=$dat_gr[$k];
$dat_screen[]="<b><img src=\"pic/sheya/$dat_name[$k].gif\" alt=\"pic\"/><a href=\"pokupka2.php?$sd&vesh=$dat_id[$k]&gorod=$udata[20]\">$dat_name[$k]</a></b><br/>Защита: M+$dat_sila[$k]<br/>Цена: ".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=bodyd">Назад</a>';}
if ($total > $start + 10) {echo '<a href="shops.php?start='.($start + 10).'&'.$sd.'&go=bodyd">Далее</a>';}
break;



case 'sheyab':
$dir = opendir ("MySql/base123/shop");
while ($file = readdir ($dir))
{if (( $file != ".") && ($file != ".."))
{$a[]=$file;}}
closedir ($dir);
$total = count($a);

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

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

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

$dat_id[]=$a[$i];
$dat_cena[]=$data[1];
$dat_sila[]=$data[0];
$dat_gr[]="B";
$dat_name[]=$data[4];}}
}
}
foreach($dat_name as $k=>$v)
{
$gr[]=$dat_gr[$k];
$dat_screen[]="<b><img src=\"pic/sheya/$dat_name[$k].gif\" alt=\"pic\"/><a href=\"pokupka2.php?$sd&vesh=$dat_id[$k]&gorod=$udata[20]\">$dat_name[$k]</a></b><br/>Защита: M+$dat_sila[$k]<br/>Цена: ".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=bodyd">Назад</a>';}
if ($total > $start + 10) {echo '<a href="shops.php?start='.($start + 10).'&'.$sd.'&go=bodyd">Далее</a>';}
break;



case 'sheyac':
$dir = opendir ("MySql/base123/shop");
while ($file = readdir ($dir))
{if (( $file != ".") && ($file != ".."))
{$a[]=$file;}}
closedir ($dir);
$total = count($a);

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

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

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

$dat_id[]=$a[$i];
$dat_cena[]=$data[1];
$dat_sila[]=$data[0];
$dat_gr[]="D";
$dat_name[]=$data[4];}}
}
}
foreach($dat_name as $k=>$v)
{
$gr[]=$dat_gr[$k];
$dat_screen[]="<b><img src=\"pic/sheya/$dat_name[$k].gif\" alt=\"pic\"/><a href=\"pokupka2.php?$sd&vesh=$dat_id[$k]&gorod=$udata[20]\">$dat_name[$k]</a></b><br/>Защита: M+$dat_sila[$k]<br/>Цена: ".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=bodyd">Назад</a>';}
if ($total > $start + 10) {echo '<a href="shops.php?start='.($start + 10).'&'.$sd.'&go=bodyd">Далее</a>';}
break;



case 'sheyas':
$dir = opendir ("MySql/base123/shop");
while ($file = readdir ($dir))
{if (( $file != ".") && ($file != ".."))
{$a[]=$file;}}
closedir ($dir);
$total = count($a);

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

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

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

$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[]="<b><img src=\"pic/sheya/$dat_name[$k].gif\" alt=\"pic\"/><a href=\"pokupka2.php?$sd&vesh=$dat_id[$k]&gorod=$udata[20]\">$dat_name[$k]</a></b><br/>Защита: M+$dat_sila[$k]<br/>Цена: ".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=bodyd">Назад</a>';}
if ($total > $start + 10) {echo '<a href="shops.php?start='.($start + 10).'&'.$sd.'&go=bodyd">Далее</a>';}
break;



case 'body':
echo"<u>Выберите Graid</u><br/>";
echo"[<a href=\"shops.php?$sd&go=bodyng\">NG</a>] (до 20 ур)<br/>";
echo"[<a href=\"shops.php?$sd&go=bodyd\">D</a>] (до 40 ур)<br/>";
echo"[<a href=\"shops.php?$sd&go=bodyc\">C</a>] (до 52 ур)<br/>";
echo"[<a href=\"shops.php?$sd&go=bodyb\">B</a>] (до 62 ур)<br/>";
echo"[<a href=\"shops.php?$sd&go=bodya\">A</a>] (до 76 ур)<br/>";
echo"[<a href=\"shops.php?$sd&go=bodys\">S</a>] (от 76 ур)<br/>";
break;
case 'bodyng':
$dir = opendir ("MySql/base123/shop");
while ($file = readdir ($dir))
{if (( $file != ".") && ($file != ".."))
{$a[]=$file;}}
closedir ($dir);
$total = count($a);

for ($i = 0; $i < $total; $i++){
$tex = @file("MySql/base123/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]=="0"){

$dat_id[]=$a[$i];
$dat_cena[]=$data[1];
$dat_sila[]=$data[0];
$dat_gr[]="NG";
$dat_name[]=$data[4];}}
}
}
foreach($dat_name as $k=>$v)
{
$gr[]=$dat_gr[$k];
$dat_screen[]="<b><img src=\"pic/robe/$dat_name[$k].gif\" alt=\"pic\"/><a href=\"pokupka2.php?$sd&vesh=$dat_id[$k]&gorod=$udata[20]\">$dat_name[$k]</a></b><br/>Защита: M+$dat_sila[$k]<br/>Цена: ".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=bodyng">Назад</a>';}
if ($total > $start + 10) {echo '<a href="shops.php?start='.($start + 10).'&'.$sd.'&go=bodyng">Далее</a>';}
break;



case 'bodyd':
$dir = opendir ("MySql/base123/shop");
while ($file = readdir ($dir))
{if (( $file != ".") && ($file != ".."))
{$a[]=$file;}}
closedir ($dir);
$total = count($a);

for ($i = 0; $i < $total; $i++){
$tex = @file("MySql/base123/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]=="D"){

$dat_id[]=$a[$i];
$dat_cena[]=$data[1];
$dat_sila[]=$data[0];
$dat_gr[]="D";
$dat_name[]=$data[4];}}
}
}
foreach($dat_name as $k=>$v)
{
$gr[]=$dat_gr[$k];
$dat_screen[]="<b><img src=\"pic/robe/$dat_name[$k].gif\" alt=\"pic\"/><a href=\"pokupka2.php?$sd&vesh=$dat_id[$k]&gorod=$udata[20]\">$dat_name[$k]</a></b><br/>Защита: M+$dat_sila[$k]<br/>Цена: ".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=bodyd">Назад</a>';}
if ($total > $start + 10) {echo '<a href="shops.php?start='.($start + 10).'&'.$sd.'&go=bodyd">Далее</a>';}
break;

case 'bodyc':
$dir = opendir ("MySql/base123/shop");
while ($file = readdir ($dir))
{if (( $file != ".") && ($file != ".."))
{$a[]=$file;}}
closedir ($dir);
$total = count($a);

for ($i = 0; $i < $total; $i++){
$tex = @file("MySql/base123/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]=="C"){

$dat_id[]=$a[$i];
$dat_cena[]=$data[1];
$dat_sila[]=$data[0];
$dat_gr[]="C";
$dat_name[]=$data[4];}}
}
}
foreach($dat_name as $k=>$v)
{
$gr[]=$dat_gr[$k];
$dat_screen[]="<b><img src=\"pic/robe/$dat_name[$k].gif\" alt=\"pic\"/><a href=\"pokupka2.php?$sd&vesh=$dat_id[$k]&gorod=$udata[20]\">$dat_name[$k]</a></b><br/>Защита: M+$dat_sila[$k]<br/>Цена: ".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=bodyc">Назад</a>';}
if ($total > $start + 10) {echo '<a href="shops.php?start='.($start + 10).'&'.$sd.'&go=bodyc">Далее</a>';}
break;
case 'bodyb':
$dir = opendir ("MySql/base123/shop");
while ($file = readdir ($dir))
{if (( $file != ".") && ($file != ".."))
{$a[]=$file;}}
closedir ($dir);
$total = count($a);

for ($i = 0; $i < $total; $i++){
$tex = @file("MySql/base123/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]=="B"){

$dat_id[]=$a[$i];
$dat_cena[]=$data[1];
$dat_sila[]=$data[0];
$dat_gr[]="B";
$dat_name[]=$data[4];}}
}
}
foreach($dat_name as $k=>$v)
{
$gr[]=$dat_gr[$k];
$dat_screen[]="<b><img src=\"pic/robe/$dat_name[$k].gif\" alt=\"pic\"/><a href=\"pokupka2.php?$sd&vesh=$dat_id[$k]&gorod=$udata[20]\">$dat_name[$k]</a></b><br/>Защита: M+$dat_sila[$k]<br/>Цена: ".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=bodyb">Назад</a>';}
if ($total > $start + 10) {echo '<a href="shops.php?start='.($start + 10).'&'.$sd.'&go=bodyb">Далее</a>';}
break;
case 'bodya':
$dir = opendir ("MySql/base123/shop");
while ($file = readdir ($dir))
{if (( $file != ".") && ($file != ".."))
{$a[]=$file;}}
closedir ($dir);
$total = count($a);

for ($i = 0; $i < $total; $i++){
$tex = @file("MySql/base123/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]=="A"){

$dat_id[]=$a[$i];
$dat_cena[]=$data[1];
$dat_sila[]=$data[0];
$dat_gr[]="A";
$dat_name[]=$data[4];}}
}
}
foreach($dat_name as $k=>$v)
{
$gr[]=$dat_gr[$k];
$dat_screen[]="<b><img src=\"pic/robe/$dat_name[$k].gif\" alt=\"pic\"/><a href=\"pokupka2.php?$sd&vesh=$dat_id[$k]&gorod=$udata[20]\">$dat_name[$k]</a></b><br/>Защита: M+$dat_sila[$k]<br/>Цена: ".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=bodya">Назад</a>';}
if ($total > $start + 10) {echo '<a href="shops.php?start='.($start + 10).'&'.$sd.'&go=bodya">Далее</a>';}
break;
case 'bodys':
$dir = opendir ("MySql/base123/shop");
while ($file = readdir ($dir))
{if (( $file != ".") && ($file != ".."))
{$a[]=$file;}}
closedir ($dir);
$total = count($a);

for ($i = 0; $i < $total; $i++){
$tex = @file("MySql/base123/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]=="S"){

$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[]="<b><img src=\"pic/robe/$dat_name[$k].gif\" alt=\"pic\"/><a href=\"pokupka2.php?$sd&vesh=$dat_id[$k]&gorod=$udata[20]\">$dat_name[$k]</a></b><br/>Защита: M+$dat_sila[$k]<br/>Цена: ".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=bodys">Назад</a>';}
if ($total > $start + 10) {echo '<a href="shops.php?start='.($start + 10).'&'.$sd.'&go=bodys">Далее</a>';}
break;
case 'boots':
echo"<u>Выберите Graid</u><br/>";
echo"[<a href=\"shops.php?$sd&go=bootsng\">NG</a>] (до 20 ур)<br/>";
echo"[<a href=\"shops.php?$sd&go=bootsd\">D</a>] (до 40 ур)<br/>";
echo"[<a href=\"shops.php?$sd&go=bootsc\">C</a>] (до 52 ур)<br/>";
echo"[<a href=\"shops.php?$sd&go=bootsb\">B</a>] (до 62 ур)<br/>";
echo"[<a href=\"shops.php?$sd&go=bootsa\">A</a>] (до 76 ур)<br/>";
echo"[<a href=\"shops.php?$sd&go=bootss\">S</a>] (от 76 ур)<br/>";
break;
case 'bootsng':
$dir = opendir ("MySql/base123/shop");
while ($file = readdir ($dir))
{if (( $file != ".") && ($file != ".."))
{$a[]=$file;}}
closedir ($dir);
$total = count($a);

for ($i = 0; $i < $total; $i++){
$tex = @file("MySql/base123/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]=="0"){

$dat_id[]=$a[$i];
$dat_cena[]=$data[1];
$dat_sila[]=$data[0];
$dat_gr[]="NG";
$dat_name[]=$data[4];}}
}
}
foreach($dat_name as $k=>$v)
{
$gr[]=$dat_gr[$k];
$dat_screen[]="<b><img src=\"pic/boots/$dat_name[$k].gif\" alt=\"pic\"/><a href=\"pokupka2.php?$sd&vesh=$dat_id[$k]&gorod=$udata[20]\">$dat_name[$k]</a></b><br/>Защита: M+$dat_sila[$k]<br/>Цена: ".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=bootsng">Назад</a>';}
if ($total > $start + 10) {echo '<a href="shops.php?start='.($start + 10).'&'.$sd.'&go=bootsng">Далее</a>';}
break;
case 'bootsd':
$dir = opendir ("MySql/base123/shop");
while ($file = readdir ($dir))
{if (( $file != ".") && ($file != ".."))
{$a[]=$file;}}
closedir ($dir);
$total = count($a);

for ($i = 0; $i < $total; $i++){
$tex = @file("MySql/base123/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]=="D"){

$dat_id[]=$a[$i];
$dat_cena[]=$data[1];
$dat_sila[]=$data[0];
$dat_gr[]="D";
$dat_name[]=$data[4];}}
}
}
foreach($dat_name as $k=>$v)
{
$gr[]=$dat_gr[$k];
$dat_screen[]="<b><img src=\"pic/boots/$dat_name[$k].gif\" alt=\"pic\"/><a href=\"pokupka2.php?$sd&vesh=$dat_id[$k]&gorod=$udata[20]\">$dat_name[$k]</a></b><br/>Защита: M+$dat_sila[$k]<br/>Цена: ".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=bootsd">Назад</a>';}
if ($total > $start + 10) {echo '<a href="shops.php?start='.($start + 10).'&'.$sd.'&go=bootsd">Далее</a>';}
break;
case 'bootsc':
$dir = opendir ("MySql/base123/shop");
while ($file = readdir ($dir))
{if (( $file != ".") && ($file != ".."))
{$a[]=$file;}}
closedir ($dir);
$total = count($a);

for ($i = 0; $i < $total; $i++){
$tex = @file("MySql/base123/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]=="C"){

$dat_id[]=$a[$i];
$dat_cena[]=$data[1];
$dat_sila[]=$data[0];
$dat_gr[]="C";
$dat_name[]=$data[4];}}
}
}
foreach($dat_name as $k=>$v)
{
$gr[]=$dat_gr[$k];
$dat_screen[]="<b><img src=\"pic/boots/$dat_name[$k].gif\" alt=\"pic\"/><a href=\"pokupka2.php?$sd&vesh=$dat_id[$k]&gorod=$udata[20]\">$dat_name[$k]</a></b><br/>Защита: M+$dat_sila[$k]<br/>Цена: ".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=bootsc">Назад</a>';}
if ($total > $start + 10) {echo '<a href="shops.php?start='.($start + 10).'&'.$sd.'&go=bootsc">Далее</a>';}
break;
case 'bootsb':
$dir = opendir ("MySql/base123/shop");
while ($file = readdir ($dir))
{if (( $file != ".") && ($file != ".."))
{$a[]=$file;}}
closedir ($dir);
$total = count($a);

for ($i = 0; $i < $total; $i++){
$tex = @file("MySql/base123/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]=="B"){

$dat_id[]=$a[$i];
$dat_cena[]=$data[1];
$dat_sila[]=$data[0];
$dat_gr[]="B";
$dat_name[]=$data[4];}}
}
}
foreach($dat_name as $k=>$v)
{
$gr[]=$dat_gr[$k];
$dat_screen[]="<b><img src=\"pic/boots/$dat_name[$k].gif\" alt=\"pic\"/><a href=\"pokupka2.php?$sd&vesh=$dat_id[$k]&gorod=$udata[20]\">$dat_name[$k]</a></b><br/>Защита: M+$dat_sila[$k]<br/>Цена: ".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=bootsb">Назад</a>';}
if ($total > $start + 10) {echo '<a href="shops.php?start='.($start + 10).'&'.$sd.'&go=bootsb">Далее</a>';}
break;
case 'bootsa':
$dir = opendir ("MySql/base123/shop");
while ($file = readdir ($dir))
{if (( $file != ".") && ($file != ".."))
{$a[]=$file;}}
closedir ($dir);
$total = count($a);

for ($i = 0; $i < $total; $i++){
$tex = @file("MySql/base123/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]=="A"){

$dat_id[]=$a[$i];
$dat_cena[]=$data[1];
$dat_sila[]=$data[0];
$dat_gr[]="A";
$dat_name[]=$data[4];}}
}
}
foreach($dat_name as $k=>$v)
{
$gr[]=$dat_gr[$k];
$dat_screen[]="<b><img src=\"pic/boots/$dat_name[$k].gif\" alt=\"pic\"/><a href=\"pokupka2.php?$sd&vesh=$dat_id[$k]&gorod=$udata[20]\">$dat_name[$k]</a></b><br/>Защита: M+$dat_sila[$k]<br/>Цена: ".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=bootsa">Назад</a>';}
if ($total > $start + 10) {echo '<a href="shops.php?start='.($start + 10).'&'.$sd.'&go=bootsa">Далее</a>';}
break;
case 'bootss':
$dir = opendir ("MySql/base123/shop");
while ($file = readdir ($dir))
{if (( $file != ".") && ($file != ".."))
{$a[]=$file;}}
closedir ($dir);
$total = count($a);

for ($i = 0; $i < $total; $i++){
$tex = @file("MySql/base123/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]=="S"){

$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[]="<b><img src=\"pic/boots/$dat_name[$k].gif\" alt=\"pic\"/><a href=\"pokupka2.php?$sd&vesh=$dat_id[$k]&gorod=$udata[20]\">$dat_name[$k]</a></b><br/>Защита: M+$dat_sila[$k]<br/>Цена: ".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=bootss">Назад</a>';}
if ($total > $start + 10) {echo '<a href="shops.php?start='.($start + 10).'&'.$sd.'&go=bootss">Далее</a>';}
break;
case 'gloves':
echo"<u>Выберите Graid</u><br/>";
echo"[<a href=\"shops.php?$sd&go=glovesng\">NG</a>] (до 20 ур)<br/>";
echo"[<a href=\"shops.php?$sd&go=glovesd\">D</a>] (до 40 ур)<br/>";
echo"[<a href=\"shops.php?$sd&go=glovesc\">C</a>] (до 52 ур)<br/>";
echo"[<a href=\"shops.php?$sd&go=glovesb\">B</a>] (до 62 ур)<br/>";
echo"[<a href=\"shops.php?$sd&go=glovesa\">A</a>] (до 76 ур)<br/>";
echo"[<a href=\"shops.php?$sd&go=glovess\">S</a>] (от 76 ур)<br/>";
break;
case 'glovesng':
$dir = opendir ("MySql/base123/shop");
while ($file = readdir ($dir))
{if (( $file != ".") && ($file != ".."))
{$a[]=$file;}}
closedir ($dir);
$total = count($a);

for ($i = 0; $i < $total; $i++){
$tex = @file("MySql/base123/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]=="0"){

$dat_id[]=$a[$i];
$dat_cena[]=$data[1];
$dat_sila[]=$data[0];
$dat_gr[]="NG";
$dat_name[]=$data[4];}}
}
}
foreach($dat_name as $k=>$v)
{
$gr[]=$dat_gr[$k];
$dat_screen[]="<b><img src=\"pic/gloves/$dat_name[$k].gif\" alt=\"pic\"/><a href=\"pokupka2.php?$sd&vesh=$dat_id[$k]&gorod=$udata[20]\">$dat_name[$k]</a></b><br/>Защита: M+$dat_sila[$k]<br/>Цена: ".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=glovesng">Назад</a>';}
if ($total > $start + 10) {echo '<a href="shops.php?start='.($start + 10).'&'.$sd.'&go=glovesng">Далее</a>';}
break;
case 'glovesd':
$dir = opendir ("MySql/base123/shop");
while ($file = readdir ($dir))
{if (( $file != ".") && ($file != ".."))
{$a[]=$file;}}
closedir ($dir);
$total = count($a);

for ($i = 0; $i < $total; $i++){
$tex = @file("MySql/base123/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]=="D"){

$dat_id[]=$a[$i];
$dat_cena[]=$data[1];
$dat_sila[]=$data[0];
$dat_gr[]="D";
$dat_name[]=$data[4];}}
}
}
foreach($dat_name as $k=>$v)
{
$gr[]=$dat_gr[$k];
$dat_screen[]="<b><img src=\"pic/gloves/$dat_name[$k].gif\" alt=\"pic\"/><a href=\"pokupka2.php?$sd&vesh=$dat_id[$k]&gorod=$udata[20]\">$dat_name[$k]</a></b><br/>Защита: M+$dat_sila[$k]<br/>Цена: ".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=glovesd">Назад</a>';}
if ($total > $start + 10) {echo '<a href="shops.php?start='.($start + 10).'&'.$sd.'&go=glovesd">Далее</a>';}
break;
case 'glovesc':
$dir = opendir ("MySql/base123/shop");
while ($file = readdir ($dir))
{if (( $file != ".") && ($file != ".."))
{$a[]=$file;}}
closedir ($dir);
$total = count($a);

for ($i = 0; $i < $total; $i++){
$tex = @file("MySql/base123/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]=="C"){

$dat_id[]=$a[$i];
$dat_cena[]=$data[1];
$dat_sila[]=$data[0];
$dat_gr[]="C";
$dat_name[]=$data[4];}}
}
}
foreach($dat_name as $k=>$v)
{
$gr[]=$dat_gr[$k];
$dat_screen[]="<b><img src=\"pic/gloves/$dat_name[$k].gif\" alt=\"pic\"/><a href=\"pokupka2.php?$sd&vesh=$dat_id[$k]&gorod=$udata[20]\">$dat_name[$k]</a></b><br/>Защита: M+$dat_sila[$k]<br/>Цена: ".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=glovesc">Назад</a>';}
if ($total > $start + 10) {echo '<a href="shops.php?start='.($start + 10).'&'.$sd.'&go=glovesc">Далее</a>';}
break;
case 'glovesb':
$dir = opendir ("MySql/base123/shop");
while ($file = readdir ($dir))
{if (( $file != ".") && ($file != ".."))
{$a[]=$file;}}
closedir ($dir);
$total = count($a);

for ($i = 0; $i < $total; $i++){
$tex = @file("MySql/base123/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]=="B"){

$dat_id[]=$a[$i];
$dat_cena[]=$data[1];
$dat_sila[]=$data[0];
$dat_gr[]="B";
$dat_name[]=$data[4];}}
}
}
foreach($dat_name as $k=>$v)
{
$gr[]=$dat_gr[$k];
$dat_screen[]="<b><img src=\"pic/gloves/$dat_name[$k].gif\" alt=\"pic\"/><a href=\"pokupka2.php?$sd&vesh=$dat_id[$k]&gorod=$udata[20]\">$dat_name[$k]</a></b><br/>Защита: M+$dat_sila[$k]<br/>Цена: ".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=glovesb">Назад</a>';}
if ($total > $start + 10) {echo '<a href="shops.php?start='.($start + 10).'&'.$sd.'&go=glovesb">Далее</a>';}
break;
case 'glovesa':
$dir = opendir ("MySql/base123/shop");
while ($file = readdir ($dir))
{if (( $file != ".") && ($file != ".."))
{$a[]=$file;}}
closedir ($dir);
$total = count($a);

for ($i = 0; $i < $total; $i++){
$tex = @file("MySql/base123/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]=="A"){

$dat_id[]=$a[$i];
$dat_cena[]=$data[1];
$dat_sila[]=$data[0];
$dat_gr[]="A";
$dat_name[]=$data[4];}}
}
}
foreach($dat_name as $k=>$v)
{
$gr[]=$dat_gr[$k];
$dat_screen[]="<b><img src=\"pic/gloves/$dat_name[$k].gif\" alt=\"pic\"/><a href=\"pokupka2.php?$sd&vesh=$dat_id[$k]&gorod=$udata[20]\">$dat_name[$k]</a></b><br/>Защита: M+$dat_sila[$k]<br/>Цена: ".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=glovesa">Назад</a>';}
if ($total > $start + 10) {echo '<a href="shops.php?start='.($start + 10).'&'.$sd.'&go=glovesa">Далее</a>';}
break;
case 'glovess':
$dir = opendir ("MySql/base123/shop");
while ($file = readdir ($dir))
{if (( $file != ".") && ($file != ".."))
{$a[]=$file;}}
closedir ($dir);
$total = count($a);

for ($i = 0; $i < $total; $i++){
$tex = @file("MySql/base123/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]=="S"){

$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[]="<b><img src=\"pic/gloves/$dat_name[$k].gif\" alt=\"pic\"/><a href=\"pokupka2.php?$sd&vesh=$dat_id[$k]&gorod=$udata[20]\">$dat_name[$k]</a></b><br/>Защита: M+$dat_sila[$k]<br/>Цена: ".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=glovess">Назад</a>';}
if ($total > $start + 10) {echo '<a href="shops.php?start='.($start + 10).'&'.$sd.'&go=glovess">Далее</a>';}
break;
case '4it':
echo"<u>Выберите Graid</u><br/>";
echo"[<a href=\"shops.php?$sd&go=4itng\">NG</a>] (до 20 ур)<br/>";
echo"[<a href=\"shops.php?$sd&go=4itd\">D</a>] (до 40 ур)<br/>";
echo"[<a href=\"shops.php?$sd&go=4itc\">C</a>] (до 52 ур)<br/>";
echo"[<a href=\"shops.php?$sd&go=4itb\">B</a>] (до 62 ур)<br/>";
echo"[<a href=\"shops.php?$sd&go=4ita\">A</a>] (до 76 ур)<br/>";
echo"[<a href=\"shops.php?$sd&go=4its\">S</a>] (от 76 ур)<br/>";
break;
case '4itng':
$dir = opendir ("MySql/base123/shop");
while ($file = readdir ($dir))
{if (( $file != ".") && ($file != ".."))
{$a[]=$file;}}
closedir ($dir);
$total = count($a);

for ($i = 0; $i < $total; $i++){
$tex = @file("MySql/base123/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]=="0"){

$dat_id[]=$a[$i];
$dat_cena[]=$data[1];
$dat_sila[]=$data[0];
$dat_gr[]="NG";
$dat_name[]=$data[4];}}
}
}
foreach($dat_name as $k=>$v)
{
$gr[]=$dat_gr[$k];
$dat_screen[]="<b><img src=\"pic/4it/$dat_name[$k].gif\" alt=\"pic\"/><a href=\"pokupka2.php?$sd&vesh=$dat_id[$k]&gorod=$udata[20]\">$dat_name[$k]</a></b><br/>Защита: M+$dat_sila[$k]<br/>Цена: ".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=4itng">Назад</a>';}
if ($total > $start + 10) {echo '<a href="shops.php?start='.($start + 10).'&'.$sd.'&go=4itng">Далее</a>';}
break;
case '4itd':
$dir = opendir ("MySql/base123/shop");
while ($file = readdir ($dir))
{if (( $file != ".") && ($file != ".."))
{$a[]=$file;}}
closedir ($dir);
$total = count($a);

for ($i = 0; $i < $total; $i++){
$tex = @file("MySql/base123/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]=="D"){

$dat_id[]=$a[$i];
$dat_cena[]=$data[1];
$dat_sila[]=$data[0];
$dat_gr[]="D";
$dat_name[]=$data[4];}}
}
}
foreach($dat_name as $k=>$v)
{
$gr[]=$dat_gr[$k];
$dat_screen[]="<b><img src=\"pic/4it/$dat_name[$k].gif\" alt=\"pic\"/><a href=\"pokupka2.php?$sd&vesh=$dat_id[$k]&gorod=$udata[20]\">$dat_name[$k]</a></b><br/>Защита: M+$dat_sila[$k]<br/>Цена: ".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=4itd">Назад</a>';}
if ($total > $start + 10) {echo '<a href="shops.php?start='.($start + 10).'&'.$sd.'&go=4itd">Далее</a>';}
break;
case '4itc':
$dir = opendir ("MySql/base123/shop");
while ($file = readdir ($dir))
{if (( $file != ".") && ($file != ".."))
{$a[]=$file;}}
closedir ($dir);
$total = count($a);

for ($i = 0; $i < $total; $i++){
$tex = @file("MySql/base123/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]=="C"){

$dat_id[]=$a[$i];
$dat_cena[]=$data[1];
$dat_sila[]=$data[0];
$dat_gr[]="C";
$dat_name[]=$data[4];}}
}
}
foreach($dat_name as $k=>$v)
{
$gr[]=$dat_gr[$k];
$dat_screen[]="<b><img src=\"pic/4it/$dat_name[$k].gif\" alt=\"pic\"/><a href=\"pokupka2.php?$sd&vesh=$dat_id[$k]&gorod=$udata[20]\">$dat_name[$k]</a></b><br/>Защита: M+$dat_sila[$k]<br/>Цена: ".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=4itc">Назад</a>';}
if ($total > $start + 10) {echo '<a href="shops.php?start='.($start + 10).'&'.$sd.'&go=4itc">Далее</a>';}
break;
case '4itb':
$dir = opendir ("MySql/base123/shop");
while ($file = readdir ($dir))
{if (( $file != ".") && ($file != ".."))
{$a[]=$file;}}
closedir ($dir);
$total = count($a);

for ($i = 0; $i < $total; $i++){
$tex = @file("MySql/base123/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]=="B"){

$dat_id[]=$a[$i];
$dat_cena[]=$data[1];
$dat_sila[]=$data[0];
$dat_gr[]="B";
$dat_name[]=$data[4];}}
}
}
foreach($dat_name as $k=>$v)
{
$gr[]=$dat_gr[$k];
$dat_screen[]="<b><img src=\"pic/4it/$dat_name[$k].gif\" alt=\"pic\"/><a href=\"pokupka2.php?$sd&vesh=$dat_id[$k]&gorod=$udata[20]\">$dat_name[$k]</a></b><br/>Защита: M+$dat_sila[$k]<br/>Цена: ".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=4itb">Назад</a>';}
if ($total > $start + 10) {echo '<a href="shops.php?start='.($start + 10).'&'.$sd.'&go=4itb">Далее</a>';}
break;
case '4ita':
$dir = opendir ("MySql/base123/shop");
while ($file = readdir ($dir))
{if (( $file != ".") && ($file != ".."))
{$a[]=$file;}}
closedir ($dir);
$total = count($a);

for ($i = 0; $i < $total; $i++){
$tex = @file("MySql/base123/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]=="A"){

$dat_id[]=$a[$i];
$dat_cena[]=$data[1];
$dat_sila[]=$data[0];
$dat_gr[]="A";
$dat_name[]=$data[4];}}
}
}
foreach($dat_name as $k=>$v)
{
$gr[]=$dat_gr[$k];
$dat_screen[]="<b><img src=\"pic/4it/$dat_name[$k].gif\" alt=\"pic\"/><a href=\"pokupka2.php?$sd&vesh=$dat_id[$k]&gorod=$udata[20]\">$dat_name[$k]</a></b><br/>Защита: M+$dat_sila[$k]<br/>Цена: ".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=4ita">Назад</a>';}
if ($total > $start + 10) {echo '<a href="shops.php?start='.($start + 10).'&'.$sd.'&go=4ita">Далее</a>';}
break;
case '4its':
$dir = opendir ("MySql/base123/shop");
while ($file = readdir ($dir))
{if (( $file != ".") && ($file != ".."))
{$a[]=$file;}}
closedir ($dir);
$total = count($a);

for ($i = 0; $i < $total; $i++){
$tex = @file("MySql/base123/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]=="S"){

$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[]="<b><img src=\"pic/4it/$dat_name[$k].gif\" alt=\"pic\"/><a href=\"pokupka2.php?$sd&vesh=$dat_id[$k]&gorod=$udata[20]\">$dat_name[$k]</a></b><br/>Защита: M+$dat_sila[$k]<br/>Цена: ".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=4its">Назад</a>';}
if ($total > $start + 10) {echo '<a href="shops.php?start='.($start + 10).'&'.$sd.'&go=4its">Далее</a>';}
break;
case 'helmet':
echo"<u>Выберите Graid</u><br/>";
echo"[<a href=\"shops.php?$sd&go=helmetng\">NG</a>] (до 20 ур)<br/>";
echo"[<a href=\"shops.php?$sd&go=helmetd\">D</a>] (до 40 ур)<br/>";
echo"[<a href=\"shops.php?$sd&go=helmetc\">C</a>] (до 52 ур)<br/>";
echo"[<a href=\"shops.php?$sd&go=helmetb\">B</a>] (до 62 ур)<br/>";
echo"[<a href=\"shops.php?$sd&go=helmeta\">A</a>] (до 76 ур)<br/>";
echo"[<a href=\"shops.php?$sd&go=helmets\">S</a>] (от 76 ур)<br/>";
break;
case 'helmetng':
$dir = opendir ("MySql/base123/shop");
while ($file = readdir ($dir))
{if (( $file != ".") && ($file != ".."))
{$a[]=$file;}}
closedir ($dir);
$total = count($a);

for ($i = 0; $i < $total; $i++){
$tex = @file("MySql/base123/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]=="0"){

$dat_id[]=$a[$i];
$dat_cena[]=$data[1];
$dat_sila[]=$data[0];
$dat_gr[]="NG";
$dat_name[]=$data[4];}}
}
}
foreach($dat_name as $k=>$v)
{
$gr[]=$dat_gr[$k];
$dat_screen[]="<b><img src=\"pic/shlem/$dat_name[$k].gif\" alt=\"pic\"/><a href=\"pokupka2.php?$sd&vesh=$dat_id[$k]&gorod=$udata[20]\">$dat_name[$k]</a></b><br/>Защита: M+$dat_sila[$k]<br/>Цена: ".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=helmetng">Назад</a>';}
if ($total > $start + 10) {echo '<a href="shops.php?start='.($start + 10).'&'.$sd.'&go=helmetng">Далее</a>';}
break;
case 'helmetd':
$dir = opendir ("MySql/base123/shop");
while ($file = readdir ($dir))
{if (( $file != ".") && ($file != ".."))
{$a[]=$file;}}
closedir ($dir);
$total = count($a);

for ($i = 0; $i < $total; $i++){
$tex = @file("MySql/base123/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]=="D"){

$dat_id[]=$a[$i];
$dat_cena[]=$data[1];
$dat_sila[]=$data[0];
$dat_gr[]="D";
$dat_name[]=$data[4];}}
}
}
foreach($dat_name as $k=>$v)
{
$gr[]=$dat_gr[$k];
$dat_screen[]="<b><img src=\"pic/shlem/$dat_name[$k].gif\" alt=\"pic\"/><a href=\"pokupka2.php?$sd&vesh=$dat_id[$k]&gorod=$udata[20]\">$dat_name[$k]</a></b><br/>Защита: M+$dat_sila[$k]<br/>Цена: ".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=helmetd">Назад</a>';}
if ($total > $start + 10) {echo '<a href="shops.php?start='.($start + 10).'&'.$sd.'&go=helmetd">Далее</a>';}
break;
case 'helmetc':
$dir = opendir ("MySql/base123/shop");
while ($file = readdir ($dir))
{if (( $file != ".") && ($file != ".."))
{$a[]=$file;}}
closedir ($dir);
$total = count($a);

for ($i = 0; $i < $total; $i++){
$tex = @file("MySql/base123/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]=="C"){

$dat_id[]=$a[$i];
$dat_cena[]=$data[1];
$dat_sila[]=$data[0];
$dat_gr[]="C";
$dat_name[]=$data[4];}}
}
}
foreach($dat_name as $k=>$v)
{
$gr[]=$dat_gr[$k];
$dat_screen[]="<b><img src=\"pic/shlem/$dat_name[$k].gif\" alt=\"pic\"/><a href=\"pokupka2.php?$sd&vesh=$dat_id[$k]&gorod=$udata[20]\">$dat_name[$k]</a></b><br/>Защита: M+$dat_sila[$k]<br/>Цена: ".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=helmetc">Назад</a>';}
if ($total > $start + 10) {echo '<a href="shops.php?start='.($start + 10).'&'.$sd.'&go=helmetc">Далее</a>';}
break;
case 'helmetb':
$dir = opendir ("MySql/base123/shop");
while ($file = readdir ($dir))
{if (( $file != ".") && ($file != ".."))
{$a[]=$file;}}
closedir ($dir);
$total = count($a);

for ($i = 0; $i < $total; $i++){
$tex = @file("MySql/base123/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]=="B"){

$dat_id[]=$a[$i];
$dat_cena[]=$data[1];
$dat_sila[]=$data[0];
$dat_gr[]="B";
$dat_name[]=$data[4];}}
}
}
foreach($dat_name as $k=>$v)
{
$gr[]=$dat_gr[$k];
$dat_screen[]="<b><img src=\"pic/shlem/$dat_name[$k].gif\" alt=\"pic\"/><a href=\"pokupka2.php?$sd&vesh=$dat_id[$k]&gorod=$udata[20]\">$dat_name[$k]</a></b><br/>Защита: M+$dat_sila[$k]<br/>Цена: ".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=helmetb">Назад</a>';}
if ($total > $start + 10) {echo '<a href="shops.php?start='.($start + 10).'&'.$sd.'&go=helmetb">Далее</a>';}
break;
case 'helmeta':
$dir = opendir ("MySql/base123/shop");
while ($file = readdir ($dir))
{if (( $file != ".") && ($file != ".."))
{$a[]=$file;}}
closedir ($dir);
$total = count($a);

for ($i = 0; $i < $total; $i++){
$tex = @file("MySql/base123/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]=="A"){

$dat_id[]=$a[$i];
$dat_cena[]=$data[1];
$dat_sila[]=$data[0];
$dat_gr[]="A";
$dat_name[]=$data[4];}}
}
}
foreach($dat_name as $k=>$v)
{
$gr[]=$dat_gr[$k];
$dat_screen[]="<b><img src=\"pic/shlem/$dat_name[$k].gif\" alt=\"pic\"/><a href=\"pokupka2.php?$sd&vesh=$dat_id[$k]&gorod=$udata[20]\">$dat_name[$k]</a></b><br/>Защита: M+$dat_sila[$k]<br/>Цена: ".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=helmeta">Назад</a>';}
if ($total > $start + 10) {echo '<a href="shops.php?start='.($start + 10).'&'.$sd.'&go=helmeta">Далее</a>';}
break;
case 'helmets':
$dir = opendir ("MySql/base123/shop");
while ($file = readdir ($dir))
{if (( $file != ".") && ($file != ".."))
{$a[]=$file;}}
closedir ($dir);
$total = count($a);

for ($i = 0; $i < $total; $i++){
$tex = @file("MySql/base123/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]=="S"){

$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[]="<b><img src=\"pic/shlem/$dat_name[$k].gif\" alt=\"pic\"/><a href=\"pokupka2.php?$sd&vesh=$dat_id[$k]&gorod=$udata[20]\">$dat_name[$k]</a></b><br/>Защита: M+$dat_sila[$k]<br/>Цена: ".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=helmets">Назад</a>';}
if ($total > $start + 10) {echo '<a href="shops.php?start='.($start + 10).'&'.$sd.'&go=helmets">Далее</a>';}
break;
case 'weapon':
echo"<u>Выберите тип оружия</u><br/>";
echo"[<a href=\"shops.php?$sd&go=me4\">Мечи</a>]<br/>";
echo"[<a href=\"shops.php?$sd&go=bow\">Луки</a>]<br/>";
echo"[<a href=\"shops.php?$sd&go=kastet\">Кастеты</a>]<br/>";
break;
case 'me4':
echo"<u>Выберите Graid</u><br/>";
echo"[<a href=\"shops.php?$sd&go=me4ng\">NG</a>] (до 20 ур)<br/>";
echo"[<a href=\"shops.php?$sd&go=me4d\">D</a>] (до 40 ур)<br/>";
echo"[<a href=\"shops.php?$sd&go=me4c\">C</a>] (до 52 ур)<br/>";
echo"[<a href=\"shops.php?$sd&go=me4b\">B</a>] (до 62 ур)<br/>";
echo"[<a href=\"shops.php?$sd&go=me4a\">A</a>] (до 76 ур)<br/>";
echo"[<a href=\"shops.php?$sd&go=me4s\">S</a>] (от 76 ур)<br/>";
break;
case 'me4ng':
$dir = opendir ("MySql/base123/shop");
while ($file = readdir ($dir))
{if (( $file != ".") && ($file != ".."))
{$a[]=$file;}}
closedir ($dir);
$total = count($a);

for ($i = 0; $i < $total; $i++){
$tex = @file("MySql/base123/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]=="0"){

$dat_id[]=$a[$i];
$dat_cena[]=$data[1];
$dat_sila[]=$data[0];
$dat_gr[]="NG";
$dat_name[]=$data[4];}}
}
}
foreach($dat_name as $k=>$v)
{
$gr[]=$dat_gr[$k];
$dat_screen[]="<b><img src=\"pic/weapon/$dat_name[$k].gif\" alt=\"pic\"/><a href=\"pokupka2.php?$sd&vesh=$dat_id[$k]&gorod=$udata[20]\">$dat_name[$k]</a></b><br/>Атака: M+$dat_sila[$k]<br/>Цена: ".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=me4ng">Назад</a>';}
if ($total > $start + 10) {echo '<a href="shops.php?start='.($start + 10).'&'.$sd.'&go=me4ng">Далее</a>';}
break;
case 'me4d':
$dir = opendir ("MySql/base123/shop");
while ($file = readdir ($dir))
{if (( $file != ".") && ($file != ".."))
{$a[]=$file;}}
closedir ($dir);
$total = count($a);

for ($i = 0; $i < $total; $i++){
$tex = @file("MySql/base123/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]=="D"){

$dat_id[]=$a[$i];
$dat_cena[]=$data[1];
$dat_sila[]=$data[0];
$dat_gr[]="D";
$dat_name[]=$data[4];}}
}
}
foreach($dat_name as $k=>$v)
{
$gr[]=$dat_gr[$k];
$dat_screen[]="<b><img src=\"pic/weapon/$dat_name[$k].gif\" alt=\"pic\"/><a href=\"pokupka2.php?$sd&vesh=$dat_id[$k]&gorod=$udata[20]\">$dat_name[$k]</a></b><br/>Атака: M+$dat_sila[$k]<br/>Цена: ".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=me4d">Назад</a>';}
if ($total > $start + 10) {echo '<a href="shops.php?start='.($start + 10).'&'.$sd.'&go=me4d">Далее</a>';}
break;
case 'me4c':
$dir = opendir ("MySql/base123/shop");
while ($file = readdir ($dir))
{if (( $file != ".") && ($file != ".."))
{$a[]=$file;}}
closedir ($dir);
$total = count($a);

for ($i = 0; $i < $total; $i++){
$tex = @file("MySql/base123/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]=="C"){

$dat_id[]=$a[$i];
$dat_cena[]=$data[1];
$dat_sila[]=$data[0];
$dat_gr[]="C";
$dat_name[]=$data[4];}}
}
}
foreach($dat_name as $k=>$v)
{
$gr[]=$dat_gr[$k];
$dat_screen[]="<b><img src=\"pic/weapon/$dat_name[$k].gif\" alt=\"pic\"/><a href=\"pokupka2.php?$sd&vesh=$dat_id[$k]&gorod=$udata[20]\">$dat_name[$k]</a></b><br/>Атака: M+$dat_sila[$k]<br/>Цена: ".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=me4c">Назад</a>';}
if ($total > $start + 10) {echo '<a href="shops.php?start='.($start + 10).'&'.$sd.'&go=me4c">Далее</a>';}
break;
case 'me4b':
$dir = opendir ("MySql/base123/shop");
while ($file = readdir ($dir))
{if (( $file != ".") && ($file != ".."))
{$a[]=$file;}}
closedir ($dir);
$total = count($a);

for ($i = 0; $i < $total; $i++){
$tex = @file("MySql/base123/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]=="B"){

$dat_id[]=$a[$i];
$dat_cena[]=$data[1];
$dat_sila[]=$data[0];
$dat_gr[]="B";
$dat_name[]=$data[4];}}
}
}
foreach($dat_name as $k=>$v)
{
$gr[]=$dat_gr[$k];
$dat_screen[]="<b><img src=\"pic/weapon/$dat_name[$k].gif\" alt=\"pic\"/><a href=\"pokupka2.php?$sd&vesh=$dat_id[$k]&gorod=$udata[20]\">$dat_name[$k]</a></b><br/>Атака: M+$dat_sila[$k]<br/>Цена: ".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=me4b">Назад</a>';}
if ($total > $start + 10) {echo '<a href="shops.php?start='.($start + 10).'&'.$sd.'&go=me4b">Далее</a>';}
break;
case 'me4a':
$dir = opendir ("MySql/base123/shop");
while ($file = readdir ($dir))
{if (( $file != ".") && ($file != ".."))
{$a[]=$file;}}
closedir ($dir);
$total = count($a);

for ($i = 0; $i < $total; $i++){
$tex = @file("MySql/base123/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]=="A"){

$dat_id[]=$a[$i];
$dat_cena[]=$data[1];
$dat_sila[]=$data[0];
$dat_gr[]="A";
$dat_name[]=$data[4];}}
}
}
foreach($dat_name as $k=>$v)
{
$gr[]=$dat_gr[$k];
$dat_screen[]="<b><img src=\"pic/weapon/$dat_name[$k].gif\" alt=\"pic\"/><a href=\"pokupka2.php?$sd&vesh=$dat_id[$k]&gorod=$udata[20]\">$dat_name[$k]</a></b><br/>Атака: M+$dat_sila[$k]<br/>Цена: ".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=me4a">Назад</a>';}
if ($total > $start + 10) {echo '<a href="shops.php?start='.($start + 10).'&'.$sd.'&go=me4a">Далее</a>';}
break;
case 'me4s':
$dir = opendir ("MySql/base123/shop");
while ($file = readdir ($dir))
{if (( $file != ".") && ($file != ".."))
{$a[]=$file;}}
closedir ($dir);
$total = count($a);

for ($i = 0; $i < $total; $i++){
$tex = @file("MySql/base123/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]=="S"){

$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[]="<b><img src=\"pic/weapon/$dat_name[$k].gif\" alt=\"pic\"/><a href=\"pokupka2.php?$sd&vesh=$dat_id[$k]&gorod=$udata[20]\">$dat_name[$k]</a></b><br/>Атака: M+$dat_sila[$k]<br/>Цена: ".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=me4s">Назад</a>';}
if ($total > $start + 10) {echo '<a href="shops.php?start='.($start + 10).'&'.$sd.'&go=me4s">Далее</a>';}
break;
case 'bow':
echo"<u>Выберите Graid</u><br/>";
echo"[<a href=\"shops.php?$sd&go=bowng\">NG</a>] (до 20 ур)<br/>";
echo"[<a href=\"shops.php?$sd&go=bowd\">D</a>] (до 40 ур)<br/>";
echo"[<a href=\"shops.php?$sd&go=bowc\">C</a>] (до 52 ур)<br/>";
echo"[<a href=\"shops.php?$sd&go=bowb\">B</a>] (до 62 ур)<br/>";
echo"[<a href=\"shops.php?$sd&go=bowa\">A</a>] (до 76 ур)<br/>";
echo"[<a href=\"shops.php?$sd&go=bows\">S</a>] (от 76 ур)<br/>";
break;
case 'bowng':
$dir = opendir ("MySql/base123/shop/bow");
while ($file = readdir ($dir))
{if (( $file != ".") && ($file != ".."))
{$a[]=$file;}}
closedir ($dir);
$total = count($a);

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

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

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

$dat_id[]=$a[$i];
$dat_cena[]=$data[1];
$dat_sila[]=$data[0];
$dat_gr[]="NG";
$dat_name[]=$data[4];}}
}
}
foreach($dat_name as $k=>$v)
{
$gr[]=$dat_gr[$k];
$dat_screen[]="<b><img src=\"pic/weapon/$dat_name[$k].gif\" alt=\"pic\"/><a href=\"pokupka3.php?$sd&vesh=$dat_id[$k]&gorod=$udata[20]\">$dat_name[$k]</a></b><br/>Атака: M+$dat_sila[$k]<br/>Цена: ".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=bowng">Назад</a>';}
if ($total > $start + 10) {echo '<a href="shops.php?start='.($start + 10).'&'.$sd.'&go=bowng">Далее</a>';}
break;
case 'bowd':
$dir = opendir ("MySql/base123/shop/bow");
while ($file = readdir ($dir))
{if (( $file != ".") && ($file != ".."))
{$a[]=$file;}}
closedir ($dir);
$total = count($a);

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

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

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

$dat_id[]=$a[$i];
$dat_cena[]=$data[1];
$dat_sila[]=$data[0];
$dat_gr[]="D";
$dat_name[]=$data[4];}}
}
}
foreach($dat_name as $k=>$v)
{
$gr[]=$dat_gr[$k];
$dat_screen[]="<b><img src=\"pic/weapon/$dat_name[$k].gif\" alt=\"pic\"/><a href=\"pokupka3.php?$sd&vesh=$dat_id[$k]&gorod=$udata[20]\">$dat_name[$k]</a></b><br/>Атака: M+$dat_sila[$k]<br/>Цена: ".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=bowd">Назад</a>';}
if ($total > $start + 10) {echo '<a href="shops.php?start='.($start + 10).'&'.$sd.'&go=bowd">Далее</a>';}
break;
case 'bowc':
$dir = opendir ("MySql/base123/shop/bow");
while ($file = readdir ($dir))
{if (( $file != ".") && ($file != ".."))
{$a[]=$file;}}
closedir ($dir);
$total = count($a);

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

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

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

$dat_id[]=$a[$i];
$dat_cena[]=$data[1];
$dat_sila[]=$data[0];
$dat_gr[]="C";
$dat_name[]=$data[4];}}
}
}
foreach($dat_name as $k=>$v)
{
$gr[]=$dat_gr[$k];
$dat_screen[]="<b><img src=\"pic/weapon/$dat_name[$k].gif\" alt=\"pic\"/><a href=\"pokupka3.php?$sd&vesh=$dat_id[$k]&gorod=$udata[20]\">$dat_name[$k]</a></b><br/>Атака: M+$dat_sila[$k]<br/>Цена: ".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=bowc">Назад</a>';}
if ($total > $start + 10) {echo '<a href="shops.php?start='.($start + 10).'&'.$sd.'&go=bowc">Далее</a>';}
break;
case 'bowb':
$dir = opendir ("MySql/base123/shop/bow");
while ($file = readdir ($dir))
{if (( $file != ".") && ($file != ".."))
{$a[]=$file;}}
closedir ($dir);
$total = count($a);

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

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

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

$dat_id[]=$a[$i];
$dat_cena[]=$data[1];
$dat_sila[]=$data[0];
$dat_gr[]="B";
$dat_name[]=$data[4];}}
}
}
foreach($dat_name as $k=>$v)
{
$gr[]=$dat_gr[$k];
$dat_screen[]="<b><img src=\"pic/weapon/$dat_name[$k].gif\" alt=\"pic\"/><a href=\"pokupka3.php?$sd&vesh=$dat_id[$k]&gorod=$udata[20]\">$dat_name[$k]</a></b><br/>Атака: M+$dat_sila[$k]<br/>Цена: ".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=bowb">Назад</a>';}
if ($total > $start + 10) {echo '<a href="shops.php?start='.($start + 10).'&'.$sd.'&go=bowb">Далее</a>';}
break;
case 'bowa':
$dir = opendir ("MySql/base123/shop/bow");
while ($file = readdir ($dir))
{if (( $file != ".") && ($file != ".."))
{$a[]=$file;}}
closedir ($dir);
$total = count($a);

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

$a[$i]=str_replace(".dat","",$a[$i]);
if($data[2]=="weapon"){
if($udata[9]<="85"){if($data[3]=="A"){

$dat_id[]=$a[$i];
$dat_cena[]=$data[1];
$dat_sila[]=$data[0];
$dat_gr[]="A";
$dat_name[]=$data[4];}}
}
}
foreach($dat_name as $k=>$v)
{
$gr[]=$dat_gr[$k];
$dat_screen[]="<b><img src=\"pic/weapon/$dat_name[$k].gif\" alt=\"pic\"/><a href=\"pokupka3.php?$sd&vesh=$dat_id[$k]&gorod=$udata[20]\">$dat_name[$k]</a></b><br/>Атака: M+$dat_sila[$k]<br/>Цена: ".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=bowa">Назад</a>';}
if ($total > $start + 10) {echo '<a href="shops.php?start='.($start + 10).'&'.$sd.'&go=bowa">Далее</a>';}
break;
case 'bows':
$dir = opendir ("MySql/base123/shop/bow");
while ($file = readdir ($dir))
{if (( $file != ".") && ($file != ".."))
{$a[]=$file;}}
closedir ($dir);
$total = count($a);

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

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

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

$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[]="<b><img src=\"pic/weapon/$dat_name[$k].gif\" alt=\"pic\"/><a href=\"pokupka3.php?$sd&vesh=$dat_id[$k]&gorod=$udata[20]\">$dat_name[$k]</a></b><br/>Атака: M+$dat_sila[$k]<br/>Цена: ".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=bows">Назад</a>';}
if ($total > $start + 10) {echo '<a href="shops.php?start='.($start + 10).'&'.$sd.'&go=bows">Далее</a>';}
break;
case 'kastet':
echo"<u>Выберите Graid</u><br/>";
echo"[<a href=\"shops.php?$sd&go=kastetng\">NG</a>] (до 20 ур)<br/>";
echo"[<a href=\"shops.php?$sd&go=kastetd\">D</a>] (до 40 ур)<br/>";
echo"[<a href=\"shops.php?$sd&go=kastetc\">C</a>] (до 52 ур)<br/>";
echo"[<a href=\"shops.php?$sd&go=kastetb\">B</a>] (до 62 ур)<br/>";
echo"[<a href=\"shops.php?$sd&go=kasteta\">A</a>] (до 76 ур)<br/>";
echo"[<a href=\"shops.php?$sd&go=kastets\">S</a>] (от 76 ур)<br/>";
break;
case 'kastetng':
$dir = opendir ("MySql/base123/shop/kastet");
while ($file = readdir ($dir))
{if (( $file != ".") && ($file != ".."))
{$a[]=$file;}}
closedir ($dir);
$total = count($a);

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

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

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

$dat_id[]=$a[$i];
$dat_cena[]=$data[1];
$dat_sila[]=$data[0];
$dat_gr[]="NG";
$dat_name[]=$data[4];}}
}
}
foreach($dat_name as $k=>$v)
{
$gr[]=$dat_gr[$k];
$dat_screen[]="<b><img src=\"pic/weapon/$dat_name[$k].gif\" alt=\"pic\"/><a href=\"pokupka4.php?$sd&vesh=$dat_id[$k]&gorod=$udata[20]\">$dat_name[$k]</a></b><br/>Атака: M+$dat_sila[$k]<br/>Цена: ".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=kastetng">Назад</a>';}
if ($total > $start + 10) {echo '<a href="shops.php?start='.($start + 10).'&'.$sd.'&go=kastetng">Далее</a>';}
break;
case 'kastetd':
$dir = opendir ("MySql/base123/shop/kastet");
while ($file = readdir ($dir))
{if (( $file != ".") && ($file != ".."))
{$a[]=$file;}}
closedir ($dir);
$total = count($a);

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

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

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

$dat_id[]=$a[$i];
$dat_cena[]=$data[1];
$dat_sila[]=$data[0];
$dat_gr[]="D";
$dat_name[]=$data[4];}}
}
}
foreach($dat_name as $k=>$v)
{
$gr[]=$dat_gr[$k];
$dat_screen[]="<b><img src=\"pic/weapon/$dat_name[$k].gif\" alt=\"pic\"/><a href=\"pokupka4.php?$sd&vesh=$dat_id[$k]&gorod=$udata[20]\">$dat_name[$k]</a></b><br/>Атака: M+$dat_sila[$k]<br/>Цена: ".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=kastetd">Назад</a>';}
if ($total > $start + 10) {echo '<a href="shops.php?start='.($start + 10).'&'.$sd.'&go=kastetd">Далее</a>';}
break;
case 'kastetc':
$dir = opendir ("MySql/base123/shop/kastet");
while ($file = readdir ($dir))
{if (( $file != ".") && ($file != ".."))
{$a[]=$file;}}
closedir ($dir);
$total = count($a);

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

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

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

$dat_id[]=$a[$i];
$dat_cena[]=$data[1];
$dat_sila[]=$data[0];
$dat_gr[]="C";
$dat_name[]=$data[4];}}
}
}
foreach($dat_name as $k=>$v)
{
$gr[]=$dat_gr[$k];
$dat_screen[]="<b><img src=\"pic/weapon/$dat_name[$k].gif\" alt=\"pic\"/><a href=\"pokupka4.php?$sd&vesh=$dat_id[$k]&gorod=$udata[20]\">$dat_name[$k]</a></b><br/>Атака: M+$dat_sila[$k]<br/>Цена: ".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=kastetc">Назад</a>';}
if ($total > $start + 10) {echo '<a href="shops.php?start='.($start + 10).'&'.$sd.'&go=kastetc">Далее</a>';}
break;
case 'kastetng':
$dir = opendir ("MySql/base123/shop/kastet");
while ($file = readdir ($dir))
{if (( $file != ".") && ($file != ".."))
{$a[]=$file;}}
closedir ($dir);
$total = count($a);

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

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

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

$dat_id[]=$a[$i];
$dat_cena[]=$data[1];
$dat_sila[]=$data[0];
$dat_gr[]="B";
$dat_name[]=$data[4];}}
}
}
foreach($dat_name as $k=>$v)
{
$gr[]=$dat_gr[$k];
$dat_screen[]="<b><img src=\"pic/weapon/$dat_name[$k].gif\" alt=\"pic\"/><a href=\"pokupka4.php?$sd&vesh=$dat_id[$k]&gorod=$udata[20]\">$dat_name[$k]</a></b><br/>Атака: M+$dat_sila[$k]<br/>Цена: ".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=kastetb">Назад</a>';}
if ($total > $start + 10) {echo '<a href="shops.php?start='.($start + 10).'&'.$sd.'&go=kastetb">Далее</a>';}
break;
case 'kasteta':
$dir = opendir ("MySql/base123/shop/kastet");
while ($file = readdir ($dir))
{if (( $file != ".") && ($file != ".."))
{$a[]=$file;}}
closedir ($dir);
$total = count($a);

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

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

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

$dat_id[]=$a[$i];
$dat_cena[]=$data[1];
$dat_sila[]=$data[0];
$dat_gr[]="A";
$dat_name[]=$data[4];}}
}
}
foreach($dat_name as $k=>$v)
{
$gr[]=$dat_gr[$k];
$dat_screen[]="<b><img src=\"pic/weapon/$dat_name[$k].gif\" alt=\"pic\"/><a href=\"pokupka4.php?$sd&vesh=$dat_id[$k]&gorod=$udata[20]\">$dat_name[$k]</a></b><br/>Атака: M+$dat_sila[$k]<br/>Цена: ".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=kasteta">Назад</a>';}
if ($total > $start + 10) {echo '<a href="shops.php?start='.($start + 10).'&'.$sd.'&go=kasteta">Далее</a>';}
break;
case 'kastets':
$dir = opendir ("MySql/base123/shop/kastet");
while ($file = readdir ($dir))
{if (( $file != ".") && ($file != ".."))
{$a[]=$file;}}
closedir ($dir);
$total = count($a);

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

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

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

$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[]="<b><img src=\"pic/weapon/$dat_name[$k].gif\" alt=\"pic\"/><a href=\"pokupka4.php?$sd&vesh=$dat_id[$k]&gorod=$udata[20]\">$dat_name[$k]</a></b><br/>Атака: M+$dat_sila[$k]<br/>Цена: ".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=kastets">Назад</a>';}
if ($total > $start + 10) {echo '<a href="shops.php?start='.($start + 10).'&'.$sd.'&go=kastets">Далее</a>';}
break;
case 'kastetb':
$dir = opendir ("MySql/base123/shop/kastet");
while ($file = readdir ($dir))
{if (( $file != ".") && ($file != ".."))
{$a[]=$file;}}
closedir ($dir);
$total = count($a);

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

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

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

$dat_id[]=$a[$i];
$dat_cena[]=$data[1];
$dat_sila[]=$data[0];
$dat_gr[]="B";
$dat_name[]=$data[4];}}
}
}
foreach($dat_name as $k=>$v)
{
$gr[]=$dat_gr[$k];
$dat_screen[]="<b><img src=\"pic/weapon/$dat_name[$k].gif\" alt=\"pic\"/><a href=\"pokupka4.php?$sd&vesh=$dat_id[$k]&gorod=$udata[20]\">$dat_name[$k]</a></b><br/>Атака: M+$dat_sila[$k]<br/>Цена: ".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=kastetb">Назад</a>';}
if ($total > $start + 10) {echo '<a href="shops.php?start='.($start + 10).'&'.$sd.'&go=kastetb">Далее</a>';}
break;
case 'prikras':
echo"<u>Выберите Graid</u><br/>";
echo"[<a href=\"shops.php?$sd&go=prikrasng\">NG</a>] (до 20 ур)<br/>";
echo"[<a href=\"shops.php?$sd&go=prikrasd\">D</a>] (до 40 ур)<br/>";
echo"[<a href=\"shops.php?$sd&go=prikrasc\">C</a>] (до 52 ур)<br/>";
echo"[<a href=\"shops.php?$sd&go=prikrasb\">B</a>] (до 62 ур)<br/>";
echo"[<a href=\"shops.php?$sd&go=prikrasa\">A</a>] (до 76 ур)<br/>";
echo"[<a href=\"shops.php?$sd&go=prikrass\">S</a>] (от 76 ур)<br/>";
break;
case 'prikrasng':
$dir = opendir ("MySql/base123/shop");
while ($file = readdir ($dir))
{if (( $file != ".") && ($file != ".."))
{$a[]=$file;}}
closedir ($dir);
$total = count($a);

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

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

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

$dat_id[]=$a[$i];
$dat_cena[]=$data[1];
$dat_sila[]=$data[0];
$dat_gr[]="NG";
$dat_name[]=$data[4];}}
}
}
foreach($dat_name as $k=>$v)
{
$gr[]=$dat_gr[$k];
$dat_screen[]="<b><img src=\"pic/ykr/$dat_name[$k].gif\" alt=\"pic\"/><a href=\"pokupka2.php?$sd&vesh=$dat_id[$k]&gorod=$udata[20]\">$dat_name[$k]</a></b><br/>Защита: M+$dat_sila[$k]<br/>Цена: ".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=prikrasng">Назад</a>';}
if ($total > $start + 10) {echo '<a href="shops.php?start='.($start + 10).'&'.$sd.'&go=prikrasng">Далее</a>';}
break;
case 'prikrasd':
$dir = opendir ("MySql/base123/shop");
while ($file = readdir ($dir))
{if (( $file != ".") && ($file != ".."))
{$a[]=$file;}}
closedir ($dir);
$total = count($a);

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

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

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

$dat_id[]=$a[$i];
$dat_cena[]=$data[1];
$dat_sila[]=$data[0];
$dat_gr[]="D";
$dat_name[]=$data[4];}}
}
}
foreach($dat_name as $k=>$v)
{
$gr[]=$dat_gr[$k];
$dat_screen[]="<b><img src=\"pic/ykr/$dat_name[$k].gif\" alt=\"pic\"/><a href=\"pokupka2.php?$sd&vesh=$dat_id[$k]&gorod=$udata[20]\">$dat_name[$k]</a></b><br/>Защита: M+$dat_sila[$k]<br/>Цена: ".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=prikrasd">Назад</a>';}
if ($total > $start + 10) {echo '<a href="shops.php?start='.($start + 10).'&'.$sd.'&go=prikrasd">Далее</a>';}
break;
case 'prikrasc':
$dir = opendir ("MySql/base123/shop");
while ($file = readdir ($dir))
{if (( $file != ".") && ($file != ".."))
{$a[]=$file;}}
closedir ($dir);
$total = count($a);

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

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

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

$dat_id[]=$a[$i];
$dat_cena[]=$data[1];
$dat_sila[]=$data[0];
$dat_gr[]="C";
$dat_name[]=$data[4];}}
}
}
foreach($dat_name as $k=>$v)
{
$gr[]=$dat_gr[$k];
$dat_screen[]="<b><img src=\"pic/ykr/$dat_name[$k].gif\" alt=\"pic\"/><a href=\"pokupka2.php?$sd&vesh=$dat_id[$k]&gorod=$udata[20]\">$dat_name[$k]</a></b><br/>Защита: M+$dat_sila[$k]<br/>Цена: ".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=prikrasc">Назад</a>';}
if ($total > $start + 10) {echo '<a href="shops.php?start='.($start + 10).'&'.$sd.'&go=prikrasc">Далее</a>';}
break;
case 'prikrasb':
$dir = opendir ("MySql/base123/shop");
while ($file = readdir ($dir))
{if (( $file != ".") && ($file != ".."))
{$a[]=$file;}}
closedir ($dir);
$total = count($a);

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

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

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

$dat_id[]=$a[$i];
$dat_cena[]=$data[1];
$dat_sila[]=$data[0];
$dat_gr[]="B";
$dat_name[]=$data[4];}}
}
}
foreach($dat_name as $k=>$v)
{
$gr[]=$dat_gr[$k];
$dat_screen[]="<b><img src=\"pic/ykr/$dat_name[$k].gif\" alt=\"pic\"/><a href=\"pokupka2.php?$sd&vesh=$dat_id[$k]&gorod=$udata[20]\">$dat_name[$k]</a></b><br/>Защита: M+$dat_sila[$k]<br/>Цена: ".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=prikrasb">Назад</a>';}
if ($total > $start + 10) {echo '<a href="shops.php?start='.($start + 10).'&'.$sd.'&go=prikrasb">Далее</a>';}
break;
case 'prikrasa':
$dir = opendir ("MySql/base123/shop");
while ($file = readdir ($dir))
{if (( $file != ".") && ($file != ".."))
{$a[]=$file;}}
closedir ($dir);
$total = count($a);

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

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

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

$dat_id[]=$a[$i];
$dat_cena[]=$data[1];
$dat_sila[]=$data[0];
$dat_gr[]="A";
$dat_name[]=$data[4];}}
}
}
foreach($dat_name as $k=>$v)
{
$gr[]=$dat_gr[$k];
$dat_screen[]="<b><img src=\"pic/ykr/$dat_name[$k].gif\" alt=\"pic\"/><a href=\"pokupka2.php?$sd&vesh=$dat_id[$k]&gorod=$udata[20]\">$dat_name[$k]</a></b><br/>Защита: M+$dat_sila[$k]<br/>Цена: ".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=prikrasa">Назад</a>';}
if ($total > $start + 10) {echo '<a href="shops.php?start='.($start + 10).'&'.$sd.'&go=prikrasa">Далее</a>';}
break;
case 'prikrass':
$dir = opendir ("MySql/base123/shop");
while ($file = readdir ($dir))
{if (( $file != ".") && ($file != ".."))
{$a[]=$file;}}
closedir ($dir);
$total = count($a);

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

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

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

$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[]="<b><img src=\"pic/ykr/$dat_name[$k].gif\" alt=\"pic\"/><a href=\"pokupka2.php?$sd&vesh=$dat_id[$k]&gorod=$udata[20]\">$dat_name[$k]</a></b><br/>Защита: M+$dat_sila[$k]<br/>Цена: ".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=prikrass">Назад</a>';}
if ($total > $start + 10) {echo '<a href="shops.php?start='.($start + 10).'&'.$sd.'&go=prikrass">Далее</a>';}
break;
}
}else{echo"Пароль или логин неверен!";}
include_once"include/down.php";
?>
