Просмотр файла darkworld/adminka2/priz.php

Размер файла: 4.55Kb
<?
Error_Reporting(E_ALL & ~E_NOTICE);
$ref=rand(100,10000000);

header("Content-type:text/vnd.wap.wml");
echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>";
echo "<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.2//EN\" \"http://www.wapforum.org/DTD/wml12.dtd\">";
echo "<wml>\n";
echo "<head><meta http-equiv=\"Cache-Control\" content=\"no-cache\" forua=\"true\"/></head>";
echo "<card id=\"index\" title=\"GM-panel\">";
echo "<p align=\"left\">";

$log = htmlspecialchars(stripslashes($log));
$pas = htmlspecialchars(stripslashes($pas));
/////////////////////////////////////////////////////
$text = @file("../data/reg/$log.dat"); 
if ($text!=""){
$udata = explode(":||:",$text[0]);
$login=trim($udata[0]);
$password=trim($udata[1]);}
////////////////////////////////////////////////////////
if (md5($pas)==$password && $log==$login && $log!=="" && md5($pas)!=="") {

$u = explode(".",$login);

if($log=="$u[0].GM"){


switch($go) {

default:

echo "<small>&#x421;&#x43A;&#x43E;&#x43B;&#x44C;&#x43A;&#x43E; &#x430;&#x434;&#x435;&#x43D;:</small><br/>";
echo "<input name=\"kol\" maxlength=\"100\" title=\"kol\"/><br/>";
echo "<small>&#x41F;&#x438;&#x441;&#x44C;&#x43C;&#x43E; &#x441; &#x440;&#x430;&#x441;&#x441;&#x44B;&#x43B;&#x43A;&#x43E;&#x439;:</small><br/>";
echo "<input name=\"msg\" maxlength=\"999\" title=\"msg\"/><br/>";
echo "<small><anchor title=\"go\">OK<go href=\"priz.php?log=$log&amp;pas=$pas&amp;go=go\" method=\"post\">";
echo "<postfield name=\"kol\" value=\"$(kol)\"/>";
echo "<postfield name=\"msg\" value=\"$(msg)\"/>";
echo "</go></anchor></small><br/>";

break;

case 'go':

$fdir = opendir('../data/reg/');
while($file = readdir($fdir)){

	if ($file != '.' and $file != '..'){
$file=str_replace(".dat","",$file);
$fal = @file("../data/reg/$file.dat"); 
$uda = explode(":||:",$fal[0]);

$uda[8]=$uda[8]+$_POST[kol];

$t=$uda[0].':||:'.$uda[1].':||:'.$uda[2].':||:'.$uda[3].':||:'.$uda[4].':||:'.$uda[5].':||:'.$uda[6].':||:'.$uda[7].':||:'.$uda[8].':||:'.$uda[9].':||:'.$uda[10].':||:'.$uda[11].':||:'.$uda[12].':||:'.$uda[13].':||:'.$uda[14].':||:'.$uda[15].':||:'.$uda[16].':||:'.$uda[17].':||:'.$uda[18].':||:'.$uda[19].':||:'.$uda[20].':||:'.$uda[21].':||:1:||:'.$uda[23].':||:'.$uda[24].':||:'.$uda[25].':||:'.$uda[26].':||:'.$uda[27].':||:'.$uda[28].':||:'.$uda[29].':||:'.$uda[30].':||:'.$uda[31].':||:'.$uda[32].':||:'.$uda[33].':||:'.$uda[34].':||:'.$uda[35].':||:'.$uda[36].':||:'.$uda[37].':||:'.$uda[38].':||:'.$uda[39].':||:'.$uda[40].':||:';

$fp=fopen("../data/reg/$file.dat","w");
flock($fp,LOCK_EX);           
ftruncate($fp,0);                                                                 
fputs($fp,"$t");
fflush($fp);
flock($fp,LOCK_UN);
fclose($fp); 

$currHour=date("H",time());
$currDate=date("d F, Y", time());
$currTime=date("$currHour:i:s", time());
$currDate = str_replace("January","&#x44F;&#x43D;&#x432;&#x430;&#x440;&#x44F;",$currDate);
$currDate = str_replace("February","&#x444;&#x435;&#x432;&#x440;&#x430;&#x43B;&#x44F;",$currDate);
$currDate = str_replace("March","&#x43C;&#x430;&#x440;&#x442;&#x430;",$currDate);
$currDate = str_replace("April","&#x430;&#x43F;&#x440;&#x435;&#x43B;&#x44F;",$currDate);
$currDate = str_replace("May","&#x43C;&#x430;&#x44F;",$currDate);
$currDate = str_replace("June","&#x438;&#x44E;&#x43D;&#x44F;",$currDate);
$currDate = str_replace("July","&#x438;&#x44E;&#x43B;&#x44F;",$currDate);
$currDate = str_replace("August","&#x430;&#x432;&#x433;&#x443;&#x441;&#x442;&#x430;",$currDate);
$currDate = str_replace("September","&#x441;&#x435;&#x43D;&#x442;&#x44F;&#x431;&#x440;&#x44F;",$currDate);
$currDate = str_replace("October","&#x43E;&#x43A;&#x442;&#x44F;&#x431;&#x440;&#x44F;",$currDate);
$currDate = str_replace("November","&#x43D;&#x43E;&#x44F;&#x431;&#x440;&#x44F;",$currDate);
$currDate = str_replace("December","&#x434;&#x435;&#x43A;&#x430;&#x431;&#x440;&#x44F;",$currDate);

$msg=base64_encode($_POST[msg]);
$tex=":::Administrator|$msg|$currDate $currTime"; 

$fp=@fopen("../data/msg/$file.msg","a+");  
flock ($fp,LOCK_EX);                                                              
fputs($fp,"$tex\r\n");
fflush ($fp);
flock ($fp,LOCK_UN);
fclose($fp);  

}}

echo"<small>&#x41F;&#x43E;&#x437;&#x434;&#x440;&#x430;&#x432;&#x43B;&#x435;&#x43D;&#x438;&#x435; &#x43E;&#x442;&#x43F;&#x440;&#x430;&#x432;&#x43B;&#x435;&#x43D;&#x43E;!</small>";

}
}
}else{echo"<small>&#x41F;&#x430;&#x440;&#x43E;&#x43B;&#x44C; &#x438;&#x43B;&#x438; &#x43B;&#x43E;&#x433;&#x438;&#x43D; &#x43D;&#x435;&#x432;&#x435;&#x440;&#x435;&#x43D;!</small>";}


echo "</p></card></wml>"; 

?>