Files
dnssash/theme/rd.dnssash/skin/board/order_eclem/view.skin.php
T
2026-06-11 18:47:38 +09:00

206 lines
11 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<?php
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
include_once(G5_LIB_PATH.'/thumbnail.lib.php');
// add_stylesheet('css 구문', 출력순서); 숫자가 작을 수록 먼저 출력됨
add_stylesheet('<link rel="stylesheet" href="'.$board_skin_url.'/style.css">', 0);
add_javascript('<script src="'.G5_JS_URL.'/viewimageresize.js"></script>', 0);
add_javascript('<script src="'.$board_skin_url.'/order_form.js"></script>', 10);
// 💡 [수정] 대리점 기능 비활성화 -> 전문가(Level 9) 또는 관리자(Level 10)에게는 활성화
$is_admin = (isset($member['mb_level']) && $member['mb_level'] >= 8);
$is_agent = (isset($member['mb_level']) && ($member['mb_level'] == 9 || $member['mb_level'] == 10));
// 💡 [추가] 견적 정보 로드
$estimate_master = sql_fetch("SELECT * FROM estimate WHERE wr_id = '{$view['wr_id']}' AND is_deleted = 0");
$items = [];
if ($estimate_master) {
$result_items = sql_query("SELECT * FROM estimate_item WHERE estimate_id = '{$estimate_master['id']}' AND is_deleted = 0 ORDER BY no ASC");
while ($item = sql_fetch_array($result_items)) {
$items[] = $item;
}
}
// 💡 [추가] 뷰페이지에서 사용할 헤더 정의 (대리점용 필드 제외)
$view_estimate_headers = array("no", "위치", "창호형태", "창비율", "규격", "유리사양(색상)", "시정장치", "교체위치", "비고");
?>
<!-- 게시물 읽기 시작 { -->
<article id="bo_v" style="width:<?php echo $width; ?>">
<header>
<h2 id="bo_v_title">
<?php if ($category_name) { ?>
<span class="bo_v_cate"><?php echo $view['ca_name']; // 분류 출력 끝 ?></span>
<?php } ?>
<span class="bo_v_tit">
<?php
echo cut_str(get_text($view['wr_subject']), 70); // 글제목 출력
?></span>
</h2>
</header>
<section id="bo_v_info">
<!--
<div class="profile_info">
<div class="pf_img"><?php echo get_member_profile_img($view['mb_id']) ?></div>
<div class="profile_info_ct">
<strong><?php echo $view['name'] ?><?php if ($is_ip_view) { echo "&nbsp;($ip)"; } ?></strong><br>
<a href="#bo_vc"> <i class="far fa-comment-dots" aria-hidden="true"></i> <?php echo number_format($view['wr_comment']) ?>건</a>
<span><i class="far fa-eye" aria-hidden="true"></i> <?php echo number_format($view['wr_hit']) ?>회</span>
<strong class="if_date"><i class="far fa-clock" aria-hidden="true"></i> <?php echo date("y-m-d H:i", strtotime($view['wr_datetime'])) ?></strong>
</div>
</div>
-->
<div id="bo_v_top">
<ul class="btn_bo_user">
<li><a href="<?php echo $list_href ?>" class="btn_b01 btn"><i class="fas fa-list" aria-hidden="true"></i> 목록</a></li>
<?php if ($reply_href && ($is_admin || $is_agent)) { // 💡 [수정] 답변 버튼 노출 조건 완화 ?>
<li><a href="<?php echo $reply_href ?>" class="btn_b01 btn"><i class="fas fa-reply" aria-hidden="true"></i> 답변</a></li>
<?php } ?>
<?php if ($write_href) { ?><li><a href="<?php echo $write_href ?>" class="btn_b02 btn"><i class="fas fa-pencil-alt" aria-hidden="true"></i> 글쓰기</a></li><?php } ?>
</ul>
<ul class="btn_bo_user">
<?php if ($update_href) { ?><li><a href="<?php echo $update_href ?>" class="btn btn_b01">수정</a></li><?php } ?>
<?php if ($delete_href) { ?><li><a href="<?php echo $delete_href ?>" onclick="del(this.href); return false;" class="btn btn_b01">삭제</a></li><?php } ?>
<?php if ($copy_href) { ?><li><a href="<?php echo $copy_href ?>" onclick="board_move(this.href); return false;" class="btn btn_b01">복사</a></li><?php } ?>
<?php if ($move_href) { ?><li><a href="<?php echo $move_href ?>" onclick="board_move(this.href); return false;" class="btn btn_b01">이동</a></li><?php } ?>
<?php if ($search_href) { ?><li><a href="<?php echo $search_href ?>" class="btn btn_b01">검색</a></li><?php } ?>
</ul>
</div>
</section>
<section id="bo_v_atc">
<h2 id="bo_v_atc_title">본문</h2>
<!-- 💡 [수정] 견적 정보 출력 (order2.php 스타일 적용) -->
<?php if ($estimate_master) { ?>
<div class="order-view-container">
<div class="order-common-specs">
<h3>견적 공통 사양</h3>
<table class="house-info">
<tbody>
<tr>
<th>주거공간 형태</th>
<td><?php echo htmlspecialchars($estimate_master['house_type'] ?? ''); ?></td>
<th>공간 규모</th>
<td><?php echo htmlspecialchars($estimate_master['house_size'] ?? ''); ?></td>
</tr>
<tr>
<th>프레임 소재</th>
<td><?php echo htmlspecialchars($estimate_master['material'] ?? ''); ?></td>
<th>프레임 컬러</th>
<td><?php echo ($estimate_master['color'] == '색지정') ? htmlspecialchars($estimate_master['temp_2'] ?? '') : htmlspecialchars($estimate_master['color'] ?? ''); ?></td>
</tr>
<tr>
<th>유리두께</th>
<td><?php echo htmlspecialchars($estimate_master['glass_thickness'] ?? ''); ?></td>
<th>시공포함</th>
<td><?php echo htmlspecialchars($estimate_master['install'] ?? ''); ?></td>
</tr>
<tr>
<th>제품구매</th>
<td><?php echo htmlspecialchars($estimate_master['temp_1'] ?? ''); ?></td>
</tr>
</tbody>
</table>
</div>
<div class="order-individual-specs">
<h3 style="margin-top: 30px;">개별 창 상세 사양</h3>
<div class="table-scroll">
<table id="estimate_table" class="view-table">
<thead>
<tr>
<?php foreach($view_estimate_headers as $header) { echo "<th>{$header}</th>"; } ?>
</tr>
</thead>
<tbody id="estimate_body">
<?php if (count($items) > 0): ?>
<?php foreach ($items as $item): ?>
<tr>
<td><?php echo htmlspecialchars($item['no'] ?? ''); ?></td>
<td><?php echo htmlspecialchars($item['location'] ?? ''); ?></td>
<td><?php echo htmlspecialchars($item['windowType'] ?? ''); ?></td>
<td><?php echo htmlspecialchars($item['windowRatio'] ?? ''); ?></td>
<td><?php echo htmlspecialchars($item['spec_width'] ?? '') . ' × ' . htmlspecialchars($item['spec_height'] ?? ''); ?></td>
<td><?php echo htmlspecialchars($item['glass_color'] ?? ''); ?></td>
<td><?php echo htmlspecialchars($item['handle'] ?? ''); ?></td>
<td><?php echo htmlspecialchars($item['replacePart'] ?? ''); ?></td>
<td><?php echo htmlspecialchars($item['extra_1'] ?? ''); ?></td>
</tr>
<?php endforeach; ?>
<?php else: ?>
<tr>
<td colspan="<?php echo count($view_estimate_headers); ?>" class="empty_list">견적 항목이 없습니다.</td>
</tr>
<?php endif; ?>
</tbody>
</table>
</div>
</div>
</div>
<?php } ?>
<!-- 본문 내용 시작 { -->
<div id="bo_v_con"><?php echo get_view_thumbnail($view['content']); ?></div>
<!-- } 본문 내용 끝 -->
<?php if ($is_signature) { ?><p><?php echo $signature ?></p><?php } ?>
<?php /* 스크랩 추천 비추천 시작 { */ ?>
<?php if (false && ($scrap_href || $good_href || $nogood_href)) { ?>
<div id="bo_v_act">
<?php if ($scrap_href) { ?><a href="<?php echo $scrap_href; ?>" target="_blank" class="btn_b01 btn" onclick="win_scrap(this.href); return false;"><i class="fas fa-thumbtack" aria-hidden="true"></i> 스크랩</a><?php } ?>
<?php if ($good_href) { ?>
<span class="bo_v_act_gng">
<a href="<?php echo $good_href.'&amp;'.$qstr ?>" id="good_button" class="btn_b01 btn"><i class="far fa-thumbs-up" aria-hidden="true"></i> 추천 <strong><?php echo number_format($view['wr_good']) ?></strong></a>
<b id="bo_v_act_good"></b>
</span>
<?php } ?>
<?php if ($nogood_href) { ?>
<span class="bo_v_act_gng">
<a href="<?php echo $nogood_href.'&amp;'.$qstr ?>" id="nogood_button" class="btn_b01 btn"><i class="far fa-thumbs-down" aria-hidden="true"></i> 비추천 <strong><?php echo number_format($view['wr_nogood']) ?></strong></a>
<b id="bo_v_act_nogood"></b>
</span>
<?php } ?>
</div>
<?php } ?>
<?php /* } 스크랩 추천 비추천 끝 */ ?>
</section>
<?php
include_once(G5_BBS_PATH.'/view_comment.php');
?>
</article>
<!-- } 게시물 읽기 끝 -->
<script>
document.addEventListener('DOMContentLoaded', function() {
// 더보기 버튼 기능
const moreOptWrappers = document.querySelectorAll('.more_opt_wrapper');
moreOptWrappers.forEach(wrapper => {
const btn = wrapper.querySelector('.btn_more_opt');
const list = wrapper.querySelector('.more_opt');
if (btn && list) {
list.style.display = 'none'; // 💡 [수정] JS로 초기에 숨김
btn.addEventListener('click', function(e) {
e.stopPropagation();
const currentDisplay = list.style.display;
document.querySelectorAll('.more_opt').forEach(el => el.style.display = 'none');
list.style.display = (currentDisplay === 'none') ? 'block' : 'none';
});
}
});
document.addEventListener('click', function() {
document.querySelectorAll('.more_opt').forEach(el => el.style.display = 'none');
});
});
// PHP 변수를 JavaScript로 전달
var gallery_general_config = {
bo_download_point: <?php echo (int)$board['bo_download_point']; ?>
};
</script>