A unified version of the primitive and normal basis theorems