Front end - The code

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

BookingCalendarView.m

#define calendarId @"0"
#define calendarYear @"2015" 

#define jsonLinkData @"http://dopstudios.net/envato/jquery/booking-calendar-pro/dopbcp/php-file/load.php"
#define jsonLinkFormData @"http://dopstudios.net/envato/jquery/booking-calendar-example-pro/dopbcp/php-file/load-calendar.php?calendar=0"

Define the macros above to start your application calendar.

– (void)initFirstDay

Depending on the device define the container width of the calendar (containerWidth constant) by setting properly the following variables:

  • iPadCalendarWidth
  • iPhoneCalendarWidth

BookingForm.m

Set the following macro with you own link where to send the reservation details after it is completed.

#define linkWhereToSendTheReservation

JSON

You can add the following options to the front end version of the plugin iOS application:

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

  • sendURL
    Default value: 'dopbcp/php-file/send.php'.
    URL from were JSON reservation data is saved.

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

  • calendar
    calendar contains 2 attributes: data and text

  • data
    data is used to change calendar configuration

  • bookingStop
    Default value: 0.
    Set the number of minutes before the booking is stopped in advance. For 1 hour you have 60 minutes, for 1 day you have 1440 minutes.

  • dateType
    Default value: 0.
    Select date format: 0 for American (mm dd, yyyy) or 1 for European (dd mm yyyy).

  • language
    Default value: en.
    Set your calendar language.

  • languages
    Default value: [].
    Set your calendar languages.

  • view
    Default value: false.
    Set true to display only booking information in calendar.

  • text
    text is used to change calendar texts

  • addMonth
    Default value: 'Add month view'.
    Add Month View button title (plus icon).

  • available
    Default value: 'available'.
    available text

  • availableMultiple
    Default value: 'available'.
    available multiple text

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

  • nextMonth
    Default value: 'Next month'.
    Next Month button title.

  • previousMonth
    Default value: 'Previous month'.
    Previous Month button title.

  • removeMonth
    Default value: 'Remove month view'.
    Remove Month View button title (minus icon).

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

  • currency
    currency contains 2 attributes: data and text.

  • data
    data is used to change currency configuration

  • code
    Default value: 'USD'.
    Set calendar currency.

  • position
    Default value: 'before'.
    Set your currency position.

  • sign
    Default value: '$'.
    Set your currency sign.

  • 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)

  • morningCheckOut
    Default value: false.
    This option enables "Check in" in the afternoon of first day and "Check out" in the morning of the day after last day.

  • multipleSelect
    Default value: true.
    Use Check in/Check out or select only one day.

  • 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.

  • form
    Form

  • data
    data is used to change form configuration

  • form
    Form fields

  • id
    Default value: '1'.
    Field id

  • form_id
    Default value: '1'.
    Form id

  • type
    Default value: 'text'.
    Field type

  • position
    Default value: '1'.
    Field position

  • multiple_select
    Default value: 'false'.
    Set true if you want to select multiple options from this field.

  • allowed_characters
    Default value: ''.
    Enter the caracters allowed in this field. Leave it blank if all characters are allowed.

  • size
    Default value: '0'.
    Enter the maximum number of characters allowed. Leave it blank for unlimited.

  • is_email
    Default value: 'false'.
    Set true if you want this field to be verified if an email has been added or not.

  • required
    Default value: 'true'.
    Set true if you want the field to be mandatory.

  • translation
    Default value: 'New Field'.
    Field label

  • text
    text is used to change form texts

  • checked
    Default value: 'Checked'.
    Checked text

  • invalidEmail
    Default value: 'is invalid. Please enter a valid email.'.
    Invalid email text

  • required
    Default value: 'is required.'.
    Is required text

  • title
    Default value: 'Contact information'.
    form title text

  • unchecked
    Default value: 'Unchecked'.
    unchecked text

  • ID
    Default value: 0.
    Calendar ID. Change it if you have more then one calendar.

  • months
    Calendar months.

  • data
    data is used to change months 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.

  • order
    Order.

  • data
    data is used to change order configuration

  • redirect
    Default value: ''.
    Set the link where want to be redirected after booking is done. Leave it empty if you don't redirect.

  • terms
    Default value: false.
    Set true if you want to enable terms and conditions.

  • termsLink
    Default value: ''.
    Set the terms and condition link. Leave it empty if you don't want terms and condition.

  • text
    text is used to change order texts

  • book
    Default value: 'Book now'.
    book button

  • success
    Default value: 'Reservation has been added!'.
    Reservation success message

  • terms
    Default value: 'I accept to agree to the Terms & Conditions.'.
    Terms and conditions label

  • termsInvalid
    Default value: 'You must agree with our Terms & Conditions to continue.'.
    Terms & condtions - error message

  • title
    Default value: 'Order'.
    Order title

  • unavailable
    Default value: 'The period you selected is not available anymore. The calendar will refresh to update the schedule.'.
    Error message for unavailable selected period

  • reservation
    Reservation.

  • text
    text is used to change reservation texts

  • price
    Default value: 'Price'.
    Reservation price text

  • priceChange
    Default value: 'Price change'.
    Reservation Price change text

  • priceTotal
    Default value: 'Total'.
    Reservation Total text

  • selectDays
    Default value: 'Please select the days from calendar.'.
    Reservation select days text

  • title
    Default value: 'Reservation'.
    Reservation title

  • titleDetails
    Default value: 'Details'.
    Reservation Details title

  • search
    Search.

  • text
    text is used to change search texts

  • noItems
    Default value: 'No. book items'.
    No. book items text

  • noServices
    Default value: 'There are no services available for the period you selected.'.
    No services available text

  • noServicesSplitGroup
    Default value: 'You cannot add divided groups to a reservation.'.
    No split group text

  • title
    Default value: 'Search.'.
    Search title.