Back end - The code

Add the plugin to a container (HTML tag, class or id).

Simple Calendar example

To display the booking calendar please use the following example:

$('#backend').DOPBackendBookingCalendarPRO();

Custom Calendar example

To display the booking calendar with custom settings please read the JSON section and use the following example:

$('#backend').DOPBackendBookingCalendarPRO({
    'ID': 1,
    'loadURL': 'dopbcp/php-database/load.php',
    'saveURL': 'dopbcp/php-database/save.php'
});

JSON

You can add the following options to the back end version of the plugin:

  • AddtMonthViewText
    Default value: 'Add Month View'.
    Add Month View button title (plus icon).

  • AvailableLabel
    Default value: 'No. Available'.
    Form label for Number of Available Items.

  • AvailableOneText
    Default value: 'available'.
    Available Day text for one item.

  • AvailableText
    Default value: 'available'.
    Available text for more items.

  • BookedText
    Default value: 'booked'.
    Booked Day text.

  • Currency
    Default value: '$'.
    Currency icon.

  • DateEndLabel
    Default value: 'End Date'.
    Form label for End Date.

  • DateStartLabel
    Default value: 'Start Date'.
    Form label for Start Date.

  • DateType
    Default value: 1.
    Form date display type (1 = American, 2 = European)

  • GroupDaysLabel
    Default value: 'Group Days'.
    Form label for Group Days checkbox.

  • ID
    Default value: 0.
    Calendar ID. Change it if you have more then one calendar. Make it the same as the Front End version.

  • InfoLabel
    Default value: 'Information (users will see this message)'.
    Form label for Information field.

  • NextMonthText
    Default value: 'Next Month'.
    Next Month button title.

  • NotesLabel
    Default value: 'Notes (only you will see this message)'.
    Form label for Notes field.

  • PreviousMonthText
    Default value: 'Previous Month'.
    Previous Month button title.

  • PriceLabel
    Default value: 'Price'.
    Form label for Price Field.

  • PromoLabel
    Default value: 'Promo Price'.
    Form label for Promo Price field.

  • reinitialize
    Default value: false.
    reinitialize the calendar if already loaded.

  • RemoveMonthViewText
    Default value: 'Remove Month View'.
    Remove Month View button title (minus icon).

  • ResetConfirmation
    Default value: 'Are you sure you want to reset data?'.
    Form Reset Confirmation text.

  • StatusAvailableText
    Default value: 'Available'.
    Form Status - Available text.

  • StatusBookedText
    Default value: 'Booked'.
    Form Status - Booked text.

  • StatusLabel
    Default value: 'Status'.
    Form label for Status Select field.

  • StatusSpecialText
    Default value: 'Special'.
    Form Status - Special text.

  • StatusUnavailableText
    Default value: 'Unavailable'.
    Form Status - Unavailable text.

  • UnavailableText
    Default value: 'unavailable'.
    Unavailable Day text.

  • LoadedText
    Default value: 'Calendar data loaded successfully.'.
    Calendar data loaded successfully text for loader message.

  • SavedText
    Default value: 'Calendar data saved successfully.'.
    Calendar data saved successfully text for loader message.

  • SavingText
    Default value: 'Saving calendar...'.
    Saving calendar text for loader message.

  • LoadingText
    Default value: 'Loading calendar...'.
    Loading calendar text for loader message.

  • loadURL
    Default value: 'dopbcp/php-file/load.php'.
    URL from were JSON data is loaded.

  • saveURL
    Default value: 'dopbcp/php-file/save.php'.
    URL from were JSON data is saved.

  • form
    form contains 2 attributes: data and text.

  • data
    data is used to change form configuration

  • style
    Default value: 5
    Form style: 1, 2, 3, 4 ,5.

  • text
    text is used to change form texts

  • checkIn
    Default value: 'Check in'
    Check in text for form.

  • checkOut
    Default value: 'Check out'
    Check out text for form.

  • submit
    Default value: 'Submit'
    Submit text button.

  • reset
    Default value: 'Reset'
    Reset text button.

  • days
    days contains 2 attributes: data and text.

  • data
    data is used to change days configuration

  • available
    Default value: [true, true, true, true, true, true, true].
    Set available/unavailable days starting with Monday.

  • first
    Default value: 1.
    Set the first day of the week (1 = Monday, 2 = Tuesday, 3 = Wednesday, 4 = Thursday, 5 = Friday, 6 = Saturday, 7 = Sunday)

  • text
    text is used to change days texts

  • names
    Default value: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'].
    Weekdays long names.

  • shortNames
    Default value: ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa'].
    Weekdays short names.

  • months
    months contains 2 attributes: data and text.

  • data
    data is used to change month configuration

  • no
    Default value: 1.
    Set the number of months initialy displayed.

  • text
    text is used to change months texts

  • names
    Default value: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'].
    Months long names.

  • shortNames
    Default value: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'].
    Months short names.