<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%> <%Session.CodePage=65001 Response.Charset = "utf-8"%> <%datapath="../"%> <%id=int(EW_Char.checkchar(EW_Char.requestFun("id"),0)) set rs=conn.execute("select * from ZH_xuexi where id=" & id) if rs.eof then call EW_Char.funshow("该专业资料不存在","index.html",1) sid=int(EW_Char.checkchar(EW_Char.requestFun("sid"),0)) if u_id<=0 then call EW_Char.funshow("请先登录","info" & id & ".html",1) userid=0 tempfalg=false set rs2=conn.execute("select * from BZ_Users where username='" & username & "'") if not rs2.eof then userid=rs2("userid") if userid=0 then userid=rs2("id") end if rs2.close set rs2=nothing u_id=userid if not sid=1 and not sid=2 then call EW_Char.funshow("参数有误","info" & id & ".html",1) else downurl=rs("downurl") if not EW_Fso.EW_FileExists("../" & downurl) then call EW_Char.funshow("下载文件不存在,请与客服联系","Learn/info" & id & ".html",1) else lookjifen=0 set rs2=conn.execute("select jifen from BZ_Users_DownorLook where userid=" & u_id & " and conid=" & id & " and sortid=1") if not rs2.eof then do while not rs2.eof lookjifen=lookjifen+rs2("jifen")*1 rs2.movenext loop end if rs2.close set rs2=nothing downjifen=int(EW_Char.checkchar(rs("downjifen"),0)) lookjifen=downjifen-lookjifen if lookjifen>u_jifen then call EW_Char.funshow("您当前帐户包装币余额不足,请先充值","../member/jifenpay.asp?act=edit",1) if lookjifen<=0 then lookjifen=0 set rs2=conn.execute("select * from BZ_Users_DownorLook where userid=" & u_id & " and conid=" & id & " and sortid=2 and downorlook=1") if not rs2.eof then cishu=int(EW_Char.checkchar(rs2("cishu"),0))+1 conn.execute("update BZ_Users_DownorLook set cishu=" & cishu & ",jointime='" & now & "' where userid=" & u_id & " and conid=" & id & " and sortid=2 and downorlook=1") lookjifen=0 else conn.execute("insert into BZ_Users_DownorLook (title,userid,conid,sortid,jifen,downorlook,jointime,cishu) values('" & rs("title") & "'," & u_id & "," & id & ",2," & lookjifen & ",1,'" & now & "',1)") end if rs2.close set rs2=nothing if lookjifen>0 then u_jifen=u_jifen-lookjifen conn.execute("update BZ_Users set jifen=" & u_jifen & " where id=" & u_id) end if downclick=int(EW_Char.checkchar(rs("downclick"),0)) '跳转到下载页面 downclick=downclick+1 conn.execute("update ZH_Xuexi set downclick=" & downclick & " where id=" & id) 'downurl=EW_Char.replaceFun(downurl,"downimg/" , "") call EW_Updown.updown(downurl,"..") end if end if rs.close set rs=nothing %>