=== PocketBooking - Manage Appointments on the Go ===
Contributors: maksim85
Tags: appointment booking, scheduling, booking calendar, pwa, mobile booking
Tested up to: 6.9.1
Requires PHP: 7.4
Stable tag: 1.1.7
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Professional booking system wich comes with its own Smartphone App (PWA) support. Manage appointments and staff easily. Includes offline access and push notifications.

== Description ==

**PocketBooking** is a professional, high-performance appointment scheduling system for WordPress. Ideal for salons, clinics, consultants, and service-based businesses.

**Key Features:**

* **Progressive Web App (PWA):** Install your booking system as a native mobile app on any device. Works offline, supports push notifications for new bookings, and provides an app-like experience with custom icons and splash screens.
* **Smart Frontend:** Responsive multi-step booking form with real-time availability, service selection, and staff assignment.
* **Powerful Backend:** Full management suite with filtering, sorting, manual bookings, and a visual dashboard with statistics.
* **Smart Search:** Quickly find bookings, services, or staff members with live search functionality. Search by name, email, phone, service, or staff member across all admin pages.
* **Quick Email Actions:** Accept or reject bookings directly from admin notification emails with styled quick-action buttons. No need to log into the backend!
* **Automatically Accept Bookings:** Optionally enable automatic booking confirmation in settings. New bookings are instantly confirmed and customers receive confirmation emails with cancellation links.
* **Push Notifications:** Receive instant notifications for new bookings directly on your mobile device (PWA mode only).
* **Dynamic Calendar Views:** Week and Day calendar views automatically adjust time slots based on your configured opening hours for optimal scheduling visibility.
* **Services & Staff:** Manage multiple services with custom durations and buffer times. Set individual working hours and profile photos for staff members.
* **Flexible Scheduling:** Manage regular weekly hours, holidays, and special opening hours that override defaults automatically.
* **Automated Communication:** Reminder and confirmation emails in 9 languages (DE, EN, IT, ES, FR, PL, RU, SV). Includes unique cancellation links for guest self-service.
* **Custom Design:** Adjust colors (background, buttons, tiles) and corner radius for both form and tiles with a live preview to match your brand. Customize form headers (date, service, employee, time, contact sections) for each language.
* **Flexible View Toggle:** Switch between table and card views in Services and Staff management pages. Card view defaults to grid layout with responsive design (2 columns on tablets, auto-fill on desktop). User preferences are saved in localStorage.
* **Bulk Management:** Efficiently handle large amounts of data with bulk-delete for past or cancelled bookings and CSV export.
* **Security & Performance:** Built with WordPress best practices, featuring Nonce verification, SQL injection protection, and optimized AJAX handlers.

Professional features like iCal/ICS feeds and detailed booking analytics help you stay organized.

== Installation ==

**Installation via WordPress Dashboard (recommended):**

1. Navigate to `Plugins` > `Install` in your WordPress admin area.
2. Search for "PocketBooking".
3. Click `Install Now` and then `Activate`.
4. The setup wizard will automatically appear to guide you through the initial configuration.
5. Add the shortcode `[pocketbooking-form]` to the page where you want the form to be displayed.

**Manual Installation:**

1. Download the plugin file (`.zip`).
2. Extract the `.zip` file on your computer.
3. Upload the plugin folder to the `/wp-content/plugins/` directory on your server.
4. Go to `Plugins` in your WordPress admin area and activate "PocketBooking".
5. Add the shortcode `[pocketbooking-form]` to the desired page.

== Usage ==

=== Setup Wizard ===

After activation, the setup wizard will automatically appear to help you configure your booking system. The wizard guides you through 6 steps:

1. **Basic Information:**
   - Enter company name
   - Configure notification email address
   - Enable/disable email notifications

2. **Opening Hours:**
   - Activate weekdays for reservations
   - Set opening hours for each day
   - Configure time interval

3. **Service:**
   - Create your first service
   - Set service name, duration, and buffer time

4. **Staff:**
   - Add your first staff member
   - Set name, email, phone, and profile photo
   - Configure individual working hours (optional)

5. **Language:**
   - Select the desired language for frontend and backend
   - All texts will be automatically translated

6. **Complete:**
   - Review your settings
   - Access the dashboard to manage bookings

You can restart the setup wizard at any time by going to `PocketBooking` > `Settings` > "General" tab > "Setup Wizard" section and clicking "Reset Setup Wizard".

=== Getting Started ===

1. **Configure General Settings:**
   - Go to `PocketBooking` > `Settings` > "General" tab
   - Enter company name
   - Configure email address for notifications
   - Set maximum number of people and stay duration
   - Configure minimum advance time
   - **Appointment Reminders:** Enable/disable automatic reminder emails and set how many hours before the appointment they should be sent (1-168 hours)

2. **Set Up Opening Hours:**
   - "Opening Hours" tab > "Regular Weekly Opening Hours"
   - Activate desired weekdays
   - Set opening hours (start and end) for each day
   - Configure time interval (default: 30 minutes)

3. **Add Services:**
   - Go to `PocketBooking` > `Services`
   - Click on a service to edit or add a new one
   - Set service name, duration, and buffer time
   - Assign staff members who can perform this service

4. **Add Staff Members:**
   - Go to `PocketBooking` > `Staff`
   - Click on a staff member to edit or add a new one
   - Set name, email, phone, and profile photo
   - Configure individual working hours (optional)
   - Assign services this staff member can perform

5. **Add Holidays:**
   - "Opening Hours" tab > "Holidays & Special Opening Hours"
   - Select a date in the calendar
   - Click "Configure Selected Date"
   - Choose "Close entire day" or "Special opening hours"
   - Save settings

6. **Customize Email Templates:**
   - "Emails" tab
   - Select desired language
   - Customize subject and message for each email type:
     * Confirmation emails (sent when a booking is created)
     * Reminder emails (sent X hours before the appointment)
     * Cancellation emails (sent when a booking is cancelled)
     * Status change notifications
   - Use placeholders for dynamic content
   - Each booking automatically includes a cancellation link that guests can use to cancel their appointment

7. **Customize Design:**
   - "Design" tab
   - Select background color for the form
   - Adjust text, button, and tile background colors
   - Set corner radius for form (0-50 pixels)
   - Set corner radius for tiles (date/service/employee/time cards) separately (0-50 pixels)
   - Customize form section headers (date, service, employee, time, contact) for each language with language-specific defaults

8. **Select Language:**
   - "Language" tab
   - Select desired language for frontend and backend
   - All texts are automatically translated

9. **Embed Form:**
   - Create a new page or edit an existing one
   - Add the shortcode `[pocketbooking-form]`
   - Publish the page

=== Managing Bookings ===

**Dashboard:**
- Go to `PocketBooking` > `Dashboard`
- View overview statistics for today and this week
- See booking status breakdown (Confirmed, Pending, Cancelled)
- Quick access to common actions (New Booking, Settings, etc.)
- Display of the shortcode for embedding the booking form
- Automatically shown after completing the setup wizard

**Booking List:**
- Go to `PocketBooking` > `Bookings`
- Use filters to display specific bookings (All, Pending, Today, Upcoming, Past, Cancelled)
- **Quick Search:** Use the search field to find bookings by name, email, phone, service, or staff member
- Sort by various criteria
- Click on a booking to view details and change status
- Edit or delete bookings directly from the modal
- **Bulk Actions:** On "Past" and "Cancelled" tabs, select multiple bookings with checkboxes and delete them all at once with a single confirmation

**Services Management:**
- Go to `PocketBooking` > `Services`
- **Quick Search:** Find services by name, category, or description
- Switch between table and card views
- Click on a service to edit details or add a new one

**Staff Management:**
- Go to `PocketBooking` > `Staff`
- **Quick Search:** Find staff members by name, email, or phone
- Switch between table and card views
- Click on a staff member to edit details or add a new one

**Add Manual Booking:**
- Go to `PocketBooking` > `New Booking`
- Fill in all fields
- Select service, staff member, date and time
- Optional: Send email confirmation to guest
- Click "Create Booking"

**Calendar View:**
- Go to `PocketBooking` > `Calendar`
- View all bookings in a calendar format
- Filter by service and staff member
- Subscribe to calendar feed (iCal/ICS)

**Statistics:**
- Go to `PocketBooking` > `Statistics`
- View booking statistics and cancellation rates

**CSV Export:**
- Go to `PocketBooking` > `Bookings`
- Optionally select a filter
- Click "Export CSV"
- The file will be downloaded

== Frequently Asked Questions ==

= What is the Progressive Web App (PWA) feature? [PRO] =

The PWA feature allows you to install your booking system as a native app on any mobile device or desktop. Benefits include:
- **Offline Access:** Access your booking system even without an internet connection
- **Push Notifications:** Receive instant notifications for new bookings on your device
- **App-Like Experience:** Full-screen mode, custom app icon, and splash screen
- **Fast Performance:** Optimized loading times and smooth navigation
- **No App Store Required:** Install directly from your website with one click

To enable PWA, go to `PocketBooking` > `Settings` > "App" tab and configure your app name, icons, and push notifications.

= How do I install the app on my device? [PRO] =

**On Android/Chrome:**
1. Open your WordPress admin panel in Chrome
2. Look for the "Install" prompt in the address bar or click the menu (⋮) > "Install app"
3. Confirm installation

**On iOS/Safari:**
1. Open your WordPress admin panel in Safari
2. Tap the Share button (□↑)
3. Scroll down and tap "Add to Home Screen"
4. Tap "Add"

