Moved queries to model from controller (view_emp and edit)