Transport Booking System

AI Plugin Information
Version 2
Download Download Plugin

Transport Booking System – WordPress Plugin

A comprehensive WordPress plugin for managing transport booking requests for both personal and school use. This plugin enables staff members to submit booking requests, transport managers to approve/reject them, and accounts teams to be notified of approved personal bookings.

Features

🚌 Dual Booking Types

  • Personal Use: Staff can book transport for personal purposes with start/end dates and times
  • School Use: Book transport for school trips with destination, passenger count, and special requirements

👥 User Management

  • User-friendly booking form with conditional fields based on booking type
  • Personal booking history dashboard for users
  • Email notifications for booking status updates

🔐 Admin Features

  • Dedicated admin interface for managing all bookings
  • Approve/reject bookings with optional rejection reasons
  • Filter bookings by status (pending, approved, rejected) and type (personal, school)
  • Detailed booking information display
  • Custom post type for transport bookings

📧 Automated Notifications

  • Transport manager receives notifications for new booking requests
  • Users receive notifications when bookings are approved/rejected
  • Accounts team receives notifications for approved personal bookings

🎨 Responsive Design

  • Custom CSS for both frontend and admin interfaces
  • Status badges for visual booking status identification
  • Mobile-friendly forms and tables

Installation

  1. Download the plugin
  2. Upload and Activate the plugin through the ‘Plugins’ menu in your WordPress admin area
  3. Configure email settings in Transport Bookings > Settings

Requirements

  • WordPress: 6.0 or higher
  • PHP: 8.0 or higher
  • MySQL: 5.6 or higher

Configuration

Email Settings

Navigate to Transport Bookings > Settings in the WordPress admin panel to configure:

  • Transport Manager Email: Receives notifications for new booking requests
  • Accounts Team Email: Receives notifications for approved personal bookings

Database

The plugin automatically creates a custom database table (wp_transport_bookings) upon activation to store booking details.

Usage

For Users (Staff Members)

Submitting a Booking Request

  1. Navigate to a page containing the [ transport_booking_form] shortcode
  2. Select booking type (Personal or School)
  3. Fill in the required fields based on booking type
  4. Submit the form
  5. Receive email confirmation when booking is approved/rejected

Viewing Booking History

  1. Navigate to a page containing the [ my_transport_bookings] shortcode
  2. View all your submitted bookings with their current status

For Transport Managers

Managing Bookings

  1. Go to Transport Bookings in the WordPress admin menu
  2. View all booking requests in a sortable table
  3. Filter by status or booking type
  4. Click View to see detailed booking information
  5. Approve or reject bookings with optional rejection reasons

For Administrators

Setting Up Pages

Create pages with the following shortcodes:

[ transport_booking_form]

Displays the booking request form

[ my_transport_bookings]

Displays the user’s booking history

Shortcodes

[ transport_booking_form]

Displays the transport booking request form. Users must be logged in to access.

Example:

[ transport_booking_form]

[ my_transport_bookings]

Displays a table of the current user’s booking history with status information.

Example:

[ my_transport_bookings]

Booking Types

Personal Use Booking

Required fields:

  • Start Date
  • Start Time
  • End Date
  • End Time
  • Purpose (optional)

Workflow:

  1. User submits request
  2. Transport manager approves/rejects
  3. If approved, accounts team is notified

School Use Booking

Required fields:

  • Date Required
  • Departure Time
  • Return Time
  • Destination
  • Purpose of Trip
  • Number of Passengers
  • Special Requirements (optional)

Workflow:

  1. User submits request
  2. Transport manager approves/rejects
  3. User is notified of decision

File Structure

aiplugin5417/
├── aiplugin5417.php                          # Main plugin file
├── README.md                                  # This file
├── composer.json                              # Composer dependencies
├── src/
│   ├── aiplugin5417/
│   │   └── TransportBookingSystem.php        # Core booking system class
│   ├── css/
│   │   ├── transport-booking.css             # Frontend styles
│   │   └── transport-booking-admin.css       # Admin styles
│   ├── js/
│   │   ├── transport-booking.js              # Frontend JavaScript
│   │   └── transport-booking-admin.js        # Admin JavaScript
│   └── plugin-update-checker/                # Auto-update functionality
└── docs/
    └── wordpress-plugin-architecture-guide.md

