Streamline Event Planning with a Comprehensive PHP & MySQL Event Management System

Rashmi Mishra
0

 

Event Management System

Project Overview: 

The Event Management System is a web application designed to facilitate event organization and participation. It features two distinct interfaces: an Admin Panel and a User Panel. Users can register, log in, and book events through the User Panel, while the admin can manage events and users through the Admin Panel. The system ensures smooth handling of event bookings and generates a unique ticket number for each booking.


Features and Functionality:

Admin Panel Features:

1.  Add Events: Admin can create new events with details like name, description, date, time, venue, and ticket price.

2.  Modify Events: Admin can edit event details or remove events.

3.  View Events: Admin can see all available events.

4.  Manage Users: Admin can view and modify user details.

User Panel Features:

1.  Modify User Profile: Users can update their personal information.

2.  View Events: Users can browse all available events.

3.  Book Event: Users can book events, generating a unique ticket number.

4.  View Bookings: Users can view their bookings and ticket numbers.

Landing Page Features(index.php):

1.  Login: For both users and admins to access their respective panels.

2.  Register: For new users to sign up for an account.


Steps to Develop the Project in PHP and MySQL

Step 1: Setup Environment

1.  Install XAMPP or WAMP server.

2.  Create a project directory in the htdocs folder (e.g., event_management).

3.  Start Apache and MySQL services.

Step 2: Database Design

Create a MySQL database (e.g., event_management) with the following tables:

1.  users:

o    id (Primary Key)

o    role (admin or user), 

name, 

email,

username,

phone, 

password,  

created_at, 

updated_at

2.  events:

o    id (Primary Key)

 event_name, 

event_description, 

event_date, 

event_location

event_price

event_image,

event_status, 

created_at, 

updated_at

3.  bookings:

o    id (Primary Key)

o    user_id (Foreign Key referencing users)

o    event_id (Foreign Key referencing events)

o    ticket_number,

o    created_at,

o    updated_at


SCREENSHOTS FOR CREATING TABLES WITH DETAIL





Step 3: Design the Application Structure

1.  Create folders for organization:

o    css: For styling.

o    includes: For reusable components like header.php and footer.php.

o    admin: For admin-related pages.

o    user: For user-related pages.

2.  Create a db_.php file to connect to the database.


Step 4: Develop the Features

1. Landing Page

  • Create index.php for login and registration forms.
  • Handle authentication in login.php and registration in register.php.

2. Admin Panel

  • admin/dashboard.php: Display event stats.
  • admin/add_event.php: Form to add events.
  • admin/manage_events.php: List of events with edit/delete options.
  • admin/manage_users.php: List of users with edit/delete options.

3. User Panel

  • user/dashboard.php: Display available events and user bookings.
  • user/profile.php: Form to modify user details.
  • user/book_event.php: Form to book an event and generate a ticket number.
  • user/my_bookings.php: Display user's booked events and ticket numbers.

4. Common Files

  • header.php, footer.php, and sidebar.php for layout consistency.
  • functions.php for reusable PHP functions (e.g., ticket generation).

Step 5: Style the Application

1.  Use Bootstrap for responsive design.

2.  Apply custom CSS for additional styling.


Step 6: Testing

1.  Test user registration, login, and role-based redirection.

2.  Test event management and user bookings.

3.  Verify ticket number generation.


Step 7: Deployment

1.  Host the project on a live server.

2.  Export the database and import it into the hosting server.

3.  Update database credentials in config.php.

The project straucture

Root Directory: event_management

event_management/

├── admin/                   # Admin Panel

   ├── add_event.php        # Page for adding new events

   ├── edit_event.php       # Page for editing an event

   ├── manage_events.php    # Page to list and manage all events

   ├── manage_users.php     # Page to list and manage users

   ├── dashboard.php        # Admin dashboard

   └── styles.css           # Specific CSS for Admin Panel

├── user/                    # User Panel

   ├── book_event.php       # Page for booking events

   ├── edit_profile.php     # Page for editing user profile

   ├── my_bookings.php      # Page for viewing user bookings

   ├── view_events.php      # Page for viewing all events

   └── dashboard.php        # User dashboard

