rewrite pagination combine with sqlstr_add_limit
update structure of template pagination
functions with new pagination