<%
ds="../"
%>
<!--#include file="../conn/conn.asp" -->
<!--#include file="../inc/sub.asp"-->
<!--#include file="checkcmember.asp" -->
<%
If Trim(Request.QueryString("action"))="del" Then
	ID=Replace(Trim(Request.Form("ID"))," ","")
	If ID<>"" Then
		Conn.Execute("Delete From JOB_consume where consume_member='"&session("user_name")&"' And consume_id In("&ID&")")
	Else
		Response.Write("<script>alert(""请至少选择一项操作的记录！"");history.back();</script>")
		Response.End()
	End If
	Response.Redirect("company_paylog.asp")
End If

Dim page,i
Dim totalPut
const MaxPerpage=20
Const strFileName="company_paylog.asp"

page=Trim(Request("page"))
If page<>"" And IsNumeric(page) Then
	If page<1 Or Len(page)>10 Then
		page=1
	Else
    	page=CLng(page)
	End If
Else
	page=1
End If
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>消费记录-<%=SiteName%></title>
<LINK href="../css/css.css" rel=stylesheet>
<script>
function checkAll(box1) {
    var ids = document.getElementsByName("ID");
	if (ids != null) {
		for (i=0; i<ids.length; i++) {
			var obj = ids(i);
			obj.checked = box1.checked;
		}
	}
}
</script></head>
<body>
<!--#include file="../inc/head.asp"-->
<br class="br">
<table width="778" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td width="200" valign="top"><!--#include file="menu.asp" --></td>
    <td valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td height="28" background="../images/companyleftregbg.gif">&nbsp;<font class=font-14><b><img src="../images/arrow_01.gif" width="11" height="11" align="absmiddle"> </b></font><span class="bl_14"><b>您的企业名称是</b></span><font class=font-14><b>：</b></font><font 
            class=font-title color="#FF6600"><%=session("user_cname")%></font></td>
        <td width="122" background="../images/companyleftregbg.gif"><font 
            class=font-title color="#FF6600"><a 
            style="CURSOR: hand" 
            href="logout.asp"><img src="../images/exit.gif" width=79 
            height=19 border="0"></a></font></td>
      </tr>
    </table>
      <table width="98%" border="0" align="center" cellpadding="0" cellspacing="0" class="orange-bar">
        <tr>
          <td width="2%" align="right">&nbsp;</td>
          <td width="97%" class="white14">购买结果</td>
          <td width="1%">&nbsp;</td>
        </tr>
      </table>

<%
Set rs= Server.CreateObject("ADODB.Recordset")
sql="select * from JOB_consume where consume_member='"&session("user_name")&"' order by consume_id desc"
rs.open sql,conn,1,1
if rs.eof and rs.bof then
	Response.Write("<br><br><div align=""center"">暂无任何消费记录！</div><br><br>")
else
	totalPut=rs.recordcount
	if (page-1)*MaxPerpage>totalput then
		if (totalPut mod MaxPerpage)=0 then
			page= totalPut \ MaxPerpage
		else
			page= totalPut \ MaxPerpage + 1
		end if
	end if
	if page=1 then
		Call MainInfo()
	else
		if (page-1)*MaxPerpage<totalPut then
			rs.move  (page-1)*MaxPerpage
			dim bookmark
			bookmark=rs.bookmark
			Call MainInfo()
		else
			page=1
			Call MainInfo()
		end if
	end if
end if
rs.close
set rs=nothing
%>
      <%Sub MainInfo()%>
	  
      <table width="100%" border="0" cellpadding="0" cellspacing="0" align="center">
	  <form name="paylog" action="company_paylog.asp?action=del" method="post">
          <tr>
            <td align="right"><table width="98%" border="0" align="center" cellpadding="6" cellspacing="0">
                <tr align="center">
                  <td width="30%" height="28" bgcolor="#E7E7E7"><b>消费项目</b></td>
                  <td width="20%" bgcolor="#E7E7E7"><b>消费点数</b></td>
                  <td width="30%" bgcolor="#E7E7E7"><b>操作时间</b></td>
                  <td width="10%" bgcolor="#E7E7E7"><b>IP记录</b></td>
				  <td width="10%" bgcolor="#E7E7E7"><b>操作</b></td>
                </tr>
<%
	Do while Not rs.EOF
%>
                <tr bgcolor="#f7f7f7">
                  <td height="22" align="center"><%=rs("consume_content")%></td>
                  <td align="center"><%=rs("consume_num")%></td>
                  <td align="center"><%=rs("consume_date")%></td>
                  <td align="center"><%=rs("consume_ip")%></td>
				  <td align="center"><input name="ID" type="checkbox" value="<%=rs("consume_id")%>"></td>
                </tr>
<%
		i=i+1
		if i>=MaxPerPage then exit do
		rs.movenext
		loop
%>
            </table>
			全选
			<input name="chkAll" type="checkbox" id="chkAll" value="1" onClick="javascript: checkAll(this)">
			<input type="submit" value="删除选定记录">&nbsp;&nbsp;
			</td>
          </tr>
	 </form>
      </table>
<%End Sub%>
<%
If totalput>0 Then
	call showpage(strFileName,totalput,MaxPerPage,false,true,"个日志")
End If
%>
    </td>
  </tr>
</table>
<!--#include file="../inc/bottom.asp"-->
</body>
</html>