├── includes/                # Common Includes

   ├── config.php           # Database connection file

   ├── header.php           # Header for all pages

   ├── footer.php           # Footer for all pages

   ├── sidebar_admin.php    # Sidebar navigation for Admin Panel

   ├── sidebar_user.php     # Sidebar navigation for User Panel

   └── functions.php        # Common PHP functions

├── assets/                  # Assets Folder

   ├── css/                 # CSS Files

      ├── main.css         # General styles for the website

      └── bootstrap.min.css # Bootstrap CSS

   ├── js/                  # JavaScript Files

      ├── main.js          # General JavaScript

      └── bootstrap.min.js # Bootstrap JS

   └── images/              # Images for the website

├── auth/                    # Authentication Module

   ├── login.php            # Login page

   ├── register.php         # Registration page

   ├── logout.php           # Logout functionality

   └── forgot_password.php  # Forgot password functionality (optional)

├── index.php                # Landing Page (Login/Register)

├── about.php                # Optional: About Page

├── contact.php              # Optional: Contact Page

├── README.md                # Documentation for the project

└── db_dump.sql              # SQL file for the database schema

Description of Key Files and Folders

Admin Folder

Contains pages for admin-exclusive features:

  • add_event.php: A form to add events.
  • edit_event.php: Edit existing events.
  • manage_events.php: List and manage events.
  • manage_users.php: Manage user profiles (view, edit, delete).
  • dashboard.php: Summary and analytics for the admin.

User Folder

Contains user-exclusive pages:

  • book_event.php: Form for booking an event.
  • edit_profile.php: Modify user details.
  • my_bookings.php: View booked events and ticket numbers.
  • view_events.php: Browse available events.
  • dashboard.php: User homepage after login.

Includes Folder

Reusable components:

  • config.php: Database connection script.
  • header.php and footer.php: Shared header and footer.
  • sidebar_admin.php and sidebar_user.php: Role-based navigation menus.
  • functions.php: Common utility functions like ticket generation and form validation.

Assets Folder

For static resources:

  • CSS: Contains all CSS styles, including Bootstrap and custom styles.
  • JS: JavaScript files for frontend interactions.
  • Images: Stores images used on the site (e.g., logos, event banners).

Auth Folder

Manages authentication processes:

  • login.php: Allows admin and users to log in.
  • register.php: User registration form.
  • logout.php: Ends user session.

.....Here I give the project folder structure and in the downlaod project folder files are in direct root folder .You can arrange the files in respective folder and deploy your project as using the folder structure in php.


ScreenShots Of EMS in PHP

Landing Page: (index.php)

register.php


login.php















Download the source code ...




Steps How to run this project on your Computer

Step 1: Install a Local Server

1.  Download and install a local server like XAMPP or WAMP.

2.  Ensure that the installation includes PHP, Apache, and MySQL.


Step 2: Download the Project

1.  Obtain the project files in a compressed format (e.g., .zip) or clone it using Git if available.

2.  Extract the project folder to your local machine.


Step 3: Place the Project in the Web Server Directory

1.  Locate your web server's root directory:

o    For XAMPP: C:\xampp\htdocs

o    For WAMP: C:\wamp\www

2.  Move the extracted project folder to this directory. For example:

C:\xampp\htdocs\my_project


Step 4: Start the Server

1.  Open the control panel of your local server (XAMPP/WAMP).

2.  Start Apache and MySQL services.


Step 5: Configure the Database

1.  Open your browser and go to:

o    For XAMPP: http://localhost/phpmyadmin

o    For WAMP: http://localhost/phpmyadmin

2.  Create a new database:

o    Click on "New" in phpMyAdmin.

o    Enter the database name , which you can found drom you db_connect.php file of your project folder (e.g., eventmanagement) and click "Create."

3.  Import the database:

o    Click on the newly created database.

o    Go to the "Import" tab.

o    Choose the .sql file provided with the project (usually named db.sql or database.sql or your_project_name.sql in your db folder in your project folder).

o    Click "Go" to import.


Step 6: Configure the Project

1.  Open the project folder.

