{include "header.inc.html"}
<div class="content_box">
	<div class="toolbar_box">
		<div class="toolbar"> <span> <strong>{$lang.admin.seopage.name}</strong><br />
		<span class="english">{$lang.admin.seopage.name_en}</span> </span> </div>
	</div>
 {if $smarty.get.act=="edit" || $smarty.get.act=="add"}
<div class="hotkeyForm">
<form class="form" action="" method="post" id="form-seopage">
<input type="hidden" name="act" value="{$smarty.get.act}" /><input type="hidden" name="inajax" value="1" />
{if $smarty.get.act=="edit"}<input type="hidden" name="id" value="{$seoPageInfo.id}" />{/if}
<div class="form-line">
<label class="label">{$lang.admin.seopage.form.name}：</label><div class="element"><input type="text" class="text w200" name="name" value="{$seoPageInfo.name}" /></div>
</div>
<div class="form-line">
<label class="label">{$lang.seo.title}：</label><div class="element"><textarea name="title">{$seoPageInfo.title}</textarea></div>
</div>
<div class="form-line">
<label class="label">{$lang.seo.keywords}：</label><div class="element"><textarea name="keywords">{$seoPageInfo.keywords}</textarea></div>
</div>
<div class="form-line">
<label class="label">{$lang.seo.description}：</label><div class="element"><textarea name="description">{$seoPageInfo.description}</textarea></div>
</div>
<div class="form-line">
<label class="label"></label><div class="element"><input class="btn_sub" type="submit" value="{$lang.form.submit}"></div>
</div>
</form>
</div>
 {else}
 <table class="table-ca table_1" id="tInfo">
 <tr>
<th class="w30">{$lang.form.id}</th><th class="w80">{$lang.admin.seopage.form.name}</th><th class="">{$lang.seo.title}</th><th class="w300">{$lang.keywords}</th><th class="w300">{$lang.seo.description}</th><th class="w70">{$lang.form.posttime}</th><th class="w60">{$lang.form.operate}</th>
 </tr>
{seopages limit="false"}
<tr>
<td>{$item.id}</td><td>{$item.name}</td><td>{$item.title}	</td><td>{$item.keywords}</td><td>{$item.description}</td><td>{$item.posttime|date_format:"Y-m-d"}</td><td><a href="{$adminUrl}seopage/act/edit/id/{$item.id}" class="modBtn" title="{$lang.edit}">{$lang.edit}</a> <a href="javascript:void(0)" title="{$lang.del}" class="delBtn" sid="{$item.id}">{$lang.del}</a></td>
</tr>
{/seopages}
</table>
<script type="text/javascript">
$(function(){
	$(".delBtn").click(function(){
		if(!confirm(lang[4])){ return false; }
		var id = $(this).attr("sid");
		var tr = $(this).parent("td").parent("tr");
		$.ajax({
			type:"POST",
			url:"{$adminUrl}seopage",
			data:"inajax=1&act=del&id="+id,
			dataType:"json",
			success:function(json){
				if(json.success){
					tr.remove();Msg("删除成功");
				}else{
					alert(json.message);
				}
			}
		})
	});
});
</script>
{/if}
</div><!--.content_box-->
<script type="text/javascript">
$(function(){
	$('#form-seopage').ajaxForm({ dataType:'json',success:function(json){ if(json.success){ qlib.tips({ icon:'success',msg:json.message});if($('#form-seopage input[name="act"]').val()=='add'){ $('#form-seopage').find('input[type="text"],textarea').val(''); } }else{ qlib.tips({ icon:'error',msg:json.message }); } },error:function(){ qlib.tips('Ajax处理失败'); }});
});
</script>
{include "footer.inc.html"}