<!--#include file="../inc/config.asp"-->
<!--#include file="../inc/conn.asp"-->
<!-- #include file="inc/Session.asp" -->
<!-- #include file="../inc/function.asp" -->
<!-- #include file="inc/checkrole.asp" -->
<%
'''''''''''''''''''''''''''''''''''''''''''''''
call checkPrevilege(Session("Name"),"p21")
'''''''''''''''''''''''''''''''''''''''''''''''
dim currentpage,totalpage,totalnum,recpage,urls,IsCheck
recpage=20
dim infotypeid,GameName,ItemsType,Province,City,Key,carr
if(request.QueryString("page")<>"") then
	currentpage=Clng(request.QueryString("page"))
else
	currentpage=1
end if
if(request.QueryString("IsCheck")<>"") then
	IsCheck=Clng(request.QueryString("IsCheck"))
else
	IsCheck=1
end if
if(request.QueryString("InfoTypeId")<>"") then
	infotypeid=Clng(request.QueryString("InfoTypeId"))	
else
	infotypeid=0
end if
if(request.QueryString("GameName")<>"") then
	GameName=Clng(request.QueryString("GameName"))
else
	GameName=0
end if
if(request.QueryString("ItemsType")<>"") then
	ItemsType=Clng(request.QueryString("ItemsType"))	
else
	ItemsType=0
end if
if(request.QueryString("Province")<>"") then
	Province=replace(request.querystring("Province"),"'","")
else
	Province=""
end if
if(request.QueryString("City")<>"") then
	City=replace(request.querystring("City"),"'","")
else
	City=""
end if
if(request.QueryString("Key")<>"") then
	Key=replace(request.querystring("Key"),"'","")
else
	Key=""
