<?php
|
include_once "/language/lang.php";
|
include_once "/Common/CommFunc.php";
|
include_once "/Common/Logging.php";
|
include_once "/Account/User.php";
|
|
\Logging\CreateLogging("GMT_CompensationQuery.php");
|
|
\CommFunc\SessionStart();
|
$Permission = \User\Permission::P_ServerMailMgr;
|
$spid = $_SESSION['spid'];
|
$user = new \User\User($_SESSION['UserAccount']);
|
if (!$user->HavePermission($Permission)) {
|
exit;
|
}
|
|
$serversArray = $user->GetServers();
|
|
$mailNameArray = CommFunc\getCfgKeyNameContent("mail", true, $spid);
|
$itemNameArray = CommFunc\getCfgKeyNameContent("item", true, $spid);
|
$moneyTypeArray = CommFunc\getCfgKeyNameContent("money", true, $spid);
|
$mailtypes = CommFunc\GetMailTypes();
|
|
//------------------------------------------
|
|
//显示表格字段配置 key-参数名,value-说明
|
$tableArray = array(
|
"Num" => \Lang\gettext("编号"),
|
"CheckState" => \Lang\gettext("状态"),
|
"MailType" => \Lang\gettext("类型"),
|
"Title" => \Lang\gettext("标题"),
|
"LimitLV" => \Lang\gettext("限制等级"),
|
"LimitLVType" => \Lang\gettext("升级可领"),
|
"Gold" => $moneyTypeArray["1"],
|
"GoldPaper" => $moneyTypeArray["2"],
|
"Silver" => $moneyTypeArray["3"],
|
"PlayerJob" => \Lang\gettext("职业"),
|
"ItemList" => \Lang\gettext("物品"),
|
"Content" => \Lang\gettext("内容"),
|
"GUID" => \Lang\gettext("GUID"),
|
"CreateTime" => \Lang\gettext("发送时间"),
|
"LimitTime" => \Lang\gettext("到期时间"),
|
"Sender" => \Lang\gettext("发送人"),
|
"OnlyServerID" => \Lang\gettext("是否单服邮件")
|
);
|
|
// 获取字段对应内容
|
function GetContent($mailDict, $keyName, $mailNameArray, $itemNameArray)
|
{
|
global $mailtypes;
|
$c = $mailDict[$keyName];
|
if ($keyName == "CheckState") {
|
if ($c == "0") {
|
return \Lang\gettext("通过");
|
}
|
return "<font color='red'>" . \Lang\gettext("未审") . "</font>";
|
} elseif ($keyName == "LimitLVType") {
|
if ($c == "0") {
|
return \Lang\gettext("否");
|
}
|
return \Lang\gettext("是");
|
} elseif ($keyName == "ItemList") {
|
if (count($c) == 0) {
|
return \Lang\gettext("无");
|
}
|
$itemInfo = "";
|
foreach ($c as $item) {
|
$itemID = "" . $item[0];
|
$itemCount = $item[1];
|
if (array_key_exists($itemID, $itemNameArray)) {
|
$itemInfo .= $itemNameArray[$itemID] . "(" . $itemID . ")";
|
} else {
|
$itemInfo .= "<font color='red'>" . \Lang\gettext("未知物品ID") . "(" . $itemID . ")</font>";
|
}
|
$itemInfo .= " x" . $itemCount . \Lang\gettext("个") . "<br/><br/>";
|
}
|
return $itemInfo;
|
} elseif ($keyName == "MailType") {
|
return $mailtypes["" . $c] . "(" . $c . ")";
|
}
|
return $mailDict[$keyName];
|
}
|
|
$resultInfo = $_POST;
|
|
$resultList = $resultInfo["ResultMsg"];
|
|
$retCount = count($resultList);
|
|
?>
|
|
<!DOCTYPE html>
|
<html>
|
|
<head>
|
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
<title><?php echo \Lang\gettext("全服邮件管理"); ?></title>
|
</head>
|
|
<body>
|
<form id="CompensationMgr" name="CompensationMgr" action="/Common/GMCmdProcess.php" method="post">
|
<br />
|
<hr />
|
<?php echo \Lang\gettext("返回条数"); ?>: <?php echo $retCount; ?><br /><br />
|
<table id="tt" class="border-table">
|
<?php
|
echo "<tr>";
|
foreach ($tableArray as $key => $value) {
|
echo "<td align='center'>" . $value . "</td>";
|
}
|
echo "</tr>";
|
|
for ($i = 0; $i < $retCount; $i++) {
|
$mailDict = $resultList[$i];
|
$num = $i + 1;
|
echo "<tr>";
|
echo "<td align='center'><input name='checkbox" . $i . "' id='checkbox" . $i . "' type='checkbox' />" . $num . " </td>";
|
foreach ($tableArray as $key => $value) {
|
if ($key == "Num") {
|
continue;
|
}
|
|
$widgetName = "lab" . $key . $i;
|
$tdContent = GetContent($mailDict, $key, $mailNameArray, $itemNameArray);
|
$tdContent = '<label name="' . $widgetName . '" id="' . $widgetName . '"/>' . $tdContent . '</label>';
|
if ($key == "Title" || $key == "Content" || $key == "ItemList") {
|
$align = "left";
|
} else {
|
$align = "center";
|
}
|
echo "<td align='" . $align . "'>" . $tdContent . "</td>";
|
}
|
echo "</tr>";
|
}
|
?>
|
</table>
|
<hr />
|
|
<input type="hidden" name="GUIDInfo" id="GUIDInfo" value="" />
|
<?php echo \Lang\gettext("选中邮件操作"); ?>:
|
<input type="radio" name="operation" id="operation" value="1" /><label name="operation1" id="operation1"><?php echo \Lang\gettext("通过"); ?></label>
|
<input type="radio" name="operation" id="operation" value="2" /><label name="operation2" id="operation2"><?php echo \Lang\gettext("删除"); ?></label>
|
|
<input type="hidden" name="Permission" value="<?php echo $Permission; ?>" />
|
<input type="hidden" name="pack_type" value="GMT_CompensationMgr" />
|
<p>
|
<?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\" />";
|
}
|
?>
|
</p>
|
<?php
|
include_once "/Common/SelectServer.php";
|
?>
|
<center>
|
<p>
|
<input type="submit" name="submit" align="center" value="<?php echo \Lang\gettext("提交"); ?>" onclick="return CheckSubmit(<?php echo $retCount; ?>)" />
|
</P>
|
</center>
|
<hr>
|
</form>
|
<script src="/Common/selectserver.js"></script>
|
<script>
|
//浏览器类型判定
|
function getOs() {
|
if (navigator.userAgent.indexOf("MSIE") > 0) {
|
return "IE"; //InternetExplor
|
} else if (isFirefox = navigator.userAgent.indexOf("Firefox") > 0) {
|
return "FF"; //firefox
|
} else if (isSafari = navigator.userAgent.indexOf("Safari") > 0) {
|
return "SF"; //Safari
|
} else if (isCamino = navigator.userAgent.indexOf("Camino") > 0) {
|
return "C"; //Camino
|
} else if (isMozilla = navigator.userAgent.indexOf("Gecko/") > 0) {
|
return "G"; //Gecko
|
} else if (isMozilla = navigator.userAgent.indexOf("Opera") >= 0) {
|
return "O"; //opera
|
} else {
|
return 'Other';
|
}
|
}
|
|
//获取换行符
|
function getbr() {
|
var os = getOs();
|
if (os == 'FF' || os == 'SF') { //FireFox、谷歌浏览器用这个
|
return "\n";
|
} else { //IE系列用这个
|
return "\r\n";
|
}
|
}
|
|
function CheckSubmit(rCount) {
|
var br = getbr();
|
var checkInfo = "";
|
//每次重新提交表单要重置该值,不然单次操作中多次确认提交会产生多余数据
|
document.getElementById("GUIDInfo").value = "";
|
for (var i = 0; i < rCount; i++) {
|
if (!document.getElementById("checkbox" + i).checked) {
|
continue;
|
}
|
|
var guid = document.getElementById("labGUID" + i).innerText;
|
var title = document.getElementById("labTitle" + i).innerText;
|
|
checkInfo = checkInfo + "<?php echo \Lang\gettext("编号"); ?>" + (i + 1) + "." + title + "(" + guid + ")" + br + br;
|
|
var GUIDInfo = document.getElementById("GUIDInfo").value;
|
if (GUIDInfo) {
|
GUIDInfo += ",";
|
}
|
GUIDInfo += guid;
|
document.getElementById("GUIDInfo").value = GUIDInfo;
|
}
|
// alert("GUIDInfo: " + document.getElementById("GUIDInfo").value);
|
if (checkInfo == "") {
|
alert("<?php echo \Lang\gettext("没有选中邮件"); ?>");
|
return false;
|
}
|
|
// 列表的不能用 getElementById
|
var operation = document.getElementsByName("operation")
|
var operText = "";
|
for (var i = 0; i < operation.length; i++) {
|
if (operation[i].checked) {
|
operText = document.getElementById("operation" + (i + 1)).innerText;
|
break;
|
}
|
}
|
|
if (operText == "") {
|
alert("<?php echo \Lang\gettext("没有选择操作类型"); ?>");
|
return false;
|
}
|
|
if (!window.confirm("<?php echo \Lang\gettext("以下邮件确定执行该操作吗"); ?>" + "?【" + operText + "】" + br + br + checkInfo)) {
|
return false;
|
}
|
|
if (document.getElementById("key").type != "hidden" && !document.getElementById("key").value) {
|
alert("<?php echo \Lang\gettext("请输入授权码!"); ?>");
|
return false;
|
}
|
|
return true;
|
}
|
</script>
|
|
<style type="text/css">
|
.border-table {
|
border-collapse: collapse;
|
border: none;
|
font-size: 13px;
|
}
|
|
.border-table td {
|
border: solid #000 1px;
|
}
|
</style>
|
</body>
|
|
</html>
|