<?php
|
include_once "/Account/User.php";
|
include_once "/language/lang.php";
|
include_once "/Common/CommFunc.php";
|
include_once "/GMToolClient/cfg/GMT_QueryBillboard.php";
|
include_once "/Common/Logging.php";
|
|
\Logging\CreateLogging("billboardhis.php");
|
|
$Permission = \User\Permission::P_QueryBillboard;
|
$spid = $_SESSION['spid'];
|
$user = new \User\User($_SESSION['UserAccount']);
|
if (!$user->HavePermission($Permission)) {
|
exit;
|
}
|
$server_id = $_SESSION['server_id'];
|
$billboardCh = GetbillboardCh();
|
|
// 默认当天
|
$billboardDate = array_key_exists("billboardDate", $_POST) ? $_POST["billboardDate"] : date("Y-m-d");
|
$billboardType = 0;
|
|
if (array_key_exists("billboardType", $_POST)) {
|
$OnlyServerID = 1; // 默认只查指定服
|
// 设置默认数据,开界面默认查选中服
|
$_POST["billboardDate"] = $billboardDate;
|
$_POST["eventType"] = "BillboardHis";
|
$_POST["queryAllData"] = "on"; // 设置可查询备份数据
|
$billboardType = intval($_POST["billboardType"]);
|
$_POST["billboardType"] = $billboardType + 1; // 查询的时候+1,目前流向查询过滤掉了0的参数
|
\CommFunc\QueryEventData($user, $retInfo);
|
}
|
|
?>
|
|
<!DOCTYPE html>
|
<html>
|
|
<head>
|
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
<title><?php echo \Lang\gettext("查询历史排行榜"); ?></title>
|
<style type="text/css">
|
.border-table {
|
border-collapse: collapse;
|
border: none;
|
}
|
|
.border-table td {
|
border: solid #000 1px;
|
}
|
</style>
|
</head>
|
|
<body>
|
|
<form id="BillboardHis" name="BillboardHis" action="billboardhis.php" method="post">
|
<dl>
|
<center>
|
<dt><b><?php echo \Lang\gettext("查询历史排行榜"); ?></b></dt>
|
</center>
|
|
<dd class="def_dd">
|
<div>
|
<?php echo \Lang\gettext("查询时间"); ?>:
|
<input type="text" name="billboardDate" id="billboardDate" onclick="new Calendar().show(this);" readonly value="<?php echo $billboardDate; ?>" size="8" /><br />
|
<?php echo \Lang\gettext("榜单类型"); ?>:
|
<select name='billboardType' id='billboardType'>
|
<?php
|
foreach ($billboardCh as $key => $value) {
|
$bbName = $value['BBName'];
|
echo "<option value='" . $key . "' ";
|
if ($billboardType == $key) {
|
echo " selected";
|
}
|
echo ">" . $bbName . "(" . $key . ")</option>";
|
}
|
?>
|
</select>
|
<input type="text" name="billType" value="" maxlength="3" size="5" />(<?php echo \Lang\gettext("其他类型"); ?>)
|
</div>
|
<p class="clear"></p>
|
</dd>
|
<input type="hidden" name="viewDRFileName" id="viewDRFileName" value="" />
|
<input type="hidden" name="Permission" value="<?php echo $Permission; ?>" />
|
<dd class="submit_dd">
|
<input type="submit" value="<?php echo \Lang\gettext("提交"); ?>" onclick="return CheckKey('key')" />
|
<br /><br />
|
<a href="/GMToolClient/queryBillboard.php"><?php echo \Lang\gettext("查询实时排行榜"); ?></a>
|
</dd>
|
</dl>
|
</form>
|
<?php
|
if (array_key_exists("billboardType", $_POST)) {
|
if (isset($retInfo) && array_key_exists($server_id, $retInfo) && $retInfo[$server_id]["ErrorInfo"]) {
|
echo "<font color=\"#FF0000\">" . $retInfo[$server_id]["ErrorInfo"] . "</font><br/>";
|
} else if (isset($retInfo) && array_key_exists($server_id, $retInfo)) {
|
$drFileList = $retInfo[$server_id]["DRFileList"];
|
$resultList = $retInfo[$server_id]["DRData"];
|
$retCount = count($resultList);
|
|
$billboardKeyCh = array(
|
'Index' => \Lang\gettext('Index'),
|
'Rank' => \Lang\gettext('排名'),
|
'ID' => \Lang\gettext('ID'),
|
'ID2' => \Lang\gettext('ID2'),
|
'Name1' => \Lang\gettext('玩家'),
|
'Name2' => \Lang\gettext('账号'),
|
'Type2' => \Lang\gettext('职业'),
|
'CmpValue' => \Lang\gettext('比较值1'),
|
'CmpValue2' => \Lang\gettext('比较值2'),
|
'CmpValue3' => \Lang\gettext('更新时间'),
|
'Value1' => \Lang\gettext('其他值1'),
|
'Value2' => \Lang\gettext('其他值2'),
|
'Value3' => \Lang\gettext('其他值3'),
|
'Value4' => \Lang\gettext('其他值4'),
|
'Value5' => \Lang\gettext('其他值5'),
|
'Value6' => \Lang\gettext('其他值6'),
|
'Value7' => \Lang\gettext('其他值7'),
|
'Value8' => \Lang\gettext('其他值8'),
|
'time' => \Lang\gettext('备份时间'),
|
);
|
|
$jobNameInfo = array("1" => \Lang\gettext("枪豪"), "2" => \Lang\gettext("道师"), "3" => \Lang\gettext("剑修"));
|
|
$billboardKeyChPri = $billboardCh[$billboardType];
|
$bbName = $billboardKeyChPri['BBName'];
|
if ($bbName) {
|
echo "【" . $bbName . "】<br/>";
|
}
|
echo \Lang\gettext("榜单类型") . ": " . $billboardType . "<br/>";
|
echo \Lang\gettext("备份数量") . ": " . count($drFileList) . "<br/>";
|
for ($i = 0; $i < count($drFileList); $i++) {
|
$drFileInfo = $drFileList[$i];
|
$drFileName = $drFileInfo[0];
|
$dataCount = $drFileInfo[1];
|
$addDataDict = $drFileInfo[2];
|
echo "<a href=\"#\" onclick=\"submitForm('$drFileName')\">" . $drFileName . "</a> 条数:" . $dataCount . " " . json_encode($addDataDict) . "<br/>";
|
}
|
|
echo "<br/>";
|
echo \Lang\gettext("数据条数") . ": " . $retCount . " ". $_POST["viewDRFileName"]."<br/>";
|
echo "<table id=\"tf\" class=\"border-table\">";
|
echo "<tr>";
|
foreach ($billboardKeyCh as $key => $value) {
|
// 没有指定要显示的key
|
if (($key == "CmpValue2" or \CommFunc\startsWith($key, "Value")) and !array_key_exists($key, $billboardKeyChPri)) {
|
continue;
|
}
|
$keyCh = $value;
|
if (array_key_exists($key, $billboardKeyChPri)) {
|
// 指定榜单字段名
|
$keyCh = $billboardKeyChPri[$key];
|
}
|
echo "<td align='center'>" . $keyCh . "</td>";
|
}
|
echo "</tr>";
|
|
$cmpValue3CalcTime = 3471264000; //2080-01-01 00:00:00 的时间戳,用于存比较值3更新时间的计算值
|
for ($i = 0; $i < $retCount; $i++) {
|
$dataInfo = $resultList[$i];
|
echo "<tr>";
|
echo "<td align='center'>" . ($dataInfo["Index"]?$dataInfo["Index"]:0) . "</td>";
|
|
foreach ($billboardKeyCh as $key => $value) {
|
if ($key == "Index") {
|
continue;
|
}
|
// 没有指定要显示的key
|
if (($key == "CmpValue2" or \CommFunc\startsWith($key, "Value")) and !array_key_exists($key, $billboardKeyChPri)) {
|
continue;
|
}
|
$widgetName = "lab" . $key . $i;
|
$tdContent = $dataInfo[$key];
|
if ($key == "CmpValue3" and !array_key_exists($key, $billboardKeyChPri)) {
|
$updTime = $cmpValue3CalcTime - $tdContent;
|
$tdContent = date("Y-m-d H:i:s", $updTime); // 更新数据时间
|
}
|
if ($key == "Type2") {
|
if (array_key_exists("" . $tdContent, $jobNameInfo)) {
|
$tdContent = $jobNameInfo["" . $tdContent];
|
}
|
}
|
$tdContent = '<label name="' . $widgetName . '" id="' . $widgetName . '"/>' . $tdContent . '</label>';
|
if ($key == "Name1" || $key == "Name2") {
|
$align = "left";
|
} else {
|
$align = "center";
|
}
|
echo "<td align='" . $align . "'>" . $tdContent . "</td>";
|
}
|
echo "</tr>";
|
}
|
echo "</table>";
|
} else {
|
echo \Lang\gettext("无数据");
|
}
|
}
|
?>
|
<script type='text/javascript' src="/js/calendar.js"></script>
|
<script type='text/javascript' src="/js/common.js"></script>
|
<script>
|
function submitForm(drFileName) {
|
document.getElementById("viewDRFileName").value = drFileName;
|
document.forms[0].submit();
|
}
|
</script>
|
</body>
|
|
</html>
|