<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<!--{$page_charset}-->" />

<title>题目选项</title>
<!--{include file="<!--{$cptplpath}-->headerjs.tpl"}-->
<!--{assign var='pluginevent' value=XHook::doAction('adm_head')}-->
</head>
<body>
<!--{include file="<!--{$cptplpath}-->lang_all.tpl"}-->
<!--{if $a eq "run"}-->
<div class="main-wrap">
  <div class="path"><p>当前位置：模块管理<span>&gt;&gt;</span>调查征集<span>&gt;&gt;</span>题目选项</p></div>
  <div class="main-cont">
    <h3 class="title">
	  <a href="<!--{$cpfile}-->?c=<!--{$c}-->&a=add&stopicid=<!--{$stopicid}-->" class="btn-general"><span>添加题目选项</span></a>题目选项
	</h3>
	<div class="search-area ">
	  <form method="post" id="search_form" action="<!--{$cpfile}-->?c=<!--{$c}-->" />
	  <div class="item">
		所属问卷：
		<!--{hook mod="quetopic" type="select" name="stopicid" value=$stopicid text="=请选择="}-->
		&nbsp;
		题目标题：<input type="text" id="stitle" name="stitle" class="input-txt" value="<!--{$stitle}-->" />&nbsp;
		&nbsp;&nbsp;<input type="submit" class="button_s" value="搜 索" />
	  </div>
	  </form>
	</div>
	<form action="<!--{$cpfile}-->?c=<!--{$c}-->" method="post" name="myform" id="myform" style="margin:0">
	<input type='hidden' name='a' id='a'>
    <table width="100%" border="0" cellpadding="0" cellspacing="0" class="table" align="center">
	  <thead class="tb-tit-bg">
	  <tr>
		<th width="10%"><div class="th-gap">选择</div></th>
		<th width="20%"><div class="th-gap">所属问卷</div></th>
		<th width="25%"><div class="th-gap">题目</div></th>
	    <th width="6%"><div class="th-gap">排序</div></th>
		<th width="8%"><div class="th-gap">投票总数</div></th>
		<th width="15%"><div class="th-gap">添加时间</div></th>
		<th><div class="th-gap">操作</div></th>
	  </tr>
	  </thead>
	  <tfoot class="tb-foot-bg"></tfoot>
	  <!--{if empty($question)}-->
	  <tr>
	    <td colspan="7" align="center">没有找到符合条件的信息</td>
	  </tr>
	  <!--{else}-->
	  <!--{foreach $question as $volist}-->
	  <tr onMouseOver="overColor(this)" onMouseOut="outColor(this)">
	    <td align="center"><input name="id[]" type="checkbox" value="<!--{$volist.queid}-->" onClick="checkItem(this, 'chkAll')"><!--{$volist.queid}--></td>
		<td><!--{$volist.topicname}--></td>
		<td><!--{$volist.title}--></td>
		<td align="center"><!--{$volist.orders}--></td>
		<td align="center"><!--{$volist.totalpolls}--></td>
		<td align="center"><!--{$volist.addtime|date_format:"%Y-%m-%d %H:%M:%S"}--></td>
		<td align="center">
		  <a href="<!--{$cpfile}-->?c=<!--{$c}-->&a=edit&id=<!--{$volist.queid}-->&<!--{$comeurl}-->">编辑</a>&nbsp;&nbsp;
		  <a href="<!--{$cpfile}-->?c=<!--{$c}-->&a=del&id[]=<!--{$volist.queid}-->&<!--{$comeurl}-->" onClick="{if(confirm('确定要删除吗？')){return true;} return false;}">删除</a>&nbsp;&nbsp;
		  <a href="<!--{$cpfile}-->?c=queoption&a=add&squeid=<!--{$volist.queid}-->&<!--{$comeurl}-->">添加选项</a>
		</td>
	  </tr>
	  <!--{/foreach}-->
	  <tr>
		<td align="center"><input name="chkAll" type="checkbox" id="chkAll" onClick="checkAll(this, 'id[]')" value="checkbox"></td>
		<td class="hback" colspan="6">
		<input class="button" name="btn_del" type="button" value="删 除" onClick="{if(confirm('确定要删除吗？')){$('#a').val('del');$('#myform').submit();return true;}return false;}" class="button">
		&nbsp;&nbsp;共[ <b><!--{$total}--></b> ]条记录</td>
	  </tr>
	  <!--{/if}-->
	</table>
	</form>
  </div>
</div>
<!--{/if}-->

