Вход Регистрация
Файл: byruk.php
Строк: 149
<?
include_once("mysql.php");
include_once(
"include/sesi.php");
Error_Reporting(E_ALL & ~E_NOTICE);
include_once(
"include/antixak.php");
$_title 'Linewap2';
include 
'include/header.php';
$log htmlspecialchars(stripslashes($log));
$pas htmlspecialchars(stripslashes($pas));
/////////////////////////////////////////////////////
$text = @file("MySql/base123/reg/$log.dat");
if (
$text!=""){
$udata explode(":||:",$text[0]);
$login=trim($udata[0]);
$password=trim($udata[1]);}
////////////////////////////////////////////////////////

if (isset($user)) {
include_once(
"include/udata.php");
switch(
$go) {

default:

if(!@
file("MySql/base123/sellruk/$seller.dat")){echo"<small>Такого продовца несуществует!</small>"; include_once"include/down.php"; exit; }

$file = @file("MySql/base123/sellruk/$seller.dat");
$data explode("||",$file[0]);
if(
$data[2]=="ykr"){
echo 
"<form action="byruk.php?$sd&go=by&seller=$seller" method="post"><small>Покупка:</small><br/>";
echo
"<small>$data[4] за $data[5] аден</small><br/>";
echo
"<small>Информация:<br/>
Защита: 
$data[0]<br/>
Graid: <small>"
; if($data[3]=="0"){echo"<small>NG</small><br/>";}else{echo"<small>$data[3]</small><br/>";}
if(
$data[2]=="ykr"){echo"<small>Тип: Украшения</small><br/>";}
echo 
'<input type="submit" value="Купить"></form>';
include
'include/down.php';
exit;}
if(
$data[2]=="ring"){
echo 
"<form action="byruk.php?$sd&go=by&seller=$seller" method="post"><small>Покупка:</small><br/>";
echo
"<small>$data[4] за $data[5] аден</small><br/>";
echo
"<small>Информация:<br/>
Защита: 
$data[0]<br/>
Graid: <small>"
; if($data[3]=="0"){echo"<small>NG</small><br/>";}else{echo"<small>$data[3]</small><br/>";}
if(
$data[2]=="ring"){echo"<small>Тип: Кольцо</small><br/>";}
echo 
'<input type="submit" value="Купить"></form>';
include
'include/down.php';
exit;}

if(
$data[2]=="ring1"){
echo 
"<form action="byruk.php?$sd&go=by&seller=$seller" method="post"><small>Покупка:</small><br/>";
echo
"<small>$data[4] за $data[5] аден</small><br/>";
echo
"<small>Информация:<br/>
Защита: 
$data[0]<br/>
Graid: <small>"
; if($data[3]=="0"){echo"<small>NG</small><br/>";}else{echo"<small>$data[3]</small><br/>";}
if(
$data[2]=="ring1"){echo"<small>Тип: Кольцо</small><br/>";}
echo 
'<input type="submit" value="Купить"></form>';
include
'include/down.php';
exit;}

if(
$data[2]=="body"){
echo 
"<form action="byruk.php?$sd&go=by&seller=$seller" method="post"><small>Покупка:</small><br/>";
echo
"<small>$data[4] за $data[5] аден</small><br/>";
echo
"<small>Информация:<br/>
Защита: 
$data[0]<br/>
Graid: <small>"
; if($data[3]=="0"){echo"<small>NG</small><br/>";}else{echo"<small>$data[3]</small><br/>";}
if(
$data[2]=="body"){echo"<small>Тип: Доспехи</small><br/>";}
echo 
'<input type="submit" value="Купить"></form>';
include
'include/down.php';
exit;}
if(
$data[2]=="4it"){
echo 
"<form action="byruk.php?$sd&go=by&seller=$seller" method="post"><small>Покупка:</small><br/>";
echo
"<small>$data[4] за $data[5]</small><br/>";
echo
"<small>Информация:<br/>
Защита: 
$data[0]<br/>
Graid: <small>"
; if($data[3]=="0"){echo"<small>NG</small><br/>";}else{echo"<small>$data[3]</small><br/>";}
if(
$data[2]=="4it"){echo"<small>Тип: Щит</small><br/>";}
echo 
'<input type="submit" value="Купить"></form>';
include
'include/down.php';
exit;}
if(
$data[2]=="nogi"){
echo 
"<form action="byruk.php?$sd&go=by&seller=$seller" method="post"><small>Покупка:</small><br/>";
echo
"<small>$data[4] за $data[5] аден</small><br/>";
echo
"<small>Информация:<br/>
Защита: 
$data[0]<br/>
Graid: <small>"
; if($data[3]=="0"){echo"<small>NG</small><br/>";}else{echo"<small>$data[3]</small><br/>";}
if(
$data[2]=="nogi"){echo"<small>Тип: Сапоги</small><br/>";}
echo 
'<input type="submit" value="Купить"></form>';
include
'include/down.php';
exit;}
if(
$data[2]=="golova"){
echo 
"<form action="byruk.php?$sd&go=by&seller=$seller" method="post"><small>Покупка:</small><br/>";
echo
"<small>$data[4] за $data[5] аден</small><br/>";
echo
"<small>Информация:<br/>
Защита: 
$data[0]<br/>
Graid: <small>"
; if($data[3]=="0"){echo"<small>NG</small><br/>";}else{echo"<small>$data[3]</small><br/>";}
if(
$data[2]=="golova"){echo"<small>Тип: Шлем</small><br/>";}
echo 
'<input type="submit" value="Купить"></form>';
include
'include/down.php';
exit;}
if(
$data[2]=="weapon"){
echo 
"<form action="byruk.php?$sd&go=by&seller=$seller" method="post"><small>Покупка:</small><br/>";
echo
"<small>$data[4] за $data[5] аден</small><br/>";
echo
"<small>Информация:<br/>
Атака: 
$data[0]<br/>
Graid: <small>"
; if($data[3]=="0"){echo"<small>NG</small><br/>";}else{echo"<small>$data[3]</small><br/>";}
if(
$data[2]=="weapon"){echo"<small>Тип: Оружие</small><br/>";}
echo 
'<input type="submit" value="Купить"></form>';
include
'include/down.php';
exit;}
if(
$data[2]=="ryki"){
echo 
"<form action="byruk.php?$sd&go=by&seller=$seller" method="post"><small>Покупка:</small><br/>";
echo
"<small>$data[4] за $data[5]</small><br/>";
echo
"<small>Информация:<br/>
Защита: 
$data[0]<br/>
Graid: <small>"
; if($data[3]=="0"){echo"<small>NG</small><br/>";}else{echo"<small>$data[3]</small>";}
if(
$data[2]=="ryki"){echo"<small>Тип: Перчатки</small><br/>";}
echo 
'<input type="submit" value="Купить"></form>';
include
'include/down.php';
exit;}
echo
"<small>$data[4] за $data[5] вcего $data[3]</small><br/><br/>";

echo 
"<form action="byruk.php?$sd&go=go&seller=$seller" method="post"><small>Сколько?:</small><br/>";
echo 
"<input name="kol" maxlength="50" title="*N" emptyok="true"/><br/>";
echo 
'<input type="submit" value="Купить"></form>';

break;

case 
'go':
$kol htmlspecialchars(stripslashes($kol));
$seller htmlspecialchars(stripslashes($seller));

if(empty(
$kol)){echo"<small>Вы не ввели колличетво покупаемого товара!</small>";  include_once"include/down.php"; exit;}



if(
eregi("[^0-9]",$kol)){echo"<small>Вводите число, а не буквы!</small>"; include_once"include/down.php"; exit;}
$file = @file("MySql/base123/sellruk/$seller.dat");
$data explode("||",$file[0]);

if(
$kol>$data[3]){echo"<small>У продавца нет столько вещей!</small>"; include_once"include/down.php"; exit; }
$cena=$kol*$data[5];

if(
$udata[8]<$cena){echo"<small>У вас не хватает денег!</small>"; include_once"include/down.php"; exit; }




$text = @file("MySql/base123/reg/$seller.dat");
$udata explode(":||:",$text[0]);

$udata[8]=$udata[8]+$cena;

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

$udata[8]=$udata[8]-$cena;

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


$fp=fopen("MySql/base123/reg/$log.dat","a+");
flock ($fp,LOCK_EX);
ftruncate ($fp,0);
fputs($fp,"$textus");
fflush ($fp);
flock ($fp,LOCK_UN);
fclose($fp);


$file=@file("MySql/base123/item/$log.dat");
$total=count($file);

$text = @file("MySql/base123/sellruk/$seller.dat");
$data explode("||",$text[0]);

for(
$i=0$i<$total$i++){
$item explode(":||:",$file[$i]);

if(
$data[4]==$item[4]){

$fp=fopen("MySql/base123/item/$log.dat","w");
flock ($fp,LOCK_EX);
unset(
$file[$i]);
fputs($fpimplode("",$file));
flock ($fp,LOCK_UN);
fclose($fp);

$all=$item[3]+$kol;

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

$fp=fopen("MySql/base123/item/$log.dat","a+");
flock($fp,LOCK_EX);
fputs($fp,"$textrn");
fflush($fp);
flock($fp,LOCK_UN);
fclose($fp);

echo
"<small>Куплено.</small>";

$ost=$data[3]-$kol;

if(
$ost=="0"){

unlink ("MySql/base123/sellruk/$seller.dat");

}else{

$text="$data[0]||$data[1]||$data[2]||$ost||$data[4]||$data[5]||$data[6]||";

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

}

include_once
"include/down.php";



exit;
}
}


$file=@file("MySql/base123/item/$log.dat");
$total=count($file);

$text = @file("MySql/base123/sellruk/$seller.dat");
$data explode("||",$text[0]);

for(
$i=0$i<$total$i++){
$item explode(":||:",$file[$i]);

if(
$data[4]!==$item[4]){


$all=$kol;

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

$fp=fopen("MySql/base123/item/$log.dat","a+");
flock($fp,LOCK_EX);
fputs($fp,"$textrn");
fflush($fp);
flock($fp,LOCK_UN);
fclose($fp);

echo
"<small>Куплено.</small>";

$ost=$data[3]-$kol;

if(
$ost=="0"){

unlink ("MySql/base123/sellruk/$seller.dat");

}else{

$text="$data[0]||$data[1]||$data[2]||$ost||$data[4]||$data[5]||$data[6]||";

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

}

include_once
"include/down.php";


exit;
}
}

break;
case 
'by':
$file = @file("MySql/base123/sellruk/$seller.dat");
$data explode("||",$file[0]);

$cena=$data[5];
if(
$udata[8]<$cena){echo"<small>У вас не хватает денег!</small>"; include_once"include/down.php"; exit; }




$text = @file("MySql/base123/reg/$seller.dat");
$udata explode(":||:",$text[0]);

$udata[8]=$udata[8]+$cena;

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


$fp=fopen("MySql/base123/reg/$seller.dat","a+");
flock ($fp,LOCK_EX);
ftruncate ($fp,0);
fputs($fp,"$textus");
fflush ($fp);
flock ($fp,LOCK_UN);
fclose($fp);

$text = @file("MySql/base123/reg/$log.dat");
$udata explode(":||:",$text[0]);

$udata[8]=$udata[8]-$cena;

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


$fp=fopen("MySql/base123/reg/$log.dat","a+");
flock ($fp,LOCK_EX);
ftruncate ($fp,0);
fputs($fp,"$textus");
fflush ($fp);
flock ($fp,LOCK_UN);
fclose($fp);
$file=@file("MySql/base123/item/$log.dat");
$total=count($file);

$text = @file("MySql/base123/sellruk/$seller.dat");
$data explode("||",$text[0]);

for(
$i=0$i<$total$i++){
$item explode(":||:",$file[$i]);

if(
$data[4]==$item[4]){

$fp=fopen("MySql/base123/item/$log.dat","w");
flock ($fp,LOCK_EX);
unset(
$file[$i]);
fputs($fpimplode("",$file));
flock ($fp,LOCK_UN);
fclose($fp);}

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

$fp=fopen("MySql/base123/item/$log.dat","a+");
flock($fp,LOCK_EX);
fputs($fp,"$textrn");
fflush($fp);
flock($fp,LOCK_UN);
fclose($fp);
unlink ("MySql/base123/sellruk/$seller.dat");
echo
"<small>Куплено.</small>";
break;
}}
}else{echo
"<small>Пароль или логин неверен!</small>";}

include_once
"include/down.php";
?>
Онлайн: 2
Реклама