<?php
	include("header.tpl.php");
	include("bodytop.tpl.php"); 
?>
<div class="g_navigation">
		<a href="index.php">网站首页</a> >> <a href="surveydisplay.php"><?php echo $surveyname?></a> >>
		<?php echo $survey_thread['survey_title']?>
</div>
	<div id="subsurveylist" class="bord">
       <div class="threadlist_head"><label><?php echo $survey_thread['survey_title']?></label></div>
		<form id="form_surveylist" method="post" >
			<table class="surveytable">
				<tr>
					<th class="sub_survey_item_label font_12">投票选项</th>
					<th class="sub_survey_result_label font_12">当前结果(总票数：<?php echo $survey_thread['survey_total_count']?>)</th>
					<th class="sub_survey_check_label font_12"> 选择</th>
				</tr>
				<?php 
				foreach($survey_items as $key => $survey_item){?>
				<tbody>
				<tr>
				  <td class="sub_survey_item_label" height="40">
				  <?php echo $survey_item['sub_survey_title']?>
				  </td>
					<td class="sub_survey_result_label">
					<?php if($survey_thread['showresult']){ ?>
					<a href="javascript:void(0)" onmouseover="showMenu(this.id)"  id="vote_result_show_<?php echo $survey_item['sub_survey_id']?>" class="dropmenu">
					<img src="templates/default/images/vote_01.gif" height="7" 
					width="<?php echo $survey_item['sub_survey_img_width']?>" />
					</a>
<div class="popupmenu_popup" id="vote_result_show_<?php echo $survey_item['sub_survey_id']?>_menu" style="display:none">
得票数为:<?php echo $survey_item['sub_survey_count']?>
</div>
					<?php }else{?>
					投票结果不可见
					<?php }?>
					</td>
					<td class="sub_survey_check_label">
					<?php if($survey_thread['multichecked']){?>					
					<input type="checkbox" name="post_sub_survey_count[<?php echo $key?>]" value="<?php echo $survey_item['sub_survey_id']?>" id="survey_check_<?php echo $key?>">
					<?php }else{?>
					<input type="radio" name="post_sub_survey_count" value="<?php echo $survey_item['sub_survey_id']?>" id="survey_radio_<?php echo $key?>">
					<?php }?>
					</td>
				</tr>
				</tbody>
			<?php }?>
		</table>
	</form>
	  </div>
	 <div class="clear"></div>
<?php
include("tail.tpl.php"); 
?>

<SCRIPT LANGUAGE="JavaScript">
//删除调查
function postvote(multi , get_id){
	if(multi){
		if(!is_checked('survey')){
			return alert("没有调查主题被选中");
		}
	}else{
		var cd=false;
		for(i=0; i<10; i++){
			var obj = $("survey_radio_" + i);
			if(obj!=null){
				if(obj.checked){
					cd=true;
				}
			}
		}
		if(!cd){
			return alert("没有调查主题被选中");
		}
	}
		$('form_surveylist').action="post.php?action=savevote&get_id="+get_id;
		$('form_surveylist').submit();
}
</SCRIPT>

