hxp
2025-06-04 f4a514d5ac952110da846636ecbb9de951eaf3d2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
<?php
include_once "/Account/User.php";
include_once "/language/lang.php";
include_once "/Common/CommFunc.php";
include_once "/Common/Logging.php";
include_once "/Common/GMTRetCode.php";
 
\Logging\CreateLogging("queryFamilyByServerID.php");
$Permission = \User\Permission::P_GetFamilyByServerID;
$spid = $_SESSION['spid'];
$serverID = $_SESSION['serverID'];
$user = new \User\User($_SESSION['UserAccount']);
if (!$user->HavePermission($Permission)) {
    exit;
}
\Logging\LogInfo("_SESSION:" . print_r($_SESSION, true));
\Logging\LogInfo("_POST:" . print_r($_POST, true));
 
\CommFunc\MatchServerIDList($serverIDCondArray, $serverIDList);
// \Logging\LogInfo("serverIDCondArray:" . print_r($serverIDCondArray, true));
// \Logging\LogInfo("serverIDList:" . print_r($serverIDList, true));
 
// 分页
$limit = 100; // 单页条数
$page = 0;
if (array_key_exists("topage", $_POST) && intval($_POST["topage"]) >= 1) {
    $page = intval($_POST["topage"]);
} else if (array_key_exists("page", $_POST) && intval($_POST["page"]) >= 1) {
    $page = intval($_POST["page"]);
}
$totalCount = 0;
 
$dataArray = null;
$queryCnt = 100;
if ($_POST["submit"] || $page > 0) {
    if ($page <= 0) {
        $page = 1;
    }
    $packData = array(
        "serverIDList" => json_encode($serverIDList),
        "queryCnt" => "" . $limit,
        "page" =>  "" . $page,
    );
    \Logging\LogInfo("packData:" . print_r($packData, true));
    $retList = \CommFunc\SendGMTToGameServers(False, "GMT_GetFamilyByServerID", $packData, $spid, array($serverID));
    \Logging\LogInfo("retList:" . print_r($retList, true));
    if (!is_array($retList)) {
        echo "返回错误,没有返回信息";
        exit;
    }
 
    $ret = json_decode($retList[$serverID], true);
    $errStr = ParseResult($ret, $retMsg);
    if ($errStr != "") {
        echo $errStr;
        exit;
    }
    $dataArray = $retMsg["familyList"];
    $totalCount = $retMsg["totalCnt"];
}
$skip = ($page - 1) * $limit;
 
//显示表格字段配置 key-参数名,value-说明
$tableArray = array(
    "Num" => array(\Lang\gettext("排名"), "3%", "center"),
    "ID" => array(\Lang\gettext("仙盟ID"), "5%", "center"),
    "Name" => array(\Lang\gettext("仙盟名"), "9%", "center"),
    "FightPower" => array(\Lang\gettext("总战力"), "9%", "center"),
    "LeaderID" => array(\Lang\gettext("盟主ID"), "5%", "center"),
    "LeaderName" => array(\Lang\gettext("盟主名"), "9%", "center"),
    "LV" => array(\Lang\gettext("仙盟等级"), "3%", "center"),
    "MemberCnt" => array(\Lang\gettext("成员数"), "3%", "center"),
    "OnLineCnt" => array(\Lang\gettext("在线数"), "3%", "center"),
    "ServerID" => array(\Lang\gettext("区服ID"), "5%", "center"),
);
 
?>
 
<!DOCTYPE html>
<html>
 
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title><?php echo \Lang\gettext("查询区服仙盟"); ?></title>
    <link rel="stylesheet" type="text/css" href="/css/table.css">
    <link rel="stylesheet" type="text/css" href="/css/button.css">
    <link rel="gettext" type="application/x-po" href="../language/<?php echo \Lang\getLang(); ?>/LC_MESSAGES/<?php echo \Lang\getjspodomain(); ?>.po" />
</head>
 
<body>
 
    <form method="post">
 
        <center>
            <dt><b><?php echo \Lang\gettext("查询区服仙盟"); ?></b></dt>
        </center>
        &nbsp;&nbsp;<input type="button" value="添加服务器ID条件" onclick="AddServerIDCondition('', '', '')" />
        &nbsp;&nbsp;<input type="button" value="重置条件" onclick="ResetServerIDCondition()" />
        &nbsp;&nbsp;<input type="submit" name="submit" value="<?php echo \Lang\gettext("查询"); ?>" />
        <div id="ServerIDCondition"></div>
        <hr />
        <?php
        if (isset($dataArray)) {
            echo "仙盟总数: " . $totalCount;
            echo '<table width="100%">';
            echo "<thead><tr>";
            foreach ($tableArray as $value) {
                echo "<th width=\"" . $value[1] . "\">" . $value[0] . "</td>";
            }
            echo "</tr></thead>";
            $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 '</table>';
            echo '<hr />';
        } else if ($_POST["submit"]) {
            echo \Lang\gettext("暂无数据"), "<br/>";
        }
        ?>
        <?php
        include_once "/Common/SelectPage.php";
        ?>
    </form>
    <script type='text/javascript' src='/language/gettext.js'></script>
    <script type='text/javascript' src="/js/common.js"></script>
    <script type="text/javascript">
        window.onload = function() {
            LoadServerIDCondition('<?php echo json_encode($serverIDCondArray); ?>');
 
        }
    </script>
</body>
 
</html>