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
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
<?php
include_once "/Common/CommFunc.php";
include_once "/Common/Logging.php";
include_once "/Account/User.php";
include_once "/language/lang.php";
 
\Logging\CreateLogging("AddEntireCompensation.php");
$Permission = \User\Permission::P_ServerMailSend;
$spid = $_SESSION['spid'];
$user = new \User\User($_SESSION['UserAccount']);
if (!$user->HavePermission($Permission)) {
    exit;
}
 
// 由于需要对全服邮件进行多服批量管理,所以全服邮件GUID统一由GM工具生成,全服邮件合服不合并
$GUID = \CommFunc\guid();
\Logging\LogInfo("GUID: " . $GUID);
 
$serversArray = $user->GetServers();
 
$readTempContent = \CommFunc\GetFileContents("MailTemp\\" . $spid . "_Entire.json", "[]");
$mailTempArray = json_decode($readTempContent, true);
$selectTempIndex = -1;
if (array_key_exists('tempIndex', $_GET)) {
    $selectTempIndex = intval($_GET["tempIndex"]);
}
 
$itemIDNameInfo = CommFunc\getCfgKeyNameContent("item", false);
// $mailtypes = CommFunc\GetMailTypes();
 
?>
 
<!DOCTYPE html>
<html>
 
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title><?php echo \Lang\gettext("全服邮件"); ?></title>
    <link rel="gettext" type="application/x-po" href="../language/<?php echo \Lang\getLang(); ?>/LC_MESSAGES/<?php echo \Lang\getjspodomain(); ?>.po" />
</head>
 
