Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php require_once 'engine/init.php'; include 'layout/overall/header.php';
- /*protect_page();
- admin_only($user_data);
- */
- if ($config['log_ip'])
- {
- znote_visitor_insert_detailed_data(4);
- }
- if(isset($_GET['action']) && isset($_GET['pid']))
- {
- $action = $_GET['action'];
- $pid = $_GET['pid'];
- switch ($action) {
- case 'clear_balance':
- mysql_update("UPDATE `players` SET `balance`= 0 WHERE `id`=". $pid .";");
- echo '<strong>The balance of player with ID = '. $pid . ' was set to zero.</strong><br>';
- echo '<br><a href="admin_bans.php">Back to the banned players</a>';
- return;
- break;
- case 'to_temple':
- mysql_update("UPDATE `players` SET `posx`= 0 WHERE `id`=". $pid .";");
- mysql_update("UPDATE `players` SET `posy`= 0 WHERE `id`=". $pid .";");
- mysql_update("UPDATE `players` SET `posz`= 0 WHERE `id`=". $pid .";");
- echo '<strong>The player with ID = '. $pid . ' was sent to his temple.</strong><br>';
- echo '<br><a href="admin_bans.php">Back to the banned players</a>';
- return;
- break;
- case 'clear_ban':
- mysql_delete("DELETE FROM `bans` WHERE `value`='". $pid ."' LIMIT 1;");
- echo '<strong>The ban of player with ID = '. $pid . ' was removed.</strong><br>';
- echo '<br><a href="admin_bans.php">Back to the banned players</a>';
- return;
- break;
- default:
- # code...
- break;
- }
- }
- $bans = 0;
- if(isset($_GET['name'])) {
- $bans = mysql_select_multi("SELECT `a`.`type`, `a`.`expires`, `a`.`statement`, `b`.`id`, `b`.`name`, `c`.`email`, `b`.`balance`, `c`.`name` AS `aac` FROM `bans` AS `a` INNER JOIN `players` AS `b` ON `a`.`value` = `b`.`id` INNER JOIN `accounts` AS `c` ON `b`.`account_id` = `c`.`id` WHERE `b`.`name` LIKE '%". $_GET['name'] ."%' ORDER BY `a`.`id` DESC LIMIT 30");
- }
- else {
- $bans = mysql_select_multi("SELECT `a`.`type`, `a`.`expires`, `a`.`statement`, `b`.`id`, `b`.`name`, `c`.`email`, `b`.`balance`, `c`.`name` AS `aac` FROM `bans` AS `a` INNER JOIN `players` AS `b` ON `a`.`value` = `b`.`id` INNER JOIN `accounts` AS `c` ON `b`.`account_id` = `c`.`id` ORDER BY `a`.`id` DESC LIMIT 30");
- }
- ?>
- <h1>Banned Players</h1>
- <form action="" method="get">
- Find players by name:<br>
- <?php if(isset($_GET['name'])) {?>
- <input type="text" name="name" value="<?php echo $_GET['name']; ?>">
- <?php } else { ?>
- <input type="text" name="name" value="">
- <?php } ?>
- <input type="submit" value="Search"/>
- </form>
- <?php
- if(!$bans) {
- ?>
- <p>There are no banned players at this time.</p>
- <?php } else { ?>
- <br>
- <?php if(isset($_GET['name'])) {?>
- <strong>Showing players with name like "<?php echo $_GET['name']; ?>".</strong>
- <?php } else { ?>
- <strong>Showing all the banned players.</strong>
- <?php } ?>
- <table class="table table-striped table-hover">
- <tr class="yellow">
- <th><strong>Character Name</strong></th>
- <th><strong>Account Name</strong></th>
- <th><strong>Email</strong></th>
- <th><strong>Balance </strong></th>
- <th><strong>Expires</strong></th>
- </tr>
- <?php foreach($bans as $ban) {
- echo '<tr><td>'.$ban['name'].'</td><td>'.$ban['aac'].'</td><td>'.$ban['email'].'</td><td>'.$ban['balance'].'</td><td>'.date("m-d-Y H:i", $ban['expires']).'</td></tr>';
- } ?>
- </table>
- <h1>Actions</h1>
- <table class="table table-striped table-hover">
- <tr class="yellow">
- <th><strong>Character Name</strong></th>
- <th><strong>Clear Balance Button</strong></th>
- <th><strong>Clear Player Ban Button</strong></th>
- <th><strong>To Temple Button</strong></th>
- </tr>
- <?php foreach($bans as $ban) {
- echo '<tr><td>'.$ban['name'].'</td>';
- echo '<td><a href="?action=clear_balance&pid='. $ban['id'] .'">Clear Balance</a></td>';
- echo '<td><a href="?action=clear_ban&pid='. $ban['id'] .'">Clear Ban</a></td>';
- echo '<td><a href="?action=to_temple&pid='. $ban['id'] .'">To Temple</a></td>';
- echo '</tr>';
- } ?>
- </table>
- <?php
- }
- include 'layout/overall/footer.php'; ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement