<!--#include file="QvodCms_Conn.asp"-->
<!--#include file="QvodCms_Check.asp"-->
<%
Dim action,class_id,class_bigid,server_id,shuxin_id,search_type,search_class,search_keyword,pagelink,order,startime,endtime, ListUrl,DataUrl,sx,oid
sql="":S1="":S2="":S3=""
allid=Trim(Request.Form("allid"))'批量ID
action=Trim(Request.QueryString("action"))
sx=clng(Request.QueryString("sx"))
oid=clng(Request.QueryString("oid"))
search_keyword=Trim(Request.QueryString("search_keyword"))'搜索关键字
page=QvodCms_CLng(Request.QueryString("page")):If page<=0 or page="" Then page=1'初始化分页参数
reurl=Request.ServerVariables("Http_Referer")'获取来源地址
Call OpenConn()
Sub Product_sql'作用：处理SQL查询语句   
    If action="search" Then
		 If Config(1)="SQL" Then
		 sql="and oqq like '%"&search_keyword&"%'"
		 Else'启用InStr,LCase函数过滤小日本
		 sql="and InStr(1,LCase(oqq),LCase('"&search_keyword&"'),0)<>0"
		 End If
		 pagelink="qvodcms_order.asp?Action=search&search_type="&search_type&"&search_keyword="&search_keyword&"&" '分页路径
	Else
	    sql=""	   
	End If
	pagelink="qvodcms_order.asp"'分页路径
	sql = "Select * from qvodcms_order,qvodcms_user where oid>0 "&sql&" and ouid=uid order by oid desc"
End Sub

Sub ostar()'发货状态
   if rs("ostar")=1 then
    'Response.Write("<a href='?action=ostar&sx=0&oid="&rs("oid")&"' title=""修改发货状态""><font color='red'>已发货</font></a>")
	Response.Write("<font color='red'>已发货√</font>")
   Else
    Response.Write "<a href='?action=ostar&sx=1&oid="&rs("oid")&"' title=""修改发货状态"" onClick=""return confirm('确定要发货吗?');"">未发货×</a>"
   End if		
End Sub

if action="ostar" then
   if sx=0 and oid>0 then
   Conn.execute("update qvodcms_order set ostar=0 where oid="&oid&"")
   Elseif sx=1 and oid>0 then
   Conn.execute("update qvodcms_order set ostar=1,oktime='"&Now()&"' where oid="&oid&"")
   Else
   Call QvodCms_Err("必要参数不能为空！")
   Response.End
   End if
End if

If action="delall" Then'批量删除
    If allid="" Then 
		Call QvodCms_Err("必要参数不能为空！")
		Response.End
	End if
    Call card_delall
End if	

Sub card_delall()
 conn.execute(" delete from qvodcms_order where oid in("&allid&")  ")'删除影片
End Sub
%>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=gb2312" />
<TITLE>兑换管理页面</TITLE>
<link href="skins/css/JaJa_main.css" rel="stylesheet" type="text/css" />
<script language = "javaScript" src = "QvodCms_All.js" type="text/javascript"></script>
</head>
<body>


<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr> 
<th colspan=10 style="text-align:center;"><table width="100%" border="0">
    <tr>
      <td><table width="611" border="0" align="left" cellpadding="0" cellspacing="0">
        <tr>
          <form method="get" action="Qvodcms_Product.asp">
            <input type="hidden" name="action" value="search">
            <td width="71" style="color: #990000; text-align:right;">兑换搜索：</td>
            <td width="458"><input name="search_keyword" type="text" style="width:450px; text-align:left" onFocus="if(this.value=='关键字')this.value='';" value="用户名"></td>
            <td width="82"><input type="submit" name="Submit" value="提交搜索" /></td>
          </form>
        </tr>
      </table></td>
      </tr>
  </table>
<!-- --></th>
</tr>
<tr style="text-align:center;">
<td width="44" class="td2">选中</td>
<td width="50" class="td2">ID</td>
<td width="105" class="td2">兑换用户</td>
<td width="258" class="td2">兑换奖品</td>
<td width="71"  class="td2">兑换数量</td>
<td width="108"  class="td2">联系方式</td>
<td width="98"  class="td2">联系QQ</td>
<td width="68"  class="td2">状态</td>
<td width="86"  class="td2">兑换时间</td>
<td width="87"  class="td2">常规操作</td>
</tr>
<form name='myform' method='Post' action=''>
<%
Set rs = Server.CreateObject("adodb.recordset")
Call Product_sql
rs.Open sql, Conn, 1, 1
If not(rs.bof And rs.eof) Then
	rs.pagesize=QvodCms_CLng(AdminId(16))'每页数据
	rs.AbsolutePage=page
	m=rs.recordcount     '总记录
	n=rs.PageCount       '总页数
	z=rs.pagesize        '每页数量
	i=0
	Do While Not rs.eof and i<rs.pagesize
	i=i+1
%>
<tr bgcolor="#FFFFFF" onMouseOver="javascript:this.bgColor='#ecf5f8'" onMouseOut="javascript:this.bgColor='#FFFFFF'" style="text-align:center;">
  <td >
  <input name='allid' type='checkbox' value='<%=rs("oid")%>' style="border:none">  </td>
  <td ><%=rs("oid")%></td>
  <td style="text-align:left;"><%=rs("uname")%></td>
  <td  align="left"><%=Trim(rs("oname"))%></td>
  <td ><%=rs("ohow")%></td>
  <td ><%=trim(rs("otel"))%></td>
  <td ><%=trim(rs("oqq"))%></td>
  <td ><% Call ostar()%></td>
  <td ><%=formatdatetime(rs("otime"),2)%></td>
  <td ><a href="#" onClick="ops('QvodCms_Order_info.asp?oid=<%=rs("oid")%>&action=orderinfo','330','500');">查看</a></td>
</tr>
<%
	rs.movenext  
	loop 
%>
<tr >
  <td colspan="10" class="td2" style="text-align:left; height:30px;"><table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td><input name='chkAll' type='checkbox' id='chkAll' onclick='CheckAll(this.form)' value='checkbox' style="border:none">
      全选
        <input name='submit1' type='submit' value='批量删除' onClick="document.myform.action='?action=delall';">&nbsp;</td>
    </tr>
</table></td>
  </tr>
</form> 
<tr> 
<th colspan=10 style="text-align:center; padding:5px;"><%=ShowPage(pagelink&Product,m, z, page, True, True, "个", False)%></th>
</tr>
</table>
<%
Else
    Call QvodCms_Err("暂无奖品兑换数据！")
End If
rs.Close:Set rs=nothing:Call CloseConn()
%>
<div style="text-align:center; margin-top:5px; color: #FF0000">页面执行时间：<%=GetRunTime()%>秒</div>
</body>
</html>