/** * Automatically aggregate games from otg_rangers_games and update/insert otg_coach_statistics. */ private static function sync_rangers_season_stats($coach_id, $season) { global $wpdb; if ($coach_id <= 0 || empty($season)) { echo '

Invalid Coach or Season specified for sync.

'; return; } // 1. Regular Season Calculation (game_type = 2) $reg_sql = $wpdb->prepare( "SELECT COUNT(*) as gc, SUM(CASE WHEN rangers_score > opponent_score THEN 1 ELSE 0 END) as wins, SUM(CASE WHEN rangers_score < opponent_score AND overtime_status != 'OT' AND overtime_status != 'SO' THEN 1 ELSE 0 END) as losses, SUM(CASE WHEN rangers_score = opponent_score THEN 1 ELSE 0 END) as ties, SUM(CASE WHEN rangers_score < opponent_score AND overtime_status = 'OT' THEN 1 ELSE 0 END) as ot, SUM(CASE WHEN rangers_score < opponent_score AND overtime_status = 'SO' THEN 1 ELSE 0 END) as sol, SUM(CASE WHEN rangers_score > opponent_score AND overtime_status = 'SO' THEN 1 ELSE 0 END) as sow FROM otg_rangers_games WHERE game_type = 2 AND season = %s", $season ); $reg = $wpdb->get_row($reg_sql); // 2. Playoff Calculation (game_type = 3) - Fetching series/opponent details ordered by date/game $playoff_games_sql = $wpdb->prepare( "SELECT opponent, rangers_score, opponent_score FROM otg_rangers_games WHERE game_type = 3 AND season = %s ORDER BY game_date ASC, game_id ASC", $season ); $playoff_games = $wpdb->get_results($playoff_games_sql); $gc = $reg->gc ? intval($reg->gc) : 0; $w = $reg->wins ? intval($reg->wins) : 0; $l = $reg->losses ? intval($reg->losses) : 0; $t = $reg->ties !== null ? intval($reg->ties) : 0; $ot = $reg->ot !== null ? intval($reg->ot) : 0; $sol = $reg->sol !== null ? intval($reg->sol) : 0; $sow = $reg->sow !== null ? intval($reg->sow) : 0; $pgc = count($playoff_games); $pw = 0; $pl = 0; $pt = 0; $sw = 0; $sl = 0; $sc = 0; $scf = 0; if ($pgc > 0) { $series_records = []; $current_opponent = null; $opp_wins = 0; $nyr_wins = 0; foreach ($playoff_games as $g) { if (intval($g->rangers_score) > intval($g->opponent_score)) { $pw++; $nyr_wins++; } elseif (intval($g->rangers_score) < intval($g->opponent_score)) { $pl++; $opp_wins++; } else { $pt++; } if ($current_opponent === null) { $current_opponent = $g->opponent; $nyr_wins = (intval($g->rangers_score) > intval($g->opponent_score)) ? 1 : 0; $opp_wins = (intval($g->rangers_score) < intval($g->opponent_score)) ? 1 : 0; } elseif ($current_opponent !== $g->opponent) { // Previous series concluded because opponent changed if ($nyr_wins > $opp_wins) { $sw++; } else { $sl++; } $current_opponent = $g->opponent; $nyr_wins = (intval($g->rangers_score) > intval($g->opponent_score)) ? 1 : 0; $opp_wins = (intval($g->rangers_score) < intval($g->opponent_score)) ? 1 : 0; } } // Final series check after loop finishes if ($current_opponent !== null) { // Check if this was the Stanley Cup Finals (last series) and if they won the Cup (4 wins in final series or overall context, typically 4 wins wins a modern NHL playoff series) if ($nyr_wins > $opp_wins) { $sw++; // If it's the final round and they won, check if it's the Stanley Cup win // (Assuming final round win equates to SC = 1 if it's the ultimate round) } else { $sl++; } } // Determine if they won the Stanley Cup (e.g. won 4 rounds total, or check standard criteria) // If they won 4 series in a 4-round playoff format, they are Stanley Cup Champions if ($sw >= 4) { $sc = 1; $scf = 1; } elseif ($sw == 3 && $sl > 0) { $scf = 1; $sc = 0; } } $data = array( 'CoachID' => $coach_id, 'Team' => 'New York Rangers', 'League' => 'NHL', 'Season' => $season, 'GC' => $gc, 'W' => $w, 'L' => $l, 'T' => $t, 'OT' => $ot, 'SOL' => $sol, 'SOW' => $sow, 'PGC' => $pgc, 'PW' => $pw, 'PL' => $pl, 'PT' => $pt, 'SCF' => $scf, 'SC' => $sc, 'SW' => $sw, 'SL' => $sl, ); $existing = $wpdb->get_var($wpdb->prepare( "SELECT COUNT(*) FROM otg_coach_statistics WHERE CoachID = %d AND Season = %s AND Team = 'New York Rangers'", $coach_id, $season )); if ($existing > 0) { $wpdb->update('otg_coach_statistics', $data, array('CoachID' => $coach_id, 'Season' => $season, 'Team' => 'New York Rangers')); echo '

