Added php code for models

created php models for views, models, db