<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="index.aspx.cs" Inherits="JuSNS.Web.system.album.index" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<title id="ptitle" runat="server">相册管理</title>
<link href="../images/css/style.css" rel="stylesheet" type="text/css" />
<script language="javascript" type="text/javascript" src="../../js/ajax.js"></script>
<script language="javascript" type="text/javascript" src="../../js/public.js"></script>
<script language="javascript" type="text/javascript">
    function getEvent(){     //同时兼容ie和ff的写法
         if(document.all)    return window.event;        
         func=getEvent.caller;            
         while(func!=null){    
             var arg0=func.arguments[0];
             if(arg0){
                 if((arg0.constructor==Event || arg0.constructor ==MouseEvent)
                     || (typeof(arg0)=="object" && arg0.preventDefault && arg0.stopPropagation)){    
                     return arg0;
                 }
             }
             func=func.caller;
         }
         return null;
    }
    //搜索
    function Search()
    {
        var event=getEvent();
        var obj=event.srcElement||event.target;
        var form=obj.form;
        var key=form.Key.value;
        var url="?"+location.search.substr(1);
        url=url.replace(/\&?key=[^&]*/gi,"");
        if(url.substr(url.length-1)=="&")
        {
            url=url.substring(0,url.length-1);
        }
        location.href=url+"&key="+escape(key);
    }
    //全选
    function checkall()
    {
        var event=event||window.event;
        var obj=event.srcElement||event.target;
        var form=obj.form;
        try
        {
            var item=form.albumchkedid;
            for(var i=0;i<item.length;i++)
            {
                if(obj.checked)
                {
                    item[i].checked=true;
                }
                else
                {
                    item[i].checked=false;
                }
            }
        }catch(e){}
    }
    </script>
</head>
<body>
<table width="99%" border="0" align="center" cellpadding="5" cellspacing="1">
  <tr>
    <td width="120" align="center" valign="top">
        <div class="menu">
            <ul>
        	<%=this.GetSystemMenu(sort)%>
        	</ul>
      </div>
    </td>
    <td valign="top">
   <div class="navip">
    <span class="Blue"><a href="index.aspx">相册管理</a></span> &nbsp;<a href="photo.aspx">照片管理</a>
   </div> 
   <div id="DivErr" runat="server"></div>
   <form id="form1" runat="server">
   <div id="mainbody">
            <asp:Repeater runat="server" ID="RptData">
                <HeaderTemplate>
                    <table width="100%" border="0" cellpadding="3" cellspacing="1" class="maintable">
                        <tr class="maintablehead">
                            <td align="center" style="width: 10%;">
                                编号</td>
                            <td align="center" style="width: 20%;">
                                相册名称</td>
                            <td align="center" style="width: 10%;">
                                创建人</td>
                            <td align="center" style="width: 10%;">
                                照片张数</td>
                            <td align="center" style="width: 15%;">
                                创建时间</td>
                            <td align="center" style="width: 15%;">
                                最后上传时间</td>
                            <td align="center" style="width: 20%;">
                                操作<input type="checkbox" value="1" onclick="javascript:checkall();" /></td>
                        </tr>
                </HeaderTemplate>
                <ItemTemplate>
                    <tr class="maintablelist">
                        <td align="center">
                            <%# DataBinder.Eval(Container.DataItem, "AlbumID")%>
                        </td>
                        <td>
                            <a href="../../home/Album/AlbumView.aspx?r[0]=<%# DataBinder.Eval(Container.DataItem, "UserID")%>&r[1]=<%# DataBinder.Eval(Container.DataItem, "AlbumID")%>"
                                target="_blank">
                                <%# DataBinder.Eval(Container.DataItem, "Title")%>
                            </a>
                        </td>
                        <td align="center">
                            <a href="../../user/?r=<%# DataBinder.Eval(Container.DataItem, "UserID")%>" target="_blank"><%# DataBinder.Eval(Container.DataItem, "UserName")%></a>
                        </td>
                        <td align="center">
                            <%# DataBinder.Eval(Container.DataItem, "ImagesCount")%>
                        </td>
                        <td align="center">
                            <%# DataBinder.Eval(Container.DataItem, "CreateTime")%>
                        </td>
                        <td align="center">
                            <%# DataBinder.Eval(Container.DataItem, "LastUploadTime")%>
                        </td>
                        <td align="center">
                            <input type="checkbox" name="albumchkedid" value="<%# DataBinder.Eval(Container.DataItem, "AlbumID")%>" />
                        </td>
                    </tr>
                </ItemTemplate>
                <FooterTemplate>
                    </table>
                </FooterTemplate>
            </asp:Repeater>
            <table width="100%" border="0" cellpadding="3" cellspacing="1">
                <tr>
                    <td><div class="pagination" runat="server" id="DivPage" style="text-align: center;"></div></td><td align="right" style="padding-right: 15px;">
                        <asp:Button ID="delAlbum" runat="server" Text="删除" OnClientClick="confim();" OnClick="delAlbum_Click" /></td>
                </tr>
            </table>
            <table width="100%" border="0" cellpadding="3" cellspacing="1">
                <tr class="maintablepage">
                    <td>
                        <div style="text-align: center;">
                            搜索相册
                            <asp:TextBox ID="Key" runat="server" Width="200"></asp:TextBox>&nbsp;&nbsp<input type="button"
                                value="搜索" onclick="javascript:Search();" />
                        
                        </div>
                    </td>
                </tr>
            </table>
        </div>
    </form>
    </td>
  </tr>
</table>
</body>
</html>