{include file="page_header.htm"}
{insert_scripts files="../js/utils.js"}
<form enctype="multipart/form-data" name="theForm" action="shipping.php" method="post" onsubmit="return validate()">
<table width="100%"  border="0" cellspacing="0" cellpadding="0" class="table_form1" >	
<tr>
<td width="17%">费用计算方式:</td>
<td>
<label><input type="radio" {if $fields.fee_compute_mode == 'by_number'}checked{/if} onclick="compute_mode('by_number')" name="fee_compute_mode" value="by_number" /> 按产品件数计算</label>
<label><input type="radio" {if $fields.fee_compute_mode == 'by_weight'}checked{/if} onclick="compute_mode('by_weight')" name="fee_compute_mode" value="by_weight" /> 按重量计算 </label>
</td>
</tr>
<tr id="item_fee_box">
<td width="17%"><a href="#" title="每一件产品多少运费" style="margin-right:5px;" ><img src="images/help.gif" border="0" alt=""/></a>	单件费用:</td>
<td>
<input type="text" name="item_fee" id="item_fee" class="FormSmall" maxlength="60" size="40" value="{$fields.item_fee}" /> 元 <span class="required">&nbsp;</span>
	
</td>
</tr>

<tr id="base_fee_box">
<td width="17%"><a href="#" title="产品1000克以内多产运费" style="margin-right:5px;" ><img src="images/help.gif" border="0" alt=""/></a>1000克以内费用:</td>
<td>
<input type="text" name="base_fee" id="base_fee" class="FormSmall" maxlength="60" size="40" value="{$fields.base_fee}" /> 元 <span class="required">&nbsp;</span>
	
</td>
</tr>

<tr id="step_fee_box">
<td width="17%"><a href="#" title="产品每超过1000克多少运费" style="margin-right:5px;" ><img src="images/help.gif" border="0" alt=""/></a>续重每1000克费用:</td>
<td>
<input type="text" name="step_fee" id="step_fee" class="FormSmall" maxlength="60" size="40" value="{$fields.step_fee}" /> 
元 <span class="required">&nbsp;</span> 		
</td>
</tr>

<tr>
<td width="17%"><a href="#" title="产品金额达到多少免运费" style="margin-right:5px;" ><img src="images/help.gif" border="0" alt=""/></a>	免费额度:</td>
<td>
<input type="text" name="free_money" id="free_money" class="FormSmall" maxlength="60" size="40" value="{$fields.free_money}" /> 
元 <span class="required">&nbsp;</span> 				
</td>
</tr>	


<tr>
<td style="border:none;"></td>
<td style="border:none;">
<input type="hidden" name="act" value="update" />
<input type="hidden" id="id" name="id" value="{$shipping.shipping_id}" />
<input type="submit" value="提交" class="bginput" />
<input type="reset" value="重置" class="bginput" />
</td>
</tr> 
</table>
</form>

<script type="text/javascript">
{literal}
function compute_mode(mode){
	if(mode == 'by_number'){
		$("#item_fee_box").show();
		$("#base_fee_box").hide();
		$("#step_fee_box").hide();
	}else{
		$("#item_fee_box").hide();
		$("#base_fee_box").show();
		$("#step_fee_box").show();
	}
}
{/literal}
compute_mode('{$fields.fee_compute_mode}');
{literal}

function validate(){
	CheResult = true;
	firstErrorControl = "";
	var fee_compute_mode = $("input:[name=fee_compute_mode]:radio:checked").val();

	if(fee_compute_mode == 'by_weight'){
		validator.required('base_fee', '请输入1000克以内费用.');
		validator.required('step_fee', '续重每1000克或其零数的费用.');
		return false;
	}

	if(fee_compute_mode == 'by_number'){
		validator.required('item_fee', '请输入单件商品费用.');
	}	
	
	validator.required('free_money', '免费额度.');


	return validator.passed();
}
{/literal}
</script>
{insert_scripts files="validator.js"}
{include file="page_footer.htm"}