index_not_html.asp 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. <!--#include file="Conn.asp"--><%
  2. IP=GetIP
  3. Act = Request.QueryString("act")
  4. If Act = "logout" Then
  5. conn.execute("insert into logRecord (loginName,loginTime,loginAct) values ('"&Session("employee_name")&"','"&now()&"','"&Session("employee_name")&" "&now()&"从"&IP&"退出系统')")
  6. Session.Contents.Remove("employee_id")
  7. Session.Contents.Remove("employee_name")
  8. Session.Contents.Remove("t")
  9. Session.Contents.Remove("t1")
  10. Session.Contents.Remove("t2")
  11. Session.Contents.Remove("t3")
  12. Session.Contents.Remove("t4")
  13. Session.Contents.Remove("d1")
  14. Session.Contents.Remove("d2")
  15. End If
  16. Session.Contents.Remove("employee_id")
  17. If Act = "login" Then
  18. loginuser=TextEncode(Request.Form("loginuser"))
  19. loginpwd=TextEncode(Request.Form("loginpwd"))
  20. logincode=Request.Form("logincode")
  21. If loginuser="" Then Response.Write "1":Conn.Close:Set Conn=Nothing:Response.End
  22. If loginpwd="" Then Response.Write "2":Conn.Close:Set Conn=Nothing:Response.End
  23. If logincode<>Session("zengscode") Then Response.Write "3":Conn.Close:Set Conn=Nothing:Response.End
  24. Set Rs=Server.CreateObject("ADODB.RecordSet")
  25. Rs.Open "Select id,em_user,em_password,em_role,em_code,em_email,em_tel,lastIp from employee Where em_user='"&loginuser&"'",conn,1,3
  26. If Rs.Recordcount=0 Then Response.Write "4":Rs.Close:Set Rs=Nothing:Conn.Close:Set Conn=Nothing:Response.End
  27. If Rs("em_password")<>MD5(loginpwd) Then Response.Write "5":Rs.Close:Set Rs=Nothing:Conn.Close:Set Conn=Nothing:Response.End
  28. Session("employee_id")=Cint(Rs("id"))
  29. Session("employee_name")=Rs("em_user")
  30. Response.Write "7"
  31. Rs("lastIp")=GetIp()'记录登陆IP
  32. Rs.update
  33. Rs.Close
  34. BackToSeaStr="select id,cs_updatetime,cs_claimdate,cs_claimFrom,cs_chain from customer where cs_claimFrom<>'' and cs_claimdate>'2023-01-01' and cs_deal<>3 and cs_belong="&Session("employee_id")
  35. Rs.Open BackToSeaStr,conn,3,1
  36. Do while Not Rs.bof And not Rs.eof
  37. If DATEDIFF("d",Rs("cs_claimdate"),now())>4 and DATEDIFF("s",Rs("cs_updatetime"),Rs("cs_claimdate"))=0 Then '已经认领但是认领后无更新
  38. myArray=split(Rs("cs_chain"),",")
  39. myLen=UBound(myArray)
  40. Litem=myArray(myLen)
  41. IF Litem+0=Rs("cs_claimFrom")+0 Then
  42. cs_chain=Rs("cs_claimFrom")
  43. Else
  44. cs_chain=Rs("cs_chain")&","&Rs("cs_claimFrom")
  45. End If
  46. updatestr="update customer set cs_belong="&Rs("cs_claimFrom")&" ,cs_chain='"&cs_chain&"' where id="&Rs("id")
  47. conn.execute(updatestr)
  48. ElseIf DATEDIFF("s",Rs("cs_claimdate"),Rs("cs_updatetime"))>0 Then '认领后更新,不参与判断
  49. updatestr="update customer set cs_claimdate='2022-12-31' where id="&Rs("id")
  50. conn.execute(updatestr)
  51. End If
  52. Rs.moveNext
  53. Loop
  54. Rs.close
  55. Rs.Open "Select count(id) from customer where cs_belong="&Session("employee_id"),conn,1,1
  56. Session("t")=Rs(0)
  57. Rs.close
  58. Rs.Open "Select count(id) from customer where cs_type=1 and cs_belong="&Session("employee_id"),conn,1,1
  59. Session("t1")=Rs(0)
  60. Rs.close
  61. Rs.Open "Select count(id) from customer where cs_type=2 and cs_belong="&Session("employee_id"),conn,1,1
  62. Session("t2")=Rs(0)
  63. Rs.close
  64. Rs.Open "Select count(id) from customer where cs_type=3 and cs_belong="&Session("employee_id"),conn,1,1
  65. Session("t3")=Rs(0)
  66. Rs.close
  67. Rs.Open "Select count(id) from customer where cs_type=4 and cs_belong="&Session("employee_id"),conn,1,1
  68. Session("t4")=Rs(0)
  69. Rs.close
  70. Rs.Open "Select count(id) from customer where cs_deal=3 and cs_belong="&Session("employee_id"),conn,1,1
  71. Session("d1")=Rs(0)
  72. Rs.close
  73. Rs.Open "Select count(id) from customer where cs_deal=2 and cs_belong="&Session("employee_id"),conn,1,1
  74. Session("d2")=Rs(0)
  75. Rs.close
  76. Rs.Open "Select count(id) from customer where DATEDIFF(DAY,cs_updatetime,getdate())>120 and cs_belong="&Session("employee_id"),conn,1,1
  77. Session("d3")=Rs(0)
  78. Rs.close
  79. Set Rs=Nothing
  80. conn.execute("insert into logRecord (loginName,loginTime,loginAct) values ('"&Session("employee_name")&"','"&now()&"','"&Session("employee_name")&" "&now()&"从"&IP&"登录')")
  81. Conn.Close:Set Conn=Nothing:Response.End
  82. Response.End
  83. End If
  84. %>