"It's not caused by broken off cover flap and the cover flap can be repalced by http://www.witrigs.com/replacement-parts...
As for the headphone, have you tired change a pair of headphones? And before you repairing the motherboard, what other you can try is replace the headphone jack."
the same what happend to me, bro to clean inside the jack with somthing small like a pen or something else then insert your headphone it should work ;)
I too have the same problem with my Xperia zr. I am not even able to make Soundabout work because even if I choose speakers in that app, music still plays only on the headphone. I can make calls only by connecting headphones or by talking on the loudspeaker. How to deal with the problem?