{include "header.inc.html"}
{$dlang=$lang.admin.deliverytype.form}
<div class="content_box">
	<div class="toolbar_box">
		<div class="toolbar"> <span> <strong>物流公司</strong><br />
		<span class="english">Delivery Corp</span> </span> </div>
	</div>
	<div class="tool">
		<a href="javascript:void(0)" class="ui-btn" id="J-add-deliverytype">添加物流公司</a>
	</div>

<div class="adminForm none">
<form class="form" action="" method="post" id="typeForm">
<input type="hidden" name="act" value="add" /><input type="hidden" name="inajax" value="1" />
<div class="form-line">
<label class="label">物流公司：</label><div class="element"><input type="text" class="text w200" name="name" value="{$deliveryCorpInfo.name}" autocomplete="off" /></div>
</div>
<div class="form-line">
<label class="label">网址：</label><div class="element"><input type="text" class="text w250" name="website" value="{$deliveryCorpInfo.className}" /></div>
</div>
<div class="form-line none">
<label class="label">{$lang.form.sort}：</label><div class="element"><input type="text" class="text w50" name="sortId" value="{$deliveryCorpInfo.sortId|default:50}" /></div>
</div>
<div class="form-line none">
<label class="label">{$lang.form.iStatus}：</label><div class="element">
<input type="radio" class="" name="iStatus" id="iStatus1" value="1"{if (not isset($deliveryCorpInfo)) or $deliveryCorpInfo.iStatus==1} checked="checked"{/if} /> <label for='iStatus1'>{$dlang.yes}</label>
<input type="radio" class="" name="iStatus" id="iStatus0" value="0"{if $deliveryCorpInfo and $deliveryCorpInfo.iStatus!=1} checked{/if} /><label for='iStatus0'> {$dlang.no}</label>
	</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>

 
 <table class="table-ca table_1" id="tInfo">
 <tr sid="{$item.id}">
<th class="w60">{$lang.form.id}</th><th>物流公司名称</th><th class="w250">网址</th><th class="w100">{$lang.form.operate}</th>
 </tr>
{deliverycorp limit=15 pager="true"}
<tr sid="{$item.id}">
<td>{$item.id}</td><td>{$item.name}</td>
<td>{$item.website}</td><td> <a href="javascript:void(0)" class="delBtn">{$lang.del}</a></td>
</tr>
{/deliverycorp}
</table>
<div class="page">
	<div class="pagin fr">{pager allCount=$allCount url='/qkadmin/deliverycorp/page/' number="false"}</div>
</div>

<script type="text/javascript">
$(function(){
	$(".delBtn").click(function(){
		if(!confirm(lang[4])){ return false; }
		var tr = $(this).parent("td").parent("tr");
		var id = tr.attr("sid");
		if(!id || !parseInt(id)){ return false; }
		$.ajax({
			type:"POST",
			url:"{$adminUrl}deliverycorp",
			data:"inajax=1&act=del&id="+id,
			dataType:"json",
			success:function(json){
				if(json.success){
					tr.slideUp().remove();
				}else{
					qlib.tips(json.message);
				}
			}
		})
	});
	$('#J-add-deliverytype').click(function(){
		$(".adminForm").dialog({ modal:true,resizable:false,width:650,height:260,title:'添加物流公司' });
	});
	$('#typeForm').ajaxForm({ type:'POST',dataType:'json',success:function(json){ if(json.success){ qlib.tips({ icon:'success',msg:json.message});$("#typeForm").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"}