<!--{include file="<!--{$oetplpath}-->block_head.tpl"}-->
<!--{if $a == "run"}-->
<div class="oemarry_layout">
  <div class="oe_top_nav"><i></i>营销管理->邮件模板</div>
  <div class="oe_content">
	
	<form id="myform" action="<!--{$oefile}-->&c=<!--{$c}-->&a=del" method="post">
    <table class="oe_table_list table_cs">
	  <tr>
	    <th width="8%">ID</th>
		<th width="12%">类型</th>
		<th width="20%">邮件标题</th>
		<th>模板内容</th>
		<th width="10%">操作</th>
	  </tr>
	  <!--{if empty($mailtpl)}-->
	  <tr>
	    <td class="text_center" colspan="5">No data!</td>
	  </tr>
	  <!--{else}-->
	  <!--{foreach $mailtpl as $volist}-->
	  <tr>
	    <td class="text_center"><!--{$volist.tplid}--></td>
		<td><!--{$volist.type}--></td>
		<td><!--{$volist.title}--></td>
		<td><!--{$volist.content|filterhtml:80}--></td>
		<td class="text_center">
		 <a href="<!--{$oefile}-->&c=<!--{$c}-->&a=edit&id=<!--{$volist.tplid}-->" class="oe_ico_blue">编辑</a>
		</td>
	  </tr>
	  <!--{/foreach}-->
	  <!--{/if}-->
	</table>
	</form>

	<div class="oe_page_box"><!--{$showpage}--></div>

  </div>
</div>
<!--{/if}-->


<!--{if $a == 'edit'}-->
<div class="oemarry_layout">
  <div class="oe_top_nav">
	<i></i>营销管理->邮件模板->编辑
	<span><a href="<!--{$oefile}-->&c=<!--{$c}-->">&lt;&lt;返回列表</a></span>
  </div>
  <div class="oe_txtwrap">全局标签可用：{sitename}-网站名称，{siteurl}-网站URL</div>

  <div class="oe_content">
    <h6>编辑邮件模板</h6>
	<form id="myform" action="<!--{$oefile}-->&c=<!--{$c}-->" method="post" />
	<input type="hidden" name="a" id="a" value="saveedit" />
	<input type="hidden" name="id" id="id" value="<!--{$id}-->" />
    <table class="oe_table_wrap">
	  <tr>
	    <th width="15%">模板类型：<span class="f_red"></span></th>
		<td width="85%"><!--{$mailtpl.type}--></td>
	  </tr>
	  <tr>
	    <th>邮件标题：<span class="f_red">*</span></th>
		<td><input type="text" name="title" id="title" class="input-b" value="<!--{$mailtpl.title}-->" /></td>
	  </tr>
	  <tr>
	    <th>邮件模板内容：<span class="f_red"></span></th>
		<td colspan="3">
		  <textarea name="content" id="content" style="width:90%;height:350px;display:none;"><!--{$mailtpl.content}--></textarea>
		</td>
	  </tr>
	  <tr>
	    <td></td>
		<td><input type="button" id="btn_save" class="button_2" value="编辑保存" /> </td>
	  </tr>
	</table>
	</form>
  </div>
</div>
<script type="text/javascript">
$(function(){
	var myeditor;
	KindEditor.ready(function(K) {myeditor = K.create("#content");});

	$("#btn_save").bind("click", function(){
		if ($("#title").val().length == 0) {
			ToastShow("请填写邮件标题", "title");
			return false;
		}
		$("#content").text(myeditor.html());
		$("#myform").submit();
	});
});
</script>
<!--{/if}-->
</body>
</html>