임관 권유 메시지를 템플릿으로 이동

This commit is contained in:
2018-06-24 04:12:19 +09:00
parent 5ca8a6ecfa
commit 8a56393159
6 changed files with 39 additions and 52 deletions
+1 -1
View File
@@ -216,7 +216,7 @@ if ($budgetricediff > 0) {
<table align=center width=1000 class='tb_layout bg0'>
<form name=form1 method=post action=c_dipcenter.php>
<tr><td colspan=2 height=10></td></tr>
<tr><td colspan=2 align=center bgcolor=orange>국 가 방 침 &amp; 임관 권유 메지</td></tr>
<tr><td colspan=2 align=center bgcolor=orange>국 가 방 침 &amp; 임관 권유 메지</td></tr>
<tr><td colspan=2 class=bg1>국가 방침 <textarea <?=$read?> maxlength=16000 rows="5" style="color:white;background-color:black;width:830px;" name=msg><?=$nation['msg']?></textarea><input type=<?=$btn?> name=btn value=국가방침></td></tr>
<tr><td colspan=2 class=bg1>임관 권유 <input type=text <?=$read?> maxlength=1000 style=color:white;background-color:black;width:830px; name=scoutmsg value='<?=$nation['scoutmsg']?>'><input type=<?=$btn?> name=btn value=임관권유></td></tr>
<tr><td colspan=2>870 x 200px 넘는 크기를 점유할 시 통보없이 제한될 수 있습니다.</td></tr>
+11
View File
@@ -172,4 +172,15 @@ function getMapHtml(){
$templates = new \League\Plates\Engine(__dir__.'/templates');
return $templates->render('map');
}
function getInvitationList(array $nationList){
$templates = new \League\Plates\Engine(__dir__.'/templates');
foreach($nationList as &$nation){
$nation['textColor'] = newColor($nation['color']);
}
return $templates->render('invitationList', [
'nationList'=>$nationList
]);
}
+2 -18
View File
@@ -63,27 +63,11 @@ if ($gencount >= $admin['maxgeneral']) {
echo "<script>history.go(-1);</script>";
exit();
}
?>
<table align=center width=1000 class='tb_layout bg0'>
<tr><td align=center colspan=2 id=bg1>임관 권유 메세지</td></tr>
<?php
$query = "select name,scoutmsg,color from nation";
$nationresult = MYDB_query($query, $connect) or Error("join ".MYDB_error($connect), "");
$nationcount = MYDB_num_rows($nationresult);
$nationList = $db->query('SELECT nation,`name`,color,scout,scoutmsg FROM nation ORDER BY rand()');
for ($i=0; $i < $nationcount; $i++) {
$nation = MYDB_fetch_array($nationresult);
if ($nation['scoutmsg'] == "") {
echo "
<tr><td align=center width=98 style=color:".newColor($nation['color']).";background-color:{$nation['color']}>{$nation['name']}</td><td width=898 style=color:".newColor($nation['color']).";background-color:{$nation['color']}>-</td></tr>";
} else {
echo "
<tr><td align=center width=98 style=color:".newColor($nation['color']).";background-color:{$nation['color']}>{$nation['name']}</td><td width=898 style=color:".newColor($nation['color']).";background-color:{$nation['color']}>{$nation['scoutmsg']}</td></tr>";
}
}
echo getInvitationList($nationList);
?>
</table>
<form name=form1 method=post action=join_post.php>
<table align=center width=1000 class='tb_layout bg0'>
+5 -17
View File
@@ -972,6 +972,8 @@ function command_25($turn, $command) {
$query = "select nation,name,color,scout,scoutmsg,sabotagelimit,gennum from nation order by gennum";
$result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),"");
$count = MYDB_num_rows($result);
$nationList = $db->query('SELECT nation,`name`,color,scout,scoutmsg FROM nation ORDER BY rand()');
echo "
국가에 임관합니다.<br>
@@ -988,18 +990,7 @@ function command_25($turn, $command) {
<option value=98 style=color:white;background-color:black;>???</option>";
$scoutStr = "";
for($i=1; $i <= $count; $i++) {
$nation = MYDB_fetch_array($result);
$scoutStr .=
"<tr>"
."<td align=center width=130 style=color:".newColor($nation['color']).";background-color:{$nation['color']};>"
.$nation['name']
."</td>"
."<td width=870 style='color:".newColor($nation['color']).";background-color:{$nation['color']};overflow:hidden;max-width:870px;max-height:200px'>"
.($nation['scoutmsg']?:'-')
.'</td></tr>';
foreach($nationList as $nation){
if($gameStor->year < $gameStor->startyear+3 && $nation['gennum'] >= GameConst::$initialNationGenLimit) {
echo "
<option value={$nation['nation']} style=color:{$nation['color']};background-color:red;>【 {$nation['name']} 】</option>";
@@ -1026,11 +1017,8 @@ function command_25($turn, $command) {
}
echo "
</form>
<table align=center width=1000 class='tb_layout bg0'>
<tr><td align=center colspan=2 id=bg1>임관 권유 메세지</td></tr>
{$scoutStr}
</table>";
</form>";
echo getInvitationList($nationList);
ender();
}
+2 -16
View File
@@ -18,7 +18,7 @@ if(!$npcmode) {
$gencount = $db->queryFirstField('SELECT count(`no`) FROM general WHERE npc<2');
$nations = $db->queryAllLists('SELECT `name`, scoutmsg, color FROM nation');
$nationList = $db->query('SELECT nation,`name`,color,scout,scoutmsg FROM nation ORDER BY rand()');
?>
<!DOCTYPE html>
<html>
@@ -61,21 +61,7 @@ history.go(-1);
<tr><td><?=info(0)?></td></tr>
</table>
<table style="width:100%;" class="bg0 with_border">
<thead>
<tr><th colspan=2 class="bg1">임관 권유 메세지</th></tr>
</thead>
<tbody>
<?php foreach($nations as list($name, $scoutmsg, $color)): ?>
<tr>
<td style='width:98px;color:<?=newColor($color)?>;background-color:<?=$color?>'><?=$name?></td>
<td style='color:<?=newColor($color)?>;background-color:<?=$color?>'><?=$scoutmsg?:'-'?></td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
<?=getInvitationList($nationList)?>
<div class="bg0">
<div class="bg1 with_border legacy_layout font1" style="text-align:center;font-weight:bold;">장수 빙의</div>
+18
View File
@@ -0,0 +1,18 @@
<table class="tb_layout bg0" style="margin:auto;">
<thead>
<tr><td colspan="2" style="text-align:center;" class="bg1">임관 권유 메시지</td></tr>
</thead>
<tbody>
<?php foreach($nationList as $nation): ?>
<tr
data-nation-id="<?=$nation['nation']?>"
style="color:<?=$nation['textColor']?>;background-color:<?=$nation['color']?>;"
>
<td style="width:130px;text-align:center;"
><?=$nation['name']?></td>
<td style="width:870px;max-width:870px;max-height:200px;overflow:hidden;"
><?=$nation['scoutmsg']?:'-'?></td>
</tr>
<?php endforeach; ?>
</tbody>
</table>