The requested PR for preferences.php + Password Hashing Implementation

preferences.php:
mysql --> mysqli
Now using prepared statements to prevent sql injection.
Fixed many errors.
Note: There is still some kind of bug with GMT >9 && <-9


password hashing:
Current passwords need to be updated.
Password generation function needs to use phash function.