getvalues.php 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. <?php
  2. $currentusr = $_SESSION["username"];
  3. $isadminqry = mysqli_query($link, "select * from users where username='".$currentusr."'");
  4. while($row = mysqli_fetch_array($isadminqry)){
  5. $admin = $row['admin'];
  6. $userid = $row['id'];
  7. }
  8. if(isset($_GET['a'])){
  9. $place = $_GET['a'];
  10. }
  11. if(isset($_GET['asset'])){
  12. $asset = $_GET['asset'];
  13. }
  14. if(isset($_GET['do'])){
  15. $do = $_GET['do'];
  16. }
  17. if(isset($_GET['sched'])){
  18. $sched = $_GET['sched'];
  19. }
  20. if(isset($_GET['newscriptid'])){
  21. $newscriptid = $_GET['newscriptid'];
  22. }
  23. if(isset($_GET['script'])){
  24. $script = $_GET['script'];
  25. }
  26. if(isset($_GET['req'])){
  27. $req = trim($_GET['req']);
  28. }
  29. if(isset($_GET['acc'])){
  30. $acc = trim($_GET['acc']);
  31. }
  32. if(isset($_GET['clt'])){
  33. $cltid = trim($_GET['clt']);
  34. }
  35. if(isset($_GET['rep'])){
  36. $rep = trim($_GET['rep']);
  37. }
  38. if(isset($_GET['usr'])){
  39. $usr = trim($_GET['usr']);
  40. }
  41. if(isset($_GET['chk'])){
  42. $chk = trim($_GET['chk']);
  43. }
  44. if(isset($_GET['repid'])){
  45. $repportid = trim($_GET['repid']);
  46. }
  47. if(isset($_GET['searchstring'])){
  48. $searchstring = trim($_GET['searchstring']);
  49. }
  50. if(isset($_GET['dvctp'])){
  51. $dvctp = trim($_GET['dvctp']);
  52. }
  53. if(isset($_GET['stpdn'])){
  54. $stpdn = trim($_GET['stpdn']);
  55. }
  56. if(isset($_GET['repdn'])){
  57. $repdn = trim($_GET['repdn']);
  58. }
  59. if($place == "logout"){
  60. session_destroy();
  61. header("Refresh:0");
  62. exit;
  63. }
  64. if($_SERVER["REQUEST_METHOD"] == "POST"){
  65. require "place/postactions.php";
  66. }
  67. if(isset($place)){
  68. if($place == 'delscript'){
  69. $delscriptqry = "DELETE FROM scripts WHERE id = ?";
  70. if($stmt = mysqli_prepare($link, $delscriptqry)){
  71. mysqli_stmt_bind_param($stmt, "i", $script);
  72. if(mysqli_stmt_execute($stmt)){
  73. header("location: ?a=scripts");
  74. exit;
  75. }else{
  76. echo "Oops! Something went wrong. Please try again later.";
  77. }
  78. }
  79. }
  80. }
  81. require "place/theme.php";
  82. ?>