<%@ Page Language="vb" AutoEventWireup="false" MasterPageFile="~/Master/User.Master" CodeBehind="MyUserVideos.aspx.vb" Inherits="Dingtai.Website.MyUserVideos" 
    title="我的视频管理" %>
    
<%@ Register src="~/App_Data/Controls/PageControl.ascx" tagname="PageControl" tagprefix="uc1" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">

<div id="body_left">
    <div class="body_left_top"></div>
    <div id="body_left_conter">
        <div id="upload_title" style="color:#FFF;">我的视频管理
            <div class="back"><a id="lnkBack" href="javascript:history.back(-1)">返回上页</a></div>
        </div>

        <div class="MyVideos">
            <asp:Repeater ID="Repeater1" runat="server">
                <HeaderTemplate>
                    <ul class="MyVideos_content">
                </HeaderTemplate>
                <ItemTemplate>
                        <li>
                            <p class="img"><a href='<%# getUrl(Eval("ID").toString(),Eval("IsApproved"),Eval("IsConverted")) %>' ><img src='<%#getImgUrl(Eval("ID").ToString(),Eval("IsApproved"))%>' width="102" height="75" /></a></p>
                            <p class="box"><a href='<%# getUrl(Eval("ID").toString(),Eval("IsApproved"),Eval("IsConverted")) %>'><b><%#Eval("Name")%></b></a><span style="float:right"><%#getStatus(Eval("IsApproved"), Eval("IsConverted"))%></span><br />
                                频道：<b style="margin-right:149px;"><a href ="#" onclick ="window.open('<%#Dingtai.Output.Items.Cache_New.GetChannelPath(Eval("ChannelID").toString(),false,0,1) %>')">
                                <%#DingTai.BLL.Media.Provider.Medias.GetChannelName(Eval("ChannelID").ToString())%></a>
                            </b>标签：<b><%#Eval("Tag")%></b><br />
                            <span style="margin-right:125px;">上传时间：<%#Eval("UploadDate", "{0:yyyy-MM-dd}").ToString()%></span>
                            <span style="margin-right:31px;">人气：<%#Eval("TotalView")%></span><span>评论：<%#Eval("CommentCount")%></span><br>
                            <span  class="jieshao">简介：<%#Eval("Detail")%></span>
                            <span class="box_an">
                                <a href="MyVideoUpdate.aspx?ID=<%#Eval("ID") %>" class="an1" >修改视频</a>
                                 <a href="javascript:;" onclick="getImage('<%#Eval("ID") %>','<%#Eval("MediaType") %>',false);" class="an2" >设置封面</a>
                                 <a href="#" class="an3" onclick="IsUserBestById('<%#Eval("ID") %>');" >推荐</a>
                                 <a href="#" class="an4" onclick="IsUserTopById('<%#Eval("ID") %>');" >置顶</a>
                                 <a href="#" class="an5" onclick="delMediaById('<%#Eval("ID") %>');" >删除</a>
                            </span>
                            </p>
                        </li>
                </ItemTemplate>
                <FooterTemplate>                
                    </ul>                    
                </FooterTemplate>
            </asp:Repeater>            
            <div class="info_page">
                <uc1:PageControl ID="page2" runat="server" ShowFirstLast="true" ShowPrevNext="true"       
                    PrevPageText="上一页" NextPageText="下一页" AlwaysShow="true"  ShowCustomInfoSec="left" 
                    NumericButtonCount="15" PagingButtonSpacing="10px" PageSize="4"
                    CustomInfoClass="" InputBoxHeight="" SubmitButtonClass="" ShowInputBoxB="Never" />
            </div>
        </div>
    </div>
    <div class="body_left_bottom"></div>
</div>


<div id="pop_bg"></div>

<!--浮层框架开始-->
<div id="pop_body">
<div id="pop_box">
<div id="pop_title">
<a href="JavaScript:;" class="style1" onClick="Lock_CheckForm(this);">关闭</a><span>设置封面</span>
</div>
<div id="pop_content" style="padding-top:11px;margin-left:8px;">
    <iframe id="imagelist" width="100%" height="410px" frameborder="0" scrolling="yes"></iframe>
</div>
</div>
</div>
</div>
<!--浮层框架结束-->

<!--上传页跳转-->
<script type="text/javascript">
    function getQueryString(name) {
        var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
        var r = window.location.search.substr(1).match(reg);
        if (r != null) return unescape(r[2]); return null;
    }
    if (getQueryString("source") == "upload") {
        document.getElementById("lnkBack").href = "Upload.aspx?isHd=false";
    }
</script>

<script type="text/javascript" language="javascript">
    function getImage(id,type,ishd) {
    if (type==0) {
        document.all.imagelist.src = "imagelist.aspx?id=" + id + "&type=" + type + "&ishd=" + ishd;
    }
    else
    {
         document.all.imagelist.src = "audioimage.aspx?id=" + id + "&type=" + type + "&ishd=" + ishd;
    }
         
//        document.all.imagelist.src = "imagelist.aspx?id=51&type=0&ishd=false";
         locking();
    }
    function locking(){        
         document.all.pop_bg.style.display="block";
         document.all.pop_bg.style.width=document.body.clientWidth;
         document.all.pop_bg.style.height=document.body.clientHeight;
         document.all.pop_body.style.display='block';
    }
    function Lock_CheckForm(theForm){
     document.all.pop_bg.style.display='none';document.all.pop_body.style.display='none';
      document.all.imagelist.src = "";
     return false;
    }
    //推荐
    function IsUserBestById(id){
        if (id == "") {
            alert("无参数传递!");
            return;
        }
        
        var ret = MyUserVideos.IsUserBest(id).value;
        if (ret == true)
        {
            alert("操作成功!");
            refreshPage();  
        }
    }
    
    //置顶
    function IsUserTopById(id){
        if (id == "") {
            alert("无参数传递!");
            return;
        }
        
        var ret = MyUserVideos.IsUserTop(id).value;
        if (ret == true)
        {
            alert("操作成功!");
            refreshPage();  
        }
    }
    
    //删除
    function delMediaById(id){
        if (id == "") {
            alert("无参数传递!");
            return;
        }
        
        if (!confirm("确认删除此视频?"))
        {
            return;
        }
        
        var ret = MyUserVideos.DelMedia(id).value;
        if (ret == true)
        {
            alert("操作成功!");
            refreshPage();  
        }
    }
    
    function refreshPage()
    {
         location.reload();
    }
</script>
</asp:Content>
