Server-side code to generate admin code and change date format in db