<!-- $Id: bonus_list.htm 14216 2008-03-10 02:27:21Z testyang $ -->

{if $full_page}
{include file="pageheader.htm"}
{insert_scripts files="../js/utils.js,../js/transport.js,listtable.js"}
<div class="form-div">
  <form action="javascript:searchCards()" name="searchForm">
    <img src="images/icon_search.gif" width="26" height="22" border="0" alt="SEARCH" />
    {$lang.card_sn|escape}<input name="card_sn" type="text" id="card_sn" size="15">
    {$lang.order_sn|escape}<input name="order_sn" type="text" id="order_sn" size="15">
    {$lang.group_name}<input name="group_name" type="text" id="group_name" size="15">
    
    {$lang.all_status}
    <select name="status" id="status">
      <option value="-1">{$lang.select_please}</option>
      {html_options options=$status_list}
    </select>
    <input type="submit" value="{$lang.button_search}" class="button" />
  </form>
</div>

<form method="POST" action="group_card.php?act=batch" name="listForm">
<div class="list-div" id="listDiv">
{/if}

  <table cellpadding="3" cellspacing="1">
    <tr>
      <th>
        <input onclick='listTable.selectAll(this, "checkboxes")' type="checkbox">
        <a href="javascript:listTable.sort('card_id'); ">{$lang.record_id}</a>{$sort_card_id}</th>
      <th><a href="javascript:listTable.sort('card_sn'); ">{$lang.card_sn}</a>{$sort_card_sn}</th>
            <th><a href="javascript:listTable.sort('card_password'); ">{$lang.card_password}</a>{$sort_card_password}</th>
   <th><a href="javascript:listTable.sort('send_num'); ">{$lang.send_num}</a>{$sort_send_num}</th>
      <th><a href="javascript:listTable.sort('group_id'); ">{$lang.group_name}</a>{$sort_group_name}</th>
      <th><a href="javascript:listTable.sort('order_sn'); ">{$lang.order_sn}</a>{$sort_order_sn}</th>
      <th><a href="javascript:listTable.sort('user_id'); ">{$lang.user_name}</a>{$sort_user_id}</th>
     <th><a href="javascript:listTable.sort('end_date'); ">{$lang.end_date}</a>{$sort_end_time}</th>
      <th><a href="javascript:listTable.sort('is_used'); ">{$lang.is_used}</a>{$is_used}</th>
      <th>{$lang.handler}</th>
    </tr>
    {foreach from=$group_list item=group}
    <tr>
      <td width="60"><span><input value="{$group.card_id}" name="checkboxes[]" type="checkbox">{$group.card_id}</span></td>
      <td width="65">{$group.card_sn}</td>
      <td width="65">{$group.card_password}</td>
       <td width="65" align="center">{$group.send_num}</td>
      <td><a href="../team.php?id={$group.group_id}" target="_blank">{$group.goods_name}</a></td>
      <td align="center" width="95">{$group.order_sn}</td>
      <td width="120">{$group.user_name}</td>
      <td width="80" align="center">{$group.end_date}</td>
      <td align="center" width="60">{if $group.is_used eq '0'}否{else}是<br />{$group.use_date}{/if}</td>
      <td align="center" width="60">
    <a href="javascript:;" onclick="send_sms({$group.card_id})">{$lang.send_sms}</a>
    &nbsp;&nbsp;<a href="javascript:;" onclick="listTable.remove({$group.card_id}, '{$lang.drop_confirm}', 'remove_card')">{$lang.remove}</a>
      </td>
    </tr>
    {foreachelse}
    <tr><td class="no-records" colspan="11">{$lang.no_records}</td></tr>
    {/foreach}
  </table>

  <table cellpadding="4" cellspacing="0">
    <tr>
      <td><input type="submit" name="drop" id="btnSubmit" value="{$lang.drop}" class="button" disabled="true" />
      {if $show_mail}<input type="submit" name="mail" id="btnSubmit1" value="{$lang.send_mail}" class="button" disabled="true" />{/if}</td>
      <td align="right">{include file="page.htm"}</td>
    </tr>
  </table>

{if $full_page}
</div>
<!-- end user_bonus list -->
</form>

<script type="text/javascript" language="JavaScript">
  listTable.recordCount = {$record_count};
  listTable.pageCount = {$page_count};
  listTable.query = "query_card";

  {foreach from=$filter item=item key=key}
  listTable.filter.{$key} = '{$item}';
  {/foreach}

  {literal}
  function searchCards()
  {
        listTable.filter['card_sn'] = Utils.trim(document.forms['searchForm'].elements['card_sn'].value);
		listTable.filter['order_sn'] = Utils.trim(document.forms['searchForm'].elements['order_sn'].value);
        listTable.filter['group_name'] = Utils.trim(document.forms['searchForm'].elements['group_name'].value);
        listTable.filter['card_status'] = document.forms['searchForm'].elements['status'].value;
        listTable.filter['page'] = 1;
        listTable.loadList();
  }
  
  onload = function()
  {
    // 开始检查订单
    startCheckOrder();
    document.forms['listForm'].reset();
  }
  function send_sms(card_id)
  {
	 if (card_id > 0)
	 { 
  	   Ajax.call('group_card.php?is_ajax=1&act=send_sms', 'card_id=' + card_id, listTable.listCallback, "GET", "JSON");
	 }
  }
  {/literal}
</script>
{include file="pagefooter.htm"}
{/if}