<!doctype html>
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="renderer" content="webkit">
    <title>教师中心-{$GetSiteName}</title>
    <!--kesion.common style-->
    <link href="SysImg/teacher/css/kesion-common.css" rel="stylesheet" />
    <!--//kesion.common style-->
    <!--<link href="SysImg/teacher/css/general68.css" rel="stylesheet" />-->
    <!--<link href="SysImg/teacher/css/cont.css" rel="stylesheet" />-->
    <link href="SysImg/teacher/font/iconfont.css" rel="stylesheet">
    <link href="SysImg/teacher/css/style.css" rel="stylesheet" /> 
    <script src="/ks_inc/jquery.js"></script>
    <script src="/ks_inc/kesion.common.js"></script> 

    <!--[if lt IE 9]>
      <script src="{$GetInstallDir}ks_inc/html5shiv.js"></script>
    <![endif]-->
 
</head>
<body class="bg-gray o-hidden">

<header class="header">
	<div class="header-score">
		 <span style="float:left"><img src="/SysImg/teacherscore/{KS:Field:ScoreitemID}.gif" onerror="this.src='/SysImg/teacherscore/1.gif';" title="级别：{KS:Field:ScoreitemID}级" />您的信誉积分：<b><a href="{=GetUserUrl(teacher/teacherscore)}">{KS:Field:CreditScore}</a></b> </span>
        <span style="float:left;margin-left:50px; display:{KS:IsShow}">所属机构：{KS:EpName}</span>
    </div>
    	
	<div class="header-r">
		
		<ul>
			<li><div id="Today"></div>
            <input id="clicktype" type="hidden" name="clicktype" value="1"/></li>
            <li>
<script>
if(parseInt({KS:Field:TcID})==0||'{KS:Field:TcID}'=='')
{
document.write('<a href="javascript:;" onclick="alert(\'请先完善教师信息！\')" title="教师主页"><i class="iconfont icon-zhuye"></i></a>')  
}else{
document.write('<a href="{=GetRewriteUrl(teacherview,{KS:Field:TcID})}" target="_blank" title="教师主页"><i class="iconfont icon-zhuye"></i></a>')
}
</script></li>
            <li><a href="{=GetUserUrl(message/Receivedmessage)}" title="站内信息" onFocus="this.blur();"><span class="span2"><div class="numbg" id="NewMessage"></div><i class="iconfont icon-xinfeng"></i></span></a></li>
            <li><a href="{=GetUserUrl(loginout/loginout)}" onClick="return(confirm('确定要退出吗？'))" title="退出登录"><span class="span3"><i class="iconfont icon-qiehuanzuhu"></i></span></a></li>
		</ul>
	</div>
</header>

