So it is allowed if the spotting last for till the 11th day which is considered as the vaginal discharge and not the periods? What about if she sees the whiteness on the 7 th day so at that time is she is allowed to have intercourse or she has to take the ghusl first for the periods alone.

Yes. If she was certain -from her previous experience- that bleeding will pass the 10 days, then she can have intercourse.
If she saw the whiteness before completing 10 days, then she is clean, and have to do ghusl and practice prayers, and sexual life.