<%
Response.Expires= -1
Response.ExpiresAbsolute = Now() - 1
response.CacheControl="no-cache"
server.ScriptTimeout=50000
%>
<!--#include file="conn/conn.asp"-->
<!--#include file="functions/dofunction.asp"-->
<%
'取出newcateid所对应名称
Function GetNewcatename(newcata_ID)

  Set Rs_t=Conn.Execute("select title from edu_cataid where id="&newcata_ID&"")
  If Not Rs_t.Eof Then
   GetNewcatename=Rs_t(0)
  End If
  Rs_t.Close
  Set Rs_t=Nothing
  
End Function


'取出lesson_id所对应名称
Function GetLessonname(lesson_id)

  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
  
End Function

nctid=checkstr(request("nctid"),1)
leupid=checkstr(request("leupid"),1)
newsubid=checkstr(request("newsubid"),1)
if nctid=0 then nctid=320
	
if nctid>0 then
	SqlContent=SqlContent&" and newcataid="&nctid
end if

if leupid>0 then
	SqlContent=SqlContent&" and lesson_up="&leupid
end if
	
if newsubid>0 then
	SqlContent=SqlContent&" and newsubid="&newsubid
end if

if nctid=299 then
	showtitle="招生简章"
else
	if leupid>0 then showtitle=GetLessonname(leupid)&":"&GetNewcatename(newsubid) else showtitle=GetNewcatename(newsubid)
end if
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title><%=showtitle%> - 环球职业面授中心</title>
<link href="css/header.css" rel="stylesheet" type="text/css" />
<link href="/css/news.css" rel="stylesheet" type="text/css" />
</head>

