PageRenderTime 27ms CodeModel.GetById 0ms RepoModel.GetById 0ms app.codeStats 0ms

/Wap/User/User_LogEdays.asp

https://github.com/joechen2010/health
ASP | 122 lines | 121 code | 1 blank | 0 comment | 0 complexity | 812614e73080085a76015066104ace7b MD5 | raw file
  1. <% @LANGUAGE="VBSCRIPT" CODEPAGE="65001" %>
  2. <%option explicit%>
  3. <!--#include file="../Conn.asp"-->
  4. <!--#include file="../KS_Cls/Kesion.CommonCls.asp"-->
  5. <%Response.ContentType = "text/vnd.wap.wml; charset=utf-8"%><?xml version="1.0" encoding="utf-8"?>
  6. <!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN" "http://www.wapforum.org/DTD/wml_1.1.xml">
  7. <wml>
  8. <head>
  9. <meta http-equiv="Cache-Control" content="no-Cache"/>
  10. <meta http-equiv="Cache-Control" content="max-age=0"/>
  11. </head>
  12. <card id="main" title="查询我的有效期明细">
  13. <p>
  14. <%
  15. Dim KSCls
  16. Set KSCls = New User_LogEdays
  17. KSCls.Kesion()
  18. Set KSCls = Nothing
  19. %>
  20. </p>
  21. </card>
  22. </wml>
  23. <%
  24. Class User_LogEdays
  25. Private KS
  26. Private CurrentPage,totalPut,TotalPages,SQL
  27. Private RS,MaxPerPage
  28. Private TempStr,SqlStr
  29. Private Sub Class_Initialize()
  30. MaxPerPage =5
  31. Set KS=New PublicCls
  32. End Sub
  33. Private Sub Class_Terminate()
  34. Set KS=Nothing
  35. Set KSUser=Nothing
  36. End Sub
  37. Public Sub Kesion()
  38. IF Cbool(KSUser.UserLoginChecked)=False Then
  39. Response.redirect KS.GetDomain&"User/Login/"
  40. Exit Sub
  41. End If
  42. Dim InOrOutFlag:InOrOutFlag = KS.ChkClng(KS.S("InOrOutFlag"))
  43. If KS.S("page") <> "" Then
  44. CurrentPage = KS.ChkClng(KS.S("page"))
  45. Else
  46. CurrentPage = 1
  47. End If
  48. Response.Write KS.GetReadMessage
  49. IF InOrOutFlag="" or InOrOutFlag="1" or InOrOutFlag="2" Then
  50. Response.Write "<a href='User_LogEdays.asp?"&KS.WapValue&"'>所有记录</a> "
  51. Else
  52. Response.Write "所有记录 "
  53. End If
  54. IF InOrOutFlag="1" Then
  55. Response.Write "收入["&Conn.Execute("select count(id) from ks_logEdays where InOrOutFlag=1 and username='" & KSUser.UserName & "'")(0)&"] "
  56. Else
  57. Response.Write "<a href='User_LogEdays.asp?InOrOutFlag=1&amp;"&KS.WapValue&"'>收入["&Conn.Execute("select count(id) from ks_logEdays where InOrOutFlag=1 and username='" & KSUser.UserName & "'")(0)&"]</a> "
  58. End If
  59. IF InOrOutFlag="2" Then
  60. Response.Write "支出["&Conn.Execute("select count(id) from ks_logEdays where InOrOutFlag=2 and username='" & KSUser.UserName & "'")(0)&"]"
  61. Else
  62. Response.Write "<a href='User_LogEdays.asp?InOrOutFlag=2&amp;"&KS.WapValue&"'>支出["&Conn.Execute("select count(id) from ks_logEdays where InOrOutFlag=2 and username='" & KSUser.UserName & "'")(0)&"]</a>"
  63. End If
  64. Response.Write "<br/>【有效期明细】<br/>"
  65. If KS.ChkClng(InOrOutFlag)=1 Or KS.ChkClng(InOrOutFlag)=2 Then
  66. SqlStr="Select ID,UserName,AddDate,IP,Edays,InOrOutFlag,User,Descript From KS_LogEdays Where InOrOutFlag=" & KS.ChkClng(InOrOutFlag) & " And UserName='" & KSUser.UserName &"' order by id desc"
  67. Else
  68. SqlStr="Select ID,UserName,AddDate,IP,Edays,InOrOutFlag,User,Descript From KS_LogEdays Where UserName='" & KSUser.UserName &"' order by id desc"
  69. End if
  70. Set RS=Server.createobject("adodb.recordset")
  71. RS.open SqlStr,conn,1,1
  72. If RS.EOF And RS.BOF Then
  73. Response.Write "找不到您要的记录!<br/><br/>"
  74. Else
  75. TotalPut=rs.recordcount
  76. If (TotalPut Mod MaxPerPage)=0 Then
  77. TotalPages = TotalPut \ MaxPerPage
  78. Else
  79. TotalPages = TotalPut \ MaxPerPage + 1
  80. End If
  81. If CurrentPage > TotalPages Then CurrentPage=TotalPages
  82. If CurrentPage < 1 Then CurrentPage=1
  83. RS.move (CurrentPage-1)*MaxPerPage
  84. SQL = RS.GetRows(MaxPerPage)
  85. Dim i,InEdays,OutEdays
  86. For i=0 To Ubound(SQL,2)
  87. %>
  88. 用户名:<%=SQL(1,i)%>(IP:<%=SQL(3,i)%>)<br/>
  89. 消费时间:<%=SQL(2,i)%><br/>
  90. <%
  91. If SQL(5,I)=1 Then
  92. Response.Write "收入天数:"
  93. InEdays=InEdays+SQL(4,I)
  94. Else
  95. Response.Write "支出天数:"
  96. OutEdays=OutEdays+SQL(4,I)
  97. End If
  98. Response.Write SQL(4,I)&"天,"
  99. Response.Write "操作员:"&SQL(6,i)&"<br/>"
  100. Response.Write "备注:"&SQL(7,i)&"<br/>"
  101. Response.Write "<img src=""../Images/Hen.gif"" alt=""""/><br/>"
  102. Next
  103. Call KS.ShowPageParamter(totalPut, MaxPerPage, "User_LogEdays.asp", True, "条记录", CurrentPage, "InOrOutFlag=" & KS.ChkClng(KS.S("InOrOutFlag")) & "&amp;" & KS.WapValue & "")
  104. Response.Write "【本页合计】<br/>"
  105. Response.Write "收入天数:" & InEdays & "天<br/>"
  106. Response.Write "支出天数:" & KS.ChkClng(OutEdays) & "天<br/>"
  107. Dim totalinEdays:totalinEdays=Conn.Execute("Select sum(Edays) From KS_LogEdays where username='" & KSUser.UserName & "'AND InOrOutFlag=1")(0)
  108. Dim TotalOutEdays:TotalOutEdays=Conn.Execute("Select sum(Edays) From KS_LogEdays where username='" & KSUser.UserName & "'AND InOrOutFlag=2")(0)
  109. If KS.ChkClng(totalInEdays)=0 Then totalInEdays=0
  110. If KS.ChkClng(TotalOutEdays)=0 Then TotalOutEdays=0
  111. Response.Write "【所有合计】<br/>"
  112. Response.Write "收入天数:" & KS.ChkClng(totalInEdays) & "天<br/>"
  113. Response.Write "支出天数:" & KS.ChkClng(totalOutEdays) & "天<br/>"
  114. Response.Write "合计累计还剩:" & totalInEdays-totalOutEdays & "天<br/><br/>"
  115. End If
  116. RS.Close:set RS=Nothing
  117. Response.Write "<a href=""Index.asp?"&KS.WapValue&""">我的地盘</a><br/>"
  118. Response.Write "<a href="""&KS.GetGoBackIndex&""">返回首页</a><br/>"
  119. End Sub
  120. End Class
  121. %>