<?php $result = !empty($seasonGames) ? get_month_week_details($seasonGames) : array(); ?> <div class="tab innerTabs" id="tab2"> <form class="scheduleForm clearfix" method="post" action="#" id="splitForm"> <h4 class="smallHeading" id="splitSeason"><?php echo $season; ?> SEASON STATISTICS</h4> <div class="fieldsWrapper clearfix"> <div class="control-group"> <select name="season" id="splitYear" onchange="split_form(this);"> <?php getRegularSeason(); ?> </select> </div> <div class="control-group"> <select> <option>Regular Season</option> </select> </div> </div> </form> <div id="splitsScrollbar"> <div id="splitTable"> <div id="statsTableInner4"> <table class="table table-bordered statsTable normalCase"> <thead> <tr>
function getSplit() { $seasonId = $_POST['season']; $regularSeasonStats = array(); $seasonGames = array(); $output = ""; $SeasonStatastics = call_api("http://www.nhl.com/feed/nhl/playerdata/playercard.json?id=8467329&seasonid={$seasonId}&auth="); if (!empty($SeasonStatastics)) { $regularSeasonStats = $SeasonStatastics['regularseasonstats'][0]; $seasonGames = $SeasonStatastics['gamebygame']; } $result = !empty($seasonGames) ? get_month_week_details($seasonGames) : array(); $output = '<div id="statsTableInner4"><table class="table table-bordered statsTable normalCase"><thead><tr><th></th><th><span class="toolTip" title="GAMES PLAYED">GP</span></th><th>G</th><th>A</th><th>P</th><th>+ / -</th><th>PIM</th><th>PP</th><th>SH</th><th>GWG</th><th>S</th><th>Hits</th><th>Bks</th></tr></thead><tbody>'; if (!empty($regularSeasonStats)) { $output .= "<tr><td>REGULAR SEASON</td><td>" . $regularSeasonStats['gp'] . "</td><td>" . $regularSeasonStats['goals'] . "</td><td>" . $regularSeasonStats['assists'] . "</td><td>" . $regularSeasonStats['points'] . "</td><td>" . $regularSeasonStats['plusMinus'] . "</td><td>" . $regularSeasonStats['pim'] . "</td><td>" . $regularSeasonStats['powerPlayGoals'] . "</td><td>" . $regularSeasonStats['shortHandedGoals'] . "</td><td>" . $regularSeasonStats['gameWinningGoals'] . "</td><td>" . $regularSeasonStats['shots'] . "</td><td>" . $regularSeasonStats['hits'] . "</td><td>" . $regularSeasonStats['blockedShots'] . "</td></tr>"; } else { $output .= "<tr><td colspan='13'>Data Not Found</td></tr>"; } $output .= "</tbody></table></div>"; $output .= '<h5 class="smallHeading withBg">LAST GOAL/ASSIST FOR SEASON</h5><div id="statsTableInner5"><table class="table table-bordered statsTable"><tbody><tr><td>LAST GOAL (GAMES PLAYED SINCE):</td><td>' . lastGoalOrAssists($seasonGames, "goals") . '</td></tr><tr><td>LAST ASSIST (GAMES PLAYED SINCE):</td><td>' . lastGoalOrAssists($seasonGames, "assists") . '</td></tr></tbody></table></div>'; $output .= '<h5 class="smallHeading withBg">EVEN STRENGTH, POWER PLAY, SHORTHANDED</h5><div id="statsTableInner6"><table class="table table-bordered statsTable"></tbody>'; if (!empty($regularSeasonStats)) { $output .= '<tr><td>ES GOALS:</td><td>' . ($regularSeasonStats["goals"] - ($regularSeasonStats["powerPlayGoals"] + $regularSeasonStats["shortHandedGoals"])) . '</td><td>PP GOALS:</td><td>' . $regularSeasonStats["powerPlayGoals"] . '</td><td>SH GOALS:</td><td>' . $regularSeasonStats["shortHandedGoals"] . '</td></tr>'; } else { $output .= "<tr><td colspan='6'>Data Not Found</td></tr>"; } $output .= "</tbody></table></div>"; $output .= '<h5 class="smallHeading withBg">STATS BY MONTH</h5><div id="statsTableInner7"><table class="table table-bordered statsTable"><thead><tr><th></th><th>OCT</th><th>NOV</th><th>DEC</th><th>JAN</th><th>FEB</th><th>MAR</th><th>APR</th></tr></thead><tbody>'; if (!empty($result)) { foreach ($result[0] as $key => $month_detail) { $output .= "<tr>"; $output .= "<td>" . $key . "</td>"; $output .= "<td>" . $month_detail['oct'] . "</td>"; $output .= "<td>" . $month_detail['nov'] . "</td>"; $output .= "<td>" . $month_detail['dec'] . "</td>"; $output .= "<td>" . $month_detail['jan'] . "</td>"; $output .= "<td>" . $month_detail['feb'] . "</td>"; $output .= "<td>" . $month_detail['mar'] . "</td>"; $output .= "<td>" . $month_detail['apr'] . "</td></tr>"; } } else { $output .= "<tr><td colspan='8'>Data Not Found</td></tr>"; } $output .= "</tbody></table></div>"; $output .= '<h5 class="smallHeading withBg">STATS BY DAY OF WEEK</h5><div id="statsTableInner8"><table class="table table-bordered statsTable"><thead><tr><th></th><th>SUNDAY</th><th>MONDAY</th><th>TUESDAY</th><th>WEDNESDAY</th><th>THURSDAY</th><th>FRIDAY</th><th>SATURDAY</th></tr></thead><tbody>'; if (!empty($result)) { foreach ($result[1] as $key => $week_detail) { $output .= "<tr>"; $output .= "<td>" . $key . "</td>"; $output .= "<td>" . $week_detail['sun'] . "</td>"; $output .= "<td>" . $week_detail['mon'] . "</td>"; $output .= "<td>" . $week_detail['tue'] . "</td>"; $output .= "<td>" . $week_detail['wed'] . "</td>"; $output .= "<td>" . $week_detail['thu'] . "</td>"; $output .= "<td>" . $week_detail['fri'] . "</td>"; $output .= "<td>" . $week_detail['sat'] . "</td></tr>"; } } else { $output .= "<tr><td colspan='8'>Data Not Found</td></tr>"; } $output .= "</tbody></table></div>"; echo $output; echo '<script type="text/javascript"> if(jQuery(window).width()<=767){jQuery("#homeScheduleScrollbar, #statsTableInner1, #statsTableInner2, #statsTableInner3, #statsTableInner4, #statsTableInner5, #statsTableInner6, #statsTableInner7, #statsTableInner8, #statsTableInner9, .January, .February, .March, .April, .May, .June, .July, .August, .September, .October, .November, .December, #scheduleScrollbar, #statsScrollbar, #splitsScrollbar, #gameLogsScrollbar, #tweets, .patientTabs, .innerMenuInner").mCustomScrollbar("destroy");}</script>'; exit; }