end if
urls="InfoTypeId="&InfoTypeId&"&GameName="&GameName&"&ItemsType="&ItemsType&"&Province="&Province&"&City="&City&"&Key="&Key&"&IsCheck="&IsCheck
%>
<html>
<head>
<title>游戏交易信息</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<style type="text/css">
<!--
body {
	margin-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 0px;
	background-color: #FFFFFF;
}
a.blue:link{ font-size:14px; text-decoration:underline; color:#003399;}
a.blue:hover{ font-size:14px; text-decoration:underline; color:#003399;}
a.blue:visited{ font-size:14px; text-decoration:underline; color:#003399;}
a.blue:active{ font-size:14px; text-decoration:underline; color:#003399;}
-->
</style>
<style type="text/css">
<!--
.search_t{ color:#ffffff; line-height:20px; text-align:center;}
-->
</style>
<link href="../style/global.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="../js/http.js"></script>
<script type="text/javascript">
function selectcity(provinceid,cityid){	
			var citySelect=document.PostForm.City;
			citySelect.options.length = 0;		
			var xmlhttp;	 
			xmlhttp=getXMLRequester();	
			//alert(xmlhttp);
			if(xmlhttp){	
				xmlhttp.onreadystatechange = function doAction() {		
					if (xmlhttp.readyState == 4)
					{			
						/*alert(xmlhttp.responseText);*/				
						var response = xmlhttp.responseXML.documentElement;
						var classidList = response.getElementsByTagName('city');	
						
						for(var i=0;i<classidList.length;i++){
							xx=classidList[i].getElementsByTagName('id');
							yy=classidList[i].getElementsByTagName('title');
							classid=xx[0].firstChild.data
							classtitle=yy[0].firstChild.data				
							citySelect.options[i]=new Option(classtitle,classtitle);							
							if(cityid==classtitle){
								citySelect.options[i].selected=true;
							}
						}
					}
				};
				xmlhttp.open("POST", "/member/get_citys.asp?pid="+provinceid,true);
				xmlhttp.send("");
			}
}////////////////////////	
</script>
</head>
</head>
<body>
<table width="100%"  border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td><iframe src="right_top.htm" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" height="30" width="100%"></iframe></td>
  </tr>
</table>
<table width="1000" height="96" border="0" align="center" cellpadding="0" cellspacing="0" background="../deals/images/s_bg.gif">
  <tr>
    <td><form name="PostForm" method="get" action="">
      <table width="90%" border="0" align="center" cellpadding="0" cellspacing="0" class="search_t">

        <tr>
          <td height="30"><span class="td_row">
            状态：
                <select name="IsCheck" id="IsCheck">
                  <option value="0" <%if(IsCheck=0) then response.write("selected=""selected""") end if%>>未审核</option>
                  <option value="1"  <%if(IsCheck=1) then response.write("selected=""selected""") end if%>>已审核</option>
                </select>
              信息类别：
              <select name="InfoTypeId" id="InfoTypeId">
			  <option value="0">全部</option>
              <option value="1" <%if(InfoTypeId=1) then response.write("selected=""selected""") end if%>>出售</option>
              <option value="2"  <%if(InfoTypeId=2) then response.write("selected=""selected""") end if%>>求购</option>
            </select>
            游戏名称：
            <select name="GameName" id="GameName">
              <option value="0">全部</option>
			  <%=getGameNameOptions(GameName)%>
            </select>
          </span><span class="td_row">物品类别：
          <select name="ItemsType" id="ItemsType">
            <option value="0">全部</option>
			<%=getGameItemOptions(ItemsType)%>
          </select>
          </span><span class="td_row">
          省：
          <select name="Province" id="Province" onChange="selectcity(this.options[this.selectedIndex].value,'')">
            <option value="">全部</option>
			<%
			response.write(getProvinceOptions(Province))
			%>
          </select>
 市：          
 <select name="City">
 	<option value="">全部</option>
          </select>
          <script type="text/javascript">
			selectcity("<%=Province%>","<%=City%>");	
	      </script>
          关键字：
          <input name="Key" type="text" id="key" size="10" value="<%=key%>">
          <input type="submit" name="Submit" value="开始搜索">
          </span></td>
          </tr>
        <tr>
          <td height="30" style="padding:8px 0px 0px 0px;"><div align="center">本站提供免费信息发布平台，请注意分辨信息真违。</div></td>
          </tr>
      </table>
            </form>
    </td>
  </tr>
</table>
<form action="gamedeals_do.asp" method="post" style="margin:0px;">
<table width="960" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#CCCCCC">
  <tr>
    <td width="53" height="25" bgcolor="#B6E2EF"><div align="center"><strong>类别</strong></div></td>
    <td width="282" bgcolor="#B6E2EF"><div align="center"><strong>标题</strong></div></td>
    <td width="138" bgcolor="#B6E2EF"><div align="center"><strong>游戏</strong></div></td>
    <td width="123" bgcolor="#B6E2EF"><div align="center"><strong>物品</strong></div></td>
    <td width="123" bgcolor="#B6E2EF"><div align="center"><strong>省市</strong></div></td>
    <td width="79" bgcolor="#B6E2EF"><div align="center"><strong>价格</strong></div></td>
    <td width="78" bgcolor="#B6E2EF"><div align="center"><strong>日期</strong></div></td>
    <td width="75" bgcolor="#B6E2EF"><div align="center"><strong>查看详细</strong></div></td>
  </tr>
<%  
csql="select count(*) from t_game_deal where IsCheck="&IsCheck
if(InfoTypeId>0) then
	csql=csql&" and InfoTypeId="&InfoTypeId
end if
if(GameName>0) then
	csql=csql&" and GameName="&GameName
end if
if(ItemsType>0) then
	csql=csql&" and ItemsType="&ItemsType
end if
if(Province<>"") then
	csql=csql&" and Province='"&Province&"'"
end if
if(City<>"") then
	csql=csql&" and City='"&City&"'"
end if
if(Key<>"") then
	csql=csql&" and Title like '%"&Key&"%'"
end if
sql="select top "&recpage&" t_game_deal.id as tid,t_game_deal.Title as gtitle,t_game_deal.ItemsNum,Price,PubDate,Province,City,t_game_items.Title as ititle,t_game_names.Title as gtitle from t_game_deal,t_game_items,t_game_names where t_game_deal.id<=(select min(id) from (select top "&((currentpage-1)*recpage+1)&" id from t_game_deal where IsCheck="&IsCheck
if(InfoTypeId>0) then
	sql=sql&" and InfoTypeId="&InfoTypeId
end if
if(GameName>0) then
	sql=sql&" and GameName="&GameName
end if
if(ItemsType>0) then
	sql=sql&" and ItemsType="&ItemsType
end if
if(Province<>"") then
	sql=sql&" and Province='"&Province&"'"
end if
if(City<>"") then
	sql=sql&" and City='"&City&"'"
end if
if(Key<>"") then
	sql=sql&" and Title like '%"&Key&"%'"
end if
sql=sql&" order by id desc) as t) and t_game_deal.ItemsType=t_game_items.id and t_game_deal.GameName=t_game_names.id and t_game_deal.IsCheck="&IsCheck
if(InfoTypeId>0) then
	sql=sql&" and t_game_deal.InfoTypeId="&InfoTypeId
end if
if(GameName>0) then
	sql=sql&" and t_game_deal.GameName="&GameName
end if
if(ItemsType>0) then
	sql=sql&" and t_game_deal.ItemsType="&ItemsType
end if
if(Province<>"") then
	sql=sql&" and t_game_deal.Province='"&Province&"'"
end if
if(City<>"") then
	sql=sql&" and t_game_deal.City='"&City&"'"
end if
if(Key<>"") then
	sql=sql&" and t_game_deal.Title like '%"&Key&"%'"
end if
sql=sql&" order by t_game_deal.id desc"
'response.Write(sql)
totalnum=conn.execute(csql)(0)
totalpage=int((totalnum-1+recpage)/recpage)
set rs=server.CreateObject("adodb.recordset")
rs.open sql,conn,3,1
if not rs.eof then
	carr=rs.GetRows()
end if
rs.close
set rs=nothing
if isarray(carr) then
	for i=0 to ubound(carr,2)
  %>
  <tr>
    <td height="25" bgcolor="#FFFFFF">
	<div align="center"><input type="checkbox" name="commenid" value=<%=carr(0,i)%>><%if(InfoTypeId=1) then response.write("出售") else response.write("--") end if%></div></td>
    <td bgcolor="#FFFFFF"><div align="left">&nbsp;<%=carr(1,i)%></div></td>
    <td bgcolor="#FFFFFF"><div align="center"><%=carr(8,i)%></div></td>
    <td bgcolor="#FFFFFF"><div align="center"><%=carr(7,i)%></div></td>
    <td bgcolor="#FFFFFF"><div align="center"><%=carr(5,i)%>-<%=carr(6,i)%></div></td>
    <td bgcolor="#FFFFFF"><div align="center"><%=carr(3,i)%></div></td>
    <td bgcolor="#FFFFFF"><div align="center"><%=month(carr(4,i))&"-"&day(carr(4,i))%></div></td>
    <td bgcolor="#FFFFFF"><div align="center"><a href="../deals/show.asp?id=<%=carr(0,i)%>" target="_blank">查看详细</a></div></td>
  </tr>
<%
	next
end if
%>
</table>
<table width="960" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td><div align="center">
      <input class=Button type="button" name="chkall" value="全选" onClick="CheckAll(this.form)">&nbsp;&nbsp;
      <input class=Button type="button" name="chksel" value="反选" onClick="ContraSel(this.form)">&nbsp;&nbsp;
	  <select name="acttype" id="acttype">
        <option value="del">删除</option>
        <option value="check">批量审核</option>
        <option value="uncheck">取消审核</option>
      </select>
      <input class=Button type="submit" name="Submit2" value="执行==>" onClick="return confirm('您确定执行该操作吗?')">
    </div></td>
  </tr>
</table>
</form>
<table width="960" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td><div align="center">
<%
dim n,p,startpage,endpage,j
n=currentpage+1
p=currentpage-1
startpage=currentpage-5
if(startpage<=0) then
	startpage=1
end if
endpage=currentpage+5
if(endpage>totalpage) then
	endpage=totalpage
end if
if p>0then
	response.write("["&"<a href='?"&urls&"&page="&cstr(p)&"'>上一页</a>]&nbsp;&nbsp;&nbsp;")
else 
	response.write("上一页&nbsp;&nbsp;&nbsp;")
end if 
'''''''''''''''''
for j=startpage to endpage
		if(j=currentpage) then
			response.write(j&"&nbsp;")
		else
			response.write("<a href=""?"&urls&"&page="&j&""">["&j&"]</a>&nbsp;")
		end if
		if(j>(startPage+10)) then
			exit for
		end if
next
'''''''''''''''''''''''''''''''''''''
if (n-1)*recpage>=Clng(totalnum) then 
	response.write("下一页" )
else
	response.Write("["&"<a href='?"&urls&"&page="&cstr(n)&"'>下一页</a>]")
end if
response.Write("&nbsp;共"&totalpage&"页&nbsp;")
response.Write("&nbsp;第"&currentpage&"页&nbsp;")
%>
	</div></td>
  </tr>
</table>
<script language="javascript">
function CheckAll(form) {  
	for (var i=0;i<form.elements.length;i++)  {  
		var e = form.elements[i];  
		if (e.name != 'chkall')  
		e.checked = true // form.chkall.checked;  
	}  
} 
 
function ContraSel(form) {
	for (var i=0;i<form.elements.length;i++){
		var e = form.elements[i];
		if (e.name != 'chkall')
		e.checked=!e.checked;
	}
}
</script>
</body>
</html>
<%
call connclose()
%>