2.  Locate the configuration file for database connection (usually named db.php, db_config.php, or in an /includes directory or in /db durectory).

3.  Update the database credentials:

$host = 'localhost';

$username = 'root';

$password = ''; // Leave blank for local servers

$database = eventmanagement'; // Replace with the name of your database


Step 7: Access the Project

1.  Open your browser and navigate to:

http://localhost/my_project

Replace my_project with the name of your project folder.Here the project name I take eventmanagement.


Step 8: Test the Project

1.  Test all features to ensure they are working correctly.


You're All Set!

Your PHP project should now be running successfully on your local computer.

Here the downloaded project structure :

EventManagement/

├── db/                # Common Includes

   ├── db_connect.php           # Database connection file

├── admin/                   # Admin Panel

   ├── heder.php       

   ├── footer.php       

   ├── sidebar.php    

├── Assets/                 

   ├── css /      

   ├── ├──styles.css  

├── images/       

├── uploads/       

├── about_img.jpg       

├── add_event.php      

├── admin_dashboard.php

├── all_ticket_report.php

├── book_event.php

├── dashboard.html.php       

├── delete_event.php       

├── delete_user.php       

├── edit_event.php       

├── edit_profile.php       

├── edit_user.php     

├── footer.php     

├── header.php     

├── index.php     

├── login_submit.php     

├── login.html

├── logout.php     

├── logout.php     

├── manage_events.php     

├── manage_users.php     

├── namaste_img.jpg

├── profile.php     

├── register_submit.php     

├── register.html     

├── script.js    

├── sidebar.php     

├── styles.css     

├── ticket_details.php     

├── user_dashboard.php     

├── user_events.php     

├── view_detail_event.php     

├── view_event_user.php     

├── view_events.php     

├── view_user.php     



Code In Detail:


Db/db_connect.php

<?php

// Database configuration

define('DB_HOST', 'localhost');       // Database host

define('DB_USER', 'root');   // Database username

define('DB_PASSWORD', ''); // Database password

define('DB_NAME', 'EVENTMANAGEMENT');   // Database name

 

// Connect to MySQL database

$connection = new mysqli(DB_HOST, DB_USER, DB_PASSWORD, DB_NAME);

 

// Check connection

if ($connection->connect_error) {

    die("Connection failed: " . $connection->connect_error);

}

 

//echo "Connected successfully";

 

// Optionally, to close the connection at the end

// $connection->close();

?>

 

 

 

Admin/header.php:

<div class="header">

    <div class="header-container">

        <h1>Welcome, <?php echo $_SESSION['username']; ?></h1>

        <div class="header-right">

            <a href="profile.php">Profile</a>

            <a href="logout.php">Logout</a>

        </div>

    </div>

</div>

 

<style>

    .header {

        padding: 20px;

        background-color: #34495E;

        color: white;

        position: fixed;

        top: 0;

        left: 250px; /* Ensures header starts from the right side of sidebar */

        right: 0; /* Extends header to the right edge */

        z-index: 9999;

        box-sizing: border-box;

    }

    .header-container {

        display: flex;

        justify-content: space-between;

        align-items: center;

        overflow: hidden; /* Prevents accidental overflow */

        width: 100%; /* Ensures container uses full header width */

    }

    .header h1 {

        margin: 0;

        font-size: 24px;

        white-space: nowrap;

    }

    .header-right {

        display: flex;

        align-items: center;

        overflow: hidden; /* Prevents overflow of links */

    }

    .header-right a {

        color: #BDC3C7;

        margin-left: 20px;

        text-decoration: none;

        white-space: nowrap;

    }

    .header-right a:hover {

        color: #fff;

    }

</style>

 

 

 Admin/footer.php:

<div class="footer">

    <p>&copy; <?php echo date("Y"); ?> Event Management System(Admin Panel) . All rights reserved.</p>

</div>

 

<style>

    .footer {

        text-align: center;

        padding: 15px;

        background-color: #2C3E50;

        color: white;

        position: fixed;

        bottom: 0;

        left: 250px; /* Ensures header starts from the right side of sidebar */

 

        width: calc(100% - 250px);

    }

