<!--{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="serform" action="<!--{$oefile}-->&c=<!--{$c}-->" method="post">
	<div class="oe_txtwrap">
	  优惠券ID：<input type="text" name="scoupid" id="scoupid" class="input-100" value="<!--{if $scoupid>0}--><!--{$scoupid}--><!--{/if}-->" />&nbsp;
	  优惠券标题：<input type="text" name="stitle" id="stitle" class="input-100" value="<!--{$stitle}-->" />&nbsp;
	  券码：<input type="text" name="scodesn" id="scodesn" class="input-100" value="<!--{$scodesn}-->" />&nbsp;
	  会员ID：<input type="text" name="suserid" id="suserid" class="input-100" value="<!--{if $suserid > 0}--><!--{$suserid}--><!--{/if}-->" />&nbsp;
	  状态：
	  <select name="sflag" id="sflag">
	  <option value="">==</option>
	  <option value="1"<!--{if $sflag == '1'}--> selected<!--{/if}-->>未使用</option>
	  <option value="2"<!--{if $sflag == '2'}--> selected<!--{/if}-->>已使用</option>
	  <option value="3"<!--{if $sflag == '3'}--> selected<!--{/if}-->>未使用已过期</option>
	  </select>
	  &nbsp;&nbsp;<input type="submit" name="btn_search" id="btn_search" class="button_2" value="搜索" />
	</div>
	</form>

    <div class="oe_tools_bar clearfix">
      <a class="icon-checkbox-unchecked" href="javascript:;" id="selAll" onclick="oemarrySelectAll(this, 'selall');">全选/反选</a>
      <a class="icon-remove-2" onclick="oemarryDialogFormDel('myform');">删除</a>
      <span class="fr"><a class="icon-plus" href="<!--{$oefile}-->&c=<!--{$c}-->&a=add">添加</a></span>
    </div>
    
	<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="15%">券码</th>
		<th width="15%">所属优惠券</th>
		<th width="15%">有效时间</th>
		<th width="10%">会员</th>
		<th width="13%">购买/领取时间</th>
		<th width="8%">状态</th>
		<th width="10%">使用时间</th>
		<th>操作</th>
	  </tr>
	  <!--{if empty($couponcode)}-->
	  <tr>
	    <td class="text_center" colspan="12">No data!</td>
	  </tr>
	  <!--{else}-->
	  <!--{foreach $couponcode as $volist}-->
	  <tr>
	    <td class="text_center"><input type="checkbox" name="id[]" id="id[]" class="selall" value="<!--{$volist.codeid}-->" /><!--{$volist.codeid}--></td>
		<td><!--{$volist.codesn}--></td>
		<td><!--{$volist.title}--></td>
		<td>
		<!--{$volist.starttime|date_format:"%Y-%m-%d %H:%M:%S"}-->至<!--{$volist.endtime|date_format:"%Y-%m-%d %H:%M:%S"}-->
		</td>
		<td><!--{$volist.username}-->(<!--{$volist.userid}-->)</td>
		<td class="text_center"><!--{$volist.buytime|date_format:"%Y-%m-%d %H:%M:%S"}--><br /><!--{$volist.addtime|date_format:"%H:%M:%S"}--></td>		
		<td class="text_center">
		<!--{if $volist.usestatus == '1'}-->
		<font color="green">已使用</font>
		<!--{else}-->
		<!--{if $volist.endtime < $time}-->
		<font color="red">已过期</font>
		<!--{else}-->
		<font color="gray">未使用</font>
		<!--{/if}-->
		<!--{/if}-->
		</td>
		<td class="text_center">
		<!--{if $volist.usetime>0}-->
		<!--{$volist.usetime|date_format:"%Y-%m-%d %H:%M:%S"}-->
		<!--{else}-->
		~
		<!--{/if}-->
		</td>
		<td class="text_center">
		 <a href="javascript:;" onclick="oemarryDialogUrlDel('<!--{$oefile}-->&c=<!--{$c}-->&a=del&id[]=<!--{$volist.codeid}-->&<!--{$comeurl}-->');" class="oe_ico_red">删除</a>
		</td>
	  </tr>
	  <!--{/foreach}-->
	  <!--{/if}-->
	</table>
	</form>

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

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

</body>
</html>