Lais Prad
Disgusting Scammer
- Joined
- Apr 12, 2017
- Messages
- 153
- Solutions
- 6
- Reaction score
- 15
Hello,
I'm trying to get the page to show only 40 players per page and have the option to switch to the next page and come back. (Next Page and Previous page)
I'm using gesior acc 2012 and tfs 1.3
Credits @nevix
I'm trying to get the page to show only 40 players per page and have the option to switch to the next page and come back. (Next Page and Previous page)
I'm using gesior acc 2012 and tfs 1.3
PHP:
<style type="text/css">
.tg {border-collapse:collapse;border-spacing:0;}
.tg td{font-family:Arial, sans-serif;font-size:14px;padding:-10px 50px;border-style:solid;border-width:1px;overflow:hidden;word-break:normal;}
.tg th{font-family:Arial, sans-serif;font-size:14px;font-weight:normal;padding:5px 15px;border-style:solid;border-width:1px;overflow:hidden;word-break:normal;}
</style>
<?PHP
$pageZ = 0;
if(isset($_REQUEST['page']))
$pageZ = min(50, $_REQUEST['page']);
$idas = mysql_escape_string($_GET['idas']);
if($idas == true AND $group_id_of_acc_logged >= $config['site']['access_admin_panel'])
{
echo'<font color=green> Player unbanned succesfull.</font>';
$SQL->query("DELETE FROM account_bans WHERE account_id = $idas");
}
///
$data = $SQL->query('SELECT `players_data`.`name`, `account_bans`.`account_id`, `account_bans`.`reason`, `account_bans`.`banned_at`, `account_bans`.`expires_at`, `account_bans`.`banned_by` FROM `account_bans` INNER JOIN (SELECT * FROM (SELECT `account_id`, `name` FROM `players` WHERE `players`.`account_id` IN (SELECT `account_id` FROM `account_bans`) ORDER BY `level` DESC) x GROUP BY `account_id`) players_data ON `account_bans`.`account_id` = `players_data`.`account_id`')->fetchAll();
echo ' <center><h1>Banned Players</h1>
<font color=red>- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -</font><br/><br/>
</center>
';
if($data == true){
echo ' <table class="tg">
<th class="tg-031e">Number.</th>
<th class="tg-031e"> Player </th>
<th class="tg-031e"> Reason </th>
<th class="tg-031e"> Expires </th>
<tr>
';
}else
{
echo '<font color=green>[#] Nothing banned at this moment.</font>';
}
foreach($data as $i => $ban)
{
if(!htmlspecialchars($ban['reason'])){
$ban['reason'] = "(None)";
}
$kada1 = $ban['expires_at'] - time();
$kada2 = date("i",$kada1);
$kada3 = date("s",$kada1);
$kada4 = $kada1/60/60;
$kada4 = current(explode(".", $kada4));
if($kada1 < 60)
{
$zodis = "<b>Expires in: $kada1 sec.</b>";
}
elseif($kada4 >= 1)
{
$zodis = "<b>Expires in: $kada4 h, $kada2 min.</b>";
}
elseif($kada2 >= 1)
{
$zodis = "<b>Expires in: $kada2 min, $kada3 sec.</b>";
}
if($group_id_of_acc_logged >= $config['site']['access_admin_panel'])
{
$extra = ' (<a href="?subtopic=banneds&idas=' . urlencode($ban['account_id']) . '">Unban</a>)';
}
echo '<td>' .($i+1) .'.'.$extra.'</td><td><center><a href="?subtopic=characters&name=' . urlencode($ban['name']) . '">' . htmlspecialchars($ban['name']) . '</a></center></td>
<td><center>' . htmlspecialchars($ban['reason']) . '</center><br /></td>
<td> ' . $zodis . ' </td><tr>';
}
if($pageZ > 0)
$main_content .= '<TR><TD WIDTH=100% ALIGN=right VALIGN=bottom><A HREF="?subtopic=banneds&page='.($pageZ - 1).'" CLASS="size_xxs">Previous Page</A></TD></TR>';
if($pageZ < 50)
$main_content .= '<TR><TD WIDTH=100% ALIGN=right VALIGN=bottom><A HREF="?subtopic=banneds&page='.($pageZ + 1).'" CLASS="size_xxs">Next Page</A></TD></TR>';
echo '</table>';
?>
Credits @nevix