20260205 업데이트(컨텐츠 페이지 연결)

This commit is contained in:
2026-02-05 10:06:09 +09:00
parent 5d52f6d37a
commit 6dcc2eb796
208 changed files with 8143 additions and 1524 deletions

View File

@@ -63,7 +63,7 @@
</ul>
</section>
<section class="sub-content">
<h3 class="sub-tit">1:1 문의하기</h3>
<h3 class="sub-tit">문의하기(Q&A)</h3>
<form class="qa-controls" method="get" action="">
<div class="search-wrap">
<div class="filters">
@@ -119,124 +119,127 @@
</div>
</form>
<div class="board-wrap">
<div class="board-list">
<table>
<colgroup>
<col style="width:5%"><col style="width:7%"><col style="width:12%"><col style="width:12%">
<col style="width:7%"><col style="width:auto"><col style="width:9%"><col style="width:9%">
</colgroup>
<thead>
<tr>
<th>번호</th><th>구분</th><th>회사</th><th>부서</th>
<th>작성자</th><th>제목</th><th>등록일</th><th>상태</th>
</tr>
</thead>
<tbody>
<?php
$totalIndex = $totalCount - ($page - 1) * $pageSize;
$idx = 0;
?>
<?php foreach($posts as $row): ?>
<?php
$isNotice = ($row['category'] === '공지사항');
$rowNumber = $totalIndex - $idx; // 연속 번호 재계산
?>
<?php $isNotice = ($row['category'] === 'notice'); ?>
<tr class="<?= $isNotice ? 'row-notice' : '' ?>" onclick="location.href='/kngil/bbs/qa_detail.php?id=<?= urlencode($row['post_id']) ?>'" style="cursor:pointer;">
<!-- 번호: 공지 or 연속번호 -->
<td><?= $isNotice ? '공지' : $rowNumber ?></td>
<!-- 구분 -->
<td><?= htmlspecialchars($row['category']) ?></td>
<!-- 회사 -->
<td><?= htmlspecialchars($row['display_company']) ?></td>
<!-- 부서 -->
<td><?= htmlspecialchars($row['dept_nm'] ?? '') ?></td>
<!-- 작성자 -->
<td><?= htmlspecialchars($row['display_name']) ?></td>
<!-- 제목 -->
<td class="left">
<?php if (($row['is_secret'] ?? 'N') === 'Y'): ?>
<small style="color:#999">[비밀글]</small>
<?php endif; ?>
<span class="title-text">
<?= htmlspecialchars($row['title']) ?>
</span>
<!-- 댓글 개수 -->
<?php if (!empty($row['comment_count'])): ?>
<span class="badge badge-comment" style="color:#007bff; margin-left:5px;">
<i class="fa fa-commenting-o"></i> <?= $row['comment_count'] ?>
</span>
<?php endif; ?>
<!-- 첨부파일 개수 -->
<?php if (!empty($row['file_count'])): ?>
<span class="badge badge-file" style="color:#28a745; margin-left:5px;">
<i class="fa fa-paperclip"></i> <?= $row['file_count'] ?>
</span>
<?php endif; ?>
</td>
<!-- 등록일 -->
<td><?= htmlspecialchars(substr($row['created_at'],0,10)) ?></td>
<!-- 상태 -->
<td>
<?php if ($row['category'] === '공지사항'): ?>
<!-- 공지사항이면 상태값 안 보여줌 -->
<span></span>
<?php else: ?>
<span class="status-<?= htmlspecialchars($row['status']) ?>">
<?= $row['status']==='wait' ? '문의접수'
: ($row['status']==='review' ? '문의검토'
: ($row['status']==='deep' ? '정밀검토'
: ($row['status']==='patch' ? '패치예정'
: ($row['status']==='done' ? '답변완료'
: '')))) ?>
</span>
<?php endif; ?>
</td>
<table>
<colgroup>
<col style="width:5%"><col style="width:7%"><col style="width:12%"><col style="width:12%">
<col style="width:7%"><col style="width:auto"><col style="width:9%"><col style="width:9%">
</colgroup>
<thead>
<tr>
<th>번호</th><th>구분</th><th>회사</th><th>부서</th>
<th>작성자</th><th>제목</th><th>등록일</th><th>상태</th>
</tr>
<?php $idx++; ?>
<?php endforeach; ?>
</tbody>
</table>
<?php if ($totalPages > 1): ?>
<div class="pagination">
<?php if ($page > 1): ?>
<a href="?<?= http_build_query(array_merge($_GET, ['page'=>$page-1])) ?>" class="prev">이전</a>
<?php else: ?><span class="prev">이전</span><?php endif ?>
</thead>
<tbody>
<?php
$totalIndex = $totalCount - ($page - 1) * $pageSize;
$idx = 0;
?>
<?php foreach($posts as $row): ?>
<?php
$isNotice = ($row['category'] === '공지사항');
$rowNumber = $totalIndex - $idx; // 연속 번호 재계산
?>
<?php $isNotice = ($row['category'] === 'notice'); ?>
<tr class="<?= $isNotice ? 'row-notice' : '' ?>" onclick="location.href='/kngil/bbs/qa_detail.php?id=<?= urlencode($row['post_id']) ?>'" style="cursor:pointer;">
<!-- 번호: 공지 or 연속번호 -->
<td><?= $isNotice ? '공지' : $rowNumber ?></td>
<!-- 구분 -->
<td><?= htmlspecialchars($row['category']) ?></td>
<!-- 회사 -->
<td><?= htmlspecialchars($row['display_company']) ?></td>
<!-- 부서 -->
<td><?= htmlspecialchars($row['dept_nm'] ?? '') ?></td>
<!-- 작성자 -->
<td><?= htmlspecialchars($row['display_name']) ?></td>
<!-- 제목 -->
<td class="left">
<?php if (($row['is_secret'] ?? 'N') === 'Y'): ?>
<small style="color:#999">[비밀글]</small>
<?php endif; ?>
<?php
$blockSize = 10;
$currentBlock= ceil($page / $blockSize);
$start = ($currentBlock - 1) * $blockSize + 1;
$end = min($totalPages, $currentBlock * $blockSize);
<span class="title-text">
<?= htmlspecialchars($row['title']) ?>
</span>
for ($i = $start; $i <= $end; $i++):
?>
<?php if ($i == $page): ?>
<!-- ✅ 여기! 현재 페이지는 span.current -->
<span class="current"><?= $i ?></span>
<?php else: ?>
<a href="?<?= http_build_query(array_merge($_GET, ['page'=>$i])) ?>"><?= $i ?></a>
<?php endif ?>
<?php endfor ?>
<!-- 댓글 개수 -->
<?php if (!empty($row['comment_count'])): ?>
<span class="badge badge-comment" style="color:#007bff; margin-left:5px;">
<i class="fa fa-commenting-o"></i> <?= $row['comment_count'] ?>
</span>
<?php endif; ?>
<?php if ($page < $totalPages): ?>
<a href="?<?= http_build_query(array_merge($_GET, ['page'=>$page+1])) ?>" class="next">다음</a>
<?php else: ?><span class="next">다음</span><?php endif ?>
<!-- 첨부파일 개수 -->
<?php if (!empty($row['file_count'])): ?>
<span class="badge badge-file" style="color:#28a745; margin-left:5px;">
<i class="fa fa-paperclip"></i> <?= $row['file_count'] ?>
</span>
<?php endif; ?>
</td>
<!-- 등록일 -->
<td><?= htmlspecialchars(substr($row['created_at'],0,10)) ?></td>
<!-- 상태 -->
<td>
<?php if ($row['category'] === '공지사항'): ?>
<!-- 공지사항이면 상태값 안 보여줌 -->
<span></span>
<?php else: ?>
<span class="status-<?= htmlspecialchars($row['status']) ?>">
<?= $row['status']==='wait' ? '문의접수'
: ($row['status']==='review' ? '문의검토'
: ($row['status']==='deep' ? '정밀검토'
: ($row['status']==='patch' ? '패치예정'
: ($row['status']==='done' ? '답변완료'
: '')))) ?>
</span>
<?php endif; ?>
</td>
</tr>
<?php $idx++; ?>
<?php endforeach; ?>
</tbody>
</table>
</div>
<?php endif ?>
<?php if ($totalPages > 1): ?>
<div class="pagination">
<?php if ($page > 1): ?>
<a href="?<?= http_build_query(array_merge($_GET, ['page'=>$page-1])) ?>" class="prev">이전</a>
<?php else: ?><span class="prev">이전</span><?php endif ?>
</div>
<?php
$blockSize = 10;
$currentBlock= ceil($page / $blockSize);
$start = ($currentBlock - 1) * $blockSize + 1;
$end = min($totalPages, $currentBlock * $blockSize);
for ($i = $start; $i <= $end; $i++):
?>
<?php if ($i == $page): ?>
<!-- ✅ 여기! 현재 페이지는 span.current -->
<span class="current"><?= $i ?></span>
<?php else: ?>
<a href="?<?= http_build_query(array_merge($_GET, ['page'=>$i])) ?>"><?= $i ?></a>
<?php endif ?>
<?php endfor ?>
<?php if ($page < $totalPages): ?>
<a href="?<?= http_build_query(array_merge($_GET, ['page'=>$page+1])) ?>" class="next">다음</a>
<?php else: ?><span class="next">다음</span><?php endif ?>
</div>
<?php endif ?>
<div class="btn-wrap right">
<button type="button" class="btn-primary" onclick="location.href='/kngil/skin/qa_write.skin.php'">
<i class="fa fa-pencil" aria-hidden="true"></i> 문의등록
</button>
</div>
</div>
</section>