Просмотр файла modules/padmin/ban.php

Размер файла: 1.84Kb
  1. <?php
  2. /**********************************
  3. * @package: PerfCMS *
  4. * @year: 2012 *
  5. * @author: Artas *
  6. * @link: http://perfcms.pp.ua *
  7. **********************************/
  8. $locate = 'in_padmin';
  9. if(isset($user) && $user['level'] >= 5 && isset($_GET['user_id']) && $user['id'] != $_GET['user_id'] && $db->query("SELECT level FROM `users` WHERE `id` = '". $_GET['user_id'] ."'")->fetchColumn() != 7) {
  10. $title = $lang->word('to_ban');
  11. require_once(SYS.'/view/header.php');
  12. $tpl->div('title', $lang->word('to_ban').' '.tnick($_GET['user_id']));
  13. if(isset($_POST['ban']) && $_GET['act']== 'ban') {
  14. $ban_time = (time()+60*60*24*abs(intval($_POST['ban_time'])));
  15. $ban_text = input($_POST['ban_text']);
  16. $db->query("UPDATE `users` SET `ban_time` = '". $ban_time."', `ban_text` = '". $ban_text."' WHERE `id` = '".abs(intval($_GET['user_id'])) ."'");
  17. $tpl->div('menu', $lang->word('succ_save'));
  18. $tpl->div('block', img('nav.png') . '<a href="/user/'.abs(intval($_GET['user_id'])) .'/">'.$lang->word('back').'</a><br/>'. img('admin.png') .'<a href="/padmin/">'. $lang->word('padmin') .'</a><br/>'. HICO .'<a href="/">'. $lang->word('home') .'</a>');
  19. require_once(SYS.'/view/footer.php');
  20. exit;
  21. }
  22. echo '<div class="post">
  23. <form action="/padmin/ban/'.abs(intval($_GET['user_id'])) .'/?act=ban" method="post">
  24. <b>'. $lang->word('ban_time') .'</b>:<br/>
  25. <input type="text" size="3" maxlength="3" name="ban_time" value="1" /><br/>
  26. <b>'. $lang->word('ban_text') .'</b>:<br/>
  27. <textarea name="ban_text" rows="5" cols="26"></textarea><br/>
  28. <input type="submit" name="ban" value="'. $lang->word('to_ban') .'" /><br/>
  29. </form>
  30. </div>';
  31. $tpl->div('block', img('admin.png') .'<a href="/padmin/">'. $lang->word('padmin') .'</a><br/>'. HICO .'<a href="/">'. $lang->word('home') .'</a>');
  32. require_once(SYS.'/view/footer.php');
  33. } else { header('Location: /'); }
  34. ?>