Просмотр файла modules/chat/add_room.php

Размер файла: 1.24Kb
  1. <?php
  2. /**********************************
  3. * @package: PerfCMS *
  4. * @year: 2012 *
  5. * @author: Artas *
  6. * @link: http://perfcms.pp.ua *
  7. **********************************/
  8. $locate = 'in_chat';
  9. if(!isset($user) || $user['level'] < '6') { header('Location: /'); }
  10. $title = $lang->word('add_room');
  11. require_once(SYS.'/view/header.php');
  12. $tpl->div('title', $lang->word('add_room'));
  13. if(isset($_POST['create']) && $_GET['act'] == 'create') {
  14. $name = substr(input($_POST['name']), 0, 25);
  15. $db->query("INSERT INTO `chat`(`name`) VALUES('".$name."')");
  16. $tpl->div('menu', $lang->word('succ_add'));
  17. $tpl->div('block', img('chat.png') .'<a href="/padmin/">'. $lang->word('chat') .'</a><br/>'. HICO .'<a href="/">'. $lang->word('home') .'</a>');
  18. require_once(SYS.'/view/footer.php');
  19. exit;
  20. }
  21. echo '<form action="/chat/add_room/?act=create" method="post">
  22. <div class="menu">
  23. <b>'. $lang->word('name') .'</b>:<br/>
  24. <input name="name" type="text" /><br/>
  25. <input name="create" type="submit" value="'. $lang->word('create') .'" /><br/>
  26. </div>
  27. </form>';
  28. $tpl->div('block', NAV .'<a href="/chat/">'. $lang->word('chat') .'</a><br/>' . HICO .'<a href="/">'. $lang->word('home').'</a>');
  29. require_once(SYS.'/view/footer.php');
  30. ?>