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

@ -49,6 +49,17 @@
padding:5px;
}
.poll_detail_box .text {
margin:5px 0px 5px 20px;
}
.poll_detail_box .bar {
margin:5px 0px 15px 20px;
background-color:#444444;
height:5px;
}
.poll_button_area {
text-align:center;
}

View file

@ -1,8 +1,10 @@
<filter name="poll" module="poll" act="procPoll" confirm_msg_code="confirm_poll_submit">
<form />
<parameter />
<response>
<response callback_func="completePoll">
<tag name="error" />
<tag name="message" />
<tag name="poll_srl" />
<tag name="tpl" />
</response>
</filter>

View file

@ -2,49 +2,61 @@
<!--%import("js/poll.js")-->
<!--%import("css/poll.css")-->
<div class="poll_box" style="{$poll->style}">
<script type="text/javascript">
var poll_alert_lang = "{$lang->msg_check_poll_item}";
</script>
<form action="./" method="get" onsubmit="return doPoll(this)">
<div id="poll_{$poll->poll_srl}">
<div class="poll_title_box">
<div class="poll_total_count">
{$lang->poll_total_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>
<div class="poll_box" style="{$poll->style}">
<!--@foreach($poll->poll as $poll_srl_index => $val)-->
<form action="./" method="get" onsubmit="return doPoll(this)">
<div class="poll_detail_box">
<div class="title">{$poll_srl_index}. {$val->title} ({$val->poll_count})</div>
<!--@foreach($val->item as $item_srl => $item)-->
{@$_idx = $poll->poll_srl.'_'.$poll_srl_index.'_'.$item_srl}
<input type="hidden" name="poll_srl" value="{$poll->poll_srl}" />
<input type="hidden" name="poll_srl_indexes" value="" />
<div class="poll_title_box">
<div class="poll_total_count">
{$lang->poll_total_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)-->
<input type="hidden" name="checkcount_{$poll_srl_index}" value="{$val->checkcount}" />
<div class="poll_detail_box">
<div class="title">{$poll_srl_index}. {$val->title} ({$val->poll_count})</div>
<!--@foreach($val->item as $item_srl => $item)-->
{@$_idx = $poll->poll_srl.'_'.$poll_srl_index.'_'.$item_srl}
<div class="item">
<!--@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} ({$item->poll_count})</label>
</div>
<!--@end-->
<!--@if($val->checkcount>1)-->
<div class="checkcount">
{$lang->poll_check_count} : {$val->checkcount}
</div>
<!--@end-->
</div>
<div class="item">
<!--@if($val->checkcount>1)-->
<input type="checkbox" name="item_{$poll->poll_srl}_{$poll_srl_index}" value="{$item_srl}" id="poll_item_{$_idx}" />
<!--@else-->
<input type="radio" name="item_{$poll->poll_srl}_{$poll_srl_index}" value="{$item_srl}" id="poll_item_{$_idx}" />
<!--@end-->
<label for="poll_item_{$_idx}">{$item->title} ({$item->poll_count})</label>
</div>
<!--@end-->
<!--@if($val->checkcount>1)-->
<div class="checkcount">
{$lang->poll_check_count} : {$val->checkcount}
</div>
<!--@end-->
<div class="poll_button_area">
<input type="submit" value="{$lang->cmd_apply_poll}" class="poll_button" />
</div>
</form>
</div>
<!--@end-->
<div class="poll_button_area">
<input type="submit" value="{$lang->cmd_apply_poll}" class="poll_button" />
</div>
</form>
</div>

View file

@ -1,7 +1,49 @@
/* 설문 참여 함수 */
function doPoll(fo_obj) {
procFilter(fo_obj, poll);
var check_count = 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);
check_count[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 check_count) {
var count = check_count[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'];
xInnerHtml("poll_"+poll_srl, tpl);
}

View file

@ -1 +1,34 @@
hihi
<!--%import("css/poll.css")-->
<div class="poll_box" style="{$poll->style}">
<div class="poll_title_box">
<div class="poll_total_count">
{$lang->poll_total_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">{$poll_srl_index}. {$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->title} : {$item->poll_count} ({$per}%)
</div>
<!--@if($per)-->
<div class="bar" style="width:{$per}%;"></div>
<!--@else-->
<div class="bar" style="width:2px;"></div>
<!--@end-->
<!--@end-->
</div>
<!--@end-->
</div>