Файл: sclan.php
Строк: 44
<?
include 'mysql.php';
Error_Reporting(E_ALL & ~E_NOTICE);
$_title = 'Linewap2';
include_once("include/sesi.php");
include 'include/header.php';
include 'include/ini.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/up.php";
switch($go) {
default:
if(empty($udata[23])){echo"<small>Вы не в клане!</small>";}else{
echo"<small>Нажмите на ещь чтобы её взять.</small><br/>";
if(@file("MySql/base123/clan/sklad/$udata[23].dat")){
$file = @file("MySql/base123/clan/sklad/$udata[23].dat");
$total = count($file);
if (empty($_GET['start'])) $start = 0;
else $start = $_GET['start'];
if ($total < $start + 5){ $end = $total; }
else {$end = $start + 5; }
for ($i = $start; $i < $end; $i++){
$file = @file("MySql/base123/clan/sklad/$udata[23].dat");
$file = array_reverse($file);
$data = explode(":||:",$file[$i]);
echo"<b><small><a href="sclan.php?$sd&id=$i&name=$data[4]&go=me">$data[4]</a></small></b> <small>- ($data[2]) [+$data[0]]</small><br/>";
}}else{echo"<small>На складе нет вещей.</small>";}
if ($start != 0) {echo '<a href="sclan.php?start='.($start - 5).'&'.$sd.'">Назад</a> ';}
if ($total > $start + 5) {echo ' <a href="sclan.php?start='.($start + 5).'&'.$sd.'">Далее</a>';}
}
break;
case 'me':
$id=$_GET['id'];
$name=$_GET['name'];
$file = @file("MySql/base123/clan/sklad/$udata[23].d ");
$file = array_reverse($file);
$data = explode(":||:",$file[$id]);
if($name!==$data[4]){echo"<small>На складе нет такой вещи!</small>"; include_once"include/down.php"; exit;}
//////////////////////////////////////////
$text=''.$data[0].':||:'.$data[1].':||:'.$data[2].':||:'.$data[3].':||:'.$data[4].':||:';
$fp=fopen("MySql/base123/clan/sklad/$udata[23].dat","w");
flock ($fp,LOCK_EX);
unset($file[$id]);
fputs($fp, implode("",$file));
flock ($fp,LOCK_UN);
fclose($fp);
$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>";
break;
}
}else{echo"<small>Пароль или логин неверен!</small>";}
include_once"include/down.php";
?>