The app icon will appear on your home screen like any other app.

= Do push notifications work on all devices? [PRO] =

Push notifications require:
- HTTPS connection (SSL certificate)
- Supported browser: Chrome, Edge, Firefox, Samsung Internet (iOS Safari does not support push notifications)
- User permission to show notifications
- PWA app installed on the device

Push notifications are configured in `PocketBooking` > `Settings` > "App" tab > "Push Notifications" section.

= How many languages are supported? =

The plugin supports 9 languages: German (DE), English (US, UK), Italian (IT), Spanish (ES), French (FR), Polish (PL), Russian (RU), and Swedish (SV). English US is also available with 12-hour AMPM time format. Push notifications are automatically translated based on your selected language.

= How do I add the booking form to my website? =

Add the shortcode `[pocketbooking-form]` to the text editor of any page or post.

= Can I customize the form colors? =

Yes. Go to `PocketBooking` > `Settings` > "Design" tab. There you can adjust the background, text, button, and tile background colors as well as the corner radius.

= How do I set a day off, e.g. Monday? =

Go to `PocketBooking` > `Settings` > "Opening Hours" tab > "Regular Weekly Opening Hours". Simply uncheck "Allow reservations on this day" for "Monday" and save the changes.

= How do I close my business for a specific holiday? [PRO] =

Go to `PocketBooking` > `Settings` > "Opening Hours" tab > "Holidays & Special Opening Hours". Select the desired date in the calendar and click "Configure Selected Date". Make sure the "Close entire day" option is selected and save the settings.

= How do I set special opening hours for a day, e.g. December 24 from 2-6 PM? [PRO] =

Go to `PocketBooking` > `Settings` > "Opening Hours" tab > "Holidays & Special Opening Hours". Select the date (e.g. December 24) in the calendar, click "Configure Selected Date", choose "Special opening hours" and enter the times (14:00 - 18:00). Save the settings.

= Which languages are supported? =

The plugin supports 9 languages: German, English (US, UK), Italian, Spanish, French, Polish, Russian, and Swedish. The default language on first installation is English.

= How do I change the plugin language? =

Go to `PocketBooking` > `Settings` > "Language" tab and select the desired language. After saving, the entire interface will be displayed in the new language.

= Are emails sent in the selected language? =

Yes. Emails are automatically sent in the language selected in the plugin settings. You can create separate email templates for each language.

= Can I design email templates differently for different languages? =

Yes. Switch to the desired language in settings and customize the email templates. Each language has its own templates.

= How do reminder emails work? [PRO] =

Reminder emails are automatically sent to guests X hours before their appointment. You can configure this in `PocketBooking` > `Settings` > "General" tab > "Appointment Reminders" section. Enable or disable reminders and set the number of hours (1-168) before the appointment when the reminder should be sent. Reminder emails use their own templates (customizable in the "Emails" tab) and include a cancellation link for guests.

= How can guests cancel their bookings? [PRO] =

Each booking receives a unique cancellation token. A cancellation link is automatically included in confirmation and reminder emails. Guests can click this link to cancel their booking directly from the frontend. After cancellation, both the guest and the administrator receive a cancellation confirmation email.

= What is the setup wizard? =

The setup wizard is an interactive guide that appears automatically after plugin activation. It helps you configure the basic settings of your booking system in 6 steps: Basic Information, Opening Hours, Service, Staff, Language, and Completion. You can restart the wizard at any time from `PocketBooking` > `Settings` > "General" tab.

= How does availability checking work? =

The system considers:
- Regular opening hours of the weekday
- Special opening hours for the selected date (if available)
- Existing bookings
- Service duration and buffer time
- Staff member availability and individual working hours
- Maximum number of people
- Stay duration per booking
- Minimum advance time

= Can I accept or reject bookings directly from emails? =

Yes! Each admin notification email for a new booking contains three styled quick-action buttons:
- **Accept** - Immediately accepts the booking
- **Reject** - Rejects the booking
- **View** - Opens booking details in the backend

The buttons are styled like frontend tiles for a consistent look and allow you to manage bookings without opening the WordPress admin panel. You must be logged in to use these buttons.

== Screenshots ==

1. The user-friendly, multi-step booking form in the frontend with service and staff selection.
2. The clear booking list in the admin area with filter options and clickable rows.
3. The calendar view showing all bookings in a visual calendar format.
4. The services management page with service details and staff assignments.
5. The staff management page with individual working hours configuration.
6. The settings page for regular weekly opening hours.
7. [PRO] The management of holidays and special opening hours.
8. The design settings with color selection and corner radius for the form.
9. The email template management with language selection.
10. The language selection with 9 supported languages.
11. The statistics page with booking analytics.
12. The setup wizard guiding through initial configuration.
13. [PRO]The calendar view showing all bookings in the Smartphone. 
14. The dashboard overview with statistics and quick actions.
15. The App settings tab where you can configure your own smartphone app. (Pro)
16. Smartphone app dashboard view. (Pro)
17. Smartphone app calendar view. (Pro)
18. Reservation list in the smartphone app. (Pro)

