<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="utf-8" />
    <title><?php echo $_CONFIG->config_data('name')?></title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <!--Basic Styles-->
    <link href="<?php echo style2015;?>assets/css/bootstrap.min.css" rel="stylesheet" />
    <link id="bootstrap-rtl-link" href="#" rel="stylesheet" />
    <link href="<?php echo style2015;?>assets/css/font-awesome.min.css" rel="stylesheet" />
    <link href="<?php echo style2015;?>assets/css/weather-icons.min.css" rel="stylesheet" />
    <!--Beyond styles-->
    <link id="beyond-link" href="<?php echo style2015;?>assets/css/beyond.min.css" rel="stylesheet" type="text/css" />
    <link href="<?php echo style2015;?>assets/css/demo.min.css" rel="stylesheet" />
    <link href="<?php echo style2015;?>assets/css/typicons.min.css" rel="stylesheet" />
    <link href="<?php echo style2015;?>assets/css/animate.min.css" rel="stylesheet" />
    <link id="skin-link" href="<?php echo style2015;?>assets/css/skins/darkblue.min.css" rel="stylesheet" type="text/css" />

    <!--Skin Script: Place this script in head to load scripts for skins and rtl support-->
    <script src="<?php echo style2015;?>assets/js/skins.min.js"></script>
