Advertisement
Guest User

Untitled

a guest
Mar 18th, 2016
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.74 KB | None | 0 0
  1. <html>
  2. <table style="width:100%">
  3. <tr>
  4. <th align="center">Admin ID</th>
  5. <th align="center">Admin name</th>
  6. <th align="center">Bans</th>
  7. <th align="center">Gags</th>
  8. <th align="center">Mutes</th>
  9. </tr>
  10.  
  11. <?php
  12. //error_reporting(0);
  13.  
  14. $dbhost = 'localhost';
  15. $dbuser = 'root';
  16. $dbpass = '';
  17. $dbdb = 'sourcebans';
  18. $conn = mysqli_connect($dbhost, $dbuser, $dbpass,$dbdb);
  19. if (mysqli_connect_errno())
  20. {
  21. echo "Failed to connect to MySQL: " . mysqli_connect_error();
  22. }
  23.  
  24.  
  25.  
  26. $gatherallq = "SELECT sb_comms.aid, sb_comms.type, sb_admins.aid, sb_admins.user
  27. FROM sb_comms
  28. INNER JOIN sb_admins ON sb_comms.aid = sb_admins.aid
  29. WHERE sb_comms.aid!='0'
  30. GROUP BY sb_admins.aid ASC";
  31.  
  32.  
  33.  
  34. $gatherall = mysqli_query($conn,$gatherallq);
  35.  
  36.  
  37.  
  38. while ($res = mysqli_fetch_array($gatherall)):
  39. $aid = $res['aid'];
  40. $name = $res['user'];
  41. $type = $res['type'];
  42.  
  43. $countmutes = mysqli_query($conn,"SELECT aid,type FROM sb_comms WHERE type='1' AND aid='$aid'");
  44. $mutestotal = mysqli_num_rows($countmutes);
  45.  
  46.  
  47. $countgags = mysqli_query($conn,"SELECT aid,type FROM sb_comms WHERE type='2' AND aid='$aid'");
  48. $gagstotal = mysqli_num_rows($countgags);
  49.  
  50. $joinbans2 = "SELECT sb_admins.aid, sb_admins.user, sb_bans.aid
  51. FROM sb_admins
  52. INNER JOIN sb_bans ON sb_admins.aid = sb_bans.aid
  53. WHERE sb_admins.aid='$aid'";
  54. $joinbans = mysqli_query($conn,$joinbans2);
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62. $banstotal = mysqli_num_rows($joinbans);
  63.  
  64.  
  65.  
  66.  
  67.  
  68. ?>
  69.  
  70. <tr>
  71. <th><?php echo $aid;?></th>
  72. <th><?php echo $name;?></th>
  73. <th><?php echo $banstotal;?></th>
  74. <th><?php echo $gagstotal;?></th>
  75. <th><?php echo $mutestotal;?></th>
  76. </tr>
  77.  
  78. <?php endwhile;?>
  79. </table>
  80.  
  81. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement