<%@ Reference Page="~/admin/backup/operate.aspx" %>

<%@ Page Language="c#" Inherits="WebApp.SpaceStat" EnableEventValidation="false" CodeBehind="SpaceStat.aspx.cs" %>

<!DOCTYPE html>
<!--[if lt IE 9]><html class="lte-ie8"><![endif]-->
<!--[if gt IE 8]><!-->
<html>
<!--<![endif]-->
<head>
    <title>子站占用磁盘空间统计</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <!--#include file = "../Css/adminCssEdit.htm" -->

    <script language="javascript" type="text/javascript">
			function selectSchools()
			{	
				var arr = showModalDialog("selectSchools.aspx", window, "dialogWidth:500px;dialogHeight:326px;help:no;scroll:no;resizable:yes;status:no");
		   		if(arr!=null)
		   		  location.href="SpaceStat.aspx";
			}
			function DelAll() 
			{
				var selectTo=document.frmSpaceStat.schoolList;
				var nLen = selectTo.length;
				if (nLen<1) return;
				for(var loop=nLen;loop>=0;loop--)
				{ 
               		selectTo.options[loop] = null;
               	}			  
			}
			function checkform(text,value) 
			{				
				var selectFrom=document.frmSpaceStat.schoolList;
			    selectFrom.add(new Option(text,value));
			    //alert(text+","+value);
			}
			function queryform() {
				var sel=document.frmSpaceStat.schoolList;
				var nLen = sel.length;
				var str1="";
				var str2="";
				for (var i=0;i<nLen;i++) {
					if (i>0) 
					{str2+=",";str1+=",";}
					str2+=sel.options[i].value;
					str1+=sel.options[i].text;
				}
				document.frmSpaceStat.d_name.value=str1;
				document.frmSpaceStat.d_value.value=str2;
				//alert(str1+str2);
				return true;
			}
    </script>

    <base target="_self" />
