<?
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>Сколько аден:</small><br/>";
echo "<input name=\"kol\" maxlength=\"100\" title=\"kol\"/><br/>";
echo "<small>Письмо с рассылкой:</small><br/>";
echo "<input name=\"msg\" maxlength=\"999\" title=\"msg\"/><br/>";
echo "<small><anchor title=\"go\">OK<go href=\"priz.php?log=$log&pas=$pas&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","января",$currDate);
$currDate = str_replace("February","февраля",$currDate);
$currDate = str_replace("March","марта",$currDate);
$currDate = str_replace("April","апреля",$currDate);
$currDate = str_replace("May","мая",$currDate);
$currDate = str_replace("June","июня",$currDate);
$currDate = str_replace("July","июля",$currDate);
$currDate = str_replace("August","августа",$currDate);
$currDate = str_replace("September","сентября",$currDate);
$currDate = str_replace("October","октября",$currDate);
$currDate = str_replace("November","ноября",$currDate);
$currDate = str_replace("December","декабря",$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>Поздравление отправлено!</small>";
}
}
}else{echo"<small>Пароль или логин неверен!</small>";}
echo "</p></card></wml>";
?>