</head>
<!-- /Head -->
<!-- Body -->
<body scroll="no">
    <!-- Loading Container -->
    <div class="loading-container">
        <div class="loader"></div>
    </div>
    <!--  /Loading Container -->
    <!-- Navbar -->
    <div class="navbar navbar-fixed-top">
        <div class="navbar-inner">
            <div class="navbar-container">
                <!-- Navbar Barnd -->
                <div class="navbar-header pull-left">
                    <a href="#" class="navbar-brand" style="padding-top:18px;font-family:verdana;font-size:18px;zoom-x:5;zoom-y:1; font-weight:400;">
                      
						<?php
						echo $_CONFIG->config_data('name');
						//if (!$_CONFIG->config_data('logo')){
						//	echo '<img src="template/default/images/admin_img/logo.png" alt="" />';
						//}else{
						//	echo '<img src="'.$_CONFIG->config_data('logo').'" alt="" />';
						//}
						?>
                       
                     
                    </a>
                </div>
                <!-- /Navbar Barnd -->
                <!-- Sidebar Collapse -->
                <div class="sidebar-collapse" id="sidebar-collapse" title="展开菜单">
                    <i class="collapse-icon fa fa-bars"></i>
                </div>
                <!-- /Sidebar Collapse -->
                <!-- Account Area and Settings --->
                <div class="navbar-header pull-right">
                    <div class="navbar-account">
                        <ul class="account-area">
                            
                            <li>
							<a href="javascript:;" class="sidebar-toggler" title="关闭菜单">
                                <i class="icon fa fa-arrows-alt"></i>
                            </a>
							</li>
							<li>
                                <a class="dropdown-toggle" onClick="_SMS();" data-toggle="dropdown" title="微消息" href="#">
                                    <i class="icon fa fa-comments"></i>
                                    <span class="badge" id="sms_num"></span>
                                </a>
                                <!--Messages Dropdown-->
                                <ul class="pull-right dropdown-menu dropdown-arrow dropdown-messages" id="_SMS">
								
								
                                    
                                </ul>
                                <!--/Messages Dropdown-->
                            </li>
						   <?php if(mysql_num_rows(mysql_query("SHOW TABLES LIKE '".DB_TABLEPRE.DB_JT."recemail'"))==1){?>
                            <li>
                                <a class="dropdown-toggle" onClick="_Mail();" data-toggle="dropdown" title="邮件" href="#">
                                    <i class="icon fa fa-envelope"></i>
                                    <span class="badge"  id="mail_num"></span>
                                </a>
                                <!--Tasks Dropdown-->
                                <ul class="pull-right dropdown-menu dropdown-messages dropdown-arrow " id="_Mail">
                                   
                                </ul>
                                <!--/Tasks Dropdown-->
                            </li>
							<?php }?>
                            <li>
                                <a class="wave in" id="chat-link" title="在线聊天" href="#">
                                    <i class="icon glyphicon glyphicon-comment"></i>
                                </a>
                            </li>
                            <li>
                                <a class="login-area dropdown-toggle" data-toggle="dropdown">
                                    <div class="avatar">
                                        <img src="<?php echo $user['pic'];?>" >
                                    </div>
                                    <section>
                                        <h2><span class="profile" style="width:74px;"><span><?php echo get_realname($_USER->id)?></span></span></h2>
                                    </section>
                                </a>
                                <!--Login Area Dropdown-->
                                <ul class="pull-right dropdown-menu  dropdown-login-area">
                                    
                                    
                                    <!--Avatar Area-->
                                    <li>
                                        <div class="avatar-area">
                                            <img src="<?php echo $user['pic'];?>" class="avatar">
													
                                        </div>
                                    </li>
                                    <!--Avatar Area-->
                                    <li class="edit">
                                        
                                        <a href="javascript:;" class="pull-left">切换皮肤</a>
                                    </li>
                                    <!--Theme Selector Area-->
                                    <li class="theme-area">
                                        <ul class="colorpicker" id="skin-changer">
                                            <li><a class="colorpick-btn" href="#" style="background-color:#5DB2FF;" rel="<?php echo style2015;?>assets/css/skins/blue.min.css"></a></li>
                                            <li><a class="colorpick-btn" href="#" style="background-color:#2dc3e8;" rel="<?php echo style2015;?>assets/css/skins/azure.min.css"></a></li>
                                            <li><a class="colorpick-btn" href="#" style="background-color:#03B3B2;" rel="<?php echo style2015;?>assets/css/skins/teal.min.css"></a></li>
                                            <li><a class="colorpick-btn" href="#" style="background-color:#53a93f;" rel="<?php echo style2015;?>assets/css/skins/green.min.css"></a></li>
                                            <li><a class="colorpick-btn" href="#" style="background-color:#FF8F32;" rel="<?php echo style2015;?>assets/css/skins/orange.min.css"></a></li>
                                            <li><a class="colorpick-btn" href="#" style="background-color:#cc324b;" rel="<?php echo style2015;?>assets/css/skins/pink.min.css"></a></li>
                                            <li><a class="colorpick-btn" href="#" style="background-color:#AC193D;" rel="<?php echo style2015;?>assets/css/skins/darkred.min.css"></a></li>
                                            <li><a class="colorpick-btn" href="#" style="background-color:#8C0095;" rel="<?php echo style2015;?>assets/css/skins/purple.min.css"></a></li>
                                            <li><a class="colorpick-btn" href="#" style="background-color:#0072C6;" rel="<?php echo style2015;?>assets/css/skins/darkblue.min.css"></a></li>
                                            <li><a class="colorpick-btn" href="#" style="background-color:#585858;" rel="<?php echo style2015;?>assets/css/skins/gray.min.css"></a></li>
											<li><a class="colorpick-btn" href="#" style="background-color:#474544;" rel="<?php echo style2015;?>assets/css/skins/black.min.css"></a></li>
                                            <li><a class="colorpick-btn" href="#" style="background-color:#001940;" rel="<?php echo style2015;?>assets/css/skins/deepblue.min.css"></a></li>
                                            
                                        </ul>
                                    </li>
                                    <!--/Theme Selector Area-->
                                    <li class="dropdown-footer">
                                        <a href="login.php?do=logout">
                                            安全退出
                                        </a>
                                    </li>
                                </ul>
                                <!--/Login Area Dropdown-->
                            </li>
                            <!-- /Account Area -->
                       </ul>  
					     
                    </div>
                </div>
                <!-- /Account Area and Settings -->
            </div>
        </div>
		 
    </div>
    <!-- /Navbar -->
    <!-- Main Container -->
    <div class="main-container container-fluid">
        <!-- Page Container -->
        <div class="page-container">
            <!-- Page Sidebar -->
            <div class="page-sidebar sidebar-fixed" id="sidebar">
				
                <!-- Sidebar Menu -->
                <ul class="nav sidebar-menu">
                    <!--Dashboard-->
                    <li class="active">
                        <a href="javascript:_M(0,'home.php?file=text')" hidefocus="true">
                            <i class="menu-icon glyphicon glyphicon-home"></i>
                            <span class="menu-text">个人门户</span>
                        </a>
                    </li>
					<?php
					foreach ( $_CACHE[DB_JT.'menu'] as $row) {
						if($row['fatherid']=='0' && $row[menutype]!='1'){
							if($row[keytable]){
							if(is_superadmin() || check_purview($row[keytable])){
					?>
					<li>
                        <a href="javascript:_M(<?php echo $row[menuid]?>,'<?php echo $row[menuurl]?>');" hidefocus="true" class="menu-dropdown" title="<?php echo $row[menuname]?>">
                            <i class="menu-icon fa <?php echo _Nico($row[menuid]);?>"></i>
                            <span class="menu-text"><?php echo $row[menuname]?></span>
                            <i class="menu-expand"></i>
                        </a>
						 <!--<div class="page-chatbar-s">
							<div id="munuviews"></div>
						 </div> -->
					</li>
					<?php
							}
						}else{
						?>
					<li >
                        <a href="javascript:_M(<?php echo $row[menuid]?>,'<?php echo $row[menuurl]?>');" hidefocus="true" class="menu-dropdown"  title="<?php echo $row[menuname]?>">
                            <i class="menu-icon fa <?php echo _Nico($row[menuid]);?>"></i>
                            <span class="menu-text"><?php echo $row[menuname]?></span>
                            <i class="menu-expand"></i>
                        </a>
						 <!--<div class="page-chatbar-s">
							<div id="munuviews"></div>
						 </div> -->
					</li>
					<?php
						}
						}
					}
					?>
                </ul>
                <!-- /Sidebar Menu -->
            </div>
            <!-- /Page Sidebar -->
            <!-- Chat Bar -->
            <div id="chatbar" class="page-chatbar">
                <div class="chatbar-contacts">
                    <div class="contacts-search">
                        <input type="text" class="searchinput" id="user" name="user" placeholder="姓名查找" />
                        <i class="searchicon fa fa-search" onClick="search_user();"></i>
                        <div class="searchhelper">请输入同事的姓名进行查找</div>
                    </div>
                    <ul class="contacts-list" id="_SmsShow">
					 <!--<div class="online"></div><div class="offline"></div> -->
					
						
                        
                    </ul>
                </div>
                <div class="chatbar-messages" style="display: none;">
                    <div class="messages-contact" id="_SmsBack">
                        
                    </div>



                    <ul class="messages-list" id="_SmsMsg">
                        
                    </ul>
                    <div class="send-message">
                        <span class="input-icon icon-right">
                            <textarea name="SMS_CONTENT" class="form-control" placeholder="输入消息内容" style="height:50px;"></textarea>
                            <!--<i class="ico glyphicon glyphicon-arrow-right">
