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

Размер файла: 1.68Kb
  1. <?php
  2. /**********************************
  3. * @package: PerfCMS *
  4. * @year: 2012 *
  5. * @author: Artas *
  6. * @link: http://perfcms.ru *
  7. **********************************/
  8. $locate = 'in_share';
  9. if($user['level'] < '6' || !isset($_GET['rid'])) { go('/'); }
  10. if($db->query("SELECT * FROM `share` WHERE `id` = '". $_GET['rid'] ."'")->rowCount() == 0) {
  11. go('/share/');
  12. }
  13. if(isset($_POST['create']) && $_GET['act'] == 'create') {
  14. $name = substr(input($_POST['name']), 0, 45);
  15. $desc = substr(input($_POST['desc']), 0, 160);
  16. $db->query("INSERT INTO `share_c`(`name`, `rid`, `who_upload`, `desc`) VALUES('".$name."', '". abs(intval($_GET['rid']))."', '". abs(intval($_POST['who_upload']))."', '". $desc ."')");
  17. go('/share/'. ABS(INTVAL($_GET['rid'])));
  18. }
  19. $title = $lang->word('create_dir');
  20. require_once(SYS.'/view/header.php');
  21. $tpl->div('title', $lang->word('create_dir'));
  22. echo '<form action="/share/add_folder/'. abs(intval($_GET['rid'])) .'/?act=create" method="post">
  23. <div class="menu">
  24. <b>'. $lang->word('name') .'</b>:<br/>
  25. <input name="name" type="text" /><br/>
  26. <b>'. $lang->word('desc') .'</b>:<br/>
  27. <input name="desc" type="text" /><br/>
  28. <b>'.$lang->word('who_upload').'</b>:<br/>
  29. <select name="who_upload">
  30. <option value="1">'.$lang->word('administration').'</option>
  31. <option value="2">'.$lang->word('alls').' '.$lang->word('regs').'</option>
  32. </select><br/>
  33. <input name="create" type="submit" value="'. $lang->word('create') .'" /><br/>
  34. </div>
  35. </form>';
  36. $tpl->div('block', NAV .'<a href="/share/">'. $lang->word('share') .'</a><br/>' . HICO .'<a href="/">'. $lang->word('home').'</a>');
  37. require_once(SYS.'/view/footer.php');
  38. ?>