'); 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 + " | "); tr.append("" + val.WinPercentage.toFixed(3) + " | "); $('#tblStats tbody').append(tr); $("#tblStats").tablesorter({ widgets: ['zebra'] }).trigger("update"); }); }); } if (stat > 0) { $('#tblPlayers tbody').empty(); $.getJSON('https://api.rampinteractive.com/players/getbasketballstatsbydiv/1928/' + sid + '/30190/' + gtid + '/1/' +'1/261673' + '/0', function (data) { var i = 0; $.each(data, function (key, val) { i++; var lname = val.lName; var fname = val.fName; var displayName = ""; displayName = (lname != "" ? lname : ""); displayName += (fname != "" ? (displayName != "" ? ", " : "") + fname : ""); var jersey = ""; if (val.Jersey != null) { jersey = val.Jersey; } tr = $('
'); tr.append("" + val.rank + " | "); tr.append("" + jersey + " | "); tr.append("" + displayName + " | "); tr.append("" + val.GP + " | "); if (stat == 1) { tr.append("" + val.TotalP + " | "); tr.append("" + (val.PPG).toFixed(1) + " | "); } if (stat == 2) { tr.append("" + val.TotalA + " | "); tr.append("" + (val.APG).toFixed(1) + " | "); } if (stat == 3) { tr.append("" + val.OffensiveRebound + " | "); tr.append("" + val.DefensiveRebound + " | "); tr.append("" + (val.RPG).toFixed(1) + " | "); } if (stat == 4) { tr.append("" + val.TotalSteals + " | "); tr.append("" + (val.SPG).toFixed(1)+ " | "); } if (stat == 5) { tr.append("" + val.Totalblocks + " | "); tr.append("" + (val.BPG).toFixed(1) + " | "); } if (stat == 6) { tr.append("" + val.FGA + " | "); tr.append("" + val.FGM + " | "); tr.append("" + (val.FGPercent).toFixed(1) + " | "); } if (stat == 7) { tr.append("" + val.threePA + " | "); tr.append("" + val.threePM + " | "); tr.append("" + (val.threePPercent).toFixed(1) + " | "); } if (stat == 8) { tr.append("" + val.FTA + " | "); tr.append("" + val.FTM + " | "); tr.append("" + (val.FTPercent).toFixed(1) + " | "); } $('#tblPlayers tbody').append(tr); }); }); $('#tblPlayers').show(); $("#tblPlayers").tablesorter({ widgets: ['zebra'] }).trigger("update"); } else { } };