왕조일람 임시 갱신

This commit is contained in:
2018-07-03 06:59:27 +09:00
parent 4c25d2275c
commit 2b36ffef45
2 changed files with 88 additions and 9 deletions
+30 -9
View File
@@ -6,11 +6,11 @@ include "func.php";
$select = Util::getReq('select', 'int', 0);
extractMissingPostToGlobals();
$db = DB::db();
$connect=$db->get();
$templates = new \League\Plates\Engine('templates');
$templates->registerFunction('ConvertLog', '\sammo\ConvertLog');
$templates->registerFunction('newColor', '\sammo\newColor');
increaseRefresh("왕조일람", 1);
?>
<!DOCTYPE html>
@@ -36,12 +36,7 @@ increaseRefresh("왕조일람", 1);
<?php
if ($select == 0) {
$query = "select * from emperior order by no desc";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
$empcount = MYDB_num_rows($result);
for ($i=0; $i < $empcount; $i++) {
$emperior = MYDB_fetch_array($result);
foreach($db->query('SELECT * FROM emperior ORDER BY `no` DESC') as $emperior){
?>
@@ -100,6 +95,7 @@ if ($select == 0) {
}
$emperior = $db->queryFirstRow('SELECT * FROM emperior WHERE `no`=%i',$select);
$serverID = $emperior['server_id']??($emperior['serverID']??null);
?>
<table align=center width=1000 class='tb_layout bg0'>
@@ -210,6 +206,31 @@ $emperior = $db->queryFirstRow('SELECT * FROM emperior WHERE `no`=%i',$select);
</tr>
</table>
<?php
if($serverID){
$nations = $db->query('SELECT * FROM ng_old_nations WHERE server_id=%s ORDER BY date DESC', $serverID);
foreach($nations as $nation){
if(!$nation['nation']??null){
continue;
}
$nation += Json::decode($nation['data']);
$nation['typeName'] = getNationType($nation['type']);
$nation['levelName'] = getNationLevel($nation['level']);
if($nation['generals']){
$generals = $db->query('SELECT `general_no`, `name` FROM ng_old_generals WHERE server_id=%s AND general_no IN %li', $serverID, $nation['generals']);
$nation['generalsFull'] = $generals;
}
else{
$nation['generalsFull'] = [];
}
echo $templates->render('oldNation', $nation);
}
}
?>
<table align=center width=1000 class='tb_layout bg0'>
<tr><td><?=closeButton()?></td></tr>
<tr><td><?=banner()?></td></tr>
+58
View File
@@ -0,0 +1,58 @@
<table width=1000 class='tb_layout bg2' style="margin:auto;margin-top:20px;">
<colgroup>
<col style="width:98px;" />
<col style="width:238px;" />
<col style="width:98px;" />
<col style="width:238px;" />
<col style="width:98px;" />
<col style="width:238px;" />
</colgroup>
<thead>
<tr>
<td colspan=8 style="color:<?=$this->newColor($color)?>; background-color:<?=$color?>; text-align:center;"
> <?=$name?> 】</td>
</tr>
</thead>
<tbody style="text-align:center;">
<tr>
<td class="bg1">성향</td>
<td><?=$typeName?></td>
<td class="bg1">멸망 시기</td>
<td><?=$last_year??0?>년 <?=$last_month??0?>월</td>
<td class="bg1">일자</td>
<td><?=$date?></td>
</tr>
<tr>
<td class="bg1">최종 작위</td>
<td><?=$levelName?></td>
<td class="bg1">최종 장수 수</td>
<td><?=count($generals)?>명</td>
<td class="bg1">기술력</td>
<td><?=$tech?></td>
</tr>
<tr>
<td class="bg1">최대 영토 수</td>
<td><?=count($cities??[])?></td>
<td class="bg1">최대 병력 수</td>
<td><?=$maxArmy??0?>명</td>
<td class="bg1">최대 국력</td>
<td><?=$maxPower??0?></td>
</tr>
<tr>
<td valign=top class="bg1"> 최대영토</td>
<td colspan=5><?=join(', ',$cities??[])?></td>
</tr>
<tr>
<td valign=top class="bg1"> 장수명단</td>
<td colspan=5>
<?php foreach($generalsFull as $general): ?>
<?=$general['name']?>,
<?php endforeach; ?>
</td>
</tr>
<tr>
<td valign=top class="bg1">국가열전</td>
<td colspan=5 class='bg0' style="text-align:left;"><?=$this->ConvertLog($history)?></td>
</tr>
</tbody>
</table>