Thanks for query,
As you had last period at the end of june, ie about 10 days passed.
You had sex in safe period but can not take risk and go for pregnancy
test to rule out pregnancy.
You might have some infection as you have blood stained discharge,
Ok and bye.