<!-- $Id: auction_info.htm 13847 2007-12-10 03:02:15Z fenghl $ -->
{include file="pageheader.htm"}
<script type="text/javascript" src="../js/calendar.php?lang={$cfg_lang}"></script>
<link href="../js/calendar/calendar.css" rel="stylesheet" type="text/css" />
{insert_scripts files="validator.js,../js/transport.js}
<div class="main-div">
<form method="post" action="auction.php" name="theForm" enctype="multipart/form-data" onSubmit="return validate()">
<table cellspacing="1" cellpadding="3" width="100%">
  <tr>
    <td class="label">{$lang.label_act_name}</td>
    <td><input name="act_name" type="text" id="act_name" value="{$auction.act_name}" maxlength="60" />
    {$lang.notice_act_name}</td>
  </tr>
  <tr>
    <td class="label">{$lang.label_act_desc}</td>
    <td><textarea  name="act_desc" cols="60" rows="4" id="act_desc"  >{$auction.act_desc}</textarea></td>
  </tr>
  <tr>
    <td align="right">{$lang.label_search_goods}</td>
    <td><input name="keyword" type="text" id="keyword">
      <input name="search" type="button" id="search" value="{$lang.button_search}" class="button" onclick="searchGoods()" /></td>
  </tr>
  <tr>
    <td class="label">{$lang.label_goods_name}</td>
    <td><select name="goods_id" id="goods_id">
      <option value="{$auction.goods_id}" selected="selected">{$auction.goods_name}</option>
    </select>    </td>
  </tr>
  <tr>
    <td class="label">{$lang.label_start_time}</td>
    <td><input name="start_time" type="text" id="start_time" value="{$auction.start_time}" readonly="readonly" />
      <input name="selbtn1" type="button" id="selbtn1" onclick="return showCalendar('start_time', '%Y-%m-%d %H:%M', '24', false, 'selbtn1');" value="{$lang.btn_select}" class="button" /></td>
  </tr>
  <tr>
    <td class="label">{$lang.label_end_time}</td>
    <td><input name="end_time" type="text" id="end_time" value="{$auction.end_time}" readonly="readonly" />
      <input name="selbtn2" type="button" id="selbtn2" onclick="return showCalendar('end_time', '%Y-%m-%d %H:%M', '24', false, 'selbtn2');" value="{$lang.btn_select}" class="button" /></td>
  </tr>
  <tr>
    <td class="label">{$lang.label_start_price}</td>
    <td><input name="start_price" type="text" id="start_price" value="{$auction.start_price}"></td>
  </tr>
  <tr>
    <td class="label">{$lang.label_end_price}</td>
    <td><input name="end_price" type="text" id="end_price" value="{$auction.end_price}"></td>
  </tr>
  <tr>
    <td class="label">{$lang.label_amplitude}</td>
    <td><input name="amplitude" type="text" id="amplitude" value="{$auction.amplitude}"></td>
  </tr>
  <tr>
    <td class="label">{$lang.label_deposit}</td>
    <td><input name="deposit" type="text" id="deposit" value="{$auction.deposit}"></td>
  </tr>
  {if $auction.act_id gt 0}
  <tr>
    <td class="label">{$lang.label_status}</td>
    <td>{$auction.status}<br />{$bid_user_count} <a href="auction.php?act=view_log&id={$auction.act_id}"> [ {$lang.view} ]</a></td>
  </tr>
  {/if}
  <tr>
    <td colspan="2" align="center">
      {if $auction.act_id eq 0 or $auction.status_no eq "0" or $auction.status_no eq "1"}
      <input type="submit" class="button" value="{$lang.button_submit}" />
      <input type="reset" class="button" value="{$lang.button_reset}" />
      <input type="hidden" name="act" value="{$form_action}" />
      {elseif $auction.status_no eq "2"}
        {if $auction.deposit gt 0}
        {$lang.settle_frozen_money}
        <input type="submit" class="button" value="{$lang.unfreeze}" name="unfreeze" />
        <input type="submit" class="button" value="{$lang.deduct}" name="deduct" />
        <input type="hidden" name="act" value="settle_money" />
        {/if}
      {/if}
      <input type="hidden" name="id" value="{$auction.act_id}" /></td>
  </tr>
</table>
</form>
</div>

{literal}
<script language="JavaScript">
<!--
onload = function()
{
    // 开始检查订单
    startCheckOrder();
}
/**
 * 检查表单输入的数据
 */
function validate()
{
    validator = new Validator("theForm");
    validator.isNumber('start_price', start_price_not_number, false);
    validator.isNumber('end_price', end_price_not_number, false);
    validator.gt('end_price', 'start_price', end_gt_start);
    validator.isNumber('amplitude', amplitude_not_number, false);
    validator.isNumber('deposit', deposit_not_number, false);
    validator.islt('start_time', 'end_time', start_lt_end);
    return validator.passed();
}

function searchGoods()
{
  var filter = new Object;
  filter.keyword  = document.forms['theForm'].elements['keyword'].value;

  Ajax.call('auction.php?is_ajax=1&act=search_goods', filter, searchGoodsResponse, 'GET', 'JSON');
}

function searchGoodsResponse(result)
{
  if (result.error == '1' && result.message != '')
  {
    alert(result.message);
	return;
  }

  var sel = document.forms['theForm'].elements['goods_id'];

  sel.length = 0;

  /* 创建 options */
  var goods = result.content;
  if (goods)
  {
    for (i = 0; i < goods.length; i++)
    {
      var opt = document.createElement("OPTION");
      opt.value = goods[i].goods_id;
      opt.text  = goods[i].goods_name;
      sel.options.add(opt);
    }
  }

  return;
}
//-->
</script>
{/literal}
{include file="pagefooter.htm"}
