OP, this is a terrible situation and not your fault. At 36 I was in a relationship with a really awful man, a total liar. Luckily no kids. It was hard for me to see that I was ONLY 36! I found the strength to ltb after one flirtation too far, and an affair I suspect though I didn't hang around long enough to get proof, my feelings were enough proof.
I'm 44 now, married to a good man who has his flaws but he is kind and I can't imagine he would get involved with texting a 17 year old. I could have had 5 babies between 36 and now. Still fertile now and could have some if I wanted. I don't have any family either, I mean none but if I he had done this I would leave, no hesitation. I would be in a room in a shared house as I only earn £800 a month but I would go.
You are only 36 and I think your grief over what could have been will keep you stuck. Please be brave and leave, I can understand why you are feeling so desperately unhappy now if kids are what you want, but nothing about this suggests there is a future here anymore.
Please believe that meeting someone else and kids can be a part of your future.
I can't imagine on my work placement at 17, a married bloke like this making a move on me. I would totally have fallen, such was the lack of kindness or attention at all from anyone at time. I would have ended a shell of a person, as that unfortunate poster has had to witness, the demise of her daughter's mental health and descent into hell. I'm sorry that I can't remember your name, poster but I feel for you.
Please don't stay. Please don't give up hope for yourself.