Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <head>
- <style type="text/css">
- A:link {text-decoration: none}
- A:visited {text-decoration: none}
- A:active {text-decoration: none}
- A:hover {text-decoration: none; color: red;}
- </style>
- </head>
- <body>
- <?php
- $todaysdate = time();
- $link = mysql_connect("ip", "host", "readonly"); // We secured with read only premissions
- if (!$link)
- {
- die('Could not connect: ' . mysql_error());
- }
- mysql_select_db("bans");
- $result = mysql_query("SELECT * FROM bans");
- if (!$result)
- {
- $message = 'Invalid query: ' . mysql_error() . "\n";
- $message .= 'Whole query: ' . $result;
- die($message);
- }
- print "<center><table width='500' border='0'>
- <tr>
- <td><b>Name</b></td>
- <td><b>SteamID</b></td>
- <td><b>Time</b></td>
- <td ><b>Reason</b></td>
- <td><b>Admin</b></td><tr>";
- while($row = mysql_fetch_array($result, MYSQL_ASSOC))
- {
- $row['cid'] = 'http://steamcommunity.com/profiles/' . $row['cid'];
- if ($row['time'] == 0)
- {
- $row['time'] = "Permanent";
- }
- elseif ($row['time'] > $todaysdate)
- {
- $timeleft = $row['time'] - $todaysdate;
- $Minutes = floor($timeLeft / 60);
- $Seconds = $timeLeft - ($Minutes * 60);
- $Hours = floor($Minutes / 60);
- $Minutes = $Minutes - ($Hours * 60);
- $Days = floor($Hours / 24);
- $Hours = $Hours - ($Days * 24);
- if ($Days >= 1)
- {
- $row['time'] = $Days + 1 . " days";
- if ($Days == 0)
- {
- $row['time'] = $Days + 1 . " days " . $Hours + 1 . " hours";
- }
- elseif (($Hours == 0) && ($Days == 0))
- {
- $row['time'] = $Days + 1 . " days " . $Minutes + 1 . " minutes";
- }
- else
- {
- $row['time'] = $Days + 1 . " days " . $Seconds + 1 . " seconds.";
- }
- }
- elseif ($Days == 0)
- {
- $row['time'] = $Hours + 1 . " hours";
- if (($Hours == 0) && ($Days == 0))
- {
- $row['time'] = $Hours + 1 . " hours " . $Minutes + 1 . " minutes";
- }
- else
- {
- $row['time'] = $Hours + 1 . " hours " . $Seconds + 1 . " seconds.";
- }
- }
- elseif (($Hours == 0) && ($Days == 0))
- {
- $row['time'] = $Minutes + 1 . " minutes";
- if ($Seconds >= 1)
- {
- $row['time'] = $Minutes + 1 . " minutes " . $Seconds + 1 . " seconds";
- }
- }
- else
- {
- $row['time'] = $Seconds + 1 . " seconds.";
- }
- }
- elseif ($row['time'] < $todaysdate && $row['time'] != 0)
- {
- $row['time'] = "Unbanned";
- }
- echo"
- <tr>
- <td><a href={$row['cid']}>{$row['name']}</a></td>
- <td>{$row['steamid']}</td>
- <td>{$row['time']}</td>
- <td>{$row['reason']}</td>
- <td>{$row['admin']}</td>
- </tr>
- ";
- }
- print "</table>";
- ?>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement