Completed loginView and database functionality with loginView.