home *** CD-ROM | disk | FTP | other *** search
/ 221.214.14.186 / 221.214.14.186.tar / 221.214.14.186 / zb / 11 / counter.asp < prev    next >
Text File  |  2003-11-02  |  2KB  |  60 lines

  1. <%
  2. mode = LCASE(Request("mode"))
  3. gif  = Request("gif")
  4.  
  5. SET rs = Server.CreateObject("ADODB.Recordset")
  6. Rs.Open "Select * From counters" ,conn,1,3
  7.  
  8. if Request.Cookies("IsFirst")=fail then 
  9. LASTIP = RS("LASTIP")
  10. NEWIP = REQUEST.servervariables("REMOTE_ADDR") 
  11.  
  12. IF CSTR(Month(RS("DATE"))) <> CSTR(Month(DATE())) THEN    
  13.  
  14.        RS("DATE") = DATE()                      
  15.        RS("YESTERDAY") = RS("TODAY")            
  16.        RS("BMONTH") = RS("MONTH")
  17.        RS("MONTH") = 1                          
  18.        RS("TODAY") = 1                          
  19.        RS.Update                                
  20. ELSE
  21.    IF CSTR(Day(RS("DATE"))) <> CSTR(Day(DATE())) THEN    
  22.        RS("DATE") = DATE()                      
  23.        RS("YESTERDAY") = RS("TODAY")            
  24.        RS("TODAY") = 1                          
  25.        RS.Update                                
  26.    END IF
  27. response.Cookies("IsFirst")=true
  28. RS("TOTAL")  =  RS("TOTAL") + 1
  29. END IF
  30.  
  31. RS("TOTAL")  =  RS("TOTAL") + 1               
  32. RS("TODAY") =  RS("TODAY") + 1               
  33. RS("MONTH")  =  RS("MONTH") + 1               
  34. RS.Update                                    
  35. Session("UserID")=RS("TOTAL")
  36.  
  37. end if
  38.  
  39. N = Now
  40. D1 =  #6/27/2001#                                                    ' ┐¬╩╝═│╝╞╚╒╞┌(╘┬/╚╒/─Ω)
  41. D2 = DateValue(N)
  42. D3 = DateDiff("d", D1, D2)
  43. response.write  "▒╛╒╛╫▄╖├╬╩ú║"
  44. GCounter( RS("TOTAL") )
  45. response.write  " ╚╦"
  46. response.write "<br>"
  47. rs.Close
  48. response.write "╡▒╟░╙╨ <img src='OnlineCount.asp'> ╚╦╘┌╧▀"
  49. response.write "<br>"
  50. Function GCounter( counter )
  51.    Dim S, i, G
  52.    S = CStr( counter )  
  53.  
  54.    For i = 1 to Len(S)
  55.       G = G & "<IMG SRC=counter/" & Mid(S, i, 1) & ".gif Align=middle>"
  56.    Next
  57.    response.write G
  58. End Function
  59. %>
  60.