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
<?php
include_once "/language/lang.php";
include_once "/Common/CommFunc.php";
 
header("Content-type: text/html; charset=utf-8");
 
\CommFunc\SessionStart();
 
// 仙盟信息
$familyKeyCh = array(
    'Rank' => \Lang\gettext('名次'),
    'FamilyName' => \Lang\gettext('仙盟名'),
    'LeaderName' => \Lang\gettext('盟主'),
    'LV' => \Lang\gettext('等级'),
    'MemberCnt' => \Lang\gettext('总人数'),
    'OnLineCnt' => \Lang\gettext('在线数'),
    //'WarRank'=>'联赛评级'),
    'FightPower' => \Lang\gettext('总战力'),
    'ServerID' => \Lang\gettext('服务器ID'),
    'Broadcast' => \Lang\gettext('公告'),
);
 
// 成员信息                    
$memberKeyCh = array(
    'Name' => \Lang\gettext('玩家名'),
    'LV' => \Lang\gettext('等级'),
    'FamilyLV' => \Lang\gettext('职位'),
    'ActiveValue' => \Lang\gettext('周贡献'),
    'OffLineSeconds' => \Lang\gettext('离线时间'),
);
 
// 职位        
$positionKeyCh = array(
    '0' => \Lang\gettext('成员'),
    '1' => \Lang\gettext('精英'),
    '2' => \Lang\gettext('副盟主'),
    '3' => \Lang\gettext('盟主'),
);
 
$resultInfo = $_POST;
$resultList = $resultInfo["ResultMsg"];
 
$retCount = count($resultList);
 
$memberList = null;
?>
 
<hr />
<?php echo \Lang\gettext("仙盟数"); ?>: <?php echo $retCount; ?><br /><br />
<?php
echo "<table id=\"tf\" class=\"border-table\">";
echo "<tr>";
foreach ($familyKeyCh as $key => $value) {
    echo "<td align='center'>" . $value . "</td>";
}
echo "</tr>";
 
for ($i = 0; $i < $retCount; $i++) {
    $familyInfo = $resultList[$i];
    if (array_key_exists('MemberInfo', $familyInfo)) {
        $memberList = $familyInfo['MemberInfo'];
    }
    echo "<tr>";
    foreach ($familyKeyCh as $key => $value) {
        $widgetName = "lab" . $key . $i;
        $tdContent = $familyInfo[$key];
        $tdContent = '<label name="' . $widgetName . '" id="' . $widgetName . '"/>' . $tdContent . '</label>';
        if ($key == "Broadcast") {
            $align = "left";
        } else {
            $align = "center";
        }
        echo "<td align='" . $align . "'>" . $tdContent . "</td>";
    }
    echo "</tr>";
}
echo "</table>";
?>
 
<?php
if ($memberList) {
    $memCount = count($memberList);
    echo "<br/>" . \Lang\gettext("仙盟成员数") . ": " . $memCount . "<br/>";
    echo "<table id=\"tm\" class=\"border-table\">";
    echo "<tr>";
    foreach ($memberKeyCh as $key => $value) {
        echo "<td align='center'>" . $value . "</td>";
    }
    echo "</tr>";
 
    for ($i = 0; $i < $memCount; $i++) {
        $memberInfo = $memberList[$i];
        echo "<tr>";
        foreach ($memberKeyCh as $key => $value) {
            $widgetName = "lab" . $key . $i;
            $tdContent = $memberInfo[$key];
            if ($key == 'FamilyLV') {
                $tdContent = $positionKeyCh[$tdContent];
            } else if ($key == 'OffLineSeconds') {
                $offlineSeconds = $tdContent;
                if (!$offlineSeconds) {
                    $tdContent = \Lang\gettext("在线");
                } else if ($offlineSeconds >= 3600 * 24) {
                    $days = intval($offlineSeconds / (3600 * 24));
                    $hours = round(($offlineSeconds - 3600 * 24 * $days) / 3600, 1);
                    $tdContent = $days . \Lang\gettext("天") . $hours . \Lang\gettext("小时前");
                } else if ($offlineSeconds >= 3600) {
                    $hours = round($offlineSeconds / 3600, 1);
                    $tdContent = $hours . \Lang\gettext("小时前");
                } else if ($offlineSeconds >= 60) {
                    $minutes = intval($offlineSeconds / 60);
                    $tdContent = $minutes . \Lang\gettext("分钟前");
                } else {
                    $tdContent = $offlineSeconds . \Lang\gettext("秒前");
                }
            }
            $tdContent = '<label name="' . $widgetName . '" id="' . $widgetName . '"/>' . $tdContent . '</label>';
            echo "<td align='center'>" . $tdContent . "</td>";
        }
        echo "</tr>";
    }
    echo "</table>";
}
?>
<hr />
<style type="text/css">
    .border-table {
        border-collapse: collapse;
        border: none;
    }
 
    .border-table td {
        border: solid #000 1px;
    }
</style>