Advertisement
mack29446

Untitled

Sep 22nd, 2019
428
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.67 KB | None | 0 0
  1. <head>
  2. <link rel="stylesheet" href="index.css">
  3. <link rel="stylesheet" href="/mackstrucks/animate.css">
  4. <script src="https://cdn.jsdelivr.net/npm/sweetalert2@8"></script>
  5. <script src="sweetalert2.all.min.js"></script>
  6. <!-- Optional: include a polyfill for ES6 Promises for IE11 and Android browser -->
  7. <script src="https://cdn.jsdelivr.net/npm/promise-polyfill"></script>
  8. </head>
  9.  
  10. <body>
  11. <h1>Mack's Trucks Admin User Manager</h1>
  12. <p> User List</p>
  13. </body>
  14.  
  15. <?php
  16.  
  17. session_start();
  18. echo "developer statistics:";
  19. echo "<br>";
  20. echo "driver", $_SESSION['driver'], "admin", $_SESSION['admin'];
  21. echo "<br>";
  22. echo $_SESSION['ID'];
  23. $user = 0;
  24. $surname = 0;
  25. $newpass = 0;
  26. $_POST['usercreate'] = null;
  27. $_POST['surnamecreate'] = null;
  28. if($_SESSION['admin'] == 0){
  29. echo "piss off";
  30.  
  31. echo "
  32. </script>
  33. </body>";
  34. echo "<script type='text/javascript'>
  35. <!--
  36. window.location = '/mackstrucks/login'
  37. //-->
  38. </script>";
  39. $_SESSION['crap'] = "1";
  40. }
  41. else{
  42. echo "good";
  43. }
  44. $host="localhost";
  45. $user="root";
  46. $password="";
  47. $db="mackstrucks";
  48. $sql=mysqli_connect($host,$user,$password);
  49. mysqli_select_db($sql,$db);
  50. $request="select * from users";
  51. $result=mysqli_query($sql,$request);
  52. $rows=mysqli_num_rows($result);
  53. echo $rows;
  54.  
  55.  
  56.  
  57. ?>
  58.  
  59. <div style="float:left; width:37.5%">
  60. <h2>User List</h2>
  61. <table style="width:95%">
  62. <tr>
  63. <td>ID</td>
  64. <td>User</td>
  65. <td>Surname</td>
  66. </tr>
  67. <?php
  68. for( $i = 0; $i<$rows; $i++ ) {
  69. $request="select * from users LIMIT $i,1";
  70. $result=mysqli_query($sql,$request);
  71. $row=mysqli_fetch_assoc($result);
  72. //echo $row['User'];
  73. $oofergang = "<?php deleteUser('".$password."') ?> ";
  74. echo "<tr><td>", $row['ID'], "</td><td>", $row['User'], "</td><td>", $row['Surname'], "</td> </tr>";
  75. }
  76. if(isset($_POST['usercreate'])){
  77. $user = 0;
  78. $surname = 0;
  79. $newpass = 0;
  80. $user=$_POST['usercreate'];
  81. $surname=$_POST['surnamecreate'];
  82. $newpass = rand(1111,9999);
  83. $request="INSERT INTO users (User, Pass, Surname) VALUES
  84. ('".$user."', '".$newpass."', '".$surname."')";
  85. $result=mysqli_query($sql,$request);
  86. }
  87. if(isset($_POST['iddelete'])){
  88. $ID=$_POST['iddelete'];
  89. $request="DELETE FROM Users WHERE ID='".$ID."'";
  90. $_SESSION['ID'] = $ID;
  91. $result=mysqli_query($sql,$request);
  92. }
  93. ?>
  94.  
  95. </table>
  96. </div>
  97. <div style="float:right; height:100px; width:25%">
  98. <h2>Quick Links</h2>
  99. <p class="animated infinite pulse"><a href=/mackstrucks/developers.html><b> Developers </b></a></p>
  100. <?php if($_SESSION['admin'] = "1"){ echo "<p class='animated infinite pulse'><a href=/mackstrucks/panel/><b> Panel </b></a></p>";}?>
  101. </div>
  102. <div style="float:right; width:37.5%">
  103. <h2>Delete User</h2>
  104. <form method="POST">
  105. <div class="imgcontainer">
  106. <!--<img src="login.png" alt="Avatar" class="avatar">-->
  107. <img width=95% src="https://www.gannett-cdn.com/presto/2019/09/10/PAPP/7b0128a4-97eb-4946-b21c-0ae4c10d8a65-20171019_PEPPAPIG_HighRes_0471.jpg?crop=885,664,x57,y0&width=640">
  108. </div>
  109.  
  110. <div class="container">
  111. <p>ID</p>
  112. <input type="text" placeholder="Enter ID" name="iddelete" required>
  113.  
  114. <button type="submit">Delete</button>
  115. </div>
  116. </form>
  117. <h2>Make User</h2>
  118. <form method="POST">
  119. <div class="imgcontainer">
  120. <!--<img src="login.png" alt="Avatar" class="avatar">-->
  121. <img width=95% src="https://i.ytimg.com/vi/FamXkqlwbXg/maxresdefault.jpg">
  122. </div>
  123.  
  124. <div class="container">
  125. <p>ID</p>
  126. <input type="text" placeholder="Enter Username" name="usercreate" required>
  127. <input type="text" placeholder="Enter Surname" name="surnamecreate" required>
  128.  
  129. <button type="submit">Create</button>
  130. </div>
  131. </form>
  132. </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement