'); tr.append("
" + val.TeamName + " | "); 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.PIM + " | "); $('#tblStats tbody').append(tr); }); }); $('#tblStats').show(); var jsShowPlayers = true; if (tid > 0 && jsShowPlayers) { $('#tblPlayerStats tbody').empty(); $.getJSON('https://api.rampinteractive.com/players/getMSAPlayerStats/2090/9176/11068/' + gtid + '/197511', function (data) { if ( data.length > 0 ){ $('#tblPlayerStats').show(); } else { $('#tblPlayerStats').hide(); } $.each(data, function (key, val) { var lname = val.lname; var fname = val.fname; var isStaff = val.isStaff; var ap = val.AP; var oa = val.OA; var displayName = ""; displayName = (lname != "" ? lname : ""); displayName += (fname != "" ? (displayName != "" ? ", " : "") + fname : ""); if (!isStaff && ap) { displayName += (displayName != "" ? " (AP/GUEST)" : ""); } if (!isStaff && oa) { displayName += " (OA)" } var jersey = ""; if (val.jersey != null) { jersey = val.jersey; } tr = $('
'); tr.append("" + jersey + " | "); tr.append("" + displayName + " | "); tr.append("" + val.GP + " | "); tr.append("" + val.G + " | "); tr.append("" + val.A + " | "); tr.append("" + val.PTS + " | "); tr.append("" + val.PPG + " | "); tr.append("" + val.SHG + " | "); tr.append("" + val.GWG + " | "); tr.append("" + val.PIM + " | "); $('#tblPlayerStats tbody').append(tr); }); }); $('#tblGoalieStats tbody').empty(); $.getJSON('https://api.rampinteractive.com/players/getmsagoaliestats/2090/9176/11068/' + gtid + '/197511', function(data) { $.each(data, function(key, val) { var lname = val.lname; var fname = val.fname; var isStaff = val.isStaff; var ap = val.AP; var oa = val.OA; var displayName = ""; displayName = (lname != "" ? lname : ""); displayName += (fname != "" ? (displayName != "" ? ", " : "") + fname : ""); if (!isStaff && ap) { displayName += (displayName != "" ? " (AP/GUEST)" : ""); } if (!isStaff && oa) { displayName += " (OA)" } 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 > 0 ? val.SavePercentageString : "")+ " | "); tr.append("" + val.GAAString + " | "); $('#tblGoalieStats tbody').append(tr); }); }); $('#tblGoalieStats').show(); } else { $('#tblPlayerStats').hide(); $('#tblGoalieStats').hide(); } } else { $('#tblStats').hide(); } };