</style>

 

 

 Admin/sidebar.php

<aside class="sidebar">

    <div class="sidebar-header">

        <h2>Admin Dashboard</h2>

    </div>

    <nav class="sidebar-nav">

        <ul>

            <li><a href="admin_dashboard.php" class="sidebar-link">Dashboard</a></li>

            <li><a href="manage_users.php" class="sidebar-link">Manage Users</a></li>

            <li><a href="manage_events.php" class="sidebar-link">Manage Events</a></li> <!-- Link to manage events -->

            <li><a href="add_event.php" class="sidebar-link">Add Event</a></li> <!-- Link to add new event -->

            <li><a href="view_events.php" class="sidebar-link">View Events</a></li><!-- Link to add new event -->

            <li><a href="all_ticket_report.php" class="sidebar-link">Ticket Informations</a></li>

            <li><a href="logout.php" class="sidebar-link">Logout</a></li>

        </ul>

    </nav>

</aside>

 

<style>

    /* Sidebar Style */

    .sidebar {

        width: 250px;

        height: 100%;

        background-color: #2c3e50;

        color: white;

        position: fixed;

        left: 0;

        top: 0;

        padding-top: 20px;

    }

 

    .sidebar-header {

        text-align: center;

        margin-bottom: 30px;

    }

 

    .sidebar-header h2 {

        color: white;

    }

 

    .sidebar-nav ul {

        list-style: none;

        padding: 0;

    }

 

    .sidebar-nav ul li {

        margin: 20px 0;

    }

 

    .sidebar-link {

        color: white;

        text-decoration: none;

        display: block;

        padding: 10px;

        font-size: 18px;

    }

 

    .sidebar-link:hover {

        background-color: #34495e;

        border-radius: 5px;

    }

</style>

 

 

 


Assets/css/styles.css

body {

    font-family: Arial, sans-serif;

    background-color: #f0f0f5;

    display: flex;

    justify-content: center;

    align-items: center;

    height: 100vh;

    margin: 0;

}

 

h1 {

    color: #333;

    text-align: center;

}

 

/* Form container styling */

form {

    background-color: #fff;

    padding: 20px;

    border-radius: 8px;

    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);

    width: 100%;

    max-width: 400px;

    text-align: center;

}

 

input[type="text"], input[type="password"], input[type="tel"] , input[type="email"] ,select {

    width: 100%;

    padding: 10px;

    margin: 10px 0;

    border: 1px solid #ccc;

    border-radius: 4px;

    box-sizing: border-box;

}

 

button {

    background-color: #4CAF50;

    color: white;

    padding: 10px 20px;

    border: none;

    border-radius: 4px;

    cursor: pointer;

    font-size: 1em;

    margin-top: 10px;

}

 

button:hover {

    background-color: #45a049;

}

 

 register.html

<!DOCTYPE html>

<html lang="en">

<head>

    <meta charset="UTF-8">

    <meta name="viewport" content="width=device-width, initial-scale=1.0">

    <title>Register</title>

    <link rel="stylesheet" href="Assets/css/styles.css">

</head>

<body>

    <h1>Register</h1>

    <form id="registerForm" action="register_submit.php" method="POST">

        <!-- Role selection as a dropdown -->

        <select name="role" id="role" required>

            <option value="">Select Role</option>

            <option value="Admin">Admin</option>

            <option value="User">User</option>

            <option value="Guest">Guest</option>

        </select>

 

        <input type="text" name="name" placeholder="Name" required>

        <input type="email" name="email" placeholder="Email ID" required>

        <input type="text" name="username" placeholder="Username" required>

        <input type="tel" name="phone" placeholder="Phone Number" required>

        <input type="password" name="password" placeholder="Password" required>

        <input type="password" name="confirm_password" placeholder="Confirm Password" required>

        <button type="submit">Register</button>

    </form>

</body>

</html>

 

 

 

<?php

// Include database connection

include 'db/db_connect.php';

 

// Check if form data is submitted

