Small changes

Created SQL function that returns an unique ID
Errors will be saved in a 'log.txt' file
Manager won't pre-select anything