<%@ Page Language="c#" Inherits="Web.Wpdcc.welcome" CodeBehind="welcome.aspx.cs" %>

<!DOCTYPE html>
<html>
<head>
    <title>Operation Guide</title>
    <!--#include file = "../Css/head.htm" -->
    <style>
        * {
            -webkit-box-sizing: border-box;
            -moz-box-sizing: border-box;
            box-sizing: border-box;
        }

        .widget-color-1{border-color:#87B87F;}
        .widget-color-1 .widget-header{background: #87B87F;}

        .widget-color-2{border-color:#6FB3E0;}
        .widget-color-2 .widget-header{background: #6FB3E0;}

        .widget-header h4 {
            font-family: "Microsoft Yahei";
        }

        .widget-box-liveness ul > li {
            margin-bottom: 10px;
        }
    </style>
</head>
<body>
    <div class="main-content-inner">
        <!-- #section:basics/content.breadcrumbs -->
        <div class="page-content">
            <div class="page-header">
                <h1>
                    Welcome
                    <small>
                        <i class="ace-icon fa fa-angle-double-right"></i>
                        引导 &amp; 统计
								</small>
                </h1>
            </div>
            <!-- /section:settings.box -->
            <div class="row">
                <div class="col-xs-12">
                    <!-- PAGE CONTENT BEGINS -->
                    <div class="row">
                        <div class="widget-container-col col-sm-12">
                            <div class="widget-box">
                                <div class="widget-body bg-info">
                                    <div class="widget-main padding-30">
                                        <ul class="steps">
                                            <li data-step="1" class="active">
                                                <span class="step">1</span>
                                                <h1 class="title h1">基本设置</h1>
                                                <div class="col-sm-6 col-sm-offset-3">
                                                    <ul class="list-group">
                                                        <button class="btn btn-primary btn-block no-border" style="width:118px;" onclick="javascript:window.location.href='wpctl/manageSiteBasicProperty.aspx'">网站常用设置</button>
                                                        <button class="btn btn-primary btn-block no-border" style="width:118px;" onclick="javascript:window.location.href='wpctl/manageUploadFilesProperty.aspx'">网站高级属性</button>
                                                    </ul>
                                                </div>
                                            </li>

                                            <li data-step="2" class="active">
                                                <span class="step">2</span>
                                                <h1 class="title h1">模板管理</h1>
                                                <div class="col-sm-6 col-sm-offset-3">
                                                    <ul class="list-group">
                                                        <button class="btn btn-primary btn-block no-border" style="width:104px;" onclick="javascript:window.location.href='manageTempLib.aspx'">公用库模板</button>
                                                        <button class="btn btn-primary btn-block no-border" style="width:104px;" onclick="javascript:window.location.href='manageTempPage.aspx?type=2'">频道页模板</button>
                                                        <button class="btn btn-primary btn-block no-border" style="width:104px;" onclick="javascript:window.location.href='manageTempPage.aspx?type=1'">更多页模板</button>
                                                        <button class="btn btn-primary btn-block no-border" style="width:104px;" onclick="javascript:window.location.href='manageTempPage.aspx?type=0'">新闻页模板</button>
                                                    </ul>
                                                </div>
                                            </li>

                                            <li data-step="3" class="active">
                                                <span class="step">3</span>
                                                <h1 class="title h1">栏目管理</h1>
                                                <div class="col-sm-6 col-sm-offset-3">
                                                    <ul class="list-group">
                                                        <button class="btn btn-primary btn-block no-border" style="width:104px;" onclick="javascript:window.location.href='manageMenuTree.aspx'">栏目及布局</button>
                                                    </ul>
                                                </div>
                                            </li>

                                            <li data-step="4" class="active">
                                                <span class="step">4</span>
                                                <h1 class="title h1">用户管理</h1>
                                                <div class="col-sm-6 col-sm-offset-3">
                                                    <ul class="list-group">
                                                        <button class="btn btn-primary btn-block no-border" style="width:132px;" onclick="javascript:window.location.href='manageUsers.aspx'">用户及权限分配</button>
                                                    </ul>
                                                </div>
                                            </li>
                                        </ul>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                    <hr />
                    <div class="row">
                        <div class="widget-container-col col-sm-4">
                            <div class="widget-box widget-color-1">
                                <div class="widget-header">
                                    <h4 class="widget-title">使用空间情况</h4>
                                </div>
                                <div class="widget-body" style="min-height: 170px">
                                    <!-- #section:plugins/charts.flotchart -->
                                    <div id="piechart-placeholder"></div>
                                </div>
                            </div>
                        </div>
                        <div class="widget-container-col col-sm-4">
                            <div class="widget-box widget-color-2 widget-box-liveness">
                                <div class="widget-header">
                                    <h4 class="widget-title">本月活跃栏目</h4>
                                    <span class="widget-toolbar">
                                        <a data-action="settings" data-container="body" data-toggle="tooltip" data-placement="top" title="用户发文统计" href="javascript:void(0);" onclick="javascript:window.location.href='manageNewsImg.aspx'">
                                            <i class="ace-icon glyphicon glyphicon-search white"></i>
                                        </a>
                                    </span>
                                </div>
                                <div class="widget-body" style="min-height: 170px">
                                    <div class="widget-main">
                                        <ul class="list-group">
                                            <li id="none" runat="server" visible="false">
                                                <div class="alert alert-danger">
                                                    <strong>
                                                        <i class="ace-icon fa fa-exclamation-circle"></i>
                                                        本月暂无新闻发送
											</strong>
                                                </div>
                                            </li>
                                            <li id="little" runat="server" visible="false">
                                                <div class="alert alert-danger">
                                                    <button class="close" type="button" data-dismiss="alert">
                                                        <i class="ace-icon fa fa-times"></i>
                                                    </button>
                                                    <strong>
                                                        <i class="ace-icon fa fa-exclamation-circle"></i>
                                                        本月活跃栏目较少
											</strong>
                                                </div>
                                            </li>
                                            <li id="class1" runat="server">
                                                <div id="classNo1" runat="server">
                                                </div>
                                            </li>
                                            <li id="class2" runat="server">
                                                <div id="classNo2" runat="server">
                                                </div>
                                            </li>
                                            <li id="class3" runat="server">
                                                <div id="classNo3" runat="server">
                                                </div>
                                            </li>
                                            <li id="class4" runat="server">
                                                <div id="classNo4" runat="server">
                                                </div>
                                            </li>
                                        </ul>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="widget-container-col col-sm-4">
                            <div class="widget-box widget-color-red3">
                                <div class="widget-header">
                                    <h4 class="widget-title">网站备份</h4>
                                    <span class="widget-toolbar">
                                        <a data-action="settings" data-container="body" data-toggle="tooltip" data-placement="top" title="备份" href="javascript:void(0);" onclick="javascript:window.location.href='Wpbak/operate.aspx'">
                                            <i class="glyphicon glyphicon-floppy-open white"></i>
                                        </a>
                                    </span>
                                </div>
                                <div class="widget-body" style="height: 170px">
                                    <div class="widget-main">
                                        <ul class="list-group">
                                            <li>
                                                <div class="alert alert-danger" id="danger" runat="server" visible="false">
                                                    <strong>
                                                        <button class="close" type="button" data-dismiss="alert">
                                                            <i class="ace-icon fa fa-times"></i>
                                                        </button>
                                                        <i class="ace-icon fa fa-exclamation-circle"></i>
                                                        <%= welcomepmsg %>
											</strong>
                                                </div>
                                                <div id="time" runat="server">
                                                </div>
                                            </li>
                                        </ul>
                                    </div>
                                </div>
                            </div>
                        </div>



                    </div>
                    <!-- PAGE CONTENT ENDS -->
                </div>
                <!-- /.col -->
            </div>
            <!-- /.row -->
        </div>
        <!-- /.page-content -->
    </div>
    <!--#include file = "../Css/foot.htm" -->
    <script src="../assets/js/flot/jquery.flot.js"></script>
    <script src="../assets/js/flot/jquery.flot.pie.js"></script>
    <script src="../assets/js/flot/jquery.flot.resize.js"></script>
    <!-- inline scripts related to this page -->
    <script>
        $(function () {
            $.resize.throttleWindow = false;

            var placeholder = $('#piechart-placeholder').css({ 'width': '90%', 'min-height': '150px' });
            var data = [
              { label: "剩余空间", data: 48.7, color: "#68BC31" },
              { label: "文件下载空间", data: 24.5, color: "#2091CF" },
              { label: "网站程序占用空间", data: 8.2, color: "#AF4E96" },
              { label: "其它程序占用空间", data: 18.6, color: "#DA5430" },
            ]
            function drawPieChart(placeholder, data, position) {
                $.plot(placeholder, data, {
                    series: {
                        pie: {
                            show: true,
                            tilt: 0.8,
                            highlight: {
                                opacity: 0.25
                            },
                            stroke: {
                                color: '#fff',
                                width: 2
                            },
                            startAngle: 2
                        }
                    },
                    legend: {
                        show: true,
                        position: position || "ne",
                        labelBoxBorderColor: null,
                        margin: [-30, 15]
                    }
                  ,
                    grid: {
                        hoverable: true,
                        clickable: true
                    }
                })
            }
            drawPieChart(placeholder, data);
            placeholder.data('chart', data);
            placeholder.data('draw', drawPieChart);
            //pie chart tooltip example
            var $tooltip = $("<div class='tooltip top in'><div class='tooltip-inner'></div></div>").hide().appendTo('body');
            var previousPoint = null;

            placeholder.on('plothover', function (event, pos, item) {
                if (item) {
                    if (previousPoint != item.seriesIndex) {
                        previousPoint = item.seriesIndex;
                        var tip = item.series['label'] + " : " + item.series['percent'] + '%';
                        $tooltip.show().children(0).text(tip);
                    }
                    $tooltip.css({ top: pos.pageY + 10, left: pos.pageX + 10 });
                } else {
                    $tooltip.hide();
                    previousPoint = null;
                }

            });
        })
    </script>
    <script type="text/javascript">

        //加载运行监控图
        $('#GridView1 tr').each(function () {
            var t1 = $(this).find('td').eq(2);
            var t2 = $(this).find('td').eq(3);
            var t3 = $(this).find('td').eq(4);
            var t4 = $(this).find('td').eq(5);
            var a = $(this).find('td').eq(1).find('a').attr('href');

            //获取发文量
            $.ajax({
                type: "GET",
                url: a + "/service/get_fw.ashx",
                data: { ak: "402880c017155f390117156dec37000e", startime: getCycleFormatDate($('#HfFWCycle').val()), endtime: getNowFormatDate() },
                dataType: "json",
                success: function (data) {

                    if (data.ret > 0) {
                        t1.html(data.msg);
                    }
                    else {
                        var fws = $('#HfFWStandard').val();//获取标准值。
                        var bfb = (Math.round(data.value / (fws * 2) * 10000) / 100.00);// 小数点后两位百分比，此处的“2”为长度系数。

                        if (bfb >= 50) {
                            t1.html("<div class=\"progress pos-rel\" data-percent=\"" + data.value + "篇\"><div class=\"progress-bar\" style=\"width:" + bfb + "%;\"></div></div>");
                        }
                        else {
                            t1.html("<div class=\"progress pos-rel progress-yellow\" data-percent=\"" + data.value + "篇\"><div class=\"progress-bar progress-bar-yellow\" style=\"width:" + bfb + "%;\"></div></div>");
                        }
                    }
                },
                error: function () {
                    t1.empty();   //清空
                    //t1.html("加载异常");
                    t1.html("<div class=\"progress pos-rel progress-yellow\" data-percent=\"获取失败\"><div class=\"progress-bar progress-bar-danger\" style=\"width:1%;\"></div></div>");
                }
            });
        });
    </script>
    


</body>
</html>
