리빌더 부분 추가
This commit is contained in:
75
theme/rb.basic/skin/poll/basic/poll.skin.php
Normal file
75
theme/rb.basic/skin/poll/basic/poll.skin.php
Normal file
@ -0,0 +1,75 @@
|
||||
<?php
|
||||
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
|
||||
|
||||
// add_stylesheet('css 구문', 출력순서); 숫자가 작을 수록 먼저 출력됨
|
||||
add_stylesheet('<link rel="stylesheet" href="'.$poll_skin_url.'/style.css">', 0);
|
||||
?>
|
||||
|
||||
<!-- 설문조사 시작 { -->
|
||||
<form name="fpoll" action="<?php echo G5_BBS_URL ?>/poll_update.php" onsubmit="return fpoll_submit(this);" method="post">
|
||||
<input type="hidden" name="po_id" value="<?php echo $po_id ?>">
|
||||
<input type="hidden" name="skin_dir" value="<?php echo urlencode($skin_dir); ?>">
|
||||
<section id="poll">
|
||||
<header>
|
||||
<h2>설문조사</h2>
|
||||
<?php if ($is_admin == "super") { ?><a href="<?php echo G5_ADMIN_URL ?>/poll_form.php?w=u&po_id=<?php echo $po_id ?>" class="btn_admin" title="설문관리"><i class="fa fa-cog fa-spin fa-fw"></i><span class="sound_only">설문관리</span></a><?php } ?>
|
||||
<a href="<?php echo G5_BBS_URL."/poll_result.php?po_id=$po_id&skin_dir=".urlencode($skin_dir); ?>" target="_blank" onclick="poll_result(this.href); return false;" class="btn_result">결과보기</a>
|
||||
</header>
|
||||
<div class="poll_con">
|
||||
<p><?php echo $po['po_subject'] ?></p>
|
||||
<ul>
|
||||
<?php for ($i=1; $i<=9 && $po["po_poll{$i}"]; $i++) { ?>
|
||||
<li class="chk_box">
|
||||
<input type="radio" name="gb_poll" value="<?php echo $i ?>" id="gb_poll_<?php echo $i ?>">
|
||||
<label for="gb_poll_<?php echo $i ?>">
|
||||
<span></span>
|
||||
<?php echo $po['po_poll'.$i] ?>
|
||||
</label>
|
||||
</li>
|
||||
<?php } ?>
|
||||
</ul>
|
||||
<div id="poll_btn">
|
||||
<button type="submit" class="btn_poll">투표하기</button>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</form>
|
||||
|
||||
<script>
|
||||
function fpoll_submit(f)
|
||||
{
|
||||
<?php
|
||||
if ($member['mb_level'] < $po['po_level'])
|
||||
echo " alert('권한 {$po['po_level']} 이상의 회원만 투표에 참여하실 수 있습니다.'); return false; ";
|
||||
?>
|
||||
|
||||
var chk = false;
|
||||
for (i=0; i<f.gb_poll.length;i ++) {
|
||||
if (f.gb_poll[i].checked == true) {
|
||||
chk = f.gb_poll[i].value;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!chk) {
|
||||
alert("투표하실 설문항목을 선택하세요");
|
||||
return false;
|
||||
}
|
||||
|
||||
var new_win = window.open("about:blank", "win_poll", "width=616,height=500,scrollbars=yes,resizable=yes");
|
||||
f.target = "win_poll";
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
function poll_result(url)
|
||||
{
|
||||
<?php
|
||||
if ($member['mb_level'] < $po['po_level'])
|
||||
echo " alert('권한 {$po['po_level']} 이상의 회원만 결과를 보실 수 있습니다.'); return false; ";
|
||||
?>
|
||||
|
||||
win_poll(url);
|
||||
}
|
||||
</script>
|
||||
<!-- } 설문조사 끝 -->
|
||||
124
theme/rb.basic/skin/poll/basic/poll_result.skin.php
Normal file
124
theme/rb.basic/skin/poll/basic/poll_result.skin.php
Normal file
@ -0,0 +1,124 @@
|
||||
<?php
|
||||
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
|
||||
|
||||
$get_max_cnt = 0;
|
||||
|
||||
if ((int) $total_po_cnt > 0){
|
||||
foreach( $list as $k => $v ) {
|
||||
$get_max_cnt = max( array( $get_max_cnt, $v['cnt'] ) ); // 가장 높은 투표수를 뽑습니다.
|
||||
}
|
||||
}
|
||||
|
||||
// add_stylesheet('css 구문', 출력순서); 숫자가 작을 수록 먼저 출력됨
|
||||
add_stylesheet('<link rel="stylesheet" href="'.$poll_skin_url.'/style.css">', 0);
|
||||
?>
|
||||
|
||||
<!-- 설문조사 결과 시작 { -->
|
||||
<div id="poll_result" class="new_win">
|
||||
<h1 id="win_title"><?php echo $g5['title'] ?></h1>
|
||||
<div class="new_win_con2">
|
||||
<!-- 설문조사 결과 그래프 시작 { -->
|
||||
<span class="poll_all">전체 <?php echo $nf_total_po_cnt ?>표</span>
|
||||
<section id="poll_result_list">
|
||||
<h2><?php echo $po_subject ?> 결과</h2>
|
||||
<ol>
|
||||
<?php
|
||||
for ($i=1; $i<=count($list); $i++) {
|
||||
// 가장 높은 투표수와 같으면 li 태그에 poll_1st 클래스가 붙습니다.
|
||||
$poll_1st_class = ($get_max_cnt && ((int) $list[$i]['cnt'] === (int) $get_max_cnt)) ? 'poll_1st' : '';
|
||||
?>
|
||||
<li class="<?php echo $poll_1st_class; ?>">
|
||||
<span><?php echo $list[$i]['content'] ?></span>
|
||||
<div class="poll_result_graph">
|
||||
<span style="width:<?php echo number_format($list[$i]['rate'], 1) ?>%"></span>
|
||||
</div>
|
||||
<div class="poll_numerical">
|
||||
<strong class="poll_cnt"><?php echo $list[$i]['cnt'] ?> 표</strong>
|
||||
<span class="poll_percent"><?php echo number_format($list[$i]['rate'], 1) ?> %</span>
|
||||
</div>
|
||||
</li>
|
||||
<?php } ?>
|
||||
</ol>
|
||||
</section>
|
||||
<!-- } 설문조사 결과 그래프 끝 -->
|
||||
|
||||
<!-- 설문조사 기타의견 시작 { -->
|
||||
<?php if ($is_etc) { ?>
|
||||
<section id="poll_result_cmt">
|
||||
<h2>이 설문에 대한 기타의견</h2>
|
||||
|
||||
<?php for ($i=0; $i<count($list2); $i++) { ?>
|
||||
<article>
|
||||
<header>
|
||||
<h2><?php echo $list2[$i]['pc_name'] ?><span class="sound_only">님의 의견</span></h2>
|
||||
<?php echo $list2[$i]['name'] ?>
|
||||
<span class="poll_datetime"><i class="fa fa-clock-o" aria-hidden="true"></i> <?php echo $list2[$i]['datetime'] ?></span>
|
||||
<span class="poll_cmt_del"><?php if ($list2[$i]['del']) { echo $list2[$i]['del']."<i class=\"fa fa-trash-o\" aria-hidden=\"true\"></i><span class=\"sound_only\">삭제</span></a>"; } ?></span>
|
||||
</header>
|
||||
<p>
|
||||
<?php echo $list2[$i]['idea'] ?>
|
||||
</p>
|
||||
</article>
|
||||
<?php } ?>
|
||||
|
||||
<?php if ($member['mb_level'] >= $po['po_level']) { ?>
|
||||
<form name="fpollresult" action="./poll_etc_update.php" onsubmit="return fpollresult_submit(this);" method="post" autocomplete="off" id="poll_other_q">
|
||||
<input type="hidden" name="po_id" value="<?php echo $po_id ?>">
|
||||
<input type="hidden" name="w" value="">
|
||||
<input type="hidden" name="skin_dir" value="<?php echo urlencode($skin_dir); ?>">
|
||||
<?php if ($is_member) { ?><input type="hidden" name="pc_name" value="<?php echo get_text(cut_str($member['mb_nick'],255)) ?>"><?php } ?>
|
||||
<div id="poll_result_wcmt">
|
||||
<h3><span>기타의견</span><?php echo $po_etc ?></h3>
|
||||
<div>
|
||||
<label for="pc_idea" class="sound_only">의견<strong>필수</strong></label>
|
||||
<input type="text" id="pc_idea" name="pc_idea" required class="full_input required" size="47" maxlength="100" placeholder="의견을 입력해주세요">
|
||||
</div>
|
||||
</div>
|
||||
<?php if ($is_guest) { ?>
|
||||
<div class="poll_guest">
|
||||
<label for="pc_name" class="sound_only">이름<strong>필수</strong></label>
|
||||
<input type="text" name="pc_name" id="pc_name" required class="full_input required" size="20" placeholder="이름">
|
||||
</div>
|
||||
<?php echo captcha_html(); ?>
|
||||
<?php } ?>
|
||||
<button type="submit" class="btn_submit">의견남기기</button>
|
||||
</form>
|
||||
<?php } ?>
|
||||
|
||||
</section>
|
||||
<?php } ?>
|
||||
<!-- } 설문조사 기타의견 끝 -->
|
||||
|
||||
<!-- 설문조사 다른 결과 보기 시작 { -->
|
||||
<aside id="poll_result_oth">
|
||||
<h2>다른 투표 결과 보기</h2>
|
||||
<ul>
|
||||
<?php for ($i=0; $i<count($list3); $i++) { ?>
|
||||
<li><a href="./poll_result.php?po_id=<?php echo $list3[$i]['po_id'] ?>&skin_dir=<?php echo urlencode($skin_dir); ?>"> <?php echo $list3[$i]['subject'] ?> </a><span><i class="fa fa-clock-o" aria-hidden="true"></i> <?php echo $list3[$i]['date'] ?></span></li>
|
||||
<?php } ?>
|
||||
</ul>
|
||||
</aside>
|
||||
<!-- } 설문조사 다른 결과 보기 끝 -->
|
||||
|
||||
<div class="win_btn">
|
||||
<button type="button" onclick="window.close();" class="btn_close">창닫기</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
$(function() {
|
||||
$(".poll_delete").click(function() {
|
||||
if(!confirm("해당 기타의견을 삭제하시겠습니까?"))
|
||||
return false;
|
||||
});
|
||||
});
|
||||
|
||||
function fpollresult_submit(f)
|
||||
{
|
||||
<?php if ($is_guest) { echo chk_captcha_js(); } ?>
|
||||
|
||||
return true;
|
||||
}
|
||||
</script>
|
||||
<!-- } 설문조사 결과 끝 -->
|
||||
81
theme/rb.basic/skin/poll/basic/style.css
Normal file
81
theme/rb.basic/skin/poll/basic/style.css
Normal file
@ -0,0 +1,81 @@
|
||||
@charset "utf-8";
|
||||
|
||||
/* ### 기본 스타일 커스터마이징 시작 ### */
|
||||
|
||||
#poll_result .win_btn {text-align:center} /* 새창용 */
|
||||
|
||||
/* ### 기본 스타일 커스터마이징 끝 ### */
|
||||
|
||||
/* 설문조사 스킨 */
|
||||
#poll {border:1px solid #dde7e9;background:#f7f7f7;position:relative;border-radius:3px;margin-bottom:15px}
|
||||
#poll header {position:relative;border-bottom:1px solid #e8e8e8;padding:15px}
|
||||
#poll header:after {display:block;visibility:hidden;clear:both;content:""}
|
||||
#poll header h2 {display:inline-block;float:left;font-size:1.167em;color:#000;line-height:28px}
|
||||
#poll header h2:after {display:block;visibility:hidden;clear:both;content:""}
|
||||
#poll header .btn_result {float:right;display:inline-block;line-height:20px;height:28px;border:1px solid #d5d9dd;color:#3a8afd;border-radius:2px;padding:2px 5px;background:#fff}
|
||||
#poll header .btn_admin {float:right;margin-left:5px;line-height:28px;font-size:1.4em}
|
||||
#poll ul {padding:0 20px;list-style:none}
|
||||
#poll li {padding:5px 0}
|
||||
|
||||
.selec_chk {position:absolute;top:0;left:0;width:0;height:0;opacity:0;outline:0;z-index:-1;overflow:hidden}
|
||||
.chk_box {position:relative}
|
||||
.chk_box input[type="radio"] {position:absolute;top:0;left:0;width:0;height:0;opacity:0;outline:0;z-index:-1;overflow:hidden}
|
||||
.chk_box input[type="radio"] + label {position:relative;padding-left:23px;display:inline-block;color:#676e70}
|
||||
.chk_box input[type="radio"] + label span {position:absolute;top:0;left:0;width:15px;height:15px;display:block;background:#fff;border:1px solid #cdd6df;border-radius:50%}
|
||||
.chk_box input[type="radio"]:checked + label {color:#305af9}
|
||||
.chk_box input[type="radio"]:checked + label span:before {width:7px;height:7px;background:#305af9;content:'';position:absolute;top:3px;left:3px;border-radius:50%}
|
||||
|
||||
#poll .poll_con {}
|
||||
#poll .poll_con p {font-weight:bold;padding:15px 20px;color:#000;font-size:1.167em}
|
||||
#poll_btn {padding:10px 20px 20px;text-align:center}
|
||||
#poll_btn:after {display:block;visibility:hidden;clear:both;content:""}
|
||||
#poll_btn .btn_poll {display:block;width:100%;height:40px;line-height:40px;padding:0 10px;border:0;font-weight:bold;background:#3a8afd;color:#fff;border-radius:3px}
|
||||
|
||||
/* 설문조사 결과 (새창) */
|
||||
#poll_result {}
|
||||
#poll_result section {}
|
||||
#poll_result .tbl_wrap {margin:0}
|
||||
#poll_result .sv_member,
|
||||
#poll_result .sv_guest {font-weight:bold}
|
||||
#poll_result .poll_all {position:absolute;top:10px;right:10px;display:inline-block;margin:0 0 10px;line-height:30px;font-size:0.92em;color:#3a8afd;background:#f6f6f6;padding:0 10px;border-radius:5px}
|
||||
#poll_result_list {clear:both;margin:20px;border:1px solid #d6e2f4;border-top:0;background:#fff;border-radius:5px}
|
||||
#poll_result_list h2 {margin:0;font-size:1.25em;padding:15px;margin:0 0 15px;border-top:1px solid #d6e2f4;border-bottom:1px solid #d6e2f4;text-align:center;background:#edf3fc;color:#375582;border-radius:5px}
|
||||
#poll_result_list dt {margin-right:5%;color:#e8180d;text-align:right}
|
||||
#poll_result_list ol {margin:0;padding:0 20px}
|
||||
#poll_result_list li {margin:20px 0;position:relative;list-style-position:inside}
|
||||
|
||||
.poll_1st .poll_result_graph span {background:#3a8afd}
|
||||
.poll_result_graph {position:relative;width:90%;margin:5px 0;height:15px;background:#fff;border-radius:10px;-moz-box-shadow:inset 0px 2px 8px #dadada;-webkit-box-shadow:inset 0px 2px 8px #dadada;box-shadow:inset 0px 2px 8px #dadada}
|
||||
.poll_result_graph span {position:absolute;top:0;left:0;height:15px;background:#8395b3;border-radius:10px 10px;white-space:nowrap}
|
||||
|
||||
.poll_numerical {display:inline-block;position:absolute;top:0;right:0;text-align:center}
|
||||
.poll_numerical .poll_percent {display:block;font-size:1.2em;color:#3a8afd;font-weight:bold;letter-spacing:-0.5px}
|
||||
.poll_numerical .poll_cnt {font-size:1em;text-align:right;color:#8d8d8d}
|
||||
|
||||
#poll_result_cmt {margin:20px}
|
||||
#poll_result_cmt h2 {position:absolute;font-size:0;line-height:0;overflow:hidden}
|
||||
#poll_result_cmt article {margin:15px 0;position:relative;border-bottom:1px solid #eaeaea}
|
||||
#poll_result_cmt h1 {position:absolute;margin:0;padding:0;border:0;font-size:0;text-indent:-9999em;line-height:0;overflow:hidden}
|
||||
#poll_result_cmt header {margin:0 0 5px}
|
||||
#poll_result_cmt .poll_datetime {display:inline-block;font-size:0.92em;color:#777}
|
||||
#poll_result_cmt .profile_img img {border-radius:50%}
|
||||
#poll_result_cmt p {padding:10px;line-height:1.5em}
|
||||
|
||||
#poll_other_q h3 {margin:0;font-size:1.25em;padding:10px;border-bottom:1px solid #eaeaea;text-align:left}
|
||||
#poll_other_q h3 span {background:#f7f8e3;color:#c97600;padding:3px;display:inline-block;border-radius:5px;margin-right:5px;font-weight:normal;font-size:0.8em}
|
||||
#poll_result_wcmt {border:1px solid #cfd4db;margin-bottom:10px}
|
||||
#poll_result_wcmt input {border:0;height:80px;padding:10px}
|
||||
#poll_result_cmt .btn_submit {padding:0 20px;float:right}
|
||||
|
||||
.poll_guest input {border: 1px solid #cfd4db;padding:10px;margin-bottom:10px;display:inline-block}
|
||||
|
||||
.poll_cmt_del {float:right}
|
||||
.poll_cmt_del a {display:inline-block;margin:0 0 5px 10px;color:#c7c9cb;font-size:15px}
|
||||
.poll_cmt_del:hover a {color:#3a8afd}
|
||||
|
||||
#poll_result_oth {clear:both;margin:20px}
|
||||
#poll_result_oth h2 {padding:0 0 10px}
|
||||
#poll_result_oth ul {margin:0;padding:0;list-style:none;border:1px solid #ddd;background:#fff;border-top:0}
|
||||
#poll_result_oth ul li{border-top:1px solid #eaeaea;position:relative;line-height:20px}
|
||||
#poll_result_oth a {display:block;padding:10px}
|
||||
#poll_result_oth li span {position:absolute;bottom:10px;right:15px;color:#777;font-size:0.92em}
|
||||
Reference in New Issue
Block a user