Underworld1337

Untitled

Aug 4th, 2016
35
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.21 KB | None | 0 0
  1. baeclass
  2.     public function get_all_uids(){
  3.       $b = array();
  4.       $sql = "SELECT COUNT(*) FROM users";
  5.       if($r = $this->con->query($sql)){
  6.         if($r->fetchColumn() > 0){
  7.           $sql = "SELECT id FROM users";
  8.           foreach($this->con->query($sql) as $u){
  9.             $b[] = $u['id'];
  10.           }
  11.         }
  12.       }
  13.       return $b;
  14.     }
  15.  
  16. acp.php
  17. elseif($_GET["sub"] == "allaccs"){
  18.   $ids = $base->get_all_uids();
  19. ?>
  20.     <div>
  21.       <div class="landing-section" id="features">
  22.         <div class="container">
  23.           <div class="row gutter30 landing-features">
  24.             <div class="col-sm-10">
  25.               <h3 class="features-title"><?php print_r($ids);?></h3>
  26.               <p class="features-text"><br>
  27. <?php
  28.   echo "<table width=\"80%\" border=\"2\">
  29.  <tr>
  30.  <th>id</th>
  31.  <th>Username</th>
  32.  <th>Email </th>
  33.  <th>InviteCode</th>
  34.  </tr>";
  35.  
  36.   foreach($ids as $id){
  37.     $user = new user($id);
  38.     $user->init();
  39.     echo "<tr>";
  40.     echo "<td>" . $id . "</td>";
  41.     echo "<td>" . $user->get_name() . "</td>";
  42.     echo "<td>" . $user->get_email() . "</td>";
  43.     echo "<td>add codes</td>";
  44.     echo "</tr>";
  45.   }
  46.  
  47.   echo "</table>";
  48. ?>
  49.             </div>
  50.           </div>
  51.         </div>
  52.       </div>
  53.     </div>
  54. <?php
  55. }
Add Comment
Please, Sign In to add comment