<!--#include file="Conn.asp"-->
<!--#include file ="Check_Manager.asp"-->
<%
If Request.QueryString("action")="pass" Then
Call noPass
Response.write "<script language='javascript'>" & chr(13)
		Response.write "alert('操作成功!');" & Chr(13)
		Response.write "window.document.location.href='Product_Check.asp';"&Chr(13)
		Response.write "</script>" & Chr(13)
Response.End
End if
%>
<SCRIPT language=javascript>
function unselectall()
{
    if(document.del.chkAll.checked){
	document.del.chkAll.checked = document.del.chkAll.checked&0;
    } 	
}

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;
    }
  }
function ConfirmDel()
{
   if(confirm("确定要继续吗?"))
     return true;
   else
     return false;	 
}
</SCRIPT>
<html>
<head>
<titel></titel>
<LINK href="admin/admin.css" type=text/css rel=stylesheet>
</head>
<body>
<table width="100%" height="77%" border="0" cellpadding="0" cellspacing="0">
  <tr> 
    <td align="center" valign="top"> <br> <p align="center"><strong>产 品 资 讯 管 理</strong></p>
      <table width="720" border="0" align="center" cellpadding="0" cellspacing="2" class="border">
        <tr class="title"> 
          <td height="25">
          <form name="form1" method="post" action="">
              <table width="45%" border="0" align="center" cellpadding="0" cellspacing="0">
                <tr> 
                  <td width="30%">产品选项： </td>
                  <td width="5%"><div align="right">
                      <input name="check" type="radio" value="true" onclick="submit();" <%if Request("check")="true" then Response.write " checked"%>>
                    </div></td>
                  <td width="30%"><div align="left">已审核的产品 </div></td>
                  <td width="2%"><div align="right">
                      <input type="radio" name="check" value="false" onclick="submit();" <%if Request("check")="false" then Response.write " checked"%>>
                    </div></td>
                  <td width="33%"><div align="left">未审核的产品</div></td>
                </tr>
              </table>
            </form> </td>
        </tr>
      </table>
<%
page=request.querystring("page")
PageSize = 15
If Request("check")<>"" Then
  SqlStr = "Select * From [Product] Where "
  If Request("check")="true" Then
  SqlStr = SqlStr & "[Pass]=true "
  Else
  SqlStr = SqlStr & "[Pass]=false "
  End if
  SqlStr = SqlStr & " Order by ID Desc"
Else
  SqlStr = "Select * From [Product] Order by ID Desc"
End if
Set rs=Server.CreateObject("Adodb.Recordset")
rs.Open SqlStr,Conn,3,3
rs.PageSize = PageSize
TotalPages=rs.pagecount
if page="" or clng(page)<1 then page=1
if clng(page) > TotalPages then page=TotalPages
if TotalPages>0 then rs.AbsolutePage=page
a = 0
%>
      <form name="del" method="Post" action="Product_Check.asp?action=all" onsubmit="return ConfirmDel();">
        <table width="720" border="0" cellpadding="0" cellspacing="2">
          <tr> 
            <td height="25">&nbsp;<a href="Product_Check.asp">产品资讯管理</a> &gt;&gt;
<%If Request("check")="false" Then 
Response.Write "未审核的产品"
Else
If Request("check")="true" Then
Response.Write "已审核的产品"
Else
Response.Write "全部产品"
End if
End if
%>           </td>
            <td width="150">&nbsp; </td>
          </tr>
        </table>
<%
If rs.Eof Then
Response.Write "没有产品!"
Else
%>
        <table width="720" border="0" cellpadding="2" cellspacing="1" class=tableBorder style="word-break:break-all">
          <tr class="title"> 
            <td width="31" height="25" align="center" background="admin/admin_bg_1.gif">ID</td>
            <td width="247" align="center" background="admin/admin_bg_1.gif">产品名称</td>
            <td width="89" align="center" background="admin/admin_bg_1.gif">所属一级分类</td>
            <td width="78" align="center" background="admin/admin_bg_1.gif">所属二级分类</td>
            <td width="65" align="center" background="admin/admin_bg_1.gif">加入时间</td>
            <td width="56" align="center" background="admin/admin_bg_1.gif">审核情况</td>
            <td width="44" align="center" background="admin/admin_bg_1.gif">点击数</td>
            <td width="67" align="center" background="admin/admin_bg_1.gif">操作</td>
          </tr>
          <%Do While Not rs.Eof and a<rs.PageSize%>
          <tr> 
            <td height="22" align="center"> <%=cstr(rs("ID"))%></td>
            <td><a href="../ShowProduct.asp?id=<%=rs("ID")%>" target="_blank"><%=Left(rs("Name"),20)%></a></td>
            <td><div align="center"><%=rs("BigClassP")%></div></td>
            <td><div align="center"><%=rs("SmallClassP")%></div></td>
            <td align="center"><%=rs("UpTime")%></td>
            <td align="center"> 
              <%If rs("Pass")=true Then 
			   Response.Write "已审核"
			    Else 
				 Response.Write "未审核"
				  End if%>
            </td>
            <td width="44" align="center"> <a href="Product_Check.asp?action=pass&id=<%=rs("ID")%>"> 
              </a><%=rs("Hits")%> </td>
            <td width="67" align="center"><a href="Product_Check.asp?action=pass&id=<%=rs("ID")%>">
              <%
If rs("Pass")=true Then 
Response.Write "取消审核"
Else
Response.Write "通过审核"
End if
%>
              </a></td>
          </tr>
          <%a = a+1
rs.MoveNext
Loop
End if
rs.Close
Set rs=Nothing
%>
        </table>
        </form>
<table width="96%" border="0" align="center" cellpadding="0" cellspacing="0"><tr> 
          <td align="center">
      <%
Response.Write "共" & TotalPages & "页<b>"
beginpage=1
endpage=Totalpages
if TotalPages>=5 then
  if page>=3 then
    beginpage=page-2
    if page<=(TotalPages-2) then
      endpage=page+2
    else
      endpage=TotalPages
      beginpage=TotalPages-4
    end if
  else
    beginpage=1
    endpage=5
  end if
end if
if beginpage>1 then response.write"<a href='Product_Manage.asp?page=1'>&lt&lt</a>"
for i=beginpage to endpage
  if i=page then
    response.write " "&i
  else
    response.write " [<a href='Product_Manage.asp?page="&i&"'>"&i&"</a>]"
  end if
next
if endpage<TotalPages then response.write " <a href=Product_Manage.asp?page="&TotalPages&">&gt&gt</a>"
%></td>
        </tr>
      </table> 
      <br>
    </td>
  </tr>
</table>
<%
Sub noPass
Dim SqlStr
Set pro = Conn.Execute("Select [Pass] From [Product] Where ID="&Request("id"))
SqlStr = "Update [Product] Set [Pass]=" 
If pro("Pass")=true Then
SqlStr = SqlStr & " false Where ID="&Request("id")
Else
SqlStr = SqlStr & " true Where ID="&Request("id")
End if
Conn.Execute (SqlStr)
JaSys("管理员" & session("ManagerUser") & "<font color=red>修改产品ID["&Request("id")&"]审核属性</font>成功")
End Sub
%>
<%call CloseConn()%>
</body>
</html>