{include file="header.tpl" page_name=$page_name sys_name=$sys_name}
<div align="center">
{$admin_nav}
{if $do == 'list' || $do ==''}
<table width="98%" border="0" cellpadding="0" cellspacing="0" class="tableborder tableborder_line">
<tr class="header">
<td>网站名称</td>
<td>网站Logo</td>
<td>Email</td>
<td>添加时间</td>
<td>状态</td>
<td>排序</td>
<td>操作</td>
</tr>
<tbody>
{if !$farr}
	<tr><td colspan="8" style="color:red;">没有任何链接</td></tr>
{else}
{section name=i loop=$farr}
	<tr>
	<td><a href="{$farr[i].url}" target="_blank">{$farr[i].name}</a></td>
	<td>{if $farr[i].logo}<img src="../{$farr[i].logo}" width="88" height="31" border="0">{/if}</td>
	<td>{$farr[i].email}</td>
	<td>{$farr[i].add_time}</td>
	<td>{if $farr[i].state == 1}<font color="green">已审核<font>{else}<font color="red">未审核</font>{/if}</td>
	<td>{$farr[i].order_num}</td>
	<td><a href="admincp.php?action=link&do=edit&id={$farr[i].id}">编辑</a> 
    <a href="admincp.php?action=link&do=state&id={$farr[i].id}&state={$farr[i].state}">{if $farr[i].state == 0}审核{else}锁定{/if}</a> <a href="admincp.php?action=link&do=delete&id={$farr[i].id}">删除</a></td>
	</tr>
{/section}
{/if}
<tr>
<td colspan="8">
&nbsp;&nbsp;{$show_page}</td>
</tr>
</tbody>
</table>
{/if}
{if $do == 'add' || $do == 'edit'}
{literal}
<script language="javascript">
	function chkForm(obj) {
		if (!obj.name.value) {
			alert('网站名称不能为空！');
			obj.name.focus();
			return false;
		}
		if (!obj.url.value) {
			alert('网站网址不能为空！');
			obj.url.focus();
			return false;
		}
	}
</script>{/literal}
<form action="admincp.php?action=link" enctype="multipart/form-data" method="post" name="frm" onsubmit="return chkForm(this);" autocomplete="off">
<input type="hidden" value="{$do}" name="task" />
<table width="98%" border="0" cellpadding="0" cellspacing="0" class="tableborder">
{if $do == 'edit'}<input type="hidden" name="data[id]" value="{$farr.id}">{/if}

<tbody>
	<tr>
		<td  class="one">网站名称：</td>
		<td><input type="text" name="data[name]" size=30 id="name" value="{$farr.name}">&nbsp;&nbsp;<font color=red>*</font></td>
	</tr>
	<tr>
		<td  class="one">网站网址：</td>
		<td><input type="text" name="data[url]" size=30 id="url" value="{$farr.url}">&nbsp;&nbsp;<font color=red>*</font></td>
	</tr>
	<tr>
		<td  class="one">网站LOGO：</td>
		<td valign="middle"><input type="text" name="data[logo]" size=30 id="logo" value="{$farr.logo}">&nbsp;{if $farr.logo}<img src="../{$farr.logo}"  width="200" height="50"/>{/if}</td>
	</tr>
	<tr>
		<td  class="one">上传LOGO：</td>
		<td><input name="upfile" type="file" value="pic" />
        </td>
	</tr>
	<tr>
		<td  class="one">网站介绍：</td>
		<td><textarea name="data[intro]" style="width:277px;height:60px;" id="intro">{$farr.intro}</textarea></td>
	</tr>
    	<tr>
		<td  class="one">排序：</td>
		<td><input name="data[order_num]"  value="{if $farr.order_num}{$farr.order_num}{else}0{/if}" /></td>
	</tr>
	<tr>
		<td  class="one">邮箱：</td>
		<td><input type="text" name="data[email]" size=30 id="email" value="{$farr.email}"></td>
	</tr>
	<tr>
		<td  class="one">网站类型：</td>
		<td><select name="data[tid]" id="tid">{section name=i loop=$tarr}
		<option value="{$tarr[i].id}"{if $tarr[i].id == $farr.tid} selected{/if}>{$tarr[i].name}</option>
		{/section}</select></td>
	</tr>
	<tr>
		<td  class="one">通过审核：</td>
		<td><input type="radio" name="data[state]" value="1" checked>是 <input type="radio" name="data[state]" value="0">否</td>
	</tr>
	<tr>
		<td colspan="2"><div align="center"><input type="submit" value=" 提交 "> &nbsp;<input type="button" value="返回" onclick="window.location.href='admincp.php?action=link'"/></div></td>
	</tr>
</tbody>
</table>
</form>
{/if}
{if $do == 'backincheck'}
<table width="100%" border="0" cellpadding="2" cellspacing="6"><tr><td><br /><br /><br /><br /><br /><br />
<table width="500" border="0" cellpadding="0" cellspacing="0" align="center" class="tableborder">
<tr class="header"><td>系统信息提示</td></tr><tr><td class="altbg2"><div align="center">
<br /><br /><br /><font color="red">备份恢复功能将覆盖原来的数据,您确认要导入备份数据?</font><br /><br /><br />
<form action="admincp.php?action=deal&type=db&do=recover&pre={$pre}" method="post">
<input type="submit" name="submit" value="确认导入备份"  />&nbsp;
<input type='button' value='返回继续操作' onclick='javascript:history.go(-1);' />
</form>
<br /><br /></div><br /><br />
</td></tr></table>
<br /><br /><br /><br /><br />
</td></tr></table>
{/if}
</div>
{include file="footer.tpl"}