Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- if(!isset($_SESSION['user'])) header('Location: ' . $_PAGE_URL . 'updates');
- if(!Config::getData("users","Admin",$_SESSION['user'])) header('Location: ' . $_PAGE_URL . 'profile');
- ?>
- <html>
- <head>
- <title>Admin panel - Fast-Game.Ro</title>
- </head>
- </html>
- <aside class="right-side">
- <section class="content-header">
- <h1>
- Admin panel
- </h1>
- <ol class="breadcrumb">
- <li><a href="#"><i class="fa fa-home"></i> Home</a></li>
- <li class="active">Admin panel</li>
- </ol>
- </section>
- <div class="col-md-12" style="padding: 20px 15px">
- <div class="box">
- <div class="box-body table-responsive">
- <div class="col-md-6" style="padding: 20px 15px">
- <div class="box-body box box-solid"><h4>Complaints</h4>
- <?php
- $q = Config::$g_con->prepare('SELECT * FROM `rpg_complaints` WHERE `Status` = 0');
- $q->execute();
- foreach(Config::$reclamatii as $id=>$reclamatii) $count[$id] = 0;
- while($row = $q->fetch(PDO::FETCH_OBJ)) {
- foreach(Config::$reclamatii as $id=>$reclamatii) {
- if($row->Category == $id) $count[$id]++;
- }
- }
- foreach(Config::$reclamatii as $id=>$reclamatii) {
- echo ''.$reclamatii.': <b>'.$count[$id].'</b><br>';
- }
- ?>
- </div>
- </div>
- <div class="col-md-6" style="padding: 20px 15px">
- <div class="box-body box box-solid"><h4>Tickets</h4>
- <?php
- echo 'General: '.Config::get_rows("rpg_tickets","Status",0).'<hr>';
- ?>
- </div>
- </div>
- <div class="clearfix"></div>
- </div><!-- /.box-body -->
- </div><!-- /.box -->
- </div><!-- /.col -->
- <div class="col-md-12" style="padding: 20px 15px;">
- <div class="box">
- <div class="box-body">
- <?php
- if(isset($_POST['r_up'])) {
- if(Config::getData("users","Admin",$_POST['r_up']) <= 6) {
- $dd = Config::$g_con->prepare('UPDATE `users` SET `Admin` = `Admin`+1 WHERE `id` = ?'); $dd->execute(array($_POST['r_up'])); echo '<center>'.Config::getData("users","name",$_POST['r_up']).' a primit Admin up!</center>';
- }
- }
- if(isset($_POST['r_down'])) {
- if(Config::getData("users","Admin",$_POST['r_down']) > 1)
- {
- $dd = Config::$g_con->prepare('UPDATE `users` SET `Admin` = `Admin`-1 WHERE `id` = ?'); $dd->execute(array($_POST['r_down'])); echo '<center>'.Config::getData("users","name",$_POST['r_down']).' a primit Admin down!</center>';
- }
- }
- if(isset($_POST['uninvite'])) {
- $dd = Config::$g_con->prepare('UPDATE `users` SET `Admin` = 0 WHERE `id` = ?'); $dd->execute(array($_POST['uninvite'])); echo '<center>'.Config::getData("users","name",$_POST['uninvite']).' a primit uninvite!</center>';
- }
- ?>
- <div class="clearfix"></div><hr><h3>Manage admins</h3>
- <table class="table table-bordered table-striped">
- <tr>
- <th>Name</th>
- <th>Admin</th>
- <th>AW</th>
- <th>Last online</th>
- <th>Actions</th>
- </tr>
- <?php
- $q = Config::$g_con->prepare('SELECT * FROM `users` WHERE `Admin` > 0');
- $q->execute();
- while($row = $q->fetch(PDO::FETCH_OBJ))
- {
- echo '
- <tr>
- <td>'.Config::setName('users',$row->name).'</td>
- <td>'.$row->Admin.'</td>
- <td>'.$row->AW.'/3</td>
- <td>'.$row->lastOn.'</td>
- <td><form method="post">
- <button name="r_up" value="'.$row->id.'"><i class="fa fa-toggle-up"></i></button>
- <button name="r_down" value="'.$row->id.'"><i class="fa fa-toggle-down"></i></button>
- <button name="uninvite" value="'.$row->id.'"><i class="fa fa-ban"></i></button>
- </form></td>
- </tr>';
- }
- ?>
- </table>
- </div><!-- /.box-body -->
- </div><!-- /.box -->
- </div><!-- /.col -->
- </aside>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement