db sql added
corrected sql
template & display adjustmnts