if ($_SERVER["REQUEST_METHOD"] == "POST") {

    // Retrieve and sanitize form data

    $role = mysqli_real_escape_string($connection, $_POST['role']);

    $name = mysqli_real_escape_string($connection, $_POST['name']);

    $email = mysqli_real_escape_string($connection, $_POST['email']);

    $username = mysqli_real_escape_string($connection, $_POST['username']);

    $phone = mysqli_real_escape_string($connection, $_POST['phone']);

    $password = mysqli_real_escape_string($connection, $_POST['password']);

    $confirmPassword = mysqli_real_escape_string($connection, $_POST['confirm_password']);

 

    // Check if password and confirm password match

    if ($password !== $confirmPassword) {

        die("Error: Passwords do not match.");

    }

 

    // Hash the password for security

    $hashedPassword = password_hash($password, PASSWORD_BCRYPT);

 

    // SQL query to insert user into the USER table

    $sql = "INSERT INTO USER (role, name, email, username, phone, password)

            VALUES ('$role', '$name', '$email', '$username', '$phone', '$hashedPassword')";

 

    // Execute the query and check if it was successful

    if (mysqli_query($connection, $sql)) {

        echo "Registration successful!";

    } else {

        echo "Error: " . mysqli_error($connection);

    }

 

    // Close the database connection

    mysqli_close($connection);

} else {

    // Redirect to the registration form if not accessed via POST

    header("Location: register.html");

    exit();

}

?>

 

 

 login.html

<!DOCTYPE html>

<html lang="en">

<head>

    <meta charset="UTF-8">

    <meta name="viewport" content="width=device-width, initial-scale=1.0">

    <title>Login</title>

    <style>

        /* General styling */

        body {

            font-family: Arial, sans-serif;

            background-color: #f0f0f5;

            display: flex;

            justify-content: center;

            align-items: center;

            height: 100vh;

            margin: 0;

        }

 

        h1 {

            color: #333;

            text-align: center;

        }

 

        /* Form container styling */

        form {

            background-color: #fff;

            padding: 20px;

            border-radius: 8px;

            box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);

            width: 100%;

            max-width: 400px;

            text-align: center;

        }

 

        input[type="text"], input[type="password"] {

            width: 100%;

            padding: 10px;

            margin: 10px 0;

            border: 1px solid #ccc;

            border-radius: 4px;

            box-sizing: border-box;

        }

 

        input[type="checkbox"] {

            margin-right: 5px;

        }

 

        label {

            font-size: 0.9em;

            color: #555;

        }

 

        button {

            background-color: #4CAF50;

            color: white;

            padding: 10px 20px;

            border: none;

            border-radius: 4px;

            cursor: pointer;

            font-size: 1em;

            margin-top: 10px;

        }

 

        button:hover {

            background-color: #45a049;

        }

    </style>

</head>

<body>

    <h1>Login</h1>

    <form id="loginForm" action="login_submit.php" method="POST">

        <input type="text" name="username" placeholder="Username" required>

        <input type="password" name="password" placeholder="Password" required>

        <label>

            <input type="checkbox" name="remember" value="yes"> Remember Me

        </label>

        <button type="submit">Login</button>

    </form>

</body>

</html>

 

 

 login_submit.html

<?php

// Start output buffering and session

ob_start();

session_start();

 

// Include the database connection file

require_once 'db/db_connect.php';

 

if ($_SERVER["REQUEST_METHOD"] == "POST") {

    // Escape special characters to prevent SQL injection

    $username = mysqli_real_escape_string($connection, $_POST['username']);

    $password = $_POST['password'];

   

    // Query to check if the user exists

    $query = "SELECT * FROM USER WHERE username = '$username' LIMIT 1";

    $result = mysqli_query($connection, $query);

   

    if ($result && mysqli_num_rows($result) > 0) {

        $user = mysqli_fetch_assoc($result);

       

        // Verify the password

        if (password_verify($password, $user['password'])) {

            // Successful login: set session variables

            $_SESSION['user_id'] = $user['id'];

            $_SESSION['username'] = $user['username'];

            $_SESSION['role'] = $user['role'];

           

            // Redirect based on user role

            if ($user['role'] === 'Admin') {

                header("Location: admin_dashboard.php");

                exit();

            } else if ($user['role'] === 'User') {

                header("Location: user_dashboard.php");

                exit();

            } else {

                echo "Invalid role specified.";

            }

        } else {

            // Invalid password

            echo "Invalid username or password.";

        }

    } else {

        // Username not found

        echo "Invalid username or password.";

    }

 

    // Free the result set

    mysqli_free_result($result);

} else {

    echo "Invalid request.";

}

 

