<?php
|
include_once "/Common/Logging.php";
|
include_once "/language/lang.php";
|
include_once "/Common/CommFunc.php";
|
include_once "../cfg/GMT_QueryBillboard.php";
|
|
header("Content-type: text/html; charset=utf-8");
|
|
\Logging\CreateLogging("GMT_QueryBillboard.php");
|
|
\CommFunc\SessionStart();
|
|
$billboardCh = GetbillboardCh();
|
|
$resultInfo = $_POST;
|
$ResultMsg = $resultInfo["ResultMsg"];
|
|
$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'),
|
);
|
|
$bbName = "";
|
$bbType = null;
|
$resultList = null;
|
$dataTotal = null;
|
if ($ResultMsg) {
|
$bbType = $ResultMsg["BillBoardType"];
|
$resultList = $ResultMsg["BillBoardInfo"];
|
$dataTotal = $ResultMsg["dataTotal"];
|
$billboardKeyChPri = array_key_exists($bbType, $billboardCh) ? $billboardCh[$bbType] : array();
|
$bbName = $billboardKeyChPri['BBName'];
|
}
|
$retCount = count($resultList);
|
|
$cmpValue3CalcTime = 3471264000; //2080-01-01 00:00:00 的时间戳,用于存比较值3更新时间的计算值
|
$jobNameInfo = array("1" => \Lang\gettext("枪豪"), "2" => \Lang\gettext("道师"), "3" => \Lang\gettext("剑修"));
|
?>
|
|
<br />
|
<hr />
|
<a href="/GMToolClient/queryBillboard.php"><?php echo \Lang\gettext("查询实时排行榜"); ?></a> |
|
<a href="/serverinfo/billboardhis.php"><?php echo \Lang\gettext("查询历史排行榜"); ?></a>
|
<br /><br />
|
<?php
|
if ($bbName) {
|
echo "【" . $bbName . "】<br/>";
|
}
|
echo \Lang\gettext("榜单类型") . ": " . $bbType . "<br/>";
|
echo \Lang\gettext("返回条数") . ": " . $retCount . " / ". $dataTotal ."<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>";
|
|
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>";
|
?>
|
|
<hr />
|
<style type="text/css">
|
.border-table {
|
border-collapse: collapse;
|
border: none;
|
}
|
|
.border-table td {
|
border: solid #000 1px;
|
}
|
</style>
|