Added Team table and fuction And fiexed php globals