Tech Plan (Backend)

Database Schema (Physical Model) Article:

Users Table:

  • UserID (Primary Key, Auto Increment)
  • Email (VARCHAR)
  • Password (PWDHASH)
  • Category (VARCHAR) - Possible values: 'Admin' or 'Client'

Bookings Table:

  • BookingID (Primary Key, Auto Increment)
  • UserID (Foreign Key referencing Users table)
  • PackageID (Int)

Hotels Table:

  • HotelID (Primary Key, Auto Increment)
  • HotelName (VARCHAR)
  • HotelLocation (Int)

Packages Table:

  • PackageID (Primary Key, Auto Increment)
  • UserID (Foreign Key referencing Users table)
  • BookingID (Int)

Relationships between tables:

  • The Bookings,The Packages and The Packages table has a foreign key linking the tables

PHP Pseudocode Article:

User Authentication Pseudocode:

  1. Receive email and password from the login form.
  2. Validate and sanitize input.
  3. Query the database to retrieve the user with the given email.
  4. Verify the password against the stored hashed password.
  5. If authentication is successful, redirect to the appropriate dashboard.
  6. If authentication fails, display an error message.

Booking Process Pseudocode:

  1. Receive UserID, PackageID, and other booking details from the booking form.
  2. Validate and sanitize input.
  3. Insert a new record into the Bookings table with the provided details.
  4. Update relevant records in other tables (e.g., decrement available slots in the Packages table).
  5. Display a confirmation message to the user.

Retrieve User Bookings Pseudocode:

  1. Receive UserID.
  2. Query the database to retrieve all bookings associated with the user.
  3. Display the list of bookings on the user's dashboard.

File Structure:

  • project-root/
    • includes/
      • db.php
      • functions.php
    • admin/
      • dashboard.php
      • manage_content.php
      • ...
    • user/
      • dashboard.php
      • book_package.php
      • view_bookings.php