%Response.Expires= -1
Response.ExpiresAbsolute = Now() - 1
response.CacheControl="no-cache"
server.ScriptTimeout=50000
%>
<%
id=checkstr(request("id"),1)
'获得教师照片
Function GetPicture(Picture,Sex)
If Picture="" Then
If Sex=1 Then
GetPicture="/web_teacher/images/default_male.gif"
else
GetPicture="/web_teacher/images/default_male.gif"
end if
Else
GetPicture="/web_teacher/images/" & Picture
End If
End Function
'获得教师所教课程
Function GetLesson(TeacherID)
strTemp=""
strSql="select lesson from lessonset where lesson_id in (select lesson_up from classset where class_id in (select class_id from edu_TeacherPurview where teachclass like '%,"&TeacherID&",%')) and show=1"
Set rstemp=Server.CreateObject("adodb.Recordset")
rstemp.Open strSql,conn,3
Do until rstemp.EOF
strTemp=strTemp & "," & rstemp(0)
rstemp.MoveNext
Loop
If Len(strTemp)>0 Then
If left(strTemp,1)="," Then strTemp=Mid(strTemp,2) ' 去掉前面的逗号
End if
GetLesson=strTemp
rstemp.Close
Set rstemp=Nothing
End Function
' 得到当前课程大类中的所有的老师的ID值
Function GetTeacher(LessonID)
strTeacher=""
strSql="select teachclass from edu_teacherpurview where class_id in(select class_id from classset where lesson_up in(select lesson_id from lessonset where up_id="&LessonID&") and website=3)"
Set rstemp=server.createobject("adodb.recordset")
rstemp.open strSql,conn,3
Do until rstemp.EOF
strTeacher=strTeacher & rstemp("teachclass") & ","
rstemp.MoveNext
Loop
GetTeacher=replace(strTeacher,",0","") & "0"
rstemp.Close
set rstemp=nothing
End Function
%>
<% ' 判断是否找到老师
sql="select Top 1 * from edu_person where teacher_id="& id &" and show=1 and cataid<>2 "
set rst=server.createobject("adodb.recordset")
rst.open sql,conn,3
if not(rst.eof or rst.bof) then
bloglink=checkstr(rst("bloglink"),2)
if bloglink="" then bloglink="http://blog.edu24ol.com/"
teacher_pic=rst("pic")
teacher_sex=rst("sex")
teacher_name=rst("name")
teacher_Education=rst("Education")
teacher_ProTitle=rst("ProTitle")
teacher_College=rst("College")
teacher_list=rst("list")
teacher_video=rst("video")
end if
rst.close
set rst=nothing
%>
<%
'取得所有老师的信息
set rs=server.CreateObject("adodb.recordset")
sql="select a.lesson_id,a.lesson,b.teachclass from lessonset a,Edu_TeacherPurview b where a.up_id=0 and cataid=1 and b.class_id in (select class_id from classset where lesson_up in (select lesson_id from lessonset where up_id=a.lesson_id) and website=3) group by a.lesson_id,a.lesson,b.teachclass order by a.lesson_id"
rs.open sql,conn,3
if not(rs.bof or rs.eof) then
redim tlesson_id(rs.recordcount-1),tlesson(rs.recordcount-1),tteachclass(rs.recordcount-1)
n=0
m=0
for i=1 to rs.recordcount
if n<>rs("lesson_id") then
n=rs("lesson_id")
tlesson_id(i-1)=rs("lesson_id")
tlesson(i-1)=rs("lesson")
m=m+1
end if
tteachclass(i-1)=rs("teachclass")
rs.movenext
if rs.eof then exit for
next
end if
redim lesson_id(m-1),lesson(m-1),teachclass(m-1)
n=0
for i=0 to ubound(tlesson_id)
if tlesson_id(i)>0 then
lesson_id(n)=tlesson_id(i)
lesson(n)=tlesson(i)
teachclass(n)=tteachclass(i)
n=n+1
else
teachclass(n-1)=teachclass(n-1)&","&tteachclass(i)
end if
next
sngtimer11=timer-sngtimer
For i=0 to ubound(lesson_id)
%>
<%
' 得到属于当前大类的所有的老师
sql="select teacher_id,name from edu_person where teacher_id in ("&teachclass(i)&") and show=1 and cataid<>2 order by shownum,teacher_id"
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,3
if not(rs.bof or rs.eof) then
For ii=1 to rs.Recordcount
response.Write "