<!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.askid.length;i++)
	{
		if(!document.form2.askid[i].checked)
		{
			document.form2.askid[i].checked=true;
		}
	}
}
function noSelAll()
{
	for(i=0;i<document.form2.askid.length;i++)
	{
		if(document.form2.askid[i].checked)
		{
			document.form2.askid[i].checked=false;
		}
	}
}
//获得选中文件的文件名
function getCheckboxItem()
{
	var allSel="";
	if(document.form2.askid.value) return document.form2.askid.value;
	for(i=0;i<document.form2.askid.length;i++)
	{
		if(document.form2.askid[i].checked)
		{
			if(allSel=="")
				allSel=document.form2.askid[i].value;
			else
				allSel=allSel+"`"+document.form2.askid[i].value;
		}
	}
	return allSel;
}

//获得选中其中一个的id
function getOneItem()
{
	var allSel="";
	if(document.form2.askid.value) return document.form2.askid.value;
	for(i=0;i<document.form2.askid.length;i++)
	{
		if(document.form2.askid[i].checked)
		{
				allSel = document.form2.askid[i].value;
				break;
		}
	}
	return allSel;
}
function digestask(aid){
	var qstr=getCheckboxItem();
	if(aid==0) aid = getOneItem();
	location="askadmin.php?aid="+aid+"&action=digest&qstr="+qstr;
}

function deleteask(aid){
	var qstr=getCheckboxItem();
	if(aid==0) aid = getOneItem();
	location="askadmin.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="askadmin.php">全部问题</a></td>
</tr>
<form name="form2" action="askadmin.php>
<tr height="22">
<td align="center"  width="6%">id</td>
<td align="center" width="4%">选择</td>
<td align="center" width="28%">问题</td>
<td align="center" width="6%">推荐</td>
<td align="center" width="10%">提问时间</td>
<td align="center" width="10%">所属大分类</td>
<td align="center" width="10%">所属小分类</td>
<td align="center" width="8%">回答数</td>
<td align="center" width="6%">问题状态</td>
</tr>
<?php
$mylist = $dlist->GetDataList();
while($row = $mylist->GetArray('dm'))
{

	if($row['status'] == 0){
		$row['status'] = '待解决';
	}elseif($row['status'] == 1){
		$row['status'] = '已解决';
	}elseif($row['status'] == 2 ){
		$row['status'] = '已关闭';
	}elseif($row['status'] == 3){
		$row['status'] = '已过期';
	}
	$row['dateline'] = gmdate('Y-m-d' , $row['dateline'] + 3600*8);
?>
<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="askid" type="checkbox" id="id" value="<?php echo $row[id]?>" ></td>
<td align='left'><a href="../ask/question.php?id=<?php echo $row[id]?>" target="_blank"><?php echo $row[title]?></a></td>
<td><?php echo $row[digest]?></td>
<td><?php echo $row[dateline]?></td>
<td><a href="askadmin.php?tid=<?php echo $row[tid]?>"><?php echo $row[tidname]?></a> </td>
<td><a href="askadmin.php?tid2=<?php echo $row[tid2]?>"><?php echo $row[tid2name]?></a></td>
<td><?php echo $row[replies]?></td>
<td><?php echo $row[status]?></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:digestask(0)" class="inputbutx">推荐</a>
<a href="javascript:deleteask(0)" class="inputbutx">删除</a></td>
</tr>
</form>
<tr align="right" bgcolor="#E5F9FF">
<td height="20" colspan="10" align="center">
	<?php echo $dlist->GetPageList(7);?></td>
</tr>
</table>
</td>
</tr>
</body>
</html>