Пример #1
0
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" id="useridfetchclose" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
        <h4 class="modal-title" id="myModalLabel">Search For User ID</h4>
      </div>
      <div class="modal-body">
          <input type="text" class="form-control" id="userlogin" placeholder="User Login"/>
      </div>
      <div class="modal-footer">
          <button type="button" class="btn btn-primary" onclick="get_user_id('#id')">Search</button>
      </div>
    </div>
  </div>
</div>

<?php 
global $baselocation;
$table = "users";
$cols = array('id' => 'User ID', 'login' => 'Username');
if ($_SESSION['admin_level'] == 1) {
    $cols['email'] = "Email";
}
$limit = 50;
$pagenum = 1;
if (isset($_GET['pagenum'])) {
    $pagenum = $_GET['pagenum'];
}
$usertable = new dbTable($table, $cols, $limit, $pagenum, $user_options = 1, '<a href="' . $baselocation . '/users/base.php?action=uoptions&id=.id.">User Options</a>');
$usertable->display_search($cols);
$usertable->display_table();
$usertable->pagination();
Пример #2
0
if (isset($_SESSION['searchparam'])) {
    global $db;
    $user_arr = $_SESSION['searchparam'];
    if (isset($user_arr['user_id'])) {
        echo '<table class="table table-bordered"><thead><tr><th>Total Points Gained</th><th>Total Points Used</th><th>Total Points in Account</th></tr><tbody><tr>';
        $userid = $user_arr['user_id'];
        $query = "SELECT sum(coins_gained) as sum_gained FROM statistics WHERE user_id={$userid}";
        if ($result = $db->query($query)) {
            if ($row = mysqli_fetch_assoc($result)) {
                echo '<td>' . $row['sum_gained'] . '</td>';
            }
        }
        $query = "SELECT sum(coins_deducted) as sum_deducted FROM statistics WHERE user_id={$userid}";
        if ($result = $db->query($query)) {
            if ($row = mysqli_fetch_assoc($result)) {
                echo '<td>' . $row['sum_deducted'] . '</td>';
            }
        }
        $query = "SELECT coins FROM users WHERE id={$userid}";
        if ($result = $db->query($query)) {
            if ($row = mysqli_fetch_assoc($result)) {
                echo '<td>' . $row['coins'] . '</td>';
            }
        }
        echo '</tbody></table>';
    }
}
$usertable = new dbTable($table, $cols, $limit, $pagenum, $user_options = 2);
$usertable->display_search(array('user_id' => 'User ID', 'date' => 'Date', 'coins_gained_greaterrange' => 'Points Gained >=', 'coins_deducted_greaterrange' => 'Points Deducted >='));
$usertable->display_table();
$usertable->pagination();