added cphistory chistory sql query & views