<body>
<!--#include file="include/header.htm"-->
<div id="main">
	<div class="left">
    	<div class="marB">
		<img src="/images_2009/list_bg.jpg" width="213" height="122" />
		
		</div>
		<div class="t01">面授招生信息</div>
		<ul class="con">
		<%
			sql="select top 15 cast(title as varchar(26)) as showtitle,title,t_color,htmlpath,html,addlink from edu_news where newcataid=299 and isshow=1 order by shownum,addtime desc"
			set rs=server.createobject("adodb.recordset")
			rs.open sql,conn,3
			if not(rs.eof or rs.bof) then
			do while not rs.eof 
				if rs("addlink")="" or isnull(rs("addlink")) then
					newslink="/ms/web_news/html/"&rs("htmlpath")&"/"&rs("html")
				else
					newslink=rs("addlink")
				end if
			
				response.Write("<li><a href="&newslink&" target=""_blank"" title="""&rs(1)&""">"&rs(0)&"</a></li>")
				rs.movenext
			loop
			end if
			rs.close
			set rs=nothing
		%>
		</ul>
		<div class="t01">面授资讯</div>
		<ul class="con">
		<%
			sql="select top 15 cast(title as varchar(26)) as showtitle,title,t_color,htmlpath,html,addlink from edu_news where newcataid=320 and isshow=1 order by shownum,addtime desc"
			set rs=server.createobject("adodb.recordset")
			rs.open sql,conn,3
			if not(rs.eof or rs.bof) then
			do while not rs.eof 
				if rs("addlink")="" or isnull(rs("addlink")) then
					newslink="/ms/web_news/html/"&rs("htmlpath")&"/"&rs("html")
				else
					newslink=rs("addlink")
				end if
			
				response.Write("<li><a href="&newslink&" target=""_blank"" title="""&rs(1)&""">"&rs(0)&"</a></li>")
				rs.movenext
			loop
			end if
			rs.close
			set rs=nothing
		%>
		</ul>
	</div>
	<div class="right">
		<div class="positon"><a href="/">环球职业面授中心</a><%
		
		if nctid>0 then ntitle=replace(" >> <a href=/ms/news_list.asp?nctid="&nctid&">"&GetNewcatename(nctid),"面授课程","招生简章")&"</a>"
		if newsubid=790 then
			links="kszn.htm"
		elseif newsubid=791 then
			links="fdtk.htm"
		else
			links="/ms/news_list.asp?newsubid="&newsubid
		end if
		if newsubid>0 then ntitle=ntitle&" >> <a href="&links&">"&GetNewcatename(newsubid)&"</a>"
		if leupid>0 then ntitle=ntitle&" >> "&GetLessonname(leupid)
		response.Write(ntitle)
		%></div>
		<div class="t02"><span class="more"></span>
		<%
		if nctid>0 then ntitle=replace(GetNewcatename(nctid),"面授课程","招生简章")
		if newsubid>0 then ntitle=GetNewcatename(newsubid)
		if leupid>0 then ntitle=GetLessonname(leupid)
		response.Write(ntitle)
		%>
		</div>
			<ul class="con_grey">
					<%
					
					sql="select count(0) from edu_news where isshow=1 "&SqlContent&""
					set rs=server.CreateObject("Adodb.recordset")
					rs.open sql,conn,3
					'=================rows为记录总数============
					rows=rs(0)
					'==============maxrows为每页最大记录数==============
					maxrows=30
					'====================pagecou为共多少页==================
					pagecou=rows\maxrows
					if rows >(maxrows * pagecou) then pagecou=pagecou+1
					'=================curpage为当前页次============
					if checkstr(Request("page"),1)=0 then curpage=1 else curpage=checkstr(Request("page"),1)
					spage=maxrows*curpage
					if curpage=pagecou and rows mod maxrows>0 then n=rows mod maxrows else n=maxrows
					startno=maxrows*(curpage-1)+1
				
					ids="0"	
					set rs=server.CreateObject("adodb.recordset")
					
					sql="SELECT * from(select ROW_NUMBER() OVER(ORDER BY ID desc) as rowNum,id from edu_news  where  isshow=1 "&SqlContent&" ) G0 where rowNum>"&spage-maxrows&" and rowNum<="&spage&""

				    rs.open sql,conn,3
					if not(rs.bof or rs.eof) then
						rs.Movelast
						for i=1 to n
							if rs.bof or rs.eof then exit for
							ids=ids&","&rs("id")
							rs.MovePrevious
						next
					else
						ids=0
					end if
					find_ids=" and id in ("&ids&")"
					set rs=server.CreateObject("adodb.recordset")
					sql="select title,t_color,htmlpath,html,addlink,right(CONVERT(varchar(12),addtime,23),5) AS add_time from edu_news where isshow=1 "&find_ids&" order by addtime desc"
					rs.open sql,conn,3
					do until rs.eof
					
					if rs("addlink")="" or isnull(rs("addlink")) then
						newslink="/ms/web_news/html/"&rs("htmlpath")&"/"&rs("html")
					else
						newslink=rs("addlink")
					end if
					%>
					<li><a href="<%=newslink%>" target="_blank" title="<%=rs(0)%>"><%=rs(0)%></a> <span class="day_list"><%=rs(5)%></span></li>
					<%
					rs.movenext
					loop
					rs.close
					set rs=nothing
					%>				  
			</ul>
			
		<div style="width:716px;height:24px;line-height:24px;">
					共<%=pagecou%>页　　当前第<%=curpage%>页 <strong>[</strong><a href="news_list.asp?page=1&amp;nctid=<%=nctid%>&amp;leupid=<%=leupid%>&amp;newsubid=<%=newsubid%>">首页</a><strong>]</strong>
					<%if curpag>1 then%>
					<strong>[</strong><a href="news_list.asp?page=<%=curpage-1%>&amp;nctid=<%=nctid%>&amp;leupid=<%=leupid%>&amp;newsubid=<%=newsubid%>">上一页</a><strong>]</strong>
					<%end if%>
					<%if curpage<pagecou then%>
					<strong>[</strong><a href="news_list.asp?page=<%=curpage+1%>&amp;nctid=<%=nctid%>&amp;leupid=<%=leupid%>&amp;newsubid=<%=newsubid%>">下一页</a><strong>]</strong>
					<%end if%>
					<strong>[</strong><a href="news_list.asp?page=<%=pagecou%>&amp;nctid=<%=nctid%>&amp;leupid=<%=leupid%>&amp;newsubid=<%=newsubid%>">最后一页</a><strong>]</strong>
		</div>
			
			
	</div>
	<br class="cls" />
</div>
<!--#include file="include/footer.htm"-->
<%
conn.close
set conn=nothing
%>
</body>
</html>
