setReadOnly();
$userID = Session::getUserID();
$db = DB::db();
$connect=$db->get();
increaseRefresh("연감", 5);
$query = "select startyear,year,month,conlimit from game limit 1";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
$admin = MYDB_fetch_array($result);
$query = "select map,con,turntime from general where owner='{$userID}'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
$me = MYDB_fetch_array($result);
$con = checkLimit($me['con'], $admin['conlimit']);
if ($con >= 2) {
printLimitMsg($me['turntime']);
exit();
}
$query = "select year,month from history order by no limit 1";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
$history = MYDB_fetch_array($result);
$s = ($history['year']*12) + $history['month'];
$query = "select year,month from history order by no desc limit 1";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
$history = MYDB_fetch_array($result);
$e = ($history['year']*12) + $history['month'];
//FIXME: $yearmonth가 올바르지 않을 경우에 처리가 필요.
if (!$yearmonth) {
$year = $admin['year'];
$month = $admin['month'] - 1;
} else {
$year = intdiv($yearmonth, 100);
$month = $yearmonth % 100;
if ($btn == "◀◀ 이전달") {
$month -= 1;
} elseif ($btn == "다음달 ▶▶") {
$month += 1;
}
}
$now = ($year*12) + $month;
if ($now < $s) {
$now = $s;
}
if ($now > $e) {
$now = $e;
}
$year = intdiv($now, 12);
$month = $now % 12;
if ($month <= 0) {
$year -= 1;
$month += 12;
}
?>
연감
| 중 원 지 도 |
|
=getMapHtml();?>
| =$history['nation']?> |
=$history['power']?> |
=$history['gen']?> |
=$history['city']?> |
| 중 원 정 세 |
|
=$history['log']?>
|
| 장 수 동 향 |
|
=$history['genlog']?>
|
| =closeButton()?> |
| =banner()?> |