<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="inc/ubbcode.asp"-->
<!--#include file="inc/conn.asp"-->
<!--#include file="inc/Conn_User.asp"-->

<%if Request.Cookies("asp163")("UserName")="" or request("UserID")="" then 
  response.Redirect "User_Login.asp"
  else
  end if%>
<link href="css/page_style.css" rel="stylesheet" type="text/css" />
<link rel="stylesheet" type="text/css" media="screen" href="css/Mpage_main.css" />
<body style="overflow-y:hidden">
<%userid=request("userid")
set rs=server.createobject("adodb.recordset")
sql="select * from [user] where userid="&userid&" order by userid desc"
rs.open sql,Conn_User,1,1
username=rs("username")

rs.close
set rs=nothing
%>
<%if request("classid")="" then%>
<%
myPagesize=4
set rs=server.createobject("adodb.recordset")
rs.open "select * from flv where editor='"&username&"' and Deleted=0 order by photoid desc",conn,1,1
call myPages(rs,myPagesize)
%>
<%else%>
<%
myPagesize=4
classidd=request("classid")
set rs=server.createobject("adodb.recordset")
rs.open "select * from flv where editor='"&username&"' and classid="&classidd&" and Deleted=0 order by photoid desc",conn,1,1
call myPages(rs,myPagesize)
%>
<%end if%>
<%if rs.recordcount=0 then %>
<%else%>
<div id="user_title"><img src="imgs/pic/icon_04.gif" width="16" height="13"> 录制视频列表操作</div>
<table width="565" border="0" align="center" cellpadding="4" cellspacing="1" bgcolor="#F0F0F0">
</td>
<%line=myPagesize
do while not rs.eof and line>0
%>
    </tr>
				
			
                <tr>            

<%if rs("photourl")<>"" then%>









                  <td width="119" align="center" bgcolor="#FCFCFC">






<%
	  userid=request("userid")
	
	  if CheckUserLogined()=true then
	  UserNamed=Request.Cookies("asp163")("UserName")
	 
	 set userq=server.createobject("adodb.recordset")
sql="select * from [user] where UserName='"&UserNamed&"' order by userid desc"
userq.open sql,Conn_User,1,1

	  
	  userw=userq("userid")
	 
	  If cint(userw)=cint(userid) then
	  
	  %>


<a href=video_play.asp?photoid=<%=rs("photoID")%> target="_blank"><img src=<%=rs("PhotoUrl_Thumb")%> name="aa" border=0 id=aa style=""/></a>          </td>
                  <td width="260" valign="top" bgcolor="#FFFFFF" class="lineb"><br>标　　题：<strong><font color="#FF6600"><%=rs("PhotoName")%></font></strong><br><br>
                    录制时间：<%=year(rs("UpdateTime"))%>年<%=month(rs("UpdateTime"))%>月<%=day(rs("UpdateTime"))%>日<br><br>
					人　　气：<%=rs("hits")%><br> 
				  
				  
				  
				  </td>
                  <td width="69" align="center" bgcolor="#FFFFFF" class="linea"><a href="User_flvMod.asp?PhotoID=<%=rs("PhotoID")%>"><img src=user/mody.gif border="0"></a> <br><br> <a href="User_flvDel.asp?PhotoID=<%=rs("PhotoID")%>&userid=<%=userid%>&classid=<%classid=request("classid")%><%=classid%>" onClick="return ConfirmDel();"><img src=user/del.gif border="0"></a>

 <%else
	  end if%>
              <%
	  else
	  end if
	  %>
		<%else
  end if%> 
</td>  
              	  </tr>
		  <tr>
                  <td colspan="3" align="center" bgcolor="#FCFCFC"><div id='page'>
 <%rs.movenext
   line=line-1
loop
  %>
  <%rsc.close
set rsc=nothing
rsuser.close
set rsuser=nothing%>
  <center><%call listpages(mycondition)%></center>
 <%sub listpages(mycondition)
	response.write "<table height=22  border=0 cellpadding=0 cellspacing=0><Tr><td><table width='100%' border=0 cellspacing=0 cellpadding=0><tr><td height=3></td></tr></table>"
	if pages<1 then
		exit sub
	end if
	
	
	if p>0 then
		response.write	"<a href="&request.ServerVariables("script_name")&"?userid="&userid&"&currentpage=10&p="&p-1&mycondition&"><img src=user/prepre.gif alt=前十页 border=0></a>&nbsp;&nbsp;&nbsp;"
    else
	response.write	"<img src=user/prepre.gif alt=前十页 border=0>&nbsp;&nbsp;&nbsp;"
    end if
	'-------------------下面写出当前十个页码
	response.write "</td><td><img src=user/lined.gif border=0><img src=user/k.gif border=0 width=5>"
	for i=1 to 10
		if (p*10+i)>pages then exit for
		if currentpage=i then
		
			response.write "<b><a style='color:ff6600'"
		else
			response.write "<a"
		end if 
		response.write " href="&request.ServerVariables("script_name")&"?userid="&userid&"&classid="&request("classid")&"&currentpage="&i&"&p="&p&mycondition&"><font class=no >"&(p*10+i)&"</font></a></b>&nbsp;&nbsp;<img src=user/lined.gif border=0><img src=user/k.gif width=5 border=0>"	
     next
	 response.write "</td><td><table width='100%' border=0 cellspacing=0 cellpadding=0><tr><td height=3></td></tr></table>"
	 '--------------------察看下十页的连接
    if (p*10+10)<pages then
		response.write "<img src=user/k.gif border=0><a href="&request.ServerVariables("script_name")&"?userid="&userid&"&currentpage=1&p="&p+1&mycondition&"><img src=user/nextnext.gif alt=后十页 border=0></a>&nbsp;&nbsp;" 
		else
		response.write "<img src=user/k.gif border=0><img src=user/nextnext.gif alt=后十页 border=0>&nbsp;&nbsp;"
	end if
	'-----------------------------------------------上下页导航
	response.write "&nbsp;</td>"
	

	  response.write "</tr></table>"
end sub

sub myPages(myRS,mysize)  '------mysize为内部变量（主页面没有定义），myRS为主页面传递过来的RS对象（地址传递）
	if myRS.eof and myRS.bof then str="没有纪录"
	if str="" then
		if mysize="" or NOT IsNumeric(mysize) then
			mysize=15
		end if
		myRS.PageSize=mysize
		pages=myRS.pagecount
		records=myRS.recordcount
		On Error Resume Next '取得数字
		currentPage=request("currentPage")
		if currentPage="" then
			currentPage=1
		end if
		currentPage=CInt(currentPage)
		if Err.Number <> 0 Then
			currentPage=1
			Err.Clear
		end if
		if currentPage<1 then
			currentPage=1
		elseIf currentPage>10 then
			currentPage=10
		end if
		'----------------处理p
		p=request("p")
		if p="" then
			p=0
		end if
		p=CLng(p)
		if Err.Number <> 0 Then
			p=0
			Err.Clear
		end if
		if p<0 then
			p=0
		end if
		'--判断是否出了页数范围
		nowPage=p*10+currentPage
		if nowPage>pages then
			p=(pages-1)\10
			currentPage=((pages-1) mod 10)+1
		end if
		myRS.absolutepage=p*10+currentPage
	else
	   currentPage=1
	   records=0
	   pages=1
	end if
end sub

dim pages,records,currentPage,p '--------定义变量，这些变量在主页面中，进行地址传递%>
<%end if%>



</div></td>
                </tr>
              </table>
