335 lines
14 KiB
PHP
335 lines
14 KiB
PHP
<!DOCTYPE html>
|
|
<html lang="ko">
|
|
<head>
|
|
<?php include __DIR__ . "/_head.php"; ?>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>Q&A 게시판 리스트</title>
|
|
|
|
<link rel="stylesheet" href="/kngil/css/qa/font-awesome.min.css?ver=2303229">
|
|
|
|
<!-- 디자인팀 작성 -->
|
|
<script src="/kngil/js/lib/jquery-3.6.1.min.js" type="text/javascript"></script>
|
|
<script src="/kngil/js/qa/jquery.mousewheel.min.js" type="text/javascript"></script>
|
|
<script src="https://cdn.jsdelivr.net/npm/gsap@3.12.5/dist/gsap.min.js"></script>
|
|
<script src="https://cdn.jsdelivr.net/npm/gsap@3.12.5/dist/ScrollTrigger.min.js"></script>
|
|
<script src="https://cdn.jsdelivr.net/npm/gsap@3.12.5/dist/ScrollToPlugin.min.js"></script>
|
|
<link rel="stylesheet" href="https://unpkg.com/aos@2.3.1/dist/aos.css" type="text/css"/>
|
|
<link rel="stylesheet" href="https://unpkg.com/lenis@1.1.9/dist/lenis.css">
|
|
<script src="https://unpkg.com/aos@2.3.1/dist/aos.js"></script>
|
|
<script src="https://unpkg.com/lenis@1.1.9/dist/lenis.min.js"></script>
|
|
<!-- <script src="/kngil/js/qa/qa_popup.js" type="text/javascript"></script>
|
|
<script src="/kngil/js/qa/qa_common.js" type="text/javascript"></script>
|
|
<script src="/kngil/js/qa/qa_index.js" type="text/javascript"></script> -->
|
|
|
|
<link rel="stylesheet" href="/kngil/css/qa/qa_reset.css"/>
|
|
<link rel="stylesheet" href="/kngil/css/qa/qa_font.css"/>
|
|
<link rel="stylesheet" href="/kngil/css/qa/qa_style.css"/>
|
|
<!-- <link rel="stylesheet" href="/kngil/css/style.css"/> -->
|
|
<!-- //디자인팀 작성 -->
|
|
</head>
|
|
<body>
|
|
|
|
<div class="wrapper">
|
|
<!-- HEADER -->
|
|
<?php include __DIR__ . "/_header.php"; ?>
|
|
<!-- //HEADER -->
|
|
<?php
|
|
include __DIR__ . "/pop_login.php";
|
|
include __DIR__ . "/pop_join.php";
|
|
include __DIR__ . "/pop_agreement.php";
|
|
include __DIR__ . "/pop_mypage01.php";
|
|
include __DIR__ . "/pop_mypage02.php";
|
|
include __DIR__ . "/pop_mypage03.php";
|
|
include __DIR__ . "/pop_password.php";
|
|
include __DIR__ . "/pop_privacy.php";
|
|
include __DIR__ . "/pop_search.php";
|
|
// include __DIR__ . "/_nav.php";
|
|
?>
|
|
<?php
|
|
$search = $search ?? '';
|
|
$cats = $cats ?? [];
|
|
$writer = $writer ?? '';
|
|
$status = $status ?? 'all';
|
|
?>
|
|
<div class="qa-container container faq">
|
|
<section class="intro">
|
|
<div class="top js__dark">
|
|
<h2 data-aos="fade-down" data-aos-duration="1000">Q&A</h2>
|
|
<span>EG-BIM 관련 문의하기</span>
|
|
</div>
|
|
<ul class="sub_tab">
|
|
<li><a href="/kngil/skin/faq_list.skin.php">자주하는 질문(FAQ)</a></li>
|
|
<li class="on"><a href="/kngil/bbs/qa_list.php">문의하기(Q&A)</a></li>
|
|
<li><a href="https://939.co.kr/saman/" target="_blank">원격지원</a></li>
|
|
</ul>
|
|
</section>
|
|
|
|
<span class="sub_tit">문의하기(Q&A)</span>
|
|
|
|
<div class="contents">
|
|
<form class="qa-controls" method="get" action="">
|
|
<div class="search-wrap">
|
|
<div class="qa-filters">
|
|
<div class="check-group">
|
|
<!-- <strong>구분</strong> -->
|
|
<?php
|
|
// 선택 여부 유틸
|
|
$isChecked = function($v) use ($cats) {
|
|
return in_array($v, $cats ?? [], true) ? 'checked' : '';
|
|
};
|
|
// 아무 것도 선택 안되어 있으면 전체 on
|
|
$allOn = empty($cats);
|
|
?>
|
|
<label><input type="checkbox" name="cat[]" value="전체"> 전체</label>
|
|
<label><input type="checkbox" name="cat[]" value="일반문의"> 일반</label>
|
|
<label><input type="checkbox" name="cat[]" value="개선문의"> 개선</label>
|
|
<label><input type="checkbox" name="cat[]" value="오류문의"> 오류</label>
|
|
<?php if (!empty($_SESSION['login'])): ?>
|
|
<label><input type="checkbox" name="cat[]" value="관리글"> 관리</label>
|
|
<?php endif; ?>
|
|
</div>
|
|
<div class="check-box">
|
|
<strong>작성자</strong>
|
|
<label><input type="checkbox" name="writer" value="me" <?= $writer==='me' ?'checked':'' ?>> 내가 작성한 글</label>
|
|
</div>
|
|
<?php if (!empty($_SESSION['login'])): ?>
|
|
<?php $status = $_GET['status'] ?? 'all'; ?>
|
|
<div class="check-box1" style="margin-left:20px;">
|
|
<strong>상태</strong>
|
|
<select name="status" class="status-select">
|
|
<option value="all" <?= $status==='all'?'selected':'' ?>>전체</option>
|
|
<option value="wait" <?= $status==='wait'?'selected':'' ?>>문의접수</option>
|
|
<option value="review"<?= $status==='review'?'selected':'' ?>>문의검토</option>
|
|
<option value="deep" <?= $status==='deep'?'selected':'' ?>>정밀검토</option>
|
|
<option value="patch" <?= $status==='patch'?'selected':'' ?>>패치예정</option>
|
|
<option value="done" <?= $status==='done'?'selected':'' ?>>답변완료</option>
|
|
</select>
|
|
</div>
|
|
<?php endif; ?>
|
|
|
|
</div>
|
|
<div class="qa-search search-box">
|
|
<?php if (!empty($_SESSION['login'])): ?>
|
|
<input type="number" class="qna-id-input" placeholder="Q&A ID">
|
|
<button type="button" class="btn-move">이동</button>
|
|
<?php endif; ?>
|
|
|
|
<input type="text" name="q" value="<?= htmlspecialchars($search) ?>" placeholder="제목+내용 검색어를 입력하세요">
|
|
<button type="submit" class="btn-search">
|
|
<i class="fa fa-search"></i> 검색
|
|
</button>
|
|
</div>
|
|
|
|
</div>
|
|
</form>
|
|
<div class="tbl-wrap">
|
|
<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'] === 'notice');
|
|
$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 (!empty($row['is_secret'])): ?>
|
|
<span style="color:#999">[비밀글]</span>
|
|
<?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'] === 'notice'): ?>
|
|
<!-- 공지사항이면 상태값 안 보여줌 -->
|
|
<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 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 ?>
|
|
|
|
<?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-group">
|
|
<button type="button" class="btn btn-write" onclick="location.href='/kngil/skin/qa_write.skin.php'">
|
|
<i class="fa fa-pencil" aria-hidden="true"></i> 문의등록
|
|
</button>
|
|
</div>
|
|
</div><!-- contents END /egbim1/skin/qa/basic/descope_qa_write.skin.php-->
|
|
</div><!-- container END -->
|
|
|
|
<button class="btn_top js__top topbtn_on" onclick="window.scrollTo(0,0);" style="bottom:60px;"><div class="arrow"></div></button>
|
|
|
|
<!-- FOOTER -->
|
|
<?php include __DIR__ . "/_footer.php"; ?>
|
|
<!-- //FOOTER -->
|
|
</div><!-- wrapper END -->
|
|
|
|
|
|
<script src="/kngil/js/index.js"></script>
|
|
<script src="/kngil/js/mypage.js"></script>
|
|
<script src="/kngil/js/join.js"></script>
|
|
<script type="module" src="/kngil/js/login.js"></script>
|
|
<script src="/kngil/js/login_sms.js"></script>
|
|
|
|
<script>
|
|
// AOS / Lenis 초기화 (안전 가드)
|
|
try {
|
|
AOS.init();
|
|
if (typeof Lenis !== 'undefined') {
|
|
const lenis = new Lenis();
|
|
lenis.on('scroll', ScrollTrigger.update);
|
|
gsap.ticker.add((time)=>{ lenis.raf(time * 1000) });
|
|
gsap.ticker.lagSmoothing(0);
|
|
window.lenis = lenis; // 다른 코드에서 접근할 수 있게
|
|
}
|
|
} catch(e) { console.error(e); }
|
|
</script>
|
|
|
|
<script>
|
|
// ===== 공용 유틸 =====
|
|
function getQueryString(name){
|
|
// 페이지 구성 요소가 없을 수 있으므로 가드
|
|
const intro = document.querySelector('.intro_wrap');
|
|
if (intro) intro.style.display = "none";
|
|
const mainMask = document.querySelector('.main_mask');
|
|
if (mainMask) mainMask.classList.add('skip');
|
|
return new URLSearchParams(window.location.search).get(name);
|
|
}
|
|
|
|
// 필터 변경 시 자동 제출
|
|
(function(){
|
|
const form = document.querySelector('.qa-controls');
|
|
const boxes = Array.from(document.querySelectorAll('.qa-controls input[name="cat[]"]'));
|
|
const writer = document.querySelector('.qa-controls input[name="writer"]');
|
|
|
|
function submitForm(){ form && form.submit(); }
|
|
|
|
function syncAllToggle(changed){
|
|
const allBox = boxes.find(b => b.value === 'all');
|
|
const itemBoxes = boxes.filter(b => b.value !== 'all');
|
|
|
|
if (!allBox) return;
|
|
|
|
if (changed && changed.value === 'all') {
|
|
// 전체 체크 시 개별은 해제
|
|
if (allBox.checked) itemBoxes.forEach(b => b.checked = false);
|
|
} else {
|
|
// 개별 체크 시 전체 해제
|
|
if (itemBoxes.some(b => b.checked)) allBox.checked = false;
|
|
// 개별이 전부 해제되면 전체 자동 체크
|
|
if (!itemBoxes.some(b => b.checked)) allBox.checked = true;
|
|
}
|
|
}
|
|
|
|
boxes.forEach(b => {
|
|
b.addEventListener('change', function(){ syncAllToggle(this); submitForm(); });
|
|
});
|
|
if (writer) writer.addEventListener('change', submitForm);
|
|
})();
|
|
|
|
|
|
|
|
// Q&A ID 검색
|
|
$(document).on("click", ".btn-move", function() {
|
|
const qnaId = $(".qna-id-input").val().trim();
|
|
if (!qnaId) {
|
|
alert("Q&A ID를 입력하세요.");
|
|
return;
|
|
}
|
|
location.href = "/kngil/bbs/qa_detail.php?id=" + qnaId;
|
|
});
|
|
|
|
$("#qna-id-search").on("keypress", function(e){
|
|
if(e.key === "Enter"){
|
|
$("#qna-id-btn").click();
|
|
}
|
|
});
|
|
|
|
</script>
|