</head>
<body>
    <div class="edit-func-box func-box">
        <div class="hd">
            子站空间统计列表</div>
        <form id="frmSpaceStat" method="post" runat="server">
        <div class="bd">
            <div class="function-hd">
                <div class="search-box fr">
                </div>
                <!--/search-box-->
                <div class="action-field">
                    子站服务器：<asp:DropDownList ID="ddlServerList" runat="server">
                    </asp:DropDownList>
                    &nbsp;<asp:Button ID="btnQuery" CssClass="btn" runat="server" Text="查看" OnClick="btnQuery_Click" />
                </div>
                <!--/action-field-->
            </div>
            <asp:DataGrid ID="webList" CssClass="list-table" runat="server" AutoGenerateColumns="False"
                DataKeyField="pkID" OnItemCommand="webList_ItemCommand">
                <Columns>
                    <asp:BoundColumn DataField="pkID" HeaderText="ID" HeaderStyle-CssClass="title"></asp:BoundColumn>
                    <asp:BoundColumn DataField="schoolName" HeaderText="子站名称" HeaderStyle-CssClass="title">
                    </asp:BoundColumn>
                    <asp:BoundColumn DataField="regTime" HeaderText="开通时间" HeaderStyle-CssClass="title"
                        DataFormatString="{0:yyyy-MM-dd}"></asp:BoundColumn>
                    <asp:TemplateColumn HeaderText="分配空间(MB)" HeaderStyle-CssClass="title">
                        <ItemTemplate>
                            <asp:Label ID="lblWebSpace" runat="server" Text='<%# GetWebSpace(DataBinder.Eval(Container, "DataItem.webSpace").ToString()) %>'>
                            </asp:Label>
                        </ItemTemplate>
                    </asp:TemplateColumn>
                    <asp:TemplateColumn HeaderText="实用空间(MB)" HeaderStyle-CssClass="title">
                        <ItemTemplate>
                            <asp:Label ID="lblUsedSpace" runat="server" Text='<%# ((Convert.ToDouble(DataBinder.Eval(Container, "DataItem.usedSpace"))/1024)/1024).ToString("f2") %>'>
                            </asp:Label>
                        </ItemTemplate>
                    </asp:TemplateColumn>
                    <asp:TemplateColumn HeaderText="上传空间(MB)" HeaderStyle-CssClass="title">
                        <ItemTemplate>
                            <asp:Label ID="lblUsedImageSpace" runat="server" Text='<%# ((Convert.ToDouble(DataBinder.Eval(Container, "DataItem.usedImageSpace"))/1024)/1024).ToString("f2") %>'>
                            </asp:Label>
                        </ItemTemplate>
                    </asp:TemplateColumn>
                    <asp:TemplateColumn HeaderText="备份空间(MB)" HeaderStyle-CssClass="title">
                        <ItemTemplate>
                            <asp:Label ID="lblUsedBackupSpace" runat="server" Text='<%# ((Convert.ToDouble(DataBinder.Eval(Container, "DataItem.usedBackupSpace"))/1024)/1024).ToString("f2") %>'>
                            </asp:Label>
                        </ItemTemplate>
                    </asp:TemplateColumn>
                    <asp:BoundColumn DataField="spaceStateTime" HeaderText="统计时间" HeaderStyle-CssClass="title">
                    </asp:BoundColumn>
                    <asp:TemplateColumn HeaderStyle-CssClass="title">
                        <ItemTemplate>
                            <asp:Label ID="lblOver" runat="server" Text="网站空间过大" ForeColor="red" Visible='<%# IsOver(Convert.ToInt32(DataBinder.Eval(Container, "DataItem.applyID"))) %>'>
                            </asp:Label>
                            <asp:LinkButton ID="btnSendMail" runat="server" Visible='<%# IsOver(Convert.ToInt32(DataBinder.Eval(Container, "DataItem.applyID"))) %>'
                                Text="发送邮件" CommandName="send">
                            </asp:LinkButton>
                        </ItemTemplate>
                        <ItemStyle HorizontalAlign="Right" />
                    </asp:TemplateColumn>
                    <asp:BoundColumn DataField="applyID" HeaderText="子站ID" Visible="False" HeaderStyle-CssClass="title"></asp:BoundColumn>
                </Columns>
            </asp:DataGrid>
            <div class="ft">
                <div class="pagination">
                    <asp:Label ID="lblPage" runat="server"></asp:Label>
                </div>
            </div>
        </div>
        <div class="hd">
            子站空间统计</div>
        <div class="bd">
            <div class="function-hd">
                <div class="search-box fr">
                </div>
                <!--/search-box-->
                <div class="action-field">
                    <asp:Button ID="btnRefresh" CssClass="btn" runat="server" Text="刷新列表" OnClick="btnRefresh_Click">
                    </asp:Button>
                </div>
                <!--/action-field-->
            </div>
            <table cellspacing="0" cellpadding="0" width="760" border="0" align="center">
                <tr>
                    <td align="left" width="50%">
                        <asp:ListBox ID="schoolList" runat="server" Width="100%" Height="216px" Rows="10">
                        </asp:ListBox>
                    </td>
                    <td>
                        <table height="100%" cellspacing="0" cellpadding="4" border="0">
                            <tr>
                                <td valign="top" height="100%">
                                    <asp:Button ID="btnSelSchools" CssClass="btn" runat="server" Text="选择子站"></asp:Button>
                                </td>
                            </tr>
                            <tr>
                                <td valign="bottom" height="100%">
                                    <asp:Button ID="btnStat" CssClass="btn" runat="server" Width="72px" Text="统计" OnClick="btnStat_Click">
                                    </asp:Button>
                                </td>
                            </tr>
                        </table>
                    </td>
                </tr>
                <tr>
                    <td align="center" colspan="2">
                        <font face="宋体"><INPUT id="d_name" style="WIDTH: 80px; HEIGHT: 21px" type="hidden" size="8" name="Hidden1"
											runat="server"><INPUT id="d_value" style="WIDTH: 88px; HEIGHT: 21px" type="hidden" size="9" name="Hidden2"
											runat="server"></font>
                    </td>
                </tr>
            </table>
            <input id="Hidden1" runat="server" type="hidden" />
            <div class="ft">
                <div class="pagination">
                </div>
            </div>
        </div>
    </form>
    </div>
</body>
</html>