// Close the database connection

mysqli_close($connection);

ob_end_flush();

?>

 

 

 admin_dashboard.php

<?php

session_start();

 

// Redirect to login page if user is not logged in or not an admin

if (!isset($_SESSION['user_id']) || $_SESSION['role'] !== 'Admin') {

    header("Location: login.html");

    exit();

}

?>

 

<!DOCTYPE html>

<html lang="en">

<head>

    <meta charset="UTF-8">

    <meta name="viewport" content="width=device-width, initial-scale=1.0">

    <title>Admin Dashboard</title>

</head>

<body>

    <!-- Include Sidebar -->

    <?php include 'Admin/sidebar.php'; ?>

 

    <!-- Main Content Area -->

    <div class="main-content">

        <!-- Include Header -->

        <?php include 'Admin/header.php'; ?>

 

        <div class="content">

            <h2>Admin Dashboard</h2>

            <p>Welcome to the admin panel, <?php echo $_SESSION['username']; ?>! Here you can manage users, products, and view site statistics.</p>

            <!-- Example Content -->

            <div class="stats">

                <div class="stat-box">

                    <h3>Total Users</h3>

                    <p>100</p>

                </div>

                <div class="stat-box">

                    <h3>Total Events</h3>

                    <p>50</p>

                </div>

            </div>

        </div>

 

        <!-- Include Footer -->

        <?php include 'Admin/footer.php'; ?>

    </div>

 

    <style>

        .main-content {

            margin-left: 250px;

            padding: 20px;

            margin-top: 80px; /* To account for the fixed header */

            box-sizing: border-box;

        }

 

        .content {

            background-color: #ECF0F1;

            padding: 20px;

            border-radius: 8px;

            box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);

        }

 

        .stats {

            display: flex;

            justify-content: space-around;

            margin-top: 30px;

        }

 

        .stat-box {

            background-color: #3498DB;

            padding: 20px;

            color: white;

            border-radius: 8px;

            width: 200px;

            text-align: center;

        }

 

        .stat-box h3 {

            margin: 0;

            font-size: 18px;

        }

 

        .stat-box p {

            font-size: 24px;

            margin-top: 10px;

        }

    </style>

</body>

</html>

 

 

 user_dashboard.php

 

<?php

session_start();

 

// Redirect to login page if not logged in or not a 'User'

if (!isset($_SESSION['user_id']) || $_SESSION['role'] !== 'User') {

    header("Location: login.html");

    exit();

}

?>

 

<!DOCTYPE html>

<html lang="en">

