// JavaScript Document
var lang1="请输入试卷关键词";
var lang2="";
function sendmsg(msgid,msgvalue){
document.getElementById(msgid).innerHTML=msgvalue;
setTimeout('sendmsg1("'+msgid+'")',8000);
}
function sendmsg1(msgid){
document.getElementById(msgid).innerHTML="";
}
function savarenzheng(){
if(document.getElementById("it618_name").value==""){
sendmsg('ajaxtips',"请填写老师名称!");
return false;
}
if(document.getElementById("it618_tel").value==""){
sendmsg('ajaxtips',"请填写联系电话!");
return false;
}
if(document.getElementById("it618_about").value==""){
sendmsg('ajaxtips',"请填写老师简介!");
return false;
}
IT618_EXAM.post("https://yunmengzhu.com/plugin.php?id=it618_exam:ajax"+"&ac=renzheng&formhash=3991f788",IT618_EXAM("#it618_renzheng").serialize(),function (data, textStatus){
if(data=="ok"){
document.getElementById("ul1").style.display="none";
document.getElementById("ul2").style.display="";
}else{
sendmsg('ajaxtips',data);
}
}, "html");
}
function templatestyle(stylename){
IT618_EXAM.get("https://yunmengzhu.com/plugin.php?id=it618_exam:ajax&stylename="+stylename+"&formhash=3991f788", {ac:"pcstyle"},function (data, textStatus){
if(data=="ok"){
location.reload();
}
}, "html");
}
IT618_EXAM.ajaxSetup({cache:false});
var dialog_renzheng;
KindEditor.ready(function(K) {K('.renzheng').click(function() {
getrenzheng(K);
});});
var dialog_mysale;
KindEditor.ready(function(K) {K('#mysale').click(function() {
getmysale(K);
});});
var dialog_mysubscribe;
KindEditor.ready(function(K) {K('#mysubscribe').click(function() {
getmysubscribe(K);
});});
var dialog_mygoods;
KindEditor.ready(function(K) {K('#mygoods').click(function() {
getmygoods(K);
});});
var dialog_mytest;
KindEditor.ready(function(K) {K('#mytest').click(function() {
getmytest(K);
});});
var dialog_mytestpj;
KindEditor.ready(function(K) {K('#mytestpj').click(function() {
getmytestpj(K);
});});
var dialog_testpj,dialog_hftestpj,testpjid=0;
KindEditor.ready(function(K) {K('#testpj').click(function() {
gettestpj(K);
});});
KindEditor.ready(function(K) {K('#hftestpj').click(function() {
gethftestpj(K);
});});
function getrenzheng(K){
IT618_EXAM(".it618_members_login").click();return;
IT618_EXAM.get("https://yunmengzhu.com/plugin.php?id=it618_exam:showrenzheng", {ac:"add"},function (data, textStatus){
var tmparr=data.split("it618_split");
dialog_renzheng = K.dialog({
width : 1100,
height: 520,
title : tmparr[0],
body : '
'+tmparr[1]+'
',
closeBtn : {
name : '关闭',
click : function(e) {
dialog_renzheng.remove();
}
}
});
}, "html");
}
function getmysale(K){
IT618_EXAM.get("https://yunmengzhu.com/plugin.php?id=it618_exam:mysale", {ac:"add"},function (data, textStatus){
IT618_EXAM.get("https://yunmengzhu.com/plugin.php?id=it618_exam:ajax"+"&formhash=3991f788", {ac:"salelist_get",ac1:"pcmysale"},function (data1, textStatus){
var tmparr=data.split("it618_split");
var tmparr1=data1.split("it618_split");
var bodytmp=tmparr[1];
bodytmp=bodytmp.replace("it618mysalesum",tmparr1[0]);
bodytmp=bodytmp.replace("it618mysalelist",tmparr1[1]);
bodytmp=bodytmp.replace("it618mysalepage",tmparr1[2]);
bodytmp=bodytmp.replace("it618myjfcount",tmparr1[3]);
dialog_mysale = K.dialog({
width : 1200,
height: 630,
title : tmparr[0],
body : bodytmp,
closeBtn : {
name : '关闭',
click : function(e) {
dialog_mysale.remove();
}
}
});
}, "html");
}, "html");
}
function getmysubscribe(K){
IT618_EXAM.get("https://yunmengzhu.com/plugin.php?id=it618_exam:mysubscribe", {ac:"it618"},function (data, textStatus){
IT618_EXAM.get("https://yunmengzhu.com/plugin.php?id=it618_exam:ajax"+"&formhash=3991f788", {ac:"subscribe_get",ac1:"pcmysubscribe"},function (data1, textStatus){
var tmparr=data.split("it618_split");
var tmparr1=data1.split("it618_split");
var bodytmp=tmparr[1];
bodytmp=bodytmp.replace("it618mysalesum",tmparr1[0]);
bodytmp=bodytmp.replace("it618mysalelist",tmparr1[1]);
bodytmp=bodytmp.replace("it618mysalepage",tmparr1[2]);
dialog_mytest = K.dialog({
width : 1000,
height: 630,
title : tmparr[0],
body : bodytmp,
closeBtn : {
name : '关闭',
click : function(e) {
dialog_mytest.remove();
}
}
});
}, "html");
}, "html");
}
function getmygoods(K){
IT618_EXAM.get("https://yunmengzhu.com/plugin.php?id=it618_exam:mygoods", {ac:"it618"},function (data, textStatus){
IT618_EXAM.get("https://yunmengzhu.com/plugin.php?id=it618_exam:ajax"+"&formhash=3991f788", {ac:"goods_get",ac1:"pcmygoods"},function (data1, textStatus){
var tmparr=data.split("it618_split");
var tmparr1=data1.split("it618_split");
var bodytmp=tmparr[1];
bodytmp=bodytmp.replace("it618mysalesum",tmparr1[0]);
bodytmp=bodytmp.replace("it618mysalelist",tmparr1[1]);
bodytmp=bodytmp.replace("it618mysalepage",tmparr1[2]);
dialog_mytest = K.dialog({
width : 1000,
height: 630,
title : tmparr[0],
body : bodytmp,
closeBtn : {
name : '关闭',
click : function(e) {
dialog_mytest.remove();
}
}
});
}, "html");
}, "html");
}
function getmytest(K){
IT618_EXAM.get("https://yunmengzhu.com/plugin.php?id=it618_exam:mytest", {ac:"it618"},function (data, textStatus){
IT618_EXAM.get("https://yunmengzhu.com/plugin.php?id=it618_exam:ajax"+"&formhash=3991f788", {ac:"testlist_get",ac1:"pcmytest"},function (data1, textStatus){
var tmparr=data.split("it618_split");
var tmparr1=data1.split("it618_split");
var bodytmp=tmparr[1];
bodytmp=bodytmp.replace("it618mysalesum",tmparr1[0]);
bodytmp=bodytmp.replace("it618mysalelist",tmparr1[1]);
bodytmp=bodytmp.replace("it618mysalepage",tmparr1[2]);
dialog_mytest = K.dialog({
width : 1000,
height: 630,
title : tmparr[0],
body : bodytmp,
closeBtn : {
name : '关闭',
click : function(e) {
dialog_mytest.remove();
}
}
});
}, "html");
}, "html");
}
function getmytestpj(K){
IT618_EXAM.get("https://yunmengzhu.com/plugin.php?id=it618_exam:mytestpj", {ac:"it618"},function (data, textStatus){
IT618_EXAM.get("https://yunmengzhu.com/plugin.php?id=it618_exam:ajax"+"&formhash=3991f788", {ac:"testpjlist_get",ac1:"pcmytestpj"},function (data1, textStatus){
var tmparr=data.split("it618_split");
var tmparr1=data1.split("it618_split");
var bodytmp=tmparr[1];
bodytmp=bodytmp.replace("it618mysalesum",tmparr1[0]);
bodytmp=bodytmp.replace("it618mysalelist",tmparr1[1]);
bodytmp=bodytmp.replace("it618mysalepage",tmparr1[2]);
bodytmp=bodytmp.replace("it618myjfcount",tmparr1[3]);
dialog_mytest = K.dialog({
width : 1000,
height: 630,
title : tmparr[0],
body : bodytmp,
closeBtn : {
name : '关闭',
click : function(e) {
dialog_mytest.remove();
}
}
});
}, "html");
}, "html");
}
var sqlurl="";
function getmysalelist(url){
document.getElementById("img_loading").style.display="";
document.getElementById("mysalelist").style.display="none";
IT618_EXAM.get(url+sqlurl+"&formhash=3991f788", {ac:"salelist_get",ac1:"pcmysale"},function (data, textStatus){
var tmparr=data.split("it618_split");
IT618_EXAM("#mysalesum").html(tmparr[0]);
IT618_EXAM("#mysalelist").html(tmparr[1]);
IT618_EXAM("#mysalepage").html(tmparr[2]);
IT618_EXAM("#myjfcount").html(tmparr[3]);
document.getElementById("mysaleurl").value=url;
document.getElementById("img_loading").style.display="none";
document.getElementById("mysalelist").style.display="";
}, "html");
}
function searchmysale(){
if(parseInt(document.getElementById("it618_time1").value.replace(/-/g,""))>parseInt(document.getElementById("it618_time2").value.replace(/-/g,""))){
alert("开始日期不能大于截止日期!");
return false;
}
var mysalepname=document.getElementById("mysalepname").value;
var it618_time1=document.getElementById("it618_time1").value;
var it618_time2=document.getElementById("it618_time2").value;
sqlurl="&pname="+mysalepname+"&it618_time1="+it618_time1+"&it618_time2="+it618_time2;
url="https://yunmengzhu.com/plugin.php?id=it618_exam:ajax";
getmysalelist(url);
document.getElementById("mysaleurl").value=url;
}
function getmysubscribelist(url){
document.getElementById("img_loading").style.display="";
document.getElementById("mysalelist").style.display="none";
IT618_EXAM.get(url+sqlurl+"&formhash=3991f788", {ac:"subscribe_get",ac1:"pcmysubscribe"},function (data, textStatus){
var tmparr=data.split("it618_split");
IT618_EXAM("#mysalesum").html(tmparr[0]);
IT618_EXAM("#mysalelist").html(tmparr[1]);
IT618_EXAM("#mysalepage").html(tmparr[2]);
document.getElementById("mysaleurl").value=url;
document.getElementById("img_loading").style.display="none";
document.getElementById("mysalelist").style.display="";
}, "html");
}
function searchmysubscribe(){
url="https://yunmengzhu.com/plugin.php?id=it618_exam:ajax";
getmysubscribelist(url);
document.getElementById("mysaleurl").value=url;
}
var sqlurl="";
function getmygoodslist(url){
document.getElementById("img_loading").style.display="";
document.getElementById("mysalelist").style.display="none";
IT618_EXAM.get(url+sqlurl+"&formhash=3991f788", {ac:"goods_get",ac1:"pcmygoods"},function (data, textStatus){
var tmparr=data.split("it618_split");
IT618_EXAM("#mysalesum").html(tmparr[0]);
IT618_EXAM("#mysalelist").html(tmparr[1]);
IT618_EXAM("#mysalepage").html(tmparr[2]);
document.getElementById("mysaleurl").value=url;
document.getElementById("img_loading").style.display="none";
document.getElementById("mysalelist").style.display="";
}, "html");
}
function searchmygoods(){
var pname=document.getElementById("pname").value;
sqlurl="&pname="+pname;
url="https://yunmengzhu.com/plugin.php?id=it618_exam:ajax";
getmygoodslist(url);
document.getElementById("mysaleurl").value=url;
}
var sqlurl="";
function getmytestlist(url){
document.getElementById("img_loading").style.display="";
document.getElementById("mysalelist").style.display="none";
IT618_EXAM.get(url+sqlurl+"&formhash=3991f788", {ac:"testlist_get",ac1:"pcmytest"},function (data, textStatus){
var tmparr=data.split("it618_split");
IT618_EXAM("#mysalesum").html(tmparr[0]);
IT618_EXAM("#mysalelist").html(tmparr[1]);
IT618_EXAM("#mysalepage").html(tmparr[2]);
document.getElementById("mysaleurl").value=url;
document.getElementById("img_loading").style.display="none";
document.getElementById("mysalelist").style.display="";
}, "html");
}
function searchmytest(){
var pname=document.getElementById("pname").value;
sqlurl="&pname="+pname;
url="https://yunmengzhu.com/plugin.php?id=it618_exam:ajax";
getmytestlist(url);
document.getElementById("mysaleurl").value=url;
}
var sqlurl="";
function getmytestpjlist(url){
document.getElementById("img_loading").style.display="";
document.getElementById("mysalelist").style.display="none";
IT618_EXAM.get(url+sqlurl+"&formhash=3991f788", {ac:"testpjlist_get",ac1:"pcmytestpj"},function (data, textStatus){
var tmparr=data.split("it618_split");
IT618_EXAM("#mysalesum").html(tmparr[0]);
IT618_EXAM("#mysalelist").html(tmparr[1]);
IT618_EXAM("#mysalepage").html(tmparr[2]);
IT618_EXAM("#myjfcount").html(tmparr[3]);
document.getElementById("mysaleurl").value=url;
document.getElementById("img_loading").style.display="none";
document.getElementById("mysalelist").style.display="";
}, "html");
}
function searchmytestpj(){
var pname=document.getElementById("pname").value;
sqlurl="&pname="+pname;
url="https://yunmengzhu.com/plugin.php?id=it618_exam:ajax";
getmytestpjlist(url);
document.getElementById("mysaleurl").value=url;
}
var pjtype;
function settestpj(pjid){
if(testpjid==0){
testpjid=pjid;
pjtype='testpj';
IT618_EXAM("#testpj").click();
}
}
function hftestpj(pjid){
if(testpjid==0){
testpjid=pjid;
IT618_EXAM("#hftestpj").click();
}
}
function starh(spans,ia){
var _span=IT618_EXAM(spans);
var _star=_span.find('a');
var _ias=IT618_EXAM(ia);
var _i=_ias.find('i');
_star.hover(function(){
var index=_span.index(this);
var indexs=_star.index(this);
if (_i.hasClass('ns-star-tag'))
{return;}
else {
_ias.eq(index).addClass('ns-star-tags');
_i.removeClass('ns-star-tags');
_i.eq(indexs).addClass('ns-star-tags');
}
IT618_EXAM(this).addClass('ns-sider-starc');
IT618_EXAM(this).prevAll().addClass('ns-sider-starc');
IT618_EXAM(this).nextAll().removeClass('ns-sider-starc');
},function(){
_star.removeClass('ns-sider-starc');
_ias.removeClass('ns-star-tags');
_i.removeClass('ns-star-tags');
})
_star.click(function(){
var index=_span.index(this);
var indexs=_star.index(this);
_i.removeClass('ns-star-tag');
_i.eq(indexs).addClass('ns-star-tag');
_ias.eq(index).addClass('ns-star-tag');
IT618_EXAM(this).addClass('ns-sider-star');
IT618_EXAM(this).prevAll().addClass('ns-sider-star');
IT618_EXAM(this).nextAll().removeClass('ns-sider-star');
IT618_EXAM(this).parents('li').removeClass('doo');
var sb=IT618_EXAM(this).parents('li').find('span');
var sa=sb.eq(2).hide();
})
}
var ispjpicdel=0;
function gettestpj(K){
IT618_EXAM.get("https://yunmengzhu.com/plugin.php?id=it618_exam:testpj"+"&testpjid="+testpjid, {ac:"it618"},function (data, textStatus){
var tmparr=data.split("it618_split");
dialog_testpj = K.dialog({
width : 520,
title : tmparr[0],
body : ''+tmparr[1]+'
',
closeBtn : {
name : '关闭',
click : function(e) {
dialog_testpj.remove();
testpjid=0;
}
}
});
var editor = K.editor({
uploadJson : 'source/plugin/it618_exam/kindeditor/php/upload_json.php?uid='+tmparr[4]+'&imgwidth=680',
fileManagerJson : 'source/plugin/it618_exam/kindeditor/php/file_manager_json.php?uid='+tmparr[4],
allowFileManager : true
});
K('#pjpic_addbtn').click(function() {
if(document.getElementById("pjpiccount").value>=5){
return;
}
editor.loadPlugin('image', function() {
editor.plugin.imageDialog({
showRemote : false,
clickFn : function(url, title, width, height, border, align) {
IT618_EXAM.get("https://yunmengzhu.com/plugin.php?id=it618_exam:ajax"+"&ac="+pjtype+"&testpjid="+testpjid+"&picurl="+url+"&formhash=3991f788",{ac1:"addpjpic"},function (data, textStatus){
getpjpic(testpjid);
}, "html");
editor.hideDialog();
}
});
});
});
getpjpic(testpjid);
starh('.sp_a','.ias');
starh('.sp_b','.ibs');
starh('.sp_c','.ics');
starh('.sp_d','.ids');
if(tmparr[3]!='')window.eval(tmparr[3]);
IT618_EXAM('.ns-sub-a').click(function(){
if (IT618_EXAM('.doo').find('span').hasClass('mag')){
IT618_EXAM('.doo .mag').show();
}else{
var it618_content=document.getElementById("pjvalue").value;
if(getstrlen(it618_content)<5){
alert("评价内容字数至少5个!");
return false;
}
if(getstrlen(it618_content)>400){
alert("评价内容字数最多400个!");
return false;
}
if(confirm(tmparr[2])){
var score1 = IT618_EXAM('.sp_a').find('a').filter('.ns-sider-star').length;
var score2 = IT618_EXAM('.sp_b').find('a').filter('.ns-sider-star').length;
var score3 = IT618_EXAM('.sp_c').find('a').filter('.ns-sider-star').length;
var score4 = IT618_EXAM('.sp_d').find('a').filter('.ns-sider-star').length;
var score=score1+'@'+score2+'@'+score3+'@'+score4;
document.getElementById("pjvalue").value=it618_content.replace(/\n/g,"[br]");
IT618_EXAM.post("https://yunmengzhu.com/plugin.php?id=it618_exam:ajax"+"&ac="+pjtype+"&testpjid="+testpjid+"&score="+score+"&formhash=3991f788",IT618_EXAM("#it618_testpj").serialize(),function (data, textStatus){
var tmparr=data.split("it618_split");
if(tmparr[0]=="ok"){
alert(tmparr[1]);
dialog_testpj.remove();
if(pjtype=='testpj'){
getmytestpjlist(document.getElementById("mysaleurl").value);
}else{
if(ispj==1){
getsalelist(salelisturl);
getpjlist(pjlisturl);
}else{
location.reload();
}
}
testpjid=0;
}else if(tmparr[0]=="editok"){
alert(tmparr[1]);
dialog_testpj.remove();
getpjlist(pjurl);
testpjid=0;
}else{
alert(data);
}
}, "html");
}
}
})
IT618_EXAM('.ns-sub-b').click(function(){
dialog_testpj.remove();
testpjid=0;
})
}, "html");
}
function getbigpjpic(pjid,bigpjpic){
IT618_EXAM("#bigpjpic"+pjid).html("");
IT618_EXAM("#bigpjpic"+pjid).show();
}
function hidebigpjpic(obj){
obj.style.display='none';
}
function delpjpic(pjid,pjpicid){
IT618_EXAM.get("https://yunmengzhu.com/plugin.php?id=it618_exam:ajax"+"&ac="+pjtype+"&testpjid="+pjid+"&pjpicid="+pjpicid+"&formhash=3991f788",{ac1:"delpjpic"},function (data, textStatus){
getpjpic(pjid);
}, "html");
}
function getpjpic(pjid){
IT618_EXAM.get("https://yunmengzhu.com/plugin.php?id=it618_exam:ajax"+"&testpjid="+pjid+"&formhash=3991f788", {ac:"getpjpic"},function (data, textStatus){
IT618_EXAM("#divpjpic").html(data);
}, "html");
}
function gethftestpj(K){
IT618_EXAM.get("https://yunmengzhu.com/plugin.php?id=it618_exam:hftestpj"+"&testpjid="+testpjid, {ac:"it618"},function (data, textStatus){
var tmparr=data.split("it618_split");
dialog_hftestpj = K.dialog({
width : 520,
title : tmparr[0],
body : ''+tmparr[1]+'
',
closeBtn : {
name : '关闭',
click : function(e) {
dialog_hftestpj.remove();
testpjid=0;
}
}
});
IT618_EXAM('.ns-sub-a').click(function(){
var it618_content=document.getElementById("hfvalue").value;
if(it618_content==''){
alert("抱歉,请输入评价回复内容!");
return;
}
if(confirm("确定要提交评价回复内容?")){
document.getElementById("hfvalue").value=it618_content.replace(/\n/g,"[br]");
IT618_EXAM.post("https://yunmengzhu.com/plugin.php?id=it618_exam:ajax"+"&ac=hftestpj&testpjid="+testpjid+"&formhash=3991f788",IT618_EXAM("#it618_hftestpj").serialize(),function (data, textStatus){
var tmparr=data.split("it618_split");
if(tmparr[0]=="ok"){
alert(tmparr[1]);
dialog_hftestpj.remove();
getpjlist(pjurl);
testpjid=0;
}else{
alert(data);
}
}, "html");
}
})
IT618_EXAM('.ns-sub-b').click(function(){
dialog_hftestpj.remove();
testpjid=0;
})
}, "html");
}
function getstrlen(str) {
var realLength = 0, len = str.length, charCode = -1;
for (var i = 0; i < len; i++) {
charCode = str.charCodeAt(i);
if (charCode >= 0 && charCode <= 128) realLength += 1;
else realLength += 2;
}
return realLength;
}
function getstrlenspan(str){
var strlen=getstrlen(str);
if(strlen<5){document.getElementById('strlentips').innerHTML='评价内容字数至少5个!';return;}
if(strlen>400){document.getElementById('strlentips').innerHTML='评价内容字数最多400个!';return;}
document.getElementById('strlentips').innerHTML='您输入了'+strlen+'个字!';
}