{include "header.inc.html"}
<div class="content_box">
	<div class="toolbar_box">
		<div class="toolbar"> <span> <strong>商品分类</strong><br />
		<span class="english"></span> </span> </div>
	</div>

<div class="tool">
<form action="{$adminUrl}taoke/cat/list" method="get" class="form">
<label class="label">搜索：</label>每页<input type="text" class="w40" name="limit" value="{$smarty.get.limit|default:20}" />条 上级类：<input type="text" name="parent" value="{$smarty.get.parent}" /> 关键字：<input type="text" name="key" value="{$smarty.get.key}" /> <input type="submit" class="btn_sub" value="{$lang.form.search}"> 
</form>
<div class="clr"></div>
</div><!--.tool-->
{if $smarty.get.act=="edit"}
<div class="adminForm">
<form  action="{$adminUrl}taoke/shop" method="post" class="form">
<div class="form-line"><label class="label"></label><div class="element"><input type="text" class="text" name="" value="" /></div></div>
<div class="form-line"><label class="label"></label><div class="element"><input type="text" class="text" name="" value="" /></div></div>
<div class="form-line"><label class="label"></label><div class="element"><input type="text" class="text" name="" value="" /></div></div>
<div class="form-line"><label class="label"></label><div class="element"><input type="text" class="text" name="" value="" /></div></div>
<div class="form-line"><label class="label"></label><div class="element"><input type="text" class="text" name="" value="" /></div></div>
<div class="form-line"><label class="label"></label><div class="element"><input type="text" class="text" name="" value="" /></div></div>
<div class="form-line"><label class="label"></label><div class="element"><input type="text" class="text" name="" value="" /></div></div>
<div class="form-line"><label class="label"></label><div class="element"><input type="text" class="text" name="" value="" /></div></div>
<div class="form-line"><label class="label"></label><div class="element"><input type="text" class="text" name="" value="" /></div></div>
<div class="form-line"><label class="label"></label><div class="element"><input type="text" class="text" name="" value="" /></div></div>
<div class="form-line"><label class="label"></label><div class="element"><input type="text" class="text" name="" value="" /></div></div>
<div class="form-line"><label class="label"></label><div class="element"><input type="text" class="text" name="" value="" /></div></div>
<div class="form-line"><label class="label"></label><div class="element"><input type="text" class="text" name="" value="" /></div></div>
<div class="form-line"><label class="label"></label><div class="element"><input type="text" class="text" name="" value="" /></div></div>
<div class="form-line"><label class="label"></label><div class="element"><input type="text" class="text" name="" value="" /></div></div>
</form>
</div>
{else}
 <table class="table-ca table_1" id="tInfo">
 <tr>
<th class="w60">编号</th><th class="w200">分类名</th><th class="w200">分类ID</th><th class="">上级分类</th><th class="w100">是否为父类</th><th class="w60">操作</th>
 </tr>
 {$lim = $smarty.get.limit|default:20}
{taobaocat limit=$lim pager="true"}
<tr>
<td>{$item.id}</td><td>{$item.name}</td><td>{$item.cid}</td><td>{$item.parent}</td><td><img src="{$adminUrl}images/{if $item.is_parent==1}yes{else}no{/if}.gif" width="14px" height="14px" />	</td><td><a href="{$adminUrl}taoke/shop/act/edit/id/{$item.id}" title="" class="edit"></a></td>
</tr>
{/taobaocat}
</table>
<div class="page">
{if $smarty.get.key}
{$key=$key|escape:'url'}
{$key = "&key=$key"}
{/if}
{if $parent=$smarty.get.parent}
{$parent=$parent|escape:'url'}
{$parent = "&parent=$parent"}
{/if}
	<div class="pagin fr">{pager allCount=$allCount url="/qkadmin/taoke/cat/list?$key$parent&page=" number="false"}</div>
</div>
</div><!--.content_box-->
{/if}
<script type="text/javascript">
$(function(){
	$("#updatecat").button().click(function(){
		var dia = $("<div>是否向淘宝同步所有分类？</div>").css({ fontSize:14 }).dialog({ modal:true,width:300,height:160,resizable:false,title:'确认更新分类',buttons:{
			"确认":function(e){
				dia.html('<img src="{$baseUrl}static/images/loading.gif" width="16px" height="16px" /> 正在同步，请稍候...');
				var btn = $(e.srcElement);
				btn.attr("disabled","disabled");
				$.ajax({
					type:"POST",
					url:"{$adminUrl}taoke/cat",
					data:"inajax=1&act=update",
					dataType:"json",
					success:function(json){
						if(json.success){
							dia.dialog("destroy");
						}else{
							dia.html(json.message);
							btn.removeAttr("disabled");
						}
					}
				});
				
			},
			"取消":function(){
				dia.dialog("destroy");
			}
		}
		});
	});
});
</script>
{include "footer.inc.html"}