first commit 2
This commit is contained in:
@@ -0,0 +1,175 @@
|
||||
<?php
|
||||
//if (!defined('_GNUBOARD_')) exit;
|
||||
include_once('../../../../common.php');
|
||||
|
||||
// 설문 관리 라이브러리 로드
|
||||
include_once(G5_ADMIN_PATH.'/survey_manage/lib/survey.lib.php');
|
||||
|
||||
$sv_id = isset($_GET['sv_id']) ? (int)$_GET['sv_id'] : 0;
|
||||
|
||||
if (!$sv_id) {
|
||||
alert('잘못된 접근입니다.', G5_URL);
|
||||
}
|
||||
|
||||
// 설문 유효성 검사
|
||||
$validation = validate_survey_access($sv_id, $member['mb_id'], $_SERVER['REMOTE_ADDR']);
|
||||
if (!$validation['success']) {
|
||||
alert($validation['message']);
|
||||
return;
|
||||
}
|
||||
|
||||
$survey = $validation['survey'];
|
||||
$questions = get_survey_questions($sv_id);
|
||||
|
||||
if (empty($questions)) {
|
||||
alert('설문 질문이 없습니다.', G5_URL);
|
||||
}
|
||||
|
||||
$g5['title'] = $survey['sv_title'];
|
||||
include_once(G5_THEME_PATH.'/head.sub.php');
|
||||
|
||||
// 설문 테마 색상
|
||||
$theme_color = $survey['sv_theme_color'] ?: '#AA20FF';
|
||||
?>
|
||||
|
||||
<style>
|
||||
/* 페이지 전용 스타일 */
|
||||
:root {
|
||||
--survey-primary: <?php echo $theme_color; ?>;
|
||||
--survey-primary-light: <?php echo $theme_color; ?>20;
|
||||
--survey-primary-dark: <?php echo $theme_color; ?>CC;
|
||||
}
|
||||
|
||||
body {
|
||||
background: linear-gradient(135deg, var(--survey-primary-light) 0%, #ffffff 100%);
|
||||
min-height: 100vh;
|
||||
}
|
||||
|
||||
.survey-page-container {
|
||||
min-height: 100vh;
|
||||
padding-top: 100px; /* 헤더 높이만큼 */
|
||||
}
|
||||
|
||||
.survey-page-header {
|
||||
text-align: center;
|
||||
margin-bottom: 40px;
|
||||
padding: 40px 20px;
|
||||
background: white;
|
||||
border-radius: 20px;
|
||||
box-shadow: 0 10px 30px rgba(0,0,0,0.1);
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
max-width: 800px;
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
}
|
||||
|
||||
.survey-page-header::before {
|
||||
content: '';
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
height: 5px;
|
||||
background: linear-gradient(90deg, var(--survey-primary) 0%, var(--survey-primary-dark) 100%);
|
||||
}
|
||||
|
||||
.survey-page-title {
|
||||
font-size: 2.5em;
|
||||
font-weight: 700;
|
||||
color: #333;
|
||||
margin-bottom: 15px;
|
||||
line-height: 1.2;
|
||||
}
|
||||
|
||||
.survey-page-description {
|
||||
font-size: 1.1em;
|
||||
color: #666;
|
||||
line-height: 1.6;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.survey-page-info {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
gap: 30px;
|
||||
margin-top: 20px;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
.survey-page-info-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
color: #888;
|
||||
font-size: 0.9em;
|
||||
}
|
||||
|
||||
.survey-page-info-item i {
|
||||
color: var(--survey-primary);
|
||||
}
|
||||
|
||||
.survey-form-section {
|
||||
max-width: 800px;
|
||||
margin: 0 auto;
|
||||
padding: 0 20px 80px;
|
||||
}
|
||||
|
||||
/* 반응형 */
|
||||
@media (max-width: 768px) {
|
||||
.survey-page-container {
|
||||
padding-top: 80px;
|
||||
}
|
||||
|
||||
.survey-page-title {
|
||||
font-size: 2em;
|
||||
}
|
||||
|
||||
.survey-page-info {
|
||||
flex-direction: column;
|
||||
gap: 15px;
|
||||
}
|
||||
|
||||
.survey-form-section {
|
||||
padding: 0 10px 60px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
<div class="survey-page-container">
|
||||
<!-- 설문 헤더 -->
|
||||
<!-- <div class="survey-page-header">-->
|
||||
<!-- <h1 class="survey-page-title">--><?php //echo htmlspecialchars($survey['sv_title']); ?><!--</h1>-->
|
||||
<!-- --><?php //if ($survey['sv_description']): ?>
|
||||
<!-- <p class="survey-page-description">--><?php //echo nl2br(htmlspecialchars($survey['sv_description'])); ?><!--</p>-->
|
||||
<!-- --><?php //endif; ?>
|
||||
<!-- -->
|
||||
<!-- <div class="survey-page-info">-->
|
||||
<!-- <div class="survey-page-info-item">-->
|
||||
<!-- <i class="fa fa-clock"></i>-->
|
||||
<!-- <span>예상 소요시간: --><?php //echo count($questions); ?><!--분</span>-->
|
||||
<!-- </div>-->
|
||||
<!-- <div class="survey-page-info-item">-->
|
||||
<!-- <i class="fa fa-question-circle"></i>-->
|
||||
<!-- <span>총 --><?php //echo count($questions); ?><!--개 질문</span>-->
|
||||
<!-- </div>-->
|
||||
<!-- <div class="survey-page-info-item">-->
|
||||
<!-- <i class="fa fa-users"></i>-->
|
||||
<!-- <span>--><?php //echo number_format(get_survey_response_count($sv_id, 'completed')); ?><!--명 참여</span>-->
|
||||
<!-- </div>-->
|
||||
<!-- </div>-->
|
||||
<!-- </div>-->
|
||||
|
||||
<!-- 설문 폼 섹션 (rb.custom 모듈 사용) -->
|
||||
<div class="survey-form-section">
|
||||
<?php
|
||||
// 설문 폼 커스텀 모듈 포함
|
||||
$_GET['sv_id'] = $sv_id; // 모듈에서 사용할 수 있도록 설정
|
||||
include_once(G5_THEME_PATH.'/rb.custom/survey_form/module.php');
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
include_once(G5_THEME_PATH.'/tail.sub.php');
|
||||
?>
|
||||
Reference in New Issue
Block a user