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

Размер файла: 1.17Kb
  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($user['level'] == 2 || $user['level'] >= 6) {
  10. if(isset($_GET['post_id'])) {
  11. if(isset($_POST['yes'])) {
  12. $db->query("DELETE FROM `chat_p` WHERE `id` = '".abs(intval($_GET['post_id']))."'");
  13. header('Location: /chat/');
  14. } elseif(isset($_POST['no'])) {
  15. header('Location: /chat/');
  16. }
  17. $title = $lang->word('delete');
  18. require_once(SYS.'/view/header.php');
  19. $tpl->div('title', $lang->word('delete'));
  20. echo '<form action="/chat/del_post/?post_id='.abs(intval($_GET['post_id'])).'" method="post">
  21. <div class="menu">
  22. <b>'. $lang->word('r_sure') .'</b><br/>
  23. <input name="yes" type="submit" value="'. $lang->word('yyes') .'" /> <input name="no" type="submit" value="'. $lang->word('yno') .'" /><br/>
  24. </div>
  25. </form>';
  26. $tpl->div('block', NAV .'<a href="/chat/">'. $lang->word('chat') .'</a><br/>' . HICO .'<a href="/">'. $lang->word('home').'</a>');
  27. require_once(SYS.'/view/footer.php');
  28. } else { header('Location: /'); }
  29. } else { header('Location: /'); }
  30. ?>