<body>
 
    <form id="AddEntireCompensation" name="AddEntireCompensation" action="/Common/GMCmdProcess.php" method="post">
 
        <table>
            <caption>
                <p><?php echo \Lang\gettext("全服邮件"); ?></P>
            </caption>
            <tr>
                <td><?php echo \Lang\gettext("模板名称"); ?>: </td>
                <td>
                    <input type="text" name="MailTempName" id="MailTempName" size="50" />
                    <?php
                    $tempCount = count($mailTempArray);
                    echo "<select id='MailTemp' name='MailTemp' onchange='onChangeMailTemp(" . $readTempContent . ", true)'><option value=''>" . \Lang\gettext("选择邮件模板") . "</option>";
                    for ($i = 0; $i < $tempCount; $i++) {
                        $tempInfo = $mailTempArray[$i];
                        echo '<option value ="' . $i . '"';
                        if ($i == $selectTempIndex) {
                            echo 'selected="selected"';
                        }
                        echo '>' .  ($i + 1) . '. ' . $tempInfo["Name"] . '</option>';
                    }
                    echo "</select>";
                    ?>
                </td>
            </tr>
            <?php
            if ($user->HavePermission(\User\Permission::P_ServerMailTempMgr, false)) {
                echo "<tr><td></td><td>";
                echo '<input type="submit" name="saveTemp" value="' . \Lang\gettext("保存修改模板") . '" onclick="return onSaveMailTemp()" />';
                echo '&nbsp;<input type="submit" name="delTemp" value="' . \Lang\gettext("删除此模板") . '" onclick="return onDelMailTemp()" />';
                echo '&nbsp;<input type="submit" name="saveNewTemp" value="' . \Lang\gettext("另存为新模板") . '" onclick="return onSaveNewMailTemp()" />';
                echo "</td></tr>";
            }
            ?>
            <tr>
            </tr>
            <tr>
                <td style="text-align: right;">GUID: </td>
                <td><?php echo $GUID; ?></td>
                <input type="hidden" name="GUID" id="GUID" value="<?php echo $GUID; ?>" />
            </tr>
            <tr>
                <td style="text-align: right;"><?php echo \Lang\gettext("发件人"); ?>: </td>
                <td><input type="text" name="Sender" value="" size="20" /></td>
            </tr>
            <tr>
                <td><?php echo \Lang\gettext("有效天数"); ?>:</td>
                <td><input type="number" name="LimitDays" id="LimitDays" value="7" min="1" /></td>
                <!-- <td><?php echo \Lang\gettext("结束时间"); ?>: </td>
                <td>
                    <?php
                    include_once "/Common/EndTimeSelect.php";
                    ?>
                </td> -->
            </tr>
            <!-- <tr>
                <td><?php echo \Lang\gettext("职业多选"); ?>: </td>
                <td>
                    <input type="checkbox" name="Job1" id="Job1" onclick="UpdatePlayerJob(3)" checked /><?php echo \Lang\gettext("枪豪"); ?>
                    <input type="checkbox" name="Job2" id="Job2" onclick="UpdatePlayerJob(3)" checked /><?php echo \Lang\gettext("道师"); ?>
                    <input type="checkbox" name="Job3" id="Job3" onclick="UpdatePlayerJob(3)" checked /><?php echo \Lang\gettext("剑修"); ?>
                    <input type="hidden" name="PlayerJob" id="PlayerJob" value="15" />
                    <input type="checkbox" name="JobAll" checked onclick="SelectAllJob(this.checked, 3)" /><?php echo \Lang\gettext("全选/全不选"); ?><br />
                </td>
            </tr> -->
            <tr>
                <td><?php echo \Lang\gettext("最低等级"); ?>: </td>
                <td><input type="number" name="PlayerLV" id="PlayerLV" value="30" min="1" />(<?php echo \Lang\gettext("领取邮件所需最低等级"); ?>)</td>
            </tr>
            <tr>
                <td><?php echo \Lang\gettext("升级可领"); ?>: </td>
                <td>
                    <select name="LimitLVType" id="LimitLVType">
                        <option value="0"><?php echo \Lang\gettext("不能"); ?></option>
                        <option value="1"><?php echo \Lang\gettext("可以"); ?></option>
                    </select>
                </td>
            </tr>
            <tr>
                <td><?php echo \Lang\gettext("需要审核"); ?>: </td>
                <td>
                    <select name="CheckState" id="CheckState">
                        <option value="0"><?php echo \Lang\gettext("不需要"); ?></option>
                        <option value="1" selected><?php echo \Lang\gettext("需要"); ?></option>
                    </select>
                </td>
            </tr>
            <!-- <tr>
                <td><?php echo \Lang\gettext("邮件类型"); ?>: </td>
                <td>
                    <select name="MailType" id="MailType">
                        <?php
                        foreach ($mailtypes as $key => $value) {
                            echo "<option value='" . $key . "'>" . $value . "(" . $key . ")</option>";
                        }
                        ?>
                    </select>
                </td>
            </tr> -->
            <tr>
                <td><?php echo \Lang\gettext("邮件标题"); ?>: </td>
                <td><input type="text" name="Title" id="Title" size="68" /></td>
            </tr>
            <tr>
                <td><?php echo \Lang\gettext("邮件内容"); ?>: </td>
                <td>
                    <textarea name="Text" id="Text" cols="70" rows="7"></textarea><br />
                    <!-- <input type="button" value="<?php echo \Lang\gettext("插入超链接"); ?>" onclick="inserthyperlink('Text');" />
                    <input type="button" value="<?php echo \Lang\gettext("插入界面"); ?>" onclick="insertgameform('Text');" /><br /> -->
                </td>
            </tr>
            <tr>
                <td><?php echo \Lang\gettext("邮件物品"); ?>:</td>
                <td>
                    <div id="itemContent"></div>
                    <input type="hidden" name="itemNums" id="itemNums" value="" />
                    <a href="javascript:AddItemHtml();"><?php echo \Lang\gettext("添加邮件物品"); ?></a>
                </td>
            </tr>
 
        </table>
        <hr>
        <?php
        if ($user->NeedCheckKey()) {
            echo \Lang\gettext("授权码(key)") . ":";
            echo "<input type=\"text\" name=\"key\" id=\"key\" />";
        } else {
            echo "<input type=\"hidden\" name=\"key\" id=\"key\" />";
        }
        ?>
        <br />
        <?php
        include_once "/Common/SelectServer.php";
        ?>
        <center>
            <p>
                <input type="hidden" name="Permission" value="<?php echo $Permission; ?>" />
                <input type="hidden" name="pack_type" id="pack_type" value="GMT_AddEntireCompensation" />
                <input type="submit" name="submit" align="center" value="<?php echo \Lang\gettext("提交"); ?>" onclick="return CheckSubmit()" />
            </P>
        </center>
 
        <hr>
 
    </form>
 
    <script type='text/javascript' src='/language/gettext.js'></script>
    <script type='text/javascript' src="/js/calendar.js"></script>
    <script type='text/javascript' src="/js/common.js"></script>
    <script type='text/javascript' src="/Common/selectserver.js"></script>
    <script language='javascript' src='compensationitem.js' type='text/javascript'></script>
    <script language='javascript' src='compensationTemp.js' type='text/javascript'></script>
    <script type="text/javascript">
        window.onload = function() {
            onChangeMailTemp(<?php echo $readTempContent; ?>, false);
        }
 
        function onItemIDChange(num, value) {
            var itemIDNameInfo = <?php echo $itemIDNameInfo; ?>;
            var itemName = "<font color='red'><?php echo \Lang\gettext("未知物品ID"); ?></font>";
            if (itemIDNameInfo[value]) {
                itemName = itemIDNameInfo[value];
            }
            document.getElementById("ItemName" + num).innerHTML = itemName;
        }
    </script>
</body>
 
</html>