I don't really get what's going on. What is Timestamp? You're querying Attendance but it seems not doing anything with it. Except you're overwriting Attendance (class) by the result of the query; you should really probably call it attendance = ....
ok. But I am still pretty much confused like how to implement this logic like can I use for loop to get login and logout time of all students or is there any other way? That's where I need help. Currently, I can retrieve Login and Logout in object form and I am trying to show it on the frontend.