Example #1
0
    LEFT JOIN ip_log AS ipl ON ipl.user_id = u.id
    LEFT JOIN countries AS co ON co.id = u.country_id
    ' . ($search_for ? 'WHERE u.team_name LIKE :search_for_team_name OR u.email LIKE :search_for_email' : '') . (verifySA() ? '' : 'WHERE u.instanceID =' . $_SESSION["IID"]) . '
    GROUP BY u.id
    ORDER BY u.team_name ASC
    LIMIT ' . $from . ', ' . $results_per_page, $values);
pager(CONFIG_SITE_ADMIN_URL . 'list_users/', count($users), $results_per_page, $from);
foreach ($users as $user) {
    echo '
    <tr>
        <td>
            <a href="', CONFIG_SITE_URL, 'user?id=', htmlspecialchars($user['id']), '">', htmlspecialchars($user['team_name']), '</a>
        </td>
        <td><a href="', CONFIG_SITE_ADMIN_URL, 'new_email.php?to=', htmlspecialchars($user['email']), '">', htmlspecialchars($user['email']), '</a></td>
        <td>', date_time($user['added']), '</td>
        <td>', user_class_name($user['class']), '</td>
        <td>', $user['enabled'] ? 'Yes' : 'No', '</td>
        <td><a href="', CONFIG_SITE_ADMIN_URL, 'list_ip_log.php?id=', htmlspecialchars($user['id']), '">', number_format($user['num_ips']), '</a></td>
        <td>
            <a href="', CONFIG_SITE_ADMIN_URL, 'edit_user.php?id=', htmlspecialchars($user['id']), '" class="btn btn-xs btn-primary">Edit</a>
        </td>
    </tr>
    ';
}
echo '
      </tbody>
    </table>
     ';
form_start(CONFIG_SITE_ADMIN_RELPATH . 'actions/export_csv');
form_hidden('action', 'export');
form_button_submit('Export to CSV', 'danger');
Example #2
0
function user_class_select($selected = null)
{
    $options = array(array('val' => CONST_USER_CLASS_USER, 'opt' => user_class_name(CONST_USER_CLASS_USER)), array('val' => CONST_USER_CLASS_MODERATOR, 'opt' => user_class_name(CONST_USER_CLASS_MODERATOR)));
    form_select($options, 'Min user class', 'val', $selected, 'opt');
}
head('Dynamic pages');
menu_management();
section_head('Dynamic pages', button_link('New page', 'new_dynamic_page'), false);
$pages = db_select_all('dynamic_pages', array('id', 'title', 'visibility', 'min_user_class'), null, 'title ASC');
echo '
    <table id="dynamic_pages" class="table table-striped table-hover">
      <thead>
        <tr>
          <th>Title</th>
          <th>visibility</th>
          <th>Min user class</th>
          <th>Manage</th>
        </tr>
      </thead>
      <tbody>
    ';
foreach ($pages as $item) {
    echo '
    <tr>
        <td>', htmlspecialchars($item['title']), '</td>
        <td>', visibility_enum_to_name($item['visibility']), '</td>
        <td>', user_class_name($item['min_user_class']), '</td>
        <td><a href="' . CONFIG_SITE_ADMIN_URL . 'edit_dynamic_page?id=', $item['id'], '" class="btn btn-xs btn-primary">Edit</a></td>
    </tr>
    ';
}
echo '
      </tbody>
    </table>
     ';
foot();
Example #4
0
    ' . ($search_for ? 'WHERE u.team_name LIKE :search_for_team_name OR u.email LIKE :search_for_email' : '') . '
    GROUP BY u.id
    ORDER BY u.team_name ASC
    LIMIT ' . $from . ', ' . $results_per_page, $values);
$total_results = isset($total_results) ? $total_results : count($users);
$base_url = CONFIG_SITE_ADMIN_URL . 'list_users' . (isset($_GET['search_for']) ? '?search_for=' . $_GET['search_for'] : '');
pager($base_url, $total_results, $results_per_page, $from);
foreach ($users as $user) {
    echo '
    <tr>
        <td>
            ', country_flag_link($user['country_name'], $user['country_code']), '
            <a href="', CONFIG_SITE_URL, 'user?id=', htmlspecialchars($user['id']), '">', htmlspecialchars($user['team_name']), '</a>
        </td>
        <td><a href="', CONFIG_SITE_ADMIN_URL, 'new_email.php?to=', htmlspecialchars($user['email']), '">', htmlspecialchars($user['email']), '</a></td>
        <td>', date_time($user['added']), '</td>
        <td>', $user['last_active'] ? date_time($user['last_active']) : '<i>Never</i>', '</td>
        <td class="center">', user_class_name($user['class']), '</td>
        <td class="center">', $user['enabled'] ? '<span class="glyphicon glyphicon-ok"></span>' : '<span class="glyphicon glyphicon-remove red"></span>', '</td>
        <td class="center"><a href="', CONFIG_SITE_ADMIN_URL, 'list_ip_log.php?id=', htmlspecialchars($user['id']), '">', number_format($user['num_ips']), '</a></td>
        <td class="center">
            <a href="', CONFIG_SITE_ADMIN_URL, 'edit_user.php?id=', htmlspecialchars($user['id']), '" class="btn btn-xs btn-primary">Edit</a>
        </td>
    </tr>
    ';
}
echo '
      </tbody>
    </table>
     ';
foot();