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 = "
" + listCourseGradeView[0].StarttermName + " | "; html += "||||
课程名称 | "; html += "总成绩 | "; html += "学分 | "; html += "||
" + listCourseGradeView[j].CourseName + " | "; } else { html += "" + listCourseGradeView[j].CourseName + " | "; } if (listCourseGradeView[j].TotalScore < 60 || listCourseGradeView[j].TotalScore == "") html += "" + listCourseGradeView[j].TotalScoreStr + " | "; else html += "" + listCourseGradeView[j].TotalScoreStr + " | "; html += "" + isEmpty(listCourseGradeView[j].ScoreCredit) + " | "; 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 + ""; }