2022-09-17 20:50:50 +09:00
|
|
|
<?php
|
2024-09-23 11:07:19 +09:00
|
|
|
include_once "./_common.php";
|
2024-10-05 07:34:26 +09:00
|
|
|
include_once G5_CAPTCHA_PATH . "/captcha.lib.php";
|
2022-09-17 20:50:50 +09:00
|
|
|
|
2024-09-30 01:58:32 +09:00
|
|
|
$po = sql_fetch("SELECT * FROM {$g5['poll_table']} where po_id = '{$po_id}' ");
|
2022-09-17 20:50:50 +09:00
|
|
|
if (!$po['po_id'])
|
2024-09-19 20:57:39 +09:00
|
|
|
alert('설문조사 정보가 없습니다.');
|
2022-09-17 20:50:50 +09:00
|
|
|
|
|
|
|
|
if ($member['mb_level'] < $po['po_level'])
|
2024-09-19 20:57:39 +09:00
|
|
|
alert('권한 ' . $po['po_level'] . ' 이상의 회원만 결과를 보실 수 있습니다.');
|
2022-09-17 20:50:50 +09:00
|
|
|
|
|
|
|
|
$g5['title'] = '설문조사 결과';
|
|
|
|
|
|
|
|
|
|
$po_subject = $po['po_subject'];
|
|
|
|
|
|
|
|
|
|
$max = 1;
|
|
|
|
|
$total_po_cnt = 0;
|
2024-09-19 20:57:39 +09:00
|
|
|
for ($i = 1; $i <= 9; $i++) {
|
|
|
|
|
$poll = $po['po_poll' . $i];
|
|
|
|
|
if ($poll == '')
|
|
|
|
|
break;
|
2022-09-17 20:50:50 +09:00
|
|
|
|
2024-09-19 20:57:39 +09:00
|
|
|
$count = $po['po_cnt' . $i];
|
|
|
|
|
$total_po_cnt += $count;
|
2022-09-17 20:50:50 +09:00
|
|
|
|
2024-09-19 20:57:39 +09:00
|
|
|
if ($count > $max)
|
|
|
|
|
$max = $count;
|
2022-09-17 20:50:50 +09:00
|
|
|
}
|
|
|
|
|
$nf_total_po_cnt = number_format($total_po_cnt);
|
|
|
|
|
|
2024-09-23 09:37:13 +09:00
|
|
|
$list = [];
|
2022-09-17 20:50:50 +09:00
|
|
|
|
2024-09-19 20:57:39 +09:00
|
|
|
for ($i = 1; $i <= 9; $i++) {
|
|
|
|
|
$poll = $po['po_poll' . $i];
|
|
|
|
|
if ($poll == '') {
|
|
|
|
|
break;
|
|
|
|
|
}
|
2022-09-17 20:50:50 +09:00
|
|
|
|
2024-09-19 20:57:39 +09:00
|
|
|
$list[$i]['content'] = $poll;
|
|
|
|
|
$list[$i]['cnt'] = $po['po_cnt' . $i];
|
|
|
|
|
if ($total_po_cnt > 0)
|
|
|
|
|
$list[$i]['rate'] = ($list[$i]['cnt'] / $total_po_cnt) * 100;
|
2022-09-17 20:50:50 +09:00
|
|
|
|
2024-09-19 20:57:39 +09:00
|
|
|
$bar = (int) ($list[$i]['cnt'] / $max * 100);
|
2022-09-17 20:50:50 +09:00
|
|
|
|
2024-09-19 20:57:39 +09:00
|
|
|
$list[$i]['bar'] = $bar;
|
|
|
|
|
$list[$i]['num'] = $i;
|
2022-09-17 20:50:50 +09:00
|
|
|
}
|
|
|
|
|
|
2024-09-23 09:37:13 +09:00
|
|
|
$list2 = [];
|
2022-09-17 20:50:50 +09:00
|
|
|
|
|
|
|
|
// 기타의견 리스트
|
|
|
|
|
$sql = " select a.*, b.mb_open
|
|
|
|
|
from {$g5['poll_etc_table']} a
|
|
|
|
|
left join {$g5['member_table']} b on (a.mb_id = b.mb_id)
|
2024-09-30 01:58:32 +09:00
|
|
|
where po_id = '{$po_id}' ORDER BY pc_id DESC ";
|
2022-09-17 20:50:50 +09:00
|
|
|
$result = sql_query($sql);
|
2024-09-19 20:57:39 +09:00
|
|
|
for ($i = 0; $row = sql_fetch_array($result); $i++) {
|
|
|
|
|
$list2[$i]['pc_name'] = get_text($row['pc_name']);
|
2024-09-23 11:07:19 +09:00
|
|
|
$list2[$i]['name'] = get_sideview($row['mb_id'], get_text(cut_str($row['pc_name'], 10)), '', '');
|
2024-09-19 20:57:39 +09:00
|
|
|
$list2[$i]['idea'] = get_text(cut_str($row['pc_idea'], 255));
|
|
|
|
|
$list2[$i]['datetime'] = $row['pc_datetime'];
|
|
|
|
|
|
|
|
|
|
$list2[$i]['del'] = '';
|
|
|
|
|
if ($is_admin == 'super' || ($row['mb_id'] == $member['mb_id'] && $row['mb_id']))
|
|
|
|
|
$list2[$i]['del'] = '<a href="' . G5_BBS_URL . '/poll_etc_update.php?w=d&pc_id=' . $row['pc_id'] . '&po_id=' . $po_id . '&skin_dir=' . $skin_dir . '" class="poll_delete">';
|
2022-09-17 20:50:50 +09:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 기타의견 입력
|
|
|
|
|
$is_etc = false;
|
|
|
|
|
if ($po['po_etc']) {
|
2024-09-19 20:57:39 +09:00
|
|
|
$is_etc = true;
|
|
|
|
|
$po_etc = $po['po_etc'];
|
|
|
|
|
if ($member['mb_id'])
|
|
|
|
|
$name = '<b>' . $member['mb_nick'] . '</b> <input type="hidden" name="pc_name" value="' . $member['mb_nick'] . '">';
|
|
|
|
|
else
|
|
|
|
|
$name = '<input type="text" name="pc_name" size="10" class="input" required>';
|
2022-09-17 20:50:50 +09:00
|
|
|
}
|
|
|
|
|
|
2024-09-23 09:37:13 +09:00
|
|
|
$list3 = [];
|
2022-09-17 20:50:50 +09:00
|
|
|
|
|
|
|
|
// 다른투표
|
2024-09-30 01:58:32 +09:00
|
|
|
$sql = "SELECT po_id, po_subject, po_date FROM {$g5['poll_table']} ORDER BY po_id DESC ";
|
2022-09-17 20:50:50 +09:00
|
|
|
$result = sql_query($sql);
|
2024-09-19 20:57:39 +09:00
|
|
|
for ($i = 0; $row2 = sql_fetch_array($result); $i++) {
|
|
|
|
|
$list3[$i]['po_id'] = $row2['po_id'];
|
|
|
|
|
$list3[$i]['date'] = substr($row2['po_date'], 2, 8);
|
|
|
|
|
$list3[$i]['subject'] = cut_str($row2['po_subject'], 60, "…");
|
2022-09-17 20:50:50 +09:00
|
|
|
}
|
|
|
|
|
|
2024-09-19 20:57:39 +09:00
|
|
|
if (preg_match('#^theme/(.+)$#', $skin_dir, $match)) {
|
|
|
|
|
if (G5_IS_MOBILE) {
|
|
|
|
|
$poll_skin_path = G5_THEME_MOBILE_PATH . '/' . G5_SKIN_DIR . '/poll/' . $match[1];
|
|
|
|
|
if (!is_dir($poll_skin_path))
|
|
|
|
|
$poll_skin_path = G5_THEME_PATH . '/' . G5_SKIN_DIR . '/poll/' . $match[1];
|
|
|
|
|
$poll_skin_url = str_replace(G5_PATH, G5_URL, $poll_skin_path);
|
|
|
|
|
} else {
|
|
|
|
|
$poll_skin_path = G5_THEME_PATH . '/' . G5_SKIN_DIR . '/poll/' . $match[1];
|
|
|
|
|
$poll_skin_url = str_replace(G5_PATH, G5_URL, $poll_skin_path);
|
|
|
|
|
}
|
|
|
|
|
//$skin_dir = $match[1];
|
2022-09-17 20:50:50 +09:00
|
|
|
} else {
|
2024-09-19 20:57:39 +09:00
|
|
|
if (G5_IS_MOBILE) {
|
|
|
|
|
$poll_skin_path = G5_MOBILE_PATH . '/' . G5_SKIN_DIR . '/poll/' . $skin_dir;
|
|
|
|
|
$poll_skin_url = G5_MOBILE_URL . '/' . G5_SKIN_DIR . '/poll/' . $skin_dir;
|
|
|
|
|
} else {
|
|
|
|
|
$poll_skin_path = G5_SKIN_PATH . '/poll/' . $skin_dir;
|
|
|
|
|
$poll_skin_url = G5_SKIN_URL . '/poll/' . $skin_dir;
|
|
|
|
|
}
|
2022-09-17 20:50:50 +09:00
|
|
|
}
|
|
|
|
|
|
2024-10-05 07:34:26 +09:00
|
|
|
include_once G5_PATH . "/head.sub.php";
|
2022-09-17 20:50:50 +09:00
|
|
|
|
2024-09-19 20:57:39 +09:00
|
|
|
if (!file_exists($poll_skin_path . '/poll_result.skin.php'))
|
|
|
|
|
die('skin error');
|
2024-10-05 07:34:26 +09:00
|
|
|
include_once $poll_skin_path . "/poll_result.skin.php";
|
2022-09-17 20:50:50 +09:00
|
|
|
|
2024-10-05 07:34:26 +09:00
|
|
|
include_once G5_PATH . "/tail.sub.php";
|