<?
header("Cache-Control: no-cache");
header("Content-type:text/vnd.wap.wml");
$ref=rand(10000,1000000);
require("inc.php");
$link = @mysql_pconnect ($MySQL_Hostname, $MySQL_Username, $MySQL_Password)
or die ("<wml>
<card id=\"error\" title=\"error\">
<do type=\"prev\" label=\"Back\"><prev/></do><p align=\"center\">Can not connect to MySQL</p>
</card>
</wml>");
@mysql_select_db($MySQLDatabasename) or die ("<wml>
<card id=\"error\" title=\"error\">
<do type=\"prev\" label=\"Back\"><prev/></do><p align=\"center\">error select the database...</p>
</card>
</wml>");
$result = @mysql_query ("Select * from mafusers where id='".$id."'");
if (mysql_affected_rows() == 0) {
echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n";
echo "<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.2//EN\" \"http://www.wapforum.org/DTD/wml12.dtd\">\n";
echo "<wml>\n";
echo "<card id=\"error\" title=\"Ошибка\" ontimer=\"index.php?ref=$ref\"><timer value=\"15\"/>\n";
echo "<p align=\"center\">\n";
echo "User was not found\n";
echo "</p>\n";
echo "</card>\n";
echo "</wml>\n";
mysql_close($link);
exit;
}
$row = mysql_fetch_array ($result);
if ($ps !== $row["pass"]){
echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n";
echo "<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.2//EN\" \"http://www.wapforum.org/DTD/wml12.dtd\">\n";
echo "<wml>\n";
echo "<card id=\"error\" title=\"Ошибка\" ontimer=\"index.php?ref=$ref\"><timer value=\"15\"/>\n";
echo "<p align=\"center\">\n";
echo "Your login failed\n";
echo "</p>\n";
echo "</card>\n";
echo "</wml>\n";
mysql_close($link);
exit;
}
if($row["level"] < 5)
{
echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n";
echo "<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.2//EN\" \"http://www.wapforum.org/DTD/wml12.dtd\">\n";
echo "<wml>\n";
echo "<card id=\"error\" title=\"error\">\n";
echo "<p align=\"center\">\n";
echo "У вас нет прав доступа!\n";
echo "</p>\n";
echo "</card>\n";
echo "</wml>\n";
mysql_close ($link);
exit;
}
$us=$row["user"];
if(isset($nk)){
$select = @mysql_query ("Select * from mafusers where id='".$nk."'");
} else {
function rus_to_k($str){
$str = str_replace("Р°","a",$str);
$str = str_replace("Р±","b",$str);
$str = str_replace("РІ","v",$str);
$str = str_replace("Рі","g",$str);
$str = str_replace("Рґ","d",$str);
$str = str_replace("Рµ","e",$str);
$str = str_replace("С‘","e",$str);
$str = str_replace("Р¶","j",$str);
$str = str_replace("Р·","z",$str);
$str = str_replace("Рё","i",$str);
$str = str_replace("Р№","y",$str);
$str = str_replace("Рє","k",$str);
$str = str_replace("Р»","l",$str);
$str = str_replace("Рј","m",$str);
$str = str_replace("РЅ","n",$str);
$str = str_replace("Рѕ","o",$str);
$str = str_replace("Рї","p",$str);
$str = str_replace("СЂ","r",$str);
$str = str_replace("СЃ","s",$str);
$str = str_replace("С‚","t",$str);
$str = str_replace("Сѓ","u",$str);
$str = str_replace("С„","f",$str);
$str = str_replace("С…","h",$str);
$str = str_replace("С‡","c",$str);
$str = str_replace("С†","q",$str);//ч
$str = str_replace("С€","w",$str);
$str = str_replace("С‰",">",$str);//щ
$str = str_replace("СЊ","<",$str);//ъ
$str = str_replace("С‹","x",$str);//ы
$str = str_replace("СЉ",".",$str);//ь
$str = str_replace("СЌ",":",$str);//э
$str = str_replace("СЋ",";",$str);//ю
$str = str_replace("СЏ","}",$str);//я
$str = str_replace("Рђ","a",$str);
$str = str_replace("Р‘","b",$str);
$str = str_replace("Р’","v",$str);
$str = str_replace("Р“","g",$str);
$str = str_replace("Р”","d",$str);
$str = str_replace("Р•","e",$str);
$str = str_replace("РЃ","e",$str);
$str = str_replace("Р–","j",$str);
$str = str_replace("Р—","z",$str);
$str = str_replace("Р?","i",$str);
$str = str_replace("Р™","y",$str);
$str = str_replace("Рљ","k",$str);
$str = str_replace("Р›","l",$str);
$str = str_replace("Рњ","m",$str);
$str = str_replace("Рќ","n",$str);
$str = str_replace("Рћ","o",$str);
$str = str_replace("Рџ","p",$str);
$str = str_replace("Р ","r",$str);
$str = str_replace("РЎ","s",$str);
$str = str_replace("Рў","t",$str);
$str = str_replace("РЈ","u",$str);
$str = str_replace("Р¤","f",$str);
$str = str_replace("РҐ","h",$str);
$str = str_replace("Р§","c",$str);
$str = str_replace("Р¦","q",$str);
$str = str_replace("РЁ","w",$str);
$str = str_replace("Р©",">",$str);
$str = str_replace("Р¬","<",$str);
$str = str_replace("Р«","x",$str);
$str = str_replace("РЄ",".",$str);
$str = str_replace("Р",":",$str);
$str = str_replace("Р®",";",$str);
$str = str_replace("РЇ","}",$str);
return $str;
}
$nick=trim($nick);
if($nick=="")$nick=0;
$latuser=strtolower($nick);
$ruser = rus_to_k($nick);
if($ruser==$nick){
$select = mysql_query ("Select * from mafusers where latuser = '".$latuser."'");
} else {
$select = mysql_query ("select * from mafusers where ruser = '".$ruser."'");
}
}
if (mysql_affected_rows() == 0) {
echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n";
echo "<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.2//EN\" \"http://www.wapforum.org/DTD/wml12.dtd\">\n";
echo "<wml>\n";
echo "<head><meta http-equiv=\"Cache-Control\" content=\"no-cache\" forua=\"true\"/></head>\n";
echo "<card id=\"error\" title=\"error\" ontimer=\"maf.php?id=$id&ps=$ps&rm=$rm&ref=$ref\"><timer value=\"10\" />\n";
echo "<p align=\"center\">\n";
echo "Нет такого юзера\n";
echo "</p>\n";
echo "</card>\n";
echo "</wml>\n";
mysql_close ($link);
exit;
}
$inf = mysql_fetch_array ($select);
$bid = $inf["id"];
$level = $inf["level"];
$bnik = $inf["user"];
echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n";
echo "<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.2//EN\" \"http://www.wapforum.org/DTD/wml12.dtd\">\n";
echo "<wml>\n";
//echo "<head><meta http-equiv=\"Cache-Control\" content=\"no-cache\" forua=\"true\"/></head>\n";
echo "<card id=\"Ok\" title=\"Ok\" ontimer=\"maf.php?id=$id&ps=$ps&rm=$rm&ref=$ref\"><timer value=\"10\" />\n";
echo "<p align=\"center\">\n";
if($level<$row["level"]){
echo "$bnik Забанен!<br/>\n";
mysql_query("delete from ingame WHERE gamer_id = '".$bid."'");
@mysql_query ("Delete from mafusers where id ='".$bid."'");
$data = date("(H:i jF)");
@$open=fopen("bannlist.dat","a+");
@flock ($open,LOCK_EX);
@fwrite($open,"#$bnik#$data|who: $us|$REMOTE_ADDR|$HTTP_USER_AGENT\n");
@fflush($open);
@flock ($open,LOCK_UN);
@fclose($open);
} else {
if($level==4)$sts="VIPa";
if($level==5)$sts="Киллера";
if($level==6)$sts="Старшего модера";
if($level==7)$sts="РђРґРјРёРЅР°";
echo "С ума сошли $sts банить!? $bnik вам это припомнит!\n";
}
echo "</p>\n";
echo "</card>\n";
echo "</wml>\n";
mysql_close ($link);
?>