added some fixes for db class and added phtml files