$connect 잘 가
This commit is contained in:
@@ -21,7 +21,6 @@ return [
|
||||
|
||||
'file_list' => [
|
||||
'f_config/config.php',
|
||||
'hwe/MYDB.php',
|
||||
'hwe/a_bestGeneral.php',
|
||||
'hwe/a_emperior.php',
|
||||
'hwe/a_emperior2.php',
|
||||
|
||||
@@ -1,30 +0,0 @@
|
||||
<?php
|
||||
namespace sammo;
|
||||
|
||||
function MYDB_query($query, $connect)
|
||||
{
|
||||
return mysqli_query($connect, $query);
|
||||
}
|
||||
|
||||
function MYDB_num_rows(\mysqli_result $result) : int
|
||||
{
|
||||
return mysqli_num_rows($result);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return mixed[]|null
|
||||
*/
|
||||
function MYDB_fetch_array(\mysqli_result $result)
|
||||
{
|
||||
return mysqli_fetch_array($result);
|
||||
}
|
||||
|
||||
function MYDB_fetch_row(\mysqli_result $result)
|
||||
{
|
||||
return mysqli_fetch_row($result);
|
||||
}
|
||||
|
||||
function MYDB_error($connect)
|
||||
{
|
||||
return mysqli_error($connect);
|
||||
}
|
||||
+22
-40
@@ -23,7 +23,6 @@ if ($session->userGrade < 5) {
|
||||
}
|
||||
|
||||
$db = DB::db();
|
||||
$connect = $db->get();
|
||||
|
||||
$sel = [];
|
||||
$sel2 = [];
|
||||
@@ -86,11 +85,7 @@ $sel2[$type2] = "selected";
|
||||
<select name=nation size=1 style=color:white;background-color:black>";
|
||||
<option value=0>재야</option>";
|
||||
<?php
|
||||
$query = "select nation,name,color,scout,gennum from nation order by power";
|
||||
$result = MYDB_query($query, $connect) or Error("aaa_processing.php " . MYDB_error($connect), "");
|
||||
$count = MYDB_num_rows($result);
|
||||
for ($i = 1; $i <= $count; $i++) {
|
||||
$nation = MYDB_fetch_array($result);
|
||||
foreach ($db->query('SELECT nation,name,color,scout,gennum from nation order by power DESC') as $nation) {
|
||||
|
||||
echo "
|
||||
<option value={$nation['nation']}>{$nation['name']}</option>";
|
||||
@@ -216,35 +211,27 @@ GROUP BY B.nation
|
||||
$query .= " order by avg(B.dex5) desc";
|
||||
break;
|
||||
}
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__ . MYDB_error($connect), "");
|
||||
$nationCount = MYDB_num_rows($result);
|
||||
for ($i = 0; $i < $nationCount; $i++) {
|
||||
$nation = MYDB_fetch_array($result);
|
||||
foreach($db->query($query) as $nation){
|
||||
$gen = $db->queryFirstRow('SELECT COUNT(*) as cnt,
|
||||
ROUND(AVG(gold)) as avgg,
|
||||
ROUND(AVG(rice)) as avgr,
|
||||
SUM(leadership) as leadership, ROUND(AVG(leadership), 1) as avgl,
|
||||
ROUND(AVG(strength), 1) as avgs,
|
||||
ROUND(AVG(intel), 1) as avgi,
|
||||
ROUND(AVG(explevel), 1) as avge,
|
||||
SUM(crew) as crew
|
||||
from general where nation=%i',$nation['nation']);
|
||||
|
||||
$query = "select COUNT(*) as cnt,
|
||||
ROUND(AVG(gold)) as avgg,
|
||||
ROUND(AVG(rice)) as avgr,
|
||||
SUM(leadership) as leadership, ROUND(AVG(leadership), 1) as avgl,
|
||||
ROUND(AVG(strength), 1) as avgs,
|
||||
ROUND(AVG(intel), 1) as avgi,
|
||||
ROUND(AVG(explevel), 1) as avge,
|
||||
SUM(crew) as crew
|
||||
from general where nation='{$nation['nation']}'";
|
||||
$genResult = MYDB_query($query, $connect) or Error(__LINE__ . MYDB_error($connect), "");
|
||||
$gen = MYDB_fetch_array($genResult);
|
||||
|
||||
$query = "select COUNT(*) as cnt,
|
||||
SUM(pop) as pop, SUM(pop_max) as pop_max,
|
||||
ROUND(SUM(pop)/SUM(pop_max)*100, 2) as rate,
|
||||
trust,
|
||||
ROUND(SUM(agri)/SUM(agri_max)*100, 2) as agri,
|
||||
ROUND(SUM(comm)/SUM(comm_max)*100, 2) as comm,
|
||||
ROUND(SUM(secu)/SUM(secu_max)*100, 2) as secu,
|
||||
ROUND(SUM(wall)/SUM(wall_max)*100, 2) as wall,
|
||||
ROUND(SUM(def)/SUM(def_max)*100, 2) as def
|
||||
from city where nation='{$nation['nation']}'";
|
||||
$cityResult = MYDB_query($query, $connect) or Error(__LINE__ . MYDB_error($connect), "");
|
||||
$city = MYDB_fetch_array($cityResult);
|
||||
$city = $db->queryFirstRow('SELECT COUNT(*) as cnt,
|
||||
SUM(pop) as pop, SUM(pop_max) as pop_max,
|
||||
ROUND(SUM(pop)/SUM(pop_max)*100, 2) as rate,
|
||||
trust,
|
||||
ROUND(SUM(agri)/SUM(agri_max)*100, 2) as agri,
|
||||
ROUND(SUM(comm)/SUM(comm_max)*100, 2) as comm,
|
||||
ROUND(SUM(secu)/SUM(secu_max)*100, 2) as secu,
|
||||
ROUND(SUM(wall)/SUM(wall_max)*100, 2) as wall,
|
||||
ROUND(SUM(def)/SUM(def_max)*100, 2) as def
|
||||
from city where nation=%i', $nation['nation']);
|
||||
|
||||
echo "
|
||||
<tr>
|
||||
@@ -324,12 +311,7 @@ GROUP BY B.nation
|
||||
?>
|
||||
</tr>
|
||||
<?php
|
||||
$query = "select * from statistic where month=1 or no=1";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__ . MYDB_error($connect), "");
|
||||
$count = MYDB_num_rows($result);
|
||||
for ($i = 0; $i < $count; $i++) {
|
||||
$stat = MYDB_fetch_array($result);
|
||||
|
||||
foreach($db->query('SELECT * from statistic where month=1 or no=1') as $stat){
|
||||
echo "
|
||||
<tr>
|
||||
<td align=center>{$stat['year']}</td>
|
||||
|
||||
@@ -1,211 +0,0 @@
|
||||
<?php
|
||||
namespace sammo;
|
||||
|
||||
include "lib.php";
|
||||
include "func.php";
|
||||
|
||||
$select = Util::getReq('select', 'int', 0);
|
||||
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
increaseRefresh("왕조일람", 2);
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<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('../e_lib/jquery-3.3.1.min.js')?>
|
||||
<?=WebUtil::printJS('../e_lib/bootstrap.bundle.min.js')?>
|
||||
<?=WebUtil::printJS('js/common.js')?>
|
||||
<?=WebUtil::printCSS('../e_lib/bootstrap.min.css')?>
|
||||
<?=WebUtil::printCSS('../d_shared/common.css')?>
|
||||
<?=WebUtil::printCSS('css/common.css')?>
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<table align=center width=1000 class='tb_layout bg0'>
|
||||
<tr><td>역 대 왕 조<br>
|
||||
<input type=button value='창 닫기' onclick=window.close()><br>
|
||||
</td></tr>
|
||||
</table>
|
||||
|
||||
<?php
|
||||
|
||||
if ($select == 0) {
|
||||
$query = "select * from emperior_table 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);
|
||||
|
||||
echo "
|
||||
<form action=a_emperior2.php method=post>
|
||||
<table align=center width=1000 class='tb_layout bg0'>
|
||||
<tr>
|
||||
<td bgcolor=skyblue align=center colspan=8>
|
||||
<font size=5>{$emperior['phase']}</font>
|
||||
<input type=submit value='자세히'>
|
||||
<input type=hidden name=select value='{$emperior['no']}'>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align=center style=color:".newColor($emperior['color'])."; bgcolor={$emperior['color']} colspan=8>
|
||||
<font size=5>{$emperior['name']} ({$emperior['year']}年 {$emperior['month']}月)</font>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td id=bg1 align=center width=80>국 력</td>
|
||||
<td align=center width=170>{$emperior['power']}</td>
|
||||
<td id=bg1 align=center width=80>장 수</td>
|
||||
<td align=center width=170>{$emperior['gennum']}</td>
|
||||
<td id=bg1 align=center width=80>속 령</td>
|
||||
<td align=center width=170>{$emperior['citynum']}</td>
|
||||
<td id=bg1 align=center width=80>성 향</td>
|
||||
<td align=center width=170>{$emperior['type']}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td id=bg1 align=center>황 제</td>
|
||||
<td align=center>{$emperior['l12name']}</td>
|
||||
<td id=bg1 align=center>승 상</td>
|
||||
<td align=center>{$emperior['l11name']}</td>
|
||||
<td id=bg1 align=center>위 장 군</td>
|
||||
<td align=center>{$emperior['l10name']}</td>
|
||||
<td id=bg1 align=center>사 공</td>
|
||||
<td align=center>{$emperior['l9name']}</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>";
|
||||
}
|
||||
} else {
|
||||
$query = "select * from emperior_table where no='$select'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
|
||||
$emperior = MYDB_fetch_array($result);
|
||||
|
||||
echo "
|
||||
<form action=a_emperior2.php method=post>
|
||||
<table align=center width=1000 class='tb_layout bg0'>
|
||||
<tr>
|
||||
<td bgcolor=skyblue align=center colspan=6>
|
||||
<font size=5>{$emperior['phase']}</font>
|
||||
<input type=submit value='전체보기'>
|
||||
<input type=hidden name=select value='0'>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td id=bg1 width=98 align=center>국 가 수<br>(최종 / 최대)</td>
|
||||
<td align=center width=398 colspan=2>{$emperior['nation_count']}</td>
|
||||
<td id=bg1 width=98 align=center>장 수 수<br>(최종 / 최대)</td>
|
||||
<td align=center width=398 colspan=2>{$emperior['gen_count']}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td id=bg1 align=center>등 장 국 가</td>
|
||||
<td colspan=5>{$emperior['nation_name']}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td id=bg1 align=center>국가별 성향</td>
|
||||
<td colspan=5>{$emperior['nation_hist']}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td id=bg1 align=center>장 수 성 격</td>
|
||||
<td colspan=5>{$emperior['personal_hist']}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td id=bg1 align=center>장 수 특 기</td>
|
||||
<td colspan=5>{$emperior['special_hist']}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align=center style=color:".newColor($emperior['color'])."; bgcolor={$emperior['color']} colspan=6>
|
||||
<font size=5>{$emperior['name']} ({$emperior['year']}年 {$emperior['month']}月)</font>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td id=bg1 width=98 align=center>국 력</td>
|
||||
<td align=center width=398 colspan=2>{$emperior['power']}</td>
|
||||
<td id=bg1 width=98 align=center>성 향</td>
|
||||
<td align=center width=398 colspan=2>{$emperior['type']}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td id=bg1 width=98 align=center>장 수</td>
|
||||
<td align=center width=398 colspan=2>{$emperior['gennum']}</td>
|
||||
<td id=bg1 width=98 align=center>속 령</td>
|
||||
<td align=center width=398 colspan=2>{$emperior['citynum']}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td id=bg1 align=center>총 인 구</td>
|
||||
<td align=center colspan=2>{$emperior['pop']}</td>
|
||||
<td id=bg1 align=center>인 구 율</td>
|
||||
<td align=center colspan=2>{$emperior['poprate']}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td id=bg1 align=center>국 고</td>
|
||||
<td align=center colspan=2>{$emperior['gold']}</td>
|
||||
<td id=bg1 align=center>병 량</td>
|
||||
<td align=center colspan=2>{$emperior['rice']}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td id=bg1 align=center>황 제</td>
|
||||
<td width=64> </td>
|
||||
<td width=332>{$emperior['l12name']}</td>
|
||||
<td id=bg1 align=center>승 상</td>
|
||||
<td width=64> </td>
|
||||
<td width=332>{$emperior['l11name']}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td id=bg1 align=center>위 장 군</td>
|
||||
<td width=64> </td>
|
||||
<td width=332>{$emperior['l10name']}</td>
|
||||
<td id=bg1 align=center>사 공</td>
|
||||
<td width=64> </td>
|
||||
<td width=332>{$emperior['l9name']}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td id=bg1 align=center>표 기 장 군</td>
|
||||
<td width=64> </td>
|
||||
<td width=332>{$emperior['l8name']}</td>
|
||||
<td id=bg1 align=center>태 위</td>
|
||||
<td width=64> </td>
|
||||
<td width=332>{$emperior['l7name']}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td id=bg1 align=center>거 기 장 군</td>
|
||||
<td width=64> </td>
|
||||
<td width=332>{$emperior['l6name']}</td>
|
||||
<td id=bg1 align=center>사 도</td>
|
||||
<td width=64> </td>
|
||||
<td width=332>{$emperior['l5name']}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td id=bg1 align=center>오 호 장 군</td>
|
||||
<td colspan=5>{$emperior['tiger']}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td id=bg1 align=center>건 안 칠 자</td>
|
||||
<td colspan=5>{$emperior['eagle']}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td id=bg1 align=center>장 수 들<br>(공헌도 순서)</td>
|
||||
<td colspan=5>{$emperior['gen']}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td id=bg1 align=center>역 사 기 록</td>
|
||||
<td colspan=5>".formatHistoryToHTML(Json::decode($emperior['history']))."</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>";
|
||||
}
|
||||
?>
|
||||
|
||||
<table align=center width=1000 class='tb_layout bg0'>
|
||||
<tr><td><?=closeButton()?></td></tr>
|
||||
<tr><td><?=banner()?></td></tr>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
+2
-13
@@ -13,7 +13,6 @@ $userID = Session::getUserID();
|
||||
|
||||
$db = DB::db();
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
$connect=$db->get();
|
||||
|
||||
increaseRefresh("거래장", 2);
|
||||
|
||||
@@ -79,13 +78,8 @@ if ($msg2 == "") {
|
||||
<td width=148>거래종료</td>
|
||||
</tr>
|
||||
<?php
|
||||
$query = "select * from auction where type=0 order by expire";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
|
||||
$count = MYDB_num_rows($result);
|
||||
|
||||
$chk = 0;
|
||||
for ($i=0; $i < $count; $i++) {
|
||||
$auction = MYDB_fetch_array($result);
|
||||
foreach($db->query('SELECT * from auction where type=0 order by expire') as $auction){
|
||||
$radio = "";
|
||||
$alert = "";
|
||||
$alert2 = "";
|
||||
@@ -172,13 +166,8 @@ for ($i=0; $i < $count; $i++) {
|
||||
<td width=148>거래종료</td>
|
||||
</tr>
|
||||
<?php
|
||||
$query = "select * from auction where type=1 order by expire";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
|
||||
$count = MYDB_num_rows($result);
|
||||
|
||||
$chk = 0;
|
||||
for ($i=0; $i < $count; $i++) {
|
||||
$auction = MYDB_fetch_array($result);
|
||||
foreach($db->query('SELECT * from auction where type=1 order by expire') as $auction){
|
||||
$radio = "";
|
||||
$alert = "";
|
||||
$alert2 = "";
|
||||
|
||||
+31
-27
@@ -9,7 +9,6 @@ $userID = Session::getUserID();
|
||||
|
||||
$db = DB::db();
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
$connect=$db->get();
|
||||
|
||||
increaseRefresh("베팅장", 1);
|
||||
TurnExecutionHelper::executeAllCommand();
|
||||
@@ -86,14 +85,15 @@ if($str3){
|
||||
<tr align=center><td height=10 colspan=16></td></tr>
|
||||
<tr align=center>
|
||||
<?php
|
||||
$query = "select npc,name,win from tournament where grp>=60 order by grp, grp_no";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
|
||||
for ($i=0; $i < 1; $i++) {
|
||||
$general = MYDB_fetch_array($result)??[
|
||||
$generalList = $db->query('SELECT npc,name,win from tournament where grp>=60 order by grp, grp_no LIMIT 1');
|
||||
while(count($generalList) < 1){
|
||||
$generalList[] = [
|
||||
'name'=>'-',
|
||||
'npc'=>0,
|
||||
'name'=>'',
|
||||
'win'=>0
|
||||
];
|
||||
}
|
||||
foreach($generalList as $i=>$general){
|
||||
if ($general['name'] == "") {
|
||||
$general['name'] = "-";
|
||||
}
|
||||
@@ -109,20 +109,21 @@ echo "
|
||||
</tr>
|
||||
<tr align=center>";
|
||||
|
||||
$query = "select npc,name,win from tournament where grp>=50 order by grp, grp_no";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
|
||||
$cent = [];
|
||||
$line = [];
|
||||
$gen = [];
|
||||
for ($i=0; $i < 1; $i++) {
|
||||
$cent[$i] = "<font color=white>";
|
||||
}
|
||||
for ($i=0; $i < 2; $i++) {
|
||||
$general = MYDB_fetch_array($result)??[
|
||||
$generalList = $db->query('SELECT npc,name,win from tournament where grp>=50 order by grp, grp_no LIMIT 2');
|
||||
while(count($generalList) < 2){
|
||||
$generalList[] = [
|
||||
'name'=>'-',
|
||||
'npc'=>0,
|
||||
'name'=>'',
|
||||
'win'=>0
|
||||
];
|
||||
}
|
||||
foreach($generalList as $i=>$general){
|
||||
if ($general['name'] == "") {
|
||||
$general['name'] = "-";
|
||||
}
|
||||
@@ -157,17 +158,18 @@ echo "
|
||||
</tr>
|
||||
<tr align=center>";
|
||||
|
||||
$query = "select npc,name,win from tournament where grp>=40 order by grp, grp_no";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
|
||||
for ($i=0; $i < 2; $i++) {
|
||||
$cent[$i] = "<font color=white>";
|
||||
}
|
||||
for ($i=0; $i < 4; $i++) {
|
||||
$general = MYDB_fetch_array($result)??[
|
||||
$generalList = $db->query('SELECT npc,name,win from tournament where grp>=40 order by grp, grp_no LIMIT 4');
|
||||
while(count($generalList) < 4){
|
||||
$generalList[] = [
|
||||
'name'=>'-',
|
||||
'npc'=>0,
|
||||
'name'=>'',
|
||||
'win'=>0
|
||||
];
|
||||
}
|
||||
foreach($generalList as $i=>$general){
|
||||
if ($general['name'] == "") {
|
||||
$general['name'] = "-";
|
||||
}
|
||||
@@ -202,17 +204,18 @@ echo "
|
||||
</tr>
|
||||
<tr align=center>";
|
||||
|
||||
$query = "select npc,name,win from tournament where grp>=30 order by grp, grp_no";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
|
||||
for ($i=0; $i < 4; $i++) {
|
||||
$cent[$i] = "<font color=white>";
|
||||
}
|
||||
for ($i=0; $i < 8; $i++) {
|
||||
$general = MYDB_fetch_array($result)??[
|
||||
$generalList = $db->query('SELECT npc,name,win from tournament where grp>=30 order by grp, grp_no LIMIT 8');
|
||||
while(count($generalList) < 8){
|
||||
$generalList[] = [
|
||||
'name'=>'-',
|
||||
'npc'=>0,
|
||||
'name'=>'',
|
||||
'win'=>0
|
||||
];
|
||||
}
|
||||
foreach($generalList as $i=>$general){
|
||||
if ($general['name'] == "") {
|
||||
$general['name'] = "-";
|
||||
}
|
||||
@@ -247,17 +250,18 @@ echo "
|
||||
</tr>
|
||||
<tr align=center>";
|
||||
|
||||
$query = "select npc,name,win from tournament where grp>=20 order by grp, grp_no";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
|
||||
for ($i=0; $i < 8; $i++) {
|
||||
$cent[$i] = "<font color=white>";
|
||||
}
|
||||
for ($i=0; $i < 16; $i++) {
|
||||
$general = MYDB_fetch_array($result)??[
|
||||
$generalList = $db->query('SELECT npc,name,win from tournament where grp>=20 order by grp, grp_no LIMIT 16');
|
||||
while(count($generalList) < 16){
|
||||
$generalList[] = [
|
||||
'name'=>'-',
|
||||
'npc'=>0,
|
||||
'name'=>'',
|
||||
'win'=>0
|
||||
];
|
||||
}
|
||||
foreach($generalList as $i=>$general){
|
||||
if ($general['name'] == "") {
|
||||
$general['name'] = "-";
|
||||
}
|
||||
@@ -456,7 +460,7 @@ foreach($tournamentType as $tournamentTypeText=>[$statTypeText,$statFunc,$rankCo
|
||||
$tournamentRankerList = array_splice($tournamentRankerList, 0, 30);
|
||||
foreach($tournamentRankerList as $rank=>$ranker){
|
||||
printRow(
|
||||
$rank+1,
|
||||
$rank,
|
||||
$ranker->getNPCType(),
|
||||
$ranker->getName(),
|
||||
($statFunc)($ranker),
|
||||
|
||||
+4
-20
@@ -12,14 +12,10 @@ $userID = Session::getUserID();
|
||||
$userGrade = Session::getUserGrade();
|
||||
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
increaseRefresh("현재도시", 1);
|
||||
|
||||
$query = "select no,nation,officer_level,city from general where owner='{$userID}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$me = MYDB_fetch_array($result);
|
||||
|
||||
$me = $db->queryFirstRow('SELECT no,nation,officer_level,city from general where owner=%i', $userID);
|
||||
$myNation = $db->queryFirstRow('SELECT nation,level,spy FROM nation WHERE nation=%i', $me['nation']);
|
||||
|
||||
$templates = new \League\Plates\Engine('templates');
|
||||
@@ -78,9 +74,7 @@ if(!$citylist){
|
||||
// 재야일때는 현재 도시만
|
||||
$valid = 0;
|
||||
if($me['officer_level'] == 0) {
|
||||
$query = "select city,name,nation from city where city='{$me['city']}'";
|
||||
$cityresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$city = MYDB_fetch_array($cityresult);
|
||||
$city = $db->queryFirstRow('SELECT city,name,nation from city where city=%i', $me['city']);
|
||||
echo "
|
||||
<option value={$city['city']}";
|
||||
if($city['city'] == $citylist) { echo " selected"; $valid = 1; }
|
||||
@@ -91,12 +85,7 @@ if($me['officer_level'] == 0) {
|
||||
echo "</option>";
|
||||
} else {
|
||||
// 아국 도시들 선택
|
||||
$query = "select city,name,nation from city where nation='{$me['nation']}'";
|
||||
$cityresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$citycount = MYDB_num_rows($cityresult);
|
||||
|
||||
for($i=0; $i < $citycount; $i++) {
|
||||
$city = MYDB_fetch_array($cityresult);
|
||||
foreach($db->query('SELECT city,name,nation from city where nation=%i', $me['nation']) as $city){
|
||||
echo "
|
||||
<option value={$city['city']}";
|
||||
if($city['city'] == $citylist) { echo " selected"; $valid = 1; }
|
||||
@@ -108,12 +97,7 @@ if($me['officer_level'] == 0) {
|
||||
}
|
||||
|
||||
// 아국 장수가 있는 타국 도시들 선택
|
||||
$query = "select distinct A.city,B.name,B.nation from general A,city B where A.city=B.city and A.nation='{$me['nation']}' and B.nation!='{$me['nation']}'";
|
||||
$cityresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$citycount = MYDB_num_rows($cityresult);
|
||||
|
||||
for($i=0; $i < $citycount; $i++) {
|
||||
$city = MYDB_fetch_array($cityresult);
|
||||
foreach ($db->query('SELECT distinct A.city,B.name,B.nation from general A,city B where A.city=B.city and A.nation=%i and B.nation!=%i', $me['nation'], $me['nation']) as $city){
|
||||
echo "
|
||||
<option value={$city['city']}";
|
||||
if($city['city'] == $citylist) { echo " selected"; $valid = 1; }
|
||||
|
||||
+48
-85
@@ -8,15 +8,12 @@ $session = Session::requireGameLogin()->setReadOnly();
|
||||
$userID = Session::getUserID();
|
||||
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
increaseRefresh("인사부", 1);
|
||||
//훼섭 추방을 위해 갱신
|
||||
TurnExecutionHelper::executeAllCommand();
|
||||
|
||||
$query = "select no,nation,officer_level from general where owner='{$userID}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$me = MYDB_fetch_array($result);
|
||||
$me = $db->queryFirstRow('SELECT no,nation,officer_level from general where owner=%i', $userID);
|
||||
$nationID = $me['nation'];
|
||||
|
||||
$meLevel = $me['officer_level'];
|
||||
@@ -25,6 +22,8 @@ if($meLevel == 0) {
|
||||
exit();
|
||||
}
|
||||
|
||||
$nation = $db->queryFirstRow('SELECT nation,name,level,color,chief_set from nation where nation=%i', $nationID); //국가정보
|
||||
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
@@ -51,10 +50,6 @@ var myLevel = <?=$meLevel?>;
|
||||
|
||||
<?php
|
||||
|
||||
$query = "select nation,name,level,color,chief_set from nation where nation='{$nationID}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$nation = MYDB_fetch_array($result); //국가정보
|
||||
|
||||
$ambassadors = $db->query('SELECT no, name, officer_level, penalty, permission FROM general WHERE permission = \'ambassador\' AND nation = %i', $nationID);
|
||||
$auditors = $db->query('SELECT no, name, officer_level, penalty, permission FROM general WHERE permission = \'auditor\' AND nation = %i', $nationID);
|
||||
$candidateAmbassadors = [];
|
||||
@@ -108,13 +103,13 @@ $lv = getNationChiefLevel($nation['level']);
|
||||
if($meLevel >= 5) { $btn = "button"; }
|
||||
else { $btn = "hidden"; }
|
||||
|
||||
$query = "select name,officer_level,picture,imgsvr,belong from general where nation='{$nationID}' and officer_level>={$lv} order by officer_level desc";
|
||||
$genresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$level = [];
|
||||
for($i=12; $i >= $lv; $i--) {
|
||||
$levels = MYDB_fetch_array($genresult);
|
||||
$level[$levels['officer_level']] = $levels;
|
||||
}
|
||||
$level = Util::convertArrayToDict(
|
||||
$db->query(
|
||||
'SELECT name,officer_level,city,picture,imgsvr,belong from general where nation=%i and officer_level>=%i order by officer_level desc',
|
||||
$nationID, $lv
|
||||
),
|
||||
'officer_level'
|
||||
);
|
||||
|
||||
|
||||
$tigers = $db->query('SELECT value, name
|
||||
@@ -179,16 +174,26 @@ for($i=12; $i >= $lv; $i-=2) {
|
||||
<td width=498>
|
||||
<?php
|
||||
|
||||
if($meLevel >= 5){
|
||||
$candidateStrength = $db->query('SELECT no,name,officer_level,city,npc from general where nation=%i and officer_level!=12 and strength>=%i order by npc,binary(name)', $nationID, GameConst::$chiefStatMin);
|
||||
$candidateIntel = $db->query('SELECT no,name,officer_level,city,npc from general where nation=%i and officer_level!=12 and intel>=%i order by npc,binary(name)', $nationID, GameConst::$chiefStatMin);
|
||||
$candidateAny = $db->query('SELECT no,name,officer_level,city,npc,leadership,strength,intel,killturn from general where nation=%i and officer_level!=12 order by npc,binary(name)', $nationID); //추방 때문에 조금 더 김
|
||||
}
|
||||
else{
|
||||
$candidateStrength = [];
|
||||
$candidateIntel = [];
|
||||
$candidateAny = [];
|
||||
}
|
||||
|
||||
|
||||
if($meLevel >= 5 && !isOfficerSet($nation['chief_set'], $meLevel)) {
|
||||
echo "
|
||||
<select id='genlist_kick' size=1 style=color:white;background-color:black;>";
|
||||
|
||||
$query = "select no,npc,name,officer_level,leadership,strength,intel,killturn from general where nation='{$nationID}' and officer_level!='12' and no!='{$me['no']}' order by npc,binary(name)";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$gencount = MYDB_num_rows($result);
|
||||
|
||||
for($i=0; $i < $gencount; $i++) {
|
||||
$general = MYDB_fetch_array($result);
|
||||
foreach($candidateAny as $general) {
|
||||
if($general['no'] === $me['no']){
|
||||
continue;
|
||||
}
|
||||
echo "
|
||||
<option data-officer_level='{$general['officer_level']}' data-name='{$general['name']}' value={$general['no']}>{$general['name']} <small>({$general['leadership']}/{$general['strength']}/{$general['intel']}, {$general['killturn']}턴)</small></option>";
|
||||
}
|
||||
@@ -198,9 +203,6 @@ if($meLevel >= 5 && !isOfficerSet($nation['chief_set'], $meLevel)) {
|
||||
<input type=$btn id='btn_kick' value=추방>";
|
||||
}
|
||||
|
||||
$query = "select name,city from general where nation='{$nationID}' and officer_level=12";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$general = MYDB_fetch_array($result);
|
||||
$officerLevelText = getOfficerLevelText(11, $nation['level']);
|
||||
echo "
|
||||
</td>
|
||||
@@ -211,7 +213,7 @@ echo "
|
||||
<tr><td colspan=4 align=center bgcolor=blue>수 뇌 부 임 명</td></tr>
|
||||
<tr>
|
||||
<td width=98 align=right id=bg1>".getOfficerLevelText(12, $nation['level'])."</td>
|
||||
<td width=398>{$general['name']} 【".CityConst::byID($general['city'])->name."】</td>
|
||||
<td width=398>{$level[12]['name']} 【".CityConst::byID($level[12]['city'])->name."】</td>
|
||||
<td width=98 align=right id=bg1>{$officerLevelText}</td>
|
||||
<td width=398>
|
||||
";
|
||||
@@ -220,12 +222,8 @@ if($meLevel >= 5 && !isOfficerSet($nation['chief_set'], 11)) {
|
||||
echo "
|
||||
<select id='genlist_11' size=1 maxlength=15 style=color:white;background-color:black;>
|
||||
<option value=0 data-officer_level='0' data-name=''>____공석____</option>";
|
||||
$query = "select no,name,officer_level,city from general where nation='{$nationID}' and officer_level!='12' order by npc,binary(name)";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$gencount = MYDB_num_rows($result);
|
||||
|
||||
for($i=0; $i < $gencount; $i++) {
|
||||
$general = MYDB_fetch_array($result);
|
||||
foreach($candidateAny as $general) {
|
||||
if($general['officer_level'] == 11) {
|
||||
echo "<option style=color:red; selected data-officer_level='{$general['officer_level']}' data-name='{$general['name']}' value={$general['no']}>{$general['name']} 【".CityConst::byID($general['city'])->name."】</option>";
|
||||
} elseif($general['officer_level'] > 1) {
|
||||
@@ -239,11 +237,8 @@ if($meLevel >= 5 && !isOfficerSet($nation['chief_set'], 11)) {
|
||||
</select>
|
||||
<input class='btn_appoint' type=$btn data-officer_level='11' data-officer_level_text='{$officerLevelText}' value=임명>";
|
||||
} else {
|
||||
$query = "select name,city from general where nation='{$nationID}' and officer_level='11'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$general = MYDB_fetch_array($result);
|
||||
if($general){
|
||||
echo "{$general['name']} 【".CityConst::byID($general['city'])->name."】";
|
||||
if(key_exists(11, $level)){
|
||||
echo "{$level[11]['name']} 【".CityConst::byID($level[11]['city'])->name."】";
|
||||
}
|
||||
|
||||
}
|
||||
@@ -252,14 +247,6 @@ echo "
|
||||
</tr>
|
||||
";
|
||||
|
||||
$queries = [];
|
||||
$queries[10] = "select no,name,officer_level,city from general where nation='{$nationID}' and officer_level!='12' and strength>='".GameConst::$chiefStatMin."' order by npc,binary(name)";
|
||||
$queries[9] = "select no,name,officer_level,city from general where nation='{$nationID}' and officer_level!='12' and intel>='".GameConst::$chiefStatMin."' order by npc,binary(name)";
|
||||
$queries[8] = "select no,name,officer_level,city from general where nation='{$nationID}' and officer_level!='12' and strength>='".GameConst::$chiefStatMin."' order by npc,binary(name)";
|
||||
$queries[7] = "select no,name,officer_level,city from general where nation='{$nationID}' and officer_level!='12' and intel>='".GameConst::$chiefStatMin."' order by npc,binary(name)";
|
||||
$queries[6] = "select no,name,officer_level,city from general where nation='{$nationID}' and officer_level!='12' and strength>='".GameConst::$chiefStatMin."' order by npc,binary(name)";
|
||||
$queries[5] = "select no,name,officer_level,city from general where nation='{$nationID}' and officer_level!='12' and intel>='".GameConst::$chiefStatMin."' order by npc,binary(name)";
|
||||
|
||||
for($i=10; $i >= $lv; $i--) {
|
||||
if($i % 2 == 0) { echo "<tr>"; }
|
||||
$officerLevelText = getOfficerLevelText($i, $nation['level']);
|
||||
@@ -274,12 +261,7 @@ for($i=10; $i >= $lv; $i--) {
|
||||
<select id='genlist_{$i}' size=1 style=color:white;background-color:black;>
|
||||
<option value=0 data-officer_level='0' data-name=''>____공석____</option>";
|
||||
|
||||
$query = $queries[$i];
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$gencount = MYDB_num_rows($result);
|
||||
|
||||
for($k=0; $k < $gencount; $k++) {
|
||||
$general = MYDB_fetch_array($result);
|
||||
foreach(($i%2==0?$candidateStrength:$candidateIntel) as $general) {
|
||||
if($general['officer_level'] == $i) {
|
||||
echo "<option style=color:red; selected data-officer_level='{$general['officer_level']}' data-name='{$general['name']}' value={$general['no']}>{$general['name']} 【".CityConst::byID($general['city'])->name."】</option>";
|
||||
} elseif($general['officer_level'] > 1) {
|
||||
@@ -293,9 +275,7 @@ for($i=10; $i >= $lv; $i--) {
|
||||
</select>
|
||||
<input class='btn_appoint' type=$btn data-officer_level='{$i}' data-officer_level_text='$officerLevelText' value=임명>";
|
||||
} else {
|
||||
$query = "select name,city from general where nation='{$nationID}' and officer_level={$i}";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$general = MYDB_fetch_array($result);
|
||||
$general = $level[$i]??null;
|
||||
if($general){
|
||||
echo "{$general['name']} 【".CityConst::byID($general['city'])->name."】";
|
||||
}
|
||||
@@ -345,13 +325,12 @@ if($meLevel >= 5) {
|
||||
<select id='citylist_4' size=1 style=color:white;background-color:black;>
|
||||
";
|
||||
|
||||
$query = "select city,name,region from city where nation='{$nationID}' and (officer_set&(1<<4))=0 order by region,level desc,binary(name)"; // 도시 이름 목록
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$citycount = MYDB_num_rows($result);
|
||||
|
||||
$cityList = $db->query('SELECT city,name,region,officer_set FROM city WHERE nation=%i ORDER BY region,level DESC,binary(name)', $nationID);
|
||||
$region = 0;
|
||||
for($i=0; $i < $citycount; $i++) {
|
||||
$city = MYDB_fetch_array($result);
|
||||
foreach($cityList as $city){
|
||||
if(isOfficerSet($city['officer_set'], 4)){
|
||||
continue;
|
||||
}
|
||||
|
||||
if($region != $city['region']) {
|
||||
if($region != 0) {
|
||||
@@ -371,11 +350,7 @@ if($meLevel >= 5) {
|
||||
<option value=0 data-officer_level='0' data-name=''>____공석____</option>
|
||||
";
|
||||
|
||||
$query = "select no,name,officer_level,city from general where nation='{$nationID}' and officer_level!='12' and strength>='".GameConst::$chiefStatMin."' order by npc,binary(name)";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$count = MYDB_num_rows($result);
|
||||
for($i=0; $i < $count; $i++) {
|
||||
$general = MYDB_fetch_array($result);
|
||||
foreach($candidateStrength as $general) {
|
||||
if($general['officer_level'] == 4) {
|
||||
echo "<option style=color:red; data-officer_level='{$general['officer_level']}' data-name='{$general['name']}' value={$general['no']}>{$general['name']} 【".CityConst::byID($general['city'])->name."】</option>";
|
||||
} elseif($general['officer_level'] > 1) {
|
||||
@@ -397,13 +372,11 @@ if($meLevel >= 5) {
|
||||
<select id='citylist_3' size=1 style=color:white;background-color:black;>
|
||||
";
|
||||
|
||||
$query = "select city,name,region from city where nation='{$nationID}' and (officer_set&(1<<3))=0 order by region,level desc,binary(name)"; // 도시 이름 목록
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$citycount = MYDB_num_rows($result);
|
||||
|
||||
$region = 0;
|
||||
for($i=0; $i < $citycount; $i++) {
|
||||
$city = MYDB_fetch_array($result);
|
||||
foreach($cityList as $city){
|
||||
if(isOfficerSet($city['officer_set'], 3)){
|
||||
continue;
|
||||
}
|
||||
|
||||
if($region != $city['region']) {
|
||||
if($region != 0) {
|
||||
@@ -423,11 +396,7 @@ if($meLevel >= 5) {
|
||||
<option value=0 data-officer_level='0' data-name=''>____공석____</option>
|
||||
";
|
||||
|
||||
$query = "select no,name,officer_level,city from general where nation='{$nationID}' and officer_level!='12' and intel>='".GameConst::$chiefStatMin."' order by npc,binary(name)";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$count = MYDB_num_rows($result);
|
||||
for($i=0; $i < $count; $i++) {
|
||||
$general = MYDB_fetch_array($result);
|
||||
foreach($candidateIntel as $general) {
|
||||
if($general['officer_level'] == 3) {
|
||||
echo "<option style=color:red; data-officer_level='{$general['officer_level']}' data-name='{$general['name']}' value={$general['no']}>{$general['name']} 【".CityConst::byID($general['city'])->name."】</option>";
|
||||
} elseif($general['officer_level'] > 1) {
|
||||
@@ -449,13 +418,11 @@ if($meLevel >= 5) {
|
||||
<select id='citylist_2' size=1 style=color:white;background-color:black;>
|
||||
";
|
||||
|
||||
$query = "select city,name,region from city where nation='{$nationID}' and (officer_set&(1<<2))=0 order by region, level desc,binary(name)"; // 도시 이름 목록
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$citycount = MYDB_num_rows($result);
|
||||
|
||||
$region = 0;
|
||||
for($i=0; $i < $citycount; $i++) {
|
||||
$city = MYDB_fetch_array($result);
|
||||
foreach($cityList as $city){
|
||||
if(isOfficerSet($city['officer_set'], 2)){
|
||||
continue;
|
||||
}
|
||||
|
||||
if($region != $city['region']) {
|
||||
if($region != 0) {
|
||||
@@ -475,11 +442,7 @@ if($meLevel >= 5) {
|
||||
<option value=0>____<span class='name_field'>공석</span>____</option>
|
||||
";
|
||||
|
||||
$query = "select no,name,officer_level,city from general where nation='{$nationID}' and officer_level!='12' order by npc,binary(name)";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$count = MYDB_num_rows($result);
|
||||
for($i=0; $i < $count; $i++) {
|
||||
$general = MYDB_fetch_array($result);
|
||||
foreach ($candidateAny as $general) {
|
||||
if($general['officer_level'] == 2) {
|
||||
echo "<option style=color:red; data-officer_level='{$general['officer_level']}' data-name='{$general['name']}' value={$general['no']}>{$general['name']} 【".CityConst::byID($general['city'])->name."】</option>";
|
||||
} elseif($general['officer_level'] > 1) {
|
||||
|
||||
+37
-40
@@ -9,14 +9,11 @@ $userID = Session::getUserID();
|
||||
|
||||
$db = DB::db();
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
$connect=$db->get();
|
||||
|
||||
increaseRefresh("토너먼트", 1);
|
||||
TurnExecutionHelper::executeAllCommand();
|
||||
|
||||
$query = "select no,tournament,con,turntime from general where owner='{$userID}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
|
||||
$me = MYDB_fetch_array($result);
|
||||
$me = $db->queryFirstRow('select no,tournament,con,turntime from general where owner=%i', $userID);
|
||||
|
||||
$admin = $gameStor->getValues(['tournament','phase','tnmt_msg','tnmt_type','develcost','tnmt_trig']);
|
||||
|
||||
@@ -158,14 +155,15 @@ echo "
|
||||
<table align=center width=2000 class='bg0 mimic_flex'>
|
||||
<tr align=center>";
|
||||
|
||||
$query = "select npc,name,win from tournament where grp>=60 order by grp, grp_no";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
|
||||
for ($i=0; $i < 1; $i++) {
|
||||
$general = MYDB_fetch_array($result) ?? [
|
||||
'name'=>'',
|
||||
$generalList = $db->query('SELECT npc,name,win from tournament where grp>=60 order by grp, grp_no LIMIT 1');
|
||||
while(count($generalList) < 1){
|
||||
$generalList[] = [
|
||||
'name'=>'-',
|
||||
'npc'=>0,
|
||||
'win'=>0
|
||||
];
|
||||
}
|
||||
foreach($generalList as $i=>$general){
|
||||
if ($general['name'] == "") {
|
||||
$general['name'] = "-";
|
||||
}
|
||||
@@ -181,22 +179,21 @@ echo "
|
||||
</tr>
|
||||
<tr align=center>";
|
||||
|
||||
$query = "select npc,name,win from tournament where grp>=50 order by grp, grp_no";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
|
||||
$cent = [];
|
||||
for ($i=0; $i < 1; $i++) {
|
||||
$cent[$i] = "<font color=white>";
|
||||
}
|
||||
$line = [];
|
||||
$gen = [];
|
||||
for ($i=0; $i < 2; $i++) {
|
||||
//FIXME: 다시 작성. null인 경우엔 어쩌려고?
|
||||
$general = MYDB_fetch_array($result) ?? [
|
||||
'name'=>'',
|
||||
$generalList = $db->query('SELECT npc,name,win from tournament where grp>=50 order by grp, grp_no LIMIT 2');
|
||||
while(count($generalList) < 2){
|
||||
$generalList[] = [
|
||||
'name'=>'-',
|
||||
'npc'=>0,
|
||||
'win'=>0
|
||||
];
|
||||
|
||||
}
|
||||
foreach($generalList as $i=>$general){
|
||||
if ($general['name'] == "") {
|
||||
$general['name'] = "-";
|
||||
}
|
||||
@@ -230,18 +227,19 @@ for ($i=0; $i < 2; $i++) {
|
||||
echo "
|
||||
</tr>
|
||||
<tr align=center>";
|
||||
|
||||
$query = "select npc,name,win from tournament where grp>=40 order by grp, grp_no";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
|
||||
for ($i=0; $i < 2; $i++) {
|
||||
$cent[$i] = "<font color=white>";
|
||||
}
|
||||
for ($i=0; $i < 4; $i++) {
|
||||
$general = MYDB_fetch_array($result) ?? [
|
||||
'name'=>'',
|
||||
|
||||
$generalList = $db->query('SELECT npc,name,win from tournament where grp>=40 order by grp, grp_no LIMIT 4');
|
||||
while(count($generalList) < 4){
|
||||
$generalList[] = [
|
||||
'name'=>'-',
|
||||
'npc'=>0,
|
||||
'win'=>0
|
||||
];
|
||||
}
|
||||
foreach($generalList as $i=>$general){
|
||||
if ($general['name'] == "") {
|
||||
$general['name'] = "-";
|
||||
}
|
||||
@@ -276,17 +274,19 @@ echo "
|
||||
</tr>
|
||||
<tr align=center>";
|
||||
|
||||
$query = "select npc,name,win from tournament where grp>=30 order by grp, grp_no";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
|
||||
for ($i=0; $i < 4; $i++) {
|
||||
$cent[$i] = "<font color=white>";
|
||||
}
|
||||
for ($i=0; $i < 8; $i++) {
|
||||
$general = MYDB_fetch_array($result) ?? [
|
||||
'name'=>'',
|
||||
|
||||
$generalList = $db->query('SELECT npc,name,win from tournament where grp>=30 order by grp, grp_no LIMIT 8');
|
||||
while(count($generalList) < 8){
|
||||
$generalList[] = [
|
||||
'name'=>'-',
|
||||
'npc'=>0,
|
||||
'win'=>0
|
||||
];
|
||||
}
|
||||
foreach($generalList as $i=>$general){
|
||||
if ($general['name'] == "") {
|
||||
$general['name'] = "-";
|
||||
}
|
||||
@@ -321,17 +321,18 @@ echo "
|
||||
</tr>
|
||||
<tr align=center>";
|
||||
|
||||
$query = "select npc,name,win from tournament where grp>=20 order by grp, grp_no";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
|
||||
for ($i=0; $i < 8; $i++) {
|
||||
$cent[$i] = "<font color=white>";
|
||||
}
|
||||
for ($i=0; $i < 16; $i++) {
|
||||
$general = MYDB_fetch_array($result) ?? [
|
||||
'name'=>'',
|
||||
$generalList = $db->query('SELECT npc,name,win from tournament where grp>=20 order by grp, grp_no LIMIT 16');
|
||||
while(count($generalList) < 16){
|
||||
$generalList[] = [
|
||||
'name'=>'-',
|
||||
'npc'=>0,
|
||||
'win'=>0
|
||||
];
|
||||
}
|
||||
foreach($generalList as $i=>$general){
|
||||
if ($general['name'] == "") {
|
||||
$general['name'] = "-";
|
||||
}
|
||||
@@ -410,10 +411,8 @@ for ($i=0; $i < 8; $i++) {
|
||||
<tr><td colspan=9 style=background-color:black;>{$num[$i]}조</td></tr>
|
||||
<tr id=bg1><td align=center>순</td><td align=center>장수</td><td align=center>{$tp2}</td><td align=center>경</td><td align=center>승</td><td align=center>무</td><td align=center>패</td><td align=center>점</td><td align=center>득</td></tr>";
|
||||
|
||||
$query = "select npc,name,leadership,strength,intel,leadership+strength+intel as total,prmt,win+draw+lose as game,win,draw,lose,gl,win*3+draw as gd from tournament where grp='$grp' order by gd desc, gl desc, seq";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
|
||||
for ($k=1; $k <= 4; $k++) {
|
||||
$general = MYDB_fetch_array($result);
|
||||
$generalList = $db->query('SELECT npc,name,leadership,strength,intel,leadership+strength+intel as total,prmt,win+draw+lose as game,win,draw,lose,gl,win*3+draw as gd from tournament where grp=%i order by gd desc, gl desc, seq',$grp);
|
||||
foreach($generalList as $k=>$general) {
|
||||
printRow($k, $general['npc'], $general['name'], $general[$tp], $general['game'], $general['win'], $general['draw'], $general['lose'], $general['gd'], $general['gl'], $general['prmt']);
|
||||
}
|
||||
echo "
|
||||
@@ -436,10 +435,8 @@ for ($i=0; $i < 8; $i++) {
|
||||
<tr><td colspan=9 style=background-color:black;>{$num[$i]}조</td></tr>
|
||||
<tr id=bg1><td align=center>순</td><td align=center>장수</td><td align=center>{$tp2}</td><td align=center>경</td><td align=center>승</td><td align=center>무</td><td align=center>패</td><td align=center>점</td><td align=center>득</td></tr>";
|
||||
|
||||
$query = "select npc,name,leadership,strength,intel,leadership+strength+intel as total,prmt,win+draw+lose as game,win,draw,lose,gl,win*3+draw as gd from tournament where grp='$grp' order by gd desc, gl desc, seq";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
|
||||
for ($k=1; $k <= 8; $k++) {
|
||||
$general = MYDB_fetch_array($result);
|
||||
$generalList = $db->query('SELECT npc,name,leadership,strength,intel,leadership+strength+intel as total,prmt,win+draw+lose as game,win,draw,lose,gl,win*3+draw as gd from tournament where grp=%i order by gd desc, gl desc, seq',$grp);
|
||||
foreach($generalList as $k=>$general) {
|
||||
printRow($k, $general['npc'], $general['name'], $general[$tp], $general['game'], $general['win'], $general['draw'], $general['lose'], $general['gd'], $general['gl'], $general['prmt']);
|
||||
}
|
||||
echo "
|
||||
|
||||
@@ -169,6 +169,7 @@ function getTournament(int $tnmt) {
|
||||
}
|
||||
|
||||
function printRow($k, $npc, $name, $abil, $tgame, $win, $draw, $lose, $gd, $gl, $prmt) {
|
||||
$k += 1;
|
||||
if($prmt > 0) { $name = "<font color=orange>".$name."</font>"; }
|
||||
elseif($npc >= 2) { $name = "<font color=cyan>".$name."</font>"; }
|
||||
elseif($npc == 1) { $name = "<font color=skyblue>".$name."</font>"; }
|
||||
@@ -824,7 +825,7 @@ function setRefund() {
|
||||
|
||||
//16강자 명성 돈
|
||||
$cost = $gameStor->develcost;
|
||||
$generalIDList = $db->queryFirstColumn('SELECT no FROM tournament WHERE grp<10 AND no >0');
|
||||
$generalIDList = $db->queryFirstColumn('SELECT no FROM tournament WHERE grp<10 AND no > 0');
|
||||
$db->update('general', [
|
||||
'gold'=>$db->sqleval('gold + %i', $cost)
|
||||
], 'no IN %li', $generalIDList);
|
||||
|
||||
@@ -53,7 +53,7 @@ if($gameStor->isunited){
|
||||
|
||||
$generalList = [];
|
||||
foreach($rawGeneralList as $rawGeneral){
|
||||
[$owner,$no,$picture,$imgsvr,$npc,$age,$nation,$special,$special2,$personal,$name,$ownerName,$injury,$leadership,$strength,$intel,$experience,$dedication,$officerLevel,$killturn,$connect] = $rawGeneral;
|
||||
[$owner,$no,$picture,$imgsvr,$npc,$age,$nation,$special,$special2,$personal,$name,$ownerName,$injury,$leadership,$strength,$intel,$experience,$dedication,$officerLevel,$killturn,$connectCnt] = $rawGeneral;
|
||||
|
||||
if(key_exists($owner, $ownerNameList)){
|
||||
$ownerName = $ownerNameList[$owner];
|
||||
@@ -84,7 +84,7 @@ foreach($rawGeneralList as $rawGeneral){
|
||||
getDed($dedication),
|
||||
getOfficerLevelText($officerLevel, $nationArr['level']),
|
||||
$killturn,
|
||||
$connect
|
||||
$connectCnt
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
@@ -19,7 +19,6 @@ $loader->addClassMap((function () {
|
||||
|
||||
//디버그용 매크로
|
||||
ini_set("session.cache_expire", 10080); // minutes
|
||||
include "MYDB.php";
|
||||
|
||||
// 각종 변수
|
||||
define('STEP_LOG', true);
|
||||
|
||||
+24
-21
@@ -417,27 +417,30 @@ ENGINE=Aria DEFAULT CHARSET=utf8mb4;
|
||||
###########################################################################
|
||||
## 토너먼트 테이블
|
||||
###########################################################################
|
||||
create table tournament (
|
||||
seq int(6) not null auto_increment,
|
||||
no int(6) default 0,
|
||||
npc int(6) default 0,
|
||||
name varchar(64) default '',
|
||||
w varchar(20) default 'None',
|
||||
b varchar(20) default 'None',
|
||||
h varchar(20) default 'None',
|
||||
leadership int(3) default 0,
|
||||
strength int(3) default 0,
|
||||
intel int(3) default 0,
|
||||
lvl int(3) default 0,
|
||||
grp int(2) default 0,
|
||||
grp_no int(2) default 0,
|
||||
win int(2) default 0,
|
||||
draw int(2) default 0,
|
||||
lose int(2) default 0,
|
||||
gl int(2) default 0,
|
||||
prmt int(1) default 0,
|
||||
PRIMARY KEY (seq)
|
||||
) ENGINE=Aria DEFAULT CHARSET=utf8mb4;
|
||||
CREATE TABLE `tournament` (
|
||||
`seq` INT(6) NOT NULL AUTO_INCREMENT,
|
||||
`no` INT(6) NULL DEFAULT 0,
|
||||
`npc` INT(6) NULL DEFAULT 0,
|
||||
`name` VARCHAR(64) NULL DEFAULT '',
|
||||
`w` VARCHAR(20) NULL DEFAULT 'None',
|
||||
`b` VARCHAR(20) NULL DEFAULT 'None',
|
||||
`h` VARCHAR(20) NULL DEFAULT 'None',
|
||||
`leadership` INT(3) NULL DEFAULT 0,
|
||||
`strength` INT(3) NULL DEFAULT 0,
|
||||
`intel` INT(3) NULL DEFAULT 0,
|
||||
`lvl` INT(3) NULL DEFAULT 0,
|
||||
`grp` INT(2) NULL DEFAULT 0,
|
||||
`grp_no` INT(2) NULL DEFAULT 0,
|
||||
`win` INT(2) NULL DEFAULT 0,
|
||||
`draw` INT(2) NULL DEFAULT 0,
|
||||
`lose` INT(2) NULL DEFAULT 0,
|
||||
`gl` INT(2) NULL DEFAULT 0,
|
||||
`prmt` INT(1) NULL DEFAULT 0,
|
||||
PRIMARY KEY (`seq`),
|
||||
INDEX `grp` (`grp`, `grp_no`)
|
||||
)
|
||||
COLLATE='utf8mb4_general_ci'
|
||||
ENGINE=Aria;
|
||||
|
||||
###########################################################################
|
||||
## 거래 테이블
|
||||
|
||||
Reference in New Issue
Block a user