Successfully synced Rangers stats for season ' . esc_html($season) . '!

'; } else { $wpdb->insert('otg_coach_statistics', $data); echo '

Successfully inserted synced Rangers stats for season ' . esc_html($season) . '!

'; } } 2023-24 – 50 Contracts – Hit The Road Jake – OutsideTheGarden Boards
DECEMBER
«
Wed
24
Thu
25
Fri
26
Sat
27
Sun
28
Mon
29
Tue
30
»
2023-24 - 50 Contra...
 
Notifications
Clear all

2023-24 - 50 Contracts

 
Fish
 Fish
(@fish)
Member Moderator

Each team is allowed 50 contracts. The Rangers currently have 47 contracts for the 2023-24 season.

  1. Belzile - signed July 1st (2 years $775 AAV)
  2. Berard
  3. Blidh - resigned June 7th (2 years $775K AAV)
  4. Boyko
  5. Brodzinski - resigned February 21st (2 years $788K AAV) 
  6. Brouillard - signed July 1st (1 year $775K AAV)
  7. Chytil
  8. Cuylle
  9. Domingue
  10. Edstrom
  11. Fox
  12. Garand
  13. Goodrow
  14. Gustafsson - signed July 1st (1 year $775K AAV)
  15. Harpur
  16. Henriksson
  17. Hollowell - signed July 2nd (1 year $775K AAV)
  18. Jones - resigned June 16th (2 years $813K AAV)
  19. Kakko
  20. Korczak
  21. Kreider
  22. Lafreniere - resigned March (2 years $2.325M AAV)
  23. Leschyshyn
  24. Lindgren
  25. Lindbom
  26. Mackey - re-signed March 1st (2 years $775K AAV)
  27. McConnell-Barker
  28. Miller - resigned July 11th (2 years $3.872M AAV)
  29. Nash - signed July 1st (2 years - $775K AAV)
  30. Othmann
  31. Panarin
  32. Petan - acquired by trade 3/8
  33. Pitlick - signed July 1st (1 year - $788K AAV)
  34. Quick - resigned March 3rd (1 year - $1.275M AAV)
  35. Rempe
  36. Roberston
  37. Ruhwedel - acquired by trade 3/8
  38. Scanlin - signed August 2nd (1 year - $775K AAV)
  39. Schneider
  40. Shesterkin
  41. Sykora
  42. Trivigno
  43. Trocheck
  44. Trouba
  45. Vesey
  46. Wennberg - acquired by trade 3/6
  47. Wheeler signed July 1st (1 year $800K)
  48. Zibanejad

Contract Slide (Player in Juniors and exempt from 50 player limit):

  • Chmelar - Signed for 2024-25 thru 2026-27
  • Mancini - Signed for 2024-25 and 2025-26
  • McConnell-Barker - Sent back to OHL
  • Ollas - Signed for 2024-25 and 2025-26
  • Vaisanen - Signed for 2024-25 thru 2026-27

Departed in 2023-24:

  • Bonino - contract terminated
  • Elson - traded to MIN for Petan
  • Emberson - claimed off of waivers by Sharks 

Quote
Topic starter Posted : 28/08/2023 11:00 am
Share: