refactor: common_ts 분리 후 일괄 로드
This commit is contained in:
+108
-97
@@ -1,4 +1,5 @@
|
||||
<?php
|
||||
|
||||
namespace sammo;
|
||||
|
||||
include "lib.php";
|
||||
@@ -6,7 +7,7 @@ include "func.php";
|
||||
|
||||
$type = Util::getReq('type', 'int', 1);
|
||||
|
||||
if($type <= 0 || $type > 8){
|
||||
if ($type <= 0 || $type > 8) {
|
||||
$type = 1;
|
||||
}
|
||||
|
||||
@@ -22,111 +23,121 @@ $sel[$type] = "selected";
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=1024" />
|
||||
<title><?=UniqueConst::$serverName?>: 빙의일람</title>
|
||||
<?=WebUtil::printJS('../d_shared/common_path.js')?>
|
||||
<?=WebUtil::printJS('dist_js/vendors.js')?>
|
||||
<?=WebUtil::printJS('dist_js/common.js')?>
|
||||
<?=WebUtil::printCSS('../d_shared/common.css')?>
|
||||
<?=WebUtil::printCSS('dist_css/common.css')?>
|
||||
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/gh/orioncactus/pretendard/dist/web/static/pretendard.css" />
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=1024" />
|
||||
<title><?= UniqueConst::$serverName ?>: 빙의일람</title>
|
||||
<?= WebUtil::printJS('../d_shared/common_path.js') ?>
|
||||
<?= WebUtil::printJS('dist_js/vendors.js') ?>
|
||||
<?= WebUtil::printJS('dist_js/common_ts.js') ?>
|
||||
<?= WebUtil::printJS('dist_js/common.js') ?>
|
||||
<?= WebUtil::printCSS('../d_shared/common.css') ?>
|
||||
<?= WebUtil::printCSS('dist_css/common.css') ?>
|
||||
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/gh/orioncactus/pretendard/dist/web/static/pretendard.css" />
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<table align=center width=1000 class='tb_layout bg0'>
|
||||
<tr><td>빙 의 일 람<br><?=closeButton()?></td></tr>
|
||||
<tr><td><form name=form1 method=post>정렬순서 :
|
||||
<select name=type size=1>
|
||||
<option <?=$sel[1]??''?> value=1>이름</option>
|
||||
<option <?=$sel[2]??''?> value=2>국가</option>
|
||||
<option <?=$sel[3]??''?> value=3>종능</option>
|
||||
<option <?=$sel[4]??''?> value=4>통솔</option>
|
||||
<option <?=$sel[5]??''?> value=5>무력</option>
|
||||
<option <?=$sel[6]??''?> value=6>지력</option>
|
||||
<option <?=$sel[7]??''?> value=7>명성</option>
|
||||
<option <?=$sel[8]??''?> value=8>계급</option>
|
||||
</select>
|
||||
<input type=submit value='정렬하기'></form>
|
||||
</td></tr>
|
||||
</table>
|
||||
<?php
|
||||
$nationName = [];
|
||||
$nationName[0] = "-";
|
||||
foreach (getAllNationStaticInfo() as $nation) {
|
||||
$nationName[$nation['nation']] = $nation['name'];
|
||||
}
|
||||
<table align=center width=1000 class='tb_layout bg0'>
|
||||
<tr>
|
||||
<td>빙 의 일 람<br><?= closeButton() ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<form name=form1 method=post>정렬순서 :
|
||||
<select name=type size=1>
|
||||
<option <?= $sel[1] ?? '' ?> value=1>이름</option>
|
||||
<option <?= $sel[2] ?? '' ?> value=2>국가</option>
|
||||
<option <?= $sel[3] ?? '' ?> value=3>종능</option>
|
||||
<option <?= $sel[4] ?? '' ?> value=4>통솔</option>
|
||||
<option <?= $sel[5] ?? '' ?> value=5>무력</option>
|
||||
<option <?= $sel[6] ?? '' ?> value=6>지력</option>
|
||||
<option <?= $sel[7] ?? '' ?> value=7>명성</option>
|
||||
<option <?= $sel[8] ?? '' ?> value=8>계급</option>
|
||||
</select>
|
||||
<input type=submit value='정렬하기'>
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<?php
|
||||
$nationName = [];
|
||||
$nationName[0] = "-";
|
||||
foreach (getAllNationStaticInfo() as $nation) {
|
||||
$nationName[$nation['nation']] = $nation['name'];
|
||||
}
|
||||
|
||||
$generalList = $db->query('SELECT npc,nation,name,owner_name,special,special2,personal,leadership,strength,intel,leadership+strength+intel as sum,explevel,experience,dedication from general where npc=1');
|
||||
$generalListFromPool = $db->query('SELECT npc,nation,name,owner_name,special,special2,personal,leadership,strength,intel,leadership+strength+intel as sum,explevel,experience,dedication from general JOIN select_pool on general.no = select_pool.general_id where npc=0');
|
||||
$generalList = $db->query('SELECT npc,nation,name,owner_name,special,special2,personal,leadership,strength,intel,leadership+strength+intel as sum,explevel,experience,dedication from general where npc=1');
|
||||
$generalListFromPool = $db->query('SELECT npc,nation,name,owner_name,special,special2,personal,leadership,strength,intel,leadership+strength+intel as sum,explevel,experience,dedication from general JOIN select_pool on general.no = select_pool.general_id where npc=0');
|
||||
|
||||
if($generalListFromPool){
|
||||
$generalList = array_merge($generalListFromPool, $generalList);
|
||||
}
|
||||
if ($generalListFromPool) {
|
||||
$generalList = array_merge($generalListFromPool, $generalList);
|
||||
}
|
||||
|
||||
$sortType = [
|
||||
1 => ['name', true],
|
||||
2 => ['nation', true],
|
||||
3 => ['sum', false],
|
||||
4 => ['leadership', false],
|
||||
5 => ['strength', false],
|
||||
6 => ['intel', false],
|
||||
7 => ['experience', false],
|
||||
8 => ['dedication', false],
|
||||
];
|
||||
$sortType = [
|
||||
1 => ['name', true],
|
||||
2 => ['nation', true],
|
||||
3 => ['sum', false],
|
||||
4 => ['leadership', false],
|
||||
5 => ['strength', false],
|
||||
6 => ['intel', false],
|
||||
7 => ['experience', false],
|
||||
8 => ['dedication', false],
|
||||
];
|
||||
|
||||
[$sortKey, $isAsc] = $sortType[$type];
|
||||
[$sortKey, $isAsc] = $sortType[$type];
|
||||
|
||||
if($isAsc){
|
||||
usort($generalList, function($lhs, $rhs)use($sortKey){
|
||||
return $lhs[$sortKey] <=> $rhs[$sortKey];
|
||||
});
|
||||
}
|
||||
else{
|
||||
usort($generalList, function($lhs, $rhs)use($sortKey){
|
||||
return $rhs[$sortKey] <=> $lhs[$sortKey];
|
||||
});
|
||||
}
|
||||
if ($isAsc) {
|
||||
usort($generalList, function ($lhs, $rhs) use ($sortKey) {
|
||||
return $lhs[$sortKey] <=> $rhs[$sortKey];
|
||||
});
|
||||
} else {
|
||||
usort($generalList, function ($lhs, $rhs) use ($sortKey) {
|
||||
return $rhs[$sortKey] <=> $lhs[$sortKey];
|
||||
});
|
||||
}
|
||||
|
||||
?>
|
||||
<table align=center width=1000 class='tb_layout bg0'>
|
||||
<tr>
|
||||
<td width=102 align=center class='bg1'>희생된 장수</td>
|
||||
<td width=102 align=center class='bg1'>악령 이름</td>
|
||||
<td width=68 align=center class='bg1'>레벨</td>
|
||||
<td width=118 align=center class='bg1'>국가</td>
|
||||
<td width=68 align=center class='bg1'>성격</td>
|
||||
<td width=88 align=center class='bg1'>특기</td>
|
||||
<td width=68 align=center class='bg1'>종능</td>
|
||||
<td width=68 align=center class='bg1'>통솔</td>
|
||||
<td width=68 align=center class='bg1'>무력</td>
|
||||
<td width=68 align=center class='bg1'>지력</td>
|
||||
<td width=78 align=center class='bg1'>명성</td>
|
||||
<td width=78 align=center class='bg1'>계급</td>
|
||||
</tr>
|
||||
<?php foreach($generalList as $general): ?>
|
||||
<tr>
|
||||
<td align=center><?=getColoredName($general['name'], $general['npc'])?></td>
|
||||
<td align=center><?=$general['owner_name']?></td>
|
||||
<td align=center>Lv <?=$general['explevel']?></td>
|
||||
<td align=center><?=$nationName[$general['nation']]?></td>
|
||||
<td align=center><?=displayCharInfo($general['personal'])?></td>
|
||||
<td align=center><?=displaySpecialDomesticInfo($general['special'])?> / <?=displaySpecialWarInfo($general['special2'])?></td>
|
||||
<td align=center><?=$general['sum']?></td>
|
||||
<td align=center><?=$general['leadership']?></td>
|
||||
<td align=center><?=$general['strength']?></td>
|
||||
<td align=center><?=$general['intel']?></td>
|
||||
<td align=center><?=$general['experience']?></td>
|
||||
<td align=center><?=$general['dedication']?></td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</table>
|
||||
<table align=center width=1000 class='tb_layout bg0'>
|
||||
<tr><td><?=closeButton()?></td></tr>
|
||||
<tr><td><?=banner()?></td></tr>
|
||||
</table>
|
||||
?>
|
||||
<table align=center width=1000 class='tb_layout bg0'>
|
||||
<tr>
|
||||
<td width=102 align=center class='bg1'>희생된 장수</td>
|
||||
<td width=102 align=center class='bg1'>악령 이름</td>
|
||||
<td width=68 align=center class='bg1'>레벨</td>
|
||||
<td width=118 align=center class='bg1'>국가</td>
|
||||
<td width=68 align=center class='bg1'>성격</td>
|
||||
<td width=88 align=center class='bg1'>특기</td>
|
||||
<td width=68 align=center class='bg1'>종능</td>
|
||||
<td width=68 align=center class='bg1'>통솔</td>
|
||||
<td width=68 align=center class='bg1'>무력</td>
|
||||
<td width=68 align=center class='bg1'>지력</td>
|
||||
<td width=78 align=center class='bg1'>명성</td>
|
||||
<td width=78 align=center class='bg1'>계급</td>
|
||||
</tr>
|
||||
<?php foreach ($generalList as $general) : ?>
|
||||
<tr>
|
||||
<td align=center><?= getColoredName($general['name'], $general['npc']) ?></td>
|
||||
<td align=center><?= $general['owner_name'] ?></td>
|
||||
<td align=center>Lv <?= $general['explevel'] ?></td>
|
||||
<td align=center><?= $nationName[$general['nation']] ?></td>
|
||||
<td align=center><?= displayCharInfo($general['personal']) ?></td>
|
||||
<td align=center><?= displaySpecialDomesticInfo($general['special']) ?> / <?= displaySpecialWarInfo($general['special2']) ?></td>
|
||||
<td align=center><?= $general['sum'] ?></td>
|
||||
<td align=center><?= $general['leadership'] ?></td>
|
||||
<td align=center><?= $general['strength'] ?></td>
|
||||
<td align=center><?= $general['intel'] ?></td>
|
||||
<td align=center><?= $general['experience'] ?></td>
|
||||
<td align=center><?= $general['dedication'] ?></td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</table>
|
||||
<table align=center width=1000 class='tb_layout bg0'>
|
||||
<tr>
|
||||
<td><?= closeButton() ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?= banner() ?></td>
|
||||
</tr>
|
||||
</table>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
</html>
|
||||
Reference in New Issue
Block a user