<!-- $Id: bonus_type_info.htm 7561 2007-03-23 11:50:21Z paulgao $ -->
{include file="pageheader.htm"}
<div class="main-div">
<form action="bonus.php" method="post" name="theForm" enctype="multipart/form-data" onsubmit="return validate()">
<table width="100%">
  <tr>
    <td class="label">{$lang.type_name}</td>
    <td>
      <input type='text' name='type_name' maxlength="30" value="{$bonus_arr.type_name}" size='20' />
    </td>
  </tr>
  <tr>
    <td class="label">
      <a href="javascript:showNotice('Type_money_a');" title="{$lang.form_notice}">
      <img src="images/notice.gif" width="16" height="16" border="0" alt="{$lang.form_notice}"></a>{$lang.type_money}</td>
    <td>
    <input type="text" name="type_money" value="{$bonus_arr.type_money}" size="20" />
    <br /><span class="notice-span" id="Type_money_a">{$lang.type_money_notic}</span>
    </td>
  </tr>

  <tr>
    <td class="label">{$lang.send_method}</td>
    <td>
      <input type="radio" name="send_type" value="0" {if $bonus_arr.send_type eq 0} checked="true" {/if} onClick="showunit(0)"  />{$lang.send_by[0]}
      <input type="radio" name="send_type" value="1" {if $bonus_arr.send_type eq 1} checked="true" {/if} onClick="showunit(1)"  />{$lang.send_by[1]}
      <input type="radio" name="send_type" value="2" {if $bonus_arr.send_type eq 2} checked="true" {/if} onClick="showunit(2)"  />{$lang.send_by[2]}
      <input type="radio" name="send_type" value="3" {if $bonus_arr.send_type eq 3} checked="true" {/if} onClick="showunit(3)"  />{$lang.send_by[3]}
    </td>
  </tr>
  <tr id="1" style="display:none">
    <td class="label">
      <a href="javascript:showNotice('Order_money_a');" title="{$lang.form_notice}">
      <img src="images/notice.gif" width="16" height="16" border="0" alt="{$lang.form_notice}"></a>{$lang.min_amount}</td>
    <td>
      <input type="text" name="min_amount" value="{$bonus_arr.min_amount}" size="20" />
      <br /><span class="notice-span" id="Order_money_a">{$lang.order_money_notic}</span>
    </td>
  </tr>
  <tr>
    <td class="label">
      <a href="javascript:showNotice('Send_start_a');" title="{$lang.form_notice}">
      <img src="images/notice.gif" width="16" height="16" border="0" alt="{$lang.form_notice}"></a>{$lang.send_startdate}</td>
    <td>
      {html_select_date prefix="send_startdate" field_order="YMD" month_format="%m"  day_value_format="%02d" start_year="-1" end_year="+10" display_days=yes time=$bonus_arr.send_startdate}
      <br /><span class="notice-span" id="Send_start_a">{$lang.send_startdate_notic}</span>
    </td>
  </tr>
  {if $action eq "add"}
    <tr>
      <td class="label">{$lang.send_enddate}</td>
      <td>
        {html_select_date prefix="send_enddate" field_order="YMD" month_format="%m"  day_value_format="%02d" start_year="-1" end_year="+10" display_days=yes time=$end_datelist}
      </td>
    </tr>
  {else}
    <tr>
      <td class="label">{$lang.send_enddate}</td>
      <td>
        {html_select_date prefix="send_enddate" field_order="YMD" month_format="%m"  day_value_format="%02d" start_year="-1" end_year="+10" display_days=yes time=$bonus_arr.send_enddate}
      </td>
    </tr>
  {/if}
  <tr>
    <td class="label">{$lang.use_startdate}</td>
    <td>
      {html_select_date prefix="use_startdate" field_order="YMD" month_format="%m"  day_value_format="%02d" start_year="-1" end_year="+10" display_days=yes time=$bonus_arr.use_startdate}
    </td>
  </tr>
{if $action eq "add"}
  <tr>
    <td class="label">{$lang.use_enddate}</td>
    <td>
    {html_select_date prefix="use_enddate" field_order="YMD" month_format="%m"  day_value_format="%02d" start_year="-1" end_year="+10" display_days=yes time=$end_datelist}
    </td>
  </tr>
{else}
  <tr>
    <td class="label">{$lang.use_enddate}</td>
    <td>
    {html_select_date prefix="use_enddate" field_order="YMD" month_format="%m"  day_value_format="%02d" start_year="-1" end_year="+10" display_days=yes time=$bonus_arr.use_enddate}
    </td>
  </tr>
 {/if}
  <tr>
    <td class="label">&nbsp;</td>
    <td>
      <input type="submit" value="{$lang.button_submit}" class="button" />
      <input type="reset" value="{$lang.button_reset}" class="button" />
      <input type="hidden" name="act" value="{$form_act}" />
      <input type="hidden" name="type_id" value="{$bonus_arr.type_id}" />
    </td>
  </tr>
</table>
</form>
</div>
{insert_scripts files="../js/utils.js,validator.js"}
{literal}
<script language="javascript">
<!--
document.forms['theForm'].elements['type_name'].focus();
/**
 * 检查表单输入的数据
 */
function validate()
{
    validator = new Validator("theForm");
    validator.required("type_name",      type_name_empty);
    validator.required("type_money",     type_money_empty);
    validator.isNumber("type_money",     type_money_isnumber, true);
    return validator.passed();
}
onload = function()
{
    {/literal}
        get_value = '{$bonus_arr.send_type}';
    {literal}

    showunit(get_value)
    // 开始检查订单
    startCheckOrder();
}
/* 红包类型按订单金额发放时才填写 */
function gObj(obj)
{
    var theObj;
    if (document.getElementById)
    {
        if (typeof obj=="string")
        {
            return document.getElementById(obj);
        }else{
            return obj.style;
        }
    }
    return null;
}

function showunit(get_value)
{
    if (get_value == 2){
        gObj("1").style.display = "";
    }else{
        gObj("1").style.display = "none";
    }

    var sel = document.forms['theForm'].getElementsByTagName("select");

    for (i = 0; i < sel.length; i++)
    {
      if (sel[i].name.substr(0,5) == "send_")
      {
        sel[i].disabled = (get_value != 1 && get_value != 2);
      }
    }
}
//-->
</script>
{/literal}
{include file="pagefooter.htm"}