<table class="etable"> 
	<{if !$row.id}>
	<tr>	
		<td width="80">类名：</td>
		<td>
			<select name="code" id="code">
				<option value="0">--选择类名--</option>
				<{foreach item=i from=$method}>
					<option value="<{$i}>"<{if $i == $row.code}> selected="selected"<{/if}>><{$i}></option>
				<{/foreach}>
			</select>
		</td>
	</tr> 
	<{/if}>
	<tr>
		<td width="80">名称：</td>
		<td><input type="text" name="name" value="<{$row.name}>" id="name" size="30"/></td>
	</tr>
	<tr>
		<td>排序：</td>
		<td><input type="text" name="px" value="<{$row.px}>" id="px" size="30"/></td>
	</tr> 
</table> 
<script type="text/javascript">
function ajax_submit(){
	var code = $("#code option:selected").val();
	if(code != '0'){
		var name = $("#name").val();
		var px = $("#px").val(); 
		$.post('?m=admin&a=func_mod_save',{
			<{if $row.id}>id:<{$row.id}>,<{/if}>
			<{if $smarty.get.pid}>pid:'<{$smarty.get.pid}>'<{else}>pid:'0'<{/if}>, 
			name:name, 
			code:code, 
			px:px
		},function(result){ 
			data = jQuery.parseJSON(result); 
			if(data.error == '0'){
				parent.$.alert('保存成功', function(){
					parent.ajax_flush();
					parent.ajax_close();
				});
			}else{
				parent.$.alert(data.msg);
			} 
		});	
	}else{
		alert('请选择模块');
	}
}
</script>