| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124 |
- <script type="text/javascript" src="js/modules/show_users.js"></script>
- <style type="text/css">
- tr.hide{
- display: none;
- }
- table.userListTable{
- border-collapse: collapse;
- border: 0px;
- }
- table.userListTable td{
- padding-left: 5px;
- }
- tr.subusersShowHide{cursor: pointer;}
- th.subuserColumn{
- width: 140px;
- }
- td.actions{
- cursor: default;
- }
- </style>
- <?php
- /*
- *
- * OGP - Open Game Panel
- * Copyright (C) Copyright (C) 2008 - 2013 The OGP Development Team
- *
- * http://www.opengamepanel.org/
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- */
- function exec_ogp_module() {
- global $db, $loggedInUserInfo;
-
- $page_user = isset($_GET['page']) ? $_GET['page'] : 1;
- $limit_user = isset($_GET['limit']) ? $_GET['limit'] : 10;
-
- if(hasValue($loggedInUserInfo) && is_array($loggedInUserInfo) && $loggedInUserInfo["users_page_limit"]){
- $limit_user = $loggedInUserInfo["users_page_limit"];
- }
-
- echo '<h2>'.get_lang('users')."</h2>";
- echo "<p><a href='?m=user_admin&p=add'>".get_lang('add_new_user')."</a></p>";
- echo '<table class="userListTable center" style="width: 100%;">';
- echo '<tr><th>'.get_lang('actions')."</th><th>".get_lang('username')."</th>";
- echo "<th>".get_lang('user_role')."</th>";
- echo "<th>".get_lang('email_address')."</th>";
- echo "<th>".get_lang('expires')."</th>";
- echo "<th class='subuserColumn'>".get_lang('subusers')."</th></tr>";
- $result = $db->getUserList_limit($page_user,$limit_user);
- $i = 0;
- foreach ( $result as $row )
- {
- // Show user's parent
- $ownedBy = "";
- if(!is_null($row['users_parent'])){
- $ownedBy = $row['users_parent'];
- }
- $user_expires = read_expire($row['user_expires']);
- print "<tr class='tr".($i++%2)." ";
- print $row['users_role'] . " ";
- if(!empty($ownedBy)){
- print "hide";
- }else{
- print "subusersShowHide";
- }
- print "' uid='" . $row['user_id'] . "'";
- if(!empty($ownedBy)){
- print "ownedby='" . $ownedBy . "'";
- }
- print ">";
- print "<td class='actions'><a href='?m=user_games&p=assign&user_id=$row[user_id]'>[".
- get_lang('assign_homes')."]</a><br />
- <a href='?m=user_admin&p=del&user_id=$row[user_id]'>[".get_lang('delete')."]</a><br />
- <a href='?m=user_admin&p=edit_user&user_id=$row[user_id]'>[".get_lang('edit_profile')."]</a></td>
- <td>".htmlentities($row['users_login'])."</td><td>".htmlentities($row['users_role'])."</td>
- <td>".htmlentities($row['users_email'])."</td>
- <td>$user_expires</td>";
- if(!empty($ownedBy)){
- print "<td></td>";
- }else{
- print "<td class='subUserShowHideTextTd expand' showtext='" . get_lang('show_subusers') . "' hidetext='" . get_lang('hide_subusers') . "'>" . get_lang('show_subusers') . " ↓</td>";
- }
- print "</tr>";
- }
- echo '</table><br>';
-
- $count_users = $db->get_user_count();
- if($count_users > $limit_user)
- {
- $total_pages = $count_users[0]['total'] / $limit_user;
- $pagination = "";
- for($page=1; $page <= $total_pages+1; $page++)
- {
- if($page == $page_user){
- $pagination .= " <b>$page</b>,";
- }else{
- if(isset($limit_user)){
- $limits = $limit_user;
- $pagination .= "<a href='?m=user_admin&page=$page&limit=$limits'>$page</a>,";
- }else{
- $pagination .= " <a href='?m=user_admin&page=$page' >$page</a>,";
- }
- }
- }
- echo rtrim($pagination, ",");
- }
- }
- ?>
|