0% found this document useful (0 votes)
5 views

Document (3)

The document provides the complete source code for a Workshop & Event Management System that includes user registration, payment integration, and email notifications using HTML, CSS, JavaScript, PHP, and MySQL. It outlines the project structure, frontend design, backend logic, and database setup. Additionally, it includes instructions for deployment and configuration of the system.

Uploaded by

adityanaik47147
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views

Document (3)

The document provides the complete source code for a Workshop & Event Management System that includes user registration, payment integration, and email notifications using HTML, CSS, JavaScript, PHP, and MySQL. It outlines the project structure, frontend design, backend logic, and database setup. Additionally, it includes instructions for deployment and configuration of the system.

Uploaded by

adityanaik47147
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 10

Here’s the complete source code for the Workshop & Event Management

System with payment integration using HTML, CSS, JavaScript, PHP, and
MySQL. This includes user registration, payment gateway integration, and
email notification.

🌿 1. Project Structure

WorkshopEventSystem/

├── css/ # CSS for styling

├── js/ # JavaScript for dynamic actions

├── php/ # PHP backend logic

├── db/ # Database script

├── index.html # Main UI

└── config.php # Database connection

🌐 2. Frontend: HTML, CSS, JS (PhonePe-Like UI)

Index.html (Homepage)

<!DOCTYPE html>

<html lang=”en”>

<head>

<meta charset=”UTF-8”>

<title>Workshop & Event Management</title>


<link rel=”stylesheet” href=”css/style.css”>

</head>

<body>

<div class=”container”>

<h1>Welcome to the Workshop & Event Portal</h1>

<div class=”event-card”>

<h2>React Workshop</h2>

<p>Date: March 10, 2025</p>

<p>Fee: ₹500</p>

<button onclick=”registerEvent()”>Register Now</button>

</div>

</div>

<script src=”js/script.js”></script>

</body>

</html>

Css/style.css (PhonePe-Style UI)

Body {

Font-family: Arial, sans-serif;

Background-color: #f0f0f0;

Margin: 0;

Padding: 0;

Color: #333;
Text-align: center;

.container {

Margin: 50px auto;

Width: 80%;

Max-width: 600px;

Background-color: #fff;

Padding: 20px;

Box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.1);

H1 {

Color: #4a90e2;

.event-card {

Background-color: #e3f2fd;

Padding: 15px;

Border-radius: 10px;

Margin-top: 20px;

Button {

Background-color: #007bff;

Color: white;

Border: none;
Padding: 10px 20px;

Cursor: pointer;

Border-radius: 5px;

Button:hover {

Background-color: #0056b3;

Js/script.js (Dynamic Actions)

Function registerEvent() {

Let name = prompt(“Enter your name:”);

Let email = prompt(“Enter your email:”);

If (name && email) {

Fetch(‘php/register.php’, {

Method: ‘POST’,

Headers: { ‘Content-Type’: ‘application/json’ },

Body: JSON.stringify({ name: name, email: email, event: “React


Workshop”, fee: 500 })

})

.then(response => response.json())

.then(data => {

Alert(data.message);
If (data.success) {

Window.location.href = “php/payment.php?amount=500”;

})

.catch(error => alert(“Error: “ + error));

} else {

Alert(“Please enter valid details.”);

⚙️3. Backend: PHP (User Registration & Payment)

Config.php (Database Connection)

<?php

$host = “localhost”;

$user = “root”;

$password = “”;

$db = “workshop_db”;

$conn = new mysqli($host, $user, $password, $db);

If ($conn->connect_error) {

Die(“Connection failed: “ . $conn->connect_error);

}
?>

Php/register.php (User Registration)

<?php

Header(“Content-Type: application/json”);

Include ‘../config.php’;

$data = json_decode(file_get_contents(“php://input”), true);

$name = $data[‘name’];

$email = $data[‘email’];

$event = $data[‘event’];

$fee = $data[‘fee’];

If ($name && $email) {

$sql = “INSERT INTO registrations (name, email, event, fee) VALUES


(‘$name’, ‘$email’, ‘$event’, ‘$fee’)”;

If ($conn->query($sql) === TRUE) {

Echo json_encode([“success” => true, “message” => “Registration


successful. Proceed to payment.”]);

} else {

Echo json_encode([“success” => false, “message” => “Error: “ . $conn-


>error]);

} else {

Echo json_encode([“success” => false, “message” => “Invalid input.”]);


}

?>

Php/payment.php (Razorpay Integration)

<?php

$amount = $_GET[‘amount’];

?>

<!DOCTYPE html>

<html>

<head>

<title>Payment Gateway</title>

</head>

<body>

<h1>Complete Your Payment of ₹<?php echo $amount; ?></h1>

<form action=”success.php” method=”post”>

<script src=https://checkout.razorpay.com/v1/checkout.js

Data-key=”YOUR_RAZORPAY_KEY”

Data-amount=”<?php echo $amount * 100; ?>”

Data-currency=”INR”

Data-name=”Workshop Event”

Data-description=”React Workshop”

Data-prefill.name=”Aditya”

[email protected]
Data-theme.color=”#007bff”>

</script>

</form>

</body>

</html>

Php/success.php (Payment Success)

<?php

Echo “<h1>Payment Successful!</h1>”;

Echo “<p>Thank you for registering for the workshop.</p>”;

?>

📦 4. Database: MySQL Setup

Db/workshop_db.sql

CREATE DATABASE workshop_db;

USE workshop_db;

CREATE TABLE registrations (

Id INT AUTO_INCREMENT PRIMARY KEY,

Name VARCHAR(100),
Email VARCHAR(100),

Event VARCHAR(100),

Fee INT,

Payment_status VARCHAR(20) DEFAULT ‘Pending’,

Created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP

);

☁️5. Deployment & Configuration

1. Local Server: Use XAMPP or WAMP.

2. Database: Import workshop_db.sql into MySQL.

3. Payment Gateway: Replace YOUR_RAZORPAY_KEY with your Razorpay


API key.

4. Email Setup: Configure PHP Mailer or SMTP for notifications.


Do you want me to provide the complete project as a downloadable ZIP file?

You might also like