It needs refitting properly by a good tradesman .......don't try it yourself unless you know what your doing ........the fact that you can see it to photograph it suggests time it can be refitted properly. The trap can be fitted on waste pipe fed in to position connected to the tray outlet and the joint made at the opposite end last.