move js to view php file for audit trail