<%
'=================================
'过程名：readzxkk
'作用：阅读最新开课
'函数说明：在需要调用最新开课的地方插入<% call readzxkk(m,n)% >即可
'其中形式参数“m”为你想要调用的动态条数，形式参数“n”为标题的长度，防止长标题挤乱表格
'=================================

sub readzxkk(m,n)
	dim sql
	sql="select top "&m&" * from news where smallclassname='开班通知'order by ord desc,id desc"
	set rs = conn.execute(sql)
	if rs.bof and rs.eof then
		response.write("<table><tr><td>暂无记录</td></tr></table>")
	else

	
	%>
	<table width="100%" border="0" cellspacing="0" cellpadding="0">
	<%
	while not rs.eof
		if len(rs("title"))>n then
		stitle=left(rs("title"),n)&"..."
	else
		stitle=rs("title")
	end if
	%>
    <tr>
    <td width="17"><img src="images/cion.jpg" width="11" height="11" /></td>
    <td height="22"><a href="shownews.asp?id=<%=rs("id")%>" target="_blank" title="<%=rs("title")%>"><%=stitle%></a></td>
    </tr>	<tr>
      <td height="1" colspan="2" background="images/dian.gif"></td>
      </tr>
	<%
	rs.movenext
	wend
	%>

</table>
<%
	rs.close
	set rs=nothing
	end if
end sub
'=================================
'过程名：readnews
'作用：阅读新闻内容
'函数说明：在需要调用最新开课的地方插入<% call readnews(m,n,nclass)% >即可
'其中形式参数“m”为你想要调用的动态条数，形式参数“n”为标题的长度，防止长标题挤乱表格,nclass为类别名称
'=================================

sub readnews(m,n,nclass)
	dim sql
	sql="select top "&m&" * from news where smallclassname='"&nclass&"'order by ord desc,id desc"
	set rs = conn.execute(sql)
	if rs.bof and rs.eof then
		response.write("<table ><tr><td>暂无记录</td></tr></table>")
	else
	%>
	<table width="100%" border="0" cellspacing="0" cellpadding="0">
	<%
	while not rs.eof
		if len(rs("title"))>n then
		stitle=left(rs("title"),n)&"..."
	else
		stitle=rs("title")
	end if
	i=i+1
	%>
    <tr <%if i mod 2=1 then response.write" bgcolor='#f4f4f4'"%>>
    <td width="17"><img src="images/PLUS.GIF" ></td>
    <td width="813" height="22"><a href="shownews.asp?id=<%=rs("id")%>" target="_blank" title="<%=rs("title")%>"><%=stitle%></a></td>
    <td width="145"  ><%=rs("addtime")%></td>
    </tr>
    
	<%
	rs.movenext
	wend
	%>
</table>
<%
	rs.close
	set rs=nothing
	end if
end sub
%>