<?
include_once '../sys/inc/start.php';
include_once '../sys/inc/compress.php';
include_once '../sys/inc/sess.php';
include_once '../sys/inc/home.php';
include_once '../sys/inc/settings.php';
include_once '../sys/inc/db_connect.php';
include_once '../sys/inc/ipua.php';
include_once '../sys/inc/fnc.php';
include_once '../sys/inc/user.php';
only_reg();
$set['title']='Вид анкеты';
include_once '../sys/inc/thead.php';
title();
?>
<style>
textarea{
width: 0px;
height: 0px;
border: 0;
background-color: transparent;
}
</style>
<?
if ($user['level']==10){
$page = (isset($_GET['page'])) ? htmlspecialchars($_GET['page']) : null;
switch($page){
default:
$opendiricon=opendir(H.'a/icons');
while ($icons=readdir($opendiricon))
{
if (preg_match('#^\.|default.png#',$icons))continue;
$icon[]=$icons;
}
closedir($opendiricon);
if (isset($_POST['change']) && isset($_GET['id']) && isset($_POST['name']) && $_POST['name']!=NULL  && isset($_POST['table_pole']) && $_POST['table_pole']!=NULL && isset($_POST['type_pole']) && $_POST['type_pole']!=NULL)
{
$name=esc(stripcslashes(htmlspecialchars($_POST['name'])));
$table_pole=esc(stripcslashes(htmlspecialchars($_POST['table_pole'])));
$type_pole=esc(stripcslashes(htmlspecialchars($_POST['type_pole'])));
$icon=preg_replace('#[^A-zА-яЁё0-9 _\-\.]#i', null, $_POST['icon']);
mysql_query("UPDATE `create` SET `name` = '$name', `table_pole` = '$table_pole', `type_pole` = '$type_pole',  `icon` = '$icon' WHERE `id` = '".intval($_GET['id'])."' LIMIT 1");
msg('Пункт успешно изменён.');
}
if (isset($_POST['change_icon']) && isset($_GET['id']))
{
$icon=preg_replace('#[^A-zА-яЁё0-9 _\-\.]#i', null, $_POST['icon']);
mysql_query("UPDATE `create` SET `icon` = '$icon' WHERE `id` = '".intval($_GET['id'])."' LIMIT 1");
msg('Иконка успешно изменена.');
}
if (isset($_GET['id']) && isset($_GET['act']) && mysql_result(mysql_query("SELECT COUNT(*) FROM `create` WHERE `id` = '".intval($_GET['id'])."'"),0))
{
$punkt = mysql_fetch_assoc(mysql_query("SELECT * FROM `create` WHERE `id` = '".intval($_GET['id'])."' LIMIT 1"));
if ($_GET['act']=='down')
{
mysql_query("UPDATE `create` SET `pos` = '".($punkt['pos'])."' WHERE `pos` = '".($punkt['pos']+1)."' LIMIT 1");
mysql_query("UPDATE `create` SET `pos` = '".($punkt['pos']+1)."' WHERE `id` = '".intval($_GET['id'])."' LIMIT 1");
msg('Пункт сдвинут вниз.');
}
if ($_GET['act']=='up')
{
mysql_query("UPDATE `create` SET `pos` = '".($punkt['pos'])."' WHERE `pos` = '".($punkt['pos']-1)."'  LIMIT 1");
mysql_query("UPDATE `create` SET `pos` = '".($punkt['pos']-1)."' WHERE `id` = '".intval($_GET['id'])."' LIMIT 1");
msg('Пункт сдвинут вверх.');
}
if ($_GET['act']=='del')
{
mysql_query("DELETE FROM `create` WHERE `id` = '".intval($_GET['id'])."' LIMIT 1");
msg('Пункт удалён.');
}
if (isset($_GET['avatar']))
{
$pos=mysql_result(mysql_query("SELECT MAX(`pos`) FROM `create`"), 0)+1;
mysql_query("INSERT INTO `create` (`type`, `pos`) VALUES ('avatar', '$pos')");
msg('Аватар успешно добавлен.');
}
}
err();
aut();
echo "<div class='body'><table class='post'>";
$q=mysql_query("SELECT * FROM `create` ORDER BY `pos` ASC");
while ($post = mysql_fetch_assoc($q))
{
echo "   <tr>";
echo "  <td class='p_t'>";
if ($post['type']=='razd')echo "<div class='menu_razd'>$post[name]</div>";
elseif ($post['icon']!='default.png') echo icon_anketa($post['icon'],'code');
echo "$post[name] ";
if ($post['type']=='razdel')echo "(Разделитель)";
elseif ($post['type']=='avatar')echo "Аватар";
elseif ($post['type']=='day')echo "День Рождения";
elseif ($post['type']=='stat')echo " Статистика";
else echo " (поле)";
echo "  </td>";
echo "   </tr>";
echo "   <tr>";
echo "  <td class='p_m'>";
if (isset($_GET['id']) && $_GET['id']==$post['id'] && isset($_GET['act']) && $_GET['act']=='edit')
{
if ($post['type']=='razdel'){
echo "<form class='menu' action=\"?id=$post[id]\" method=\"post\">";
echo "Название:<br>";
echo "<input type=\"text\" name=\"name\" value='$post[name]'><br>";
echo "<input class=\"submit\" name=\"change\" type=\"submit\" value=\"Изменить\" /><br>";
echo "</form>";
}
elseif ($post['type']=='pole'){
echo "<form class='menu' action=\"?id=$post[id]\" method=\"post\">";
echo "Название:<br>";
echo "<input type='text' name='name' value=\"$post[name]\" /><br>";
echo "Имя таблицы поля:<br>";
echo "<input type='text' name='table_pole' value='$post[table_pole]' /><br>";
echo "Тип таблицы:<br>";
echo '<select name="type_pole">
<option value="">Выберете тип</option>
<option value="text"'.($post["type_pole"]=="text"?' selected="selected"':null).'>Текстовый</option>
<option value="bigint"'.($post["type_pole"]=="bigint"?' selected="selected"':null).'>Числовой</option>
</select><br>';
echo "Иконка:<br>";
echo "<select name='icon'>";
echo "<option value='default.png'>По умолчанию</option>";
for ($i=0;$i<sizeof($icon);$i++)
{
echo "<option value='$icon[$i]'".($post['icon']==$icon[$i]?" selected='selected'":null).">$icon[$i]</option>";
}
echo "</select><br>";
echo "<input class=\"submit\" name=\"change\" type=\"submit\" value=\"Изменить\" /><br>";
echo "</form>";
}
elseif ($post['type']=='day' or $post['type']=='stat'){
echo "<form class='menu' action=\"?id=$post[id]\" method=\"post\">";
echo "Иконка:<br>";
echo "<select name='icon'>";
echo "<option value='default.png'>По умолчанию</option>";
for ($i=0;$i<sizeof($icon);$i++)
{
echo "<option value='$icon[$i]'".($post['icon']==$icon[$i]?" selected='selected'":null).">$icon[$i]</option>";
}
echo "</select><br>";
echo "<input class=\"submit\" name=\"change_icon\" type=\"submit\" value=\"Изменить\" /><br>";
echo "</form>";
}
echo "<div class='p_m'><img src='img/delete.png'> <a href='?'>Отмена</a></div>";
}
echo "<a href='?id=$post[id]&amp;act=down'><img src='img/down.png'> Ниже</a> | ";
echo "<a href='?id=$post[id]&amp;act=up'><img src='img/up.png'> Выше</a> | ";
echo "<a href='?id=$post[id]&amp;act=del'><img src='img/delete.png'> Уд</a>";
if ($post['type']!='avatar')echo " | <a href='?id=$post[id]&amp;act=edit'><img src='img/set.png'> Ред</a><br>";
echo "</td>";
echo "</tr>";
}
echo "<div align='center' class='p_m'><a href='?page=view'><b>Посмотреть результат</b></a></div>";
echo "<div class='menu'>";
$q=mysql_query("SELECT * FROM `create`");
$post = mysql_fetch_assoc($q);
echo "<img src='img/add.png'> <a href='add.php?add_pole'>Добавить поле</a><br>";
echo "<img src='img/add.png'> <a href='add.php?add_razd'>Добавить разделитель</a><br>";
if($post['a']==Null or $post['a']=='0')echo "<img src='img/add.png'> <a href='add.php?add_avatar'>Добавить аватар</a><br>";
if($post['d']==Null or $post['d']=='0')echo "<img src='img/add.png'> <a href='add.php?add_day'>Добавить дату рождения</a><br>";
if($post['s']==Null or $post['s']=='0')echo "<img src='img/add.png'> <a href='add.php?add_stat'>Добавить статистику</a>";
echo "</table></div>";
break;
case 'view':
aut();
echo "<div align='center' class='p_t'><b><a href='?page=start'><font color='lightgreen'>>>Создать такую анкету<<</font></a></b></div>";
$base = mysql_query("SELECT * FROM `create` ORDER BY `pos` ASC");
while ($punkt = mysql_fetch_assoc($base))
{
if ($punkt['type']=='avatar'){
echo "<div class='menu'>";
echo avatar($user);
echo "</div>";
}
elseif ($punkt['type']=='day'){
echo "<div class='p_m'>";
echo icon_anketa($punkt['icon'],'code');
echo " Дата Рождения:</div>";
echo "<div class='p_m'>";
echo icon_anketa($punkt['icon'],'code');
echo " Возраст:</div>";
}
elseif ($punkt['type']=='razdel')echo "<div class='menu_razd'>$punkt[name]</div>";
elseif ($punkt['type']=='pole'){
echo "<div class='p_m'>";
echo icon_anketa($punkt['icon'],'code');
echo ' '.$punkt['name'].':';
echo "</div>";
}
elseif ($punkt['type']=='stat'){
echo "<div class='menu_razd'>Статистика</div>";
if (mysql_result(mysql_query("SELECT COUNT(*) FROM `ban` WHERE `id_user` = '$user[id]' AND `time` > '$time'"), 0)!=0)
{
$q=mysql_query("SELECT * FROM `ban` WHERE `id_user` = '$user[id]' AND `time` > '$time' ORDER BY `time` DESC LIMIT 5");
while ($post = mysql_fetch_assoc($q))
{
echo "<div class='menu'>Забанен до ".vremja($post['time']).":";
echo "".output_text($post['prich'])."</div>";
}
}
else
{
$narush=mysql_result(mysql_query("SELECT COUNT(*) FROM `ban` WHERE `id_user` = '$user[id]'"), 0);
echo "<div class='p_m'>".icon_anketa($punkt['icon'],'code')." Нарушений:".(($narush==0)?" нет</div>":" $narush</div>");
}
echo "<div class='p_m'>".icon_anketa($punkt['icon'],'code')." Регистрация: ".vremja($user['date_reg'])."</div>";
$chat_post=mysql_result(mysql_query("SELECT COUNT(*) FROM `chat_post` WHERE `id_user` = '$user[id]'"),0);
echo "<div class='p_m'>".icon_anketa($punkt['icon'],'code')." Сообщений в чате: $chat_post</div>";
$k_them=mysql_result(mysql_query("SELECT COUNT(*) FROM `forum_t` WHERE `id_user` = '$user[id]'"),0);
echo "<div class='p_m'>".icon_anketa($punkt['icon'],'code')." Тем в форуме: $k_them</div>";
$k_p_forum=mysql_result(mysql_query("SELECT COUNT(*) FROM `forum_p` WHERE `id_user` = '$user[id]'"),0);
echo "<div class='p_m'>".icon_anketa($punkt['icon'],'code')." Сообщений в форуме: $k_p_forum</div>";
if (user_access('user_show_add_info') && $user['level']>$user['level']){
$zakl3=mysql_result(mysql_query("SELECT COUNT(*) FROM `forum_zakl` WHERE `id_user` = '$user[id]'"),0);
if (isset($user) && ($user['level']>$user['level'] || $user['level']==4))
echo "<div class='p_m'>".icon_anketa($punkt['icon'],'code')." Закладки: $zakl3</div>";
$guest3=mysql_result(mysql_query("SELECT COUNT(*) FROM `guest` WHERE `id_user` = '$user[id]'"),0);
echo "<div class='p_m'>".icon_anketa($punkt['icon'],'code')." Гостевая: $guest3</div>";
$mail3=mysql_result(mysql_query("SELECT COUNT(*) FROM `mail` WHERE `id_user` = '$user[id]' OR `id_kont` = '$user[id]'"),0);
if (isset($user) && ($user['level']>$user['level'] || $user['level']==4))
echo "<div class='p_m'>".icon_anketa($punkt['icon'],'code')." Приватные сообщения: $mail3</div>";
}
$komm_loads=mysql_result(mysql_query("SELECT COUNT(*) FROM `loads_komm` WHERE `id_user` = '$user[id]'"),0);
echo "<div class='p_m'>".icon_anketa($punkt['icon'],'code')." Комментарии в загрузках: $komm_loads</div>";
$news_komm=mysql_result(mysql_query("SELECT COUNT(*) FROM `news_komm` WHERE `id_user` = '$user[id]'"),0);
echo "<div class='p_m'>".icon_anketa($punkt['icon'],'code')." Комментарии новостей: $news_komm</div>";
if (isset($access['show_all_info'])){
$user_voice=mysql_result(mysql_query("SELECT COUNT(*) FROM `user_voice2` WHERE `id_user` = '$user[id]' OR `id_kont` = '$user[id]'"),0);
if (isset($user) && ($user['level']>$user['level'] || $user['level']==4))
echo "<div class='p_m'>".icon_anketa($punkt['icon'],'code')." Рейтинги: $user_voice</div>";
$votes_user=mysql_result(mysql_query("SELECT COUNT(*) FROM `votes_user` WHERE `u_id` = '$user[id]'"),0);
if (isset($user) && ($user['level']>$user['level'] || $user['level']==4))
echo "<div class='p_m'>".icon_anketa($punkt['icon'],'code')." Голосования: $votes_user</div>";
$obmennik3=mysql_result(mysql_query("SELECT COUNT(*) FROM `obmennik_files` WHERE `id_user` = '$user[id]'"),0);
if (isset($user) && ($user['level']>$user['level'] || $user['level']==4))
echo "<div class='p_m'>".icon_anketa($punkt['icon'],'code')." Файлы в обменнике: $obmennik3</div>";
}
}
}
echo "<div class='p_t'><img src='img/back.png'> <a href='index.php'>Вернуться назад</a></div>";
break;
case 'start':
aut();
echo "<form class='menu' action='?page=create_info' method=\"post\">";
?>
<textarea name="text">
&#60;?
include_once 'sys/inc/start.php';
include_once 'sys/inc/compress.php';
include_once 'sys/inc/sess.php';
include_once 'sys/inc/home.php';
include_once 'sys/inc/settings.php';
include_once 'sys/inc/db_connect.php';
include_once 'sys/inc/ipua.php';
include_once 'sys/inc/fnc.php';
include_once 'sys/inc/user.php';
if (isset($user))$ank['id']=$user['id'];
if (isset($_GET['id']))$ank['id']=intval($_GET['id']);
if (isset($user) && $user['id']!=$ank['id'])
if ($ank['id']==0)
{$ank=get_user($ank['id']);
$set['title']='Анкета '.$ank['nick'];
include_once 'sys/inc/thead.php';
title();
aut();
echo "$ank[group_name]<br>";
if ($ank['ank_o_sebe']!=NULL)echo "О себе:$ank[ank_o_sebe]<br>";
include_once 'sys/inc/tfoot.php';
exit;
}
$ank=get_user($ank['id']);
if(!$ank){header("Location: /index.php?".SID);exit;}
$ank['rating']=intval(@mysql_result(mysql_query("SELECT SUM(`rating`) FROM `user_voice2` WHERE `id_kont` = '$ank[id]'"),0));
$set['title']='Анкета '.$ank['nick'];
include_once 'sys/inc/thead.php';
title();
if ((!isset($_SESSION['refer']) || $_SESSION['refer']==NULL)
&& isset($_SERVER['HTTP_REFERER']) && $_SERVER['HTTP_REFERER']!=NULL &&
!preg_match('#info\.php#',$_SERVER['HTTP_REFERER']))
$_SESSION['refer']=str_replace('&','&amp;',preg_replace('#^http://[^/]*/#','/', $_SERVER['HTTP_REFERER']));
aut();
$punkt = mysql_fetch_assoc(mysql_query("SELECT * FROM `create` ORDER BY `pos` ASC"));
echo "<div class='p_m'>";
echo "id: $ank[id]";
if ($ank['group_access']>1)echo " ($ank[group_name])";
echo "</div>";
<?
$a = mysql_query("select * from `create` ORDER by `pos` Asc");
while ($b = mysql_fetch_array($a)){
if ($b['type']=='avatar'){
?>
echo "<div class='menu'>";
avatar($ank['id']);
echo "</div>";
<?
}
elseif ($b['type']=='razdel'){
?>
echo "<div class='menu_razd'><?echo $b['name'];?></div>";
<?
}
elseif ($b['type']=='day'){
?>
if ($ank['ank_d_r']!=NULL && $ank['ank_m_r']!=NULL && $ank['ank_g_r']!=NULL){
if ($ank['ank_m_r']==1)$ank['mes']='Января';
elseif ($ank['ank_m_r']==2)$ank['mes']='Февраля';
elseif ($ank['ank_m_r']==3)$ank['mes']='Марта';
elseif ($ank['ank_m_r']==4)$ank['mes']='Апреля';
elseif ($ank['ank_m_r']==5)$ank['mes']='Мая';
elseif ($ank['ank_m_r']==6)$ank['mes']='Июня';
elseif ($ank['ank_m_r']==7)$ank['mes']='Июля';
elseif ($ank['ank_m_r']==8)$ank['mes']='Августа';
elseif ($ank['ank_m_r']==9)$ank['mes']='Сентября';
elseif ($ank['ank_m_r']==10)$ank['mes']='Октября';
elseif ($ank['ank_m_r']==11)$ank['mes']='Ноября';
else $ank['mes']='Декабря';
echo "<div class='p_m'><?echo icon_anketa($b['icon'],'code')?> Дата рождения: $ank[ank_d_r] $ank[mes] $ank[ank_g_r]г.</div>";
$ank['ank_age']=date("Y")-$ank['ank_g_r'];
if (date("n")<$ank['ank_m_r'])$ank['ank_age']=$ank['ank_age']-1;
elseif (date("n")==$ank['ank_m_r']&& date("j")<$ank['ank_d_r'])$ank['ank_age']=$ank['ank_age']-1;
echo "<div class='p_m'><?echo icon_anketa($b['icon'],'code')?> Возраст: $ank[ank_age]</div>";
}
elseif($ank['ank_d_r']!=NULL && $ank['ank_m_r']!=NULL)
{
if ($ank['ank_m_r']==1)$ank['mes']='Января';
elseif ($ank['ank_m_r']==2)$ank['mes']='Февраля';
elseif ($ank['ank_m_r']==3)$ank['mes']='Марта';
elseif ($ank['ank_m_r']==4)$ank['mes']='Апреля';
elseif ($ank['ank_m_r']==5)$ank['mes']='Мая';
elseif ($ank['ank_m_r']==6)$ank['mes']='Июня';
elseif ($ank['ank_m_r']==7)$ank['mes']='Июля';
elseif ($ank['ank_m_r']==8)$ank['mes']='Августа';
elseif ($ank['ank_m_r']==9)$ank['mes']='Сентября';
elseif ($ank['ank_m_r']==10)$ank['mes']='Октября';
elseif ($ank['ank_m_r']==11)$ank['mes']='Ноября';
else $ank['mes']='Декабря';
echo "<div class='p_m'><?echo icon_anketa($b['icon'],'code')?> Дата рождения: $ank[ank_d_r] $ank[mes]</div>";
}
else{
echo "<div class='p_m'><?echo icon_anketa($b['icon'],'code')?> Дата рождения: Неизвестно</div>";
echo "<div class='p_m'><?echo icon_anketa($b['icon'],'code')?> Возраст: Неизвестно</div>";
}
<?
}
elseif ($b['type']=='stat'){
?>
echo "<div class='menu_razd'>Статистика</div>";
if (mysql_result(mysql_query("SELECT COUNT(*) FROM `ban` WHERE `id_user` = '$user[id]' AND `time` > '$time'"), 0)!=0)
{
$q=mysql_query("SELECT * FROM `ban` WHERE `id_user` = '$user[id]' AND `time` > '$time' ORDER BY `time` DESC LIMIT 5");
while ($post = mysql_fetch_assoc($q))
{
echo "<div class='menu'>Забанен до ".vremja($post['time']).":";
echo "".output_text($post['prich'])."</div>";
}
}
else
{
$narush=mysql_result(mysql_query("SELECT COUNT(*) FROM `ban` WHERE `id_user` = '$user[id]'"), 0);
echo "<div class='p_m'><?echo icon_anketa($b['icon'],'code')?> Нарушений:".(($narush==0)?" нет</div>":" $narush</div>");
}
echo "<div class='p_m'><?echo icon_anketa($b['icon'],'code')?> Регистрация: ".vremja($user['date_reg'])."</div>";
$chat_post=mysql_result(mysql_query("SELECT COUNT(*) FROM `chat_post` WHERE `id_user` = '$user[id]'"),0);
echo "<div class='p_m'><?echo icon_anketa($b['icon'],'code')?> Сообщений в чате: $chat_post</div>";
$k_them=mysql_result(mysql_query("SELECT COUNT(*) FROM `forum_t` WHERE `id_user` = '$user[id]'"),0);
echo "<div class='p_m'><?echo icon_anketa($b['icon'],'code')?> Тем в форуме: $k_them</div>";
$k_p_forum=mysql_result(mysql_query("SELECT COUNT(*) FROM `forum_p` WHERE `id_user` = '$user[id]'"),0);
echo "<div class='p_m'><?echo icon_anketa($b['icon'],'code')?> Сообщений в форуме: $k_p_forum</div>";
if (user_access('user_show_add_info') && $user['level']>$user['level']){
$zakl3=mysql_result(mysql_query("SELECT COUNT(*) FROM `forum_zakl` WHERE `id_user` = '$user[id]'"),0);
if (isset($user) && ($user['level']>$user['level'] || $user['level']==4))
echo "<div class='p_m'><?echo icon_anketa($b['icon'],'code')?> Закладки: $zakl3</div>";
$guest3=mysql_result(mysql_query("SELECT COUNT(*) FROM `guest` WHERE `id_user` = '$user[id]'"),0);
echo "<div class='p_m'><?echo icon_anketa($b['icon'],'code')?> Гостевая: $guest3</div>";
$mail3=mysql_result(mysql_query("SELECT COUNT(*) FROM `mail` WHERE `id_user` = '$user[id]' OR `id_kont` = '$user[id]'"),0);
if (isset($user) && ($user['level']>$user['level'] || $user['level']==4))
echo "<div class='p_m'><?echo icon_anketa($b['icon'],'code')?> Приватные сообщения: $mail3</div>";
}
$komm_loads=mysql_result(mysql_query("SELECT COUNT(*) FROM `loads_komm` WHERE `id_user` = '$user[id]'"),0);
echo "<div class='p_m'><?echo icon_anketa($b['icon'],'code')?> Комментарии в загрузках: $komm_loads</div>";
$news_komm=mysql_result(mysql_query("SELECT COUNT(*) FROM `news_komm` WHERE `id_user` = '$user[id]'"),0);
echo "<div class='p_m'><?echo icon_anketa($b['icon'],'code')?> Комментарии новостей: $news_komm</div>";
if (isset($access['show_all_info'])){
$user_voice=mysql_result(mysql_query("SELECT COUNT(*) FROM `user_voice2` WHERE `id_user` = '$user[id]' OR `id_kont` = '$user[id]'"),0);
if (isset($user) && ($user['level']>$user['level'] || $user['level']==4))
echo "<div class='p_m'><?echo icon_anketa($b['icon'],'code')?> Рейтинги: $user_voice</div>";
$votes_user=mysql_result(mysql_query("SELECT COUNT(*) FROM `votes_user` WHERE `u_id` = '$user[id]'"),0);
if (isset($user) && ($user['level']>$user['level'] || $user['level']==4))
echo "<div class='p_m'><?echo icon_anketa($b['icon'],'code')?> Голосования: $votes_user</div>";
$obmennik3=mysql_result(mysql_query("SELECT COUNT(*) FROM `obmennik_files` WHERE `id_user` = '$user[id]'"),0);
if (isset($user) && ($user['level']>$user['level'] || $user['level']==4))
echo "<div class='p_m'><?echo icon_anketa($b['icon'],'code')?> Файлы в обменнике: $obmennik3</div>";
}
<?
}
elseif ($b['type']=='pole'){
if ($b['type_pole']=='text'){
?>
if ($ank['<?echo $b['table_pole'];?>']!=Null){
echo "<div class='p_m'>";
echo "<?echo icon_anketa($b['icon'],'code');?>";
echo "<?echo ' '.$b['name'].':';?> $ank[<?echo "$b[table_pole]";?>]";
echo "</div>";
}else{
echo "<div class='p_m'>";
echo "<?echo icon_anketa($b['icon'],'code');?>";
echo "<?echo ' '.$b['name'].':';?> Неизвестно";
echo "</div>";
}
<?
}elseif ($b['type_pole']=='bigint'){
?>
if ($ank['<?echo $b['table_pole'];?>']!=Null && $ank['<?echo $b['table_pole'];?>']!=0){
echo "<div class='p_m'>";
echo "<?echo icon_anketa($b['icon'],'code');?>";
echo "<?echo ' '.$b['name'].':';?> $ank[<?echo "$b[table_pole]";?>]";
echo "</div>";
}else{
echo "<div class='p_m'>";
echo "<?echo icon_anketa($b['icon'],'code');?>";
echo "<?echo ' '.$b['name'].':';?> Неизвестно";
echo "</div>";
}
<?
}
}
}
?>
if ($user['level']>$ank['level']){
if ($ank['ip']!=NULL){
if (user_access('user_show_ip') && $ank['ip']!=0){
echo "<div class='p_m'><img src='/style/anketa/ip.png'> IP:".long2ip($ank['ip'])."";
if (user_access('adm_ban_ip'))
echo " [<a href='/adm_panel/ban_ip.php?min=$ank[ip]'>Бан</a>]";
echo "</div>";
}
}
if ($ank['ip_cl']!=NULL){
if (user_access('user_show_ip') && $ank['ip_cl']!=0){
echo "<div class='p_m'><img src='/style/anketa/ip.png'> IP (CLIENT):".long2ip($ank['ip_cl'])."";
if (user_access('adm_ban_ip'))
echo " [<a href='/adm_panel/ban_ip.php?min=$ank[ip_cl]'>Бан</a>]";
echo "</div>";
}
}
if ($ank['ip_xff']!=NULL){
if (user_access('user_show_ip') && $ank['ip_xff']!=0){
echo "<div class='p_m'><img src='/style/anketa/ip.png'> IP (XFF):".long2ip($ank['ip_xff'])."";
if (user_access('adm_ban_ip'))
echo " [<a href='/adm_panel/ban_ip.php?min=$ank[ip_xff]'>Бан</a>]";
echo "</div>";
}
}
}
if (isset($user) && $user['id']!=$ank['id'])echo "<div class='p_m'><img src='/style/anketa/mail.png'> <a href='/mail.php?id=$ank[id]'>Написать в приват</a></div>";
if ($user['level']>$ank['level']){
if (user_access('user_prof_edit'))
echo "<div class='p_m'><img src='/style/anketa/edit.png'> <a href='/adm_panel/user.php?id=$ank[id]'>Редактировать профиль</a></div>";
if ($user['id']!=$ank['id']){
if (user_access('user_ban_set') || user_access('user_ban_set_h') || user_access('user_ban_unset'))
echo "<div class='p_m'><img src='/style/anketa/ban.png'> <a href='/adm_panel/ban.php?id=$ank[id]'>Нарушения (бан)</a></div>";
if (user_access('user_delete'))
{
echo "<div class='p_m'><img src='/style/anketa/delete.png'> <a href='/adm_panel/delete_user.php?id=$ank[id]'>Удалить пользователя</a></div>";
}
}
}
if (user_access('adm_log_read') && $ank['level']!=0 && ($ank['id']==$user['id'] || $ank['level']<$user['level']))
echo "<div class='p_m'><img src='/style/anketa/rating.png'> <a href='/adm_panel/adm_log.php?id=$ank[id]'>Отчет по администрированию</a></div>";
include_once 'sys/inc/tfoot.php';
?&#62;
</textarea>
<?
echo "<input class='submit' type='submit' value='Создать info.php файл' /><br>";
echo "</form>";
break;
case 'create_info':
aut();
$text=htmlspecialchars_decode(htmlspecialchars(stripcslashes(stripcslashes($_POST['text']))));
$open = fopen("files/info.php", "w+");
$test = fwrite($open, $text);
if ($test)echo "<div class='msg'>info.php успешно создан. Теперь создадим anketa.php.</div>";
else echo '<div class="err">Ошибка создания файла.</div>';
fclose($open);
echo "<form class='menu' action='?page=create_anketa' method=\"post\">";
?>
<textarea name="text">
&#60;?
include_once 'sys/inc/start.php';
include_once 'sys/inc/compress.php';
include_once 'sys/inc/sess.php';
include_once 'sys/inc/home.php';
include_once 'sys/inc/settings.php';
include_once 'sys/inc/db_connect.php';
include_once 'sys/inc/ipua.php';
include_once 'sys/inc/fnc.php';
include_once 'sys/inc/user.php';
only_reg();
$set['title']='Моя анкета';
include_once 'sys/inc/thead.php';
title();
if (isset($_POST['save'])){
<?
$a = mysql_query("select * from `create` ORDER by `pos` Asc");
while ($b = mysql_fetch_array($a)){
if ($b['type']=='day'){
?>
if (isset($_POST['ank_d_r']) && (is_numeric($_POST['ank_d_r']) && $_POST['ank_d_r']>0 && $_POST['ank_d_r']<=31 || $_POST['ank_d_r']==NULL))
{
$user['ank_d_r']= (int) $_POST['ank_d_r'];
if ($user['ank_d_r']==null)$user['ank_d_r']='null';
mysql_query("UPDATE `user` SET `ank_d_r` = $user[ank_d_r] WHERE `id` = '$user[id]' LIMIT 1");
if ($user['ank_d_r']=='null')$user['ank_d_r']=NULL;
}
else $err[]='Неверный формат дня рождения.';
if (isset($_POST['ank_m_r']) && (is_numeric($_POST['ank_m_r']) && $_POST['ank_m_r']>0 && $_POST['ank_m_r']<=12 || $_POST['ank_m_r']==NULL))
{
$user['ank_m_r']= (int) $_POST['ank_m_r'];
if ($user['ank_m_r']==null)$user['ank_m_r']='null';
mysql_query("UPDATE `user` SET `ank_m_r` = $user[ank_m_r] WHERE `id` = '$user[id]' LIMIT 1");
if ($user['ank_m_r']=='null')$user['ank_m_r']=NULL;
}
else $err[]='Неверный формат месяца рождения.';
if (isset($_POST['ank_g_r']) && (is_numeric($_POST['ank_g_r']) && $_POST['ank_g_r']>0 && $_POST['ank_g_r']<=date('Y') || $_POST['ank_g_r']==NULL))
{
$user['ank_g_r']= (int) $_POST['ank_g_r'];
if ($user['ank_g_r']==null)$user['ank_g_r']='null';
mysql_query("UPDATE `user` SET `ank_g_r` = $user[ank_g_r] WHERE `id` = '$user[id]' LIMIT 1");
if ($user['ank_g_r']=='null')$user['ank_g_r']=NULL;
}
else $err[]='Неверный формат года рождения.';
<?
}elseif ($b['type']=='pole'){
if ($b['type_pole']=='text'){
?>
if (isset($_POST['<?echo $b['table_pole']?>']))
{
if (preg_match('#[^A-zА-яЁё0-9 _&#92;&#92;&#92;&#92;-&#92;&#92;&#92;&#92;=&#92;&#92;&#92;&#92;+&#92;&#92;&#92;&#92;(&#92;&#92;&#92;&#92;)&#92;&#92;&#92;&#92;*&#92;&#92;&#92;&#92;?&#92;&#92;&#92;&#92;.,]#ui',$_POST['<?echo $b['table_pole']?>']))$err[]='В поле "<?echo $b['name']?>" используются запрещённые символы.';
else {
$user['<?echo $b['table_pole']?>']=$_POST['<?echo $b['table_pole']?>'];
mysql_query("UPDATE `user` SET `<?echo $b['table_pole']?>` = '".my_esc($user['<?echo $b['table_pole']?>'])."' WHERE `id` = '$user[id]' LIMIT 1");
}
}
<?
}elseif ($b['type_pole']=='bigint'){
?>
if (isset($_POST['<?echo $b['table_pole']?>']) && (is_numeric($_POST['<?echo $b['table_pole']?>'])))
{
$user['<?echo $b['table_pole']?>']= (int) $_POST['<?echo $b['table_pole']?>'];
if ($user['<?echo $b['table_pole']?>']==null)$user['<?echo $b['table_pole']?>']='null';
mysql_query("UPDATE `user` SET `<?echo $b['table_pole']?>` = $user[<?echo $b['table_pole']?>] WHERE `id` = '$user[id]' LIMIT 1");
if ($user['<?echo $b['table_pole']?>']=='null')$user['<?echo $b['table_pole']?>']=NULL;
}
else $err[]='Неверный формат поля *<?echo $b['name']?>*.';
<?
}
}
}
?>
if (!isset($err))msg('Изменения успешно приняты.');
}
err();
aut();
echo "<form class='menu' method='post' action='?$passgen'>";
<?
$a = mysql_query("select * from `create` ORDER by `pos` Asc");
while ($b = mysql_fetch_array($a)){
if ($b['type']=='pole'){
?>
echo "<?echo $b['name']?>:<br><input type='text' name='<?echo $b['table_pole']?>' value='$user[<?echo $b['table_pole']?>]' /><br>";
<?
}
if ($b['type']=='day'){
?>
echo 'Дата рождения:<br />
<select name="ank_d_r">
<option selected="'.$user['ank_d_r'].'" value="'.$user['ank_d_r'].'" >'.$user['ank_d_r'].'<option>
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
<option value="6">6</option>
<option value="7">7</option>
<option value="8">8</option>
<option value="9">9</option>
<option value="10">10</option>
<option value="11">11</option>
<option value="12">12</option>
<option value="13">13</option>
<option value="14">14</option>
<option value="15">15</option>
<option value="16">16</option>
<option value="17">17</option>
<option value="18">18</option>
<option value="19">19</option>
<option value="20">20</option>
<option value="21">21</option>
<option value="22">22</option>
<option value="23">23</option>
<option value="24">24</option>
<option value="25">25</option>
<option value="26">26</option>
<option value="27">27</option>
<option value="28">28</option>
<option value="29">29</option>
<option value="30">30</option>
<option value="31">31</option>
</select>';
echo '<select name="ank_m_r">
<option selected="'.$user['ank_m_r'].'" value="'.$user['ank_m_r'].'" >'.$user['ank_m_r'].'<option>
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
<option value="6">6</option>
<option value="7">7</option>
<option value="8">8</option>
<option value="9">9</option>
<option value="10">10</option>
<option value="11">11</option>
<option value="12">12</option>
</select>';
echo '<select name="ank_g_r">
<option selected="'.$user['ank_g_r'].'" value="'.$user['ank_g_r'].'" >'.$user['ank_g_r'].'<option><option value="1996">1996</option><option value="1995">1995</option><option value="1994">1994</option><option value="1993">1993</option><option value="1992">1992</option><option value="1991">1991</option><option value="1990">1990</option><option value="1989">1989</option><option value="1988">1988</option><option value="1987">1987</option><option value="1986">1986</option><option value="1985">1985</option><option value="1984">1984</option><option value="1983">1983</option><option value="1982">1982</option><option value="1981">1981</option><option value="1980">1980</option><option value="1979">1979</option><option value="1978">1978</option><option value="1977">1977</option><option value="1976">1976</option><option value="1975">1975</option><option value="1974">1974</option><option value="1973">1973</option><option value="1972">1972</option><option value="1971">1971</option><option value="1970">1970</option><option value="1969">1969</option><option value="1968">1968</option><option value="1967">1967</option><option value="1966">1966</option><option value="1965">1965</option><option value="1964">1964</option><option value="1963">1963</option><option value="1962">1962</option><option value="1961">1961</option><option value="1960">1960</option><option value="1959">1959</option><option value="1958">1958</option><option value="1957">1957</option><option value="1956">1956</option><option value="1955">1955</option><option value="1954">1954</option><option value="1953">1953</option><option value="1952">1952</option><option value="1951">1951</option><option value="1950">1950</option><option value="1949">1949</option><option value="1948">1948</option><option value="1947">1947</option><option value="1946">1946</option><option value="1945">1945</option><option value="1944">1944</option><option value="1943">1943</option><option value="1942">1942</option><option value="1941">1941</option><option value="1940">1940</option><option value="1939">1939</option><option value="1938">1938</option><option value="1937">1937</option><option value="1936">1936</option><option value="1935">1935</option><option value="1934">1934</option><option value="1933">1933</option><option value="1932">1932</option><option value="1931">1931</option><option value="1930">1930</option><option value="1929">1929</option><option value="1928">1928</option><option value="1927">1927</option><option value="1926">1926</option><option value="1925">1925</option><option value="1924">1924</option><option value="1923">1923</option><option value="1922">1922</option><option value="1921">1921</option><option value="1920">1920</option>
</select><br>';
<?
}
}
?>
echo "<input type='submit' name='save' value='Сохранить' /></form>";
include_once 'sys/inc/tfoot.php';
?&#62;
</textarea>
<?
echo "<input class='submit' type='submit' value='Создать anketa.php файл' /><br>";
echo "</form>";
break;
case 'create_anketa':
aut();
$text=htmlspecialchars_decode(htmlspecialchars(stripcslashes(stripcslashes($_POST['text']))));
$open = fopen("files/anketa.php", "w+");
$test = fwrite($open, $text);
if ($test)echo "<div class='msg'>anketa.php успешно создан. Теперь создадим anketa.sql.</div>";
else echo '<div class="err">Ошибка создания файла.</div>';
fclose($open);
echo "<form class='menu' action='?page=create_sql' method=\"post\">";
?>
<textarea name="text">
<?
$a = mysql_query("select * from `create` ORDER by `pos` Asc");
while ($b = mysql_fetch_array($a)){
if ($b['type']=='pole'){
?>
Alter table `user` add `<?echo $b['table_pole'];?>` <?echo $b['type_pole'];?> Not Null;
<?
}
}
?>
</textarea>
<?
echo "<input class='submit' type='submit' value='Создать anketa.sql файл' /><br>";
echo "</form>";
break;
case 'create_sql':
aut();
$text=htmlspecialchars_decode(htmlspecialchars(stripcslashes(stripcslashes($_POST['text']))));
$open = fopen("files/anketa.sql", "w+");
$test = fwrite($open, $text);
if ($test)echo "<div class='msg'>anketa.sql успешно создан. Теперь создадим user.php.</div>";
else echo '<div class="err">Ошибка создания файла.</div>';
fclose($open);
echo "<form class='menu' action='?page=create_user' method=\"post\">";
?>
<textarea name="text">
&#60;?
include_once '../sys/inc/start.php';
include_once '../sys/inc/compress.php';
include_once '../sys/inc/sess.php';
include_once '../sys/inc/home.php';
include_once '../sys/inc/settings.php';
include_once '../sys/inc/db_connect.php';
include_once '../sys/inc/ipua.php';
include_once '../sys/inc/fnc.php';
include_once '../sys/inc/shif.php';
include_once '../sys/inc/adm_check.php';
include_once '../sys/inc/user.php';
user_access('user_prof_edit',null,'index.php?'.SID);
adm_check();
if (isset($_GET['id']))$ank['id']=intval($_GET['id']);
else {header("Location: /index.php?".SID);exit;}
if (mysql_result(mysql_query("SELECT COUNT(*) FROM `user` WHERE `id` = '$ank[id]' LIMIT 1"),0)==0){header("Location: /index.php?".SID);exit;}
$ank=get_user($ank['id']);
if ($user['level']<=$ank['level']){header("Location: /index.php?".SID);exit;}
$set['title']='Профиль пользователя '.$ank['nick'];
include_once '../sys/inc/thead.php';
title();
if (isset($_POST['save'])){
<?
$a = mysql_query("select * from `create` ORDER by `pos` Asc");
while ($b = mysql_fetch_array($a)){
if ($b['type']=='pole'){
if ($b['type_pole']=='text'){
?>
if (isset($_POST['<?echo $b['table_pole']?>']) && preg_match('#^([A-zА-яЁё0-9 \-]*)$#ui', $_POST['<?echo $b['table_pole']?>']))
{
$ank['<?echo $b['table_pole']?>']=esc(stripcslashes(htmlspecialchars($_POST['<?echo $b['table_pole']?>']))) ;
mysql_query("UPDATE `user` SET `<?echo $b['table_pole']?>` = '$ank[<?echo $b['table_pole']?>]' WHERE `id` = '$ank[id]' LIMIT 1");
}
else $err='Вы ошиблись в поле <?echo $b['name']?>';
<?
}elseif ($b['type_pole']=='bigint'){
?>
if (isset($_POST['<?echo $b['table_pole']?>']) && (is_numeric($_POST['<?echo $b['table_pole']?>'])))
{
$ank['<?echo $b['table_pole']?>']=$_POST['<?echo $b['table_pole']?>'];
if ($ank['<?echo $b['table_pole']?>']==null)$ank['<?echo $b['table_pole']?>']='null';
mysql_query("UPDATE `user` SET `<?echo $b['table_pole']?>` = $ank[<?echo $b['table_pole']?>] WHERE `id` = '$ank[id]' LIMIT 1");
if ($ank['<?echo $b['table_pole']?>']=='null')$ank['<?echo $b['table_pole']?>']=NULL;
}
else $err='Неверный формат <?echo $b['name']?>';
<?
}
}elseif ($b['type']=='day'){
?>
if (isset($_POST['ank_d_r']) && (is_numeric($_POST['ank_d_r']) && $_POST['ank_d_r']>0 && $_POST['ank_d_r']<=31 || $_POST['ank_d_r']==NULL))
{
$ank['ank_d_r']=$_POST['ank_d_r'];
if ($ank['ank_d_r']==null)$ank['ank_d_r']='null';
mysql_query("UPDATE `user` SET `ank_d_r` = $ank[ank_d_r] WHERE `id` = '$ank[id]' LIMIT 1");
if ($ank['ank_d_r']=='null')$ank['ank_d_r']=NULL;
}
else $err='Неверный формат дня рождения';
if (isset($_POST['ank_m_r']) && (is_numeric($_POST['ank_m_r']) && $_POST['ank_m_r']>0 && $_POST['ank_m_r']<=12 || $_POST['ank_m_r']==NULL))
{
$ank['ank_m_r']=$_POST['ank_m_r'];
if ($ank['ank_m_r']==null)$ank['ank_m_r']='null';
mysql_query("UPDATE `user` SET `ank_m_r` = $ank[ank_m_r] WHERE `id` = '$ank[id]' LIMIT 1");
if ($ank['ank_m_r']=='null')$ank['ank_m_r']=NULL;
}
else $err='Неверный формат месяца рождения';
if (isset($_POST['ank_g_r']) && (is_numeric($_POST['ank_g_r']) && $_POST['ank_g_r']>0 && $_POST['ank_g_r']<=date('Y') || $_POST['ank_g_r']==NULL))
{
$ank['ank_g_r']=$_POST['ank_g_r'];
if ($ank['ank_g_r']==null)$ank['ank_g_r']='null';
mysql_query("UPDATE `user` SET `ank_g_r` = $ank[ank_g_r] WHERE `id` = '$ank[id]' LIMIT 1");
if ($ank['ank_g_r']=='null')$ank['ank_g_r']=NULL;
}
else $err='Неверный формат года рождения';
<?
}
}
?>
if (isset($_POST['new_pass']) && strlen2($_POST['new_pass'])>5)
{
admin_log('Пользователи','Смена пароля',"Пользователю '$ank[nick]' установлен новый пароль");
mysql_query("UPDATE `user` SET `pass` = '".shif($_POST['new_pass'])."' WHERE `id` = '$ank[id]' LIMIT 1");
}
if (user_access('user_change_group') && isset($_POST['group_access']))
{
if (mysql_result(mysql_query("SELECT COUNT(*) FROM `user_group` WHERE `id` = '".intval($_POST['group_access'])."' AND `level` < '$user[level]'"),0)==1)
{
if ($ank['group_access']!=intval($_POST['group_access']))
{
admin_log('Пользователи','Изменение статуса',"Пользователь '$ank[nick]': Статус '$ank[group_name]' изменен на '".mysql_result(mysql_query("SELECT `name` FROM `user_group` WHERE `id` = '".intval($_POST['group_access'])."'"),0)."'");
$ank['group_access']=intval($_POST['group_access']);
mysql_query("UPDATE `user` SET `group_access` = '$ank[group_access]' WHERE `id` = '$ank[id]' LIMIT 1");
}
}
}
admin_log('Пользователи','Профиль',"Редактирование профиля пользователя '$ank[nick]' (id#$ank[id])");
if (!isset($err))msg('Изменения успешно приняты');
}
err();
aut();
echo "<form method='post' action='user.php?id=$ank[id]'>";
<?
$a = mysql_query("select * from `create` ORDER by `pos` Asc");
while ($b = mysql_fetch_array($a)){
if ($b['type']=='day'){
?>
echo 'Дата рождения:<br />
	<select name="ank_d_r">
	<option selected="'.$ank['ank_d_r'].'" value="'.$ank['ank_d_r'].'" >'.$ank['ank_d_r'].'<option>
	<option value="1">1</option>
	<option value="2">2</option>
	<option value="3">3</option>
	<option value="4">4</option>
	<option value="5">5</option>
	<option value="6">6</option>
	<option value="7">7</option>
	<option value="8">8</option>
	<option value="9">9</option>
	<option value="10">10</option>
	<option value="11">11</option>
	<option value="12">12</option>
	<option value="13">13</option>
	<option value="14">14</option>
	<option value="15">15</option>
	<option value="16">16</option>
	<option value="17">17</option>
	<option value="18">18</option>
	<option value="19">19</option>
	<option value="20">20</option>
	<option value="21">21</option>
	<option value="22">22</option>
	<option value="23">23</option>
	<option value="24">24</option>
	<option value="25">25</option>
	<option value="26">26</option>
	<option value="27">27</option>
	<option value="28">28</option>
	<option value="29">29</option>
	<option value="30">30</option>
	<option value="31">31</option>
	</select>';
	echo '<select name="ank_m_r">
	<option selected="'.$ank['ank_m_r'].'" value="'.$ank['ank_m_r'].'" >'.$ank['ank_m_r'].'<option>	
	<option value="1">1</option>
	<option value="2">2</option>
	<option value="3">3</option>
	<option value="4">4</option>
	<option value="5">5</option>
	<option value="6">6</option>
	<option value="7">7</option>
	<option value="8">8</option>
	<option value="9">9</option>
	<option value="10">10</option>
	<option value="11">11</option>
	<option value="12">12</option>
	</select>';
	echo '<select name="ank_g_r">
	<option selected="'.$ank['ank_g_r'].'" value="'.$ank['ank_g_r'].'" >'.$ank['ank_g_r'].'<option><option value="1996">1996</option><option value="1995">1995</option><option value="1994">1994</option><option value="1993">1993</option><option value="1992">1992</option><option value="1991">1991</option><option value="1990">1990</option><option value="1989">1989</option><option value="1988">1988</option><option value="1987">1987</option><option value="1986">1986</option><option value="1985">1985</option><option value="1984">1984</option><option value="1983">1983</option><option value="1982">1982</option><option value="1981">1981</option><option value="1980">1980</option><option value="1979">1979</option><option value="1978">1978</option><option value="1977">1977</option><option value="1976">1976</option><option value="1975">1975</option><option value="1974">1974</option><option value="1973">1973</option><option value="1972">1972</option><option value="1971">1971</option><option value="1970">1970</option><option value="1969">1969</option><option value="1968">1968</option><option value="1967">1967</option><option value="1966">1966</option><option value="1965">1965</option><option value="1964">1964</option><option value="1963">1963</option><option value="1962">1962</option><option value="1961">1961</option><option value="1960">1960</option><option value="1959">1959</option><option value="1958">1958</option><option value="1957">1957</option><option value="1956">1956</option><option value="1955">1955</option><option value="1954">1954</option><option value="1953">1953</option><option value="1952">1952</option><option value="1951">1951</option><option value="1950">1950</option><option value="1949">1949</option><option value="1948">1948</option><option value="1947">1947</option><option value="1946">1946</option><option value="1945">1945</option><option value="1944">1944</option><option value="1943">1943</option><option value="1942">1942</option><option value="1941">1941</option><option value="1940">1940</option><option value="1939">1939</option><option value="1938">1938</option><option value="1937">1937</option><option value="1936">1936</option><option value="1935">1935</option><option value="1934">1934</option><option value="1933">1933</option><option value="1932">1932</option><option value="1931">1931</option><option value="1930">1930</option><option value="1929">1929</option><option value="1928">1928</option><option value="1927">1927</option><option value="1926">1926</option><option value="1925">1925</option><option value="1924">1924</option><option value="1923">1923</option><option value="1922">1922</option><option value="1921">1921</option><option value="1920">1920</option>
	</select><br/>';
<?
}elseif ($b['type']=='pole'){
?>
echo "<?echo $b['name'];?>:<br><input type='text' name='<?echo $b['table_pole'];?>' value='$ank[<?echo $b['table_pole'];?>]' /><br>";
<?
}
}
?>
echo "Группа:<br><select name='group_access'".(user_access('user_change_group')?null:' disabled="disabled"')."><br>";
$q=mysql_query("SELECT * FROM `user_group` ORDER BY `level`,`id` ASC");
while ($post = mysql_fetch_assoc($q))
{
echo "<option value='$post[id]'".($post['level']>=$user['level']?" disabled='disabled'":null)."".($post['id']==$ank['group_access']?" selected='selected'":null).">".$post['name']."</option>\n";
}
echo "</select><br>";
echo "Новый пароль:<br><input type='text' name='new_pass' value='' /><br>";
echo "<input type='submit' name='save' value='Сохранить' /></form>";
include_once '../sys/inc/tfoot.php';
?&#62;
</textarea>
<?
echo "<input class='submit' type='submit' value='Создать user.php файл' /><br>";
echo "</form>";
break;
case 'create_user':
aut();
$text=htmlspecialchars_decode(htmlspecialchars(stripcslashes(stripcslashes($_POST['text']))));
$open = fopen("files/user.php", "w+");
$test = fwrite($open, $text);
if ($test)echo "<div class='msg'>user.phpl успешно создан. Теперь перейдите в папку /a/files/ и увидете там эти 4 файла. user.php закиньте в adm_panel Анкета готова.</div>";
else echo '<div class="err">Ошибка создания файла.</div>';
fclose($open);
break;
}
}
include_once '../sys/inc/tfoot.php';
?>