<td colspan="10" align="center"><?php 
    echo __("No results for this filter.");
    ?>
</td>
                        </tr>
                    <?php 
}
?>
                </tbody>
                <tfoot>
                    <tr>
                        <td colspan="10">
                            <div class="pagination pagination-centered">
                                <?php 
use_helper("TablePagination");
tablePagination($pager, $url);
?>
                            </div>
                        </td>
                    </tr>
                </tfoot>
                <thead>
                    <tr>
                        <th><?php 
echo __("#ID");
?>
</th>
                        <th><?php 
echo __("Team 1");
?>
</th>
Example #2
0
function generateClansTable($userID, $clanID, $tableName, $enablePagination)
{
    if ($enablePagination) {
        $pagination = tablePagination("SELECT COUNT('id') FROM " . $tableName);
        $start = $pagination[0];
        $clansPerPage = $pagination[3];
    }
    if ($tableName == "clans") {
        $query = $enablePagination ? mysql_query("SELECT * FROM `clans` LIMIT {$start}, {$clansPerPage}") : mysql_query("SELECT * FROM `clans`");
        if ($query) {
            echo '<link rel="stylesheet" href="./css/clans.css" type="text/css">';
            echo '<br /><br /><br /><center><table width="98%" cellpadding="0" cellspacing="0" class="t">';
            echo '<tr><th>Clan Name</th><th>Clan Leader</th><th>Total Money</th><th>Total Experience</th><th>Members</th><th>Options</th></tr>';
            while ($clan = mysql_fetch_assoc($query)) {
                echo '<tr>';
                foreach ($clan as $key => $clanInfo) {
                    switch ($key) {
                        case "id":
                            //$clanStats = clanTotals($clanID);
                            $clanID = $clanInfo;
                            //$clanStats = clanTotals($clanID);
                            $joinClan = "http://www.pkmnplanet.net/rpg/joinclan.php?cid=" . $clanInfo;
                            $viewClan = "http://www.pkmnplanet.net/rpg/clanpage.php?cid=" . $clanInfo;
                            break;
                        case "clan_name":
                            echo '<td><center>' . $clanInfo . '</center></td>';
                            break;
                        case "clan_leader":
                            echo '<td><center>' . $clanInfo . '</center></td>';
                            break;
                        case "total_money":
                            echo '<td><center>' . $clanInfo . '</center></td>';
                            break;
                        case "total_exp":
                            echo '<td><center>' . $clanInfo . '</center></td>';
                            break;
                        case "total_members":
                            echo '<td><center>' . $clanInfo . '</center></td>';
                            break;
                        case "joinable":
                            echo '<td><br /><center><form method="post" action=' . $joinClan . ' style="display:inline; padding:5px"><input type="hidden" name="cid" value="' . $clanID . '"/><input type="submit" name="submit" value=" Join Clan "/></form>  ';
                            echo '<form method="get" action=' . $viewClan . ' style="display:inline; padding:5px"><input type="hidden" name="cid" value="' . $clanID . '"/><input type="submit" value=" View Clan "/></form></center><br /></td>';
                            break;
                    }
                }
                echo '</tr>';
            }
            echo '</table>';
            if ($enablePagination) {
                getPages($pagination[1], $pagination[2]);
            }
        }
        echo '</center><br />';
    } elseif ($tableName == "clan_members") {
        $query = $enablePagination ? mysql_query("SELECT * FROM `clans_members` LIMIT {$start}, {$clansPerPage}") : mysql_query("SELECT * FROM `clan_members` WHERE clan_id='{$clanID}'");
        if (mysql_num_rows($query)) {
            echo '<link rel="stylesheet" href="./css/clans.css" type="text/css">';
            echo '<br /><br /><br /><center><table width="98%" cellpadding="0" cellspacing="0" class="t">';
            echo '<tr><th>Members Name</th><th>Money</th><th>Experience</th><th>Options</th></tr>';
            while ($clan = mysql_fetch_assoc($query)) {
                echo '<tr>';
                foreach ($clan as $key => $clanInfo) {
                    switch ($key) {
                        case "clan_id":
                            //$clanStats = clanTotals($clanID);
                            $clanID = $clanInfo;
                            $admin = isAdmin($userID, $clanID);
                            $adminID = $admin[0];
                            $joinClan = "http://www.pkmnplanet.net/rpg/joinclan.php?cid=" . $clanInfo;
                            $viewClan = "http://www.pkmnplanet.net/rpg/clanpage.php?cid=" . $clanInfo;
                            break;
                        case "members_id":
                            $membersID = $clanInfo;
                            $viewUser = "******" . $membersID;
                            $battleUser = "******" . $membersID;
                            $removeUser = "******" . $membersID;
                            //$removeUser = "******".$membersID;
                            break;
                        case "members_name":
                            echo '<td><center>' . $clanInfo . '</center></td>';
                            break;
                        case "members_money":
                            echo '<td><center>' . $clanInfo . '</center></td>';
                            break;
                        case "members_exp":
                            echo '<td><center>' . $clanInfo . '</center></td>';
                            break;
                        case "options":
                            if ($admin[1]) {
                                echo '<td><br /><center><form method="post" action="' . $viewUser . '" style="display:inline; padding:5px"><input type="hidden" name="id" value="' . $membersID . '"/><input type="submit" name="submit" value=" View User "/></form>  ';
                                echo '<form method="post" action="' . $removeUser . '" style="display:inline; padding:5px"><input type="hidden" name="id" value="' . $membersID . '"/><input type="hidden" name="adminID" value="' . $adminID . '"/><input type="hidden" name="clanID" value="' . $clanID . '"/><input type="submit" value=" Remove User "/></form></center><br /></td>';
                                break;
                            } else {
                                echo '<td><br /><center><form method="post" action=' . $joinClan . ' style="display:inline; padding:5px"><input type="hidden" name="cid" value="' . $clanID . '"/><input type="submit" value=" Join Clan "/></form>  ';
                                echo '<form method="get" action="' . $viewClan . '" style="display:inline; padding:5px"><input type="submit" value=" View Clan "/></form></center><br /></td>';
                                break;
                            }
                        default:
                            break;
                    }
                }
                echo '</tr>';
            }
            echo '</table>';
            if ($enablePagination) {
                getPages($pagination[1], $pagination[2]);
            }
        }
        echo '</center><br />';
    }
}