{if $full_page}
{include file="page_header.htm"}
{insert_scripts files="../js/utils.js,listtable.js"}

<form method="post" action="wx_reply.php" name="list_form" id="list_form">
<div class="list-div" id="listDiv">
{/if}

<table width="100%" border="0" cellspacing="0" cellpadding="0" style="margin-top:10px;">
<tr>
<td height="36" class="BotNavBg">
	<table width="100%" border="0" cellspacing="0" cellpadding="0">
	<tr>
	<td width="50" align="left" style="padding-left:15px;">
	<label><input type="checkbox" name="check_all" onclick="select_all(this);" /> 全选</label></td>
	<td style="padding-left:5px;">
		<select name="type_up" id="sel_action_up" onchange="change_action(this)">
		<option value="">--请选择--</option>
		<option value="remove">删除</option>
		<option value="hide">隐藏</option>
		<option value="show">显示</option>
		</select>
	</td>
	<td align="right" style="padding-right:3px;">{include file="page.htm"}</td>
	</tr>
	</table>
</td>
</tr>
</table>

<table cellspacing="0" cellpadding="0" class="list-table" width="100%">
	<tr class="thead">
	<th width="5%">选择</th>
	<th width="25%" align="left"><a href="javascript:listTable.sort('name');">名称</a>{$sort_name}</th>
	<th width="30%" align="left"><a href="javascript:listTable.sort('keyword');">关键词</a>{$sort_keyword}</th>
	<th width="10%" align="left"><a href="javascript:listTable.sort('type'); ">类型</a>{$sort_type}</th>
	<th width="10%"><a href="javascript:listTable.sort('count'); ">响应次数</a>{$sort_count}</th>
	<th width="10%"><a href="javascript:listTable.sort('status'); ">状态</a>{$sort_status}</th>
	<th width="10%" align="left">操作</th>
	</tr>
	{foreach from=$reply_list item=list}
	<tr>
	<td align="center"><span><input name="checkboxes[]" type="checkbox" value="{$list.id}" /></span></td>
	<td class="first-cell">{$list.name|escape:html}</td>
	<td align="left"><span>{$list.keyword|escape:html}</span></td>
	<td align="left"><span>{$list.type_name|escape:html}</span></td>
	<td align="center"><span>{$list.count|escape:html}</span></td>
	<td align="center"><span>
	<img src="images/{if $list.status eq 1}yes{else}no{/if}.gif" onclick="listTable.toggle(this, 'toggle_status', {$list.id})" /></span></td>
	
	<td align="center" nowrap="true" class="operation">

		<a href="wx_reply.php?act=edit&amp;id={$list.id}" title="编辑" class="op_edit"></a>
		<a href="javascript:;" onclick="listTable.remove({$list.id}, '您确认要删除吗?')" title="删除" class="op_del"></a>

	</td>

	</tr>
	{/foreach}
</table>

<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
	<td height="36" class="BotNavBg">
		<table width="100%" border="0" cellspacing="0" cellpadding="0">
		<tr>
			<td width="50" align="left" style="padding-left:15px;">
			<label><input type="checkbox" name="check_all" onclick="select_all(this);" /> 全选</label>
			</td>
			<td style="padding-left:5px;">
				<input type="hidden" name="act" value="batch" />
				<input type="hidden" name="type" value="" id="type" />
				<select name="type_down" id="sel_action_down" onchange="change_action(this)">
				<option value="">--请选择--</option>
				<option value="remove">删除</option>
				<option value="hide">隐藏</option>
				<option value="show">显示</option>
				</select>
			</td>
			<td align="right" style="padding-right:3px;">{include file="page.htm"}</td>
		</tr>
		</table>
	</td>
  </tr>
</table>
{if $full_page}
</div>
</form>
<script type="text/javascript">
listTable.recordCount = {$record_count};
listTable.pageCount = {$page_count};
{foreach from=$filter item=item key=key}
listTable.filter.{$key} = '{$item}';
{/foreach}
{literal}

function change_action(obj){
	var sel_val = $(obj).val();	
	$('#type').val(sel_val);
	if(sel_val == 'remove' && confirm("确认删除?")){
		$("#list_form").submit();	
	}else if(sel_val == 'hide' && confirm("确认隐藏?")){
		$("#list_form").submit();	
	}else if(sel_val == 'show' && confirm("确认显示?")){
		$("#list_form").submit();	
	}
	return false;
}
 
function select_all(obj){
	$('.list-table :checkbox').prop("checked",$(obj).prop('checked'));
}
{/literal}
</script>
{include file="page_footer.htm"}
{/if}