<table width="100%" class="etable"> 
	<tr>
		<td width="80px">类型：</td>
		<td>
			<select name="pcid">
				<option value="0">顶级分类</option>
					<{section name=c loop=$cats}>			
						<option value="<{$cats[c].cid}>" <{if $row.pcid == $cats[c].cid}>selected="selected"<{/if}>><{$cats[c].name}></option>
					<{/section}>
			</select>
		</td>
	</tr>  
	<tr>
		<td>名称：</td>
		<td><input name="name" type="text" size="30" id="name" value="<{$row.name}>"><i>必填</i></td>
	</tr>  
	<tr>
		<td>英文名：</td>
		<td><input name="alias" type="text" size="30" id="alias" value="<{$row.alias}>"/></td>
	</tr> 
	<tr>
		<td>排序：</td>
		<td><input name="px" type="text" size="5" id="px" value="<{if $smarty.get.cid}><{$row.px}><{else}>0<{/if}>"></td>
	</tr> 
	<tr>
		<td>状态：</td>
		<td>
			<label><input name="status" type="radio" value="1" id="status" <{if $row.status == '1' || $smarty.get.cid == ''}>checked="checked"<{/if}> class="status"/> 开启</label>&nbsp; &nbsp; 
			<label><input name="status" type="radio" value="0" id="status" <{if $row.status == '0'}>checked="checked"<{/if}> class="status"/> 关闭</label>
		</td>
	</tr>
</table> 
<script type="text/javascript">
function ajax_submit(){ 
	var cid = $("#cid").val();
	var pcid = $('select[name="pcid"]').val(); 
	var name = $("#name").val();
	var alias = $("#alias").val(); 
	var px = $("#px").val();
	var status = $('input[name="status"]:checked').val(); 
	if(name == ''){ alert('名称不能为空'); return false; } 
	$.ajax({
		type: 'POST',
		url: '?m=category_com&a=edit_save', 
		data: {<{if $row.cid}>cid:<{$row.cid}>, <{/if}>pcid:pcid, name:name, alias:alias, px:px, status:status},
		success: function(result){
			var data = jQuery.parseJSON(result); 
			if(data.error == '0'){
				parent.ajax_flush('?m=category_com&a=index');
				parent.ajax_close();
			}else{
				alert(data.msg);
			} 
		}
	});  
}
</script>