'); var teamNameDecode = val.TeamName; tr.append("
" + "" + unescapeHTML(teamNameDecode) + " | "); tr.append("" + val.GamesPlayed + " | "); tr.append("" + val.Wins + " | "); tr.append("" + val.Losses + " | "); tr.append("" + val.Ties + " | "); tr.append("" + val.Points + " | "); tr.append("" + val.GF + " | "); tr.append("" + val.GA + " | "); var DIFF = val.GF - val.GA; tr.append("" + DIFF + " | "); tr.append("" + val.WinPercentage.toFixed(3) + " | "); $('#tblStats tbody').append(tr); $("#tblStats").tablesorter({ widgets: ['zebra'] }).trigger("update"); }); }); $.getJSON( '/api/leaguegame/getstandings3wsdcached/2655/' + sid + '/' + gtid + '/1486/30895/274116', function (data) { $.each(data, function (key, val) { /*if (key == 0) {*/ if (val.SID == 0) { tr = $('
'); tr.append("" + val.SubDivName + " | "); $('#tblStats tbody').append(tr); } else { trt = $('
'); trt.append("" + val.TeamName + " | "); trt.append("" + val.GamesPlayed + " | "); trt.append("" + val.Wins + " | "); trt.append("" + val.Losses + " | "); trt.append("" + val.Ties + " | "); trt.append("" + val.Points + " | "); trt.append("" + val.GF + " | "); trt.append("" + val.GA + " | "); var DIFF = val.GF - val.GA; trt.append("" + DIFF + " | "); trt.append("" + val.WinPercentage.toFixed(3) + " | "); $('#tblStats tbody').append(trt); $("#tblStats").tablesorter({ widgets: ['zebra'] }).trigger("update"); } }); }); /*});*/ /*});*/ if ((aid == 314 && !showstandings) || aid == 371 || did == 566 || did == 567 || did == 846 || did == 845 || !showstandings) { $('#tblPlayerStats').hide(); $('#tblGoalieStats').hide(); } else { if (tid > 0) { $('#tblStats').show(); $('#tblPlayerStats tbody').empty(); $.getJSON('/api/players/getplayerstatscache/2655/' + sid + '/30895/' + gtid + '/274116', function (data) { if (data.length == 0) { $('#tblPlayerStats').hide(); } else { $.each(data, function (key, val) { var lname = val.lname; var fname = val.fname; var ap = val.AP; var oa = val.OA; var displayName = ""; var approvedAP = val.approvedAP; var hideHyperLink = false; var xTID = val.TID; var did = 30895; displayName = (lname != "" ? lname : ""); displayName += (fname != "" ? (displayName != "" ? ", " : "") + fname : ""); /*if (!isStaff && ap) { displayName += (displayName != "" ? " (AP)" : ""); }*/ if (ap || approvedAP) { displayName += (displayName != "" ? " (AP/GUEST)" : ""); if (approvedAP) { did = val.DID; if (did == null) { hideHyperLink = true; } } } if (oa) { displayName += " (OA)"; } if (val.rookie) { displayName += " (Rookie)"; } if (val.committed) { displayName += " (Committed)"; } if (val.import) { displayName += " (Import)"; } if (val.injured) { displayName += " (Injured)"; } if (val.reserve) { displayName += " (Reserve)"; } if (val.suspended) { displayName += " (Suspended)"; } var jersey = ""; if (val.jersey != null) { jersey = val.jersey; } if (val.Position != "") { displayName += " (" + val.Position + ")"; } tr = $('
'); tr.append("" + jersey + " | "); if (hideHyperLink) { tr.append("" + displayName + " | ");} else { tr.append("" + displayName + " | "); } tr.append("" + val.GP + " | "); tr.append("" + val.G + " | "); tr.append("" + val.A + " | "); tr.append("" + val.PTS + " | "); tr.append("" + val.PtsPG.toFixed(2) + " | "); tr.append("" + val.GPG.toFixed(2) + " | "); tr.append("" + val.APG.toFixed(2) + " | "); tr.append("" + val.PPG + " | "); tr.append("" + val.SHG + " | "); tr.append("" + val.GWG + " | "); tr.append("" + val.PIM + " | "); $('#tblPlayerStats tbody').append(tr); }); $('#tblPlayerStats').show(); $("#tblPlayerStats").tablesorter({ widgets: ['zebra'] }).trigger("update"); } }); $('#tblGoalieStats tbody').empty(); $.getJSON('/api/players/getgoaliestatscached/2655/' + sid + '/30895/' + gtid + '/274116', function (data) { if (data.length == 0) { $('#tblGoalieStats').hide(); } else { $.each(data, function (key, val) { var lname = val.lname; var fname = val.fname; var isStaff = val.isStaff; var ap = val.AP; var displayName = ""; var xTID = val.TID; displayName = (lname != "" ? lname : ""); displayName += (fname != "" ? (displayName != "" ? ", " : "") + fname : ""); if (ap) { displayName += (displayName != "" ? " (AP/GUEST)" : ""); } if (val.rookie) { displayName += " (Rookie)"; } if (val.committed) { displayName += " (Committed)"; } if (val.import) { displayName += " (Import)"; } if (val.injured) { displayName += " (Injured)"; } if (val.reserve) { displayName += " (Reserve)"; } if (val.suspended) { displayName += " (Suspended)"; } var jersey = ""; if (val.jersey != null) { jersey = val.jersey; } tr = $('
'); tr.append("" + jersey + " | "); tr.append("" + displayName + " | "); tr.append("" + val.GP + " | "); tr.append("" + val.W + " | "); tr.append("" + val.L + " | "); tr.append("" + val.T + " | "); tr.append("" + val.MPSP + " | "); tr.append("" + val.GA + " | "); tr.append("" + val.ShotsAgainst + " | "); tr.append("" + val.SAVES + " | "); tr.append("" + val.SavePercentageString + " | "); tr.append("" + val.GAAString + " | "); tr.append("" + val.SO + " | "); $('#tblGoalieStats tbody').append(tr); }); $('#tblGoalieStats').show(); $("#tblGoalieStats").tablesorter({ widgets: ['zebra'] }).trigger("update"); } }); } else { $('#tblPlayerStats').hide(); $('#tblGoalieStats').hide(); } } } else { $('#tblStats').hide(); } };