<?

          include '../../system/core.php';
          $_title = 'Панель управления';
          include '../../system/header.php';

 echo '<div class="tegi"><a href="/admin">Админка</a> '; 
  echo '</div>'; 
 
          if($user['status'] < 1){
          
          header('Location: /index.php');
          exit;
  
          }
 
          switch($_GET['m'])
          {
          
          default:  
 
        echo '<a href="?m=bans"><div class="post2"><img src="/img/money.png" wight="20" height="20"/> Управление банами</div></a>';
  echo '<a href="?m=banforum"><div class="post1"><img src="/img/money.png" wight="20" height="20"/> Управление банами форума</div></a>';
      echo '<a href="?m=reg"><div class="post2"><img src="/img/money.png" wight="20" height="20"/> Управление регистрациями</div></a>';

          if($user['status'] == 4 ){echo '<a href="?m=rek"><div class="post1"><img src="/img/money.png" wight="20" height="20"/> Управление рекламой</div></a>';}
  
          if($user['status'] == 4 ){echo '<a href="?m=users"><div class="post2"><img src="/img/money.png" wight="20" height="20"/> Управление пользователями</div></a>';}


         if($user['status'] == 4 ){echo '<a href="?m=wmid"><div class="post2"><img src="/img/money.png" wight="20" height="20"/> Подтверждение реквизитов</div></a>';}
  
     if($user['status'] == 4 ){echo '<a href="/modules/admin/rules.php"><div class="post2"><img src="/img/money.png" wight="20" height="20"/> Правила</div></a>';}
  

 if($user['status'] == 4 ){echo '<a href="/modules/admin/spam.php"><div class="post2"><img src="/img/money.png" wight="20" height="20"/> Антиспам (не работает)</div></a>';}

if($user['status'] == 4 ){echo '<a href="/modules/admin/antiimat.php"><div class="post2"><img src="/img/money.png" wight="20" height="20"/> Антимат (не работает)</div></a>';}

          echo '<a href="?m=chat"><div class="post2"><img src="/img/money.png" wight="20" height="20"/> Админ-чат ('.mysql_result(mysql_query('select count(`id`) from `user` WHERE `self` LIKE "%/admin?m=chat%" and `online` > "'.(time()-300).'"'),0).' чел.)</div></a>';

          break;
                  
          case 'chat':
  
          switch($_GET['section']){
  default:
  if(isset($_POST['submit'])){

  $text = TextGuard($_POST['text']);
  if(empty($text)) $err[] = 'Сообщение осталось пустым';

  if(!$err){

  		mysql_query("INSERT INTO `a_chat`(
			`who`,`ho`,`text`,`type`,`time`
			)VALUES(
			'".$user['id']."','','".$text."','0','".time()."'
			)");

  header('Location: /admin?m=chat'); exit;
  
  }else{
  echo '<div class="err"><b>';
  foreach($err as $err_info){
  echo $err_info.'<br>';
  }
  echo '</b></div>';
  }
  
  }

  echo '<div class="mist">
  <form action="" method="post">
  Сообщение [<a href="/admin?m=chat">Обн</a>] [<a href="/admin?m=chat&amp;section=och">Очистить</a>]:<br> <textarea name="text" style="width:98%;" rows="3"></textarea> <input type="submit" value="Написать" name="submit"/> <a href="/smiles.php">Смайлы</a> | <a href="/bbcode.php">ББ коды</a>
  </form></div>';
  $cop = $user['on_page'];
  $ca = mysql_result(mysql_query("SELECT COUNT(*) FROM `a_chat`"),0);
  $cp = ceil($ca/$cop);
  if(isset($_GET['p']) && is_numeric($_GET['p'])){
  $p = $_GET['p'];
  if($_GET['p']>$cp) $p = $cp;
  if($_GET['p']<1)$p = 1;
  }else{
  $p = 1;
  }
  $start = $p*$cop-$cop;

  
  $a_chat = mysql_query("SELECT * FROM `a_chat` ORDER BY `id` DESC LIMIT $start,$cop");
  while($_a_chat = mysql_fetch_assoc($a_chat)){

  echo '<div class="post1"><table cellpadding="0" cellspacing="4"><tr><td style="width: 40px; vertical-align: top; height: 40px; margin: 0; padding:0; border: 0;" id="mail_avatar">';
if (file_exists($_SERVER['DOCUMENT_ROOT'].'/modules/profile/ava/'.$_a_chat['who'].'.jpg')) {
echo '<img src="/modules/profile/ava/'.$_a_chat['who'].'.jpg" alt="Ava" style="max-width:40px;">';
}
else
{
echo '<img src="/modules/profile/images/noava.png" alt="Ava" style="max-width:40px;">';
}
echo '</td><td style="vertical-align: top;" id="mail_textarea"> '.ustatus($_a_chat['who']).' <a href="/us'.$_a_chat['who'].'">'.uname($_a_chat['who']).'</a> '.uaccess($_a_chat['who']).' ';
  
  if(!empty($_a_chat['ho'])) echo '<i>ответил</i> '.ustatus($_a_chat['ho']).' <a href="/us'.$_a_chat['ho'].'">'.uname($_a_chat['ho']).'</a> '.uaccess($_a_chat['ho']).'';
  
  echo ' <a href="/admin?m=chat&amp;section=say&amp;id='.$_a_chat['who'].'">[отв]</a> <a href="/admin?m=chat&amp;section=dc&amp;id='.$_a_chat['id'].'">[уд]</a> <br/>'.bbcode(smiles($_a_chat['text'])).'';
  echo '</td></tr></table></div>';
  }

  echo '<div class="spis">Стр. ';
  if($p-2>0) echo '<a href="/admin/?m=chat&amp;p=1"><<</a> ';
  if($p-1>0) echo '<a href="/admin/?m=chat&amp;p='.($p-1).'"><</a> ';

  if($p-3>0) echo '<a href="/admin/??m=chat&amp;p'.($p-3).'">'.($p-3).'</a> | ';
  if($p-2>0) echo '<a href="/admin/?m=chat&amp;p='.($p-2).'">'.($p-2).'</a> | ';  
  if($p-1>0) echo '<a href="/admin/?m=chat&amp;p='.($p-1).'">'.($p-1).'</a> | ';
  
  echo '<b>'.$p.'</b>';
  if($p+1<=$cp) echo ' | <a href="/admin/?m=chat&amp;p='.($p+1).'">'.($p+1).'</a>';
  if($p+2<=$cp) echo ' | <a href="/admin/?m=chat&amp;p='.($p+2).'">'.($p+2).'</a>';
  if($p+3<=$cp) echo ' | <a href="/admin/?m=chat&amp;p='.($p+3).'">'.($p+3).'</a>';

  if($p+1<=$cp) echo ' <a href="/admin/?m=chat&amp;p='.($p+1).'">></a>';
  if($p+2<=$cp) echo ' <a href="/admin/?m=chat&amp;p='.ceil($ca/$cop).'">>></a>';
  echo '</div>';


  
  break;
  case 'say':
 $id = TextGuard($_GET['id']);

  if(empty($id) or $id == $user['id']){
   header('Location: /admin?m=chat'); exit;
  }
 

  if(isset($_POST['submit'])){

  $text = TextGuard($_POST['text']);
  if(empty($text)) $err[] = 'Сообщение осталось пустым';

  if(!$err){

  		mysql_query("INSERT INTO `a_chat`(
			`who`,`ho`,`text`,`type`,`time`
			)VALUES(
			'".$user['id']."','".$id."','".$text."','".$type."','".time()."'
			)");

    	 mysql_query("INSERT INTO `op`(
			`who`,
			`ho`,
			`text`,
      `time`,
      `read`,
      `sort`
			)VALUES(
      '".$id."',
      '".$user['id']."',
      'ответил в [url=/admin?m=chat]чате[/url]!',
      '".time()."',
      '0',
      '3'
			)");


  header('Location: /admin?m=chat'); exit;
  
  }else{
  echo '<div class="err">';
  foreach($err as $err_info){
  echo $err_info.'<br>';
  }
  echo '</div>';
  }
  
  }

  echo '<div class="mist">
  <form action="" method="post">
  Сообщение для: '.ustatus($id).' '.uname($id).' '.uaccess($id).':<br>
<textarea name="text" style="width:98%;" rows="3"></textarea> <br/><input type="submit" value="Написать" name="submit"/> <a href="/smiles.php">Смайлы</a> | <a href="/bbcode.php">ББ коды</a>
  </form></div>';
  
  echo '<div class="tegi"><a href="/admin?m=chat">Вернуться</a></div>';
  break;
  
 case 'dc':
  $id = TextGuard($_GET['id']);

  
  mysql_query("DELETE FROM `a_chat` WHERE `id` = '".$id."'");
 


  header('Location: /admin?m=chat'); exit;
  break;

case 'och':
 

  mysql_query("DELETE FROM `a_chat`");
 


mysql_query("INSERT INTO `a_chat`(
			`who`,
			`ho`,
			`text`,
      `type`,
      `time`
			)VALUES(
			'".$user['id']."',
			'".$id."',
			 	'[b]Чат очищен[/b]',
			'".$type."',
			'".time()."'
			)");

  header('Location: /admin?m=chat'); exit;
  break;
  }
  break;
  case 'bans':
  switch($_GET['section']){
  default:

  echo '<div class="post1"><a href="/admin?m=bans&amp;section=ban">Забанить</a></div>
  <div class="post2"><a href="/admin?m=bans&amp;section=unban">Разбанить (<font color="red">'.mysql_result(mysql_query('select count(`id`) from `ban` where `end` > "'.time().'"'),0).'</font>)</a></div>';
  break;
  case 'ban':


$type = isset($_POST['type'])?$_POST['type']:'';
$who = isset($_POST['who'])?$_POST['who']:'';
 
  if(isset($_POST['submit'])){
 if(empty($who)) $err[] = 'ID или ник осталось пустым';
  if(!empty($who)) if($type == 1 && !is_numeric($who)) $err[] = 'В ID разрешено вводить только цифры'; 

  if($type == 1){
  $users = mysql_fetch_array(mysql_query('select * from `user` where `id` = "'.$who.'"'));
  }else{
  $users = mysql_fetch_array(mysql_query('select * from `user` where `login` = "'.$who.'"'));
  }
  
  if(!empty($who)) if($users == 0) $err[] = 'Такого пользователя не существует';
  if($users['status'] > $user['status']) $err[] = 'Вы не можете забанить этого пользователя т.к его должность выше вашего';
  $bans = mysql_fetch_array(mysql_query('select * from `ban` where `who` = "'.$users['id'].'"'));
  if($bans != 0) $err[] = 'Этот пользователь в бане, зайди <a href="/admin?m=bans&amp;section=unban">сюда</a> и разбанить, что-бы забанить снова';

  $why = isset($_POST['why'])?$_POST['why']:'';
$time_d = isset($_POST['time_d'])?$_POST['time_d']:'';
$time_h = isset($_POST['time_h'])?$_POST['time_h']:'';
$time_m = isset($_POST['time_m'])?$_POST['time_m']:'';

  if(empty($why)) $err[] = 'Причина осталось пустой';
  
  
  if(empty($time_d) or $time_d < 0) $time_d = 0;
  if(empty($time_h) or $time_h < 0) $time_h = 0;
  if($time_h > 24) $time_h = 24;
  if(empty($time_m) or $time_m < 0) $time_m = 0;
  if($time_m > 60) $time_m = 60;
  
  if($time_d+$time_h+$time_m == 0) $err[] = 'Вы не можете забанить на 0 часов, 0 минут, 0 секунд';
  
  if(!empty($time_d)) if(!is_numeric($time_d)) $err[] = 'Ошибка ввода времени бана';
  
  if(!$err){
  
  		mysql_query("INSERT INTO `ban`(
			`who`,
			`why`,
			`time`,
      `end`,
      `ho`
			)VALUES(
			'".$users['id']."',
			'".$why."',
			'".time()."',
			'".(time()+((((60*60)*24)*$time_d)+((60*60)*$time_h)+(60*$time_m)))."',
			'".$user['id']."'
			)");

$log = mysql_fetch_array(mysql_query('select * from `adm_log` where `ho` = "'.$id.'"'));

mysql_query("INSERT INTO `adm_log`(
			`who`,
			`ho`,
			`text`,
      `time`
			)VALUES(
      '".$id."',
      '".$user['id']."',
      'Забанил пользователя [url=/us".$who['id']."]".uname($users['id'])."[/url] ".uaccess($users['id'])."',
      '".time()."'
			)");

  echo '<div class="msg">'.ustatus($users['id']).' <a href="/us'.$users['id'].'">'.uname($users['id']).'</a> '.uaccess($users['id']).' забанен на ';
  if($time_d > 0) echo '<b>'.$time_d.'</b> дней';
  if($time_h > 0) echo '<b>'.$time_h.'</b> часов';
  if($time_m > 0) echo '<b>'.$time_m.'</b> минут';

  echo '</div>';
  
  }else{
  echo '<div class="err">';
  foreach($err as $err_info){
  echo $err_info.'<br>';
  }
  echo '</div>';  
  }
  
  }
  
  echo '<div class="poste">
  <form action="" method="post">
  <ul>
  <li><select name="type">
  <option value="1">ID</option>
  <option value="2">Ник</option>
  </select>
  <input name="who"/><br><br></li>
  <li>Причина:<br><textarea name="why" style="width:98%;" rows="3"></textarea></li>
  <li>Время:<br><br><input name="time_d" size="2"/> дней <input name="time_h" size="2"/> часов [1-24] <input name="time_m" size="2"/> минут [1-60]<br><br></li>
  <li><input type="submit" value="Забанить" name="submit"/></ul>
  </form></div>';
  
  echo '<div class="tegi"><a href="/admin?m=bans">Вернуться</a></div>';
  break;
  case 'unban':

 $cop = $user['on_page'];
  $ca = mysql_result(mysql_query("SELECT COUNT(*) FROM `ban`"),0);
  $cp = ceil($ca/$cop);
  if(isset($_POST['p']) && is_numeric($_POST['p'])){
  $p = $_POST['p'];
  if($_POST['p']>$cp) $p = $cp;
  if($_POST['p']<1)$p = 1;
  }else{
  $p = 1;
  }
  $start = $p*$cop-$cop;


  if(isset($_GET['ok'])){
 $id = TextGuard($_GET['id']);
  $ok = TextGuard($_GET['ok']);
  $ban = mysql_fetch_array(mysql_query('select * from `ban` where `id` = "'.$id.'"'));
  if(empty($id) or !is_numeric($id) or $ban == 0){
  header('Location: /admin?m=bans&section=unban'); exit;
  }else{
  mysql_query("DELETE FROM `ban` WHERE `id` = '".$id."'");
  echo '<div class="post2">'.ustatus($ban['who']).' <a href="/us'.$ban['who'].'">'.uname($ban['who']).'</a> '.uaccess($ban['who']).' разбанен !</div>';
  }}

  
  $bans = mysql_query("SELECT * FROM `ban` ORDER BY `id` DESC LIMIT $start,$cop");
  while($_bans = mysql_fetch_assoc($bans)){
  echo '<div class="post1">'.ustatus($_bans['who']).' <a href="/us'.$_bans['who'].'">'.uname($_bans['who']).'</a> '.uaccess($_bans['who']).' забанен '.ustatus($_bans['ho']).' <a href="/us'.$_bans['ho'].'">'.uname($_bans['ho']).'</a> '.uaccess($_bans['ho']).' на <b>'.times2($_bans['end']-$_bans['time']).'</b> ('.times($_bans['time']).') [<a href="/admin?m=bans&amp;section=unban&amp;ok&amp;id='.$_bans['id'].'">освободить</a>]</div>';
  }


  echo '<div class="spis">Стр. ';
  if($p-2>0) echo '<a href="/admin/?m=bans&amp;section=unban&amp;p=1"><<</a> ';
  if($p-1>0) echo '<a href="/admin/?m=bans&amp;ection=unban&amp;p='.($p-1).'"><</a> ';

  if($p-3>0) echo '<a href="/admin/??m=bans&amp;section=unban&amp;p'.($p-3).'">'.($p-3).'</a> | ';
  if($p-2>0) echo '<a href="/admin/?m=bans&amp;section=unban&amp;p='.($p-2).'">'.($p-2).'</a> | ';  
  if($p-1>0) echo '<a href="/admin/?m=bans&amp;section=unban&amp;p='.($p-1).'">'.($p-1).'</a> | ';
  
  echo '<b>'.$p.'</b>';
  if($p+1<=$cp) echo ' | <a href="/admin/?m=bans&amp;section=unban&amp;p='.($p+1).'">'.($p+1).'</a>';
  if($p+2<=$cp) echo ' | <a href="/admin/?m=bans&amp;section=unban&amp;p='.($p+2).'">'.($p+2).'</a>';
  if($p+3<=$cp) echo ' | <a href="/admin/?m=bans&amp;section=unban&amp;p='.($p+3).'">'.($p+3).'</a>';

  if($p+1<=$cp) echo ' <a href="/admin/?m=bans&amp;section=unban&amp;p='.($p+1).'">></a>';
  if($p+2<=$cp) echo ' <a href="/admin/?m=bans&amp;section=unban&amp;p='.ceil($ca/$cop).'">>></a>';
  echo '</div>';

  break;
  case 'unban':

  $cop = $user['on_page'];
  $ca = mysql_result(mysql_query("SELECT COUNT(*) FROM `ban`"),0);
  $cp = ceil($ca/$cop);
  if(isset($_POST['p']) && is_numeric($_POST['p'])){
  $p = $_POST['p'];
  if($_POST['p']>$cp) $p = $cp;
  if($_POST['p']<1)$p = 1;
  }else{
  $p = 1;
  }
  $start = $p*$cop-$cop;


  if(isset($_GET['ok'])){
 $id = TextGuard($_GET['id']);
  $ok = TextGuard($_GET['ok']);
  $ban = mysql_fetch_array(mysql_query('select * from `ban` where `id` = "'.$id.'"'));
  if(empty($id) or !is_numeric($id) or $ban == 0){
  header('Location: /admin?m=bans&section=unban'); exit;
  }else{
  mysql_query("DELETE FROM `ban` WHERE `id` = '".$id."'");
  echo '<div class="post2">'.ustatus($ban['who']).' <a href="/us'.$ban['who'].'">'.uname($ban['who']).'</a> '.uaccess($ban['who']).' разбанен !</div>';
  }}

  
  $bans = mysql_query("SELECT * FROM `ban` ORDER BY `id` DESC LIMIT $start,$cop");
  while($_bans = mysql_fetch_assoc($bans)){
  echo '<div class="post1">'.ustatus($_bans['who']).' <a href="/us'.$_bans['who'].'">'.uname($_bans['who']).'</a> '.uaccess($_bans['who']).' забанен '.ustatus($_bans['ho']).' <a href="/us'.$_bans['ho'].'">'.uname($_bans['ho']).'</a> '.uaccess($_bans['ho']).' на <b>'.times2($_bans['end']-$_bans['time']).'</b> ('.times($_bans['time']).') [<a href="/admin?m=bans&amp;section=unban&amp;ok&amp;id='.$_bans['id'].'">освободить</a>]</div>';
  }


  echo '<div class="spis">Стр. ';
  if($p-2>0) echo '<a href="/admin/?m=bans&amp;section=unban&amp;p=1"><<</a> ';
  if($p-1>0) echo '<a href="/admin/?m=bans&amp;ection=unban&amp;p='.($p-1).'"><</a> ';

  if($p-3>0) echo '<a href="/admin/??m=bans&amp;section=unban&amp;p'.($p-3).'">'.($p-3).'</a> | ';
  if($p-2>0) echo '<a href="/admin/?m=bans&amp;section=unban&amp;p='.($p-2).'">'.($p-2).'</a> | ';  
  if($p-1>0) echo '<a href="/admin/?m=bans&amp;section=unban&amp;p='.($p-1).'">'.($p-1).'</a> | ';
  
  echo '<b>'.$p.'</b>';
  if($p+1<=$cp) echo ' | <a href="/admin/?m=bans&amp;section=unban&amp;p='.($p+1).'">'.($p+1).'</a>';
  if($p+2<=$cp) echo ' | <a href="/admin/?m=bans&amp;section=unban&amp;p='.($p+2).'">'.($p+2).'</a>';
  if($p+3<=$cp) echo ' | <a href="/admin/?m=bans&amp;section=unban&amp;p='.($p+3).'">'.($p+3).'</a>';

  if($p+1<=$cp) echo ' <a href="/admin/?m=bans&amp;section=unban&amp;p='.($p+1).'">></a>';
  if($p+2<=$cp) echo ' <a href="/admin/?m=bans&amp;section=unban&amp;p='.ceil($ca/$cop).'">>></a>';
  echo '</div>';


  break;
  }
  //////////////////////////////
   break;
 case 'banforum':
  switch($_GET['section']){
  default:

  echo '<div class="post2"><a href="/admin?m=banforum&amp;section=ban">Забанить</a></div>
  <div class="post1"><a href="/admin?m=banforum&amp;section=unban">Разбанить (<font color="red">'.mysql_result(mysql_query('select count(`id`) from `ban_forum` where `end` > "'.time().'"'),0).'</font>)</a></div>';
  break;
  case 'ban':

$type = isset($_POST['type'])?$_POST['type']:'';
$who = isset($_POST['who'])?$_POST['who']:'';
  if(isset($_POST['submit'])){
 
  if(empty($who)) $err[] = 'ID или ник осталось пустым';
  if(!empty($who)) if($type == 1 && !is_numeric($who)) $err[] = 'В ID разрешено вводить только цифры'; 

  if($type == 1){
  $users = mysql_fetch_array(mysql_query('select * from `user` where `id` = "'.$who.'"'));
  }else{
  $users = mysql_fetch_array(mysql_query('select * from `user` where `login` = "'.$who.'"'));
  }
  
  if(!empty($who)) if($users == 0) $err[] = 'Такого пользователя не существует';
  if($users['status'] > $user['status']) $err[] = 'Вы не можете забанить этого пользователя т.к его должность выше вашего';
  $bans = mysql_fetch_array(mysql_query('select * from `ban_forum` where `who` = "'.$users['id'].'"'));
  if($bans != 0) $err[] = 'Этот пользователь в бане,зайди <a href="/admin?m=bans&amp;section=unban">сюда</a> и разбанить,что-бы забанить снова';

  $why = isset($_POST['why'])?$_POST['why']:'';
$time_d = isset($_POST['time_d'])?$_POST['time_d']:'';
$time_h = isset($_POST['time_h'])?$_POST['time_h']:'';
$time_m = isset($_POST['time_m'])?$_POST['time_m']:'';


  if(empty($why)) $err[] = 'Причина осталось пустой';
 
  if(empty($time_d) or $time_d < 0) $time_d = 0;
  if(empty($time_h) or $time_h < 0) $time_h = 0;
  if($time_h > 24) $time_h = 24;
  if(empty($time_m) or $time_m < 0) $time_m = 0;
  if($time_m > 60) $time_m = 60;
  
  if($time_d+$time_h+$time_m == 0) $err[] = 'Вы не можете забанить на 0 часов, 0 минут, 0 секунд';
  
  if(!empty($time_d)) if(!is_numeric($time_d)) $err[] = 'Ошибка ввода времени бана';
  
  if(!$err){
  
  		mysql_query("INSERT INTO `ban_forum`(
			`who`,
			`why`,
			`time`,
      `end`,
      `ho`
			)VALUES(
			'".$users['id']."',
			'".$why."',
			'".time()."',
			'".(time()+((((60*60)*24)*$time_d)+((60*60)*$time_h)+(60*$time_m)))."',
			'".$user['id']."'
			)");
 $log = mysql_query("SELECT * FROM `adm_log` where `ho` = '".$id."' ORDER BY `id`");
mysql_query("INSERT INTO `adm_log`(
			`who`,
			`ho`,
			`text`,
      `time`
			)VALUES(
      '".$id."',
      '".$user['id']."',
      'Забанил пользователя на форуме [url=/us".$who['id']."]".uname($users['id'])."[/url] ".uaccess($users['id'])."',
      '".time()."'
			)");

  echo '<div class="msg">'.ustatus($users['id']).' <a href="/us'.$users['id'].'">'.uname($users['id']).'</a> '.uaccess($users['id']).' забанен в форуме на ';
  if($time_d > 0) echo '<b>'.$time_d.'</b> дней';
  if($time_h > 0) echo '<b>'.$time_h.'</b> часов';
  if($time_m > 0) echo '<b>'.$time_m.'</b> минут';

  echo '</div>';
  
  }else{
  echo '<div class="err">';
  foreach($err as $err_info){
  echo $err_info.'<br>';
  }
  echo '</div>';  
  }
  
  }
  
  echo '<div class="poste">
  <form action="" method="post">
  <ul>
  <li><select name="type">
  <option value="1">ID</option>
  <option value="2">Ник</option>
  </select>
  <input name="who"/><br><br></li>
  <li>Причина:<br><textarea name="why" style="width:98%;" rows="3"></textarea></li>
  <li>Время:<br><br><input name="time_d" size="2"/> дней <input name="time_h" size="2"/> часов [1-24] <input name="time_m" size="2"/> минут [1-60]<br><br></li>
  <li><input type="submit" value="Забанить" name="submit"/></ul>
  </form></div>';
  
  echo '<div class="tegi"><a href="/admin?m=banforum">Вернуться</a></div>';
  break;
  case 'unban':
  $id = TextGuard($_GET['id']);
  $cop = $user['on_page'];
  $ca = mysql_result(mysql_query("SELECT COUNT(*) FROM `ban_forum`"),0);
  $cp = ceil($ca/$cop);
  if(isset($_GET['p']) && is_numeric($_GET['p'])){
  $p = $_GET['p'];
  if($_GET['p']>$cp) $p = $cp;
  if($_GET['p']<1)$p = 1;
  }else{
  $p = 1;
  }
  $start = $p*$cop-$cop;

  $ok = isset($_POST['ok'])?$_POST['ok']:'';
$id = isset($_POST['id'])?$_POST['id']:'';

 if(isset($_GET['ok'])){
 $id = TextGuard($_GET['id']);
  $ok = TextGuard($_GET['ok']);
  $ban = mysql_fetch_array(mysql_query('select * from `ban_forum` where `id` = "'.$id.'"'));
  if(empty($id) or !is_numeric($id) or $ban == 0){
  header('Location: /admin?m=banforum&section=unban'); exit;
  }else{
  mysql_query("DELETE FROM `ban_forum` WHERE `id` = '".$id."'");
  echo '<div class="post2">'.ustatus($ban['who']).' <a href="/us'.$ban['who'].'">'.uname($ban['who']).'</a> '.uaccess($ban['who']).' разбанен !</div>';
}
}


  
  $bans = mysql_query("SELECT * FROM `ban_forum` ORDER BY `id` DESC LIMIT $start,$cop");
  while($bans2 = mysql_fetch_assoc($bans)){
  echo '<div class="post2">'.ustatus($bans2['who']).' <a href="/us'.$bans2['who'].'">'.uname($bans2['who']).'</a> '.uaccess($bans2['who']).' забанен '.ustatus($bans2['ho']).' <a href="/us'.$bans2['ho'].'">'.uname($bans2['ho']).'</a> '.uaccess($bans2['ho']).' на <b>'.times2($bans2['end']-$bans2['time']).'</b> ('.times($bans2['time']).') [<a href="/admin?m=banforum&amp;section=unban&amp;ok&amp;id='.$bans2['id'].'">освободить</a>]</div>';
  }

  echo '<div class="spis">Стр. ';
  if($p-2>0) echo '<a href="/admin/?m=bansf&amp;section=unban&amp;p=1"><<</a> ';
  if($p-1>0) echo '<a href="/admin/?m=bansf&amp;ection=unban&amp;p='.($p-1).'"><</a> ';

  if($p-3>0) echo '<a href="/admin/??m=bansf&amp;section=unban&amp;p'.($p-3).'">'.($p-3).'</a> | ';
  if($p-2>0) echo '<a href="/admin/?m=bansf&amp;section=unban&amp;p='.($p-2).'">'.($p-2).'</a> | ';  
  if($p-1>0) echo '<a href="/admin/?m=bansf&amp;section=unban&amp;p='.($p-1).'">'.($p-1).'</a> | ';
  
  echo '<b>'.$p.'</b>';
  if($p+1<=$cp) echo ' | <a href="/admin/?m=bansf&amp;section=unban&amp;p='.($p+1).'">'.($p+1).'</a>';
  if($p+2<=$cp) echo ' | <a href="/admin/?m=bansf&amp;section=unban&amp;p='.($p+2).'">'.($p+2).'</a>';
  if($p+3<=$cp) echo ' | <a href="/admin/?m=bansf&amp;section=unban&amp;p='.($p+3).'">'.($p+3).'</a>';

  if($p+1<=$cp) echo ' <a href="/admin/?m=bansf&amp;section=unban&amp;p='.($p+1).'">></a>';
  if($p+2<=$cp) echo ' <a href="/admin/?m=bansf&amp;section=unban&amp;p='.ceil($ca/$cop).'">>></a>';
  echo '</div>';


  break;
  }
  //////////////////////////////
  break;
  
  case 'reg':
  
 $ok1 = isset($_GET['ok1'])?$_GET['ok1']:'';
  if(isset($_GET['ok1'])){
  $id = TextGuard($_GET['id']);

  $reg = mysql_fetch_array(mysql_query('select * from `reg` where `id` = "'.$id.'"'));
  
  if(empty($id) or $reg == 0){
  header('Location: /admin?m=reg'); exit;
  }
  mysql_query("UPDATE `reg` SET `ok`='1',`ho`='".$user['id']."' WHERE `id`='".$id."' limit 1");
  header('Location: /admin?m=reg'); exit;
  }

 $ok2 = isset($_GET['ok2'])?$_GET['ok2']:'';
  if(isset($_GET['ok2'])){
 $id = TextGuard($_GET['id']);
  
  $reg = mysql_fetch_array(mysql_query('select * from `reg` where `id` = "'.$id.'"'));
  
  if(empty($id) or $reg == 0){
  header('Location: /admin?m=reg'); exit;
  }
  mysql_query("UPDATE `reg` SET `ok`='2',`ho`='".$user['id']."' WHERE `id`='".$id."' limit 1");
  header('Location: /admin?m=reg'); exit;
  }

  
  $cop = $user['on_page'];
  $ca = mysql_result(mysql_query("SELECT COUNT(*) FROM `reg` where `ok` = '0'"),0);
  $cp = ceil($ca/$cop);
  if(isset($_GET['p']) && is_numeric($_GET['p'])){
  $p = $_GET['p'];
  if($_GET['p']>$cp) $p = $cp;
  if($_GET['p']<1)$p = 1;
  }else{
  $p = 1;
  }
  $start = $p*$cop-$cop;
  
  if($ca == 0){ echo '<div class="msg" align="center"><b>Регистраций требующих подтверждения пока нет.</b></div>'; } else {
  $reg = mysql_query("SELECT * FROM `reg` where `ok` = '0' ORDER BY `id` DESC LIMIT $start,$cop");
  while($reg2 = mysql_fetch_assoc($reg)){
  echo '<div class="post1">';
  
  $reg2_user = mysql_fetch_array(mysql_query('select * from `user` where `id` = "'.$reg2['who'].'"'));
  
  $reg2_ip = mysql_result(mysql_query('select count(`id`) from `user` where `ip` = "'.$reg2_user['ip'].'" and `id` != "'.$reg2_user['id'].'"'),0);
  echo ustatus($reg2['who']).' <a href="/us'.$reg2['who'].'">'.uname($reg2['who']).'</a> (IP: '.$reg2_user['ip'].') [<a href="/admin?m=reg&ok1&amp;id='.$reg2['id'].'">подтвердить</a>] [<a href="/admin?m=reg&ok2&amp;id='.$reg2['id'].'">отклонить</a>]<br>';

  if($reg2_ip > 0){
  echo '<br>Найденные ники этого IP адреса:<br>';
  $regs = mysql_query("SELECT * FROM `user` where `ip` = '".$reg2_user['ip']."' and `id` != '".$reg2['who']."' ORDER BY `id` DESC");
  while($regs2 = mysql_fetch_assoc($regs)){
  echo ustatus($regs2['id']).' <a href="/us'.$regs2['id'].'">'.uname($regs2['id']).'</a> '.uaccess($regs2['id']).'<br>';
  }
  }  
  echo '</div>';
  }

  echo '<div class="spis">Стр. ';
  if($p-2>0) echo '<a href="/admin/?m=reg&amp;p=1"><<</a> ';
  if($p-1>0) echo '<a href="/admin/?m=reg&amp;p='.($p-1).'"><</a> ';

  if($p-3>0) echo '<a href="/admin/?m=reg&amp;p'.($p-3).'">'.($p-3).'</a> | ';
  if($p-2>0) echo '<a href="/admin/?m=reg&amp;p='.($p-2).'">'.($p-2).'</a> | ';  
  if($p-1>0) echo '<a href="/admin/?m=reg&amp;p='.($p-1).'">'.($p-1).'</a> | ';
  
  echo '<b>'.$p.'</b>';
  if($p+1<=$cp) echo ' | <a href="/admin/?m=reg&amp;p='.($p+1).'">'.($p+1).'</a>';
  if($p+2<=$cp) echo ' | <a href="/admin/?m=reg&amp;p='.($p+2).'">'.($p+2).'</a>';
  if($p+3<=$cp) echo ' | <a href="/admin/?m=reg&amp;p='.($p+3).'">'.($p+3).'</a>';

  if($p+1<=$cp) echo ' <a href="/admin/?m=reg&amp;p='.($p+1).'">></a>';
  if($p+2<=$cp) echo ' <a href="/admin/?m=reg&amp;p='.ceil($ca/$cop).'">>></a>';
  echo '</div>';
  }

  echo '<div class="tegi"><a href="/admin">Вернуться</a></div>';

  break;
  /////////////////////////////////////////////////////////////////////
  case 'users':

$type = isset($_POST['type'])?$_POST['type']:'';
$who = isset($_POST['who'])?$_POST['who']:'';

  if(isset($_POST['who'])){
  if(empty($who)) $err[] = 'ID или ник осталось пыстым';
  if(!empty($who)) if($type == 1 && !is_numeric($who)) $err[] = 'В ID разрешено вводить только цифры'; 
  if($type == 1){
  $users = mysql_fetch_array(mysql_query('select * from `user` where `id` = "'.$who.'"'));
  }else{
  $users = mysql_fetch_array(mysql_query('select * from `user` where `login` = "'.$who.'"'));
  }
  if($users['id'] == $user['id']) $err[] = 'Вы не можете изменять свои данные';
  if(!empty($who)) if($users == 0) $err[] = 'Такого пользователя не существует';
  if($users['status'] > $user['status']) $err[] = 'Вы не можете просматривать данные этого пользователя т.к ваша должность ниже';

  if($err){
  echo '<div class="err"><b>';
  foreach($err as $err_info){
  echo $err_info.'<br>';
  }
  echo '</b></div>';  
  }else{

  echo '
  <div class="post1">Пользователь '.ustatus($users['id']).' <a href="/us'.$users['id'].'">'.uname($users['id']).'</a> '.uaccess($users['id']).'</div>';

$status = isset($_POST['status'])?$_POST['status']:'';
$access = isset($_POST['access'])?$_POST['access']:'';
$jur = isset($_POST['jur'])?$_POST['jur']:'';
$cedof = isset($_POST['cedof'])?$_POST['cedof']:'';
$password = isset($_POST['password'])?$_POST['password']:'';
$rub = isset($_POST['rub'])?$_POST['rub']:'';
$wmid = isset($_POST['wmid'])?$_POST['wmid']:'';
$wmr = isset($_POST['wmr'])?$_POST['wmr']:'';
  if(isset($_POST['submit'])){
  
  if($access >= $user['status']) $err[] = 'Вы не можете назначить пользователю статус выше чем у вас';
  $rating = TextGuard($_POST['rating']);
  if(!is_numeric($rating)) $err[] = 'В рейтинге разрешено использовать только цифры';
  if(empty($rating)) $rating = 0;
  if($err){
  echo '<div class="err"><b>';
  foreach($err as $err_info){
  echo $err_info.'<br>';
}
  echo '</b></div>';  
  }else{
 
mysql_query("UPDATE `user` SET `status2`='".$status."',`status`='".$access."',`wmid`='".$wmid."',`wmr`='".$wmr."',`rub`='".$rub."',`rating`='".$rating."',`jur`='".$jur."',`cedof`='".$cedof."' WHERE `id`='".$who."' limit 1");
  echo '<div class="poste"><b>Сохранено!</b></div>';
  }
  }

  echo '
  <form action="/admin?m=users&amp;type='.$type.'&amp;who='.$who.'" method="post">
 

  <div class="poste">Статус: <input name="status" value="'.$users['status2'].'"/></div>
 <div class="poste">WMID: <input name="wmid" value="'.$users['wmid'].'"/></div>
 <div class="poste">Кошелёк: <input name="wmr" value="'.$users['wmr'].'"/></div>';
  echo ' <div class="poste"> Должность: <select name="access">';
echo '<option type="checked" value="0"'; if($users['status'] == 0) echo 'selected';  
echo '>Юзер</option>';
echo '<option type="checked" value="1"'; if($users['status'] == 1) echo 'selected';  
echo '>Модератор</option>';
echo '<option type="checked" value="2"'; if($users['status'] == 2) echo 'selected';  
echo '>Админ</option>';
echo '<option type="checked" value="3"'; if($users['status'] == 3) echo 'selected';  
echo '>Ст. Админ</option>';
echo '<option type="checked" value="4"'; if($users['status'] == 4) echo 'selected';  
echo '>Создатель</option>';
echo '</select></div>';

echo '<div class="poste">Журналист: <select name="jur">';
echo '<option type="checked" value="0"'; if($users['jur'] == 0) echo 'selected';  
echo '>Нет</option>';
echo '<option type="checked" value="1"'; if($users['jur'] == 1) echo 'selected';  
echo '>Да</option>';
 echo '</select></div>
<div class="poste">Арбитр: <select name="cedof">';
echo '<option type="checked" value="0"'; if($users['cedof'] == 0) echo 'selected';  
echo '>Нет</option>';
echo '<option type="checked" value="1"'; if($users['cedof'] == 1) echo 'selected';  
echo '>Да</option>';
  echo '</select></div>
  <div class="poste">Баласн: <input name="rub" value="'.$users['rub'].'"/></div>
  <div class="poste">Рейтинг: <input name="rating" size="3" value="'.$users['rating'].'"/>
  <input type="hidden" name="who" value="'.$who.'">
  <input type="hidden" name="type" value="'.$type.'">
  <input type="submit" value="Сохранить" name="submit"/>
  </form></div>';
  }
  }else{


  echo '
  <div class="mist">
  <form action="" method="post">
  <ul>
  <li><select name="type">
  <option value="1">ID</option>
  <option value="2">Ник</option>
  </select>
  <input name="who"/><br><br/>
  <li><input type="submit" value="Изменить"/></ul>
  </form></div>';
  }

  break;
  case 'rek':
///новая реклама
  if(isset($_POST['submit'])){
  $name = TextGuard($_POST['name']);
  $link = TextGuard($_POST['link']);
  $day = TextGuard($_POST['day']);
 $color = TextGuard($_POST['color']);
  mysql_query("INSERT INTO `ads`(`name`,`link`,`color`,`day`,`time`,`mode`,`who`)VALUES('".$name."','".$link."','".$color."','".$day."','".time()."','1','".$user['id']."')");
  echo '<div class="msg">Реклама успешно добавлена</div>';
  }
  ///del
   if(isset($_GET['dn'])){
  $ide = TextGuard($_GET['ide']);
  $id = mysql_fetch_array(mysql_query('select * from `ads` where `id` = "'.$ide.'"'));
  mysql_query("DELETE FROM `ads` WHERE `id`='".$ide."'");
  header('Location: /admin?m=rek'); exit;
  }
  ///подтверждение
   if(isset($_GET['pod'])){
  $idee = TextGuard($_GET['idee']);
  $id = mysql_fetch_array(mysql_query('select * from `ads` where `id` = "'.$idee.'"'));
  mysql_query("UPDATE `ads` SET `name`='".$id['name']."',`link`='".$id['link']."',`color`='".$id['color']."',`day`='".$id['day']."',`who`='".$id['who']."',`time`='".time()."',`mode`='1' WHERE `id`='".$idee."'");
  
  $a = $id['day'];
  $b = 5;
  $sum = $a*$b;
  mysql_query("UPDATE `user` SET `rub`=`rub` - '".$sum."' WHERE `id`='".$id['who']."'");
  
  header('Location: /admin?m=rek'); exit;
  }
  ///del
   if(isset($_GET['otk'])){
  $otkl = TextGuard($_GET['otkl']);
  $id = mysql_fetch_array(mysql_query('select * from `ads` where `id` = "'.$otkl.'"'));
  mysql_query("DELETE FROM `ads` WHERE `id`='".$otkl."'");
  header('Location: /admin?m=rek'); exit;
  }
  ///главная
  echo '<div class="post2">
  <form action="" method="post">
  Название рекламы:<br><input name="name"/></br>
  Ссылка рекламы, с http://:<br><input name="link"/></br>
  На сколько дней:</br><textarea name="day" style="width:10%;" rows="1"></textarea></br>
  <input type="submit" value="Добавить" name="submit"/>
  </form></div>';
  $rek = mysql_query("SELECT * FROM `ads` WHERE `mode` = '1'");
          while($rek2 = mysql_fetch_array($rek))
          {
          echo '<div class="post2"><img src="/images/r.png" alt="*"> <a href="'.$rek2['link'].'">'.$rek2['name'].'</a> Реклама заказана на '.$rek2['day'].' д.</br>
          Заказал : '.ustatus($rek2['who']).' <a href="/us'.$rek2['who'].'">'.uname($rek2['who']).'</a> '.uaccess($rek2['who']).' ('.times($rek2['time']).')
<br/>
Цвет ссылки: <font color="'.$rek2['color'].'">'.$rek2['color'].'</font>
           [<a href="/admin?m=rek&amp;dn&amp;ide='.$rek2['id'].'">уд</a>] </div>';
          }
          echo '<div class="tegi">Подтверждение рекламы</div>';
          $reka = mysql_query("SELECT * FROM `ads` WHERE `mode` = '0'");
          while($reka2 = mysql_fetch_array($reka))
          {
          echo '<div class="post2"><img src="/images/r.png" alt="*"> <a href="'.$reka2['link'].'">'.$reka2['name'].'</a><br/> Заказана на '.$reka2['day'].' д.</br>
          Заказал : '.ustatus($reka2['who']).' <a href="/us'.$reka2['who'].'">'.uname($reka2['who']).'</a> '.uaccess($reka2['who']).' ('.times($reka2['time']).')
<br/>
Цвет ссылки: <font color="'.$reka2['color'].'">'.$reka2['color'].'</font>
           </br>[<a href="/admin?m=rek&amp;pod&amp;idee='.$reka2['id'].'">подтвердить</a>]
           [<a href="/admin?m=rek&amp;otk&amp;otkl='.$reka2['id'].'">отклонить</a>] </div>';
          }
      
          break;
  case 'arbit':
  ///отклонение
     if(isset($_GET['otk'])){
  $otkl = TextGuard($_GET['otkl']);
  $id = mysql_fetch_array(mysql_query('select * from `arbitr` where `id` = "'.$otkl.'"'));
  mysql_query("DELETE FROM `arbitr` WHERE `id`='".$otkl."'");
  header('Location: /admin?m=arbit'); exit;
  }
    ///подтверждение
   if(isset($_GET['pod'])){
  $idd = TextGuard($_GET['idd']);
  $id = mysql_fetch_array(mysql_query('select * from `arbitr` where `id` = "'.$idd.'"'));
  mysql_query("UPDATE `arbitr` SET `text`='".$id['text']."',`ver`='".$id['ver']."',`who`='".$id['who']."',`ho`='".$id['ho']."',`time`='".time()."',`mode`='1' WHERE `id`='".$idd."'");
  header('Location: /admin?m=arbit'); exit;
  }
  
  $arbv = mysql_query("SELECT * FROM `arbitr` WHERE `mode` = '0'");
  while($arbv2 = mysql_fetch_assoc($arbv)){
  echo '<div class="post2">'.ustatus($arbv2['who']).' <a href="/us'.$arbv2['who'].'">'.uname($arbv2['who']).'</a> '.uaccess($arbv2['who']).' ('.times($arbv2['time']).')<br>
  За что: '.smiles(bbcode($arbv2['text'])).'</br>
  Кого: '.ustatus($arbv2['ho']).' <a href="/us'.$arbv2['ho'].'">'.uname($arbv2['ho']).'</a> '.uaccess($arbv2['ho']).' ';
  if($arbv2['ver'] == 1){
  echo '<font color="green"><b>[отзыв]</b></font>';
  }else{
  echo '<font color="red"><b>[прета]</b></font>';
  }
  echo '</br>[<a href="/admin?m=arbit&amp;pod&amp;idd='.$arbv2['id'].'">принять</a>]
           [<a href="/admin?m=arbit&amp;otk&amp;otkl='.$arbv2['id'].'">отклонить</a>]';
  ////////////////
  echo '</div>';
  }
    
  break;
  //////////////////////////////////////////////////////////////////////////////////////////
  case 'ne':
  ///del
     if(isset($_GET['otk'])){
  $otkl = TextGuard($_GET['otkl']);
  $id = mysql_fetch_array(mysql_query('select * from `ced` where `id` = "'.$otkl.'"'));
  mysql_query("DELETE FROM `ced` WHERE `id`='".$otkl."'");
  header('Location: /admin?m=ne'); exit;
  }
  
      ///подтверждение
   if(isset($_GET['pod'])){
  $idd = TextGuard($_GET['idd']);
  $login = TextGuard($_POST['login']);
  $login2 = TextGuard($_POST['login2']);
  $id = mysql_fetch_array(mysql_query('select * from `ced` where `id` = "'.$idd.'"'));
  mysql_query("UPDATE `ced` SET `mode`='1',`login`='".$id['login2']."' WHERE `id`='".$idd."'");
  header('Location: /admin?m=ne'); exit;
  }
  ///end
  $arbv = mysql_query("SELECT * FROM `ced` WHERE `mode` = '0'");
  while($arbv2 = mysql_fetch_assoc($arbv)){
  echo '<div class="post1">'.ustatus($arbv2['author']).' <a href="/us'.$arbv2['author'].'">'.uname($arbv2['author']).'</a> '.uaccess($arbv2['author']).' ('.times($arbv2['time']).')<br>
  Имя: '.smiles(bbcode($arbv2['name'])).'</br>
  Логин: '.ustatus($arbv2['login2']).' <a href="/us'.$arbv2['login2'].'">'.uname($arbv2['login2']).'</a> '.uaccess($arbv2['login2']).'</br> 
  Причина: '.smiles(bbcode($arbv2['text'])).'</br>
  Доп. Инфо.: '.smiles(bbcode($arbv2['din'])).'</br>
  WMID: '.smiles(bbcode($arbv2['wmid'])).'</br>';
  echo '[<a href="/admin?m=ne&amp;pod&amp;idd='.$arbv2['id'].'">принять</a>]
           [<a href="/admin?m=ne&amp;otk&amp;otkl='.$arbv2['id'].'">отклонить</a>]';
           echo '</div>';

           echo '</div>';
  }
  
  break;
  
  case 'wmid':
  
  $cop = 10;
  $ca = mysql_result(mysql_query("SELECT COUNT(*) FROM `wmr`"),0);
  $cp = ceil($ca/$cop);
  if(isset($_GET['p']) && is_numeric($_GET['p'])){
  $p = $_GET['p'];
  if($_GET['p']>$cp) $p = $cp;
  if($_GET['p']<1)$p = 1;
  }else{
  $p = 1;
  }
  $start = $p*$cop-$cop;
  
  ///подтверждение
  if(isset($_GET['pod'])){
  $id = TextGuard($_GET['id']);
  $idd = mysql_fetch_array(mysql_query('select * from `wmr` where `id` = "'.$id.'"'));
  mysql_query("UPDATE `user` SET `wmr`='".$idd['wmr']."',`wmid`='".$idd['wmid']."' WHERE `id`='".$idd['who']."'");
  mysql_query("DELETE FROM `wmr` WHERE `id`='".$id."'");
  
  mysql_query("INSERT INTO `op`(
			`who`,
			`ho`,
			`text`,
      `time`,
      `read`
			)VALUES(
      '".$idd['who']."',
      '".$user['id']."',
      'Ваши реквизиты успешно подтверждены.',
      '".time()."',
      '0'
			)");
  
  header('Location: /admin?m=wmid'); exit;
  }
  ///end
  
  ///отклонение
  if(isset($_GET['otk'])){
  $id = TextGuard($_GET['id']);
  mysql_query("DELETE FROM `wmr` WHERE `id`='".$id."'");
  header('Location: /admin?m=wmid'); exit;
  }
  ///end
  
  $rub = mysql_query("SELECT * FROM `wmr` ORDER BY `id` DESC LIMIT $start,$cop");
  while($rub2 = mysql_fetch_assoc($rub)){
  echo '<div class="post2">'.ustatus($rub2['who']).' <a href="/us'.$rub2['who'].'">'.uname($rub2['who']).'</a>
  '.uaccess($rub2['who']).' ('.times($rub2['time']).')<br>WMID: <b>'.$rub2['wmid'].'</b><br>
  WMR: <b>'.$rub2['wmr'].'</b><br>
  Примечание при переводе: <b>Подтверждение личности, Webmoney_'.$rub2['who'].'</b>';
  echo '<br>[<a href="/admin?m=wmid&amp;pod&amp;id='.$rub2['id'].'">подтвердить</a>]
  [<a href="/admin?m=wmid&amp;otk&amp;id='.$rub2['id'].'">отклонить</a>]</div>';
  }
  
  break;
  ////////////////////////////////////////////////////////////////////////////////////////////
  }

          include '../../system/footer.php';

?>