<?php
if (!defined('_GNUBOARD_')) exit;
// 외부 DB 연결
include_once('/home/www/DB/db_upbit.php');
// 상단 아이콘 및 폰트 추가
add_stylesheet('<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">', 0);
add_stylesheet('<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Orbitron:wght@400;700&family=Noto+Sans+KR:wght@300;500&display=swap">', 0);
add_stylesheet('<link rel="stylesheet" href="'.$board_skin_url.'/style.list.css">', 0);
error_reporting(E_ALL & ~E_NOTICE);
ini_set('display_errors', '0');
// 데이터 로드
$new_board = sql_query("select * from $write_table order by wr_datetime desc limit 1");
$lat_board = sql_fetch_array($new_board);
?>
<style>
/* 메모 영역 폭 조절 및 말줄임 처리 */
.td-memo {
max-width: 250px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.List-Table th, .List-Table td { padding: 10px 5px; text-align: center; }
/* 실시간 검색 입력창 스타일 */
.input-realtime {
background: rgba(0, 0, 0, 0.3);
border: 1px solid var(--border-color);
color: #fff;
padding: 0 15px;
height: 38px;
border-radius: 4px;
font-size: 0.85rem;
width: 200px;
transition: all 0.3s;
}
.input-realtime:focus {
border-color: var(--accent-blue);
box-shadow: 0 0 10px rgba(0, 212, 255, 0.2);
outline: none;
width: 250px;
}
</style>
<div id="SPACE_WRAP">
<div class="nebula"></div>
<div id="stars-container"></div>
<article id='LIST'>
<section class="TopTitle">
<p><?php echo strtoupper($bo_table); ?></p>
<span><i class="fa-solid fa-satellite"></i> <?php echo $board["bo_subject"]; ?></span>
</section>
<div class="Control-Bar">
<div class="ctrl-group">
<button type="button" onclick="$('#NoticeLayer').fadeIn();"><i class="fa-solid fa-bullhorn"></i> NOTICE</button>
<?php if ($is_category) { ?>
<select onchange="location.href=this.value;">
<option value="<?php echo get_pretty_url($bo_table); ?>">RUN STATUS</option>
<option value="<?php echo get_pretty_url($bo_table, '', 'sfl=x2_run&stx=1'); ?>" <?php echo $stx=='1'?'selected':''; ?>>RUN</option>
<option value="<?php echo get_pretty_url($bo_table, '', 'sfl=x2_run&stx=0'); ?>" <?php echo ($stx=='0' && $stx!='')?'selected':''; ?>>STOP</option>
</select>
<select onchange="location.href=this.value;">
<option value="<?php echo get_pretty_url($bo_table); ?>">EXCHANGE</option>
<?php
$categories = explode('|', $board['bo_category_list']);
foreach($categories as $ca) {
if(!$ca) continue;
$selected = ($sca == $ca) ? "selected" : "";
echo "<option value='".get_pretty_url($bo_table, '', 'sca='.urlencode($ca))."' $selected>$ca</option>";
}
?>
</select>
<select onchange="location.href=this.value;">
<option value="">SUB 1</option>
<?php
$sql2 = "select distinct x2_ca2 from $write_table where x2_ca2 <> '' order by x2_ca2";
$res2 = sql_query($sql2);
while($row2 = sql_fetch_array($res2)) {
$selected = ($stx == $row2['x2_ca2']) ? "selected" : "";
echo "<option value='".get_pretty_url($bo_table, '', 'sfl=x2_ca2&stx='.urlencode($row2['x2_ca2']))."' $selected>".$row2['x2_ca2']."</option>";
}
?>
</select>
<select onchange="location.href=this.value;">
<option value="">SUB 2</option>
<?php
$sql3 = "select distinct x2_ca3 from $write_table where x2_ca3 <> '' order by x2_ca3";
$res3 = sql_query($sql3);
while($row3 = sql_fetch_array($res3)) {
$selected = ($stx == $row3['x2_ca3']) ? "selected" : "";
echo "<option value='".get_pretty_url($bo_table, '', 'sfl=x2_ca3&stx='.urlencode($row3['x2_ca3']))."' $selected>".$row3['x2_ca3']."</option>";
}
?>
</select>
<?php } ?>
</div>
<div class="ctrl-group">
<!-- 실시간 검색 입력 폼 추가 -->
<input type="text" id="realtime_search" class="input-realtime" placeholder="Quick Filter (Table/Name)...">
<button type="button" onclick="$('#SCH').css('display','flex').fadeIn();"><i class="fa-solid fa-magnifying-glass"></i> SEARCH</button>
<?php if ($is_admin) { ?>
<button type="button" onclick="location.href='<?php echo G5_ADMIN_URL; ?>/board_form.php?w=u&bo_table=<?php echo $bo_table; ?>'" style="background:#475569; color:#fff;"><i class="fa-solid fa-gear"></i> ADMIN</button>
<?php } ?>
<?php if ($write_href) { ?>
<button type="button" onclick="location.href='<?php echo $write_href; ?>'" style="background:var(--accent-blue); color:#000; font-weight:bold;"><i class="fa-solid fa-pen"></i> WRITE</button>
<?php } ?>
</div>
</div>
<form name="fboardlist" id="fboardlist" action="./board_list_update.php" method="post">
<input type="hidden" name="bo_table" value="<?php echo $bo_table; ?>">
<table class="List-Table">
<thead>
<tr class="List-Header">
<th class="Num">NO</th>
<th class="Run">D/N</th>
<th class="Subject">DAEMON</th>
<th class="Subject">TABLE</th>
<th class="Subject">IDENTIFIER</th>
<th class="Subject2">MEMO</th>
<th class="CaName">EXCHANGE</th>
<th class="Ca2">TYPE 1</th>
<th class="Ca3">TYPE 2</th>
<th class="Day">DATE</th>
</tr>
</thead>
<tbody id="main_list_body">
<?php
for ($i=0; $i<count($list); $i++) {
$is_notice = $list[$i]['is_notice'];
$delay = ($i * 0.03) + 0.2;
$run_val = $list[$i]['x2_run'];
$run_text = ($run_val == '1') ? 'DAEMON' : 'EVENT';
$run_class = ($run_val == '1') ? 'run_on' : 'run_off';
?>
<tr class="list-row" onclick="location.href='<?php echo $list[$i]['href']; ?>'" style="animation-delay: <?php echo $delay; ?>s;">
<td class="Num">
<?php if ($is_notice) echo '<i class="fa-solid fa-thumbtack" style="color:var(--accent-blue)"></i>'; else echo $list[$i]['num']; ?>
</td>
<td class="Run">
<span class="run_btn <?php echo $run_class; ?>"><?php echo $run_text; ?></span>
</td>
<td class="Subject td-table-name">
<span class="txt-main-sub"><?php echo $list[$i]['wr_subject']; ?></span>
</td>
<td class="Subject">
<span style="color:var(--accent-orange); font-size:0.85rem;"><?php echo $list[$i]['sel_event'] ?: '-'; ?></span>
</td>
<td class="Subject td-kor-name">
<span class="txt-kor-name"><?php echo $list[$i]['wr_subject_kor'] ?: '-'; ?></span>
</td>
<td class="Subject2 td-memo">
<span class="txt-desc"><?php echo $list[$i]['wr_1'] ?: 'No memo'; ?></span>
</td>
<td class="CaName"><?php echo $list[$i]['ca_name'] ?: "-"; ?></td>
<td class="Ca2"><?php echo $list[$i]['x2_ca2'] ?: "-"; ?></td>
<td class="Ca3"><?php echo $list[$i]['x2_ca3'] ?: "-"; ?></td>
<td class="Day">
<?php echo date("y-m-d", strtotime($list[$i]['wr_datetime'])); ?>
<span style="font-size:0.7rem; opacity:0.5;"><?php echo date("H:i", strtotime($list[$i]['wr_datetime'])); ?></span>
</td>
</tr>
<?php } ?>
<?php if (count($list) == 0) echo "<tr><td colspan='11' style='text-align:center; padding:100px; color:var(--text-dim);'>No system configurations found.</td></tr>"; ?>
</tbody>
</table>
</form>
<div class="Pagination">
<?php echo $write_pages; ?>
</div>
<div id="NoticeLayer" class="NoticeLayer">
<h3><i class="fa-solid fa-terminal"></i> SYSTEM NOTICE</h3>
<div class="notice-content">
<?php echo nl2br(stripslashes($board['notice'])); ?>
</div>
<div class="modal-footer">
<div>
<?php if ($is_admin) { ?>
<button type="button" onclick="window.open('<?php echo $board_skin_url;?>/notice.php?bo_table=<?php echo $bo_table;?>', 'notice_win', 'width=800,height=700,left='+(screen.availWidth-800)/2+',top='+(screen.availHeight-600)/2);" style="background:var(--accent-purple); color:#fff; border:none;">WRITE NOTICE</button>
<?php } ?>
</div>
<button type="button" onclick="$('#NoticeLayer').fadeOut();">DISMISS</button>
</div>
</div>
<section id="SCH">
<div class="search-box">
<form name="fsearch" method="get">
<input type="hidden" name="bo_table" value="<?php echo $bo_table; ?>">
<h3>TERMINAL SEARCH</h3>
<input type="text" name="stx" value="<?php echo stripslashes($stx); ?>" required placeholder="Keyword entry..." class="search-input">
<div style="margin-top:30px; display:flex; gap:12px;">
<button type="submit" style="flex:1; background:var(--accent-blue); color:#000; font-weight:bold; height:45px;">EXECUTE</button>
<button type="button" onclick="$('#SCH').fadeOut();" style="flex:1; height:45px; background:none; border:1px solid var(--text-dim); color:var(--text-dim);">CANCEL</button>
</div>
</form>
</div>
</section>
</article>
</div>
<script>
$(function() {
// 실시간 검색 기능 로직
$("#realtime_search").on("keyup", function() {
var value = $(this).val().toLowerCase();
$("#main_list_body tr.list-row").filter(function() {
var tableName = $(this).find(".td-table-name").text().toLowerCase();
var korName = $(this).find(".td-kor-name").text().toLowerCase();
$(this).toggle(tableName.indexOf(value) > -1 || korName.indexOf(value) > -1);
});
});
$('#SCH').click(function(e) { if(e.target == this) $(this).fadeOut(); });
const container = document.getElementById('stars-container');
const starCount = 100;
if(container) {
for (let i = 0; i < starCount; i++) {
const star = document.createElement('div');
const size = Math.random() * 2;
star.style.position = 'absolute';
star.style.width = size + 'px';
star.style.height = size + 'px';
star.style.backgroundColor = '#fff';
star.style.borderRadius = '50%';
star.style.left = Math.random() * 100 + '%';
star.style.top = Math.random() * 100 + '%';
star.style.opacity = Math.random();
star.setAttribute('data-speed', Math.random() * 2 + 1);
container.appendChild(star);
}
document.addEventListener('mousemove', (e) => {
const moveX = (window.innerWidth / 2 - e.pageX) / 50;
const moveY = (window.innerHeight / 2 - e.pageY) / 50;
document.querySelectorAll('#stars-container div').forEach(star => {
const speed = star.getAttribute('data-speed');
star.style.transform = `translate(${moveX * speed}px, ${moveY * speed}px)`;
});
});
}
});
</script>