Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- if(!defined('RPG')) return;
- ?>
- <div class="col-md-13">
- <div class="card">
- <div class="card-body">
- <h4 class="card-title">All members from staff</h4>
- <!-- Nav tabs -->
- <div class="vtabs customvtab">
- <ul class="nav nav-tabs tabs-vertical" role="tablist">
- <li class="nav-item"> <a class="nav-link active" data-toggle="tab" href="#admins" role="tab"><span class="hidden-sm-up"><i class="ti-home"></i></span> <span class="hidden-xs-down">Admins</span> </a> </li>
- <li class="nav-item"> <a class="nav-link" data-toggle="tab" href="#helpers" role="tab"><span class="hidden-sm-up"><i class="ti-user"></i></span> <span class="hidden-xs-down">Helpers</span></a> </li>
- <li class="nav-item"> <a class="nav-link" data-toggle="tab" href="#leaders" role="tab"><span class="hidden-sm-up"><i class="ti-email"></i></span> <span class="hidden-xs-down">Leaders</span></a> </li>
- </ul>
- <!-- Tab panes -->
- <div class="tab-content">
- <div class="tab-pane p-20 active" id="admins" role="tabpanel">
- <div class = "table-responsive">
- <table class = "table" style = "color: white;">
- <?php
- $q = DB::prepare('SELECT * FROM `players` WHERE `AdminLevel` > 0 ORDER BY `AdminLevel` DESC');
- $q->execute();
- if(!$q->rowCount())
- {
- echo '<font color = "white">Nu sunt admini de afisat!</font>';
- }
- else
- {
- ?>
- <thead>
- <th>Avatar</th>
- <th>User name</th>
- <th>Admin level</th>
- <th>Status</th>
- <th>Last login</th>
- <?php if(User::isOwner(User::get())) { ?>
- <th>Action</th>
- <?php } ?>
- </thead>
- <tbody>
- <?php
- $a = DB::prepare('SELECT * FROM `players` WHERE `AdminLevel` > 0 AND `Status` = 1');
- $a->execute();
- echo '<font color = "white">'.$a->rowCount().'/'.$q->rowCount().' admins online</font>';
- while($row = $q->fetch(PDO::FETCH_OBJ))
- {
- ?>
- <tr>
- <td><img class = "nav-user-photo" src = "<?php echo Config::$data->url;?>assets/images/avatars/<?php echo User::getData($row->ID, "Skin");?>.png" alt = "user" /></td>
- <td><?php echo User::format($row->ID,$row->Name);?></td>
- <td><?php echo $row->AdminLevel;?></td>
- <td><span class = "label label-<?php echo ($row->Status == 0 ? "danger" : "success");?>"><?php echo ($row->Status ? 'Online' : 'Offline');?></span></td>
- <td><?php echo $row->LastLogin;?></td>
- <?php
- if(User::isOwner(User::get()) && User::get() != $row->ID && $row->Status == 0) { ?>
- <td><a class = "delete btn btn-danger" id="del_<?php echo $row->ID;?>">Delete</a></td>
- <?php } if(User::isOwner(User::get()) && User::get() == $row->ID) { ?>
- <td><i class = 'ti-close' title = 'Nu poti utiliza aceasta functie pe tine.' data-toggle = 'tooltip'></i></td>
- <?php } if($row->Status == 1 && $row->ID != User::get() && User::isOwner(User::get())) { ?>
- <td><i class = 'ti-close' title = 'Acest jucator este online' data-toggle = 'tooltip'></i></td>
- <?php } ?>
- </tr>
- <?php
- }
- ?>
- </tbody>
- <?php
- }
- ?>
- </table>
- </div>
- </div>
- <div class="tab-pane p-20" id="helpers" role="tabpanel">
- <div class = "table-responsive">
- <table class = "table" style = "color: white;">
- <?php
- $q = DB::prepare('SELECT * FROM `players` WHERE `HelperLevel` > 0 ORDER BY `HelperLevel` DESC');
- $q->execute();
- if(!$q->rowCount())
- {
- echo '<font color = "white">Nu sunt helperi de afisat!</font>';
- }
- else
- {
- ?>
- <thead>
- <th>Avatar</th>
- <th>User name</th>
- <th>Helper level</th>
- <th>Status</th>
- <th>Last login</th>
- <?php if(User::isOwner(User::get())) { ?>
- <th>Action</th>
- <?php } ?>
- </thead>
- <tbody>
- <?php
- $a = DB::prepare('SELECT * FROM `players` WHERE `HelperLevel` > 0 AND `Status` = 1');
- $a->execute();
- echo '<font color = "white">'.$a->rowCount().'/'.$q->rowCount().' helpers online</font>';
- while($row = $q->fetch(PDO::FETCH_OBJ))
- {
- ?>
- <tr>
- <td><img class = "nav-user-photo" src = "<?php echo Config::$data->url;?>assets/images/avatars/<?php echo User::getData($row->ID, "Skin");?>.png" alt = "user" /></td>
- <td><?php echo User::format($row->ID,$row->Name);?></td>
- <td><?php echo $row->HelperLevel;?></td>
- <td><span class = "label label-<?php echo ($row->Status == 0 ? "danger" : "success");?>"><?php echo ($row->Status ? 'Online' : 'Offline');?></span></td>
- <td><?php echo $row->LastLogin;?></td>
- <?php
- if(User::isOwner(User::get()) && User::get() != $row->ID && $row->Status == 0) { ?>
- <td><a class = "delete btn btn-danger" id="del_<?php echo $row->ID;?>">Delete</a></td>
- <?php } if(User::isOwner(User::get()) && User::get() == $row->ID) { ?>
- <td><i class = 'ti-close' title = 'Nu poti utiliza aceasta functie pe tine.' data-toggle = 'tooltip'></i></td>
- <?php } if($row->Status == 1 && $row->ID != User::get()) { ?>
- <td><i class = 'ti-close' title = 'Acest jucator este online' data-toggle = 'tooltip'></i></td>
- <?php } ?>
- </tr>
- <?php
- }
- ?>
- </tbody>
- <?php
- }
- ?>
- </tbody>
- </table>
- </div>
- </div>
- <div class="tab-pane p-20" id="leaders" role="tabpanel">
- <div class = "table-responsive">
- <table class = "table" style = "color: white; <?php echo (!User::isOwner(User::get()) ? '' : 'font-size: 13px');?>">
- <?php
- $q = DB::prepare('SELECT * FROM `players` WHERE `Leader` > 0 ORDER BY `Leader` ASC');
- $q->execute();
- if(!$q->rowCount())
- {
- echo '<font color = "white">Nu sunt lideri de afisat!</font>';
- }
- else
- {
- ?>
- <thead>
- <th>Avatar</th>
- <th>User name</th>
- <th>Faction</th>
- <th>Status</th>
- <th>Last login</th>
- <?php if(User::isOwner(User::get())) { ?>
- <th>Leader warn</th><th>Action</th>
- <?php } ?>
- </thead>
- <tbody>
- <?php
- $a = DB::prepare('SELECT * FROM `players` WHERE `Leader` > 0 AND `Status` = 1');
- $a->execute();
- echo '<font color = "white">'.$a->rowCount().'/'.$q->rowCount().' leaders online</font>';
- while($row = $q->fetch(PDO::FETCH_OBJ))
- {
- ?>
- <tr>
- <td><img class = "nav-user-photo" src = "<?php echo Config::$data->url;?>assets/images/avatars/<?php echo User::getData($row->ID, "Skin");?>.png" alt = "user" /></td>
- <td><?php echo User::format($row->ID,$row->Name);?></td>
- <td><?php echo Arrays::$_factions[$row->Leader];?></td>
- <td><span class = "label label-<?php echo ($row->Status == 0 ? "danger" : "success");?>"><?php echo ($row->Status ? 'Online' : 'Offline');?></span></td>
- <td><?php echo $row->LastLogin;?></td>
- <?php if(User::isOwner(User::get())) { ?>
- <td>
- <span class="warn-<?php echo $row->ID;?>"><?php echo $row->LWarns;?></span>/3
- <?php if($row->Status == 0) { ?>
- <a class="table-link danger lw" href="#" id="<?php echo $row->ID;?>" action="down">
- <span class="fa-stack">
- <i class="fa fa-square fa-stack-2x"></i>
- <i class="fa fa-arrow-down fa-stack-1x fa-inverse"></i>
- </span>
- </a>
- <a class="table-link lw" href="#" id="<?php echo $row->ID;?>" action="up">
- <span class="fa-stack">
- <i class="fa fa-square fa-stack-2x"></i>
- <i class="fa fa-arrow-up fa-stack-1x fa-inverse"></i>
- </span>
- </a>
- <?php } else { ?><i class = "ti-close" title = "Acest jucator este online" data-toggle = "tooltip"></i><?php } ?>
- </td>
- <td>
- <?php if($row->Status == 0) { ?>
- <button class = "delete_leader btn btn-danger" id="del_<?php echo $row->ID;?>">Delete</button>
- <?php } else { ?><i class = "ti-close" title = "Acest jucator este online" data-toggle = "tooltip"></i><?php } ?>
- </td>
- <?php } ?>
- </tr>
- <?php
- }
- ?>
- </tbody>
- <?php
- }
- ?>
- </table>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- <script src="<?php echo Config::$data->url; ?>assets/plugins/bootbox/bootbox.min.js"></script>
- <?php if(User::isOwner(User::get())) { ?>
- <script>
- $('.delete').click(function()
- {
- var el = this;
- var id = this.id;
- var splitid = id.split("_");
- var idd = splitid[1];
- // Confirm box
- bootbox.dialog(
- {
- title: '<font color = "white" style = "float: left;">Remove from Staff</font>',
- message: '<form style = "color: white;" id = "message_form" method = "post">Reason<br><input class = "form-control" style = "color: white;" type = "text" name = "reason" /></form>',
- buttons:
- {
- cancel:
- {
- className: 'btn btn-danger',
- label: 'Close'
- },
- success:
- {
- className: 'btn btn-warning',
- label: 'Ok',
- callback: function(b)
- {
- var a = $("#message_form");
- data = a.serialize();
- // AJAX Request
- $.ajax
- ({
- url: _PAGE_URL + 'action/removes',
- type: 'POST',
- data: { id: idd, data: data },
- success: function(response)
- {
- response = JSON.parse(response);
- $.gritter.add({
- title: response.title,
- text: response.text,
- class_name: "gritter-" + response.type + (!$("#gritter-light").get(0) ? " gritter-light" : "")
- });
- if(response.type === "success")
- {
- $(el).closest('tr').css('background','tomato');
- $(el).closest('tr').fadeOut(800, function(){
- $(this).remove();
- });
- }
- }
- });
- }
- }
- }
- });
- });
- $('.delete_leader').click(function()
- {
- var el = this;
- var id = this.id;
- var splitid = id.split("_");
- // Delete id
- var deleteid = splitid[1];
- // Confirm box
- bootbox.dialog(
- {
- title: '<font color = "white">Remove from leaders</font>',
- message: '<form style = "color: white;" id = "message_form" method = "post">Reason<br><input class = "form-control" style = "color: white;" type = "text" name = "reason" /><div class="form_group"><label class="control-label"> Faction punish</label><select class="form-control" style = "color: white;" name="fpunish" ><option>0</option><option>60</option></select></div></form>',
- buttons:
- {
- cancel:
- {
- className: 'btn btn-danger',
- label: 'Close'
- },
- success:
- {
- className: 'btn btn-warning',
- label: 'Ok',
- callback: function(b)
- {
- var a = $("#message_form");
- data = a.serialize();
- // AJAX Request
- $.ajax
- ({
- url: _PAGE_URL + 'action/remove',
- type: 'POST',
- data: { id: deleteid, data: data },
- success: function(response)
- {
- response = JSON.parse(response);
- $.gritter.add({
- title: response.title,
- text: response.text,
- class_name: "gritter-" + response.type + (!$("#gritter-light").get(0) ? " gritter-light" : "")
- });
- if(response.type === "success")
- {
- // Removing row from HTML Table
- $(el).closest('tr').css('background','tomato');
- $(el).closest('tr').fadeOut(800, function(){
- $(this).remove();
- });
- }
- }
- });
- }
- }
- }
- });
- });
- $('.lw').click(function()
- {
- var b = $(this).attr("id");
- var c = $(this).attr("action");
- bootbox.dialog(
- {
- title: '<font color = "white">Leader Warn</font>',
- message: '<form style = "color: white;" id = "message_form" method = "post">Reason<br><input class = "form-control" style = "color: white;" type = "text" name = "reason" /></form>',
- buttons:
- {
- cancel:
- {
- className: 'btn btn-danger',
- label: 'Close'
- },
- success:
- {
- className: 'btn btn-warning',
- label: 'Ok',
- callback: function(x)
- {
- var a = $("#message_form");
- data = a.serialize();
- $.ajax({
- url: _PAGE_URL + "action/lw",
- type: "POST",
- data: {
- id: b,
- data: data,
- action: c
- },
- success: function(d) {
- d = JSON.parse(d);
- $.gritter.add({
- title: d.title,
- text: d.text,
- class_name: "gritter-" + d.type + (!$("#gritter-light").get(0) ? " gritter-light" : "")
- });
- if(d.type === 'success') {
- if(c === 'down') $('.warn-' + b).html(parseInt($('.warn-' + b).text())-1);
- if(c === 'up') $('.warn-' + b).html(parseInt($('.warn-' + b).text())+1);
- }
- if(d.type === 'warning')
- {
- $('.remove-' + b).fadeOut(300, function(){
- $(this).remove();
- });
- }
- }
- });
- }
- }
- }
- })
- });
- </script>
- <?php } ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement