A powerful typhoon has caused extreme flooding across the Philippines, affecting millions of people.