Merging part of the events php from backend_Event branch to Master Branch