<!--#include file="conn.Asp"-->
<!--#include file="function.Asp"-->
<%CheckAdmin3%>
<html>
<head>
<title>歌词生成控制台</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>
<style>
td{font-size:9pt;line-height:160%} 
body{font-size:9pt;line-height:160%} 

a:link       { color: #0033CC; text-decoration: none }
a:visited    { color: #0033CC; text-decoration: none }
a:active     { color: #FF0000; text-decoration: none }
a:hover      { color: #000000; text-decoration: underline}
</style>

<body>
<%
Ds=timer()
set rs=server.createobject("adodb.recordset")
if request("type")="list" then
 if request("classid")<>"" then
  rs.open ("select * from class where classid like '"&request("classid")&"'"),conn,1,1
  if not rs.eof then
   do while not rs.eof
   sqqq=sqqq& ""&rs("classid")&", "
   rs.MoveNext
   loop
  end if
  rs.close
  sql="select id from musiclist where classid in ("&sqqq&")"
 end if
' '按起始ID生成
'  elseif request("type")="isid" then
'  startid = trim(request("startid"))
'  endid = trim(request("endid"))
'   sql="select id from musiclist where id >="&startid&" and id<="&endid&""  
   
 elseif request("type")="new" then
  if request("newshu")>0 then
   sql="select top "&cint(request("newshu"))&" id from musiclist order by id desc"
  end if
elseif request("type")="JyDownID" then
  JyDownID=replace(request("JyDownID"),",",", ")
  sql="select id from musiclist where id in("&JyDownID&")"
elseif request("type")="all" then
  sql="select id from musiclist order by id desc"
elseif request("type")="SpecialID" then '按专辑生成
  SpecialID=replace(replace(request("SpecialID"),",",", "),"，",",")
  sql="select id from musiclist where SpecialID in("&SpecialID&")"
end if

if sql<>"" then
response.write"<b><font color=""#FF0000"">正在生成歌曲歌词页面,请等待......</font></b><span id=showImport></span><IE:Download ID=""oDownload"" STYLE=""behavior:url(#default#download)"" />"
   if request("p")<>"" then
     p=cint(request("p"))
     D=request("D")
   else
     p=1
     D=Ds
   end if
MaxPerPage=100
response.write sql
rs.open sql,conn,1,1
if not rs.eof then
rs.pagesize=MaxPerPage '得到每页数
mpage=rs.pagecount     '得到总页数
allshu=rs.recordcount  '得到总数
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
Tshu=Sshu+i-1

if allshu<Sshu then
 set rs=nothing
 conn.close
 set conn=nothing
 response.redirect "make_gcall.asp?type=ok&type2="&request("type")&"&shu="&request("shu")&"&D="&d&"&p="&p+1&""
 response.end
 
else
 response.write"<meta http-equiv=""refresh"" content=""0;url='make_gcall.asp?type="&request("type")&"&SpecialID="&request("SpecialID")&"&JyDownID="&request("JyDownID")&"&ts="&request("ts")&"&newshu="&request("newshu")&"&Dyear="&request("Dyear")&"&Dmonth="&request("Dmonth")&"&Dday="&request("Dday")&"&shu="&Tshu&"&D="&D&"&p="&p+1&"'"">"
 response.write"<br>正在生成:第("&Sshu&"-"&Tshu&")个 共"&allshu&"个"
end if

Sub MakeHtml()
response.write"<script>function onDownloadDone(downDate){showImport.innerHTML=downDate}oDownload.startDownload('make_gc.asp?jim="&rs("id")&"',onDownloadDone)</script>"
end Sub

else
sql="select count(*) from musiclist"
rs2=conn.execute(sql)
shu=rs2(0)
set rs=nothing
conn.close  
set conn=nothing
response.write"<b>批量生成音乐歌词器页面"
if request("type")="ok" then
if request("type2")="JyDownID" then
response.write("<script>alert('成功:共生成歌词页面("&request("shu")&")个,总费时("&FormatNumber((timer()-request("D")),2)&")秒,完成时间("&Now()&")\n\n点击[确定]返回');history.go(-1)</script>")
response.end
else
response.write"<br><br>操作成功:共生成歌词页面<font color=""#FF0000"">"&request("shu")&"</font>个,总费时<font color=""#FF0000"">"&FormatNumber((timer()-request("D")),2)&"</font>秒,完成时间"&Now()&""
end if
end if
response.write"<br><li><form name=pdd method=""post"" action=""make_gcall.asp?type=SpecialID"">"
response.write"按专集生成<input size=8 name=""SpecialID"" value=""0"">输入专辑ID,如要生成多个专辑,请用逗号分开<input name=""change"" class=""buttonface"" value=""确认"" type=""submit""></form></li>"

response.write"<br><li><form name=pdd method=""post"" action=""make_gcall.asp?type=new"">"
response.write"生成最新<input size=8 name=""newshu"" value=""0"">个歌词器Html页<input name=""change"" class=""buttonface"" value=""确认"" type=""submit""></form></li>"

'response.write"<br><li><form name=formisid method=post action=""make_gcall.asp?type=isid"">"
'response.write"起始ID<input size=8 name=startid>&nbsp;结束ID<input size=8 name=endid><input name=change class=buttonface value=确认 type=submit onClick='return checkisid()'></form></li>"

response.write"<li><form name=pid method=""post"" action=""make_gcall.asp?type=all"">生成所有歌词器Html页<input name=""change"" class=""buttonface"" value=""确认"" type=""submit""> (共<font color=""#FF0000"">"&shu&"</font>个)</form></li></ul>"

end if%>
</body>
</html>






