diff --git a/.phan/config.php b/.phan/config.php
index 34d13f21..d7f23571 100644
--- a/.phan/config.php
+++ b/.phan/config.php
@@ -44,7 +44,6 @@ return [
'hwe/a_npcList.php',
'hwe/api.php',
'hwe/a_traffic.php',
- 'hwe/a_vote.php',
'hwe/battle_simulator.php',
'hwe/b_auction.php',
'hwe/b_battleCenter.php',
@@ -63,7 +62,6 @@ return [
'hwe/b_troop.php',
'hwe/c_auction.php',
'hwe/c_tournament.php',
- 'hwe/c_vote.php',
'hwe/func_auction.php',
'hwe/func_command.php',
'hwe/func_converter.php',
diff --git a/hwe/a_vote.php b/hwe/a_vote.php
deleted file mode 100644
index e526689f..00000000
--- a/hwe/a_vote.php
+++ /dev/null
@@ -1,434 +0,0 @@
-setReadOnly();
-$userID = Session::getUserID();
-$db = DB::db();
-$gameStor = KVStorage::getStorage($db, 'game_env');
-
-increaseRefresh("설문조사", 1);
-
-$isVoteAdmin = in_array('vote', $session->acl[DB::prefix()] ?? []);
-$isVoteAdmin = $isVoteAdmin || $session->userGrade >= 5;
-
-$me = $db->queryFirstRow('SELECT no,vote from general where owner=%i', $userID);
-
-$admin = $gameStor->getValues(['develcost', 'voteopen', 'vote_title', 'vote', 'votecomment']);
-$vote_title = $admin['vote_title'] ?? '-';
-$vote = $admin['vote'] ?: ['-'];
-
-?>
-
-
-
-
- = UniqueConst::$serverName ?>: 설문조사
-
-
-
- = WebUtil::printCSS('../d_shared/common.css') ?>
-
-
- = WebUtil::printJS('../d_shared/common_path.js') ?>
- = WebUtil::printDist('ts', ['common']) ?>
-
-
-
-
-
-
-
- 설 문 조 사 = closeButton() ?> |
-
-
-
-
-
-
-
- |
-
- 전 체 통 계
-
-
- ";
- }
- echo "
- |
";
-
- if ($admin['voteopen'] >= 1 || $isVoteAdmin) {
- echo "
-
- | 전 체 |
- {$voteCount} / {$allCount} ({$percentage} %) |
-
- ";
-
- $memCount = max(1, $db->queryFirstField('SELECT count(`no`) FROM general WHERE npc<2'));
-
- $totalVote = [];
- $nationVoteCount = [];
- $nationVote = [];
-
- foreach ($db->query("SELECT nation, vote, count(`no`) as cnt FROM general WHERE npc<2 GROUP BY nation, vote") as $row) {
- $nation = $row['nation'];
- $ownVote = $row['vote'];
- $cnt = $row['cnt'];
-
- if (!isset($totalVote[$ownVote])) {
- $totalVote[$ownVote] = 0;
- }
-
- if (!isset($nationVoteCount[$nation])) {
- $nationVoteCount[$nation] = 0;
- $nationVote[$nation] = [];
- }
-
- if (!isset($nationVote[$nation][$ownVote])) {
- $nationVote[$nation][$ownVote] = 0;
- }
-
- $totalVote[$ownVote] += $cnt;
- $nationVoteCount[$nation] += $cnt;
- $nationVote[$nation][$ownVote] += $cnt;
- }
-
- $totalPer = 0;
- for ($i = 0; $i < $voteTypeCount; $i++) {
- $per = round(($totalVote[$i] ?? 0) * 100 / $memCount, 1);
- if ($i == $voteTypeCount - 1) {
- $per = 100 - $totalPer;
- } else {
- $totalPer += $per;
- }
-
-
- // if($per < 5) { $vote['cnt'] = " "; }
- ?>
-
-
-
-
- = $totalVote[$i] ?>
-
-
- |
- ";
- }
-
- if ($admin['voteopen'] >= 2 || $isVoteAdmin) {
- $memCount = $db->queryFirstField('SELECT count(no) FROM general WHERE nation=0 AND npc <2');
- if ($memCount == 0) {
- $memCount = 1;
- }
-
- if (!isset($nationVoteCount[0])) {
- $nationVoteCount[0] = 0;
- }
- $percentage = round($nationVoteCount[0] / $memCount * 100, 1);
-
- echo "
-
- | 재 야 |
- {$nationVoteCount[0]} / {$memCount} ({$percentage} %) |
-
- ";
-
- $totalPer = 0;
- for ($i = 0; $i < $voteTypeCount; $i++) {
- $per = round(Util::array_get($nationVote[0][$i], 0) / $memCount * 100, 1);
- if ($i == $voteTypeCount - 1) {
- $per = 100 - $totalPer;
- } else {
- $totalPer += $per;
- }
- // if($per < 5) { $vote['cnt'] = " "; }
- ?>
-
-
-
-
- = $nationVote[0][$i] ?>
-
-
- |
- ";
-
- foreach ($db->query('SELECT nation,color,name,gennum from nation order by gennum desc') as $i => $nation) {
- $memCount = $db->queryFirstField('SELECT count(no) FROM general WHERE nation=%i AND npc<2', $nation['nation']);
-
-
-
- $voteCount = $nationVoteCount[$nation['nation']] ?? 0;
- if ($memCount == 0) {
- $percentage = 100;
- } else {
- $percentage = round($voteCount / $memCount * 100, 1);
- }
-
-
- echo "
-
- | {$nation['name']} |
- {$voteCount} / {$memCount} ({$percentage} %) |
-
- ";
-
- $totalPer = 0;
- for ($k = 0; $k < $voteTypeCount; $k++) {
- if ($memCount == 0) {
- $per = 0;
- continue;
- }
-
- $per = round(($nationVote[$nation['nation']][$k] ?? 0) / $memCount * 100, 1);
-
- if ($i == $voteTypeCount - 1) {
- $per = 100 - $totalPer;
- } else {
- $totalPer += $per;
- }
-
- // if($per < 5) { $vote['cnt'] = " "; }
- ?>
-
-
-
-
- = $nationVote[$nation['nation']][$k] ?? 0 ?>
-
-
- |
- ";
- }
- }
- ?>
-
-
-
-
- | = closeButton() ?> |
-
-
- | = banner() ?> |
-
-
-
-
-
-
- 0) {
- $type = (($type - 1) % 7) + 1;
- }
-
- switch ($type) {
- default:
- case 0:
- $color = "black";
- break;
- case 1:
- $color = "red";
- break;
- case 2:
- $color = "orange";
- break;
- case 3:
- $color = "yellow";
- break;
- case 4:
- $color = "green";
- break;
- case 5:
- $color = "blue";
- break;
- case 6:
- $color = "navy";
- break;
- case 7:
- $color = "purple";
- break;
- }
-
- return $color;
-}
-
-function getNewColor($type)
-{
- if ($type > 0) {
- $type = (($type - 1) % 7) + 1;
- }
-
- switch ($type) {
- case 2:
- $color = "black";
- break;
- case 3:
- $color = "black";
- break;
- default:
- $color = "white";
- break;
- }
-
- return $color;
-}
diff --git a/hwe/c_vote.php b/hwe/c_vote.php
deleted file mode 100644
index bb5d6d2b..00000000
--- a/hwe/c_vote.php
+++ /dev/null
@@ -1,91 +0,0 @@
-setReadOnly();
-$userID = Session::getUserID();
-
-$isVoteAdmin = in_array('vote', $session->acl[DB::prefix()]??[]);
-$isVoteAdmin = $isVoteAdmin || $session->userGrade >= 5;
-
-$db = DB::db();
-$gameStor = KVStorage::getStorage($db, 'game_env');
-
-$admin = $gameStor->getValues(['develcost', 'cost', 'vote_title', 'vote', 'votecomment']);
-
-$generalID = Session::getGeneralID();
-
-$general = General::createGeneralObjFromDB($generalID, ['vote','horse','weapon','book','item','npc','imgsvr','picture','aux'], 2);
-
-if($btn == "투표" && $general->getVar('vote') == 0 && $sel > 0) {
- $develcost = $admin['develcost'] * 5;
- $db->update('general', [
- 'gold'=>$db->sqleval('gold + %i', $develcost),
- 'vote'=>$sel
- ], 'owner=%i', $userID);
-
- if(tryUniqueItemLottery($general, '설문조사')){
- $general->applyDB($db);
- }
-}
-else if($btn == "댓글" && trim($comment) != "") {
- $comment = StringUtil::neutralize($comment);
-
- $nation = $general->getStaticNation();
-
- if(!$admin['votecomment']){
- $admin['votecomment'] = [];
- }
- $admin['votecomment'][] = [$nation['name'],$general->getName(),$comment];
- $gameStor->votecomment = $admin['votecomment'];
-}
-
-if(!$isVoteAdmin){
- header('location:a_vote.php', true, 303);
- die();
-}
-
-
-if($btn == "수정") {
- if($title != "") {
- $gameStor->vote_title = WebUtil::htmlPurify($title);
- }
-} elseif($btn == "추가") {
- if($str != "") {
- if(!$admin['vote']){
- $admin['vote'] = [];
- }
- $admin['vote'][] = WebUtil::htmlPurify($str);
- $gameStor->vote=$admin['vote'];
- }
-} elseif($btn == "리셋") {
- $gameStor->voteopen=1;
- $gameStor->vote=['-'];
- $gameStor->vote_title = '-';
- $gameStor->votecomment=[];
-
- $db->update('general', [
- 'vote'=>0
- ], true);
-} elseif($btn == "알림") {
- $db->update('general', [
- 'newvote'=>1
- ], 'vote=0');
-} elseif($btn == "숨김") {
- $gameStor->voteopen = 0;
-} elseif($btn == "전체통계만") {
- $gameStor->voteopen = 1;
-} elseif($btn == "전부") {
- $gameStor->voteopen = 2;
-}
-
-header('location:a_vote.php', true, 303);
\ No newline at end of file
diff --git a/hwe/func_template.php b/hwe/func_template.php
index 784decae..26e5c7a7 100644
--- a/hwe/func_template.php
+++ b/hwe/func_template.php
@@ -129,7 +129,7 @@ function allButton(bool $seizeNPCMode, array $opts = [])
$site = "a_npcList.php";
$call = "빙의일람";
} else {
- $site = "a_vote.php";
+ $site = "v_vote.php";
$call = "설문조사";
}
diff --git a/hwe/ts/PageVote.vue b/hwe/ts/PageVote.vue
index deee2eb7..01ba295a 100644
--- a/hwe/ts/PageVote.vue
+++ b/hwe/ts/PageVote.vue
@@ -122,7 +122,7 @@