<?php
require("../../class/connect.php");
include("../../class/db_sql.php");
include("../../class/config.php");
include("../../class/class.php");
include("../../class/functions.php");
include "../".LoadLang("pub/fun.php");
$link=db_connect();
$empire=new mysqlquery();
$editor=1;
$logininid=getcvar('loginuserid');
$loginin=getcvar('loginusername');
$loginrnd=getcvar('loginrnd');
$loginlevel=getcvar('loginlevel');
is_login($logininid,$loginin,$loginrnd);
//验证权限
CheckLevel($logininid,$loginin,$classid,"downerror");
$enews=$_POST['enews'];
if(empty($enews))
{$enews=$_GET['enews'];}
if($enews)
{
	include("../../class/com_functions.php");
}
//删除单个错误报告
if($enews=="DelError")
{
	$errorid=$_GET['errorid'];
	DelError($errorid,$logininid,$loginin);
}
//批量删除错误报告
elseif($enews=="DelError_all")
{
	$errorid=$_POST['errorid'];
	DelError_all($errorid,$logininid,$loginin);
}
else
{}
$start=(int)$_GET['start'];
$page=(int)$_GET['page'];
$line=15;//每行显示
$page_line=15;
$offset=$start+$page*$line;
$totalquery="select count(*) as total from {$dbtbpre}enewsdownerror";
$num=$empire->gettotal($totalquery);//取得总条数
$query="select * from {$dbtbpre}enewsdownerror";
$query.=" order by errorid desc limit $offset,$line";
$sql=$empire->query($query);
$returnpage=page1($num,$line,$page_line,$start,$page,$search);
//风格
$loginadminstyleid=(int)getcvar('loginadminstyleid');
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>管理错误报告</title>
<link href="../adminstyle/<?=$loginadminstyleid?>/adminstyle.css" rel="stylesheet" type="text/css">
<script>
function CheckAll(form)
  {
  for (var i=0;i<form.elements.length;i++)
    {
    var e = form.elements[i];
    if (e.name != 'chkall')
       e.checked = form.chkall.checked;
    }
  }
</script>
</head>

<body>
<table width="100%" border="0" align="center" cellpadding="3" cellspacing="1">
  <tr>
    <td>位置：<a href="ListError.php">管理错误报告</a></td>
  </tr>
</table>
<form name="form1" method="post" action="ListError.php" onsubmit="return confirm('确认要删除？');">
<?
while($r=$empire->fetch($sql))
{
	if($class_r[$r[classid]][tbname])
	{
		$tr=$empire->fetch1("select title,titleurl,groupid,classid,newspath,filename,id from {$dbtbpre}ecms_".$class_r[$r[classid]][tbname]." where id='$r[id]' limit 1");
		$titleurl=sys_ReturnBqTitleLink($tr);
	}
?>
  <table width="100%" border="0" align="center" cellpadding="3" cellspacing="1" class="tableborder">
    <tr bgcolor="#FFFFFF" class="header"> 
      <td width="70%" height="25">信息标题：<a href="<?=$titleurl?>" target=_blank><?=$tr[title]?></a></td>
      <td width="52%" height="25"> 
        <input name="errorid[]" type="checkbox" id="errorid[]" value="<?=$r[errorid]?>"> 
        <a href="ListError.php?enews=DelError&errorid=<?=$r[errorid]?>" onclick="return confirm('确认要删除？');">删除</a></td>
    </tr>
    <tr bgcolor="#FFFFFF"> 
      <td height="25">发布者IP： 
        <?=$r[errorip]?>&nbsp;(<?=$r[email]?>)
      </td>
      <td height="25">发布时间： 
        <?=$r[errortime]?>
      </td>
    </tr>
    <tr bgcolor="#FFFFFF"> 
      <td height="25" colspan="2"> 
        <table width="100%" border="0" align="center" cellpadding="3" cellspacing="1">
          <tr> 
            <td>
              <?=nl2br(htmlspecialchars($r[errortext]))?>
            </td>
          </tr>
        </table></td>
    </tr>
  </table>
  <?
  }
  db_close();
  $empire=null;
  ?>

  <table width="100%" border="0" align="center" cellpadding="1" cellspacing="0" bgcolor="cccccc">
    <tr bgcolor="#FFFFFF"> 
    <td height="25">
      <?=$returnpage?>
      &nbsp;&nbsp;
      <input type=submit name=submit value=批量删除><input type=hidden name=enews value=DelError_all></td>
  </tr>
</table>
</form>
</body>
</html>
