Big changes on database, Model and Controller

Increase the security of Database model by using PDO instead of the
mysql_* function call. addin search functionality in to model module.
and changes in controller to use search function