<section class="main">
	<div class="main-left" id="mainLeft">
		<section class="main-left-user" id="Vip">
			<a href="{=GetUserUrl(basic/userface)}"><img  src="{$GetInstallDir}UploadFiles/avatar/{KS:Field:UserID}.jpg" type="teacher"   onerror="this.src='/SysImg/nopic.gif'"   /></a>
		    <p>{KS:Field:TName}</p>
		</section>
		<nav class="main-left-nav">
			<div class="vtitle"><a href="{=GetRewriteUrl(user)}"><i class="imgicon-home"></i>教师主页</a></div>
			{#LeftMenu}
		</nav>
	</div>
	<div class="main-right" id="mainRight">
		{#UserMain}
	</div>
</section>


<script src="SysImg/teacher/js/echarts.min.js"></script>
<script src="/ks_inc/kesion.assembly.js"></script>
<script src="/ks_inc/jquery.nicescroll.JS"></script> 
<script>
	var dataList = {};
	jQuery.ajax({
   		url: "/plus/SignIn.aspx?action=SignInUser&rnd=" + Math.random(), success: function (d) {
   				if (d != "no") {
   					$('#Today').html('<div class="sign_in qdbtn fl" onclick="location.href=\'{=GetUserUrl(other/signinlist)}\'"><i class="iconfont icon-qiandao"></i>已签到</div>')
   				}else{
   					$('#Today').html('<div class="sign_in qdbtn fl" onClick="SignIn()"><i class="iconfont icon-qiandao"></i>签到</div>');
   				}
   		}
   	});
	function SignIn() {
   		jQuery.ajax({
   			url: "/plus/SignIn.aspx?action=SignInUser&rnd=" + Math.random(), success: function (d) {
   				if (d == "no") {
   					box = jQuery.dialog.open("/plus/SignIn.aspx?rnd=" + Math.random(), { id: "loginbox", lock: true, fixed: true, title: "<div style='text-align:left'>用户签到</div>", width: 700, height: 530, max: false, min: false });
   				}
   				else {
   					KesionJS.Alert('你已签到过了!', '');
   				}
   			}
   		});
   	}
   	$(document).ready(function () {
   		jQuery.ajax({
   			url: "/plus/SignIn.aspx?action=SignInUser&rnd=" + Math.random(), success: function (d) {
   				if (d == 'close') {
   					$('.pos .qdbtn').hide();
   				} else if (d == "no") {
   					$('.pos .qdbtn').html('<i class="icon iconfont icon-qiandao" style="padding-right:5px;font-size:16px;font-weight:normal"></i>签到');
   				} else {
   					$('.pos .qdbtn').addClass('btn-ok').html('<i class="icon iconfont icon-qiandao" style="padding-right:5px;font-size:16px;font-weight:normal"></i>签到记录').click(function () {
   						location.href = "{=GetUserUrl(Other/SignInList)}";
   						return false;
   					});
   				}

   			}
   		});
   	});

	function returnMessage(text) {
		var obj = document.getElementById("NewMessage");
		obj.innerHTML = text;
	}
	function getNewMessage() {
		jQuery.ajax({
			url: "{$GetInstallDir}plus/ajaxs.ashx", cache: false, data: "type=1&a=GetNewMessage&now=" + new Date().getTime(), success: function (obj) {
				returnMessage(obj);
			}
		});
		setTimeout("getNewMessage()", 5000);
	}
	

	getNewMessage(); //短消息

	//菜单隐藏展开
	$('.main-left-nav').on('click','.vtitle',function(){
		$(this).addClass('vtitle-on').siblings('.vtitle').removeClass('vtitle-on');
		$(this).next('.vcon').addClass('vcon-on').slideDown(300);
		$(this).next().siblings('.vcon').removeClass('vcon-on').stop().slideUp(300);
	});

	hAuto();
	$("#mainRight,#mainLeft").niceScroll({
		cursorcolor: "#a6a6a6",
		cursoropacitymax: 1,
		touchbehavior: false,
		cursorwidth: "6px",
		cursorborder: "0",
		cursorborderradius: "30px"
	});
	
	$(window).resize(function () {
		hAuto();
	});
	function hAuto() {
		$('#mainRight').height($(window).height()-140);
	};

	//左菜单收缩
	function pullBack() {
		$('#logo').toggleClass('logo-small');
		$('#nav').toggleClass('nav-small');
	};


	//图表数据切换

	$("#bt_yue3").click(function () {
		$("#bt_yue3_hide").fadeToggle(300);
	});
	
	$('#bt_yue3_hide').on('click', '.bt_yue_hide', function () {
        $(this).addClass('active').siblings().removeClass('active');
        $('#bt_yue3').html($(this).text());
        $("#bt_yue3_hide").fadeToggle(300);
		ScreeningDate($(this).index())
    });

	//定义图表对象
	if(document.getElementById('Echart')){
		var myChart = echarts.init(document.getElementById('Echart'));
		$(window).resize(function(){
			myChart.resize
		});
		ScreeningDate(0);
	}
	
	
	function ScreeningDate(index){
		
		if(!dataList['list'+index]){
			$.ajax({
				type: 'post',
				dateType: 'json',
				url: "/plus/course/EnterPriseAjax.ashx?action=ordercount",
				data:{
					showtype:index,
				},
				success: function (data) {
					dataList['list'+index] = data;
					var info = data;
					var data = info.split('####')[0];
					var list = info.split('####')[1];
					chartData(data,list)
				}
			})

		}else{
			
			var info = dataList['list'+index];
			var data = info.split('####')[0];
			var list = info.split('####')[1];
			chartData(data,list)
		}
	}
	
	function chartData(data, list) {

		var listArray = list.split(',');
		var dataArray = data.split('&');
		var dataLength = dataArray.length;
		var seriesArray = new Array();
		for (var i = 0; i < dataLength; i++) {
			seriesArray[i] = {
				name: dataArray[i].split(':')[0],
				type: 'line',
				smooth: true,
				stack: '总量',
				data: dataArray[i].split(':')[1].split(',')
			}
		};


		var option = {
			tooltip: {
				trigger: 'axis'
			},
			grid: {
				x: 40,
				y: 20,
				x2: 40,
				y2: 60
			},
			legend: {
				backgroundColor: '#fff',
			},
			calculable: true,
			xAxis: [
				{
					type: 'category',
					boundaryGap: false,
					data: listArray
				}
			],
			yAxis: [
				{
					type: 'value'
				}
			],
			series: seriesArray,
			color: [
			'#2ac7cc', '#60b1e6', '#b6a6d3', '#32cd32', '#6495ed',
			'#ff69b4', '#ba55d3', '#cd5c5c', '#ffa500', '#40e0d0',
			'#1e90ff', '#ff6347', '#7b68ee', '#00fa9a', '#ffd700',
			'#6b8e23', '#ff00ff', '#3cb371', '#b8860b', '#30e0e0'
			]
		};
		myChart.setOption(option);

	};


	
function openWin(title,url,reload,width,height){ 
      if (width==null) width=760;
      if (height == null) height = 450;
	  isreload=reload;
	  box=$.dialog.open(url,{ id:'topbox',lock: true, title: title, width: width, height: height, close: function() {
       if (isreload) {
          location.reload();
          }
      }
      });
}

	IsVIP()
	function IsVIP() {
		if ("{#IsVIP}" == "1") {
			$("#Vip").append('<img src="SysImg/teacher/vip.png" class="icon_vip">');
		} 
	};

</script>




</body>
</html>
