<!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">
<title>文档管理</title>
<link href="css_body.css" rel="stylesheet" type="text/css" />
<script>
function selAll()
{
	for(i=0;i<document.form2.answerid.length;i++)
	{
		if(!document.form2.answerid[i].checked)
		{
			document.form2.answerid[i].checked=true;
		}
	}
}
function noSelAll()
{
	for(i=0;i<document.form2.answerid.length;i++)
	{
		if(document.form2.answerid[i].checked)
		{
			document.form2.answerid[i].checked=false;
		}
	}
}
//获得选中文件的文件名
function getCheckboxItem()
{
	var allSel="";
	if(document.form2.answerid.value) return document.form2.answerid.value;
	for(i=0;i<document.form2.answerid.length;i++)
	{
		if(document.form2.answerid[i].checked)
		{
			if(allSel=="")
				allSel=document.form2.answerid[i].value;
			else
				allSel=allSel+"`"+document.form2.answerid[i].value;
		}
	}
	return allSel;
}

//获得选中其中一个的id
function getOneItem()
{
	var allSel="";
	if(document.form2.answerid.value) return document.form2.answerid.value;
	for(i=0;i<document.form2.answerid.length;i++)
	{
		if(document.form2.answerid[i].checked)
		{
				allSel = document.form2.answerid[i].value;
				break;
		}
	}
	return allSel;
}
function checkanswer(aid){
	var qstr=getCheckboxItem();
	if(aid==0) aid = getOneItem();
	location="answeradmin.php?aid="+aid+"&action=check&qstr="+qstr;
}
function deleteanswer(aid){
	var qstr=getCheckboxItem();
	if(aid==0) aid = getOneItem();
	location="answeradmin.php?qstr="+qstr+"&aid="+aid+"&action=delete";
}
</script>
</head>
<body>
	<div class="bodytitle">
	<div class="bodytitleleft"></div>
	<div class="bodytitletxt">问答维护</div>
</div>


    <tr>
<td align='center' valign='top'><table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr bgcolor="#FFFFFF"><td height="4"></td></tr>
</table>
<table width="96%" border="0" cellpadding="1" cellspacing="1" align="center" class="tbtitle" style="	background:#E2F5BC;">
<tr>
<td height="24" colspan="10" align="left">
	§问题列表 &nbsp; <a href="answeradmin.php">全部答案</a> <a href="answeradmin.php?check=1">未审核的答案</a></td>
</tr>
<form name="form2" action="answeradmin.php>
<tr height="22">
<td  width="6%" align="center" bgcolor="#EDF9D5">id</td>
<td width="4%" align="center" bgcolor="#EDF9D5">选择</td>
<td width="62%" align="center" bgcolor="#EDF9D5">答案</td>
<td width="10%" align="center" bgcolor="#EDF9D5">回答时间</td>
<td width="6%" align="center" bgcolor="#EDF9D5">回答者</td>
<td width="6%" align="center" bgcolor="#EDF9D5">答案状态</td>
</tr>
<?php
$mylist = $dlist->GetDataList();
while($row = $mylist->GetArray('dm'))
{

	if($row['ifcheck'] == 1){
		$row['ifcheck'] = '已审核';
	}elseif($row['ifcheck']==0){
		$row['ifcheck'] = '未审核';
	}
	$row['dateline'] = gmdate('Y-m-d H:i:s' , $row['dateline'] + 3600*$cfg_ask_timeoffset);
?>
<tr align='center' bgcolor="#FFFFFF"  onMouseMove="javascript:this.bgColor='#EFEFEF';" onMouseOut="javascript:this.bgColor='#FFFFFF';" height="22" >
<td><?php echo $row['id']?></td>
<td><input name="answerid" type="checkbox" id="id" value="<?php echo $row['id']?>" ></td>
<td align='left'><a title="点击查看问题页面" href="../ask/question.php?id=<?php echo $row['askid']?>" target="_blank"><?php echo $row['content']?></a></td>
<td><?php echo $row['dateline']?></td>
<td><a href="member_view.php?ID=<?php echo $row['uid'];?>" target="_blank"><?php echo $row['username']?></a></td>
<td><?php echo $row['ifcheck']?></td>
</tr>
<?php
}
?>
<tr bgcolor="#F8FBFB">
<td height="24" colspan="10" align="left">
&nbsp;
<a href="javascript:selAll()" class="inputbutx">全选</a>
<a href="javascript:noSelAll()" class="inputbutx">取消</a>
<a href="javascript:checkanswer(0)" class="inputbutx">审核</a>
<a href="javascript:deleteanswer(0)" class="inputbutx">删除</a></td>
</tr>
</form>
<tr align="right" bgcolor="#E5F9FF">
<td height="20" colspan="10" align="center" bgcolor="#EDF9D5">
	<?php echo $dlist->GetPageList(7);?></td>
</tr>
</table>
</td>
</tr>
</body>
</html>