I added this function to redirect all access to login if the current time is 2 minutes after the order is placed. More than enough time for someone to click on print invoice and have that page load. I have attached only the top portion on print_order2.php where the change is needed

More...