Add datepicker and fix PHP errors