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 is His slave and Messenger.
In the first instance when you saw bleeding for a week, and then it stopped for two weeks, then this is considered as menses, because the minimum period of purity between two menses is 13 days. For more benefit, please refer to Fatwa 156775.
In the second instance when you saw bleeding for 12 days, and then it stopped for a week and then it came back and stopped again, then this bleeding that you had the second time is not menses because the maximum period of menses is 15 days as you mentioned, so this bleeding cannot be added to the previous menses. Further, the minimum period of purity between two menses is 13 days, so it can not be possible that this second bleeding is a second menses.
Since this is the case, you are considered as having Istihaadhah (bleeding outside your monthly period). A woman who has Istihaadhah should consider her regular menses if she knows it. So, if you know your regular periods, then you should count the days of bleeding during this period as menses, and after this, you are considered as having Istihaadhah.
If you do not have a regular bleeding pattern that you know of, then you should resort to distinguishing your bleeding, so what you distinguish as having the features of bleeding of menses, like blackish color, thickness and the usual smell, and feeling pain with this bleeding, then you should consider this as menses and you should consider what is beyond this as Istihaadhah.
If you do not have a regular bleeding pattern and you cannot distinguish the menses bleeding, then you should stay for 6 or 7 days when you see the bleeding and consider it as menses, and what is beyond this is considered as Istihaadhah. After the passing of the days which are counted as menses, you should perform Ghusl (ritual bath) and then use a sanitary pad or the like, and perform ablution for every prayer after its time has begun, and then pray with this ablution the obligatory prayer and any supererogatory prayers that you wish until the time of this prayer has expired.
However, if you find that the bleeding is interrupted for a time which is enough for performing the prayer with the correct purity, then you should wait for this time to pray in it. You should do so every month until your monthly periods become regular.
Allaah Knows best.