View file znaki_LIM/znaki_LIM/add.php

File size: 4.16Kb
<?php

Error_Reporting(E_ALL & ~E_NOTICE);
//посылаем заголовки
header ("Content-type:text/vnd.wap.wml; charset=utf-8");
//вывод в браузер
print '<?xml version="1.0" encoding="utf-8"?>';
print '<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN"'.
' "http://www.wapforum.org/DTD/wml_1.1.xml">'.
'<wml><head><meta http-equiv="Cache-Control" content="no-cache" forua="true"/></head>';
//конфигурационный файл
include "./ini.php";
//авторизация
if(!empty($login))
$q = @mysql_query("select `id` from `".$px.$utable."` where `login`='".$login."';");
if(empty($id)) {
$data = @mysql_fetch_array($q);
$id = $data['id']; 
}
$login = autorize();
print '<card title="'.$lang['modering'].'">'.
'<p align="center">';
print '<br/>';
if(!$login['ip']) { @mysql_query("update `".$px.$utable."` set `ip`='".getenv(REMOTE_ADDR)."' where `id`='".$id."';"); }
	if(!$login['soft']) { @mysql_query("update `".$px.$utable."` set `soft`='".getenv(HTTP_USER_AGENT)."' where `id`='".$id."';"); }
	if($login['fsize'] == "small") { $fsize1 = "<small>"; $fsize2 = "</small>"; }
	elseif($login['fsize'] == "big") { $fsize1 = "<big>"; $fsize2 = "</big>"; }
	elseif($login['fsize'] == "i") { $fsize1 = "<i>"; $fsize2 = "</i>"; }
	elseif($login['fsize'] == "em") { $fsize1 = "<em>"; $fsize2 = "</em>"; }
 	elseif($login['fsize'] == "b") { $fsize1 = "<b>"; $fsize2 = "</b>"; }
	elseif($login['fsize'] == "big") { $fsize1 = "<big>"; $fsize2 = "</big>"; }
	elseif($login['fsize'] == "u") { $fsize1 = "<u>"; $fsize2 = "</u>"; }
      else { $fsize1 = ""; $fsize2 = ""; }
      
	ustatus();

if($login&&$login['moder']) {
	//выбираем режим
	switch($mod) {
	//добавление встреч
	case 'addmeet':
	$q = @mysql_query("select * from `".$px.$meettable."` where `login`='".$login['id']."' order by id desc;");
	$last_meet = @mysql_fetch_array($q);
	if(empty($act)) {
		print $lang['title'].":<br/><input name=\"t\"/><br/>
			".$lang['content'].":<br/><input name=\"content\"/><br/>
			".$lang['organizators'].":<br/><input name=\"organizatory\"/><br/>
			".$lang['add_photo'].":<br/><input name=\"photo\"/><br/>
			<anchor>".$lang['ok']."<go href=\"add.php?id=$id&amp;pass=$pass&amp;mod=$mod\" method=\"post\">
			<postfield name=\"act\" value=\"add\"/>
			<postfield name=\"t\" value=\"$(t)\"/>
			<postfield name=\"content\" value=\"$(content)\"/>
			<postfield name=\"organizatory\" value=\"$(organizatory)\"/>
			<postfield name=\"photo\" value=\"$(photo)\"/></go></anchor><br/>";
	} else { if(empty($error)) { //если ошибок нет
	//если такой встечи нет в бд
	if($t!=$last_meet['title']) {
	//запрос на добавление новой встечи
	if(@mysql_query("insert into `".$px.$meettable."` values(0,'".$login['login']."','$t','$content','$organizatory','$photo');")) { print $lang['done']; } else { print $lang['error']; } } else { print $lang['meet_exist']; }
	} else { print $error; } }
	break;
	//режим убить
	case 'agent';
	if($login['moder']>=3) {
	$q = @mysql_query("select * from `".$px.$utable."` where `id`='$whoid';");
	$dbuser = @mysql_fetch_array($q);
	print "<b>Ip:</b><br/>".$dbuser['ip']."<br/>";
	print "<b>Soft:</b><br/>".$dbuser['soft']."<br/>"; 
	if ($login['admin']==1) print "<b><a href=\"moder.php?id=$id&amp;pass=$pass&amp;mod=kicksoftip&amp;softip=$whoid\">$lang[kick]/$lang[restore]</a> IP+SOFT</b>:($dbuser[soft] $dbuser[ip])<br/>"; 
	}
	else print $lang['access_denied'];
	break;
	//по умолчанию
	default:
	print "</p><p><a href=\"add.php?id=$id&amp;pass=$pass&amp;mod=addmeet\">".$lang['add_meet']."</a><br/>";
	print "<a href=\"vyvod.php?id=$id&amp;pass=$pass&amp;mod=addmeet\">".$lang['add_vyvod']."</a><br/>";
		print "<a href=\"./enter.php?id=$id&amp;pass=$pass&amp;mod=addmeet\">".$lang['pozd']."</a>";
	}

	}
	if($mod){
	print "<br/><a href=\"./add.php?id=$id&amp;pass=$pass\">".$lang['modering']."</a><br/>";
		print "<a href=\"./enter.php?id=$id&amp;pass=$pass&amp;mod=addmeet\">".$lang['pozd']."</a>";

			} else { $lang['access_denied']; }
@mysql_close();
print '</p>'.
'</card>'.
'</wml>';
ob_end_flush();
?>