<%@ page language="C#" autoeventwireup="true" inherits="ims.report, ims.web" enableviewstatemac="false" enableEventValidation="false" %>
<!DOCTYPE html>
<html id="report">
<head runat="server"><title></title>
    <meta http-equiv="X-UA-Compatible" content="IE=edge" /><meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=0">
</head>
<body>
    <form id="form1" runat="server">
    <asp:ScriptManager ID="s1" runat="server" AsyncPostBackTimeout="250" OnAsyncPostBackError="AsyncError">
        <CompositeScript Path="js/msajax.js" ScriptMode="Release">
            <Scripts>
                <asp:ScriptReference Name="WebForms.js" Assembly="System.Web" /><asp:ScriptReference Name="MicrosoftAjax.js" /><asp:ScriptReference Name="MicrosoftAjaxWebForms.js" />
            </Scripts>
        </CompositeScript>
    </asp:ScriptManager>
    <asp:HiddenField runat="server" ID="sorted" />
    <div runat="server" id="EmptyPrompt" visible="false" class="highlight"></div>
    <asp:UpdatePanel ID="up" runat="server" ChildrenAsTriggers="false" OnPreRender="InitTable" UpdateMode="conditional" RenderMode="Block">
    <ContentTemplate>
        <asp:HiddenField runat="server" ID="layout" /><asp:HiddenField runat="server" ID="detail_sort" />
        <div runat="server" id="reportTitle" class="pageTitle"></div>
        <asp:UpdatePanel ID="dataArea" runat="server" ChildrenAsTriggers="false" UpdateMode="conditional" RenderMode="Block">
        <ContentTemplate> </ContentTemplate></asp:UpdatePanel>
        <div runat="server" id="footer" class="hidden"></div>
    </ContentTemplate>
    </asp:UpdatePanel>
    <div id="loading" class="loading"><div class="loadbar"><div></div><div></div><div></div><div></div><div></div></div></div>
    <ims:Pop runat="server" ID="p" Width="680" OnClientUpdated="InitSettingCtl();" OnOkClientClick="return PreMakeReport();" HideOnOkClientClick="false" OnOkClick="MakeReport" HelpSubject="report" OkButtonText="生成报表" CustomCss="notfocus">
        <ContentTemplate>
            <div class="item"><span class="key">根据什么来分组统计？</span></div>
                <div class="setting">
                    <table class="autoWidth"><tr><td id="tdSetting" class="nowrap">
                        <div id="group1">选择：<asp:DropDownList runat="server" ID="ddlG1"></asp:DropDownList><span class="hide">&nbsp;<asp:DropDownList runat="server" ID="ddlP1"></asp:DropDownList><span class="hide">：<asp:TextBox runat="server" ID="tbSep1" Width="176"></asp:TextBox></span><asp:DropDownList runat="server" ID="ddlSpan1" CssClass="hide"></asp:DropDownList></span>&nbsp;&nbsp;排序：<asp:DropDownList runat="server" ID="ddlSort1"></asp:DropDownList><asp:DropDownList runat="server" ID="sort1"></asp:DropDownList></div>
                        <div runat="server" id="group2" class="hide">二级：<asp:DropDownList runat="server" ID="ddlG2"></asp:DropDownList><span class="hide">&nbsp;<asp:DropDownList runat="server" ID="ddlP2"></asp:DropDownList><span class="hide">：<asp:TextBox runat="server" ID="tbSep2" Width="176"></asp:TextBox></span><asp:DropDownList runat="server" ID="ddlSpan2" CssClass="hide"></asp:DropDownList></span>&nbsp;&nbsp;排序：<asp:DropDownList runat="server" ID="ddlSort2"></asp:DropDownList><asp:DropDownList runat="server" ID="sort2"></asp:DropDownList></div>
                        <div runat="server" id="group3" class="hide">三级：<asp:DropDownList runat="server" ID="ddlG3"></asp:DropDownList><span class="hide">&nbsp;<asp:DropDownList runat="server" ID="ddlP3"></asp:DropDownList><span class="hide">：<asp:TextBox runat="server" ID="tbSep3" Width="176"></asp:TextBox></span><asp:DropDownList runat="server" ID="ddlSpan3" CssClass="hide"></asp:DropDownList></span>&nbsp;&nbsp;排序：<asp:DropDownList runat="server" ID="ddlSort3"></asp:DropDownList><asp:DropDownList runat="server" ID="sort3"></asp:DropDownList></div>
                        <div runat="server" id="group4" class="hide">四级：<asp:DropDownList runat="server" ID="ddlG4"></asp:DropDownList><span class="hide">&nbsp;<asp:DropDownList runat="server" ID="ddlP4"></asp:DropDownList><span class="hide">：<asp:TextBox runat="server" ID="tbSep4" Width="176"></asp:TextBox></span><asp:DropDownList runat="server" ID="ddlSpan4" CssClass="hide"></asp:DropDownList></span>&nbsp;&nbsp;排序：<asp:DropDownList runat="server" ID="ddlSort4"></asp:DropDownList><asp:DropDownList runat="server" ID="sort4"></asp:DropDownList></div>
                        <div runat="server" id="group5" class="hide">五级：<asp:DropDownList runat="server" ID="ddlG5"></asp:DropDownList><span class="hide">&nbsp;<asp:DropDownList runat="server" ID="ddlP5"></asp:DropDownList><span class="hide">：<asp:TextBox runat="server" ID="tbSep5" Width="176"></asp:TextBox></span><asp:DropDownList runat="server" ID="ddlSpan5" CssClass="hide"></asp:DropDownList></span>&nbsp;&nbsp;排序：<asp:DropDownList runat="server" ID="ddlSort5"></asp:DropDownList><asp:DropDownList runat="server" ID="sort5"></asp:DropDownList></div>
                    </td><td class="vbottom">
                        <a runat="server" id="aAdd" href="#" onclick="return addGroup();" title="增加下级分组" class="f-rr f0"></a>
                    </td></tr></table>
                </div>
            <div class="item"><span class="key">报表要显示哪些内容？</span></div>
            <div class="setting"><asp:CheckBoxList runat="server" ID="cblFields" class="green" RepeatLayout="Flow" ToolTip="拖动调序" RepeatDirection="Horizontal"></asp:CheckBoxList><button type="button" class="f-duoxuan btn smest outline" onclick="SelectAll(this,'p_cblFields');">全选</button><button type="button" class="f-ok btn smest outline" onclick="RevSelect('p_cblFields');">反选</button>
                <div class="sepline2"></div>
                <div class="middle"><span>选项：</span><asp:CheckBox runat="server" ID="cbNo" Text="序号" /> <asp:CheckBox runat="server" ID="cbCount" Text="计数" /> <asp:CheckBox runat="server" ID="cbDetail" Text="显示明细" /></div>
            </div>
            <div class="item"><span class="key">统计方法：</span><asp:DropDownList runat="server" ID="ddlCompute"></asp:DropDownList></div>
            <div class="setting middle" runat="server" id="spanExclude" title="勾选不予统计的字段"><span>排除：</span><asp:CheckBoxList runat="server" ID="cblExclude" CssClass="green" RepeatLayout="Flow" RepeatDirection="Horizontal"></asp:CheckBoxList></div>
            <div class="item" id="divDetailSort"><span class="key">明细顺序：</span><asp:DropDownList runat="server" ID="ddlDetailSort"></asp:DropDownList> <asp:DropDownList runat="server" ID="sortDetail"><asp:ListItem Value="ASC" Selected="True">升序</asp:ListItem><asp:ListItem Value="DESC">降序</asp:ListItem></asp:DropDownList></div>
            <div class="item" id="divTitle"><span class="key">报表标题：</span><asp:TextBox runat="server" ID="tbTitle" Width="16em" Tooltip="留空自动生成标题"></asp:TextBox></div>
            <div class="item" id="divSign"><span class="key vtop">报表脚注：</span><div runat="server" contenteditable="true" id="note"></div></div>
            <asp:HiddenField runat="server" ID="footcon" />
        </ContentTemplate>
    </ims:Pop>        
    <asp:UpdatePanel ID="upBtns" runat="server" ChildrenAsTriggers="false" UpdateMode="conditional">
    <ContentTemplate>
        <input type="button" class="btn" value="报表设置" runat="server" id="btnSetting" onclick="ShowPop('p_popup');" />
	    <input type="button" runat="server" class="btn" value="报表操作" id="btnManage" onclick="return showEleMenu('#btnManage','#reportList');" onserverclick="ManageReports" />
        <input type="button" runat="server" id="btnExport" onclick="return toExportAs('#up');" value="导出" class="btn" />
        <input type="button" runat="server" id="btnPrint" value="打印" onclick="toPrint(event);" class="btn pconly" />
    </ContentTemplate>
    </asp:UpdatePanel>
    <ims:Pop runat="server" ID="m" ShowOkButton="false" CanelButtonText="关闭" Title="管理报表" HelpSubject="reportManage">
        <ContentTemplate>
            <div runat="server" id="allReports">
                <table class="fine">
                    <tr><th>报表</th><th style="width:32px">默认</th><th style="width:32px">更名</th><th style="width:32px">删除</th></tr>
                    <asp:PlaceHolder runat="server" ID="phReports"></asp:PlaceHolder>
                </table>
            </div>
            <fieldset class="mtop_n mbottom_s"><legend>默认报表规则</legend>
                <div class="padbox">
                    <ol runat="server" id="olRules"></ol>
                    <div class="right"><a href="#" id="aAddRule" runat="server" onserverclick="ToAddRule">添加</a></div>
                </div>
            </fieldset>
            <asp:CheckBox runat="server" ID="cbDisChange" Text="禁止普通用户切换报表" onclick="switchChange();" />
        </ContentTemplate>
    </ims:Pop>
    <ims:Pop runat="server" ID="rule" OnClientUpdated="setTimeout(initRule,0);" Width="410" OnOkClick="SaveRule" HideOnOkClientClick="false">
        <ContentTemplate>
            <table class="fixedLayout">
                <tr><td class="ruleKey">指定角色：</td><td><asp:TextBox runat="server" ID="tbRoles" TextMode="MultiLine" Rows="3" Width="98%" acfid="RoleName" chars=";；、,，" ToolTip="输入角色名。多项之间以逗号、分号或顿号分隔"></asp:TextBox></td></tr>
                <tr><td class="ruleKey">默认报表：</td><td><asp:DropDownList runat="server" ID="ddlAll"></asp:DropDownList></td></tr>
            </table>
        </ContentTemplate>
    </ims:Pop>
    <asp:UpdatePanel ID="reportList" runat="server" UpdateMode="Conditional" class="menu" />
    <script src="js/comm.js"></script>
    <script src="Ckeditor/ckeditor.js"></script>
    <script src="Ckeditor/Ckfinder/ckfinder.js"></script>
    <script src="js/report.js"></script>
    </form>
</body>
</html>