I'm building a chat system in php, and in the onlines client checking function it's going to be an ajax calling a php file every 30s, and in this file there will be a foreach that will bring in each user and do the verification , and I need to make a function that when the client is offline, change the html class in the attendant panel to offline, inside the foreach. That is, for each user he sees that he is offline he would already be setting up inside the foreach that the client is online or ofline changing his class.
Would it be possible to run this JS function within php? or in php call a JS function?