| | |
| | | } |
| | | $server_id = $_SESSION['server_id']; |
| | | |
| | | // 设置默认数据,开界面默认查选中服 |
| | | $_POST["eventType"] = "PlayerList"; |
| | | \CommFunc\QueryEventData($user, $retInfo); |
| | | |
| | | $dataArray = array(); |
| | | $TotalCount = 0; |
| | | $ShowCount = 0; |
| | | if (isset($retInfo) && array_key_exists($server_id, $retInfo) && $retInfo[$server_id]["OK"] == 1) { |
| | | $dataArray = $retInfo[$server_id]["Data"]; |
| | | $TotalCount = $retInfo[$server_id]["TotalCount"]; |
| | | $ShowCount = count($dataArray); |
| | | $isSpecialAccount = False; |
| | | \CommFunc\GetConfig("ServerInfo", "SpecialAccountList", $SpecialAccountList); |
| | | $SpecialAccountList = explode(",", $SpecialAccountList); |
| | | // 特殊账号,只能看本服 |
| | | if (in_array($UserAccount, $SpecialAccountList)) { |
| | | $isSpecialAccount = True; |
| | | } |
| | | |
| | | $onlyServerID = "on"; |
| | | if (array_key_exists("submit", $_POST)) { |
| | | $onlyServerID = $_POST["onlyServerID"]; |
| | | } |
| | | |
| | | $find = array("Channel" => $spid); |
| | | if ($onlyServerID == 'on' || $isSpecialAccount) { |
| | | $serversCfg = $user->GetServersCfg($spid); |
| | | if (array_key_exists($server_id, $serversCfg)) { |
| | | $find["ServerID"] = intval($serversCfg[$server_id]["ServerID"]); |
| | | } |
| | | } |
| | | |
| | | $limit = 100; |
| | | if (array_key_exists("limit", $_POST) && intval($_POST["limit"]) > 0) { |
| | | $limit = intval($_POST["limit"]); |
| | | } |
| | | |
| | | $TotalCount = \DBOper\Count("ServerRoles", $find); |
| | | \DBOper\Find("ServerRoles", $find, $dataArray, null, array("LV" => -1), $limit); |
| | | $ShowCount = count($dataArray); |
| | | |
| | | // echo "_POST:", print_r($dataArray, true), "<br/>"; |
| | | |
| | | //显示表格字段配置 key-参数名,value-说明 |
| | |
| | | "Num" => array(\Lang\gettext("编号"), "3%", "center"), |
| | | "AccID" => array(\Lang\gettext("账号"), "10%", "center"), |
| | | "PlayerName" => array(\Lang\gettext("玩家名"), "10%", "center"), |
| | | "PlayerID" => array(\Lang\gettext("PlayerID"), "6%", "center"), |
| | | "LV" => array(\Lang\gettext("等级"), "3%", "center"), |
| | | "PlayerID" => array(\Lang\gettext("PlayerID"), "3%", "center"), |
| | | "LV" => array(\Lang\gettext("等级"), "2%", "center"), |
| | | "CreateRoleTime" => array(\Lang\gettext("创角时间"), "7%", "center"), |
| | | "ChangeCoinPointTotal" => array(\Lang\gettext("Coin"), "5%", "center"), |
| | | "VIPLv" => array(\Lang\gettext("VIPLv"), "2%", "center"), |
| | | "LoginTime" => array(\Lang\gettext("最近登录"), "7%", "center"), |
| | | // "ChangeCoinPointTotal" => array(\Lang\gettext("Coin"), "5%", "center"), |
| | | "TreeLV" => array(\Lang\gettext("祝福树"), "2%", "center"), |
| | | "ReamlLV" => array(\Lang\gettext("官职"), "2%", "center"), |
| | | "ClientVersion" => array(\Lang\gettext("ClientVersion"), "10%", "center"), |
| | | ); |
| | | |
| | |
| | | <center> |
| | | <p><b><?php echo \Lang\gettext("玩家列表"); ?></b></P> |
| | | </center> |
| | | <?php echo "玩家总数: " . $TotalCount . " 返回玩家总数: " . $ShowCount; ?> |
| | | <hr /> |
| | | <table width="100%"> |
| | | <form method="post"> |
| | | 前x名: <input type="number" name="limit" id="limit" value="<?php echo $limit ?>" min="1" /> |
| | | <?php |
| | | if ($dataArray) { |
| | | echo "<thead><tr>"; |
| | | foreach ($tableArray as $value) { |
| | | echo "<th width=\"" . $value[1] . "\">" . $value[0] . "</td>"; |
| | | } |
| | | echo "</tr></thead>"; |
| | | } else { |
| | | echo \Lang\gettext("暂无数据"), "<br/>"; |
| | | } |
| | | |
| | | $Num = $skip; |
| | | foreach ($dataArray as $info) { |
| | | $Num += 1; |
| | | echo "<tr class='trc'>"; |
| | | foreach ($tableArray as $key => $value) { |
| | | if (!$key) { |
| | | continue; |
| | | } |
| | | $tdContent = $info[$key]; |
| | | if ($key == "Num") { |
| | | $tdContent = $Num; |
| | | } |
| | | echo "<td align='" . $value[2] . "' style=\"display:table-cell; vertical-align:middle\">"; |
| | | echo "<div id='" . $key . "_" . $Num . "'>" . $tdContent . "</div>"; |
| | | echo "</td>"; |
| | | } |
| | | echo "</tr>"; |
| | | } |
| | | // 仅显示本服 |
| | | echo " "; |
| | | echo '<input type="checkbox" name="onlyServerID" id="onlyServerID" ' . ($onlyServerID == "on" ? "checked" : "") . ' />' . \Lang\gettext("仅显示本服"); |
| | | ?> |
| | | </table> |
| | | <hr /> |
| | | <input type="submit" name="submit" value="<?php echo \Lang\gettext("查询"); ?>" class="button green medium" /> |
| | | <hr /> |
| | | <?php echo "玩家总数: " . $TotalCount . " 返回玩家总数: " . $ShowCount; ?> |
| | | <hr /> |
| | | <table width="100%"> |
| | | <?php |
| | | if ($dataArray) { |
| | | echo "<thead><tr>"; |
| | | foreach ($tableArray as $value) { |
| | | echo "<th width=\"" . $value[1] . "\">" . $value[0] . "</td>"; |
| | | } |
| | | echo "</tr></thead>"; |
| | | } else { |
| | | echo \Lang\gettext("暂无数据"), "<br/>"; |
| | | } |
| | | |
| | | $Num = $skip; |
| | | foreach ($dataArray as $info) { |
| | | $Num += 1; |
| | | echo "<tr class='trc'>"; |
| | | foreach ($tableArray as $key => $value) { |
| | | if (!$key) { |
| | | continue; |
| | | } |
| | | $tdContent = $info[$key]; |
| | | if ($key == "Num") { |
| | | $tdContent = $Num; |
| | | } elseif ($key == "AccID") { |
| | | $tdContent = $info["AccountID"] . "@" . $info["Channel"] . "@s" . $info["ServerID"]; |
| | | } |
| | | echo "<td align='" . $value[2] . "' style=\"display:table-cell; vertical-align:middle\">"; |
| | | echo "<div id='" . $key . "_" . $Num . "'>" . $tdContent . "</div>"; |
| | | echo "</td>"; |
| | | } |
| | | echo "</tr>"; |
| | | } |
| | | ?> |
| | | </table> |
| | | <hr /> |
| | | </form> |
| | | </body> |
| | | |
| | | <script type='text/javascript' src="/js/common.js"></script> |