I am writing a system that will help my boss track vacation requests. The system will allow users to login, request days off and display their current calendar.
Admins to the system will be able to approve vacation requests in addition to the other functions.
One of the tricky bits is to determine how many days of vacation to deduct from an employee for a particular request.
If I have Saturday and Sunday off, and I request Friday, Jan. 10 through Monday, Jan 13 off, that is 4 days of real time but only 2 days of vacation should be deducted from my allocation.
Any thoughts how, using PHP & MySQL, I can go about this? Specifically, if I have a table that knows the number of days of vacation I have and which days I have off, how can I use MySQL's date functions to determine the number of vacation days to deduct when given the start and end days of the vacation request?