Fix PHP errors and add UI for time input