<% Response.Expires= -1 Response.ExpiresAbsolute = Now() - 1 response.CacheControl="no-cache" server.ScriptTimeout=50000 session.Timeout=60 dim alert_ip '如果客户端通过代理服务器,则取 HTTP_X_FORWARDED_FOR 的值,如果没通过代理服务器,就取 REMOTE_ADDR 的值 if Request.ServerVariables("HTTP_X_FORWARDED_FOR")="" OR InStr(Request.ServerVariables("HTTP_X_FORWARDED_FOR"),"unknown")>0 then ip=request.ServerVariables("REMOTE_ADDR") else ip=request.ServerVariables("HTTP_X_FORWARDED_FOR") end if %> <% if instr(alert_ip,ip)>0 and (request.ServerVariables("SERVER_NAME")="exam8.edu24ol.com" or request.ServerVariables("SERVER_NAME")="kc.exam8.com") then response.End() %> <% tid=checkstr(request("tid"),1) uid=checkstr(request("uid"),1) city=checkstr(request("city"),2) lid=checkstr(request("lid"),1) up_id=uid lid=checkstr(request("lid"),1) if checkstr(request("cmd"),2)="search" then Discountname=checkstr(request("Discountname"),2) price=checkstr(request("price"),1) lid=checkstr(request("lid"),1) strcontent="" if Discountname<>"" then strcontent=strcontent&" and Title like '%"&Discountname&"%'" end if select case price case 1 strcontent=strcontent&" and NewUserPrice>=200 and NewUserPrice<=500" case 2 strcontent=strcontent&" and NewUserPrice>=500 and NewUserPrice<=800" case 3 strcontent=strcontent&" and NewUserPrice>=800 and NewUserPrice<=1000" case 4 strcontent=strcontent&" and NewUserPrice>=1000" case else strcontent=strcontent end select if lid>0 then strcontent=strcontent&" and lesson_id="&lid end if end if if request.ServerVariables("SERVER_NAME")="exam8.edu24ol.com" or request.ServerVariables("SERVER_NAME")="kc.exam8.com" then set rs=server.CreateObject("adodb.recordset") sql="select total from ip_count where ip='"&ip&"' and page='"&request.ServerVariables("URL")&"'" rs.open sql,conn,1,3 if not(rs.bof or rs.eof) then if rs("total")>50 then set rs1=server.CreateObject("adodb.recordset") sql1="select * from ip_alert where ip='"&ip&"'" rs1.open sql1,conn,1,3 if rs1.bof or rs1.eof then rs1.addnew rs1("ip")=ip rs1.update AlertFile=Server.MapPath("IP_Alert.asp") Set fso=Server.CreateObject("Scripting.FileSystemObject") strFile="<" & "%alert_ip="&chr(34) set rs=server.CreateObject("adodb.recordset") sql="select ip from ip_alert group by ip" rs.open sql,conn,3 if not(rs.bof or rs.eof) then for i=1 to rs.recordcount if i=1 then strFile=strFile&rs("ip") else strFile=strFile&","&rs("ip") rs.movenext if rs.eof then exit for next end if strFile=strFile & chr(34) & "%" & ">" Set aFile = fso.CreateTextFile(AlertFile) aFile.WriteLine strFile aFile.close set aFile=Nothing end if else rs("total")=rs("total")+1 rs.update end if else sql="insert into ip_count(ip,page) values('"&ip&"','"&request.ServerVariables("URL")&"')" conn.execute(sql) end if end if '取出ClassNum所对应班名称 Function GetLessonName(lesson_id) if lesson_id>0 then Set Rs_t=Conn.Execute("select lesson from lessonset where lesson_id="&lesson_id&"") If Not Rs_t.Eof Then GetLessonName=Rs_t(0) End If Rs_t.Close Set Rs_t=Nothing else GetLessonName="其他类" end if End Function set rs=server.CreateObject("adodb.recordset") if lid>0 then sql="select top 1 lesson from lessonset where lesson_id="&lid&"" else sql="select top 1 lesson from lessonset where lesson_id="&uid&"" end if rs.open sql,conn,3 if not rs.eof then lessonName=rs("lesson") end if %> 面授班选课报名
<%=city%>面授<%=lessonName%>套餐
套餐名称: 价格区间: 套餐类别:
<% '输出套餐 if city="" then sqlstr=" and (city ='北京' or city ='')" else sqlstr=" and city='"&city&"'" end if if lid>0 then sqlstr=sqlstr&" and lesson_id="&lid else sqlstr=sqlstr&" and lesson_up="&uid end if set rs1=server.CreateObject("adodb.recordset") sql1="select id,Title,LessonNum,BookNum,PaperNum,NewUserPrice,OldUserPrice,TotalPrice,StartDate,EndDate,lesson_id,Content from Edu_Discount where type=4 and isshow=1 "&sqlstr&" and isdel=0 and isCheck=1 and isCheck2=1 "&strcontent&" order by lesson_id desc,Showlist asc" rs1.open sql1,conn,3 if Not rs1.eof then %>
<% Pre_lesson_id=-1 do while not rs1.eof if not(rs1("lesson_id")=Pre_lesson_id) then response.write("") end if '如果课程的开始时间和结束时间不为空时,检查套餐是否过期 overdue=0 '过期标志 if rs1("StartDate")<>"" and rs1("EndDate")<>"" then if cdate(rs1("StartDate"))>now() or now()>dateadd("d",cdate(rs1("EndDate")),1) then overdue=1 end if end if if overdue=0 then %> " style="display:none;"> <% end if Pre_lesson_id=rs1("lesson_id") rs1.movenext loop %>
套餐名称 套餐说明 报名 套餐价格 原价 详细
* * "&GetLessonName(rs1("lesson_id"))&" * *
<%=rs1("Title")%> <%=rs1("Content")%> <%=rs1("NewUserPrice")%>元 <%=rs1("TotalPrice")%>元 )">"/>
<% set rs2=server.CreateObject("adodb.recordset") sql2="select a.price,c.lesson,b.classnum,d.class_type_name from Edu_DiscountDetail a inner join ClassSet b on a.ProductId=b.Class_id and a.CataId=1 and a.DiscountId="& rs1("Id") &" inner join Lessonset c on b.lesson_id=c.Lesson_id left outer join HQFS_CLASS_TYPE d on b.classnum=d.classnum" rs2.open sql2,conn,3 do while not rs2.eof %> <% rs2.movenext loop if rs1("BookNum")>0 then %> <% set rs2=server.CreateObject("adodb.recordset") sql2="select a.price,b.title from Edu_DiscountDetail a inner join Edu_Book b on a.ProductId=b.id and a.CataId=2 and a.DiscountId="& rs1("Id") rs2.open sql2,conn,3 do while not rs2.eof %> <% rs2.movenext loop End If if rs1("PaperNum")>0 then %> <% set rs2=server.CreateObject("adodb.recordset") sql2="select a.price,b.cost,b.title from Edu_DiscountDetail a inner join Edu_Paper b on a.ProductId=b.id and a.CataId=3 and a.DiscountId="& rs1("Id") rs2.open sql2,conn,3 do while not rs2.eof %> <% rs2.movenext loop End if %>
套餐名称:<%=rs1("Title")%> 原价:<%=rs1("TotalPrice")%>元 新学员价:<%=rs1("NewUserPrice")%>元 老学员价:<%=rs1("OldUserPrice")%>元
产品包中包含的课程:
<%=rs2("Lesson")&rs2("class_type_name")&"(原价:"&rs2("price")&"元)"%>
产品包中包含的图书资料:
<%=rs2("title")&"(原价:"&rs2("price")&"元)"%>
产品包中包含的试卷资料:
<%=rs2("title")&"(原价:"&rs2("cost")&"元)"%>
<%End if%>