<table class="etable"> 
	<tr>
		<td width="100px">名称：</td>
		<td><input type="text" name="name" size="30" id="name" value="<{$row.name}>"><i>必填</i></td>
	</tr>
	<tr>
		<td>别名：</td>
		<td><input type="text" name="alias" size="30" id="alias" value="<{$row.alias}>"/></td>
	</tr> 
	<{if $smarty.get.pid != ''}>
		<input type="hidden" name="pid" id="pid" value="<{$smarty.get.pid}>"/>
		<tr>
			<td>链接：</td>
			<td><input type="text" name="link" size="30" id="link" value="<{$row.link}>"/></td>
		</tr>
	<{/if}>
	<tr>
		<td>排序：</td>
		<td><input type="text" name="px" 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(){
	<{if $smarty.get.pid == ''}>
		var id = $("#id").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: '<{$__ADMIN__}>common/save', 
			data: {<{if $row.id}>id:<{$row.id}>,<{/if}> name:name, alias:alias, px:px, status:status},
			success: function(result){
				var data = jQuery.parseJSON(result); 
				if(data.error == '0'){ 
					parent.ajax_flush();
					parent.ajax_close();
				}else{
					alert(data.msg);
				} 
			}
		});  
	<{else}>
		var id 	= $("#id").val();
		var pid = $("#pid").val();
		var name = $("#name").val();
		var alias = $("#alias").val(); 
		var link = $("#link").val(); 
		var px = $("#px").val();
		var status = $('input[name="status"]:checked').val(); 
		if(name == ''){ 
			$.alert('名称不能为空'); return false; 
		} 
		$.ajax({
			type: 'POST',
			url: '<{$__ADMIN__}>common/save', 
			data: {<{if $row.id}>id:<{$row.id}>,<{/if}> pid:pid, name:name, alias:alias, link,link, px:px, status:status},
			success: function(result){
				var data = jQuery.parseJSON(result);
				if(data.error == '0'){
					parent.ajax_flush();
					parent.ajax_close();
				}else{
					alert(data.msg);
				} 
			}
		}); 
	<{/if}>
}
</script>