Файл: vesh.php
Строк: 25
<?php
include_once("files/zag.php");
include_once("files/ini.php");
$polz=mysql_query("SELECT * FROM `users` WHERE `udata0`='$log' AND `udata1`='$pas' LIMIT 1");
if(mysql_num_rows($polz)==0){
header ("Location: index.php?error");
echo'<div class="p">Ошибка! Пользователь с таким логином и паролем не зарегистрирован, или пароль/логин неверен! <a href="index.php">На главную</a><br>';exit;
}else{
include_once"files/up.php";
$qi = mysql_query("SELECT * from `quests` where `town`='$udata20' and `mesto`='/vesh.php' ");
$row=mysql_fetch_array($qi);
if (mysql_affected_rows()==1)
{
echo"<br><a href="quests.php?id=$row[id]">Задание</a><br/><br>";}
$arr = mysql_query("SELECT * from `shop` WHERE `shop2`='weapon' and shop4='Удочка' ");
$qi = mysql_query("SELECT * from `shop` WHERE `shop2`='weapon' and `shop4`='Удочка'");
if (mysql_affected_rows()==0)
{
echo "Вешей нет";
}
else
{
while($rows=mysql_fetch_array($qi))
{
$startan = $_GET['startan'];
$rows[shop1]=number_format($rows[shop1]);
if($rows[shop3]=="0"){$rows[shop3]="NG";}
echo" <small><a href="sellshop.php?act=ask&id=$rows[id]">$rows[shop4]</a> [$rows[shop1] аден ]<br/></small>";
}
}
$dir = opendir ("data/vesh");
while ($file = readdir ($dir))
{
if (( $file != ".") && ($file != ".."))
{ $file= str_replace(".dat","",$file);
$file2= "$file";
$text = @file("data/vesh/$file2.dat");
$udat = explode(":||:",$text[0]);
$hp=trim($udat[0]);
$file2=str_replace("HP","Бутылек с восстановлением HP", $file2);
$file2=str_replace("Soulshots","Soulshots", $file2);
$file2=str_replace("MP","Бутылек с восстановлением MP", $file2);
echo "<small><a href="byvesh.php?&vesh=$file&gorod=$gorod&tip=vesh">$udat[4]</a> [$udat[1] аден]</small><br/>";
}
}
closedir ($dir);
}
include_once"files/down.php";
?>