<!--{if $a eq "add"}-->
<div class="main-wrap">
  <div class="path"><p>当前位置：模块管理<span>&gt;&gt;</span>调查征集<span>&gt;&gt;</span><a href="<!--{$cpfile}-->?c=<!--{$c}-->&a=add&squeid=<!--{$squeid}-->">添加题目选项</a></p></div>
  <div class="main-cont">
	<h3 class="title"><a href="<!--{$cpfile}-->?c=question&<!--{$comeurl}-->" class="btn-general"><span>返回列表</span></a>添加题目选项</h3>
    <form name="myform" id="myform" method="post" action="<!--{$cpfile}-->?c=<!--{$c}-->&<!--{$comeurl}-->" />
    <input type="hidden" name="a" value="saveadd" />
	<table cellpadding='1' cellspacing='1' class='tab'>
	  <tr>
		<td class='hback_1' width='15%'>所属题目 <span class="f_red">*</span> </td>
		<td class='hback' width='85%'>
		  <!--{$quetitle}--> 
		  <input type="hidden" name="queid" id="queid" value="<!--{$squeid}-->" />
		</td>
	  </tr>
	  <tr>
		<td class='hback_1'>选项名称 <span class="f_red">*</span> </td>
		<td class='hback'><input type="text" name="optionname" id="optionname" class="input-txt" /> <span id='doptionname' class='f_red'></span> </td>
	  </tr>
	  <tr>
		<td class='hback_1'>排序 <span class="f_red"></span> </td>
		<td class='hback'>
		  <input type="text" name="orders" id="orders" class="input-s" /> <span id='dorders' class='f_red'></span> 
		  （可以是数字，也可以是字母）
		</td>
	  </tr>
	  <tr>
		<td class='hback'></td>
		<td class='hback'><input type="button" f="submitform" data-form="myform" name="btn_save" class="button" value="添加保存" /></td>
	  </tr>
	</table>
	</form>
  </div>
  <div style="clear:both;"></div>
</div>
<!--{/if}-->

<!--{if $a eq "edit"}-->
<div class="main-wrap">
  <div class="path"><p>当前位置：模块管理<span>&gt;&gt;</span>调查征集<span>&gt;&gt;</span>编辑题目选项</p></div>
  <div class="main-cont">
	<h3 class="title"><a href="<!--{$cpfile}-->?c=question&<!--{$comeurl}-->" class="btn-general"><span>返回列表</span></a>编辑题目选项</h3>
    <form name="myform" id="myform" method="post" action="<!--{$cpfile}-->?c=<!--{$c}-->&<!--{$comeurl}-->" />
    <input type="hidden" name="a" value="saveedit" />
	<input type="hidden" name="id" value="<!--{$id}-->" />
	<table cellpadding='1' cellspacing='1' class='tab'>
	  <tr>
		<td class='hback_1' width='15%'>所属题目 <span class="f_red">*</span> </td>
		<td class='hback' width='85%'>
		  <!--{$queoption.title}--> 
		  <input type="hidden" name="queid" id="queid" value="<!--{$queoption.queid}-->" />
		</td>
	  </tr>
	  <tr>
		<td class='hback_1'>选项名称 <span class="f_red">*</span> </td>
		<td class='hback'><input type="text" name="optionname" id="optionname" class="input-txt" value="<!--{$queoption.optionname}-->" /> <span id='doptionname' class='f_red'></span> </td>
	  </tr>
	  <tr>
		<td class='hback_1'>排序 <span class="f_red"></span> </td>
		<td class='hback'>
		  <input type="text" name="orders" id="orders" class="input-s" value="<!--{$queoption.orders}-->" /> <span id='dorders' class='f_red'></span> 
		  （可以是数字，也可以是字母）
		</td>
	  </tr>
	  <tr>
		<td class='hback_none'></td>
		<td class='hback_none'><input type="button" f="submitform" data-form="myform" name="btn_save" class="button" value="编辑保存" /></td>
	  </tr>
	</table>
	</form>
  </div>
  <div style="clear:both;"></div>
</div>
<!--{/if}-->
<!--{assign var='pluginevent' value=XHook::doAction('adm_footer')}-->
<script type="text/javascript">
$(function(){
	//提交保存
	$("[f='submitform']").bind("click", function(){
		$_form = $(this).attr("data-form");
		$_input = "";

		$_input = "optionname";
		if ($("#"+$_input).val().length == 0) {
			dmsg("请填写选项名称", $_input);
			return false;
		}
		$("#"+$_form).submit();

	});
});
</script>
</body>
</html>