<!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>
<title>刀客建站系统   管理中心  - 软件列表 </title>
<%{include file="header.html"}%>
</head>
<body>
<h1>
<span class="action-span"><a href="index.php?act=leave_word.dlist&state=0">留言列表</a></span>
<span class="action-span1"><a href="index.php?act=index.default_page">刀客建站系统   管理中心 </a>  - 站点留言相关设定</span>
<span style='float:right;margin-right:10px;'><img src='images/top_help.gif'><a href="http://sitepub.cn/help"> 帮助 </a></span>
<span style='float:right;margin-right:10px;'><img src='images/top_forum.gif'><a href="http://bbs.sitepub.cn"> 论坛 </a></span>
<div style="clear:both"></div>
</h1>
<div class="tab-div">
  
  	<div id="tabbody-div">
		<form action='index.php?act=leave_word.save_setting' method='POST'>
			<table width="100%">
				<tr>
					<td valign="top" class="label">是否关闭留言</td> 
					<td><input type='radio' value=1 name='is_close' <%{if $out.leave_word_setting.is_close }%> checked=true <%{/if}%>>是 &nbsp;<input type='radio' name='is_close' value=0  <%{if !$out.leave_word_setting.is_close }%> checked=true <%{/if}%>>否</td>
				</tr>	
			
				<tr>
					<td valign="top" class="label">留言是否自动发送邮件给管理员</td> 
					<td><input type='radio' value=1 name='mail_to_admin' <%{if $out.leave_word_setting.mail_to_admin }%> checked=true <%{/if}%>>是 &nbsp;<input type='radio' name='mail_to_admin' value=0  <%{if $out.leave_word_setting.mail_to_admin==0 }%> checked=true <%{/if}%>>否</td>
				</tr>
				<tr>
					<td valign="top" class="label">是否允许发送附件</td> 
					<td><input type='radio' value=1  name='is_attachment' <%{if $out.leave_word_setting.is_attachment }%> checked=true <%{/if}%>>是 &nbsp;<input type='radio' name='is_attachment' value=0  <%{if $out.leave_word_setting.is_attachment==0 }%> checked=true <%{/if}%>>否</td>
					
	
				</tr>	
				<tr>
					<td valign="top" class="label">留言类型:</td>
					<td><p>{$name}为留言人姓名</p><p>{$email}为留言人email</p><p>{$attachment}为附件名称</p></td>
				</tr>
					<%{foreach from =$out.leave_word_setting.type item=v key=k name=a}%>
					<tr id='type_name_<%{$k}%>'>
					<td  class="label"><a href="javascript:void(0);" onclick='del_leave_word_tr(<%{$k}%>)' >[-]</a> &nbsp;&nbsp;名称 </td>
					<td  ><input value='<%{$v.name}%>' name='type_name[<%{$k}%>]'></td>
					</tr>
					<tr id='type_return_tpl_<%{$k}%>' >
					<td  class="label">在线信息反馈:</a></td>
					<td  ><textarea name='type_return_tpl[<%{$k}%>]' style='width:300px;height:70px;'><%{$v.return_tpl}%></textarea></td>	
					</tr>
					<%{/foreach}%>
				</tr>
				<tr>
					<td valign="top" class="label"><a href="javascript:void(0);" onclick='add_leave_word_tr(this)'>[+]</a></td><td></td>
				</tr>
			</table>	
		<div class="button-div">
			<input type="submit" class="button" value=" 提交 "/>
		</div>
	</form>	
	</div>
  
</div>
<script>
	function del_leave_word_tr(id)
	{
		$("#type_name_"+id).remove();
		$("#type_return_tpl_"+id).remove();
	}	
	function add_leave_word_tr(obj)
	{
		if(typeof i =='undefined'){
			var i	=	<%{$smarty.foreach.a.total}%>;
		}else{
			i++;
		}
		$(obj).parent().parent().before('<tr id="type_name_'+i+'"><td  class="label"><a href="javascript:void(0);" onclick="del_leave_word_tr('+i+')" >[-]</a> &nbsp;&nbsp;名称 </td><td  ><input  name="type_name[]"></td></tr><tr id="type_return_tpl_'+i+'"><td  class="label">在线信息反馈:</a></td><td  ><textarea name="type_return_tpl[]" style="width:300px;height:70px;"></textarea></td></tr>');
	}

</script>

</body>
</html>