<head>

    <meta charset="UTF-8">

    <meta name="viewport" content="width=device-width, initial-scale=1.0">

    <title>User Dashboard</title>

    <link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/all.min.css" rel="stylesheet">

    <link href="https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&display=swap" rel="stylesheet">

    <style>

        /* Reset and font */

        * { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Roboto', sans-serif; }

       

        body {

            background-color: #f4f6f9;

            display: flex;

            flex-direction: column;

            min-height: 100vh;

            overflow-x: hidden;

        }

 

        /* Sidebar */

        .sidebar {

            width: 250px;

            height: 100vh;

            position: fixed;

            top: 0;

            left: 0;

            background-color: #333;

            color: #fff;

            padding-top: 20px;

            box-shadow: 2px 0 5px rgba(0, 0, 0, 0.1);

        }

        .sidebar h2 { text-align: center; color: #4CAF50; margin-bottom: 1rem; }

        .sidebar ul { list-style-type: none; }

        .sidebar ul li { padding: 15px; }

        .sidebar ul li a {

            color: #ddd;

            text-decoration: none;

            display: block;

            font-size: 1.1rem;

            transition: all 0.3s ease;

        }

        .sidebar ul li a:hover { background-color: #4CAF50; color: #fff; }

        .sidebar ul li a i { margin-right: 10px; }

 

        /* Header */

        .header {

            background-color: #4CAF50;

            color: #fff;

            padding: 15px;

            text-align: center;

            font-size: 1.5rem;

            font-weight: 500;

            margin-left: 250px;

        }

 

        /* Main content */

        .main-content {

            margin-left: 250px;

            padding: 20px;

            min-height: 100vh;

            transition: all 0.3s ease;

        }

 

        /* Dashboard content */

        .content {

            background-color: #fff;

            padding: 20px;

            border-radius: 8px;

            box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);

            margin-bottom: 20px;

        }

        .content h2 { color: #333; margin-bottom: 15px; }

        .content p { font-size: 1.1rem; color: #666; line-height: 1.6; }

 

        /* Carousel */

        .carousel-container img {

            width: 100%;  /* Adjust width based on your preference */

            max-width: 250px; /* Ensure images aren’t too large */

            border-radius: 8px;

            box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);

        }

        .carousel-slide img {

            width: 100%;

            transition: transform 0.5s ease-in-out;

        }

       

        /* Events section */

        .events-list {

            margin-top: 20px;

        }

        .events-list h3 {

            color: #4CAF50;

            font-size: 1.4rem;

            margin-bottom: 10px;

        }

        .event-item {

            background-color: #f9f9f9;

            padding: 15px;

            margin-bottom: 10px;

            border-radius: 8px;

            border-left: 4px solid #4CAF50;

        }

        .event-item p {

            font-size: 1rem;

            color: #555;

        }

 

        /* Footer */

        .footer {

            text-align: center;

            padding: 10px;

            background-color: #333;

            color: #fff;

            margin-top: auto;

            font-size: 0.9rem;

            margin-left: 250px;

        }

    </style>

</head>

<body>

    <!-- Sidebar -->

    <div class="sidebar">

        <?php include('sidebar.php'); ?>

    </div>

 

    <!-- Header -->

    <div class="header">

        Welcome, <?php echo $_SESSION['username']; ?>

    </div>

 

    <!-- Main content -->

    <div class="main-content">

        <!-- Carousel section -->

 

        <?php

include('db/db_connect.php');

$sql = "SELECT event_image FROM events where book_status='Available'   "; // Replace 'events' with your table name

        $result = $connection->query($sql);

       

        $images = [];

        if ($result->num_rows > 0) {

            while ($row = $result->fetch_assoc()) {

                $images[] = $row['event_image']; // Add each image path to the images array

            }

        }

       

       

        ?>

 

        <!-- Dashboard information section -->

        <div class="content">

            <h2>Dashboard Overview</h2>

            <p>Welcome to your dashboard, <?php echo $_SESSION['username']; ?>! Here you can view your booked events, manage settings, and much more.</p>

        </div>

 

        <!-- Booked Events Section -->

        <div class="content events-list">

            <h3>Your Booked Events</h3>

            <div class="event-item">

                <p><strong>Event Name:</strong> Music Concert</p>

                <p><strong>Date:</strong> 15th December 2024</p>

                <p><strong>Location:</strong> Grand Arena</p>

            </div>

            <div class="event-item">

                <p><strong>Event Name:</strong> Art Exhibition</p>

                <p><strong>Date:</strong> 20th December 2024</p>

                <p><strong>Location:</strong> Downtown Gallery</p>

            </div>

            <!-- Additional booked events can be added here -->

        </div>

    </div>

 

    <!-- Footer -->

    <div class="footer">

        &copy; <?php echo date("Y"); ?> Your Company Name. All rights reserved.

    </div>

 

    <script>

        // Carousel effect

        const carouselSlide = document.querySelector('.carousel-slide');

        const images = document.querySelectorAll('.carousel-slide img');

 

        let counter = 0;

        setInterval(() => {

            counter = (counter + 1) % images.length;

            carouselSlide.style.transform = `translateX(-${counter * 100}%)`;

        }, 3000); // Change every 3 seconds

    </script>

</body>

</html>

 

 

 

  

 


Post a Comment

0Comments

Post a Comment (0)