{include "header.inc.html"}
{$addrLang = $lang.admin.addr.form}
<div class="content_box">
	<div class="toolbar_box">
		<div class="toolbar"> <span> <strong>{$lang.admin.user.name}</strong><br />
		<span class="english">{$lang.admin.user.name_en}</span> </span> </div>
	</div>
<div class="userForm">
<form class="form" action="" method="post">
 {if $smarty.get.act=="edit" || $smarty.get.act=="add"}
<input type="hidden" name="act" value="{$smarty.get.act}" />
{if $smarty.get.act=="edit"}
<input type="hidden" name="id" value="{$smarty.get.id}" />
{/if}
{if $config.user.loginName}
<div class="form-line">
<label class="label">{$lang.admin.user.form.loginName}：</label><div class="element"><input type="text" class="text w200 readonly" name="loginName" value="{$addrInfo.userInfo.loginName}" {if $smarty.get.act!="add"} readonly{/if} /></div>
</div>
{/if}
{if $cfg_lang=="zh-cn"}
<div class="form-line">
<label class="label">{$addrLang.name}：</label><div class="element"><input type="text" class="text w200" name="name" value="{$addrInfo.name}" /></div>
</div>
{else}
<div class="form-line">
<label class="label">{$addrLang.firstName}：</label><div class="element"><input type="text" class="text w200" name="firstName" value="{$addrInfo.firstName}" /></div>
</div>
<div class="form-line">
<label class="label">{$addrLang.lastName}：</label><div class="element"><input type="text" class="text w200" name="lastName" value="{$addrInfo.lastName}" /></div>
</div>
{/if}

<div class="form-line">
<label class="label">{$addrLang.comName}：</label><div class="element"><input type="text" class="text w200" name="comName" value="{$addrInfo.comName}" /></div>
</div>
<div class="form-line">
<label class="label">{$addrLang.address}：</label><div class="element"><input type="text" class="text w200" name="address" value="{$addrInfo.address}" /><br /><input type="text" class="text w200" name="suburb" value="{$addrInfo.suburb}" /></div>
</div>
<div class="form-line">
<label class="label">{$addrLang.zipCode}：</label><div class="element"><input type="text" class="text w200" name="zipCode" value="{$addrInfo.zipCode}" /></div>
</div>
{if $cfg_lang!="zh-cn"}
<div class="form-line">
<label class="label">{$addrLang.city}：</label><div class="element"><input type="text" class="text w200" name="city" value="{$addrInfo.city}" /></div>
</div>
<div class="form-line">
<label class="label">{$addrLang.province}：</label><div class="element"><input type="text" class="text w200" name="province" value="{$addrInfo.province}" /></div>
</div>
<div class="form-line">
<label class="label">{$addrLang.country}：</label><div class="element"><input type="text" class="text w200" name="country" value="{$addrInfo.country}" /></div>
</div>
{else}
<div class="form-line">
<label class="label">{$addrLang.mobile}：</label><div class="element"><input type="text" class="text w200" name="mobile" value="{$addrInfo.mobile}" /></div>
</div>
<div class="form-line">
<label class="label">{$addrLang.phone}：</label><div class="element"><input type="text" class="text w200" name="phone" value="{$addrInfo.phone}" /></div>
</div>
{/if}
<div class="form-line">
<label class="label"></label><div class="element"><input class="btn_sub" type="submit" value="{$lang.form.submit}"></div>
</div>
</form>
</div>
 {else}
<div class="tool">
<form action="{$adminUrl}goods/act/list/" method="post" class="form">
<label class="label">{$lang.form.search}：</label><input type="text" name="key" value="{$key}" /><input class="btn_sub" type="submit" value="{$lang.form.search}">
</form>
<div class="clear"></div>
</div>


 <table class="table-ca table_1" id="tInfo">
 <tr>
<th class="w60">{$lang.form.id}</th><th class="">用户ID</th><th class="w100">{$addrLang.receiver}</th><th>{$addrLang.comName}</th><th>{$addrLang.address}</th><th class="w80">{$addrLang.zipCode}</th><th>{$addrLang.city}</th><th class="w100">{$addrLang.province}</th><th>{$addrLang.country}</th><th class="w130">{$lang.form.posttime}</th><th class="w100">{$lang.form.operate}</th>
 </tr>
{useraddr limit=15 key="$key"}
<tr>
<td>{$item.id}</td><td><div class="w100 nowrap J-user-anchor" sid="{$item.userId}">{$item.userId}</div></td>
<td>{if $cfg_lang=="zh-cn"}{$item.name}{else}{$item.firstName} {$item.lastName}{/if}</td>
<td>{$item.comName}</td>
<td>{$item.address}</td>
<td>{$item.zipCode}</td>
<td>{$item.city}</td>
<td>{$item.province}</td>
<td>{$item.country}</td>
<td>{$item.posttime|date_format:"Y-m-d H:i:s"}</td><td><a href="{$adminUrl}useraddr/act/edit/id/{$item.id}" class="modBtn" title="{$lang.edit}">{$lang.edit}</a> <a href="javascript:void(0)" class="delBtn" sid="{$item.id}" title="{$lang.del}">{$lang.del}</a></td>
</tr>
{/useraddr}
</table>
<div class="page">
{$key=$key|escape:"url"}
{if $key}
{$key = "/key/$key"}
{/if}
	<div class="pagin fr">{pager allCount=$allCount url='/qkadmin/user$key/page/' number="false"}</div>
</div>
{/if}
</div><!--.content_box-->
<script type="text/javascript">
$(function(){
	$(".delBtn").click(function(){
		if(!confirm(lang[4])){ return false; }
		var id = $(this).attr("sid");
		var tr = $(this).parent("td").parent("tr");
		if(!id || !parseInt(id)){ return false; }
		$.ajax({
			type:"POST",
			url:"{$adminUrl}useraddr",
			data:"inajax=1&act=del&id="+id,
			dataType:"json",
			success:function(json){
				if(json.success){
					tr.slideUp().remove();
				}else{
					qlib.tips(json.message);
				}
			}
		})
	});
});
</script>
{include "footer.inc.html"}