Moved database function in class "Database"; Corrected database-using webpages accordingly; Moved config file from PHP to JSON with more config variables; Corrected login page redirection on wrong username or password.
Source template from https://bootsnipp.com/snippets/z8aQr.