<?
include 'mysql.php';
include 'include/sesi.php';
Error_Reporting(E_ALL & ~E_NOTICE);
$ref=rand(10,100);

include_once("include/antixak.php");
$_title = 'Linewap2';
include 'include/header.php';
include 'include/ini.php';
$log = htmlspecialchars(stripslashes($log));
$pas = htmlspecialchars(stripslashes($pas));
$name = htmlspecialchars(stripslashes($name));
/////////////////////////////////////////////////////
$text = @file("MySql/base123/reg/$log.dat");
if ($text!=""){
$udata = explode(":||:",$text[0]);
$login=trim($udata[0]);
$password=trim($udata[1]);}
////////////////////////////////////////////////////////
include_once("include/sesi.php");
if (isset($user)) {
include_once"include/up.php";

switch($go) {

default:
if($udata[9]<"25"){
echo"<small>Статусы можно присваивать с 25 lvl.</small>";
include_once"include/down.php"; exit;}
echo "<form action=\"mystatus.php?$sd&go=savestatus\" method=\"post\">";
echo "<small>подстатус:</small><br/>";
echo "<input name=\"statusus\" maxlength=\"150\"/><br/>";
echo '<input type="submit" value="Изменить"/></form>';
break;
case 'savestatus':
if(!@file("MySql/base123/reg/$log.dat")){echo"<small>Такого игрока нет.</small>"; include_once"include/down.php"; exit; }

if(@file("MySql/base123/reg/$log.dat")){

$text = @file("MySql/base123/reg/$log.dat");
$data = explode(":||:",$text[0]);
$nick=$_POST['log'];
$statusus=$_POST['statusus'];
$text=$log.':||:'.$statusus.':||:';
$fp=fopen("MySql/base123/mystatus/$log.dat","w");
flock($fp,LOCK_EX);
ftruncate($fp,0);
fputs($fp,"$text");
fflush($fp);
flock($fp,LOCK_UN);
fclose($fp);
echo"<small>Вы успешно присвоили себе $log статус:<br/> $statusus</small>"; include_once"include/down.php"; exit; }
echo'Вы можете присвоить статус только себе.<br/>';include_once"include/down.php"; exit;
break;

}

}else{echo"<small>Пароль или логин неверен!</small>";}

include_once"include/down.php";
?>
