<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="userindex.aspx.cs" Inherits="Webdisk.userindex" %>

<%@ Register Src="~/userleft.ascx" TagPrefix="uc1" TagName="userleft" %>
<%@ Register Src="~/usertop.ascx" TagPrefix="uc1" TagName="usertop" %>


<!doctype html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title><%=title %></title>

   <link rel="stylesheet" href="css/bootstrap.min.css">
	<link rel="stylesheet" href="css/atlantis.css">
        <script>
            function ggshow(id) {
                $.post(
                    "ajax.aspx",
                    { action: "GetGG", id: id }, ggshowResult_callback
                )
            }
            function ggshowResult_callback(res) {
                var arr = res.split("`");
                document.getElementById('ggtitle').innerHTML = arr[0];
                document.getElementById('ggcontent').innerHTML = arr[1];
                $("#gg").modal("show");
            }
            function SizeCount() {
                $.post(
                    "ajax.aspx",
                    { action: "DirFileCount" }, SizeCountResult_callback
                )
               
            }
            function SizeCountResult_callback(res) {
                var arr = res.split("|");
                document.getElementById('lblsize').innerHTML = arr[0] + " <small> 已用</small>";
                document.getElementById('filecount').innerHTML = arr[2] + " <small>个文件夹&nbsp;</small>" + arr[1] + " <small>个文件</small>";
               // document.getElementById('IMG1').width = parseInt(arr[3]) * 3;
                //document.getElementById('per').width = arr[3];
                $('div#per').width(arr[3]+'%');
                document.getElementById('sharecount').innerHTML = "<a href=allfolder.aspx?me=1><font color=#000000>" + arr[4] + "</font></a><small> 个文件夹</small>&nbsp;<a href=allshare.aspx?me=1><font color=#000000>" + arr[5] + "</font></a><small> 个文件</small>";
            }
        </script>
</head>
<body onLoad="SizeCount();">
<div class="wrapper">
<!-- begin::navigation -->
     <uc1:usertop runat="server" id="usertop" />
<!-- end::navigation -->

    <!-- begin::header -->
   <uc1:userleft runat="server" id="userleft" />
    <!-- end::header -->

    <!-- begin::main content -->
    <div class="main-panel">

        <div class="content">
            <div class="page-inner">
<div class="row">
            <div class="page-header col-auto">
                <h4>欢迎来到<%=title%>!</h4>
				
            </div>
			<div class="col-lg col-md text-right" style="padding-bottom:10px">
			<button type="button" class="btn btn-primary btn-pulse" style="float: right" onclick="javascript:window.location='ContentPane.aspx'">
			  <i><img src="pics/wenjian.png"  width="18"></i>&nbsp;<font color="#FFFFFF">管理我的文件</font></button>
				</div>
	</div>
            <div class="row">
                <div class="col-md-12">

                    <div class="row">
                        <div class="col-md-4 ">
                            <div class="card card-body">
                                <h3 class="mb-3" id="lblsize">
                                    统计中……
                                </h3>
                                <div class="progress mb-2" style="height: 5px">
                                    <div class="progress-bar bg-primary" role="progressbar"
                                         style="width: 0%;"
                                         aria-valuenow="50" aria-valuemin="0" aria-valuemax="100" id="per"></div>
                                </div>
                                <p class="font-size-14 m-b-0">
                                     总共空间 <span class="text-success"><%=totalspace %></span>
                                </p>
                            </div>
                        </div>
                        <div class="col-md-4">
                            <div class="card card-body" >
								<h3 class="mb-3" id="filecount">
                                   统计中……
                                </h3>
                                <div class="progress mb-2" style="height: 5px">
                                    <div class="progress-bar bg-success" role="progressbar"
                                         style="width: 100%;"
                                         aria-valuenow="50" aria-valuemin="0" aria-valuemax="100"></div>
                                </div>
                                <p class="font-size-14 m-b-0">
                                   我的空间文件数量
                                </p>
                            </div>
                        </div>
                        <div class="col-md-4">
                            <div class="card card-body">
                                <h4 class="mb-3" id="sharecount">
                                  统计中……
                                </h4>
                                <div class="progress mb-2" style="height: 5px">
                                    <div class="progress-bar bg-info" role="progressbar"
                                         style="width: 100%;"
                                         aria-valuenow="50" aria-valuemin="0" aria-valuemax="100"></div>
                                </div>
                                <p class="font-size-14 m-b-0">
                                    共享给我的文件数量
                                </p>
                            </div>
                        </div>
                    </div>

                    <div class="row"></div>

                            <div class="card">
                                <div class="card-body">
                                    <h5>系统公告</h5>
                                    <hr class="m-b-0">
                                    <div class="list-group list-group-flush">
										<asp:DataList ID="DataList" runat="server" CellPadding="0" Width="100%">
										<itemtemplate>
                                      <div class="list-group-item p-t-b-10 p-l-r-0 d-flex align-items-center justify-content-between">
                                          <div class="d-flex align-items-center">
                                                <div class="m-r-20"><a href="javascript:void(0)" onclick="ggshow('<%#DataBinder.Eval(Container.DataItem,"id")%>');"><%#DataBinder.Eval(Container.DataItem,"title")%></a></div>
                                               
                                            </div>
                                            <div class="d-flex align-items-center">
                                                <div><%#DataBinder.Eval(Container.DataItem,"datetime", "{0:yyyy-MM-dd}")%></div>
                                            </div>
                                        </div></itemtemplate>
										</asp:DataList>
                                    </div>
                                </div>
                            </div>
                      

                </div>
            </div>
        </div>

    </div></div>
    <!-- end::main content -->
</div>
    <div class="modal fade" tabindex="-1" role="dialog" id="gg" aria-hidden="true">
  <div class="modal-dialog" role="document">
    <div class="modal-content">
      <div class="modal-header">
        <h5 class="modal-title" id="ggtitle">公告标题</h5>
        <button type="button" class="close" data-dismiss="modal" aria-label="Close">
          <span aria-hidden="true">×</span>
        </button>
      </div>
      <div class="modal-body" id="ggcontent">
        
          </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-secondary" data-dismiss="modal">关闭</button>
      </div>
    </div>
  </div>
</div>
</body>
</html>
<script src="js/jquery.3.2.1.min.js"></script>
	<script src="js/popper.min.js"></script>
	<script src="js/bootstrap.min.js"></script>
	<!-- jQuery UI -->
	<script src="js/jquery-ui.min.js"></script>
	<script src="js/jquery.ui.touch-punch.min.js"></script>
	
	<!-- jQuery Scrollbar -->
	<script src="js/jquery.scrollbar.min.js"></script>
	<!-- Atlantis JS -->
	<script src="js/webfont.min.js"></script>
	<script src="js/atlantis.js"></script>
			<script>
                function std_playUrl(text) {
                    var textarea = document.createElement("textarea");
                    var currentFocus = document.activeElement;
                    document.body.appendChild(textarea);
                    textarea.value = text;
                    textarea.focus();
                    if (textarea.setSelectionRange)
                        textarea.setSelectionRange(0, textarea.value.length);
                    else
                        textarea.select();
                    try {
                        var flag = document.execCommand("copy");
                    } catch (eo) {
                        var flag = false;
                    }
                    document.body.removeChild(textarea);
                    currentFocus.focus();
                    return flag;

                }
            </script>