I am facing an issue with displaying appointments on a calendar specifically for the logged-in user while grayed out for other users. Below is the table structure:
App. 1 | user 1 | 06/15/2024 8:00 | 06/15/2024 9:00 | Test the code |
App. 2 | user 2 | 06/15/2024 8:00 | 06/15/2024 9:00 | Test the code |
App. 3 | user 3 | 06/15/2024 8:00 | 06/15/2024 9:00 | Test the code |
App. 4 | user 1 | 06/15/2024 8:00 | 06/15/2024 9:00 | Test the code |
If "User1" is logged in, they would see the appointments as follows:
App. 1 | user 1 | 06/15/2024 8:00 | 06/15/2024 9:00 | Test the code |
App. 2 | 06/15/2024 8:00 | 06/15/2024 9:00 | ||
App. 3 | 06/15/2024 8:00 | 06/15/2024 9:00 | ||
App. 4 | user 1 | 06/15/2024 8:00 | 06/15/2024 9:00 | Test the code |
In order to display these appointments using Fullcalendar.io, I need to load events via ajax using the GET method:
eventSources: [
{
url: '/Calendar/GetEvents',
method: 'GET',
failure: function () {
alert('there was an error while fetching events!');
},
color: 'orange',
textColor: 'black'
}
]
I am looking to implement a foreach loop within the ajax call to differentiate and customize the view of appointments based on logged-in user. Any suggestions or guidance on how to achieve this are greatly appreciated.
Best Regards,
Sven