<%Server.ScriptTimeout=900%>
<!--#include file="../Include/QvodCms.Lable.asp"-->
<!--#include file="QvodCms_Function.asp"-->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<TITLE>网站生成管理</TITLE>
<link href="skins/css/jaja_main.css" rel="stylesheet" type="text/css" />
<style type="text/css">
h1{font-size:14px; color:#FF0000;}
td{text-align:left}
form{padding:0;margin:0}
</style>
</head>
<body> 
<%Dim Action
Dim StrTemp,StrPath,CurrentPage,AllPages,PageStr,iPages,allclassday,data_playurl,data_playpath,allid,today,BeginDate,EndDate
Action=Trim(Request.QueryString("action"))
allid=Trim(Request.Form("data_id"))'批量影片ID
List_Id=QvodCms_CLng(Request("ClassId"))
CurrentPage=QvodCms_CLng(Request.QueryString("Page")) : If CurrentPage<1 Then CurrentPage=1
name_id=QvodCms_CLng(Request.QueryString("dataid"))
data_py=Trim(Request.QueryString("data_py"))
data_playurl=Trim(Request.QueryString("data_playurl"))
data_playpath=Trim(Request.QueryString("data_playpath"))
Data_Id=QvodCms_CLng(Request.QueryString("dataid"))
PlayJD=QvodCms_CLng(Request.QueryString("PlayJD"))
PlaySv=QvodCms_CLng(Request.QueryString("PlaySv"))
iPages=QvodCms_CLng(Request.QueryString("iPages"))
allclassday=Trim(Request.QueryString("allclassday"))
PageType=Trim(Request.QueryString("PageType"))
Call OpenConn()
Select  Case Lcase(Action)
	Case "class" : makeDataClass : ClearObj
	Case Else : main
End Select

Sub	makeDataClass
today=Trim(Request.QueryString("today"))
BeginDate=date()
EndDate=date()+1

   if today="ok" Then	
	   If Config(1)="SQL" Then
	     Sql="select name_id,class_id,data_py from qvodcms_name where data_lastdate>='"&BeginDate&"' and data_lastdate<='"&EndDate&"' order by data_lastdate desc"
	   Else
         Sql="select name_id,class_id,data_py from qvodcms_name where data_lastdate between #"&BeginDate&"# and #"&EndDate&"# order by data_lastdate desc"
	   End If 
	Else
    If List_Id<1 Then QvodCms_Err("请选择分类！")
	Sql=" Select B.class_id,B.name_id,B.data_py from qvodcms_class a  inner join qvodcms_name b on a.class_id=b.class_id where (a.class_id="&List_Id&" or  a.class_bigid="&List_Id&") order by data_lastdate desc"
	End If
	Set rh = Server.CreateObject("adodb.recordset")
    rh.Open sql, Conn, 1, 1
    If Not(rh.bof And rh.eof) Then
	    datai=0
		Response.Write("总共需要读取 <font color='red'><b>"&rh.recordcount&"</b></font> 部电影<br>")
		Do while not rh.eof 	
		List_Id=rh("class_id"):name_id=rh("name_id"):data_py=rh("data_py"):makeDataById
		datai=datai+1
		if datai mod 100=0 then Response.Write "<BR><BR>---------------------这里是换行方便复制，请别把我也复制走了哦！-----------------------<BR><BR>"
		rh.movenext 
		Loop
		'Call AllPageGo(CurrentPage,rh.PageCount,"?action=data&ClassId="&List_Id&"","allok")
	Else
	    DivWrite "暂无数据"
	End If
	rh.close:Set rh=nothing
End Sub



Sub	makeDataById
    Dim StrTemp:StrTemp=""
    Lable_Cache="Lable_Cache_Data"
	StrPath=GetDataLink(List_Id,name_id,data_py)
	If Config(0)<>"/" Then StrPath=Replace(StrPath,Config(0),"/")
	'If Config(23)="3" or Config(23)="4" Then StrPath=StrPath&"index."&Config(27)
	DivWrite ""&Config(9)&StrPath&"<br>" 
End Sub




Sub DivWrite(str)
	response.write(str)
	response.Flush()
End Sub

Sub ClearObj
	Set CacheObj = Nothing
	Set LableObj = Nothing
End Sub



Sub Main()
randomize
Dim rndmsg:rndmsg="msg"&int(2100*rnd)
%>
<table width="100%" border="0" cellspacing="1" cellpadding="0">
<tr>
  <th colspan=2 background="Skins/images/tdbg.gif" class="title">&nbsp;流量交换内容页生成选项</th>
</tr>
<tr><td height="151" class="td2">
<table width="100%" height="29" border="0 "align="center" cellpadding="5" cellspacing="1" style="background: #cad9ea;">	
<tr bgcolor="#FFFFFF" >
<form action="?action=class" name="formclass" method="post" target="<%=rndmsg%>">
<td width="15%" height="27" ><select name="ClassId" ><option value="">请选择分类</option><%=QvodCms_Class_Name(0,"","")%></select></td>
<td width="85%" ><input type="submit" name="Submit"  value="读取今日更新内容提交页" style="cursor:hand; color:#FF0000" onClick="document.formclass.action='?action=class&today=ok';"> <input type="submit" value="读取选中栏目内容提交页" > 注意，每100条自动换行！</td>
</form>
</tr>
</table></td></tr>
</table>
<table width="100%" border="0" cellspacing="1" cellpadding="0">
<tr>
</form>
</tr>

<tr bgcolor="#FFFFFF">
	<td colspan="2" ><iframe style="z-index:1;visibility:inherit;width:100%;height:500px;" name="<%=rndmsg%>" frameborder=0 scrolling=yes ></iframe></td>
</tr>

</table>
<%End Sub%> 
<%Call CloseConn()%>

</body>
</html>