Guest User

Untitled

a guest
Jun 14th, 2018
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.24 KB | None | 0 0
  1. <?php
  2. switch($_GET['sector'])
  3. {
  4. case "1":
  5. $sector = "generalinformation";
  6. break;
  7. case "2":
  8. $sector = "education";
  9. break;
  10. case "3":
  11. $sector = "exhibitions";
  12. break;
  13. case "4":
  14. $sector = "contactus";
  15. break;
  16. }
  17.  
  18. $pQuery = $Db->select($sector, $_GET['view']);
  19. if(@mysql_num_rows($pQuery) == 1)
  20. {
  21. $page = $Db->fetch_assoc($pQuery);
  22. echo "".stripslashes($page['body_txtbox'])."";
  23. if(!empty($page['attachment_file']) || !empty($page['attachment2_file']) || !empty($page['attachment3_file']) || !empty($page['attachment4_file']) || !empty($page['attachment5_file']))
  24. {
  25. $arr = array("", "2", "3", "4", "5");
  26. echo "<br style=\"margin-bottom: 10px;\"><p id=\"attach\">Downloadable Files:<br style=\"margin-bottom: 10px;\">";
  27. foreach($arr AS $a)
  28. {
  29. $uQuery = $Db->select("uploads", $page['attachment'.$a.'_file']);
  30. if(mysql_num_rows($uQuery) == 1 && !empty($page['attachment'.$a.'_file']))
  31. {
  32. $upload = $Db->fetch_assoc($uQuery);
  33. echo "<a href=\"uploads/".$upload['folder']."/".$upload['file']."\">".stripslashes($upload['file'])." (".file_size(filesize("uploads/".$upload['folder']."/".$upload['file'])).")</a><br />\n";
  34. }
  35. }
  36. echo "</p>\n";
  37. }
  38. }
  39. else
  40. {
  41. include("views/404.php");
  42. }
  43. ?>
Add Comment
Please, Sign In to add comment