diff --git a/hwe/a_history.php b/hwe/a_history.php
index 72e127ba..f9416cc3 100644
--- a/hwe/a_history.php
+++ b/hwe/a_history.php
@@ -5,6 +5,7 @@ include "lib.php";
include "func.php";
$btn = Util::getReq('btn');
$yearmonth = Util::getReq('yearmonth', 'int');
+$serverID = Util::getReq('server_id', 'string', null);
extractMissingPostToGlobals();
@@ -30,10 +31,14 @@ if ($con >= 2) {
exit();
}
-[$s_year, $s_month] = $db->queryFirstList('SELECT year, month FROM history WHERE server_id = %s ORDER BY year ASC, month ASC LIMIT 1', UniqueConst::$serverID);
+if(!$serverID){
+ $serverID = UniqueConst::$serverID;
+}
+
+[$s_year, $s_month] = $db->queryFirstList('SELECT year, month FROM history WHERE server_id = %s ORDER BY year ASC, month ASC LIMIT 1', $serverID);
$s = $s_year * 12 + $s_month;
-[$e_year, $e_month] = $db->queryFirstList('SELECT year, month FROM history WHERE server_id = %s ORDER BY year DESC, month DESC LIMIT 1', UniqueConst::$serverID);
+[$e_year, $e_month] = $db->queryFirstList('SELECT year, month FROM history WHERE server_id = %s ORDER BY year DESC, month DESC LIMIT 1', $serverID);
$e = $e_year * 12 + $e_month;
//FIXME: $yearmonth가 올바르지 않을 경우에 처리가 필요.
@@ -94,7 +99,7 @@ if ($month <= 0) {
@@ -144,7 +149,7 @@ $history = $db->queryFirstRow('SELECT log,genlog,nation,power,gen,city FROM hist