{include "header.inc.html"}
{$dlang=$lang.admin.deliverytype.form}
<div class="content_box">
	<div class="toolbar_box">
		<div class="toolbar"> <span> <strong>{$lang.admin.deliverytype.name}</strong><br />
		<span class="english">{$lang.admin.deliverytype.name_en}</span> </span> </div>
	</div>
	<div class="tool">
<a class="ui-btn" id="J-add-type">添加配送方式</a>
	</div>
<div class="adminForm{if $smarty.get.act!='edit'} none{/if}">
<form class="form" action="{$adminUrl}deliverytype" method="post" id="dataForm">
<input type="hidden" name="act" value="{$smarty.get.act|default:'add'}" /><input type="hidden" name="inajax" value="1" />
{if $smarty.get.act=="edit"}
<input type="hidden" name="id" value="{$smarty.get.id}" />
{/if}
<div class="form-line">
<label class="label">{$dlang.name}：</label><div class="element"><input type="text" class="text w200" name="name" value="{$deliveryTypeInfo.name}" /></div>
</div>
<div class="form-line">
<label class="label">{$dlang.corp}：</label><div class="element"><select name="corpId"><option value="0">{$dlang.corp}</option>
{deliverycorp iStatus=1}
<option value="{$item.id}"{if $deliveryTypeInfo.corpId==$item.id} selected{/if}>{$item.name}</option>
{/deliverycorp}
</select></div>
</div>
<div class="form-line">
<label class="label">{$lang.form.sort}：</label><div class="element"><input type="text" class="text w200" name="sortId" value="{$deliveryTypeInfo.sortId|default:50}" /></div>
</div>
<div class="form-line">
<label class="label">{$dlang.weight}：</label><div class="element">
{$dlang.firstHeavy} <select name=firstunit>
<option label=500克 value=500{if $deliveryTypeInfo.config.firstunit==500} selected{/if}>500克</option>
<option label=1公斤 value=1000{if $deliveryTypeInfo.config.firstunit==1000} selected{/if}>1公斤</option>
<option label=1.2公斤 value=1200{if $deliveryTypeInfo.config.firstunit==1200} selected{/if}>1.2公斤</option>
<option label=2公斤 value=2000{if $deliveryTypeInfo.config.firstunit==2000} selected{/if}>2公斤</option>
<option label=5公斤 value=5000{if $deliveryTypeInfo.config.firstunit==2000} selected{/if}>5公斤</option>
<option label=10公斤 value=10000{if $deliveryTypeInfo.config.firstunit==10000} selected{/if}>10公斤</option>
<option label=20公斤 value=20000{if $deliveryTypeInfo.config.firstunit==20000} selected{/if}>20公斤</option>
<option label=50公斤 value=50000{if $deliveryTypeInfo.config.firstunit==50000} selected{/if}>50公斤</option>
</select>
{$dlang.continueHeavy} <select name=continueunit>
<option label=500克 value=500{if $deliveryTypeInfo.config.continueunit==500} selected{/if}>500克</option>
<option label=1公斤 value=1000{if $deliveryTypeInfo.config.continueunit==1000} selected{/if}>1公斤</option>
<option label=1.2公斤 value=1200{if $deliveryTypeInfo.config.continueunit==1200} selected{/if}>1.2公斤</option>
<option label=2公斤 value=2000{if $deliveryTypeInfo.config.continueunit==2000} selected{/if}>2公斤</option>
<option label=5公斤 value=5000{if $deliveryTypeInfo.config.continueunit==2000} selected{/if}>5公斤</option>
<option label=10公斤 value=10000{if $deliveryTypeInfo.config.continueunit==10000} selected{/if}>10公斤</option>
<option label=20公斤 value=20000{if $deliveryTypeInfo.config.continueunit==20000} selected{/if}>20公斤</option>
<option label=50公斤 value=50000{if $deliveryTypeInfo.config.continueunit==50000} selected{/if}>50公斤</option>
</select></div>
</div>
<div class="form-line">
<label class="label">{$dlang.price}：</label><div class="element">
	{$dlang.firstPrice} <input type="text" class="text w50" name="firstprice" value="{$deliveryTypeInfo.config.firstprice}" />
	{$dlang.continuePrice} <input type="text" class="text w50" name="continueprice" value="{$deliveryTypeInfo.config.continueprice}" />
	</div>
</div>
<div class="form-line">
<label class="label">{$dlang.className}：</label><div class="element"><input type="text" class="text w100" name="className" value="{$deliveryTypeInfo.className}" /></div>
</div>
<div class="form-line">
<label class="label">{$lang.form.iStatus}：</label><div class="element">
<input type="radio" class="" name="iStatus" id="iStatus1" value="1"{if (not isset($deliveryTypeInfo)) or $deliveryTypeInfo.iStatus==1} checked="checked"{/if} /> <label for='iStatus1'>{$dlang.yes}</label>
<input type="radio" class="" name="iStatus" id="iStatus0" value="0"{if $deliveryTypeInfo and $deliveryTypeInfo.iStatus!=1} checked{/if} /><label for='iStatus0'> {$dlang.no}</label>
	</div>
</div>
<div class="form-line"><label class="label">{$lang.detail}：</label><div class="element"><textarea name="detail" style="width:350px;height:60px;">{$deliveryTypeInfo.detail}</textarea></div></div>

<div class="form-line">
<label class="label"></label><div class="element"><input type="submit" class="btn_sub" value="{$lang.form.submit}" /></div>
</div>
</form>
</div>
{if $smarty.get.act!='add' && $smarty.get.act!='edit'}
 <table class="table-ca table_1" id="tInfo">
 <tr>
<th class="w60">{$lang.form.id}</th><th>{$dlang.name}</th><th class="w50">{$lang.form.sort}</th><th class="w100">{$lang.form.iStatus}</th><th class="w120">{$lang.form.posttime}</th><th class="w100">{$lang.form.operate}</th>
 </tr>
{deliverytype limit=15 pager="true"}
<tr>
<td>{$item.id}</td><td>{$item.name}</td><td>{$item.sortId}</td>
<td><img src="/static/images/{if $item.iStatus==1}yes{else}no{/if}.gif"></td>
<td>{$item.posttime|date_format:"Y-m-d H:i:s"}</td><td><a href="{$adminUrl}deliverytype/act/edit/id/{$item.id}" class="modBtn">{$lang.edit}</a> <a href="{$adminUrl}deliverytype/act/del/id/{$item.id}" class="delLink delBtn">{$lang.del}</a></td>
</tr>
{/deliverytype}
</table>
<div class="page">
	<div class="pagin fr">{pager allCount=$allCount url='/qkadmin/deliverytype/page/' number="false"}</div>
</div>
{/if}
<script type="text/javascript">
$(function(){
	$('#J-add-type').click(function(){
		$(".adminForm").dialog({ modal:true,resizable:false,width:650,height:380,title:'添加物流方式' });
	});
	$('#dataForm').ajaxForm({ type:'POST',dataType:'json',success:function(json){ if(json.success){ qlib.tips({ icon:'success',msg:json.message});;if($("#dataForm input[name='act']").val()=='add'){ $("#dataForm").find("input[name='name'],input[name='website']").val('');location.reload();} }else{ qlib.tips({ icon:'error',msg:json.message });} },error:function(){ qlib.tips('Ajax处理失败'); } });

});
</script>
</div><!--.content_box-->
{include "footer.inc.html"}