<!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=UTF-8" />
<title>友情链接管理</title>
<link href="../css/admin_css.css" rel="stylesheet" type="text/css" />
</head>

<body>
<div>
<table border="1" width="100%"  align="center">
<?php
if ($action=='add' ||$action=='m') {
	$action=='add' ? $action_str= '?action=ins' :  $action_str= '?action=up&id='.$id ;
	$action=='m' ?  $l_review == 1 ? $l_review_checked1 = 'checked' : $l_review_checked0 = 'checked' : $l_review_checked0 = 'checked';
	print <<<EOT
	<tr align="center"><td>
<form action="$action_str" method="POST" enctype="multipart/form-data">
 	名称:<input type="text"  value="$l_title"  name="l_title" size="65" ></br>
 	网址:<input type="text"  value="$l_url"  name="l_url" size="65" ></br>
	logo:<input type="text"  value="$l_img_url"  name="l_img_url" size="65" ></br>
 	排序:<input type="text"  value="$l_sort"  name="l_sort" size="65" ></br>
 	简介:
 	<textarea name="l_presentation"  rows="10" cols="50">$l_presentation</textarea></br>
 	审核:<input type="radio" name="l_review" value="1" $l_review_checked1 />审核
	<input type="radio" name="l_review" value="0" $l_review_checked0/>未审核</br>
 	<input type="submit" value=" 完 成 " >
	</form>
	</td>
</tr>
	</table>
EOT;
}
else{
	print <<<EOT
	
	<tr  align="center">
<td colspan="7"><a href="?action=add">添加新连接</a></td>
</tr>
<tr>
<td width="5%"><b>I D</b></td>
<td width="20%"  align="center"><b>网站名称</b></td>
<td width="30%"  align="center"><b>网址</b></td>
<td width="20%"  align="center"><b>LOGO</b></td>
<td width="5%"   align="center"><b>排序</b></td>
<td width="10%"  align="center"><b>审核</b></td>
<td width="10%"  align="center"><b>操作</b></td>
</tr>
EOT;

	while ($List =  sql_return($query,'FetchRow')){
		$l_id = $List['l_id'];
		$l_title = $List['l_title'];
		$l_url = $List['l_url'];
		$l_presentation = $List['l_presentation'];
		$l_sort = $List['l_sort'];
		$List['l_review'] ? $l_review = '已审核' :  $l_review = '未审核';
		$List['l_img_true'] ? $l_img_url = "<IMG SRC=\"".$List['l_img_url']."\" width=88 hight=31>"
		:	$l_img_url = '非圖片鏈接';
		print <<<EOT
<tr>
<td>$l_id</td>
<td align="left"><a href="http://$l_url">$l_title</a></td>
<td align="center"><a href="http://$l_url" target="_blank">$l_url</a></td>
<td align="center">$l_img_url</td>
<td align="center">$l_sort</td>
<td align="center">$l_review</td>
<td align="center"><a href="?action=m&id=$l_id">修改</a>  <a href="?action=del&id=$l_id">删除</a></td>
</tr>
<tr>
<td colspan="7">$l_presentation</td>
</tr>
EOT;
}
print <<<EOT
</table>


EOT;
}
?>

</div>
</body>
</html>
