Cut out section of cast iron pipe and toilet flange. Replace section of rotted subfloor reinstall PVC drain and toilet flange and install toilet.