=== AddonLogic Booking Availability Table ===
Contributors: snehalpancholi
Tags: booking, availability, schedule, calendar, appointments
Requires at least: 6.0
Tested up to: 6.7
Stable tag: 1.0.0
Requires PHP: 8.1
License: GPL-2.0+
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Display a weekly availability grid for resources with bookable time slots and simple booking request management.

== Description ==

AddonLogic Booking Availability Table lets you create "Resources" (meeting rooms, staff members, equipment, etc.) and define which hours on which days of the week are available for booking. A colour-coded weekly grid is then rendered on any page via a simple shortcode.

**Key features:**

* Create unlimited bookable resources via a dedicated WordPress post type.
* Configure available time slots per day of the week directly on the resource edit screen.
* Shortcode [availability_table resource="slug"] renders a responsive colour-coded grid.
* Visitors click an available slot to open an inline booking request form (no page reload).
* Booking requests are stored as post meta — no extra database tables needed.
* Admin can approve or decline bookings directly from the resource edit screen.
* Email notifications sent to admin on new bookings and to visitors on status change.
* Configurable slot duration (30 / 60 / 120 min), time format (12 / 24 hour), and week start day.
* Fully accessible: keyboard-navigable slots, ARIA labels, focus management.
* Zero jQuery dependency — built with vanilla JS and the Fetch API.
* Respects WordPress dark mode preferences via CSS custom properties.

== Installation ==

1. Upload the `booking-availability-table` folder to `/wp-content/plugins/`.
2. Activate the plugin through the Plugins screen in WordPress.
3. Go to **Availability** in the left-hand menu and click **Add New Resource**.
4. Give the resource a title (e.g. "Meeting Room A") and check the desired availability slots.
5. Click **Publish**.
6. Go to **Settings > Availability Table** to configure slot duration, time format, and email settings.
7. Add the shortcode `[availability_table resource="meeting-room-a"]` to any page or post.

== Frequently Asked Questions ==

= How do I find my resource slug? =

The slug appears under the resource title on the edit screen (the "Permalink" field) and is also shown as a ready-to-copy shortcode in the Resources list table.

= Can I display multiple resources on the same page? =

Yes. Place multiple shortcodes on the same page, each with a different `resource` attribute.

= What happens to a booked slot after I decline the booking? =

Declined bookings free the slot — it will appear as "Available" again on the next page load.

= Are bookings stored in the database? =

Yes, as post meta (`_bav_bookings`) on the resource post. No custom tables are created.

= Can I change the available hours range? =

Slot generation currently runs from 09:00 to 18:00. You can adjust the `addlc_bav_generate_time_slots()` function in `includes/meta-box.php` for a custom range.

= Does this integrate with a payment gateway or calendar? =

Not in the current version. Planned premium add-ons include Google Calendar sync and WooCommerce payment before booking confirmation.

== Screenshots ==

1. Resource edit screen with the Availability Schedule meta box.
2. Bookings meta box on the resource edit screen — approve or decline with one click.
3. Frontend availability grid rendered by the shortcode.
4. Inline booking form that slides in when an available slot is clicked.
5. Settings page under Settings > Availability Table.

== Changelog ==

= 1.0.0 =
* Initial release.

== Upgrade Notice ==

= 1.0.0 =
Initial release.
