Cognition and quality of life relationship among the elderly community: a cross-sectional study