Fix summary popup problem by counting records

Using PHP server, total records are different every query on infinite
scroll. Popup alerts total records are different and we can't view the
rest of the records