Database Schema

Table: wp_transport_bookings

Column Type Description
id bigint(20) Primary key
post_id bigint(20) Associated post ID
user_id bigint(20) User who created booking
booking_type varchar(20) ‘personal’ or ‘school’
start_date datetime Booking start date
end_date datetime Booking end date (personal only)
start_time time Start/departure time
end_time time End/return time
status varchar(20) ‘pending’, ‘approved’, or ‘rejected’
school_purpose text Purpose for school bookings
school_destination varchar(255) Destination for school bookings
school_passenger_count int Number of passengers
school_special_requirements text Special requirements
created_at datetime Record creation timestamp
updated_at datetime Last update timestamp

Hooks & Filters

Actions

  • init – Registers custom post type
  • admin_menu – Adds admin menu pages
  • wp_enqueue_scripts – Enqueues frontend assets
  • admin_enqueue_scripts – Enqueues admin assets
  • wp_ajax_submit_transport_booking – Handles booking submissions
  • wp_ajax_approve_transport_booking – Handles booking approvals
  • wp_ajax_reject_transport_booking – Handles booking rejections

Custom Post Type

  • Post Type: transport_booking
  • Capabilities: Based on standard post capabilities
  • Supports: Title, Author

Security Features

  • Nonce verification for all form submissions
  • AJAX request validation
  • User capability checks
  • Data sanitization and validation
  • SQL injection prevention through WordPress database API

Email Notifications

New Booking Request

  • Recipient: Transport Manager
  • Trigger: User submits booking
  • Contains: Booking ID, type, requester info, date

Booking Approved

  • Recipient: User who submitted booking
  • Trigger: Manager approves booking
  • Contains: Booking ID, type, approval confirmation

Booking Rejected

  • Recipient: User who submitted booking
  • Trigger: Manager rejects booking
  • Contains: Booking ID, type, rejection reason

Personal Booking Approved

  • Recipient: Accounts Team
  • Trigger: Manager approves personal booking
  • Contains: Booking ID, staff member info, dates

Troubleshooting

Bookings Not Appearing

  1. Ensure the plugin is activated
  2. Check user permissions (users must be logged in)
  3. Verify database table was created during activation

Email Notifications Not Sending

  1. Check WordPress email configuration
  2. Verify email addresses in Transport Bookings > Settings
  3. Test with an SMTP plugin if needed

Shortcodes Not Working

  1. Ensure shortcodes are placed in post/page content
  2. Check that users are logged in (required for both shortcodes)
  3. Clear cache if using a caching plugin

Development

JavaScript Modules

The plugin uses WordPress Script Modules API for modern JavaScript:

  • [ aiplugin5417.js](src/js/aiplugin5417.js) – Main entry point
  • [ transport-booking.js](src/js/transport-booking.js) – Frontend booking form handling
  • [ transport-booking-admin.js](src/js/transport-booking-admin.js) – Admin interface interactions

CSS Customization

Override styles by adding custom CSS to your theme:

/* Customize booking form */
.transport-booking-form-container {
    /* Your custom styles */
}

/* Customize status badges */
.status-badge {
    /* Your custom styles */
}

Support

For support, feature requests, or bug reports, please contact the plugin author.

License

Copyright (C) AI_PLUGIN_DEV 2026. ALL RIGHTS RESERVED. THIS IS NOT FREE SOFTWARE.

Credits

Changelog

Version 2 (Current)

  • Complete transport booking system implementation
  • Personal and school booking types
  • Admin approval workflow
  • Email notification system
  • Custom database table
  • Responsive frontend and admin interfaces
  • Shortcode support for easy integration

Note: This plugin requires users to be logged in to submit and view bookings. Ensure your WordPress site has user registration enabled or manually create user accounts for staff members.