This PHPMaker 2024 project will show you how to get the actual working days of Employee's Leave, by excluding the Holidays and Weekend Days (Saturday and Sunday), so that those days will not be included as the Number of Days of Employee's Leave.

It will also check whether a Date is conflict with the certain Date Range. In addition, if Two Dates conflict with the certain Date Range, then system will also prevent such data inserted into the Database.

Imagine if you do not handle this, then system will allow to store Employee's Leave with Date Periode (for example) 2023-04-03 to 2023-04-06 with another conflicted period: 2023-04-05 to 2023-04-07 for the same Employee! The two date periods appear to overlap between one to another, and this project will not allow it is saved into Database.

There are actually many things we can learn from this PHPMaker 2024 project:

  1. How to get All Dates from the certain Date Range using Row_Inserting server event.
  2. How to exclude Saturday and Sunday from the certain date range.
  3. How to exclude Holidays from Database based on the certain date range.
  4. How to insert Leave Monitor after inserting Leave History record using Row_Inserted server event.
  5. How to save Dates of Employee's Leave in Multiple-Lines Value into a Field of Database.
  6. How to update Leave Monitor after inserting the Leave History record using Row_Inserted server event.
  7. How to update Total Taken and Balance of Employee's Leave after deleting Leave History record using Row_Deleted server event.
  8. How to calculate the Actual Number of Days of Employee's Leave using Row_Inserting server event.
  9. How to limit Minimum Date in DateTimePicker control to Today's Date.
  10. How to validate Minimum Date using Form_CustomValidate in Client Scripts.
  11. How to validate End Date must be greater or equal to Start Date in Row_Inserting server event.
  12. How to make text in a field Right-Align only in List Page, but Left-Align in View Page and Master Page.
  13. How to calculate the Leave's Balance by substracting Maximum Leave and Total Leave Taken via Row_Inserted server event.
  14. How to check whether a Date or even Two Dates is conflict with the certain Date Range.
  15. How to prevent two Date Ranges conflicted (sliced between one to another) to be saved into the Database.
  16. How to create global functions to check wheter a Date or Two Dates is conflict with the certain Date Range
  17. How to create button on each record in List Page of Employees to open Add Page in Modal dialog of Leave History.
  18. How to handle the possibility of Employee's Leave that will be happened on Next Year.
  19. How to make sure maximum Year of Start Date and maximum Year of End Date must be on Next Year.
  20. How to prevent Employee's Leave that will be happened Over Next Year.
  21. How to use Option Template for the display Lookup Field looks different between the one in Extended Search and the one in each row Table of List Page.
  22. How to implement Ajax by API and Client Scripts to display the recommended Year when an Employee ID is being selected.