Просмотр файла darkworld/sellrukshmot.php

Размер файла: 5.13Kb
<?
Error_Reporting(E_ALL & ~E_NOTICE);
include_once("files/antixak.php");
header("Content-type:text/vnd.wap.wml");
echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>";
echo "<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.2//EN\" \"http://www.wapforum.org/DTD/wml12.dtd\">";
echo "<wml>\n";
echo "<head><meta http-equiv=\"Cache-Control\" content=\"no-cache\" forua=\"true\"/></head>";
echo "<card id=\"index\" title=\"&#x41F;&#x435;&#x440;&#x441;&#x43E;&#x43D;&#x430;&#x436;\">";
echo "<p align=\"left\">";

$log = htmlspecialchars(stripslashes($log));
$pas = htmlspecialchars(stripslashes($pas));
/////////////////////////////////////////////////////
$text = @file("data/reg/$log.dat"); 
if ($text!=""){
$udata = explode(":||:",$text[0]);
$login=trim($udata[0]);
$password=trim($udata[1]);}
////////////////////////////////////////////////////////
if (md5($pas)==$password && $log==$login && $log!=="" && md5($pas)!=="") {


switch($go) {

default:

echo "<small>Цена:</small><br/>";
echo "<input name=\"cena\" maxlength=\"10\" title=\"*N\" emptyok=\"true\"/><br/>";
echo "<small><anchor title=\"go\">Продать!<go href=\"sellrukshmot.php?log=$log&amp;pas=$pas&amp;go=go&amp;name=$name&amp;id=$id\" method=\"post\">";
echo "<postfield name=\"cena\" value=\"$(cena)\"/>";
echo "</go></anchor></small><br/>";

break;

case 'go':

$id = htmlspecialchars(stripslashes($id));
$cena = htmlspecialchars(stripslashes($cena));
$text = htmlspecialchars(stripslashes($_POST[text]));

if(eregi("[^0-9]",$cena)){echo"<small>&#x412;&#x432;&#x43E;&#x434;&#x438;&#x442;&#x435; &#x447;&#x438;&#x441;&#x43B;&#x43E;, &#x430; &#x43D;&#x435; &#x431;&#x443;&#x43A;&#x432;&#x44B;!</small>"; include_once"files/down.php"; exit;}


$file = @file("data/item/$log.dat");
$file = array_reverse($file);
$data = explode(":||:",$file[$id]);

if(empty($cena)){echo"<small>Вы не ввели цену товара.</small>"; include_once"files/down.php"; exit;}

if($udata[10]==$name){ echo"<small>&#x421;&#x43D;&#x430;&#x447;&#x430;&#x43B;&#x43E; &#x441;&#x43D;&#x438;&#x43C;&#x438;&#x442;&#x435; &#x432;&#x435;&#x449;&#x44C;, &#x43F;&#x43E;&#x442;&#x43E;&#x43C; &#x43F;&#x440;&#x43E;&#x434;&#x430;&#x432;&#x430;&#x439;&#x442;&#x435;.</small>"; include_once"files/down.php"; exit;}
if($udata[11]==$name){ echo"<small>&#x421;&#x43D;&#x430;&#x447;&#x430;&#x43B;&#x43E; &#x441;&#x43D;&#x438;&#x43C;&#x438;&#x442;&#x435; &#x432;&#x435;&#x449;&#x44C;, &#x43F;&#x43E;&#x442;&#x43E;&#x43C; &#x43F;&#x440;&#x43E;&#x434;&#x430;&#x432;&#x430;&#x439;&#x442;&#x435;.</small>"; include_once"files/down.php"; exit;}
if($udata[12]==$name){ echo"<small>&#x421;&#x43D;&#x430;&#x447;&#x430;&#x43B;&#x43E; &#x441;&#x43D;&#x438;&#x43C;&#x438;&#x442;&#x435; &#x432;&#x435;&#x449;&#x44C;, &#x43F;&#x43E;&#x442;&#x43E;&#x43C; &#x43F;&#x440;&#x43E;&#x434;&#x430;&#x432;&#x430;&#x439;&#x442;&#x435;.</small>"; include_once"files/down.php"; exit;}
if($udata[13]==$name){ echo"<small>&#x421;&#x43D;&#x430;&#x447;&#x430;&#x43B;&#x43E; &#x441;&#x43D;&#x438;&#x43C;&#x438;&#x442;&#x435; &#x432;&#x435;&#x449;&#x44C;, &#x43F;&#x43E;&#x442;&#x43E;&#x43C; &#x43F;&#x440;&#x43E;&#x434;&#x430;&#x432;&#x430;&#x439;&#x442;&#x435;.</small>"; include_once"files/down.php"; exit;}

if($name!==$data[4]){echo"<small>У вас нет такой вещи!</small>"; include_once"files/down.php"; exit; }
if($data[4]=="Dragon Leather Armor Hight" || $data[4]=="Dragon Leather Armor Hight*1" || $data[4]=="Dragon Leather Armor Hight*2" || $data[4]=="Dragon Leather Armor Hight*3" || $data[4]=="Dragon Leather Armor Hight*4" || $data[4]=="Dragon Leather Armor Hight*5" || $data[4]=="Talum Blade*Dark Legion's Edge" || $data[4]=="Talum Blade*Dark Legion's Edge*1" || $data[4]=="Talum Blade*Dark Legion's Edge*2" || $data[4]=="Talum Blade*Dark Legion's Edge*3" || $data[4]=="Talum Blade*Dark Legion's Edge*4" || $data[4]=="Talum Blade*Dark Legion's Edge*5" || $data[4]=="Sealed Apella Brigadine" || $data[4]=="Sealed Apella Brigadine*1" || $data[4]=="Sealed Apella Brigadine*2" || $data[4]=="Sealed Apella Brigadine*3" || $data[4]=="Sealed Apella Brigadine*4" || $data[4]=="Sealed Apella Brigadine*5"){
echo"<small>Нельзя продавать вещи из люксор магазина!</small>";
include_once"files/down.php";
exit;
}


$text="$data[0]||$data[1]||$data[2]||1||$data[4]||$cena||$text||";

$fp=fopen("data/sellruk/$log.dat","w");  
flock($fp,LOCK_EX);                                                     
fputs($fp,"$text");
fflush($fp);
flock($fp,LOCK_UN);
fclose($fp); 

$file=file("data/item/$log.dat"); 
$file = array_reverse($file);
$fp=fopen("data/item/$log.dat","w");
flock ($fp,LOCK_EX);
for ($i=0;$i< sizeof($file);$i++) { if ($i==$id) {unset($file[$i]);} }
fputs($fp, implode("",$file));
flock ($fp,LOCK_UN);
fclose($fp);


echo"<small>Вещь выставленна на продажу.<br/><a href=\"sellruktime.php?log=$log&amp;pas=$pas\">Продолжить</a></small>";

break;

}
}else{echo"<small>&#x41F;&#x430;&#x440;&#x43E;&#x43B;&#x44C; &#x438;&#x43B;&#x438; &#x43B;&#x43E;&#x433;&#x438;&#x43D; &#x43D;&#x435;&#x432;&#x435;&#x440;&#x435;&#x43D;!</small>";}

include_once"files/down.php";
?>