<!--#include file="../../p_inc/Include_func.asp"-->
<!--#include file="../inc/classDbPager.asp"-->
<!--#include file="../inc/public.asp"-->
<!--#include file="../inc/openconn.asp"-->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>批量生成HTML</title>
<LINK href="../css/style.css" rel=stylesheet type=text/css></head>
</head>
<body bgcolor="#799AE1" >
<script>
 var sett;
 var i=1;
function $(id){return document.getElementById(id)}
function scrollWindow(){this.scroll(0, 6500000);sett=setTimeout('scrollWindow()',1);}
scrollWindow();
function scrollWindow2(){
if (i%2==1)
	clearTimeout(sett)
else
	scrollWindow();
	i++;
}
document.ondblclick=scrollWindow2;
</script>
<script>
function CheckC(form,name){

  for (var i=0;i<form.elements.length;i++)
    {
    var e = form.elements[i];
    if (e.className == name )
       eval("e.checked = form."+name+".checked;")
    }
}
</script>

<%
Response.Buffer=True
response.contenttype="text/html;charset=gb2312"
Server.ScriptTimeOut=9999999

bf=Request("bf")
IF bf="a" Then 
	sTitle="播放"
Else
	sTitle="详细"
End IF
SessionToTxt "selAnnounce","","0"


IF request("action")=1 Then
	IF request("TopNew")>0 Then
		today_sql="select top "&request("TopNew")&" id from qingtiandy_News order by n_date desc, id Asc"
		set m_totle_day=conn.execute(today_sql)
		Do While Not m_totle_day.Eof
			SessionToTxt "selAnnounce",m_totle_day(0),","
			m_totle_day.movenext
		Loop
		axc_1=SessionToTxt("selAnnounce","","00")
		axc_1=PrintArray(axc_1,",")	
		SessionToTxt "selAnnounce",axc_1,"000"	
		Response.Write "<script language=javascript>location.href='"&"../makehtml/makedetailNews.asp?selAnnounce=00000000&back2=../qingtiandy_News/index.asp&bf="&bf&"';</script>"
		response.End()
	End IF
ElseIF request("action")=2 Then
	StartId=StayNub(request("StartId"))
	EndID=StayNub(request("EndID"))
	If StartId = "" Then str_=str_&"<li>开始ID不能为空</li>"
	IF EndID = "" Then str_=str_&"<li>结束ID不能为空</li>"
	IF Cint(StartId) < 1 Then str_=str_&"<li>开始ID不能小于1</li>"
	IF Cint(StartId) > Cint(EndID) Then str_=str_&"<li>开始ID不能大于结束ID</li>"
	IF str_<>"" Then
		Response.Redirect("../error.asp?ErrCodes="&Server.URLEncode(str_)&"&ErrorUrl=")
		response.End()
	End IF	
	S_sql="select id from qingtiandy_News where id>="&StartId&" And id<="&EndID&" order by id asc"
	set m_totle_day=conn.execute(S_sql)
	Do While Not m_totle_day.Eof
		SessionToTxt "selAnnounce",m_totle_day(0),","
		m_totle_day.movenext
	Loop
	axc_1=SessionToTxt("selAnnounce","","00")
	axc_1=PrintArray(axc_1,",")	
	SessionToTxt "selAnnounce",axc_1,"000"
	Response.Write "<script language=javascript>location.href='"&"../makehtml/makedetailNews.asp?selAnnounce=00000000&back2=../qingtiandy_News/index.asp&bf="&bf&"';</script>"
	response.End()	


End IF
%>
<table border="0" cellspacing="1" cellpadding="3" align=center class="tableBorder"> 
    <tr> 
      <td width="18%" height=40 class="forumRowHighlight"><strong>（按时间排序生成）：</strong></td> 
      <td width="82%" class="forumRowHighlight"><form name='form1' method='post' action='?action=1' >生成最新 <input name='TopNew' id='TopNew' value='10' size=8 maxlength='10'><input type="hidden" value="<%=bf%>" name="bf">
      条新闻<%=sTitle%>页信息  
          <input name='submit' type='submit' id='submit' value='开始生成>>'>&nbsp;&nbsp;&nbsp;&nbsp;<a href="makedetail_all_News.asp?all=all&bf=<%=bf%>">>>生成所有新闻<%=sTitle%>静态页面</a></form></td>
    </tr>
    <tr> 
      <td width="18%" height=40 class="forumRowHighlight"><strong>（按ID生成）：</strong></td> 
      <td width="82%" class="forumRowHighlight">
	  <form name='form1' method='post' action='?action=2' >
	  <input type="hidden" value="<%=bf%>" name="bf">
	  开始ID：<input name='StartId' id='StartId' value='1' size=8 maxlength='10'>
      结束ID：<input name='EndId' id='EndId' value='100' size=8 maxlength='10'> 
          <input name='submit' type='submit' id='submit' value='开始生成>>'>
	  </form></td>
    </tr>	
    <tr> 
      <td width="18%" height=40 class="forumRowHighlight"></td> 
      <td width="82%" class="forumRowHighlight"><input name='submit' type='submit' id='submit' value='开始生成>>'>
	  </td>
    </tr>		
	</form>
    </table>
	</body>
	</html>