<!-- $Id: gift_list.htm 6893 2007-03-13 04:09:30Z weberliu $ -->
{include file="pageheader.htm"}
{insert_scripts files="../js/utils.js,selectzone.js"}
<!-- 商品搜索 -->
<div class="form-div">
  <form action="javascript:searchGoods()" name="searchForm">
    <img src="images/icon_search.gif" width="26" height="22" border="0" alt="SEARCH" />
    <!-- 分类 -->
    <select name="cat_id"><option value="0">{$lang.all_category}</caption>{$cat_list}</select>
    <!-- 品牌 -->
    <select name="brand_id"><option value="0">{$lang.all_brand}</caption>{html_options options=$brand_list}</select>
    <!-- 关键字 -->
    <input type="text" name="keyword" size="30" />
    <input type="submit" value="{$lang.button_search}" class="button" />
  </form>
</div>

<div class="list-div">
<form name="theForm">
<table cellspacing='1' cellpadding='3'>
  <tr>
    <th>{$lang.all_goods}</th>
    <th>{$lang.handler}</th>
    <th>{$lang.gift_and_price}</th>
  </tr>
  <tr>
    <td width="40%">
      <select name="source_select" size="20" style="width:100%" onchange="sz.priceObj.value = this.options[this.selectedIndex].id" ondblclick="sz.addItem(false, 'add_gift_goods', giftTypeId, this.form.elements['price'].value)">
      </select>
    </td>
    <td align="center">
      <p>{$lang.price}<br /><input name="price" type="text" size="6" /></p>
      <p><input type="button" value=">" onclick="sz.addItem(false, 'add_gift_goods', giftTypeId, this.form.elements['price'].value)" class="button" /></p>
      <p><input type="button" value="<" onclick="sz.dropItem(false, 'drop_gift_goods', giftTypeId)" class="button" /></p>
      <p><input type="button" value="<<" onclick="sz.dropItem(true, 'drop_gift_goods', giftTypeId)" class="button" /></p>
    </td>
    <td width="50%">
      <select name="target_select" size="20" style="width:100%" multiple ondblclick="sz.dropItem(false, 'drop_gift_goods', giftTypeId)">
        {foreach from=$gift_list item=goods}
        <option value="{$goods.goods_id}">{$goods.goods_name} ---- [{$goods.goods_price}]</option>
        {/foreach}
      </select>
    </td>
  </tr>
</table>
</form>
</div>

<script language="JavaScript">
  var giftTypeId = '{$gift_type.gift_type_id}';
  var elements = document.forms['theForm'].elements;
  var sz = new SelectZone(2, elements['source_select'], elements['target_select'], elements['price']);
  {literal}
  onload = function()
  {
      // 开始检查订单
      startCheckOrder();
  }

  function searchGoods()
  {
      var filters = new Object;

      filters.cat_id = document.forms['searchForm'].elements['cat_id'].value;
      filters.brand_id = document.forms['searchForm'].elements['brand_id'].value;
      filters.keyword = Utils.trim(document.forms['searchForm'].elements['keyword'].value);

      sz.loadOptions('get_goods_list', filters);
  }
  {/literal}
</script>
{include file="pagefooter.htm"}