Need help with CRM based on calendar

Hi there, I have a tough issue. I want to develop functionality as below?

I need to create a CRM based on the calendar but I do not know how to organize logic and database so that I can make appointments with the client any date and time.