Why doesn't your company provide access cards to each employee (nowadays, every big company has this)? With access cards, you can track the number of hours employees spend in the office. If an employee's hours are less than 8 or 9 (as per company rules and regulations), the company can take action against them. Simultaneously, the HR manager should send an email to every employee. If an employee is not in the office for a minimum of 8/9 hours (including lunch break or coffee break), the company has the authority to deduct their salary and take legal action. Implementing this system would make employees more responsible for their working hours and punctuality. I believe this is the best way to address these issues.
Thanks and Regards,