Просмотр файла modules/share/delete_folder.php

Размер файла: 1.63Kb
  1. <?php
  2. /**********************************
  3. * @package: PerfCMS *
  4. * @year: 2012 *
  5. * @author: Artas *
  6. * @link: http://perfcms.pp.ua *
  7. **********************************/
  8. $locate = 'in_share';
  9. if($user['level'] == 4 || $user['level'] >= 6) {
  10. if(isset($_GET['rid'])) {
  11. if(isset($_POST['yes'])) {
  12. $cid = abs(intval($_GET['cid']));
  13. $db->query("DELETE FROM `share_c` WHERE `id` = '". abs(intval($_GET['cid'])) ."'");
  14. $dfiles_q = $db->query("SELECT * FROM `share_files` WHERE `cat_id` = '".abs(intval($cid))."'");
  15. while($dfiles = $dfiles_q->fetch()) {
  16. unlink(ROOT .'/files/share/'.$dfiles['path_name']);
  17. }
  18. $fid = $db->query("SELECT id FROM `share_files` WHERE `cat_id` = '". abs(intval($cid)) ."'")->fetchColumn();
  19. $db->query("DELETE FROM `share_comms` WHERE `file_id` = '". abs(intval($fid)) ."'");
  20. $db->query("DELETE FROM `share_files` WHERE `cat_id` = '". abs(intval($cid)) ."'");
  21. go('/share/');
  22. } elseif(isset($_POST['no'])) {
  23. go('/share/');
  24. }
  25. $title = $lang->word('delete');
  26. require_once(SYS.'/view/header.php');
  27. $tpl->div('title', $lang->word('delete'));
  28. echo '<form action="/share/delete_folder/'.abs(intval($_GET['cid'])).'/'.abs(intval($_GET['rid'])).'/" method="post">
  29. <div class="menu">
  30. <b>'. $lang->word('r_sure') .'</b><br/>
  31. <input name="yes" type="submit" value="'. $lang->word('yyes') .'" /> <input name="no" type="submit" value="'. $lang->word('yno') .'" /><br/>
  32. </div>
  33. </form>';
  34. $tpl->div('block', NAV .'<a href="/share/">'. $lang->word('share') .'</a><br/>' . HICO .'<a href="/">'. $lang->word('home').'</a>');
  35. require_once(SYS.'/view/footer.php');
  36. } else { go('/'); }
  37. } else { go('/'); }
  38. ?>