Advertisement
Guest User

Untitled

a guest
Mar 18th, 2016
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.71 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.        GROUP BY sb_admins.aid ASC";
  30.  
  31.  
  32.  
  33. $gatherall = mysqli_query($conn,$gatherallq);
  34.  
  35.  
  36.  
  37.     while ($res = mysqli_fetch_array($gatherall)):
  38.         $aid    = $res['aid'];
  39.         $name   = $res['user'];
  40.         $type   = $res['type'];
  41.  
  42. $countmutes = mysqli_query($conn,"SELECT aid,type FROM sb_comms WHERE type='1' AND aid='$aid'");
  43. $mutestotal = mysqli_num_rows($countmutes);
  44.  
  45.  
  46. $countgags = mysqli_query($conn,"SELECT aid,type FROM sb_comms WHERE type='2' AND aid='$aid'");
  47. $gagstotal = mysqli_num_rows($countgags);
  48.  
  49. $joinbans2 = "SELECT sb_admins.aid, sb_admins.user, sb_bans.aid
  50.        FROM sb_admins
  51.        INNER JOIN sb_bans ON sb_admins.aid = sb_bans.aid
  52.        WHERE sb_admins.aid='$aid'";
  53. $joinbans = mysqli_query($conn,$joinbans2);
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61. $banstotal = mysqli_num_rows($joinbans);
  62.  
  63.  
  64.  
  65.  
  66.  
  67. ?>
  68.  
  69.     <tr>
  70.         <th><?php echo $aid;?></th>
  71.         <th><?php echo $name;?></th>
  72.         <th><?php echo $banstotal;?></th>
  73.         <th><?php echo $gagstotal;?></th>
  74.         <th><?php echo $mutestotal;?></th>
  75.     </tr>
  76.  
  77. <?php endwhile;?>
  78. </table>
  79.  
  80. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement