<%@ page title="" language="C#" masterpagefile="~/lovecenter/LoveCenterMaster.master" autoeventwireup="true" inherits="lovecenter_PhotoUpload, App_Web_ubyenibr" enableEventValidation="false" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
<script type="text/javascript" src="/js/ajaxfileupload.js"></script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<div class="rightbody">
        <div class="menutit">
            我的相册
        </div>
        <div class="bodycotent">
            <div class="menutab">
                <div class="menuitem">
                    <a href="Album.aspx">相册管理</a>
                    <a class="chk">上传照片</a>
                </div>
                <div class="menusub">
                    <a href="PersonAlbumEdit.aspx">创建新的相册</a> | 
                    <a href="Album.aspx">相册管理</a> 
                </div>
            </div>
            <div class="body upload">
                <div class="bor selAlbum">
                    选择相册：&nbsp;&nbsp;
                    <asp:DropDownList ID="ddlPhotoAlbums" runat="server" Width="150" DataTextField="albumname" DataValueField="albumid">
                    </asp:DropDownList>&nbsp;&nbsp; <a href="PersonAlbumEdit.aspx">[创建相册]</a>
                </div>
                <img id="loading" src="loading.gif" style="display: none;">

                <div class="bor">
                    <div class="head">照片列表</div>
                    <ul class="photolist">
                    </ul>
                    <div class="bor_top">
                        <a class="addfile"></a>
                    </div>
                    <div class="bor_top">
                        温馨提示：最多同时上传<strong>20</strong>个文件，每个文件小于<strong>20M</strong>，
                        只允许上传<strong>jpg,gif,bmp</strong>文件。
                    </div>
                    <div class="bor_top">
                        <a href="javascript:void(0);" class="okbtn" id="buttonUpload">上传</a>
                        <a href="javascript:void(0);" class="okbtn" id="cancelUpload">取消</a>
                        
                        <div class="uploading">正在上传文件，请不要关闭窗口..<img src="/images/loading.gif" /></div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <script type="text/javascript">
        $(function() {
            UploadFinishCallback = function(svrArgs) {
                $.ajax({
                    url: "/Service/PhotoSaving.ashx",
                    cache: false,
                    data: { files: svrArgs.join(","), album: $("#<%= ddlPhotoAlbums.ClientID %>").val() ,uid : <%= Utils.GetLoginedUserDescr().uid %>, utype:"<%= Utils.GetLoginedUserDescr().UserType == LoginedUserDescription.EnumUserType.Person ? "p" : "e" %>" },
                    success: function(html) {
                        window.location = "PhotoUploaded.aspx?ids=" + html + "&albumid=" + $("#<%= ddlPhotoAlbums.ClientID %>").val();
                    }
                });
            }

        });
    </script>
</asp:Content>