All perfect praise be to Allaah, The Lord of the Worlds. I testify that there is none worthy of worship except Allaah, and that Muhammad, sallallaahu ‘alayhi wa sallam, is His slave and messenger.
Intention is one of the conditions for the validity of Ghusl (ritual bath). If someone takes a bath without holding the intention to remove Hadath (ritual impurity), purify oneself for prayer or something similar, his Ghusl is invalid.
Based on that, your Ghusl was invalid and did not remove Janaabah (major ritual impurity) or purify you from Hadath. It is incumbent on you to perform Ghusl to remove Janaabah, if you had not done so. Then, you have to make up for all the prayers you have performed while you were ritually impure. You are obliged to make up for those prayers without delay but without causing any harm to your body or your livelihood.
For more benefit, please refer to Fatwa 88716.
Allaah Knows best.