삭제
git-svn-id: http://xe-core.googlecode.com/svn/sandbox@2327 201d5d3c-b55e-5fd7-737f-ddc643e51545
17
modules/poll/conf/info.xml
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<module version="0.1">
|
||||
<title xml:lang="ko">설문조사</title>
|
||||
<title xml:lang="zh-CN">投票调查</title>
|
||||
<title xml:lang="jp">アンケート</title>
|
||||
<title xml:lang="en">Poll</title>
|
||||
<author email_address="zero@zeroboard.com" link="http://www.zeroboard.com" date="2007. 2. 28">
|
||||
<name xml:lang="ko">제로</name>
|
||||
<name xml:lang="zh-CN">zero</name>
|
||||
<name xml:lang="jp">Zero</name>
|
||||
<name xml:lang="en">zero</name>
|
||||
<description xml:lang="ko">설문조사 관리 모듈</description>
|
||||
<description xml:lang="zh-CN">管理投票调查的模块。</description>
|
||||
<description xml:lang="jp">アンケート管理モジュール</description>
|
||||
<description xml:lang="en">This module is for managering polls.</description>
|
||||
</author>
|
||||
</module>
|
||||
17
modules/poll/conf/module.xml
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<module>
|
||||
<grants />
|
||||
<actions>
|
||||
<action name="dispPollAdminList" type="view" admin_index="true" standalone="true" />
|
||||
<action name="dispPollAdminResult" type="view" standalone="true" />
|
||||
|
||||
<action name="dispPollAdminConfig" type="controller" standalone="true" />
|
||||
|
||||
<action name="getPollGetColorsetList" type="model" standalone="true" />
|
||||
|
||||
<action name="procInsert" type="controller" standalone="true" />
|
||||
<action name="procPoll" type="controller" standalone="true" />
|
||||
<action name="procPollAdminDeleteChecked" type="controller" standalone="true" />
|
||||
<action name="procPollAdminInsertConfig" type="controller" standalone="true" />
|
||||
</actions>
|
||||
</module>
|
||||
37
modules/poll/lang/en.lang.php
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
<?php
|
||||
/**
|
||||
* @file modules/poll/lang/en.lang.php
|
||||
* @author zero <zero@nzeo.com>
|
||||
* @brief poll module / basic language pack
|
||||
**/
|
||||
|
||||
$lang->poll = "Poll";
|
||||
$lang->poll_stop_date = "Expiration Date";
|
||||
$lang->poll_join_count = "Participants";
|
||||
$lang->poll_checkcount = "Number of required items";
|
||||
|
||||
$lang->cmd_poll_list = 'View poll list';
|
||||
$lang->cmd_delete_checked_poll = 'Delete selected poll';
|
||||
$lang->cmd_apply_poll = 'Apply poll';
|
||||
$lang->cmd_delete_checked_poll = 'Delete selected poll';
|
||||
|
||||
$lang->success_poll = 'Thank you for joining the poll.';
|
||||
|
||||
$lang->msg_already_poll = 'You already polled!';
|
||||
$lang->msg_cart_is_null = 'Please select an article to delete.';
|
||||
$lang->msg_checked_poll_is_deleted = '%d poll(s) are deleted.';
|
||||
$lang->msg_check_poll_item = 'Please select a poll item to poll.\n(Required poll item(s) may be different in each poll.)';
|
||||
$lang->msg_cart_is_null = 'Please select a poll to delete.';
|
||||
$lang->msg_checked_poll_is_deleted = '%d poll(s) are deleted.';
|
||||
$lang->msg_poll_not_exists = 'Selected poll does not exist.';
|
||||
|
||||
$lang->cmd_null_item = "No item value exist to post a poll. Please re-try.";
|
||||
|
||||
$lang->confirm_poll_submit = "Confirm to submit the poll?";
|
||||
|
||||
$lang->search_target_list = array(
|
||||
'title' => 'Title',
|
||||
'regdate' => 'Posting date',
|
||||
'ipaddress' => 'IP Address',
|
||||
);
|
||||
?>
|
||||
37
modules/poll/lang/jp.lang.php
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
<?php
|
||||
/**
|
||||
* @file modules/poll/lang/jp.lang.php
|
||||
* @author zero <zero@nzeo.com> 翻訳:RisaPapa
|
||||
* @brief アンケート(poll)モジュールの基本言語パッケージ
|
||||
**/
|
||||
|
||||
$lang->poll = "アンケート調査";
|
||||
$lang->poll_stop_date = "アンケート調査の終了日";
|
||||
$lang->poll_join_count = "参加者";
|
||||
$lang->poll_checkcount = "必須選択項目数";
|
||||
|
||||
$lang->cmd_poll_list = 'アンケートのリスト表示';
|
||||
$lang->cmd_delete_checked_poll = '選択項目削除';
|
||||
$lang->cmd_apply_poll = 'アンケート調査へ参加する';
|
||||
$lang->cmd_delete_checked_poll = '選択アンケート削除';
|
||||
|
||||
$lang->success_poll = 'アンケート調査へのご応募ありがとうございます。';
|
||||
|
||||
$lang->msg_already_poll = '既にアンケート調査に応募しました。';
|
||||
$lang->msg_cart_is_null = '削除する書き込みを選択してください。';
|
||||
$lang->msg_checked_poll_is_deleted = '%d個のアンケートが削除されました。';
|
||||
$lang->msg_check_poll_item = 'アンケート調査の項目を選択してください(アンケート調査ごと必須の選択項目が異なる場合があります)。';
|
||||
$lang->msg_cart_is_null = '削除するアンケートを選択してください。';
|
||||
$lang->msg_checked_poll_is_deleted = '%d個のアンケートが削除されました。';
|
||||
$lang->msg_poll_not_exists = '選択したアンケートは存在しません。';
|
||||
|
||||
$lang->cmd_null_item = "アンケート調査に登録する項目がありません。\nもう一度設定してください。";
|
||||
|
||||
$lang->confirm_poll_submit = "アンケート調査にご応募しますか?";
|
||||
|
||||
$lang->search_target_list = array(
|
||||
'title' => 'タイトル',
|
||||
'regdate' => '登録日',
|
||||
'ipaddress' => 'IPアドレス',
|
||||
);
|
||||
?>
|
||||
37
modules/poll/lang/ko.lang.php
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
<?php
|
||||
/**
|
||||
* @file modules/poll/lang/ko.lang.php
|
||||
* @author zero <zero@nzeo.com>
|
||||
* @brief 설문조사 (poll) 모듈의 기본 언어팩
|
||||
**/
|
||||
|
||||
$lang->poll = "설문조사";
|
||||
$lang->poll_stop_date = "설문조사 종료일";
|
||||
$lang->poll_join_count = "참가자";
|
||||
$lang->poll_checkcount = "필수 선택 항목수";
|
||||
|
||||
$lang->cmd_poll_list = '설문조사 목록 보기';
|
||||
$lang->cmd_delete_checked_poll = '선택항목 삭제';
|
||||
$lang->cmd_apply_poll = '설문 참여';
|
||||
$lang->cmd_delete_checked_poll = '선택 설문 삭제';
|
||||
|
||||
$lang->success_poll = '설문에 응하여 주셔서 감사합니다';
|
||||
|
||||
$lang->msg_already_poll = '이미 설문조사를 하셨습니다';
|
||||
$lang->msg_cart_is_null = '삭제할 글을 선택해주세요';
|
||||
$lang->msg_checked_poll_is_deleted = '%d개의 설문조사가 삭제되었습니다';
|
||||
$lang->msg_check_poll_item = '설문에 응할 항목을 선택하여 주세요. (설문조사 마다 필수 선택항목이 다를 수 있습니다)';
|
||||
$lang->msg_cart_is_null = '삭제할 설문을 선택해주세요';
|
||||
$lang->msg_checked_poll_is_deleted = '%d개의 설문이 삭제되었습니다';
|
||||
$lang->msg_poll_not_exists = '선택하신 설문이 존재하지 않습니다';
|
||||
|
||||
$lang->cmd_null_item = "설문조사로 등록할 값이 없습니다.\n다시 설정해주세요";
|
||||
|
||||
$lang->confirm_poll_submit = "설문조사에 응하시겠습니까?";
|
||||
|
||||
$lang->search_target_list = array(
|
||||
'title' => '제목',
|
||||
'regdate' => '등록일',
|
||||
'ipaddress' => 'IP 주소',
|
||||
);
|
||||
?>
|
||||
37
modules/poll/lang/zh-CN.lang.php
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
<?php
|
||||
/**
|
||||
* @file modules/poll/lang/zh-CN.lang.php
|
||||
* @author zero <zero@nzeo.com>
|
||||
* @brief 投票调查 (poll) 模块的基本语言包
|
||||
**/
|
||||
|
||||
$lang->poll = "投票调查";
|
||||
$lang->poll_stop_date = "投票调查结束日期";
|
||||
$lang->poll_join_count = "投票者";
|
||||
$lang->poll_checkcount = "必选项目数";
|
||||
|
||||
$lang->cmd_poll_list = '查看投票调查目录';
|
||||
$lang->cmd_delete_checked_poll = '删除所选项目';
|
||||
$lang->cmd_apply_poll = '参与投票';
|
||||
$lang->cmd_delete_checked_poll = '删除所选问卷';
|
||||
|
||||
$lang->success_poll = '感谢您参与投票。';
|
||||
|
||||
$lang->msg_already_poll = '不能重复投票!';
|
||||
$lang->msg_cart_is_null = '请选择要删除的文章。';
|
||||
$lang->msg_checked_poll_is_deleted = '已删除%d个投票调查。';
|
||||
$lang->msg_check_poll_item = '请选择问卷回应的项目。 (每个问卷调查有不同的必选项目)';
|
||||
$lang->msg_cart_is_null = '请选择要删除的问卷。';
|
||||
$lang->msg_checked_poll_is_deleted = '已删除%d个问卷。';
|
||||
$lang->msg_poll_not_exists = '您选择的问卷不存在!';
|
||||
|
||||
$lang->cmd_null_item = "没有要登录为投票调查的值。\n请重新设置。";
|
||||
|
||||
$lang->confirm_poll_submit = "您要参与投票吗?";
|
||||
|
||||
$lang->search_target_list = array(
|
||||
'title' => '标题',
|
||||
'regdate' => '登录日期',
|
||||
'ipaddress' => 'IP 地址',
|
||||
);
|
||||
?>
|
||||
111
modules/poll/poll.admin.controller.php
Normal file
|
|
@ -0,0 +1,111 @@
|
|||
<?php
|
||||
/**
|
||||
* @class pollAdminController
|
||||
* @author zero (zero@nzeo.com)
|
||||
* @brief poll모듈의 admin controller class
|
||||
**/
|
||||
|
||||
class pollAdminController extends poll {
|
||||
|
||||
/**
|
||||
* @brief 초기화
|
||||
**/
|
||||
function init() {
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 설정 저장
|
||||
**/
|
||||
function procPollAdminInsertConfig() {
|
||||
$config->skin = Context::get('skin');
|
||||
$config->colorset = Context::get('colorset');
|
||||
|
||||
$oModuleController = &getController('module');
|
||||
$oModuleController->insertModuleConfig('poll', $config);
|
||||
|
||||
$this->setMessage('success_updated');
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 관리자 페이지에서 선택된 설문조사들을 삭제
|
||||
**/
|
||||
function procPollAdminDeleteChecked() {
|
||||
// 선택된 글이 없으면 오류 표시
|
||||
$cart = Context::get('cart');
|
||||
if(!$cart) return $this->stop('msg_cart_is_null');
|
||||
|
||||
$poll_srl_list= explode('|@|', $cart);
|
||||
$poll_count = count($poll_srl_list);
|
||||
if(!$poll_count) return $this->stop('msg_cart_is_null');
|
||||
|
||||
// 글삭제
|
||||
for($i=0;$i<$poll_count;$i++) {
|
||||
$poll_index_srl = trim($poll_srl_list[$i]);
|
||||
if(!$poll_index_srl) continue;
|
||||
|
||||
$output = $this->deletePollTitle($poll_index_srl, true);
|
||||
if(!$output->toBool()) return $output;
|
||||
}
|
||||
|
||||
$this->setMessage( sprintf(Context::getLang('msg_checked_poll_is_deleted'), $poll_count) );
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 설문조사 삭제 (한번에 여러개의 설문 등록시 그 중 하나의 설문만 삭제)
|
||||
**/
|
||||
function deletePollTitle($poll_index_srl) {
|
||||
$args->poll_index_srl = $poll_index_srl;
|
||||
|
||||
$oDB = &DB::getInstance();
|
||||
$oDB->begin();
|
||||
|
||||
$output = $oDB->executeQuery('poll.deletePollTitle', $args);
|
||||
if(!$output) {
|
||||
$oDB->rollback();
|
||||
return $output;
|
||||
}
|
||||
|
||||
$output = $oDB->executeQuery('poll.deletePollItem', $args);
|
||||
if(!$output) {
|
||||
$oDB->rollback();
|
||||
return $output;
|
||||
}
|
||||
|
||||
$oDB->commit();
|
||||
|
||||
return new Object();
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 설문조사 삭제 (하나의 묶인 설문조사를 통째로 삭제)
|
||||
**/
|
||||
function deletePoll($poll_srl) {
|
||||
$args->poll_srl = $poll_srl;
|
||||
|
||||
$oDB = &DB::getInstance();
|
||||
$oDB->begin();
|
||||
|
||||
$output = $oDB->executeQuery('poll.deletePoll', $args);
|
||||
if(!$output) {
|
||||
$oDB->rollback();
|
||||
return $output;
|
||||
}
|
||||
|
||||
$output = $oDB->executeQuery('poll.deletePollTitle', $args);
|
||||
if(!$output) {
|
||||
$oDB->rollback();
|
||||
return $output;
|
||||
}
|
||||
|
||||
$output = $oDB->executeQuery('poll.deletePollItem', $args);
|
||||
if(!$output) {
|
||||
$oDB->rollback();
|
||||
return $output;
|
||||
}
|
||||
|
||||
$oDB->commit();
|
||||
|
||||
return new Object();
|
||||
}
|
||||
}
|
||||
?>
|
||||
28
modules/poll/poll.admin.model.php
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
<?php
|
||||
/**
|
||||
* @class pollAdminModel
|
||||
* @author zero (zero@nzeo.com)
|
||||
* @brief poll 모듈의 admin model class
|
||||
**/
|
||||
|
||||
class pollAdminModel extends poll {
|
||||
|
||||
/**
|
||||
* @brief 초기화
|
||||
**/
|
||||
function init() {
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 설문 목록 구해옴
|
||||
**/
|
||||
function getPollList($args) {
|
||||
$output = executeQuery('poll.getPollList', $args);
|
||||
if(!$output->toBool()) return $output;
|
||||
|
||||
if($output->data && !is_array($output->data)) $output->data = array($output->data);
|
||||
return $output;
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
127
modules/poll/poll.admin.view.php
Normal file
|
|
@ -0,0 +1,127 @@
|
|||
<?php
|
||||
/**
|
||||
* @class pollAdminView
|
||||
* @author zero (zero@nzeo.com)
|
||||
* @brief poll모듈의 admin view class
|
||||
**/
|
||||
|
||||
class pollAdminView extends poll {
|
||||
|
||||
/**
|
||||
* @brief 초기화
|
||||
**/
|
||||
function init() {
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 관리자 페이지
|
||||
**/
|
||||
function dispPollAdminList() {
|
||||
// 검색 옵션 정리
|
||||
$search_target = trim(Context::get('search_target'));
|
||||
$search_keyword = trim(Context::get('search_keyword'));
|
||||
|
||||
if($search_target && $search_keyword) {
|
||||
switch($search_target) {
|
||||
case 'title' :
|
||||
if($search_keyword) $search_keyword = str_replace(' ','%',$search_keyword);
|
||||
$args->s_title= $search_keyword;
|
||||
break;
|
||||
case 'regdate' :
|
||||
$args->s_regdate = $search_keyword;
|
||||
break;
|
||||
case 'ipaddress' :
|
||||
$args->s_ipaddress= $search_keyword;
|
||||
break;
|
||||
}
|
||||
}
|
||||
// 목록을 구하기 위한 옵션
|
||||
$args->page = Context::get('page'); ///< 페이지
|
||||
$args->list_count = 50; ///< 한페이지에 보여줄 글 수
|
||||
$args->page_count = 10; ///< 페이지 네비게이션에 나타날 페이지의 수
|
||||
|
||||
$args->sort_index = 'list_order'; ///< 소팅 값
|
||||
|
||||
// 목록 구함
|
||||
$oPollAdminModel = &getAdminModel('poll');
|
||||
$output = $oPollAdminModel->getPollList($args);
|
||||
|
||||
// 템플릿 변수 설정
|
||||
Context::set('total_count', $output->total_count);
|
||||
Context::set('total_page', $output->total_page);
|
||||
Context::set('page', $output->page);
|
||||
Context::set('poll_list', $output->data);
|
||||
Context::set('page_navigation', $output->page_navigation);
|
||||
Context::set('module_list', $module_list);
|
||||
|
||||
// 템플릿 지정
|
||||
$this->setTemplatePath($this->module_path.'tpl');
|
||||
$this->setTemplateFile('poll_list');
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 설문조사 스킨, 컬러셋 설정
|
||||
**/
|
||||
function dispPollAdminConfig() {
|
||||
$oModuleModel = &getModel('module');
|
||||
|
||||
// 설정 정보 가져오기
|
||||
$config = $oModuleModel->getModuleConfig('poll');
|
||||
Context::set('config', $config);
|
||||
|
||||
// 스킨 정보 가져오기
|
||||
$skin_list = $oModuleModel->getSkins($this->module_path);
|
||||
Context::set('skin_list', $skin_list);
|
||||
|
||||
if(!$skin_list[$config->skin]) $config->skin = "default";
|
||||
|
||||
// 설정된 스킨의 컬러셋 설정
|
||||
Context::set('colorset_list', $skin_list[$config->skin]->colorset);
|
||||
|
||||
// 템플릿 지정
|
||||
$this->setTemplatePath($this->module_path.'tpl');
|
||||
$this->setTemplateFile('config');
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 설문조사 결과
|
||||
**/
|
||||
function dispPollAdminResult() {
|
||||
// 팝업 레이아웃
|
||||
$this->setLayoutFile("popup_layout");
|
||||
|
||||
// 결과 뽑기
|
||||
$args->poll_srl = Context::get('poll_srl');
|
||||
$args->poll_index_srl = Context::get('poll_index_srl');
|
||||
|
||||
$output = executeQuery('poll.getPoll', $args);
|
||||
if(!$output->data) return $this->stop('msg_poll_not_exists');
|
||||
$poll->stop_date = $output->data->stop_date;
|
||||
$poll->poll_count = $output->data->poll_count;
|
||||
|
||||
$output = executeQuery('poll.getPollTitle', $args);
|
||||
if(!$output->data) return $this->stop('msg_poll_not_exists');
|
||||
|
||||
$poll->poll[$args->poll_index_srl]->title = $output->data->title;
|
||||
$poll->poll[$args->poll_index_srl]->checkcount = $output->data->checkcount;
|
||||
$poll->poll[$args->poll_index_srl]->poll_count = $output->data->poll_count;
|
||||
|
||||
$output = executeQuery('poll.getPollItem', $args);
|
||||
foreach($output->data as $key => $val) {
|
||||
$poll->poll[$val->poll_index_srl]->item[] = $val;
|
||||
}
|
||||
|
||||
$poll->poll_srl = $poll_srl;
|
||||
|
||||
Context::set('poll',$poll);
|
||||
|
||||
// 기본 설정의 스킨, 컬러셋 설정
|
||||
$oModuleModel = &getModel('module');
|
||||
$poll_config = $oModuleModel->getModuleConfig('poll');
|
||||
Context::set('poll_config', $poll_config);
|
||||
|
||||
$this->setTemplatePath($this->module_path.'tpl');
|
||||
$this->setTemplateFile('result');
|
||||
}
|
||||
}
|
||||
?>
|
||||
43
modules/poll/poll.class.php
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
<?php
|
||||
/**
|
||||
* @class poll
|
||||
* @author zero (zero@nzeo.com)
|
||||
* @brief poll모듈의 high class
|
||||
**/
|
||||
|
||||
class poll extends ModuleObject {
|
||||
|
||||
/**
|
||||
* @brief 설치시 추가 작업이 필요할시 구현
|
||||
**/
|
||||
function moduleInstall() {
|
||||
// action forward에 등록 (관리자 모드에서 사용하기 위함)
|
||||
$oModuleController = &getController('module');
|
||||
$oModuleController->insertActionForward('poll', 'view', 'dispPollAdminList');
|
||||
$oModuleController->insertActionForward('poll', 'view', 'dispPollAdminConfig');
|
||||
|
||||
// 기본 스킨 설정
|
||||
$oModuleController = &getController('module');
|
||||
$config->skin = 'default';
|
||||
$config->colorset = 'normal';
|
||||
$oModuleController->insertModuleConfig('poll', $config);
|
||||
|
||||
return new Object();
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 설치가 이상이 없는지 체크하는 method
|
||||
**/
|
||||
function checkUpdate() {
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 업데이트 실행
|
||||
**/
|
||||
function moduleUpdate() {
|
||||
return new Object();
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
185
modules/poll/poll.controller.php
Normal file
|
|
@ -0,0 +1,185 @@
|
|||
<?php
|
||||
/**
|
||||
* @class pollController
|
||||
* @author zero (zero@nzeo.com)
|
||||
* @brief poll모듈의 Controller class
|
||||
**/
|
||||
|
||||
class pollController extends poll {
|
||||
|
||||
/**
|
||||
* @brief 초기화
|
||||
**/
|
||||
function init() {
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 팝업창에서 설문 작성 완료후 저장을 누를때 설문 등록
|
||||
**/
|
||||
function procInsert() {
|
||||
$upload_target_srl = Context::get('upload_target_srl');
|
||||
|
||||
$stop_year = Context::get('stop_year');
|
||||
$stop_month = Context::get('stop_month');
|
||||
$stop_day = Context::get('stop_day');
|
||||
|
||||
$stop_date = sprintf('%04d%02d%02d235959', $stop_year, $stop_month, $stop_day);
|
||||
if($stop_date < date("YmdHis")) $stop_date = date("YmdHis", time()+60*60*24*365);
|
||||
|
||||
$vars = Context::getRequestVars();
|
||||
foreach($vars as $key => $val) {
|
||||
if(strpos($key,'tidx')) continue;
|
||||
if(!eregi("^(title|checkcount|item)_", $key)) continue;
|
||||
if(!trim($val)) continue;
|
||||
|
||||
$tmp_arr = explode('_',$key);
|
||||
|
||||
$poll_index = $tmp_arr[1];
|
||||
|
||||
if($tmp_arr[0]=='title') $tmp_args[$poll_index]->title = $val;
|
||||
else if($tmp_arr[0]=='checkcount') $tmp_args[$poll_index]->checkcount = $val;
|
||||
else if($tmp_arr[0]=='item') $tmp_args[$poll_index]->item[] = $val;
|
||||
}
|
||||
|
||||
foreach($tmp_args as $key => $val) {
|
||||
if(!$val->checkcount) $val->checkcount = 1;
|
||||
if($val->title && count($val->item)) $args->poll[] = $val;
|
||||
}
|
||||
|
||||
if(!count($args->poll)) return new Object(-1, 'cmd_null_item');
|
||||
|
||||
$args->stop_date = $stop_date;
|
||||
|
||||
// 변수 설정
|
||||
$poll_srl = getNextSequence();
|
||||
|
||||
$logged_info = Context::get('logged_info');
|
||||
$member_srl = $logged_info->member_srl?$logged_info->member_srl:0;
|
||||
|
||||
$oDB = &DB::getInstance();
|
||||
$oDB->begin();
|
||||
|
||||
// 설문의 등록
|
||||
unset($poll_args);
|
||||
$poll_args->poll_srl = $poll_srl;
|
||||
$poll_args->member_srl = $member_srl;
|
||||
$poll_args->list_order = $poll_srl*-1;
|
||||
$poll_args->stop_date = $args->stop_date;
|
||||
$poll_args->poll_count = 0;
|
||||
$poll_args->upload_target_srl = $upload_target_srl;
|
||||
$output = executeQuery('poll.insertPoll', $poll_args);
|
||||
if(!$output->toBool()) {
|
||||
$oDB->rollback();
|
||||
return $output;
|
||||
}
|
||||
|
||||
// 개별 설문 등록
|
||||
foreach($args->poll as $key => $val) {
|
||||
unset($title_args);
|
||||
$title_args->poll_srl = $poll_srl;
|
||||
$title_args->poll_index_srl = getNextSequence();
|
||||
$title_args->title = $val->title;
|
||||
$title_args->checkcount = $val->checkcount;
|
||||
$title_args->poll_count = 0;
|
||||
$title_args->list_order = $title_args->poll_index_srl * -1;
|
||||
$title_args->member_srl = $member_srl;
|
||||
$title_args->upload_target_srl = $upload_target_srl;
|
||||
$output = executeQuery('poll.insertPollTitle', $title_args);
|
||||
if(!$output->toBool()) {
|
||||
$oDB->rollback();
|
||||
return $output;
|
||||
}
|
||||
|
||||
// 개별 설문의 항목 추가
|
||||
foreach($val->item as $k => $v) {
|
||||
unset($item_args);
|
||||
$item_args->poll_srl = $poll_srl;
|
||||
$item_args->poll_index_srl = $title_args->poll_index_srl;
|
||||
$item_args->title = $v;
|
||||
$item_args->poll_count = 0;
|
||||
$item_args->upload_target_srl = $upload_target_srl;
|
||||
$output = executeQuery('poll.insertPollItem', $item_args);
|
||||
if(!$output->toBool()) {
|
||||
$oDB->rollback();
|
||||
return $output;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 작성자의 정보를 로그로 남김
|
||||
$log_args->poll_srl = $poll_srl;
|
||||
$log_args->member_srl = $member_srl;
|
||||
$output = executeQuery('poll.insertPollLog', $log_args);
|
||||
if(!$output->toBool()) {
|
||||
$oDB->rollback();
|
||||
return $output;
|
||||
}
|
||||
|
||||
$oDB->commit();
|
||||
|
||||
$this->add('poll_srl', $poll_srl);
|
||||
$this->setMessage('success_registed');
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 설문 조사에 응함
|
||||
**/
|
||||
function procPoll() {
|
||||
$poll_srl = Context::get('poll_srl');
|
||||
$poll_srl_indexes = Context::get('poll_srl_indexes');
|
||||
$tmp_item_srls = explode(',',$poll_srl_indexes);
|
||||
for($i=0;$i<count($tmp_item_srls);$i++) {
|
||||
$srl = (int)trim($tmp_item_srls[$i]);
|
||||
if(!$srl) continue;
|
||||
$item_srls[] = $srl;
|
||||
}
|
||||
|
||||
// 응답항목이 없으면 오류
|
||||
if(!count($item_srls)) return new Object(-1, 'msg_check_poll_item');
|
||||
|
||||
// 이미 설문하였는지 조사
|
||||
$oPollModel = &getModel('poll');
|
||||
if($oPollModel->isPolled($poll_srl)) return new Object(-1, 'msg_already_poll');
|
||||
|
||||
$oDB = &DB::getInstance();
|
||||
$oDB->begin();
|
||||
|
||||
$args->poll_srl = $poll_srl;
|
||||
|
||||
// 해당 글의 모든 설문조사의 응답수 올림
|
||||
$output = executeQuery('poll.updatePoll', $args);
|
||||
$output = executeQuery('poll.updatePollTitle', $args);
|
||||
if(!$output->toBool()) {
|
||||
$oDB->rollback();
|
||||
return $output;
|
||||
}
|
||||
|
||||
// 각 설문조사의 선택된 항목을 기록
|
||||
$args->poll_item_srl = implode(',',$item_srls);
|
||||
$output = executeQuery('poll.updatePollItems', $args);
|
||||
if(!$output->toBool()) {
|
||||
$oDB->rollback();
|
||||
return $output;
|
||||
}
|
||||
|
||||
// 응답자 정보를 로그로 남김
|
||||
$log_args->poll_srl = $poll_srl;
|
||||
$log_args->member_srl = $member_srl;
|
||||
$log_args->ipaddress = $_SERVER['REMOTE_ADDR'];
|
||||
$output = executeQuery('poll.insertPollLog', $log_args);
|
||||
if(!$output->toBool()) {
|
||||
$oDB->rollback();
|
||||
return $output;
|
||||
}
|
||||
|
||||
$oDB->commit();
|
||||
|
||||
// tpl 가져오기
|
||||
$tpl = $oPollModel->getPollHtml($poll_srl);
|
||||
|
||||
$this->add('poll_srl', $poll_srl);
|
||||
$this->add('tpl',$tpl);
|
||||
$this->setMessage('success_poll');
|
||||
}
|
||||
}
|
||||
?>
|
||||
105
modules/poll/poll.model.php
Normal file
|
|
@ -0,0 +1,105 @@
|
|||
<?php
|
||||
/**
|
||||
* @class pollModel
|
||||
* @author zero (zero@nzeo.com)
|
||||
* @brief poll 모듈의 model class
|
||||
**/
|
||||
|
||||
class pollModel extends poll {
|
||||
|
||||
/**
|
||||
* @brief 초기화
|
||||
**/
|
||||
function init() {
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 이미 설문 조사를 하였는지 검사하는 함수
|
||||
**/
|
||||
function isPolled($poll_srl) {
|
||||
|
||||
$args->poll_srl = $poll_srl;
|
||||
|
||||
if(Context::get('is_logged')) {
|
||||
$logged_info = Context::get('logged_info');
|
||||
$args->member_srl = $logged_info->member_srl;
|
||||
} else {
|
||||
$args->ipaddress = $_SERVER['REMOTE_ADDR'];
|
||||
}
|
||||
$output = executeQuery('poll.getPollLog', $args);
|
||||
if($output->data->count) return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 설문조사의 html데이터를 return
|
||||
* 설문조사에 응하였는지에 대한 체크를 한 후 결과를 return
|
||||
**/
|
||||
function getPollHtml($poll_srl, $style = '') {
|
||||
|
||||
$args->poll_srl = $poll_srl;
|
||||
|
||||
// 해당 설문조사에 대한 내용을 조사
|
||||
$output = executeQuery('poll.getPoll', $args);
|
||||
if(!$output->data) return '';
|
||||
|
||||
$poll->style = $style;
|
||||
$poll->poll_count = (int)$output->data->poll_count;
|
||||
$poll->stop_date = $output->data->stop_date;
|
||||
|
||||
$output = executeQuery('poll.getPollTitle', $args);
|
||||
if(!$output->data) return;
|
||||
if(!is_array($output->data)) $output->data = array($output->data);
|
||||
foreach($output->data as $key => $val) {
|
||||
$poll->poll[$val->poll_index_srl]->title = $val->title;
|
||||
$poll->poll[$val->poll_index_srl]->checkcount = $val->checkcount;
|
||||
$poll->poll[$val->poll_index_srl]->poll_count = $val->poll_count;
|
||||
}
|
||||
|
||||
$output = executeQuery('poll.getPollItem', $args);
|
||||
foreach($output->data as $key => $val) {
|
||||
$poll->poll[$val->poll_index_srl]->item[] = $val;
|
||||
}
|
||||
|
||||
$poll->poll_srl = $poll_srl;
|
||||
|
||||
// 종료일이 지났으면 무조건 결과만
|
||||
if($poll->stop_date > date("YmdHis")) {
|
||||
if($this->isPolled($poll_srl)) $tpl_file = "result";
|
||||
else $tpl_file = "form";
|
||||
} else {
|
||||
$tpl_file = "result";
|
||||
}
|
||||
|
||||
Context::set('poll',$poll);
|
||||
|
||||
// 기본 설정의 스킨, 컬러셋 설정
|
||||
$oModuleModel = &getModel('module');
|
||||
$poll_config = $oModuleModel->getModuleConfig('poll');
|
||||
if(!$poll_config->skin) $poll_config->skin = 'default';
|
||||
Context::set('poll_config', $poll_config);
|
||||
$tpl_path = sprintf("%sskins/%s/", $this->module_path, $poll_config->skin);
|
||||
|
||||
$oTemplate = &TemplateHandler::getInstance();
|
||||
return $oTemplate->compile($tpl_path, $tpl_file);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 선택된 설문조사 - 스킨의 컬러셋을 return
|
||||
**/
|
||||
function getPollGetColorsetList() {
|
||||
$skin = Context::get('skin');
|
||||
|
||||
$oModuleModel = &getModel('module');
|
||||
$skin_info = $oModuleModel->loadSkinInfo($this->module_path, $skin);
|
||||
|
||||
for($i=0;$i<count($skin_info->colorset);$i++) {
|
||||
$colorset = sprintf('%s|@|%s', $skin_info->colorset[$i]->name, $skin_info->colorset[$i]->title);
|
||||
$colorset_list[] = $colorset;
|
||||
}
|
||||
|
||||
if(count($colorset_list)) $colorsets = implode("\n", $colorset_list);
|
||||
$this->add('colorset_list', $colorsets);
|
||||
}
|
||||
}
|
||||
?>
|
||||
8
modules/poll/queries/deletePoll.xml
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
<query id="deletePoll" action="delete">
|
||||
<tables>
|
||||
<table name="poll" />
|
||||
</tables>
|
||||
<conditions>
|
||||
<condition operation="equal" column="poll_srl" var="poll_srl" filter="number" notnull="notnull" />
|
||||
</conditions>
|
||||
</query>
|
||||
9
modules/poll/queries/deletePollItem.xml
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
<query id="deletePollItem" action="delete">
|
||||
<tables>
|
||||
<table name="poll_item" />
|
||||
</tables>
|
||||
<conditions>
|
||||
<condition operation="equal" column="poll_srl" var="poll_srl" filter="number" />
|
||||
<condition operation="equal" column="poll_index_srl" var="poll_index_srl" filter="number" />
|
||||
</conditions>
|
||||
</query>
|
||||
9
modules/poll/queries/deletePollTitle.xml
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
<query id="deletePollTitle" action="delete">
|
||||
<tables>
|
||||
<table name="poll_title" />
|
||||
</tables>
|
||||
<conditions>
|
||||
<condition operation="equal" column="poll_srl" var="poll_srl" filter="number" />
|
||||
<condition operation="equal" column="poll_index_srl" var="poll_index_srl" filter="number" />
|
||||
</conditions>
|
||||
</query>
|
||||
11
modules/poll/queries/getPoll.xml
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
<query id="getPoll" action="select">
|
||||
<tables>
|
||||
<table name="poll" />
|
||||
</tables>
|
||||
<columns>
|
||||
<column name="*" />
|
||||
</columns>
|
||||
<conditions>
|
||||
<condition operation="equal" column="poll_srl" var="poll_srl" />
|
||||
</conditions>
|
||||
</query>
|
||||
12
modules/poll/queries/getPollItem.xml
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
<query id="getPollItem" action="select">
|
||||
<tables>
|
||||
<table name="poll_item" />
|
||||
</tables>
|
||||
<columns>
|
||||
<column name="*" />
|
||||
</columns>
|
||||
<conditions>
|
||||
<condition operation="equal" column="poll_srl" var="poll_srl" />
|
||||
<condition operation="equal" column="poll_index_srl" var="poll_index_srl" pipe="and" />
|
||||
</conditions>
|
||||
</query>
|
||||
19
modules/poll/queries/getPollList.xml
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
<query id="getPollList" action="select">
|
||||
<tables>
|
||||
<table name="poll_title" />
|
||||
</tables>
|
||||
<columns>
|
||||
<column name="*" />
|
||||
</columns>
|
||||
<conditions>
|
||||
<condition operation="like" column="title" var="s_title" />
|
||||
<condition operation="like_prefix" column="regdate" var="s_regdate" pipe="or" />
|
||||
<condition operation="like_prefix" column="ipaddress" var="s_ipaddress" pipe="or" />
|
||||
</conditions>
|
||||
<navigation>
|
||||
<index var="sort_index" default="list_order" order="asc" />
|
||||
<list_count var="list_count" default="20" />
|
||||
<page_count var="page_count" default="10" />
|
||||
<page var="page" default="1" />
|
||||
</navigation>
|
||||
</query>
|
||||
13
modules/poll/queries/getPollLog.xml
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
<query id="getPollLog" action="select">
|
||||
<tables>
|
||||
<table name="poll_log" />
|
||||
</tables>
|
||||
<columns>
|
||||
<column name="count(*)" alias="count"/>
|
||||
</columns>
|
||||
<conditions>
|
||||
<condition operation="equal" column="poll_srl" var="poll_srl" />
|
||||
<condition operation="equal" column="member_srl" default="0" var="memer_srl" pipe="and" />
|
||||
<condition operation="equal" column="ipaddress" var="ipaddress" default="ipaddress()" pipe="and" />
|
||||
</conditions>
|
||||
</query>
|
||||
12
modules/poll/queries/getPollTitle.xml
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
<query id="getPollTitle" action="select">
|
||||
<tables>
|
||||
<table name="poll_title" />
|
||||
</tables>
|
||||
<columns>
|
||||
<column name="*" />
|
||||
</columns>
|
||||
<conditions>
|
||||
<condition operation="equal" column="poll_srl" var="poll_srl" />
|
||||
<condition operation="equal" column="poll_index_srl" var="poll_index_srl" pipe="and" />
|
||||
</conditions>
|
||||
</query>
|
||||
15
modules/poll/queries/insertPoll.xml
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
<query id="insertPoll" action="insert">
|
||||
<tables>
|
||||
<table name="poll" />
|
||||
</tables>
|
||||
<columns>
|
||||
<column name="poll_srl" var="poll_srl" filter="number" notnull="notnull" />
|
||||
<column name="stop_date" var="stop_date" />
|
||||
<column name="member_srl" var="member_srl" />
|
||||
<column name="ipaddress" var="ipaddress" default="ipaddress()" />
|
||||
<column name="poll_count" var="poll_count" default="0" />
|
||||
<column name="upload_target_srl" var="upload_target_srl" filter="number" notnull="notnull" />
|
||||
<column name="regdate" var="regdate" default="curdate()" />
|
||||
<column name="list_order" var="list_order" default="0" />
|
||||
</columns>
|
||||
</query>
|
||||
13
modules/poll/queries/insertPollItem.xml
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
<query id="insertPollItem" action="insert">
|
||||
<tables>
|
||||
<table name="poll_item" />
|
||||
</tables>
|
||||
<columns>
|
||||
<column name="poll_item_srl" var="poll_item_srl" filter="number" notnull="notnull" default="sequence()" />
|
||||
<column name="poll_srl" var="poll_srl" filter="number" notnull="notnull" />
|
||||
<column name="poll_index_srl" var="poll_index_srl" filter="number" notnull="notnull" />
|
||||
<column name="poll_count" var="poll_count" default="0" />
|
||||
<column name="upload_target_srl" var="upload_target_srl" filter="number" notnull="notnull" />
|
||||
<column name="title" var="title" notnull="notnull" />
|
||||
</columns>
|
||||
</query>
|
||||
11
modules/poll/queries/insertPollLog.xml
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
<query id="insertPollLog" action="insert">
|
||||
<tables>
|
||||
<table name="poll_log" />
|
||||
</tables>
|
||||
<columns>
|
||||
<column name="poll_srl" var="poll_srl" filter="number" notnull="notnull" />
|
||||
<column name="member_srl" var="member_srl" filter="number" default="0" />
|
||||
<column name="ipaddress" var="ipaddress" default="ipaddress()" />
|
||||
<column name="regdate" var="regdate" default="curdate()" />
|
||||
</columns>
|
||||
</query>
|
||||
17
modules/poll/queries/insertPollTitle.xml
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
<query id="insertPollTitle" action="insert">
|
||||
<tables>
|
||||
<table name="poll_title" />
|
||||
</tables>
|
||||
<columns>
|
||||
<column name="poll_srl" var="poll_srl" filter="number" notnull="notnull" />
|
||||
<column name="poll_index_srl" var="poll_index_srl" filter="number" notnull="notnull" />
|
||||
<column name="title" var="title" notnull="notnull" />
|
||||
<column name="poll_count" var="poll_count" default="0" />
|
||||
<column name="checkcount" var="checkcount" notnull="notnull" default="1" />
|
||||
<column name="member_srl" var="member_srl" />
|
||||
<column name="upload_target_srl" var="upload_target_srl" filter="number" notnull="notnull" />
|
||||
<column name="ipaddress" var="ipaddress" default="ipaddress()" />
|
||||
<column name="regdate" var="regdate" default="curdate()" />
|
||||
<column name="list_order" var="list_order" default="0" />
|
||||
</columns>
|
||||
</query>
|
||||
11
modules/poll/queries/updatePoll.xml
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
<query id="updatePoll" action="update">
|
||||
<tables>
|
||||
<table name="poll" />
|
||||
</tables>
|
||||
<columns>
|
||||
<column name="poll_count" var="poll_count" default="plus(1)" />
|
||||
</columns>
|
||||
<conditions>
|
||||
<condition operation="equal" column="poll_srl" var="poll_srl" filter="number" notnull="notnull" />
|
||||
</conditions>
|
||||
</query>
|
||||
12
modules/poll/queries/updatePollItems.xml
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
<query id="updatePollItems" action="update">
|
||||
<tables>
|
||||
<table name="poll_item" />
|
||||
</tables>
|
||||
<columns>
|
||||
<column name="poll_count" var="poll_count" default="plus(1)" />
|
||||
</columns>
|
||||
<conditions>
|
||||
<condition operation="equal" column="poll_srl" var="poll_srl" notnull="notnull" />
|
||||
<condition operation="in" column="poll_item_srl" var="poll_item_srl" notnull="notnull" pipe="and" />
|
||||
</conditions>
|
||||
</query>
|
||||
11
modules/poll/queries/updatePollTitle.xml
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
<query id="updatePollTitle" action="update">
|
||||
<tables>
|
||||
<table name="poll_title" />
|
||||
</tables>
|
||||
<columns>
|
||||
<column name="poll_count" var="poll_count" default="plus(1)" />
|
||||
</columns>
|
||||
<conditions>
|
||||
<condition operation="equal" column="poll_srl" var="poll_srl" filter="number" notnull="notnull" />
|
||||
</conditions>
|
||||
</query>
|
||||
10
modules/poll/schemas/poll.xml
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
<table name="poll">
|
||||
<column name="poll_srl" type="number" size="11" notnull="notnull" primary_key="primary_key" />
|
||||
<column name="stop_date" type="date" />
|
||||
<column name="upload_target_srl" type="number" size="11" notnull="notnull" index="idx_upload_target_srl" />
|
||||
<column name="poll_count" type="number" size="11" notnull="notnull" />
|
||||
<column name="member_srl" type="number" size="11" notnull="notnull" index="idx_member_srl" />
|
||||
<column name="ipaddress" type="varchar" size="128" notnull="notnull" index="idx_ipaddress" />
|
||||
<column name="regdate" type="date" index="idx_regdate" />
|
||||
<column name="list_order" type="number" size="11" notnull="notnull" index="idx_list_order" />
|
||||
</table>
|
||||
8
modules/poll/schemas/poll_item.xml
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
<table name="poll_item">
|
||||
<column name="poll_item_srl" type="number" size="11" notnull="notnull" primary_key="primary_key" />
|
||||
<column name="poll_srl" type="number" size="11" notnull="notnull" index="index_poll_srl" />
|
||||
<column name="poll_index_srl" type="number" size="11" notnull="notnull" index="idx_poll_index_srl" />
|
||||
<column name="upload_target_srl" type="number" size="11" notnull="notnull" index="idx_upload_target_srl" />
|
||||
<column name="title" type="varchar" size="250" notnull="notnull" />
|
||||
<column name="poll_count" type="number" size="11" notnull="notnull" />
|
||||
</table>
|
||||
6
modules/poll/schemas/poll_log.xml
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
<table name="poll_log">
|
||||
<column name="poll_srl" type="number" size="11" notnull="notnull" index="idx_poll_srl" />
|
||||
<column name="member_srl" type="number" size="11" notnull="notnull" index="idx_member_srl" />
|
||||
<column name="ipaddress" type="varchar" size="128" notnull="notnull" index="idx_ipaddress" />
|
||||
<column name="regdate" type="date" index="idx_regdate" />
|
||||
</table>
|
||||
12
modules/poll/schemas/poll_title.xml
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
<table name="poll_title">
|
||||
<column name="poll_srl" type="number" size="11" notnull="notnull" index="idx_poll_srl" />
|
||||
<column name="poll_index_srl" type="number" size="11" notnull="notnull" index="idx_poll_srl" />
|
||||
<column name="title" type="varchar" size="250" notnull="notnull" />
|
||||
<column name="checkcount" type="number" size="11" notnull="notnull" default="1" />
|
||||
<column name="poll_count" type="number" size="11" notnull="notnull" />
|
||||
<column name="upload_target_srl" type="number" size="11" notnull="notnull" index="idx_upload_target_srl" />
|
||||
<column name="member_srl" type="number" size="11" notnull="notnull" index="idx_member_srl" />
|
||||
<column name="ipaddress" type="varchar" size="128" notnull="notnull" index="idx_ipaddress" />
|
||||
<column name="regdate" type="date" index="idx_regdate" />
|
||||
<column name="list_order" type="number" size="11" notnull="notnull" index="idx_list_order" />
|
||||
</table>
|
||||
34
modules/poll/skins/default/css/poll.css
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
.poll_table { table-layout:fixed; width:100%; }
|
||||
|
||||
.poll_table td.h { background:url(../images/top_bg.png) repeat-x left top; }
|
||||
.poll_table td.title { height:28px; background:url(../images/top_title_bg.png) repeat-x left top; padding:0 20px 0 20px;color:#C3C3C4;}
|
||||
.poll_table td.title strong { color:#FFFFFF; font-weight:bold; }
|
||||
|
||||
.poll_table td.l { border-left:1px solid #E5E5E5; }
|
||||
.poll_table td.r { border-right:1px solid #E5E5E5; }
|
||||
.poll_table td.content { padding:18px 13px 18px 13px; }
|
||||
|
||||
.poll_table td.poll_button { border:1px solid #E5E5E5; border-bottom:none; background-color:#F6F6F5; }
|
||||
.poll_table td.poll_button div { padding:5px 0 2px 0; text-align:center;}
|
||||
.poll_table td.b { background-color:#F6F6F5; height:7px; }
|
||||
.poll_table td.b img { width:100%; height:6px; border-bottom:1px solid #E5E5E5; }
|
||||
.poll_table td.bb { height:7px; }
|
||||
.poll_table td.bb img { width:100%; height:6px; border-bottom:1px solid #E5E5E5; }
|
||||
|
||||
.poll_table td.content div.title { color:#000000; background-color:#F5F5F5; border-top:2px solid #C1C0BD; border-bottom:2px solid #C1C0BD; font-weight:bold; padding:7px 0 7px 10px; margin-bottom:10px; }
|
||||
|
||||
.poll_table td.content div.item_text { color:#636363; padding:0 10px 0 10px; margin-top:10px; }
|
||||
.poll_table td.content div.item_text strong { font-weight:bold; color:#000000; font-family:돋움; font-size:12px; }
|
||||
|
||||
.poll_table td.content table.item_bar_table { width:100%; table-layout:fixed; border-bottom:1px solid #EDEDED; margin-top:10px;}
|
||||
.poll_table td.content table.noborder { border-bottom:none; margin-bottom:10px;}
|
||||
.poll_table td.content table.item_bar_table td.bar { padding:0 0 5px 0; background:url(../images/back_bar.png) repeat-x left 4px;}
|
||||
.poll_table td.content table.item_bar_table td.bar img { width:100%; height:6px; }
|
||||
.poll_table td.content table.item_bar_table td.status { font-size:.9em; padding-bottom:5px; color:#636363; padding-left:15px; }
|
||||
.poll_table td.content table.item_bar_table td.status strong { font-weight:bold; color:#58C011; }
|
||||
|
||||
.poll_table td.content div.item { color:#636363; border-bottom:1px solid #EDEDED; padding:5px 0 8px 10px; margin-bottom:3px; }
|
||||
.poll_table td.content div.noborder { border-bottom:none; margin-bottom:10px;}
|
||||
.poll_table td.content div.checkcount { border-bottom:1px dashed #EDEDED; padding:0 0 8px 10px; margin-bottom:3px; text-align:right; color:#636363; }
|
||||
|
||||
|
||||
10
modules/poll/skins/default/filter/poll.xml
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
<filter name="poll" module="poll" act="procPoll" confirm_msg_code="confirm_poll_submit">
|
||||
<form />
|
||||
<parameter />
|
||||
<response callback_func="completePoll">
|
||||
<tag name="error" />
|
||||
<tag name="message" />
|
||||
<tag name="poll_srl" />
|
||||
<tag name="tpl" />
|
||||
</response>
|
||||
</filter>
|
||||
78
modules/poll/skins/default/form.html
Normal file
|
|
@ -0,0 +1,78 @@
|
|||
<!--%import("filter/poll.xml")-->
|
||||
<!--%import("js/poll.js")-->
|
||||
<!--%import("css/poll.css")-->
|
||||
|
||||
<script type="text/javascript">
|
||||
var poll_alert_lang = "{$lang->msg_check_poll_item}";
|
||||
</script>
|
||||
|
||||
<div id="poll_{$poll->poll_srl}" style="{$poll->style}">
|
||||
|
||||
<form action="./" method="get" onsubmit="return doPoll(this)">
|
||||
<input type="hidden" name="poll_srl" value="{$poll->poll_srl}" />
|
||||
<input type="hidden" name="poll_srl_indexes" value="" />
|
||||
|
||||
<table cellspacing="0" class="poll_table">
|
||||
<col width="7" />
|
||||
<col />
|
||||
<col width="7" />
|
||||
<tr>
|
||||
<td><img src="./images/lh.png" alt="lh" class="iePngFix" width="7" height="7" /></td>
|
||||
<td class="h"><img src="./images/blank.gif" height="7" alt="blank" /></td>
|
||||
<td><img src="./images/rh.png" alt="rh" class="iePngFix" width="7" height="7" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="title" colspan="3">
|
||||
{$lang->poll_stop_date} : <strong>{zdate($poll->stop_date, "Y-m-d")}</strong> {zdate($poll->stop_date, "H:i")}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="l"><img src="./images/blank.gif" height="7" alt="blank" /></td>
|
||||
<td class="content">
|
||||
|
||||
<!--@foreach($poll->poll as $poll_srl_index => $val)-->
|
||||
<input type="hidden" name="checkcount_{$poll_srl_index}" value="{$val->checkcount}" />
|
||||
|
||||
<div class="title">A : {$val->title}</div>
|
||||
|
||||
<!--@if($val->checkcount>1)-->
|
||||
<div class="checkcount">
|
||||
{$lang->poll_checkcount} : {$val->checkcount}
|
||||
</div>
|
||||
<!--@end-->
|
||||
|
||||
|
||||
{@ $_key = 0}
|
||||
<!--@foreach($val->item as $item_srl => $item)-->
|
||||
{@$_idx = $poll->poll_srl.'_'.$poll_srl_index.'_'.$item_srl}
|
||||
|
||||
<div class="item <!--@if($_key==count($val->item)-1)-->noborder<!--@end-->">
|
||||
<!--@if($val->checkcount>1)-->
|
||||
<input type="checkbox" name="item_{$poll->poll_srl}_{$poll_srl_index}" value="{$item->poll_item_srl}" id="item_{$item->poll_item_srl}" />
|
||||
<!--@else-->
|
||||
<input type="radio" name="item_{$poll->poll_srl}_{$poll_srl_index}" value="{$item->poll_item_srl}" id="item_{$item->poll_item_srl}" />
|
||||
<!--@end-->
|
||||
<label for="item_{$item->poll_item_srl}">{$item->title}</label>
|
||||
</div>
|
||||
{@ $_key++}
|
||||
<!--@end-->
|
||||
|
||||
<!--@end-->
|
||||
|
||||
|
||||
</td>
|
||||
<td class="r"><img src="./images/blank.gif" height="7" alt="blank" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="3" class="poll_button"><div><span class="button"><input type="submit" value="{$lang->cmd_apply_poll}" class="poll_button" /></span></div></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="lb" ><img src="./images/lb.png" alt="lb" class="iePngFix" width="7" height="7" /></td>
|
||||
<td class="b"><img src="./images/blank.gif" alt="blank" /></td>
|
||||
<td class="rb" ><img src="./images/rb.png" alt="rb" class="iePngFix" width="7" height="7" /></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
</form>
|
||||
|
||||
</div>
|
||||
BIN
modules/poll/skins/default/images/back_bar.png
Executable file
|
After Width: | Height: | Size: 159 B |
BIN
modules/poll/skins/default/images/blank.gif
Normal file
|
After Width: | Height: | Size: 43 B |
BIN
modules/poll/skins/default/images/color_bar.png
Executable file
|
After Width: | Height: | Size: 328 B |
BIN
modules/poll/skins/default/images/lb.png
Executable file
|
After Width: | Height: | Size: 216 B |
BIN
modules/poll/skins/default/images/lh.png
Executable file
|
After Width: | Height: | Size: 272 B |
BIN
modules/poll/skins/default/images/pipe.png
Executable file
|
After Width: | Height: | Size: 177 B |
BIN
modules/poll/skins/default/images/rb.png
Executable file
|
After Width: | Height: | Size: 211 B |
BIN
modules/poll/skins/default/images/rh.png
Executable file
|
After Width: | Height: | Size: 262 B |
BIN
modules/poll/skins/default/images/rlb.png
Executable file
|
After Width: | Height: | Size: 215 B |
BIN
modules/poll/skins/default/images/rrb.png
Executable file
|
After Width: | Height: | Size: 212 B |
BIN
modules/poll/skins/default/images/top_bg.png
Executable file
|
After Width: | Height: | Size: 299 B |
BIN
modules/poll/skins/default/images/top_title_bg.png
Executable file
|
After Width: | Height: | Size: 523 B |
51
modules/poll/skins/default/js/poll.js
Normal file
|
|
@ -0,0 +1,51 @@
|
|||
/* 설문 참여 함수 */
|
||||
function doPoll(fo_obj) {
|
||||
|
||||
var checkcount = new Array();
|
||||
var item = new Array();
|
||||
|
||||
for(var i=0;i<fo_obj.length;i++) {
|
||||
var obj = fo_obj[i];
|
||||
if(obj.nodeName != 'INPUT') continue;
|
||||
|
||||
var name = obj.name;
|
||||
if(name.indexOf('checkcount')>-1) {
|
||||
var t = name.split('_');
|
||||
var poll_srl_index = parseInt(t[1],10);
|
||||
checkcount[poll_srl_index] = obj.value;
|
||||
item[poll_srl_index] = new Array();
|
||||
|
||||
} else if(name.indexOf('item_')>-1) {
|
||||
var t = name.split('_');
|
||||
var poll_srl = parseInt(t[1],10);
|
||||
var poll_srl_index = parseInt(t[2],10);
|
||||
if(obj.checked == true) item[poll_srl_index][item[poll_srl_index].length] = obj.value;
|
||||
}
|
||||
}
|
||||
|
||||
var poll_srl_indexes = "";
|
||||
for(var poll_srl_index in checkcount) {
|
||||
var count = checkcount[poll_srl_index];
|
||||
var items = item[poll_srl_index];
|
||||
if(count > items.length) {
|
||||
alert(poll_alert_lang);
|
||||
return false;
|
||||
}
|
||||
|
||||
poll_srl_indexes += items.join(',')+',';
|
||||
}
|
||||
fo_obj.poll_srl_indexes.value = poll_srl_indexes;
|
||||
|
||||
procFilter(fo_obj, poll);
|
||||
return false;
|
||||
}
|
||||
|
||||
/* 설문 조사후 내용을 바꿀 함수 */
|
||||
function completePoll(ret_obj) {
|
||||
alert(ret_obj['message']);
|
||||
var poll_srl = ret_obj['poll_srl'];
|
||||
var tpl = ret_obj['tpl'];
|
||||
var width = xWidth("poll_"+poll_srl);
|
||||
xInnerHtml("poll_"+poll_srl, tpl);
|
||||
xWidth("poll_"+poll_srl, width);
|
||||
}
|
||||
60
modules/poll/skins/default/result.html
Normal file
|
|
@ -0,0 +1,60 @@
|
|||
<!--%import("css/poll.css")-->
|
||||
|
||||
<div class="poll_box" style="{$poll->style}">
|
||||
|
||||
<table cellspacing="0" class="poll_table">
|
||||
<col width="7" />
|
||||
<col />
|
||||
<col width="7" />
|
||||
<tr>
|
||||
<td><img src="./images/lh.png" alt="lh" class="iePngFix" width="7" height="7" /></td>
|
||||
<td class="h"><img src="./images/blank.gif" height="7" alt="blank" /></td>
|
||||
<td><img src="./images/rh.png" alt="rh" class="iePngFix" width="7" height="7" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="title" colspan="3">
|
||||
<div class="fl">
|
||||
{$lang->poll_stop_date} : <strong>{zdate($poll->stop_date, "Y-m-d")}</strong> {zdate($poll->stop_date, "H:i")}
|
||||
</div>
|
||||
<div class="fr">
|
||||
{$lang->poll_join_count} : <strong>{number_format($poll->poll_count)}</strong>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="l"><img src="./images/blank.gif" height="7" alt="blank" /></td>
|
||||
<td class="content">
|
||||
|
||||
<!--@foreach($poll->poll as $poll_srl_index => $val)-->
|
||||
<div class="title">{$val->title} ({$val->poll_count})</div>
|
||||
<!--@foreach($val->item as $item_srl => $item)-->
|
||||
{@$per = (int)(( $item->poll_count / $val->poll_count)*100) }
|
||||
|
||||
<div class="item_text">
|
||||
<strong>{$item_srl+1}</strong> <img src="./images/pipe.png" alt="" /> {$item->title}
|
||||
</div>
|
||||
|
||||
<table cellspacing="0" class="item_bar_table <!--@if($item_srl == count($val->item)-1)-->noborder<!--@end-->">
|
||||
<col width="30" />
|
||||
<col/>
|
||||
<col width="75" />
|
||||
<tr>
|
||||
<td> </td>
|
||||
<td class="bar"><!--@if($per)--><img src="./images/color_bar.png" style="width:{$per}%;height:6px;" alt="bar" /></div><!--@else--><img src="./images/blank.gif" width="1" height="1" alt="" /><!--@end--></td>
|
||||
<td class="status"><strong>{$item->poll_count}</strong> ({$per}%)</td>
|
||||
</tr>
|
||||
</table>
|
||||
<!--@end-->
|
||||
|
||||
<!--@end-->
|
||||
</td>
|
||||
<td class="r"><img src="./images/blank.gif" height="7" alt="blank" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="rlb" ><img src="./images/rlb.png" alt="lb" class="iePngFix" width="7" height="7" /></td>
|
||||
<td class="bb"><img src="./images/blank.gif" alt="blank" /></td>
|
||||
<td class="rrb" ><img src="./images/rrb.png" alt="rb" class="iePngFix" width="7" height="7" /></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
</div>
|
||||
25
modules/poll/skins/default/skin.xml
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<skin>
|
||||
<title xml:lang="ko">설문조사 기본 스킨</title>
|
||||
<title xml:lang="zh-CN">投票调查默认皮肤</title>
|
||||
<title xml:lang="jp">アンケート調査デフォルトスキン</title>
|
||||
<title xml:lang="en">Default Skin of Poll</title>
|
||||
<maker email_address="zero@zeroboard.com" link="http://www.zeroboard.com" date="2007. 2. 28">
|
||||
<name xml:lang="ko">제로</name>
|
||||
<name xml:lang="zh-CN">zero</name>
|
||||
<name xml:lang="jp">Zero</name>
|
||||
<name xml:lang="en">zero</name>
|
||||
<description xml:lang="ko">설문조사 기본 스킨</description>
|
||||
<description xml:lang="zh-CN">投票调查默认皮肤。</description>
|
||||
<description xml:lang="jp">アンケート調査デフォルトスキン</description>
|
||||
<description xml:lang="en">Default Skin of Poll</description>
|
||||
</maker>
|
||||
<colorset>
|
||||
<color name="normal">
|
||||
<title xml:lang="ko">기본</title>
|
||||
<title xml:lang="zh-CN">默认</title>
|
||||
<title xml:lang="jp">デフォルト</title>
|
||||
<title xml:lang="en">Default</title>
|
||||
</color>
|
||||
</colorset>
|
||||
</skin>
|
||||
37
modules/poll/tpl/config.html
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
<!--%import("filter/insert_config.xml")-->
|
||||
<!--%import("js/poll_admin.js")-->
|
||||
<!--#include("./header.html")-->
|
||||
|
||||
<form action="./" method="get" onsubmit="return procFilter(this, insert_config);" id="fo_poll">
|
||||
|
||||
<table cellspacing="0" class="tableType2 gap1">
|
||||
<col width="100" />
|
||||
<col />
|
||||
<tr>
|
||||
<th scope="col">{$lang->skin}</th>
|
||||
<td>
|
||||
<select name="skin" onchange="doDisplaySkinColorset(this);return false;">
|
||||
<!--@foreach($skin_list as $key => $val)-->
|
||||
<option value="{$key}" <!--@if($config->skin == $key)-->selected="selected"<!--@end-->>{$val->title} ({$key})</option>
|
||||
<!--@end-->
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="col">{$lang->colorset}</th>
|
||||
<td>
|
||||
<select name="colorset" id="poll_colorset">
|
||||
<!--@foreach($colorset_list as $key => $val)-->
|
||||
<option value="{$val->name}" <!--@if($config->colorset == $val->name)-->selected="selected"<!--@end-->>{$val->title} ({$val->name})</option>
|
||||
<!--@end-->
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<!-- 버튼 -->
|
||||
<div class="tRight gap1">
|
||||
<span class="button"><input type="submit" value="{$lang->cmd_registration}" accesskey="s" /></span>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
82
modules/poll/tpl/css/poll.css
Normal file
|
|
@ -0,0 +1,82 @@
|
|||
.poll_box {
|
||||
border:3px solid #555555;
|
||||
background-color:#EEEEEE;
|
||||
margin:5px;
|
||||
padding:8px 5px 8px 5px;
|
||||
width:500px;
|
||||
}
|
||||
|
||||
.poll_title_box {
|
||||
border:2px solid #444444;
|
||||
background-color:#888888;
|
||||
color:#FFFFFF;
|
||||
font-weight:bold;
|
||||
margin:5px;
|
||||
padding:5px;
|
||||
height:13px;
|
||||
clear:both;
|
||||
}
|
||||
|
||||
.poll_stop_date {
|
||||
float:left;
|
||||
}
|
||||
|
||||
.poll_join_count {
|
||||
float:right;
|
||||
}
|
||||
|
||||
.poll_detail_box {
|
||||
border:1px solid #444444;
|
||||
background-color:#FFFFFF;
|
||||
margin:5px;
|
||||
padding-bottom:5px;
|
||||
}
|
||||
|
||||
.poll_detail_box .title {
|
||||
background-color:#555555;
|
||||
color:#FFFFFF;
|
||||
padding:5px;
|
||||
font-weight:bold;
|
||||
}
|
||||
|
||||
.poll_detail_box .item {
|
||||
padding:5px;
|
||||
border-bottom:1px solid #EEEEEE;
|
||||
}
|
||||
|
||||
.poll_detail_box .checkcount {
|
||||
background-color:#AAAAAA;
|
||||
text-align:right;
|
||||
color:#EEEEEE;
|
||||
padding:5px;
|
||||
}
|
||||
|
||||
.poll_detail_box .text {
|
||||
margin:5px 0px 5px 20px;
|
||||
}
|
||||
|
||||
.poll_detail_box .bar_box {
|
||||
width:80%;
|
||||
margin-bottom:10px;
|
||||
border:1px solid #DDDDDD;
|
||||
margin:0px 5px 5px 35px;
|
||||
padding:1px;
|
||||
}
|
||||
|
||||
.poll_detail_box .bar {
|
||||
background-color:#444444;
|
||||
border-bottom:1px solid #AAAAAA;
|
||||
height:5px;
|
||||
}
|
||||
|
||||
|
||||
.poll_button_area {
|
||||
text-align:center;
|
||||
}
|
||||
|
||||
.poll_button {
|
||||
border:1px solid #555555;
|
||||
background-color:#FFFFFF;
|
||||
font-weight:bold;
|
||||
height:20px;
|
||||
}
|
||||
12
modules/poll/tpl/filter/delete_checked.xml
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
<filter name="delete_checked" module="poll" act="procPollAdminDeleteChecked" confirm_msg_code="confirm_delete">
|
||||
<form>
|
||||
<node target="cart" required="true" />
|
||||
</form>
|
||||
<parameter>
|
||||
<param name="cart" target="cart" />
|
||||
</parameter>
|
||||
<response>
|
||||
<tag name="error" />
|
||||
<tag name="message" />
|
||||
</response>
|
||||
</filter>
|
||||
11
modules/poll/tpl/filter/insert_config.xml
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
<filter name="insert_config" module="poll" act="procPollAdminInsertConfig" confirm_msg_code="confirm_update">
|
||||
<form>
|
||||
<node target="skin" required="true" />
|
||||
<node target="colorset" required="true" />
|
||||
</form>
|
||||
<parameter />
|
||||
<response>
|
||||
<tag name="error" />
|
||||
<tag name="message" />
|
||||
</response>
|
||||
</filter>
|
||||
10
modules/poll/tpl/header.html
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
<h3>{$lang->poll} <span class="gray">{$lang->cmd_management}</span></h3>
|
||||
|
||||
<!--@if($module=='admin')-->
|
||||
<div class="header4">
|
||||
<ul class="localNavigation">
|
||||
<li <!--@if($act=='dispPollAdminList')-->class="on"<!--@end-->><a href="{getUrl('act','dispPollAdminList')}">{$lang->cmd_poll_list}</a></li>
|
||||
<li <!--@if($act=='dispPollAdminConfig')-->class="on"<!--@end-->><a href="{getUrl('act','dispPollAdminConfig')}">{$lang->cmd_module_config}</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<!--@end-->
|
||||
BIN
modules/poll/tpl/images/blank.gif
Normal file
|
After Width: | Height: | Size: 43 B |
38
modules/poll/tpl/js/poll_admin.js
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
/**
|
||||
* @file modules/poll/js/poll_admin.js
|
||||
* @author zero (zero@nzeo.com)
|
||||
* @brief poll 모듈의 관리자용 javascript
|
||||
**/
|
||||
|
||||
/* 위젯 코드 생성시 스킨을 고르면 컬러셋의 정보를 표시 */
|
||||
function doDisplaySkinColorset(sel, colorset) {
|
||||
var skin = sel.options[sel.selectedIndex].value;
|
||||
|
||||
var params = new Array();
|
||||
params["skin"] = skin;
|
||||
params["colorset"] = colorset;
|
||||
|
||||
var response_tags = new Array("error","message","colorset_list");
|
||||
|
||||
exec_xml("poll", "getPollGetColorsetList", params, completeGetSkinColorset, response_tags, params);
|
||||
}
|
||||
|
||||
/* 서버에서 받아온 컬러셋을 표시 */
|
||||
function completeGetSkinColorset(ret_obj, response_tags, params, fo_obj) {
|
||||
var sel = xGetElementById("fo_poll").poll_colorset;
|
||||
var length = sel.options.length;
|
||||
var selected_colorset = params["colorset"];
|
||||
for(var i=0;i<length;i++) sel.remove(0);
|
||||
|
||||
var colorset_list = ret_obj["colorset_list"].split("\n");
|
||||
var selected_index = 0;
|
||||
for(var i=0;i<colorset_list.length;i++) {
|
||||
var tmp = colorset_list[i].split("|@|");
|
||||
if(selected_colorset && selected_colorset==tmp[0]) selected_index = i;
|
||||
var opt = new Option(tmp[1], tmp[0], false, false);
|
||||
sel.options.add(opt);
|
||||
}
|
||||
|
||||
sel.selectedIndex = selected_index;
|
||||
}
|
||||
|
||||
82
modules/poll/tpl/poll_list.html
Normal file
|
|
@ -0,0 +1,82 @@
|
|||
<!--%import("filter/delete_checked.xml")-->
|
||||
|
||||
<!--#include("./header.html")-->
|
||||
|
||||
<!-- 정보 -->
|
||||
<div class="tableSummaryType1">
|
||||
Total <strong>{number_format($total_count)}</strong>, Page <strong>{number_format($page)}</strong>/{number_format($total_page)}
|
||||
</div>
|
||||
|
||||
<form action="./" method="get" onsubmit="return procFilter(this, delete_checked)">
|
||||
<input type="hidden" name="page" value="{$page}" />
|
||||
|
||||
<!-- 목록 -->
|
||||
<table cellspacing="0" class="tableType1">
|
||||
<col width="80" />
|
||||
<col width="40" />
|
||||
<col />
|
||||
<col width="140" />
|
||||
<col width="60" />
|
||||
<col width="120" />
|
||||
<col width="80" />
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col" colspan="2">{$lang->no}</th>
|
||||
<th scope="col" >{$lang->title}</th>
|
||||
<th scope="col" >{$lang->poll_checkcount}</th>
|
||||
<th scope="col" >{$lang->poll_join_count}</th>
|
||||
<th scope="col" >{$lang->regdate}</th>
|
||||
<th scope="col" >{$lang->cmd_view}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<!--@foreach($poll_list as $no => $val)-->
|
||||
<tr>
|
||||
<td class="tahoma">{$no}</td>
|
||||
<td><input type="checkbox" name="cart" value="{$val->poll_index_srl}" /></td>
|
||||
<td class="left blue"><a href="{getUrl('','document_srl',$val->upload_target_srl)}" onclick="winopen(this.href); return false;">{htmlspecialchars($val->title)}</a></td>
|
||||
<td class="tahoma">{$val->checkcount}</td>
|
||||
<td class="tahoma">{$val->poll_count}</td>
|
||||
<td class="tahoma">{zdate($val->regdate,"Y-m-d H:i")}</td>
|
||||
<td class="blue"><a href="{getUrl('','module','poll','act','dispPollAdminResult','poll_srl',$val->poll_srl,'poll_index_srl',$val->poll_index_srl)}" onclick="popopen(this.href); return false;">{$lang->cmd_view}</a></td>
|
||||
</tr>
|
||||
<!--@end-->
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
</form>
|
||||
|
||||
<!-- 버튼 -->
|
||||
<div class="fr gap1">
|
||||
<span class="button"><input type="submit" value="{$lang->cmd_delete_checked_poll}" /></span>
|
||||
</div>
|
||||
|
||||
<!-- 페이지 네비게이션 -->
|
||||
<div class="pageNavigation">
|
||||
<a href="{getUrl('page','','module_srl','')}" class="goToFirst"><img src="../../admin/tpl/images/bottomGotoFirst.gif" alt="{$lang->first_page}" width="7" height="5" /></a>
|
||||
<!--@while($page_no = $page_navigation->getNextPage())-->
|
||||
<!--@if($page == $page_no)-->
|
||||
<span class="current">{$page_no}</span>
|
||||
<!--@else-->
|
||||
<a href="{getUrl('page',$page_no,'module_srl','')}">{$page_no}</a>
|
||||
<!--@end-->
|
||||
<!--@end-->
|
||||
<a href="{getUrl('page',$page_navigation->last_page,'module_srl','')}" class="goToLast"><img src="../../admin/tpl/images/bottomGotoLast.gif" alt="{$lang->last_page}" width="7" height="5" /></a>
|
||||
</div>
|
||||
|
||||
<!-- 검색 -->
|
||||
<form action="./" method="get" class="adminSearch">
|
||||
<input type="hidden" name="module" value="{$module}" />
|
||||
<input type="hidden" name="act" value="{$act}" />
|
||||
<fieldset>
|
||||
<select name="search_target">
|
||||
<option value="">{$lang->search_target}</option>
|
||||
<!--@foreach($lang->search_target_list as $key => $val)-->
|
||||
<option value="{$key}" <!--@if($search_target==$key)-->selected="selected"<!--@end-->>{$val}</option>
|
||||
<!--@end-->
|
||||
</select>
|
||||
<input type="text" name="search_keyword" value="{htmlspecialchars($search_keyword)}" class="inputTypeText" />
|
||||
<span class="button"><input type="submit" value="{$lang->cmd_search}" /></span>
|
||||
<a href="{getUrl('','module',$module,'act',$act)}" class="button"><span>{$lang->cmd_cancel}</span></a>
|
||||
</fieldset>
|
||||
</form>
|
||||
35
modules/poll/tpl/result.html
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
<!--%import("css/poll.css")-->
|
||||
|
||||
<div class="poll_box">
|
||||
|
||||
<div class="poll_title_box">
|
||||
<div class="poll_join_count">
|
||||
{$lang->poll_join_count} : {number_format($poll->poll_count)}
|
||||
</div>
|
||||
<div class="poll_stop_date">
|
||||
{$lang->poll_stop_date} : {zdate($poll->stop_date, "Y-m-d H:i")}
|
||||
</div>
|
||||
</div>
|
||||
<!--@foreach($poll->poll as $poll_srl_index => $val)-->
|
||||
<div class="poll_detail_box">
|
||||
<div class="title">{$val->title} ({$val->poll_count})</div>
|
||||
<!--@foreach($val->item as $item_srl => $item)-->
|
||||
{@$per = (int)(( $item->poll_count / $val->poll_count)*100) }
|
||||
|
||||
<div class="text">
|
||||
{$item_srl+1}. {$item->title} : {$item->poll_count} ({$per}%)
|
||||
</div>
|
||||
<div class="bar_box">
|
||||
<!--@if($per)-->
|
||||
<div class="bar" style="width:{$per}%;"><img src="./images/blank.gif" alt="bar" width="1" height="5" /></div>
|
||||
<!--@else-->
|
||||
<div class="bar" style="width:2px;"><img src="./images/blank.gif" alt="bar" width="1" height="5" /></div>
|
||||
<!--@end-->
|
||||
</div>
|
||||
<!--@end-->
|
||||
|
||||
</div>
|
||||
|
||||
<!--@end-->
|
||||
|
||||
</div>
|
||||