示例#1
0
function makeOrgsDropDown()
{
    $matches = findOrgsByMatch('', 100, 1);
    $count = $matches["count"];
    $total = $matches["total"];
    echo "<select name=\"orgid\">";
    for ($index = 0; $index < $count; $index += 1) {
        $form = $matches[$index];
        echo "<option value=\"{$form['id']}\">{$form['name']}</option>\n";
    }
    echo "</select>";
}
示例#2
0
      (<a href="editorg.php">Add</a>)
      </span></h3>
      <form method="post" action="findorg.php?limit=<?php 
echo $limit;
?>
">
        <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 = findOrgsByMatch($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';
示例#3
0
function makeOrgsTable($query, $limit, $showLimit, $page = 1)
{
    global $allTiers;
    $includeTier = count($allTiers) > 1;
    $matches = findOrgsByMatch($query, $limit, $page);
    $total = $matches["total"];
    $count = $matches["count"];
    if ($showLimit) {
        echo "<b>Total number of results:</b> {$total}";
        if ($total > $limit) {
            echo " (first {$limit} matches shown below; show ";
            echo "<a href=\"findorg.php?limit=10\">10</a>, ";
            echo "<a href=\"findorg.php?limit=20\">20</a>, ";
            echo "<a href=\"findorg.php?limit=50\">50</a>, ";
            echo "<a href=\"findorg.php?limit=100\">100</a>";
            echo ")";
        }
    }
    echo '<table cellpadding="0" cellspacing="0" class="alternate">';
    echo "<tr> \r\n\t<th>Date</th> \r\n\t<th>Organization</th> \r\n\t<th>Members</th> \r\n\t<th>Seats</th> \r\n\t<th>Status</th>";
    if ($includeTier) {
        echo "<th>Tier</th>";
    }
    for ($index = 0; $index < $count; $index += 1) {
        $form = $matches[$index];
        $used = findTotalAccountsInOrg($form['id']);
        $created = explode(" ", $form["created"]);
        $created = $created[0];
        echo "<tr>\r\n  \t<td>{$created}</td>\r\n  \t<td><a href=\"editorg.php?id={$form['id']}\">{$form['name']}</a></td>\r\n  \t<td>{$used}</td>\r\n  \t<td>{$form['seats']}</td>\r\n\t<td>{$form['status']}</td>";
        if ($includeTier) {
            echo "<td>{$form['tier']}</td>";
        }
    }
    echo "</table>";
    return $total;
}