</i> --><a href="javascript:;" onClick="_SmsAdd();" style="margin-top:5px; float:right; width:80px; height:30px;" class="btn btn-darkorange">发 送</a>
                        </span>
                    </div>
                </div>
            </div>
            <!-- /Chat Bar -->
            <!-- Page Content -->
            <div class="page-content">
               <!-- Page Breadcrumb -->
                <div class="page-breadcrumbs">
                    <ul class="breadcrumb" id="munutopviews">
                       <li>
                            <i class="fa fa-home"></i>
                            <a href="javascript:_M(0,'home.php?file=new')">桌面</a>
                        </li>
                    </ul>

                </div>
                <!-- /Page Breadcrumb -->
                
                <!-- Page Body -->
                <div class="page-body">
					<iframe name="right" id="rightMain" class="rightMain" frameborder="false" src="" scrolling="auto" style="border:none;" width="100%" height="auto" allowtransparency="true"></iframe>
				</div>
                <!-- /Page Body -->
            </div>
            <!-- /Page Content -->

        </div>
        <!-- /Page Container -->
        <!-- Main Container -->

    </div>

    <!--Basic Scripts-->
    <script src="<?php echo style2015;?>assets/js/jquery.min.js"></script>
    <script src="<?php echo style2015;?>assets/js/bootstrap.min.js"></script>
    <script src="<?php echo style2015;?>assets/js/slimscroll/jquery.slimscroll.min.js"></script>

    <!--Beyond Scripts-->
    <script src="<?php echo style2015;?>assets/js/beyond.js"></script>


    <!--Page Related Scripts-->
    <!--Sparkline Charts Needed Scripts-->
    <script src="<?php echo style2015;?>assets/js/charts/sparkline/jquery.sparkline.js"></script>
    <script src="<?php echo style2015;?>assets/js/charts/sparkline/sparkline-init.js"></script>

    <!--Easy Pie Charts Needed Scripts-->
    <script src="<?php echo style2015;?>assets/js/charts/easypiechart/jquery.easypiechart.js"></script>
    <script src="<?php echo style2015;?>assets/js/charts/easypiechart/easypiechart-init.js"></script>

    <!--Flot Charts Needed Scripts-->
    <script src="<?php echo style2015;?>assets/js/charts/flot/jquery.flot.js"></script>
    <script src="<?php echo style2015;?>assets/js/charts/flot/jquery.flot.resize.js"></script>
    <script src="<?php echo style2015;?>assets/js/charts/flot/jquery.flot.pie.js"></script>
    <script src="<?php echo style2015;?>assets/js/charts/flot/jquery.flot.tooltip.js"></script>
    <script src="<?php echo style2015;?>assets/js/charts/flot/jquery.flot.orderBars.js"></script>
    <script>
		function _M(menuid,targetUrl) {
			$("#rightMain").attr('src', targetUrl);
			//if(menuid!=0){
				MenuTopForm(menuid);
			//}
		}
		_M(0,'home.php?file=new');
		new_menu();
        $(window).bind("load", function () {
            /*Sets Themed Colors Based on Themes*/
            themeprimary = getThemeColorFromCss('themeprimary');
            themesecondary = getThemeColorFromCss('themesecondary');
            themethirdcolor = getThemeColorFromCss('themethirdcolor');
            themefourthcolor = getThemeColorFromCss('themefourthcolor');
            themefifthcolor = getThemeColorFromCss('themefifthcolor');
			$winheight=$(window).height()-107;
			$('#rightMain').height($winheight);
			online_mon();
			//-- 在线人员 --
			function online_mon(){
			   jQuery.ajax({
				  type: 'GET',
				  url: 'inc/user_count.php?date='+new Date(),
				  success: function(data){
				  }
			   });
			   window.setTimeout(online_mon,60*5*1000);
			}
			public_workflow();
			//-- 综合流程业务处理 --
			function public_workflow()
			{
			   jQuery.ajax({
				  type: 'GET',
				  url: 'inc/workflow.php?date='+new Date(),
				  success: function(data){
				  //$('user_count').innerHTML = data;
				  $("#public_workflow").html(data);
				  }
			   });
			   window.setTimeout(public_workflow,120*5*1000);
			}
			new_menu();
			//消息提示,设定标题提示
			var newSmsSoundHtml = "<object id='sms_sound' classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='template/default/swf/swflash.cab' width='0' height='0'><param name='movie' value='template/default/swf/9.swf'><param name=quality value=high><embed id='sms_sound' src='template/default/swf/9.swf' width='0' height='0' quality='autohigh' wmode='opaque' type='application/x-shockwave-flash' plugspace='http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash'></embed></object>";
			
			sms_count();
			function sms_count(type)
			{
			   jQuery.ajax({
				  type: 'GET',
				  url: 'inc/sms_count.php?date='+new Date(),
				  success: function(data){
					if(data=='1'){
						//jQuery('#shortcut').click();
						//$('#sms_count').html('<img src="template/default/images/xin.gif">');
						$('#sms_sound').html(newSmsSoundHtml);
						//$("#sms_num").html(data);
						//alert(data);
					}else{
						 $('#sms_count').html('  ');
					}
				  }
			   });
			
			   window.setTimeout(sms_count,10*5*1000);
			}
			sms_num();
			function sms_num(type)
			{
			   jQuery.ajax({
				  type: 'GET',
				  url: 'inc/sms_count_num.php?date='+new Date(),
				  success: function(data){
					$("#sms_num").html(data);
				  }
			   });
			
			   window.setTimeout(sms_num,10*5*1000);
			}
			mail_num();
			function mail_num(type)
			{
			   jQuery.ajax({
				  type: 'GET',
				  url: 'inc/mail_num.php?date='+new Date(),
				  success: function(data){
					$("#mail_num").html(data);
				  }
			   });
			   window.setTimeout(mail_num,20*5*1000);
			}
            //Sets The Hidden Chart Width
            $('#dashboard-bandwidth-chart')
                .data('width', $('.box-tabbs')
                    .width() - 20);

            //-------------------------Visitor Sources Pie Chart----------------------------------------//
            var data = [
                {
                    data: [[1, 21]],
                    color: '#fb6e52'
                },
                {
                    data: [[1, 12]],
                    color: '#e75b8d'
                },
                {
                    data: [[1, 11]],
                    color: '#a0d468'
                },
                {
                    data: [[1, 10]],
                    color: '#ffce55'
                },
                {
                    data: [[1, 46]],
                    color: '#5db2ff'
                }
            ];
            var placeholder = $("#dashboard-pie-chart-sources");
            placeholder.unbind();

            $.plot(placeholder, data, {
                series: {
                    pie: {
                        innerRadius: 0.45,
                        show: true,
                        stroke: {
                            width: 4
                        }
                    }
                }
            });

            //------------------------------Visit Chart------------------------------------------------//
            var data2 = [{
                color: themesecondary,
                label: "Direct Visits",
                data: [[3, 2], [4, 5], [5, 4], [6, 11], [7, 12], [8, 11], [9, 8], [10, 14], [11, 12], [12, 16], [13, 9],
                [14, 10], [15, 14], [16, 15], [17, 9]],

                lines: {
                    show: true,
                    fill: true,
                    lineWidth: .1,
                    fillColor: {
                        colors: [{
                            opacity: 0
                        }, {
                            opacity: 0.4
                        }]
                    }
                },
                points: {
                    show: false
                },
                shadowSize: 0
            },
                {
                    color: themeprimary,
                    label: "Referral Visits",
                    data: [[3, 10], [4, 13], [5, 12], [6, 16], [7, 19], [8, 19], [9, 24], [10, 19], [11, 18], [12, 21], [13, 17],
                    [14, 14], [15, 12], [16, 14], [17, 15]],
                    bars: {
                        order: 1,
                        show: true,
                        borderWidth: 0,
                        barWidth: 0.4,
                        lineWidth: .5,
                        fillColor: {
                            colors: [{
                                opacity: 0.4
                            }, {
                                opacity: 1
                            }]
                        }
                    }
                },
                {
                    color: themethirdcolor,
                    label: "Search Engines",
                    data: [[3, 14], [4, 11], [5, 10], [6, 9], [7, 5], [8, 8], [9, 5], [10, 6], [11, 4], [12, 7], [13, 4],
                    [14, 3], [15, 4], [16, 6], [17, 4]],
                    lines: {
                        show: true,
                        fill: false,
                        fillColor: {
                            colors: [{
                                opacity: 0.3
                            }, {
                                opacity: 0
                            }]
                        }
                    },
                    points: {
                        show: true
                    }
                }
            ];
            var options = {
                legend: {
                    show: false
                },
                xaxis: {
                    tickDecimals: 0,
                    color: '#f3f3f3'
                },
                yaxis: {
                    min: 0,
                    color: '#f3f3f3',
                    tickFormatter: function (val, axis) {
                        return "";
                    },
                },
                grid: {
                    hoverable: true,
                    clickable: false,
                    borderWidth: 0,
                    aboveData: false,
                    color: '#fbfbfb'

                },
                tooltip: true,
                tooltipOpts: {
                    defaultTheme: false,
                    content: " <b>%x May</b> , <b>%s</b> : <span>%y</span>",
                }
            };
            var placeholder = $("#dashboard-chart-visits");
            var plot = $.plot(placeholder, data2, options);

            //------------------------------Real-Time Chart-------------------------------------------//
            var realTimedata = [],
                realTimedata2 = [],
                totalPoints = 300;

            var getSeriesObj = function () {
                return [
                {
                    data: getRandomData(),
                    lines: {
                        show: true,
                        lineWidth: 1,
                        fill: true,
                        fillColor: {
                            colors: [
                                {
                                    opacity: 0
                                }, {
                                    opacity: 1
                                }
                            ]
                        },
                        steps: false
                    },
                    shadowSize: 0
                }, {
                    data: getRandomData2(),
                    lines: {
                        lineWidth: 0,
                        fill: true,
                        fillColor: {
                            colors: [
                                {
                                    opacity: .5
                                }, {
                                    opacity: 1
                                }
                            ]
                        },
                        steps: false
                    },
                    shadowSize: 0
                }
                ];
            };
            function getRandomData() {
                if (realTimedata.length > 0)
                    realTimedata = realTimedata.slice(1);

                // Do a random walk

                while (realTimedata.length < totalPoints) {

                    var prev = realTimedata.length > 0 ? realTimedata[realTimedata.length - 1] : 50,
                        y = prev + Math.random() * 10 - 5;

                    if (y < 0) {
                        y = 0;
                    } else if (y > 100) {
                        y = 100;
                    }
                    realTimedata.push(y);
                }

                // Zip the generated y values with the x values

                var res = [];
                for (var i = 0; i < realTimedata.length; ++i) {
                    res.push([i, realTimedata[i]]);
                }

                return res;
            }
            function getRandomData2() {
                if (realTimedata2.length > 0)
                    realTimedata2 = realTimedata2.slice(1);

                // Do a random walk

                while (realTimedata2.length < totalPoints) {

                    var prev = realTimedata2.length > 0 ? realTimedata[realTimedata2.length] : 50,
                        y = prev - 25;

                    if (y < 0) {
                        y = 0;
                    } else if (y > 100) {
                        y = 100;
                    }
                    realTimedata2.push(y);
                }


                var res = [];
                for (var i = 0; i < realTimedata2.length; ++i) {
                    res.push([i, realTimedata2[i]]);
                }

                return res;
            }
            // Set up the control widget
            var updateInterval = 500;
            var plot = $.plot("#dashboard-chart-realtime", getSeriesObj(), {
                yaxis: {
                    color: '#f3f3f3',
                    min: 0,
                    max: 100,
                    tickFormatter: function (val, axis) {
                        return "";
                    }
                },
                xaxis: {
                    color: '#f3f3f3',
                    min: 0,
                    max: 100,
                    tickFormatter: function (val, axis) {
                        return "";
                    }
                },
                grid: {
                    hoverable: true,
                    clickable: false,
                    borderWidth: 0,
                    aboveData: false
                },
                colors: ['#eee', themeprimary],
            });

            function update() {

                plot.setData(getSeriesObj());

                plot.draw();
                setTimeout(update, updateInterval);
            }
            update();


            //-------------------------Initiates Easy Pie Chart instances in page--------------------//
            InitiateEasyPieChart.init();

            //-------------------------Initiates Sparkline Chart instances in page------------------//
            InitiateSparklineCharts.init();
        });

    </script>

<div id="sms_sound"></div>
</body>
</html>