== Changelog ==

= 1.1.6 =
* NEW: Automatic update system integrated - Plugin updates are now automatically detected from the Mobile-Refuel license server
* NEW: Update notification in admin settings showing available updates with version information
* NEW: Manual update check button to immediately search for new versions
* NEW: License validation before update download to ensure only active licenses can update
* NEW: Support period check - Updates only available with active support
* NEW: 12-hour cache for update checks to optimize server performance
* IMPROVED: Update information displayed in Settings > General tab with current version and update status

= 1.1.5 =
* NEW: [PRO] Progressive Web App (PWA) support - Install as native mobile app
* NEW: [PRO] Push notifications for new bookings (PWA mode with HTTPS required)
* NEW: [PRO] Custom app icons (192x192, 512x512) and splash screens
* NEW: [PRO] PWA-optimized mobile interface with bottom navigation
* NEW: [PRO] App installation prompt with custom overlay
* NEW: [PRO] Multilingual push notifications (9 languages)
* NEW: Swedish language support (sv_SE)
* NEW: Russian language support (ru_RU)
* NEW: [PRO] Automatically accept bookings option in settings - Skip manual confirmation and instantly confirm new bookings
* NEW: Service categories/grouping system - Organize services into custom categories
* NEW: Category display in services table with colored badges
* NEW: Card view grouped by category for better service organization
* NEW: Category names shown in staff assignment view (e.g., "Haircut (30 Min.) - Men")
* NEW: Delete confirmation for categories shows linked services count
* NEW: Live search functionality for bookings - Search by name, email, phone, service, or staff member
* NEW: Live search functionality for services - Search by name, category, or description
* NEW: Live search functionality for staff - Search by name, email, or phone
* NEW: Search works in both table and card views with instant filtering
* NEW: Clear button for quick search reset
* IMPROVED: Mobile-optimized layouts for all admin pages
* IMPROVED: Responsive navigation for touch devices
* IMPROVED: Color theming system unified across app and design settings

= 1.1.4 =
* NEW: Email quick action buttons - Accept and reject bookings directly from admin notification emails
* NEW: Buttons are styled like frontend tiles for design consistency
* IMPROVED: Button styling optimized for maximum email client compatibility

= 1.1.3 =
* NEW: Complete internationalization with 6 supported languages (DE, EN, IT, ES, FR, PL)
* NEW: Language-specific email templates with standard templates for all languages
* NEW: Translated calendars (months and weekdays) in frontend and backend
* NEW: Corner radius setting for form design
* NEW: Special opening hours are considered when manually creating bookings
* NEW: Services and staff management system
* NEW: Calendar view with FullCalendar integration
* NEW: Dynamic calendar time slots - Week and Day views automatically adjust to opening hours configuration
* NEW: Statistics page with booking analytics
* NEW: [PRO] Calendar subscription feature (iCal/ICS feed)
* NEW: Individual working hours for staff members
* NEW: Tile background color customization
* NEW: Setup wizard for easy initial configuration
* NEW: Dashboard overview with statistics and quick actions
* NEW: [PRO] Automated reminder emails X hours before appointments
* NEW: [PRO] Guest cancellation via unique cancellation links in emails
* NEW: Responsive card view for tablet and mobile devices
* NEW: Custom popup confirmation system for all delete actions
* NEW: Bulk delete functionality for multiple bookings on Past and Cancelled tabs
* NEW: Checkbox selection for batch operations on booking list
* NEW: Improved staff selection logic for new bookings (backend and frontend) - ensures correct staff member selection and prevents overbooking errors
* IMPROVED: Booking list with clickable rows and modal details
* IMPROVED: Responsive design for all admin pages
* IMPROVED: Card-based grid layout for better UX and mobile responsiveness
* IMPROVED: Custom styled confirmation dialogs (simpbook-dialog system) for all confirmations
* IMPROVED: Staff member selection validation in both backend manual booking creation and frontend form to prevent booking errors

= 1.1.0 =
* NEW: [PRO] Management for holidays and special opening hours added. Days can now be completely closed or given different hours.
* NEW: CSV export function for bookings.

= 1.0.0 =
* First release of the plugin.
* Main features: Online booking form, backend management, customizable emails, and weekly opening hours.

== Support ==

For support, questions, or feedback, please visit https://mobile-refuel.de

== Credits ==

Developed by Maxim Ristow / maksim85 for Mobile-Refuel.

---