You need to go the the hardware or plumbing supply and ask for a wax seal. When you get home, turn off the water valve to the toilet and flush. (ceiling is going to leak again). Take the lid off the tank in the back and bail/sponge out all the water. Now disconnect the water supply above the valve, or disconnect it where it connects to the toilet tank. Finally remove the bolt covers at on the side of the toilet at the floor and unscrew the nuts on the flange bolts. The tolet can now be lifted off the closet bend (sewer). The awful looking mess is a decomposed wax ring. It needs to be pulled away and disposed of and all surfaces cleaned.
Now inspect the floor. If water has been running on the floor all this time there could be damage. If everything looks OK, put the new wax seal on the flange, lift the toilet and seat it lining up the flange bolts. Start the flange bolds and bring them into contact with the toilet but don't tightened. Take a seat and wiggle to seat the toilet. Now tighten the flange bolts carefully. Warning too tight the toilet can be brokent. Put the bolt caps back on, re-attach the water supply, turn on the water and enjoy.
You better make this good cause he owes you big time!