Jb51 generates results for all pages + generate original pages

Source: Internet
Author: User

CopyCode The Code is as follows: <! -- # Include file = "conn. asp" -->
<Style type = "text/CSS">
Body, TD, Th {
Color: #000000;
Font-size: 14px;
Background-color: # d6dff7;
}
</Style>
<%
Dim rs
Set rs = server. Createobject ("ADODB. recordset ")
If request ("type") = "date" then
Yearstr = request ("selyear ")
Monstr = request ("selmonth ")
Daystr = request ("selday ")
If daystr <> "" then
Theymd = yearstr & "-" & monstr & "-" & daystr
SQL = "select ID from news where datetime like '" & theymd & "% 'order by datetime DESC"
Else
Theymd = yearstr & "-" & monstr &"-"
SQL = "select ID from news where datetime like '" & theymd & "% 'order by datetime DESC"
End if
Elseif request ("type") = "new" then
Topnew = request ("newcount ")
If topnew <> "then
Topnew = CINT (topnew)
SQL = "select top" & topnew & "id from news order by datetime DESC"
End if
Elseif request ("type") = "nosh" then
SQL = "select ID from news where shengcheng = 0"
Elseif request ("type") = "all" then
SQL = "select ID from news order by ID DESC"
End if
If SQL <> "" then
Response. Write SQL
Response. Write "<center> <B> <font color =" "# ff0000" "> generating Article The HTML page of the content page. Please wait ...... </font> </B> <span id = showimport> </span> </center> <ie: Download id = "" odownload "" style = "" behavior: URL (# default # download) ""/>"
If request ("p") <> "then
P = CINT (Request ("p "))
Else
P = 1
End if
Maxperpage = 100
Rs. Open SQL, Conn, 1, 1
If not Rs. EOF then
Rs. pagesize = maxperpage
Mpage = Rs. pagecount 'to get the total number of pages
Allshu = Rs. recordcount 'to get the total number
Rs. Move (p-1) * maxperpage
Do while not Rs. EOF
I = I + 1
Call makehtml ()
If I> = maxperpage then exit do
Rs. movenext
Loop
End if
Rs. Close
Sshu = maxperpage * P-maxperpage + 1 'current generated quantity
Tshu = sshu + I-1 'generated
If allshu <sshu then
Set rs = nothing
Conn. Close
Set conn = nothing
Response. Redirect "makehtmlall. asp? Type = OK "&" & Shu = "& request (" Shu ") &" & D = "& D &" & P = "& P + 1
Response. End
Else
%>
<Meta http-equiv = "refresh" content = "0; url = makehtmlall. asp? Type = <% = request ("type") %> & newcount = <% = request ("newcount") %> & selyear = <% = request ("selyear ") %> & selmonth = <% = request ("selmonth") %> & selday = <% = request ("selday ") %> & Shu = <% = tshu %> & D = <% = D %> & P = <% = P + 1%> ">
<Div align = "center"> <br> generating: Nth (<% = sshu %>/<% = tshu %>) total <% = allshu %> </div>
<%
End if
Sub makehtml ()
%>
<SCRIPT> function ondownloaddone (downdate) {showimport. innerhtml = downdate} odownload. startdownload ('makehtml. asp? News_id = <% = RS ("ID") %> ', ondownloaddone)
</SCRIPT>
<%
End sub
'----------------------- SQL is empty -------------------
Else
Set rstotal=conn.exe cute ("select count (*) from News ")
Nowtotal = rstotal (0)
Rstotal. Close
Set rstotal = nothing
Set nosh1_conn.exe cute ("select count (*) from news where shengcheng = 0 ")
Nownosh = nosh (0)
Nosh. Close
Set nosh = nothing
'-------------------
If request ("type") = "OK" then
%> <Div align = "center">
<Br> operation successful: symbiosis page
<Font color = "# ff0000"> <% = request ("Shu") %> </font>, completion time <% = now () %>
</Center>
<%
End if
'-------------------------
%>
<Table width = "511" border = "0" align = "center" cellpadding = "10" cellspacing = "1" bgcolor = "# ffffff">
<Form action = "makehtmlall. asp? Type = Date "method =" Post "> <tr>
<TD width = "99" Height = "25" nowrap bgcolor = "# d6dff7"> generated by date: </TD>
<TD width = "369" nowrap bgcolor = "# d6dff7"> <select name = "selyear">
<%
For yearstr= 2001 to year (date)
If yearstr = year (date) then
Response. Write "<option value =" & yearstr & "selected>" & yearstr & "</option>"
Else
Response. Write "<option value =" & yearstr & ">" & yearstr & "</option>"
End if
Next
%>
</SELECT>-
<Select name = "selmonth">
<%
For monstr = 1 to 12
If monstr = month (date) then
Response. Write "<option value =" & monstr & "selected>" & monstr & "</option>"
Else
Response. Write "<option value =" & monstr & ">" & monstr & "</option>"
End if
Next
%>
</SELECT>-
<Select name = "selday">
<Option value = "> </option>
<%
For daystr = 1 to 31
If daystr = Day (date) then
Response. Write "<option value =" & daystr & "selected>" & daystr & "</option>"
Else
Response. Write "<option value =" & daystr & ">" & daystr & "</option>"
End if
Next
%>
</SELECT>
<Input type = "Submit" name = "Submit" value = "generate"> </TD>
</Tr>
</Form>
<Form action = "makehtmlall. asp? Type = new "method =" Post ">
<Tr>
<TD Height = "25" nowrap bgcolor = "# d6dff7"> Based on the latest generation: </TD>
<TD nowrap bgcolor = "# d6dff7"> Generate the latest
<Input name = "newcount" type = "text" id = "newcount" size = "10">
Articles
<Input type = "Submit" name = "submit2" value = "generate"> </TD>
</Tr>
</Form>
<Form action = "makehtmlall. asp? Type = nosh "method =" Post ">
<Tr>
<TD Height = "25" nowrap bgcolor = "# d6dff7"> not generated: </TD>
<TD nowrap bgcolor = "# d6dff7"> currently, You need to generate an article [<font color = "red"> <% = nownosh %> </font>]
<Input type = "Submit" name = "submit4" value = "generate"> </TD>
</Tr>
</Form>
<Form action = "makehtmlall. asp? Type = all "method =" Post ">
<Tr>
<TD Height = "25" nowrap bgcolor = "# d6dff7"> Generate all: </TD>
<TD nowrap bgcolor = "# d6dff7"> total [<font color = "red"> <% = nowtotal %> </font>]
<Input type = "Submit" name = "submit3" value = "generate"> </TD>
</Tr>
</Form>
</Table>
<%
End if
%>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.