• Home
  • How-To
  • Close bookings for tomorrow at 7:00PM tonight

How-To

Close bookings for tomorrow at 7:00PM tonight


Some operators may wish to close the on-line bookings for tomorrow's timeslots at the end of the current day.

 

This small code modification, to the validation, will check the current time and the booking date.
If the time is after 7:00 PM, and the slot attempting to be booked is tomorrow, it will block with a message that tomorrow's bookings are closed.

 

Edit file: \components\com_rsappt_pro3\fe_val.php

Around line 118, insert this code..

    $CONFIG = new JConfig();
    date_default_timezone_set($CONFIG->offset);
    if (time() >= strtotime("19:00:00") && $startdate == date("Y-m-d", strtotime("+1 day"))) {
        $err = "<br>*** Bookings for tomorrow close at 7:00PM ***<br>";
    }

 

Adjust the time and message text to suit your requirement.

Ensure your Joomla timezone is set correctly so the current time will be your local time.