Small updates

some small updates:
- use a common and easy to understand regex in the login_model.php
- remove some bad and redundant `else if` code
- used unsigned integer in the database and fixed a differences for user_id field in notes table