git-svn-id: http://xe-core.googlecode.com/svn/trunk@1008 201d5d3c-b55e-5fd7-737f-ddc643e51545

This commit is contained in:
zero 2007-04-06 08:17:54 +00:00
parent 7766677867
commit 8a0f5b3998
14 changed files with 226 additions and 63 deletions

View file

@ -13,6 +13,19 @@
function init() {
}
/**
* @brief 이미 설문 조사를 하였는지 검사하는 함수
**/
function isPolled($poll_srl) {
$logged_info = Context::get('logged_info');
$args->member_srl = $logged_info->member_srl;
$args->poll_srl = $poll_srl;
$args->ipaddress = $_SERVER['REMOTE_ADDR'];
$output = executeQuery('poll.getPollLog', $args);
if($output->data->count) return true;
return false;
}
/**
* @brief 설문조사의 html데이터를 return
* 설문조사에 응하였는지에 대한 체크를 결과를 return
@ -41,28 +54,19 @@
$poll->poll[$val->poll_index_srl]->item[] = $val;
}
$poll->poll_srl = $poll_srl;
// 종료일이 지났으면 무조건 결과만
if($poll->stop_date > date("YmdHis")) {
// 현 사용자가 설문조사에 응하였는지 검사
$logged_info = Context::get('logged_info');
$args->member_srl = $logged_info->member_srl;
$output = executeQuery('poll.getPollLog', $args);
if($output->data->count) $poll->poll_date = $output->data->regdate;
else $poll->poll_date = '';
Context::set('poll', $poll);
// 응하였다면 결과 html return
if($poll->poll_date) $template_file = "result";
// 응하지 않았다면 설문 form html return
else $template_file = "form";
if($this->isPolled($poll_srl)) $tpl_file = "result";
else $tpl_file = "form";
} else {
$template_file = "result";
$tpl_file = "result";
}
Context::set('poll', $poll);
$tpl_path = $this->module_path.'tpl';
$tpl_file = $template_file;
require_once("./classes/template/TemplateHandler.class.php");
$oTemplate = new TemplateHandler();