<?php
|
include_once "/Common/Logging.php";
|
include_once "/Account/User.php";
|
include_once "/db/DBOper.php";
|
include_once "/language/lang.php";
|
include_once "/Account/userlogcomm.php";
|
include_once "/Common/GMTRetCode.php";
|
include_once '/Common/CommFunc.php';
|
|
\Logging\CreateLogging("BugReport.php");
|
$Permission = \User\Permission::P_BugReport;
|
|
$alertMsg = "";
|
$spid = $_SESSION['spid'];
|
$UserAccount = $_SESSION['UserAccount'];
|
$user = new \User\User($UserAccount);
|
if (!$user->HavePermission($Permission)) {
|
exit;
|
}
|
|
$limitDefault = 30;
|
$limit = array_key_exists("limit", $_COOKIE) ? intval($_COOKIE["limit"]) : $limitDefault; // 单页条数
|
$limit = 30;
|
$page = 1;
|
if (array_key_exists("limit", $_POST) && intval($_POST["limit"]) > 0) {
|
$limit = intval($_POST["limit"]);
|
}
|
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"]);
|
}
|
$skip = ($page - 1) * $limit;
|
|
if ($page == 1) {
|
\DBOper\EnsureIndex("EventReportBug", array("Channel" => 1, "Time" => -1));
|
}
|
|
$find = array("Channel" => $spid);
|
$showTypeInfo = array("all" => "全部", "bug" => "玩家反馈", "system" => "系统反馈");
|
$showType = $_POST["showType"] ? $_POST["showType"] : "bug";
|
if ($showType == "bug") {
|
$find["AccountID"] = array('$nin' => array("system"));
|
} elseif ($showType == "system") {
|
$find["AccountID"] = "system";
|
}
|
\DBOper\Find("EventReportBug", $find, $bugArray, null, array("Time" => -1), $limit, $skip);
|
$totalCount = count($bugArray);
|
if ($totalCount >= $limit || $page > 1) {
|
$totalCount = \DBOper\Count("EventReportBug", $find);
|
}
|
|
//显示表格字段配置 key-参数名,value-说明
|
$tableArray = array(
|
"RegionID" => array(\Lang\gettext("区服"), "5%", "center"),
|
"UserAccount" => array(\Lang\gettext("内容"), "", "left"),
|
);
|
|
$moneyNameInfo = CommFunc\getCfgKeyNameContent("money", false);
|
$itemIDNameInfo = CommFunc\getCfgKeyNameContent("item", false);
|
\CommFunc\GetConfig("ServerInfo", "BugReportMailTitle", $mailTitle);
|
$ReplyMailInfo = array();
|
// 保存cookie
|
// setcookie("limit", $limit);
|
?>
|
|
<html>
|
|
<head>
|
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
<title><?php echo \Lang\gettext("Bug反馈"); ?></title>
|
<link rel="stylesheet" type="text/css" href="/css/table.css">
|
<link rel="stylesheet" type="text/css" href="/css/button.css">
|
<style>
|
div {
|
/* 不换行 */
|
text-align: center;
|
display: inline-block;
|
/* 上下 左右 边距填充*/
|
padding: 3px 7px;
|
}
|
|
.TitleT {
|
background: rgb(154, 153, 153);
|
color: #ffffff;
|
font-weight: bold;
|
}
|
|
.TitleC {
|
color: rgb(67, 139, 204);
|
font-weight: bold;
|
}
|
|
.RoleT {
|
background: rgb(92, 185, 92);
|
color: #ffffff;
|
font-weight: bold;
|
}
|
|
.AccID {
|
color: rgb(1, 129, 0);
|
font-weight: bold;
|
}
|
|
.RoleID {
|
color: rgb(50, 50, 50);
|
font-weight: bold;
|
}
|
|
.Content {
|
/* font-family: "Lucida Calligraphy"; */
|
color: rgb(50, 50, 50);
|
font-weight: bold;
|
}
|
</style>
|
</head>
|
|
<body>
|
<center>
|
<p><b><?php echo \Lang\gettext("Bug反馈"); ?></b></P>
|
</center>
|
|
<form id="BugReport" action="BugReport.php" method="post">
|
<?php
|
echo "<select name=\"showType\">";
|
foreach ($showTypeInfo as $key => $value) {
|
echo "<option value=\"" . $key . "\"";
|
if ($showType == $key) {
|
echo " selected";
|
}
|
echo ">" . $value . "</option>";
|
}
|
echo "</select>";
|
?>
|
<input type="submit" name="submit" value="<?php echo \Lang\gettext("查询"); ?>" class="button green medium" />
|
<hr />
|
<table width="100%">
|
<?php
|
if ($bugArray) {
|
echo "<thead><tr>";
|
foreach ($tableArray as $value) {
|
echo "<th width=\"" . $value[1] . "\">" . $value[0] . "</td>";
|
}
|
echo "</tr></thead>";
|
} else {
|
echo \Lang\gettext("暂无反馈"), "<br/>";
|
}
|
|
$space = "  ";
|
foreach ($bugArray as $bugInfo) {
|
echo "<tr>";
|
foreach ($tableArray as $key => $value) {
|
$tdContent = $bugInfo[$key];
|
if ($key == "RegionID") {
|
$tdContent = "s." . $tdContent;
|
} elseif ($key == "UserAccount") {
|
$repID = $bugInfo["_id"];
|
$ReplyMail = $bugInfo["ReplyMail"];
|
$accID = $bugInfo["AccountID"] . "@" . $bugInfo["Channel"] . "@s" . $bugInfo["RegionID"];
|
$tdContent = "<br/>"
|
. "<div class='TitleT'>" . \Lang\gettext("标题") . ":</div>" . $space
|
. "<div class='TitleC'>" . $bugInfo["Title"] . "</div>" . $space
|
. "<div class='Time'>" . $bugInfo["Time"] . "</div>" . $space
|
. "<div class='RoleT'>" . \Lang\gettext("玩家") . ":</div>" . $space
|
. "<div class='AccID'>" . $accID . "</div>"
|
. "<div class='RoleID'>" . $bugInfo["RoleID"] . "</div>"
|
. "(LV:" . $bugInfo["Level"] . " VIP:" . $bugInfo["VIPLevel"] . ")" . $space;
|
|
$tdContent .= " <a href=\"../SuperGMToolClient/AddPersonalCompensation.php?callName=BugReport"
|
. "&repID=" . $repID . "&accID=" . $accID . "&mailTitle=" . $mailTitle . "&mailServerID=" . $bugInfo["RegionID"] . "\""
|
. " target=\"iframe_mail\" onclick=\"toggleWidth()\">"
|
. \Lang\gettext("邮件回复") . "</a>";
|
// $tdContent .= " " . $repID;
|
$tdContent .= "<br/>";
|
$tdContent .= "<br/><div class='Content'>" . $bugInfo["Content"] . "</div><br/>";
|
$tdContent .= "<br/><div>" . $bugInfo["ClientInfo"] . "</div><br/>";
|
$tdContent .= "<br/><label id='replyMail_" . $repID . "'></label><br/>";
|
if ($ReplyMail) {
|
$ReplyMailInfo[$repID . ""] = $ReplyMail;
|
}
|
// $tdContent .= "<br/>";
|
}
|
echo "<td align='" . $value[2] . "' style=\"display:table-cell; vertical-align:middle; line-height:15px;\" >";
|
echo $tdContent;
|
echo "</td>";
|
}
|
echo "</tr>";
|
}
|
$ReplyMailInfo = json_encode($ReplyMailInfo);
|
?>
|
</table>
|
<?php
|
include_once "/Common/SelectPage.php";
|
?>
|
</form>
|
|
<script type='text/javascript' src="/js/common.js"></script>
|
<script>
|
window.onload = function() {
|
var ReplyMailInfo = <?php echo $ReplyMailInfo; ?>;
|
for (const repID in ReplyMailInfo) {
|
showReplyMail(repID, JSON.parse(ReplyMailInfo[repID]));
|
}
|
}
|
|
function toggleWidth() {
|
// 切换父容器布局宽度
|
window.parent.toggleWidth();
|
}
|
|
function showReplyMail(repID, mailInfo) {
|
// console.log("更新bug反馈邮件内容显示:" + repID);
|
// console.log(mailInfo);
|
var moneyNameInfo = <?php echo $moneyNameInfo; ?>;
|
var itemIDNameInfo = <?php echo $itemIDNameInfo; ?>;
|
var innerHTML = "";
|
innerHTML += "<div>回复信息: </div><br/>";
|
innerHTML += "<div> " + mailInfo["Text"] + "</div><br/>";
|
innerHTML += "<div>金币奖励: ";
|
innerHTML += "" + moneyNameInfo["1"] + ":" + mailInfo["Gold"];
|
innerHTML += " " + moneyNameInfo["2"] + ":" + mailInfo["GoldPaper"];
|
innerHTML += " " + moneyNameInfo["3"] + ":" + mailInfo["Silver"];
|
innerHTML += "</div><br/>";
|
innerHTML += "<div>物品奖励: ";
|
for (let index = 0; index < mailInfo["ItemList"].length; index++) {
|
const itemInfo = mailInfo["ItemList"][index];
|
const itemID = itemInfo[0];
|
const itemCnt = itemInfo[1];
|
var itemName = "<font color='red'><?php echo \Lang\gettext("未知物品ID"); ?></font>";
|
if (itemIDNameInfo[itemID]) {
|
itemName = itemIDNameInfo[itemID];
|
}
|
innerHTML += itemName + "x" + itemCnt + " ";
|
}
|
if (mailInfo["ItemList"].length == 0) {
|
innerHTML += "无";
|
}
|
innerHTML += "</div><br/>";
|
|
var repObj = document.getElementById("replyMail_" + repID);
|
repObj.innerHTML = innerHTML;
|
}
|
|
function mailReplyOK(repID, mailInfo) {
|
// 邮件回复成功
|
// console.log(repID);
|
// console.log(mailInfo);
|
ajaxRequest("BugReportUpdReply.php?repID=" + repID + "&mailInfo=" + JSON.stringify(mailInfo),
|
function(xmlhttp) {
|
// console.log(xmlhttp.responseText);
|
if (xmlhttp.responseText == "OK") {
|
showReplyMail(repID, mailInfo);
|
}
|
},
|
"POST"
|
);
|
}
|
</script>
|
</body>
|
|
</html>
|