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
<?php
include_once "/language/lang.php";
include_once "/Common/CommFunc.php";
include_once "/Common/Logging.php";
include_once "/Account/User.php";
 
\Logging\CreateLogging("GMT_CrossActServerIDChange.php");
 
\CommFunc\SessionStart();
$Permission = \User\Permission::P_CrossActServerIDChange;
$spid = $_SESSION['spid'];
$user = new \User\User($_SESSION['UserAccount']);
if (!$user->HavePermission($Permission)) {
    exit;
}
 
$resultInfo = $_POST;
$ResultMsg = $resultInfo["ResultMsg"];
$ErrorInfo = "";
$crossActInfoDict = array();
if ($ResultMsg) {
    $crossActInfoDict = $ResultMsg["crossActInfoDict"];
    $ErrorInfo = $ResultMsg["ErrorInfo"];
}
$actCount = count($crossActInfoDict);
 
if ($ErrorInfo) {
    echo "ErrorInfo: ", $ErrorInfo, "<br/>";
}
?>
<!DOCTYPE html>
<html>
 
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title>跨服活动区服ID修改</title>
</head>
 
<body>
    <form id="ServerIDChange" name="ServerIDChange" action="/Common/GMCmdProcess.php" method="post">
        <center>
            <dt><b></b></dt>
        </center>
        <hr />
        当前活动数: <?php echo $actCount ?>
        <br />
        点击对应配置ID可切换区服ID范围编辑状态<br />
        注意:不修改的配置尽量不要切换为可编辑的,防止误修改!!!<br />
        注意:修改后需确保同个活动相同分组的区服ID范围不交叉!!!<br />
        <br />
        <?php
        foreach ($crossActInfoDict as $actName => $actInfo) {
            echo "活动名称:", $actName, "<br/>";
            echo "<table id=\"tf\" class=\"border-table\">";
            echo "<tr>";
            echo "<td align='center'>CfgID</td>";
            echo "<td align='center'>分组名</td>";
            echo "<td align='center'>区服ID范围</td>";
            echo "<td align='center'>开始日期</td>";
            echo "<td align='center'>结束日期</td>";
            echo "<td align='center'>模板ID列表</td>";
            echo "</tr>";
            foreach ($actInfo as $cfgID => $cfgInfo) {
                if (!count($cfgInfo)) {
                    continue;
                }
                echo "<tr>";
                $serverIDInputName = $actName . "_" . $cfgID . "_ServerIDRangeList";
 
                echo "<td align='center'><a href='javascript:ChangeDisabledState(\"" . $serverIDInputName . "\")'>" . $cfgID . "</a></td>";
                echo "<td align='center'>" . $cfgInfo["IpyDataInfo"]["ActGroupName"] . "</td>";
 
                echo "<td align='left'>";
                echo "<input type='text' name='" . $serverIDInputName . "' id='" . $serverIDInputName . "' value='"
                    . json_encode($cfgInfo["ServerIDRangeList"]) . "' size='30' disabled='disabled'/>";
                echo "</td>";
 
                echo "<td align='center'>" . $cfgInfo["IpyDataInfo"]["StartDate"] . "</td>";
                echo "<td align='center'>" . $cfgInfo["IpyDataInfo"]["EndDate"] . "</td>";
                echo "<td align='left'>" . json_encode($cfgInfo["IpyDataInfo"]["TemplateIDList"]) . "</td>";
                echo "</tr>";
            }
            echo "</table>";
            echo "<hr/>";
        }
        ?>
 
        <?php
        if ($user->NeedCheckKey()) {
            echo "<dd class=\"def_dd\">";
            echo \Lang\gettext("授权码(key)") . ":";
            echo "<input type=\"text\" name=\"key\" id=\"key\" />";
            echo "<p class=\"clear\"></p>";
            echo "</dd>";
        } else {
            echo "<input type=\"hidden\" name=\"key\" id=\"key\" />";
        }
        ?>
 
        <input type="hidden" name="doChange" value="1" />
        <input type="hidden" name="Permission" value="<?php echo $Permission; ?>" />
        <input type="hidden" name="pack_type" value="GMT_CrossActServerIDChange" />
        <dd class="submit_dd">
            <input type="submit" name="submit" value="提交修改" onclick="return CheckKey('key')" />
        </dd>
    </form>
 
    <script type="text/javascript">
        // 修改控件 disabled 状态
        function ChangeDisabledState(idname) {
            var elm = document.getElementById(idname)
            if (elm.disabled) {
                elm.disabled = "";
            } else {
                elm.disabled = "disabled";
            }
        }
 
        // 检查是否输入验证码
        function CheckKey(keyid) {
            if (document.getElementById(keyid).type != "hidden" && !document.getElementById(keyid).value) {
                alert("<?php echo \Lang\gettext("请输入授权码!"); ?>");
                return false;
            }
            if (!confirm("请检查确保修改完后每个活动配置的区服ID范围不交叉!!!")) {
                return false;
            }
            if (!confirm("确认提交修改?")) {
                return false;
            }
            return true;
        }
    </script>
 
    <style type="text/css">
        .border-table {
            border-collapse: collapse;
            border: none;
        }
 
        .border-table td {
            border: solid #000 1px;
        }
    </style>
 
</body>
 
</html>