<?php
	!defined('IN_MANAGE') && exit('Access Denied!');
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
<link href="admin/template/images/tm_right.css" type="text/css" rel="stylesheet" />
<link href="statics/ui-jquery/jquery-ui.css" type="text/css" rel="stylesheet" />
<title>网站管理后台</title>
<script language="javascript" src="statics/ui-jquery/jquery-1.8.3.js"></script>
<script language="javascript" src="statics/ui-jquery/jquery-ui.js"></script>
<script language="javascript" src="admin/template/images/tm-core.js"></script>
<script language="javascript" type="text/javascript">
	$(document).ready(function(){
		$('#status').val('<?php echo $status;?>');
	});
</script>
</head>

<body>
	<div class="status-tips">统计：共有 <font style="font-size:14px;font-weight:bold;color:#0000ff">友情链接</font> <a style="color:#FF0000" href="?mod=<?php echo $mod;?>&file=<?php echo $file;?>&action=manage"><?php echo $linkobj->linkstatis(-1);?></a>个，其中：
	正常开通<a style="color:#FF0000" href="?mod=<?php echo $mod;?>&file=<?php echo $file;?>&action=manage&status=1"><?php echo $linkobj->linkstatis(1);?></a>个，
	暂时关闭<a style="color:#FF0000" href="?mod=<?php echo $mod;?>&file=<?php echo $file;?>&action=manage&status=0"><?php echo $linkobj->linkstatis(0);?></a>个
	
	</div>
	<div class="seatch-tips">
	<form action="?" method="get" name="mysearchform">
	<input type="hidden" name="mod" value="<?php echo $mod;?>" />
	<input type="hidden" name="action" value="<?php echo $action;?>" />
	<input type="hidden" name="file" value="<?php echo $file;?>" />
	状态：<select name="status" id="status">
	<option value="-1">不限</option>
	<option value="1">正常</option>
	<option value="0">待审核</option>
	</select>
	申请日期：
	<?php echo $formobj->datetime('info','starttime',$starttime?$starttime:TIME-3600*24);?> ~ <?php echo $formobj->datetime('info','endtime',$endtime?$endtime:TIME);?>
	友链名称：<input type="text" name="k" size="4" value="" class="input-txt" />
	<input type="submit" value="查找" class="save-btn-small" />
	</form>
	</div>
	<div class="manage-tips">
	<p>
	<a href="###" onclick="if(ischecked()){$('#job').val('settop');$('#myform').submit();}else{alert('请选择要'+$(this).html()+'的项目！')}" class="pass">推荐友链</a>
	&nbsp;
	<a href="###" onclick="if(ischecked()){$('#job').val('unsettop');$('#myform').submit();}else{alert('请选择要'+$(this).html()+'的项目！')}" class="del">取消推荐</a>
	&nbsp;
	<a href="###" onclick="if(ischecked()){$('#job').val('pass');$('#myform').submit();}else{alert('请选择要'+$(this).html()+'的项目！')}" class="pass">审核</a>
	&nbsp;
	<a href="###" onclick="if(ischecked()){$('#job').val('unpass');$('#myform').submit();}else{alert('请选择要'+$(this).html()+'的项目！')}" class="del">待审</a>
	&nbsp;
	<a href="###" onclick="if(ischecked()){$('#job').val('delete');$('#myform').submit();}else{alert('请选择要'+$(this).html()+'的项目！')}"  class="del">删除</a>
	</p>
	</div>
	<form action="" method="post" name="myform" id="myform">
	<input type="hidden" name="do_submit" value="1" />
	<input type="hidden" name="movetotypeid" id="movetotypeid" value="0" />
	<input type="hidden" name="mod" value="<?php echo $mod;?>" />
	<input type="hidden" name="action" value="<?php echo $action;?>" />
	<input type="hidden" name="file" value="<?php echo $file;?>" />
	<input type="hidden" name="job" id="job" value="settop" />
	<table class="table-list" cellpadding="1" cellspacing="1">
		<tr>
			<th><input id="checkAll" name="全选/反选" type="checkbox" /></th>
			<th>ID</th>
			<th>链接名称</th>
			<th>属性</th>
			<th>链接URL</th>
			<th>申请日期</th>
			<th>分类</th>
			<?php if(SITETYPE){?><th>分站</th><?php }?>
			<th>状态</th>
			<th>操作</th>
		</tr>
		<?php if($result){?>
		<?php foreach($result as $no => $r){?>
		<tr id="tr_<?php echo $r['id'];?>" <?php echo ($no%2)?'':'class="light"';?>>
			<td><input type="checkbox" name="id[]" la="checkbox" value="<?php echo $r['id'];?>" /></td>
			<td><?php echo $r['id'];?></td>
			<td name="<?php echo $r['name'];?>" style="text-align:left"><?php echo $r['thumb']?'<font style="color:#ff0000">[图]</font>':'';?><a href="<?php echo $r['url'];?>" target="_blank"><?php echo sub_string($r['name'],20,'...');?></a></td>
			<td> <?php echo $r['istop']?'<font style="color:#009900">[推荐]</font>':'-';?> </td>
			<td><?php echo $r['url'];?></td>
			<td><?php echo date('Y-m-d',$r['inputtime']);?></td>
			<td><?php echo link_typename($r['typeid']);?></td>
			<?php if(SITETYPE){?><td><?php echo $siteidobj->sitename($r['siteid']);?></td><?php }?>
			<td><?php echo $r['status']?'<font style="color:#009900">正常</font>':'<font style="color:#ff0000">已关闭</font>';?></td>
			<td><a href="?mod=<?php echo $mod;?>&file=<?php echo $file;?>&action=edit&id=<?php echo $r['id'];?>">编辑</a></td>
		</tr>
		<?php }?>
		<tr class="page">
			<td colspan="<?php echo SITETYPE?'11':'10';?>">
			<?php echo $linkobj->pagestring;?>
			</td>
		</tr>
		<?php }else{echo '<tr class="light"><td colspan="'.(SITETYPE?'11':'10').'">暂无数据</td></tr>';}?>
		</form>
	</table>
</body>
</html>
