<table class="etable"> 
	<tr>
		<td width="100">所属分类：</td>
		<td>
			<select name="pcid">
				<option value="0">--顶级分类--</option>
<{foreach item=i from=$cats}> 
				<option value="<{$i.cid}>" <{if $i.cid == $row.pcid}>selected="selected"<{/if}>><{$i.name}></option> 
<{/foreach}>				
			</select> 
		</td>
	</tr>
	<tr>
		<td>名称：</td>
		<td><input name="name" type="text" size="38" value="<{$row.name}>" id="name"></td>
	</tr>
	<tr>
		<td>别名：</td>
		<td><input name="alias" type="text" size="38" value="<{$row.alias}>" id="alias"></td>
	</tr>
	<tr>
		<td>排序：</td>
		<td><input name="px" type="text" size="15" value="<{$row.px}>" id="px"></td>
	</tr> 
	<tr> 
		<td>状态：</td>
		<td>
		<label><input type="radio" value="1" name="status" <{if $smarty.get.a == 'cats_add' || $row.status == 1}>checked="checked"<{/if}>/>开启</label>
		<label><input type="radio" value="0" name="status" <{if $row.status == '0'}>checked="checked"<{/if}>/>关闭</label>
		</td>
	</tr> 
</table> 
<script type="text/javascript">
function ajax_submit(){ 
	var name = $("#name").val();
	if(name == ''){ 
		$.alert('名称不能为空'); return false; 
	} 
	var pcid = $('select[name="pcid"]').val(); 
	var alias = $("#alias").val();
	var px = $("#px").val();
	var status = $('input[name="status"]:checked').val();
	$.post('?m=news&a=cats_save',{<{if $row.cid}>cid:<{$row.cid}>, <{/if}>pcid:pcid, alias:alias, name:name, px:px, status:status},function(result){
		data = jQuery.parseJSON(result); 
		if(data.error == '0'){
			parent.ajax_flush(); 
			parent.ajax_close();
		}else{
			$.alert(data.msg);
		}
	}); 
} 
</script>