function reload() { $("#display_search_list").css('display', 'none'); var userID = $("#UserID").val(); $.post(CMS_SystemConfig.VirtualDirectoryPath + '/PersonalScore/NewCoursematerialList', { userID: userID }, function (data) { if (data.length > 0) { var count = data[0].ListStarttermID.length; var width = " 20%"; var a = "100%"; if (count > 5) { var height = 0; a = 100 + (count - 5) * 20; width = 100 / count + "%"; } $("#search_list").html(""); StudentCoursematerialtable(data[0]); var html = "
"; for (var i = 0; i < data[0].ListStarttermID.length; i++) { //PS:同一课程、可能开课学期不同~ var listCourseGradeView = $.grep(data[0].ListCourseGradeView, function (x) { return (x.StarttermID == data[0].ListStarttermID[i]); }); html += ""; html += ""; html += ""; html += ""; html += ""; html += ""; html += ""; html += ""; html += ""; for (var j = 0; j < listCourseGradeView.length; j++) { var color = "'" + listCourseGradeView[j].CourseTypeColour + "'" html += ""; if (listCourseGradeView[j].Club == null) { html += ""; } else { html += ""; } if (listCourseGradeView[j].TotalScore < 60 || listCourseGradeView[j].TotalScore == "") html += ""; else html += ""; html += ""; html += ""; } html += "
" + listCourseGradeView[0].StarttermName + "
课程名称总成绩学分
" + listCourseGradeView[j].CourseName + "" + listCourseGradeView[j].CourseName + "" + listCourseGradeView[j].TotalScoreStr + "" + listCourseGradeView[j].TotalScoreStr + "" + isEmpty(listCourseGradeView[j].ScoreCredit) + "
"; } html += "
"; $("#search_list").html(html); } else { StudentCoursematerialtable(data[0]); var html = "

选择的学生成绩库中无成绩,请检查。

" $("#search_list").html(html); } }); } function StudentCoursematerialtable(data) { if (data != null) { //$("#StudentCoursematerialtable").find("tr.row").remove(); var html = ""; html += ""; html += " "; html += "  "; html += " "; html += "  "; html += " "; html += "  "; html += ""; var html1 = ""; html1 += ""; html1 += " "; html1 += "  平均成绩:"; html1 += " "; html1 += "  "; html1 += " "; html1 += "  "; html1 += " "; html1 += "  "; html1 += " "; html1 += "  "; html1 += " "; html1 += "  "; html1 += " "; html1 += "  "; html1 += " "; html1 += "  "; html1 += " "; html1 += "  "; html1 += " "; $("#Studenttable").html(html); $("#StudentCoursematerialtable").html(html1); } else { $("#Studenttable").html(""); $("#StudentCoursematerialtable").html(""); } } //转化json数据的日期 function ChangeDateFormat(jsondate) { jsondate = jsondate.replace("/Date(", "").replace(")/", ""); if (jsondate.indexOf("+") > 0) { jsondate = jsondate.substring(0, jsondate.indexOf("+")); } else if (jsondate.indexOf("-") > 0) { jsondate = jsondate.substring(0, jsondate.indexOf("-")); } //alert(jsondate); var date = new Date(parseInt(jsondate, 10)); //alert(date.getHours()); var month = date.getMonth() + 1 < 10 ? "0" + (date.getMonth() + 1) : date.getMonth() + 1; var currentDate = date.getDate() < 10 ? "0" + date.getDate() : date.getDate(); //+ " " + date.getHours() + ":" + date.getMinutes() + ":" + date.getSeconds(); 时分秒就不需要了~~ return date.getFullYear() + "-" + month + "-" + currentDate; } //验证是否为空。 function isEmpty(val) { switch (typeof (val)) { case 'string': return trim(val).length == 0 ? 0 : val; break; case 'number': return val == 0 ? 0 : val; break; case 'object': return val == null ? 0 : val; break; case 'array': return val.length == 0 ? 0 : val; break; default: return true; } }; //列表字体颜色设置为红色 function SetRedColumn(index, row, value) { return " " + value + ""; }