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

<div class="form-div">
  <form action="javascript:searchSnatch()" name="searchForm">
    <img src="images/icon_search.svg" width="26" height="22" border="0" alt="SEARCH" />
    <select name = "searchType">
      <option value="card_sn">{$lang.lab_card_sn}</option>
      <option value="order_sn">{$lang.lab_order_sn}</option>
    </select>
    <input type="text" name="keyword" /> <input type="submit" value="{$lang.button_search}" class="button" />
  </form>
</div>

<form method="POST" action="virtual_card.php?act=batch_drop_card&goods_id={$goods_id}" name="listForm">
<!-- start card list -->
<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.lab_card_sn}</a>{$sort_card_sn}</th>
      <th><a href="javascript:listTable.sort('card_password'); ">{$lang.lab_card_password}</a>{$sort_card_password}</th>
      <th><a href="javascript:listTable.sort('end_date'); ">{$lang.lab_end_date}</a>{$sort_end_date}</th>
      <th><a href="javascript:listTable.sort('is_saled'); ">{$lang.lab_is_saled}</a>{$sort_is_sold}</th>
      <th><a href="javascript:listTable.sort('order_sn'); ">{$lang.lab_order_sn}</a>{$sort_order_sn}</th>
      <th>{$lang.handler}</th>
    </tr>
    {foreach from=$card_list item=card}
    <tr>
      <td><input value="{$card.card_id}" name="checkboxes[]" type="checkbox">{$card.card_id}</td>
      <td><span>{$card.card_sn}</span></td>
      <td><span>{$card.card_password}</span></td>
      <td align="right"><span>{$card.end_date}</span></td>
      <td align="center"><img src="images/{if $card.is_saled}yes{else}no{/if}.gif" /></span>
      </td>
      <td>{$card.order_sn}</td>
      <td align="center">
        <a href="virtual_card.php?act=edit_replenish&amp;card_id={$card.card_id}" title="{$lang.edit}">{$lang.edit}</a>
        <a href="javascript:;" onclick="listTable.remove({$card.card_id}, '{$lang.drop_confirm}', 'remove_card')" title="{$lang.drop}">{$lang.remove_card}</a>
      </td>
    </tr>
    {foreachelse}
    <tr><td class="no-records" colspan="10">{$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" /></td>
      <td align="right">{include file="page.htm"}</td>
    </tr>
  </table>

{if $full_page}
</div>
<!-- end card_list 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}
  onload = function()
  {
    document.forms['searchForm'].elements['keyword'].focus();
    startCheckOrder();
  }

/**
 * 搜索团购商品
 */
function searchSnatch()
{
  var keyword = Utils.trim(document.forms['searchForm'].elements['keyword'].value);
  var type = document.forms['searchForm'].elements['searchType'].value;

  if (keyword.length > 0)
  {
    listTable.filter['search_type'] = type;
    listTable.filter['keyword']     = keyword;
    listTable.loadList();
  }
  else
  {
    document.forms['searchForm'].elements['keyword'].focus();
  }
}
//-->
</script>
{/literal}

{include file="pagefooter.htm"}
{/if}