Scott Hartnell scored twice, including the game-winner as the Flyers beat the Islanders 7-4 to win the Atlantic Division title.