Advertisement
Guest User

Untitled

a guest
May 27th, 2019
148
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.61 KB | None | 0 0
  1. <?php
  2. if(!isset($_SESSION['user'])) header('Location: ' . $_PAGE_URL . 'updates');
  3. if(!Config::getData("users","Admin",$_SESSION['user'])) header('Location: ' . $_PAGE_URL . 'profile');
  4. ?>
  5. <html>
  6. <head>
  7. <title>Admin panel - Fast-Game.Ro</title>
  8. </head>
  9. </html>
  10. <aside class="right-side">
  11. <section class="content-header">
  12. <h1>
  13. Admin panel
  14. </h1>
  15. <ol class="breadcrumb">
  16. <li><a href="#"><i class="fa fa-home"></i> Home</a></li>
  17. <li class="active">Admin panel</li>
  18. </ol>
  19. </section>
  20.  
  21.  
  22. <div class="col-md-12" style="padding: 20px 15px">
  23. <div class="box">
  24. <div class="box-body table-responsive">
  25. <div class="col-md-6" style="padding: 20px 15px">
  26. <div class="box-body box box-solid"><h4>Complaints</h4>
  27. <?php
  28. $q = Config::$g_con->prepare('SELECT * FROM `rpg_complaints` WHERE `Status` = 0');
  29. $q->execute();
  30. foreach(Config::$reclamatii as $id=>$reclamatii) $count[$id] = 0;
  31. while($row = $q->fetch(PDO::FETCH_OBJ)) {
  32. foreach(Config::$reclamatii as $id=>$reclamatii) {
  33. if($row->Category == $id) $count[$id]++;
  34. }
  35. }
  36. foreach(Config::$reclamatii as $id=>$reclamatii) {
  37. echo ''.$reclamatii.': <b>'.$count[$id].'</b><br>';
  38. }
  39. ?>
  40. </div>
  41. </div>
  42. <div class="col-md-6" style="padding: 20px 15px">
  43. <div class="box-body box box-solid"><h4>Tickets</h4>
  44. <?php
  45. echo 'General: '.Config::get_rows("rpg_tickets","Status",0).'<hr>';
  46. ?>
  47. </div>
  48. </div>
  49. <div class="clearfix"></div>
  50. </div><!-- /.box-body -->
  51. </div><!-- /.box -->
  52. </div><!-- /.col -->
  53. <div class="col-md-12" style="padding: 20px 15px;">
  54. <div class="box">
  55. <div class="box-body">
  56. <?php
  57. if(isset($_POST['r_up'])) {
  58. if(Config::getData("users","Admin",$_POST['r_up']) <= 6) {
  59. $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>';
  60. }
  61. }
  62. if(isset($_POST['r_down'])) {
  63. if(Config::getData("users","Admin",$_POST['r_down']) > 1)
  64. {
  65. $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>';
  66. }
  67. }
  68. if(isset($_POST['uninvite'])) {
  69. $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>';
  70. }
  71. ?>
  72. <div class="clearfix"></div><hr><h3>Manage admins</h3>
  73. <table class="table table-bordered table-striped">
  74. <tr>
  75. <th>Name</th>
  76. <th>Admin</th>
  77. <th>AW</th>
  78. <th>Last online</th>
  79. <th>Actions</th>
  80. </tr>
  81. <?php
  82. $q = Config::$g_con->prepare('SELECT * FROM `users` WHERE `Admin` > 0');
  83. $q->execute();
  84. while($row = $q->fetch(PDO::FETCH_OBJ))
  85. {
  86. echo '
  87. <tr>
  88. <td>'.Config::setName('users',$row->name).'</td>
  89. <td>'.$row->Admin.'</td>
  90. <td>'.$row->AW.'/3</td>
  91. <td>'.$row->lastOn.'</td>
  92. <td><form method="post">
  93. <button name="r_up" value="'.$row->id.'"><i class="fa fa-toggle-up"></i></button>
  94. <button name="r_down" value="'.$row->id.'"><i class="fa fa-toggle-down"></i></button>
  95. <button name="uninvite" value="'.$row->id.'"><i class="fa fa-ban"></i></button>
  96. </form></td>
  97. </tr>';
  98. }
  99. ?>
  100. </table>
  101. </div><!-- /.box-body -->
  102. </div><!-- /.box -->
  103. </div><!-- /.col -->
  104. </aside>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement