Вход Регистрация
Файл: sell.php
Строк: 144
<?
Error_Reporting
(0);
include_once(
"inclydings/antixak.php");
include_once(
"inclydings/ini.php");
include_once(
"inclydings/zag.php");
include_once(
"inclydings/sesi.php");

$id=$_GET['id'];
$vesh=$_GET['vesh'];
$num=$_GET['num'];
$tip=$_GET['tip'];
$tip htmlspecialchars(stripslashes($tip));
$num htmlspecialchars(stripslashes($num));
$vesh htmlspecialchars(stripslashes($vesh));
$log htmlspecialchars(stripslashes($log));
$pas htmlspecialchars(stripslashes($pas));
/////////////////////////////////////////////////////
$text = @file("L2dbnam/esql2db/reg/$log.dat");
if (
$text!=""){
$udata explode(":||:",$text[0]);
$login=trim($udata[0]);
$password=trim($udata[1]);}
////////////////////////////////////////////////////////
include_once("inclydings/sesi.php");
if (isset(
$user)) {

$text = @file("L2dbnam/esql2db/reg/$log.dat");
$uda explode(":||:",$text[0]);


$file = @file("L2dbnam/esql2db/item/$log.dat");
$total count($file);

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

$cena=$data[1]/2;

if(
$vesh!==$data[4]){echo"У вас нет этой вещи!";
echo
"<br/> <a href="listsell.php?$sd">назад</a>";
echo 
"</p>";
include_once(
"inclydings/down.php");
exit; }

///////////////////////////////////////////////////////////////////////////////////////////

if($tip=="vesh"){

echo 
"Склько?:<br/>";
echo 
"<form method="post" action="sellvesh.php?$sd&id=$id&vesh=$vesh&num=$cena">";
echo 
"<input name="kol" maxlength="10" title="*N" emptyok="true"/><br/>";
echo 
"<input class="button" type="submit" value="Продать">";
echo 
"<postfield name="kol" value="$(kol)"/>";
echo 
"</form>";

echo 
"</p>";
include_once(
"inclydings/down.php");
exit;
}

if(
$tip=="vesh2"){

echo 
"Склько?:<br/>";
echo 
"<form method="post" action="sellvesh2.php?$sd&id=$id&vesh=$vesh&num=$cena">";
echo 
"<input name="kol" maxlength="10" title="*N" emptyok="true"/><br/>";
echo 
"<input class="button" type="submit" value="Продать">";
echo 
"<postfield name="kol" value="$(kol)"/>";
echo 
"</form>";

echo 
"</p>";
include_once(
"inclydings/down.php");
exit;
}


if(
$tip!=="vesh"){
if(
$uda[10]=="$vesh"){echo' Одетый шмот продавать нельзя.<br/>';include_once"inclydings/down.php"; exit;}
if(
$uda[11]=="$vesh"){echo' Одетый шмот продавать нельзя.<br/>';include_once"inclydings/down.php"; exit;}
if(
$uda[12]=="$vesh"){echo' Одетый шмот продавать нельзя.<br/>';include_once"inclydings/down.php"; exit;}
if(
$uda[13]=="$vesh"){echo' Одетый шмот продавать нельзя.<br/>';include_once"inclydings/down.php"; exit;}
if(
$uda[52]=="$vesh"){echo' Одетый шмот продавать нельзя.<br/>';include_once"inclydings/down.php"; exit;}
if(
$uda[53]=="$vesh"){echo' Одетый шмот продавать нельзя.<br/>';include_once"inclydings/down.php"; exit;}
if(
$uda[54]=="$vesh"){echo' Одетый шмот продавать нельзя.<br/>';include_once"inclydings/down.php"; exit;}
if(
$uda[48]=="$vesh"){echo' Одетый шмот продавать нельзя.<br/>';include_once"inclydings/down.php"; exit;}
if(
$uda[49]=="$vesh"){echo' Одетый шмот продавать нельзя.<br/>';include_once"inclydings/down.php"; exit;}
if(
$uda[45]=="$vesh"){echo' Одетый шмот продавать нельзя.<br/>';include_once"inclydings/down.php"; exit;}
if(
$uda[46]=="$vesh"){echo' Одетый шмот продавать нельзя.<br/>';include_once"inclydings/down.php"; exit;}
$total2=$total-1;

if(
$id=="0"){$id=$total-1;}else{$id=$total-$id-1;}

$file=file("L2dbnam/esql2db/item/$log.dat");

$fp=fopen("L2dbnam/esql2db/item/$log.dat","w");
flock ($fp,LOCK_EX);
for (
$i=0;$isizeof($file);$i++) { if ($i==$id) {unset($file[$i]);} }
fputs($fpimplode("",$file));
flock ($fp,LOCK_UN);
fclose($fp);

$text2 = @file("L2dbnam/esql2db/reg/$log.dat");
$udat explode(":||:",$text2[0]);
$aden=trim($udat[8]);
$aden=$aden+$cena;
$text=$udat[0].':||:'.$udat[1].':||:'.$udat[2].':||:'.$udat[3].':||:'.$udat[4].':||:'.$udat[5].':||:'.$udat[6].':||:'.$udat[7].':||:'.$aden.':||:'.$udat[9].':||:'.$udat[10].':||:'.$udat[11].':||:'.$udat[12].':||:'.$udat[13].':||:'.$udat[14].':||:'.$udat[15].':||:'.$udat[16].':||:'.$udat[17].':||:'.$udat[18].':||:'.$udat[19].':||:'.$udat[20].':||:'.$udat[21].':||:'.$udat[22].':||:'.$udat[23].':||:'.$udat[24].':||:'.$udat[25].':||:'.$udat[26].':||:'.$udat[27].':||:'.$udat[28].':||:'.$udat[29].':||:'.$udat[30].':||:'.$udat[31].':||:'.$udat[32].':||:'.$udat[33].':||:'.$udat[34].':||:'.$udat[35].':||:'.$udat[36].':||:'.$udat[37].':||:'.$udat[38].':||:'.$udat[39].':||:'.$udat[40].':||:'.$udat[41].':||:'.$udat[42].':||:'.$udat[43].':||:'.$udat[44].':||:'.$udat[45].':||:'.$udat[46].':||:'.$udat[47].':||:'.$udat[48].':||:'.$udat[49].':||:'.$udat[50].':||:'.$udat[51].':||:'.$udat[52].':||:'.$udat[53].':||:'.$udat[54].':||:'.$udat[55].':||:'.$udat[56].':||:'.$udat[57].':||:'.$udat[58].':||:'.$udat[59].':||:'.$udat[60].':||:'.$udat[61].':||:'.$udat[62].':||:'.$udat[63].':||:'.$udat[64].':||:'.$udat[65].':||:'.$udat[66].':||:'.$udat[67].':||:'.$udat[68].':||:'.$udat[69].':||:'.$udat[70].':||:'.$udat[71].':||:'.$udat[72].':||:'.$udat[73].':||:'.$udat[74].':||:'.$udat[75].':||:'.$udat[76].':||:'.$udat[77].':||:'.$udat[78].':||:'.$udat[79].':||:'.$udat[80].':||:'.$udat[81].':||:'.$udat[82].':||:'.$udat[83].':||:'.$udat[84].':||:'.$udat[85].':||:'.$udat[86].':||:'.$udat[87].':||:'.$udat[88].':||:'.$udat[89].':||:'.$udat[90].':||:'.$udat[91].':||:'.$udat[92].':||:'.$udat[93].':||:'.$udat[94].':||:'.$udat[95].':||:'.$udat[96].':||:'.$udat[97].':||:'.$udat[98].':||:'.$udat[99].':||:'.$udat[100].':||:';

$fp=fopen("L2dbnam/esql2db/reg/$log.dat","a+");
flock($fp,LOCK_EX);
ftruncate($fp,0);
fputs($fp,"$textrn");
fflush($fp);
flock($fp,LOCK_UN);
fclose($fp);
///////////////////////////////////////////////////////////////////////////////////////////////
echo'Продано за '.number_format($cena).' аден.';
echo
"<br/> <a href="listsell.php?$sd">назад</a>";

}


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

echo 
"</p>";
include_once(
"inclydings/down.php");
?>
Онлайн: 0
Реклама