示例#1
0
        (<a href="edituser.php">Add</a>, <a href="importUsersForm.php">Import</a>)
      </span> </h3>
      <form method="post" action="finduser.php?limit=<?php 
echo $limit;
?>
" class="search">
        <input name="search" value="<?php 
echo $query;
?>
" type="text" class="text">
        <input value="Search" type="submit" class="search">
      </form>
    </div>
    <div class="pagination">
    <?php 
$matches = findUsersByMatch($query, $limit, $page);
$count = $matches["count"];
$total = $matches["total"];
$nPages = ceil($total / $limit);
?>
      <p class="showing">Showing <?php 
echo min($page * $limit, $total);
?>
 of <?php 
echo $total;
?>
</p>
      <select name="" onChange="location = this.options[this.selectedIndex].value">
        <option <?php 
if ($limit == 10) {
    echo 'selected';
示例#2
0
function makeUsersTable($query, $limit, $showLimit, $page = 1)
{
    $matches = findUsersByMatch($query, $limit, $page);
    $count = $matches["count"];
    $total = $matches["total"];
    if ($showLimit) {
        echo "<b>Total number of results:</b> {$total}";
        if ($total > $limit) {
            echo " (first {$limit} matches shown below; show ";
            echo "<a href=\"finduser.php?limit=10\">10</a>, ";
            echo "<a href=\"finduser.php?limit=20\">20</a>, ";
            echo "<a href=\"finduser.php?limit=50\">50</a>, ";
            echo "<a href=\"finduser.php?limit=100\">100</a>";
            echo ")";
        }
    }
    echo '<table cellpadding="0" cellspacing="0" class="alternate">';
    echo "<tr> <th>Date</th> <th>User ID</th> <th>First</th> <th>Last</th> <th>Company</th> </tr>";
    for ($index = 0; $index < $count; $index += 1) {
        $form = $matches[$index];
        $created = explode(" ", $form["created"]);
        $created = $created[0];
        $sfdc = $form["sfdc"];
        echo "<tr>\r\n  \t<td>{$created}</td>\r\n  \t<td><a href=\"edituser.php?id={$form['id']}\">{$form['name']}</a></td>\r\n  \t<td>{$form['firstName']}</td>\r\n  \t<td>{$form['lastName']}</td>\r\n  \t<td>{$form['company']}</td>";
    }
    echo "</table>";
    return $total;
}