Thanks for query,
It seems that along with internal piles you might have some chronic intestinal infection giving this problem.
Go for stool test
to find out which type of infection.
After report go for treatment accordingly.
Consult surgeon to rule out piles and possibility of having Fistula in ano as you got jelly like discharge from anal canal
Avoid fried and junk food.
Ok and bye.