0% found this document useful (0 votes)
12 views83 pages

Event Management System Overview

The Event Management System (EMS) is a web-based platform that automates and streamlines the event planning process for administrators, event managers, and clients, addressing inefficiencies of traditional methods. It features role-based access, real-time updates, and integrated functionalities for managing event requests, proposals, and payments, enhancing collaboration and transparency. The system is designed with specific hardware and software requirements, and employs a waterfall model for development, ensuring a structured approach to project management.

Uploaded by

ashupandasonu
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views83 pages

Event Management System Overview

The Event Management System (EMS) is a web-based platform that automates and streamlines the event planning process for administrators, event managers, and clients, addressing inefficiencies of traditional methods. It features role-based access, real-time updates, and integrated functionalities for managing event requests, proposals, and payments, enhancing collaboration and transparency. The system is designed with specific hardware and software requirements, and employs a waterfall model for development, ensuring a structured approach to project management.

Uploaded by

ashupandasonu
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

1.

INTRODUCTION

Event Management System (EMS) is a web-based platform designed to streamline and


automate the process of planning, requesting, managing, and finalizing events involving
multiple stakeholders such as administrators, event managers, and clients. This system
facilitates the entire lifecycle of event management—from event requests and proposals
to client approvals and payments—through a unified digital interface.
The traditional method of managing events is often paper-based and manually
coordinated, which leads to inefficiencies, data loss, and miscommunication. EMS
addresses these challenges by offering a robust, scalable, and user-friendly solution that
ensures transparency, accountability, and real-time updates across all parties involved.
The platform supports multiple user roles with customized access and functionalities:
 Admins can manage users, oversee events, forward event requests to managers,
and finalize decisions.
 Event Managers receive and handle forwarded events, submit proposals, and
collaborate with clients.
 Clients can submit event requests, view proposals, and respond with approvals
or feedback.
By automating workflows and integrating modules for registration, role-based
dashboards, event scheduling, proposal handling, and secure payment processing, EMS
significantly reduces administrative burdens and improves coordination among all
stakeholders.

1.1 Goals & Objective


The primary objective of the Event Management System (EMS) is to create a
centralized, digital platform that simplifies and enhances the planning and execution of
events through seamless collaboration between admins, event managers, and clients. The
system is designed to automate routine tasks, minimize manual effort, and provide a
transparent and efficient event lifecycle management experience.
Goals:
 To offer a structured platform for managing various types of events effectively.
 To enable clients to easily submit and track event requests.
 To allow event managers to handle forwarded requests and submit detailed
proposals.
 To empower administrators with tools to supervise event workflows, assign
tasks, and finalize approvals.
 To support real-time communication and feedback between clients, managers,
and admins.
 To integrate secure payment handling and proposal management.
 To provide role-based dashboards for personalized user experiences.
Objectives:
 Enable online registration for clients and event managers.
 Provide admins with the ability to approve/reject and forward event requests.
 Allow event managers to view forwarded events, submit proposals, and track
statuses.
 Permit clients to respond to proposals and complete payments.
 Maintain event history and transaction logs for transparency.
 Ensure data integrity, role-based access control, and system-wide security.

1.2 Hardware and Software Configuration


HARDWARE DESCRIPTION
The selection of appropriate hardware ensures smooth functioning of the application and
proper handling of user interactions, especially when managing multiple requests
simultaneously.
Minimum Hardware Requirements:
 Processor: Intel Pentium 4 or equivalent
 RAM: 1 GB
 Hard Disk Drive: 40 GB
 Display: 800x600 resolution, 256 colors
Recommended System Configuration (for development/deployment):
 Processor: Intel i3 or higher
 RAM: 8 GB
 Hard Disk Drive: 500 GB
 Keyboard: Standard 101/102 keys
 Monitor: 1024x768 display panel
 Display Adapter: Super VGA
 Network Adapter: Ethernet card
 Mouse: Optical or laser mouse
SOFTWARE DESCRIPTION
OCMS is built using reliable, open-source technologies that ensure stability, scalability,
and ease of maintenance.
 Operating System: Windows 10 / Ubuntu 20.04
 Frontend: HTML, CSS, JavaScript
 Backend: Python (Django Framework)
 Database: MySQL
 Web Server: Apache / Nginx (optional)
 Browser Compatibility: Google Chrome, Mozilla Firefox, Microsoft Edge

KEYWORDS:
 Event Request – A submission by a client to organize a new event.
 Forwarding – The process of sending an event request to a suitable event
manager.
 Proposal – A detailed plan with budget and resources prepared by event
managers for client approval.
 Client – A registered user who submits requests and reviews proposals.
 Admin – The system administrator who oversees operations, user management,
and final approvals.
 Event Manager – A user responsible for managing and executing events based
on forwarded requests.
 Finalized Event – An event that has been confirmed and approved for execution.
 Payment – The client’s financial contribution toward the event proposal.
 Dashboard – A role-specific user interface showing relevant actions and event
information.
[Link] ANALYSIS
2.1 IDENTIFICATION OF NEED
This project aims to create an Online Event Management System (EMS) portal for a
campus or organization. The portal allows registered users (Admins, Event Managers,
and Clients) to interact through a centralized system to manage event requests, planning,
proposals, and finalization activities efficiently.
Users can register themselves as Clients (who submit event requests), Event Managers
(who handle event execution), or Admins (who oversee and manage the entire process).
When a person registers as an Event Manager, an approval mechanism is triggered,
which sends a notification to the Administrator for verification. The admin has access to
an approval page to review and authorize event managers to ensure authenticity and
proper role assignment.
Once logged in, users are provided with role-specific dashboards:
 Clients can submit new event requests, view the status of their requests, and
respond to proposals.
 Event Managers can view assigned event requests, submit event proposals, and
manage planning tasks.
 Admins can forward event requests to managers, review proposals, finalize
events, and manage system data.
Each event request includes details such as event type, description, date range, client
budget, and status. The admin coordinates between Clients and Event Managers to
ensure events are planned, proposed, and executed efficiently. Every proposal, approval,
and payment is timestamped and tracked throughout its lifecycle.

Key Features:
 Secure login system with role-based access control.
 Event request module where Clients can describe and request event services.
 Proposal submission module for Event Managers to respond to forwarded
requests.
 Admin dashboard to oversee system-wide activities and manage roles.
 Status tracking so all users can monitor the progress of their events.
 Document and media upload functionality for proposals and planning.
 Approval system for Event Manager registration to ensure quality and security.
 Notifications (email/SMS) to keep users informed of key actions and updates.

Benefits of EMS Over Manual Process:


 Improved efficiency and accuracy through automated workflows and digital
records.
 Eliminates risks like communication gaps, scheduling conflicts, and misplaced
documents.
 Saves time and operational costs by reducing the need for physical coordination.
 Real-time dashboards give each user a clear overview of their responsibilities
and updates.
 Accessible from any location, allowing remote management and event planning.
 Centralized system supports record keeping, future reference, and auditing.
 Feedback and communication tools (optional) can enhance collaboration and
user experience.
In a manual system, managing events from request to execution involves disjointed
communication, paperwork, and human dependency. EMS solves these challenges by
digitizing all key processes, providing a streamlined, secure, and scalable solution for
event management in both institutional and commercial settings.
Whether it’s for organizing campus fests, conferences, or corporate events, EMS can be
tailored to suit different organizational needs, delivering a professional and organized
approach to event planning.

2.2 PRELIMINARY INVESTIGATION


The purpose of the preliminary investigation is to evaluate project requests. It is not
design study, nor dose it include the collection of details to completely describe the
business system. Rather, it is the collection of information that permits committee
members to evaluate the merits of the project request and make an informed judgment
about the feasibility of the proposed project.
The data we found during the preliminary investigation through

Reviewing the official work .


Conversation with the forest department personnel.

The out comes are as follows: -


The need for better, smooth and secure structured official work flow.
The system should be newly developed.
The system development cost will be considerable high but benefit will make the forest
department so enable the handle the crimes in a very convenient manner.
2.3 FEASIBILTY STUDY
A feasibility analysis usually involves a through assessment of the operational(need),
financial and technical aspects of a proposal. Feasibility study is the test of the system
proposal made to identify whether the user needs may be satisfied using the current
software and hardware technologies, whether the system will be cost effective from a
business point of view and whether it can be developed with the given budgetary
constraints. A feasibility study should be relatively cheap and done at the earliest
possible time. Depending on the study, the decision is made whether to go ahead with a
more detailed analysis.

When a new project is proposed, it normally goes through feasibility assessment.


Feasibility study is carried out to determine whether the proposed system is possible to
develop with available resources and what should be the cost consideration. Facts
considered in the feasibility analysis were.

•Technical Feasibility
•Economic Feasibility
•Behavioral Feasibility
Technical Feasibility
Technical Feasibility deals with the hardware as well as software requirements.
Technology is not a constraint to type system development. We have to find out whether
the necessary technology, the proposed equipments have the capacity to hold the data,
which is used in the project, should be checked to carryout this technical feasibility.
The technical feasibility issues usually raised during the feasibility stage of investigation
includes these
• This software is running in windows 2000 Operating System, which can
be easily
installed.
• The hardware required is Pentium based server.
• The system can be expanded.

Economical Feasibility
This feasibility study present tangible and intangible benefits from the prefect by
comparing the development and operational cost. The technique of cost benefit analysis
is often used as a basis for assessing economic feasibility. This system needs some more
initial investment than the existing system, but it can be justifiable that it will improve
quality of service.

Thus feasibility study should center along the following points:


Improvement resulting over the existing method in terms of accuracy, timeliness.
Cost comparison
Estimate on the life expectancy of the hardware Overall objective
Our project is economically feasible. It does not require much cost to be involved in the
overall process. The overall objectives are in easing out the requirement processes.

Behavioral/ Operational Feasibility

This analysis involves how it will work when it is installed and the assessment of
political and managerial environment in which it is implemented. People are inherently
resistant to change and computers have been known to facilitate change. The new
proposed system is very much useful to the useful to the users and there for it will accept
broad audience from around the world.

2.4 SOFTWARE REQUIREMENT SPECIFICATION

SINO REQUIREMENTS DESCRIPTION REMARKS


TYPE OF
THE
REQUIREMENTS
1 Essential The system should have Role-based Login
a login for Admins, page should validate
Clients, and Event credentials and
Managers. roles.
2 Essential Users should see a role-
specific dashboard upon Clients, Event
login. Managers, and
Admins see different
dashboards.
3 Essential Clients should be able Request form must
to request events with include validation.
fields like title,
description, budget,
dates.
4 Essential Admins should be able Forwarding form
to forward event with manager
requests to Event dropdown.
Managers.
5 Essential Event Managers should Proposals are linked
be able to submit to forwarded events.
proposals (text, image,
document, required
payment).
6 Essential Clients should be able Client response is
to respond to proposals tracked with
(Accept or Reject). payment status
7 Essential Admins should be able Finalized events
to finalize accepted should be
proposals. timestamped.
8 Essential Logistics of status Events pass through
tracking should be various statuses:
visible for each request. Pending, Forwarded,
Proposal Sent,
Finalized, etc.
9 Essential Event Managers require Verification step to
approval by Admin ensure authenticity.
upon registration.
10 Essential Admin panel to manage Admin access
users (create, edit, control and logs.
delete), events, and
proposals.
11 Desirable Notification system via Alerts for proposal
email/SMS for updates submissions,
on events. approvals,
rejections, and
payments.

12 Essential File upload module Support for file types like


for proposals PDF, DOCX, JPEG,
(images/docs). PNG.

13 Desirable Feedback/comments Can be optional or added


module for post-event later.
reviews.
14 Essential Password Available under profile
change/reset feature settings.
for all users.

15 Desirable Dashboard analytics Visual display of system


for Admin (event usage and data.
stats, user activities).

2.5SoftwareEngineering Paradigm
Waterfall Model
This is the most common and classic of life cycle models, also referred to as a linear-
sequential life cycle model. It is very simple to understand and use. In a waterfall
model, each phase must be completed in its entirety before the next phase can begin. At
the end of each phase, a review takes place to determine if the project is on the right path
and whether or not to continue or discard the project. Unlike what I mentioned in the
general model, phases do not overlap in a waterfall model.
2.6 E-R diagram
Entity relationship diagramming is a technique that is widely used in the world of business and
information technology to show how information is, or should be, stored and used within a
business system.

There are 3 basic elements in ER diagrams:

Entities are the things about which we seek the [Link] are the
things of the real world which have some physical existence.

Attributes are the data we collect about the entities.

Relationships between the different entities.

Symbols used for E-R diagram:


0. To show the relationship between various entities.

[Link] show various attributes.

[Link] show weak entities.

[Link] show multiple valued attributes.


ER Diagram
2.7 DATAFLOW DIAGRAM

user info
Send request
Event Management
system
Manage events
0.0
Admin
CLIENT

View proposal

create proposal

Event
manager
n
atio
s valid Admin_profile
ck
Che
Add new user
User_profile
ADMIN

Login
Process

Ad d
even
t Manage event

forwa
rd ev
e nt

Forward event event


Information

forward_event
il
eventmanager
deta
Event manager Login
info

LOGIN
PROCESS

eventproposal
create

Event
info
ail
r det client
ome
Cust
client Login
info

LOGIN
PROCESS

view
eventproposal

Event
info

clientresponse
2.8 USE CASE DIAGRAM

Use Case for Admin


Actor: Admin
Description: The Admin manages all users and system operations, oversees event
lifecycles, and finalizes decisions.
Use Cases:
 Login to system
 Approve Event Manager registrations
 View all users (Clients, Event Managers)
 View all event requests and forwarded events
 Forward event requests to Event Managers
 Review and finalize proposals
 Generate event reports and summaries
 Manage user feedback
 Update profile
 Change password
Use Case for Client
Actor: Client
Description: Clients use the platform to submit event requests and respond to proposals.
Use Cases:
 Register/Login
 Update profile
 Submit event request (title, description, budget, dates)
 View proposal(s) from Event Managers
 Accept/Reject proposal
 Make payment for accepted proposal
 View event status and history
 Provide feedback after the event
 Change password
Use Case for Event Manager
Actor: Event Manager
Description: Event Managers are responsible for handling forwarded events and
submitting proposals.
Use Cases:
 Login (after admin approval)
 View assigned/forwarded event requests
 Submit proposal (text, documents, budget)
 View client responses to proposals
 Update proposal if needed
 View event assignment history
 Update profile
 Change password

3. SYSTEM DESIGN

3.1 MODULAR INTERACTION


The Event Management System (EMS) is structured into four primary modules based
on user roles. Each module interacts with a centralized database and is designed with
role-based access control, ensuring each user accesses only the features relevant to their
role.

1. ADMINISTRATOR MODULE
Purpose: Admins manage user roles, oversee event flow, and finalize events.
Sub-Modules:
 Login/Logout – Secure authentication for Admins
 User Management – Approve and manage Clients and Event Managers
 Event Management – View all event requests, forward requests, and track
progress
 Proposal Review – View proposals submitted by Event Managers
 Finalization – Approve proposals and mark events as finalized
 Report Generation – View event statistics and generate reports
 Feedback Review – Read feedback from clients
 Profile Update – Modify admin details
 Change Password – Update admin credentials securely

2. CLIENT MODULE
Purpose: Clients submit event requests and respond to proposals.
Sub-Modules:
 Register/Login – User registration and secure login
 Event Request Form – Submit event details (title, description, budget, date
range)
 Proposal View – Review proposals from Event Managers
 Response & Payment – Accept/reject proposal and proceed to payment
 Status Tracker – View the current state of the event
 Event History – Access previously requested events and their statuses
 Feedback Submission – Rate and review the event after completion
 Profile Update – Update personal details
 Change Password – Credential management

3. EVENT MANAGER MODULE


Purpose: Event Managers handle event planning, proposal creation, and
communication.
Sub-Modules:
 Login – Access granted after admin approval
 View Forwarded Events – List of assigned events to manage
 Submit Proposal – Add proposal text, upload documents/images, and include
estimated budget
 View Client Response – Know whether a proposal has been accepted or rejected
 Update Proposal – Modify proposal if not yet finalized
 Assignment History – Track all events managed in the past
 Profile Update – Edit manager details
 Change Password – Update login credentials
4. SYSTEM INTERACTION OVERVIEW
 All users (Clients, Event Managers, Admins) interact through a centralized EMS
database.
 Clients initiate event requests, and Admins manage and forward them to Event
Managers.
 Event Managers handle proposals, and Clients respond with acceptance and
payments.
 Admins finalize events, monitor flow, and oversee user interactions.
 Every module communicates using role-based authentication and structured
workflows.

5. SYSTEM INTERACTION OVERVIEW


 All modules interact with a centralized EMS database.
 Clients create event requests which are managed by Admins and fulfilled by
Event Managers.
 Admins act as the bridge between Clients and Managers, ensuring smooth
planning and execution.
 Each module has controlled access, ensuring data privacy, security, and
modularity.

3.2DATABASE FESIGN:

mysql> use event_db;


Database changed
mysql> show tables;
+---------------------------------------+
| Tables_in_event_db |
+---------------------------------------+
| auth_group |
| auth_group_permissions |
| auth_permission |
| auth_user |
| auth_user_groups |
| auth_user_user_permissions |
| django_admin_log |
| django_content_type |
| django_migrations |
| django_session |
| eventapp_blog |
| eventapp_client |
| eventapp_clientresponse |
| eventapp_comment |
| eventapp_dashboardimage |
| eventapp_event |
| eventapp_eventmanager |
| eventapp_eventmanager_assigned_events |
| eventapp_eventproposal |
| eventapp_eventrequest |
| eventapp_finalizedevent |
| eventapp_forwardedevent |
| eventapp_galleryimage |
| eventapp_payment |
| eventapp_role |
| eventapp_userprofile |
+---------------------------------------+
26 rows in set (0.01 sec)

mysql>desceventapp_userprofile;
+---------+-------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+---------+-------------+------+-----+---------+----------------+
| id | bigint | NO | PRI | NULL | auto_increment |
| role_id | bigint | NO | MUL | NULL | |
| user_id | int | NO | UNI | NULL | |
| address | longtext | YES | | NULL | |
| contact | varchar(15) | YES | | NULL | |
+---------+-------------+------+-----+---------+----------------+
5 rows in set (0.03 sec)

mysql>desceventapp_role;
+-------+-------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+-------+-------------+------+-----+---------+----------------+
| id | bigint | NO | PRI | NULL | auto_increment |
| role |varchar(20) | NO | UNI | NULL | |
+-------+-------------+------+-----+---------+----------------+
2 rows in set (0.00 sec)

mysql>desceventapp_payment;
+----------------+---------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+----------------+---------------+------+-----+---------+----------------+
| id | bigint | NO | PRI | NULL | auto_increment |
| amount | decimal(10,2) | NO | | NULL | |
| status | varchar(20) | NO | | NULL | |
| transaction_id | varchar(100) | NO | UNI | NULL | |
| client_id | int | NO | MUL | NULL | |
| event_id | bigint | NO | MUL | NULL | |
+----------------+---------------+------+-----+---------+----------------+
6 rows in set (0.00 sec)

mysql>desceventapp_eventproposal;
+---------------------+---------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+---------------------+---------------+------+-----+---------+----------------+
| id | bigint | NO | PRI | NULL | auto_increment |
| proposal_text | longtext | NO | | NULL | |
| proposal_image | varchar(100) |YES | | NULL | |
| facility_document | varchar(100) |YES | | NULL | |
| required_payment | decimal(10,2) | YES | | NULL | |
| status | varchar(20) | NO | | NULL | |
| submitted_at | datetime(6) | NO | | NULL | |
| forwarded_event_id |bigint | NO | UNI | NULL | |
| is_sent_to_client | tinyint(1) | NO | | NULL | |
| forwarded_to_client | tinyint(1) | NO | | NULL | |
+---------------------+---------------+------+-----+---------+----------------+
10 rows in set (0.00 sec)

mysql>desceventapp_clientresponse;
+------------------+---------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+------------------+---------------+------+-----+---------+----------------+
| id | bigint | NO | PRI | NULL | auto_increment |
| response | varchar(10) | NO | | NULL | |
| client_id | int | YES | MUL | NULL | |
| event_request_id | bigint | YES | MUL | NULL | |
| payment_link | varchar(200) |YES | | NULL | |
| payment_status | varchar(10) | NO | | NULL | |
| payment_amount | decimal(10,2) | YES | | NULL | |
| payment_method | varchar(20) | YES | | NULL | |
+------------------+---------------+------+-----+---------+----------------+
8 rows in set (0.02 sec)

mysql>desceventapp_eventmanager;
+----------+--------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+----------+--------------+------+-----+---------+----------------+
| id | bigint | NO | PRI | NULL | auto_increment |
| username | varchar(150) | NO | UNI | NULL | |
| password | varchar(128) | NO | | NULL | |
| email | varchar(254) | NO | UNI | NULL | |
| contact |varchar(15) | NO | UNI | NULL | |
+----------+--------------+------+-----+---------+----------------+
5 rows in set (0.00 sec)

mysql>desceventapp_event;
+-------------+--------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+-------------+--------------+------+-----+---------+----------------+
| id | bigint | NO | PRI | NULL | auto_increment |
| title | varchar(255) | NO | | NULL | |
| description | longtext | NO | | NULL | |
| date | date | NO | | NULL | |
| location | varchar(255) | NO | | NULL | |
| status | varchar(20) | NO | | NULL | |
+-------------+--------------+------+-----+---------+----------------+
6 rows in set (0.02 sec)
mysql>desceventapp_forwardedevent;
+---------------------+---------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+---------------------+---------------+------+-----+---------+----------------+
| id | bigint | NO | PRI | NULL | auto_increment |
| status | varchar(20) | NO | | NULL | |
| forwarded_at | datetime(6) | NO | | NULL | |
| admin_id | int | YES | MUL | NULL | |
| event_manager_id | bigint | NO | MUL | NULL | |
| event_request_id | bigint | NO | MUL | NULL | |
| client_id | int | YES | MUL | NULL | |
| event_id | bigint | YES | MUL | NULL | |
| client_budget | decimal(10,2) | NO | | NULL | |
| end_date | date | YES | | NULL | |
| event_title | varchar(255) |YES | | NULL | |
| forwarded_by_id | int | YES | MUL | NULL | |
| proposal | longtext | YES | | NULL | |
| start_date | date | YES | | NULL | |
| is_client_forwarded | tinyint(1) | NO | | NULL | |
+---------------------+---------------+------+-----+---------+----------------+
15 rows in set (0.02 sec)

mysql>desceventapp_eventrequest;
+---------------+---------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+---------------+---------------+------+-----+---------+----------------+
| id | bigint | NO | PRI | NULL | auto_increment |
| description | longtext | YES | | NULL | |
| status | varchar(20) | NO | | NULL | |
| client_id | int | NO | MUL | NULL | |
| event_id | bigint | YES | MUL | NULL | |
| client_budget | decimal(10,2) | YES | | NULL | |
| created_at | datetime(6) | NO | | NULL | |
| end_date | date | NO | | NULL | |
| event_title | varchar(255) |YES | | NULL | |
| start_date | date | NO | | NULL | |
| title | varchar(255) |YES | | NULL | |
| is_forwarded |tinyint(1) | NO | | NULL | |
+---------------+---------------+------+-----+---------+----------------+
12 rows in set (0.00 sec)

mysql>desceventapp_eventmanager_assigned_events;
+-----------------+--------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+-----------------+--------+------+-----+---------+----------------+
| id | bigint | NO | PRI | NULL | auto_increment |
| eventmanager_id | bigint | NO | MUL | NULL | |
| event_id | bigint | NO | MUL | NULL | |
+-----------------+--------+------+-----+---------+----------------+
3 rows in set (0.00 sec)
4. CODE
from [Link] import post_migrate
from [Link] import receiver
from [Link] import User
from [Link] import Role, UserProfile

def create_default_admin():
# Check if the admin user already exists
admin_user, created = [Link].get_or_create(
username="barsha",
defaults={
"email": "pani@[Link]",
"is_superuser": True,
"is_staff": True,
},
)
if created:
admin_user.set_password("pani@123") # Hash password
admin_user.save()
print("✅ Super admin created successfully!")

# Ensure the 'admin' role exists


admin_role, _ = [Link].get_or_create(role="admin")

# Check if the user profile exists, if not, create and assign role
user_profile, created = [Link].get_or_create(user=admin_user,
defaults={"role": admin_role})

if created:
print(f"✅ Role '{admin_role.role}' assigned to admin user.")
else:
print("ℹ️Admin user already has a role assigned.")

@receiver(post_migrate)
def create_roles_and_admin(sender, **kwargs):
if [Link] == "eventapp": # Ensure it only runs for your app
# Ensure default roles exist
roles = ["admin", "event_manager", "client"]
for role in roles:
[Link].get_or_create(role=role)

# Call function to create default admin


create_default_admin()

from [Link] import models


from [Link] import User
from [Link] import make_password
from [Link] import now

class Role([Link]):
ROLE_CHOICES = (
("admin", "Admin"),
("event_manager", "Event Manager"),
("client", "Client"),
)
role = [Link](max_length=20, choices=ROLE_CHOICES, unique=True)
# Changed 'name' to 'role'

def save(self, *args, **kwargs):


[Link] = [Link]()
super().save(*args, **kwargs)

def __str__(self):
return [Link]

# Extend Django User Model to Assign Roles


class UserProfile([Link]):
user = [Link](User, on_delete=[Link])
role = [Link](Role, on_delete=[Link])
contact = [Link](max_length=15, blank=True, null=True)
address = [Link](blank=True, null=True)

def __str__(self):
return f"{[Link]} - {[Link]}"
class Event([Link]):
title = [Link](max_length=255)
description = [Link]()
date = [Link]()
location = [Link](max_length=255)
status = [Link](
max_length=20,
choices=[('upcoming', 'Upcoming'), ('ongoing', 'Ongoing'), ('completed',
'Completed')],
default='upcoming'
)

def __str__(self):
return [Link]

# Event Manager Model


class EventManager([Link]):
username = [Link](max_length=150, unique=True)
password = [Link](max_length=128)
email = [Link](unique=True)
contact = [Link](max_length=15, unique=True)
assigned_events = [Link](Event, blank=True)

def save(self, *args, **kwargs):


""" Hash the password before saving """
if not [Link]:
[Link] = make_password([Link])
super().save(*args, **kwargs)

def __str__(self):
return [Link]

class Client([Link]):
user = [Link](User, on_delete=[Link])
address = [Link](max_length=255)
phone_number = [Link](max_length=15)
date_of_birth = [Link]()
registration_date = [Link](auto_now_add=True)

def __str__(self):
return [Link]

class Payment([Link]):
client = [Link](User, on_delete=[Link])
event = [Link](Event, on_delete=[Link])
amount = [Link](max_digits=10, decimal_places=2)
status = [Link](
max_length=20,
choices=[('pending', 'Pending'), ('completed', 'Completed')],
default='pending'
)
transaction_id = [Link](max_length=100, unique=True)

def __str__(self):
return f"Payment by {[Link]} for {[Link]}"
def create_default_admin():
if not [Link](username="barsha").exists():
admin_user = [Link].create_superuser(
username="barsha",
email="pani@[Link]",
password="pani@123"
)
print("Super admin created successfully!")
admin_role, _ = [Link].get_or_create(role="admin") # Use 'role' instead of 'name'

# Check if the user profile exists, if not, create and assign role
user_profile, created = [Link].get_or_create(user=admin_user,
defaults={"role": admin_role})

if created:
print(f" Role '{admin_role.role}' assigned to admin user.") # Use [Link] instead of
[Link]
else:
print(" Admin user already has a role assigned.")

class EventRequest([Link]):
STATUS_CHOICES = [
('pending', 'Pending'),
('approved', 'Approved'),
('rejected', 'Rejected'),
('forwarded', 'Forwarded'),
]
event = [Link](Event, on_delete=[Link], null=True,
blank=True) # Make it optional
client = [Link](User, on_delete=[Link])
event_title = [Link](max_length=255,null=True, blank=True)
description = [Link](null=True, blank=True)
title = [Link](max_length=255,null=True)
start_date = [Link](default=now) # Added Start Date
end_date = [Link](default=now) # Added End Date
client_budget = [Link](max_digits=10, decimal_places=2 , null=True,
blank=True) # Added Client Budget
status = [Link](max_length=20, choices=STATUS_CHOICES,
default='pending')
created_at = [Link](default=now)
is_forwarded = [Link](default=False)

def __str__(self):
return f"{self.event_title} - {[Link]}"
class ForwardedEvent([Link]):
STATUS_CHOICES = [
('pending', 'Pending'),
('proposal_sent', 'Proposal Sent'),
]

event_request = [Link](EventRequest, on_delete=[Link])


event = [Link](Event, on_delete=[Link] , null=True)

client = [Link](
User, on_delete=[Link], null=True,
related_name="client_forwarded_events"
)
admin = [Link](
User, on_delete=[Link], null=True, blank=True,
related_name="admin_forwarded_events"
)
forwarded_by = [Link](
User, on_delete=[Link], related_name="events_forwarded",null=True,
blank=True
)
event_manager = [Link](
User, on_delete=[Link], related_name="manager_assigned"
)
status = [Link](max_length=20, choices=STATUS_CHOICES,
default='pending')
forwarded_at = [Link](auto_now_add=True)

is_client_forwarded = [Link](default=False)

event_title = [Link](max_length=255,null=True)
proposal = [Link](null=True, blank=True)
start_date = [Link](null=True)
end_date = [Link](null=True)
client_budget = [Link](max_digits=10, decimal_places=2)

def __str__(self):
return f"Forwarded {self.event_request.event_title} to
{self.event_manager.username}"

class EventProposal([Link]):
STATUS_CHOICES = [
('pending', 'Pending'),
('approved', 'Approved'),
('rejected', 'Rejected'),
]

is_sent_to_client = [Link](default=False)
forwarded_event = [Link](ForwardedEvent,
on_delete=[Link])
proposal_text = [Link]()
proposal_image = [Link](upload_to='proposal_images/', null=True,
blank=True)
facility_document = [Link](upload_to='proposal_docs/', null=True,
blank=True)
required_payment = [Link](max_digits=10, decimal_places=2,
null=True, blank=True)
status = [Link](max_length=20, choices=STATUS_CHOICES,
default='pending')
submitted_at = [Link](auto_now_add=True)
forwarded_to_client = [Link](default=False)

def __str__(self):
return f"Proposal for {self.forwarded_event.event_request.event_title}"

class FinalizedEvent([Link]):
event_request = [Link](EventRequest, on_delete=[Link],
null=True, blank=True)

proposal = [Link](
EventProposal, on_delete=models.SET_NULL, null=True, blank=True,
related_name="finalized_event"
)
event = [Link](Event, on_delete=[Link], null=True,
blank=True)
status = [Link](max_length=255, null=True, blank=True)
client = [Link](
UserProfile, on_delete=[Link], null=True,
related_name="client_forwarded_events" # Update this to UserProfile
)
created_at = [Link](auto_now_add=True)
finalized_by_admin = [Link](
User, on_delete=models.SET_NULL, null=True, blank=True,
related_name="finalized_events"
)
# Add this if needed

def __str__(self):
return f"Finalized Event: {self.event_request.title if self.event_request else 'No Event
Request'}"

class ClientResponse([Link]):
ACCEPTED = "Accepted by Client"
REJECTED = "Rejected by Client"
PENDING = "Pending"

RESPONSE_CHOICES = [
(ACCEPTED, "Accepted"),
(REJECTED, "Rejected"),
(PENDING, "Pending"),
]
PAYMENT_METHOD_CHOICES = [
('Credit Card', 'Credit Card'),
('Debit Card', 'Debit Card'),
('PayPal', 'PayPal'),
('Bank Transfer', 'Bank Transfer'),
]
event_request = [Link](EventRequest,
on_delete=[Link],null=True, blank=True)
client = [Link](User, on_delete=[Link],null=True,
blank=True)
response = [Link](max_length=10, choices=[('Yes', 'Yes'), ('No', 'No')])

payment_status = [Link](max_length=10, choices=[('Pending', 'Pending'),


('Completed', 'Completed')], default='Pending')
payment_link = [Link](blank=True, null=True)
payment_amount = [Link](max_digits=10, decimal_places=2, null=True,
blank=True) # Add this field
payment_method = [Link](max_length=20,
choices=PAYMENT_METHOD_CHOICES, null=True, blank=True) # Add this field
def save(self, *args, **kwargs):
# Update status based on response
if [Link] == "Yes":
[Link] = [Link]
if not self.payment_link:
self.payment_link = f"/payment/{[Link]}/"

# Ensure payment method & amount are filled if accepted


if not self.payment_amount:
raise ValueError("Payment amount is required when response is 'Yes'.")
if not self.payment_method:
raise ValueError("Payment method is required when response is 'Yes'.")

[Link] == "No":
[Link] = [Link]
self.payment_link = None # No payment link if rejected
else:
[Link] = [Link]

super().save(*args, **kwargs)

def __str__(self):
return f"{[Link]} - {self.get_response_display()} - {self.payment_status}"

class DashboardImage([Link]):
title = [Link](max_length=255)
image = [Link](upload_to="dashboard_images/")
uploaded_at = [Link](auto_now_add=True)

def __str__(self):
return [Link]
class GalleryImage([Link]):
title = [Link](max_length=255, blank=True, null=True)
image = [Link](upload_to='gallery/')
uploaded_at = [Link](auto_now_add=True)

def __str__(self):
return [Link] if [Link] else "Untitled Image"
class Blog([Link]):
title = [Link](max_length=255)
content = [Link]()
image = [Link](upload_to='blog_images/', blank=True, null=True)
author = [Link](UserProfile, on_delete=[Link]) # Use
UserProfile instead
created_at = [Link](default=now)

def __str__(self):
return [Link]
class Comment([Link]):
blog = [Link](Blog, related_name="comments",
on_delete=[Link])
user = [Link](UserProfile, on_delete=[Link]) # Use
UserProfile instead
text = [Link]()
created_at = [Link](auto_now_add=True)

def __str__(self):
return f"Comment by {[Link]} on {[Link]}"
from django import forms
from .models import Event, EventRequest,EventManager
from [Link] import ValidationError
from [Link] import Role
from [Link] import
UserProfile ,Blog,ClientResponse,GalleryImage,FinalizedEvent,DashboardImage,Event
Request,EventProposal,ForwardedEvent

class LoginForm([Link]):
ROLE_CHOICES = [
('admin', 'Admin'),
('event_manager', 'Event Manager'),
('client', 'Client'),
]
role = [Link](choices=ROLE_CHOICES,
widget=[Link](attrs={'class': 'form-control'}))
username = [Link](widget=[Link](attrs={'class': 'form-control',
'placeholder': 'Username'}))
password = [Link](widget=[Link](attrs={'class': 'form-
control', 'placeholder': 'Password'}))

class RegisterForm([Link]):
username = [Link](
widget=[Link](attrs={'class': 'form-control', 'placeholder': 'Enter your
username'}),
max_length=150
)
email = [Link](
widget=[Link](attrs={'class': 'form-control', 'placeholder': 'Enter your
email'})
)
password = [Link](
widget=[Link](attrs={'class': 'form-control', 'placeholder': 'Enter
your password'})
)
confirm_password = [Link](
widget=[Link](attrs={'class': 'form-control', 'placeholder': 'Confirm
your password'})
)
contact = [Link](
widget=[Link](attrs={'class': 'form-control', 'placeholder': 'Enter your
contact number'}),
max_length=15
)
address = [Link](
widget=[Link](attrs={'class': 'form-control', 'placeholder': 'Enter your
address', 'rows': 2})
)
class AdminRegistrationForm([Link]):
username = [Link](widget=[Link](attrs={'class': 'form-control',
'placeholder': 'Username'}))
email = [Link](widget=[Link](attrs={'class': 'form-control',
'placeholder': 'Email'}))
password = [Link](widget=[Link](attrs={'class': 'form-
control', 'placeholder': 'Password'}))
confirm_password = [Link](widget=[Link](attrs={'class': 'form-
control', 'placeholder': 'Confirm Password'}))
contact = [Link](widget=[Link](attrs={'class': 'form-control',
'placeholder': 'Contact'}))

def clean(self):
cleaned_data = super().clean()
password = cleaned_data.get("password")
confirm_password = cleaned_data.get("confirm_password")

if password != confirm_password:
raise [Link]("Passwords do not match")
class EventManagerRegistrationForm([Link]):
username = [Link](widget=[Link](attrs={'class': 'form-control',
'placeholder': 'Username'}))
password = [Link](widget=[Link](attrs={'class': 'form-
control', 'placeholder': 'Password'}))
email = [Link](widget=[Link](attrs={'class': 'form-control',
'placeholder': 'Email'}))
contact = [Link](widget=[Link](attrs={'class': 'form-control',
'placeholder': 'Contact'}))
class EventRequestForm([Link]):
class Meta:
model = EventRequest
fields = ['event', 'description']
widgets = {
'event': [Link](attrs={'class': 'form-control'}),
'description': [Link](attrs={'class': 'form-control', 'placeholder': 'Describe
your event...'}),
}

from django import forms


from [Link] import User
class EventManagerForm([Link]):
contact = [Link](widget=[Link](attrs={'class': 'form-control'}),
required=True)
password = [Link](
widget=[Link](attrs={'class': 'form-control'}), required=False
)
confirm_password = [Link](
widget=[Link](attrs={'class': 'form-control'}), required=False
) class Meta:
model = User #✅ Use User model for username & email
fields = ["username", "email", "password"]

def clean(self):
cleaned_data = super().clean()
password = cleaned_data.get("password")
confirm_password = cleaned_data.get("confirm_password")

# ✅ Only validate password if one is entered


if password or confirm_password:
if password != confirm_password:
raise [Link]("Passwords do not match!")

class AdminForm([Link]):
password = [Link](widget=[Link], required=False)
confirm_password = [Link](widget=[Link], required=False)
contact = [Link](max_length=15, required=True) # Handle contact here

class Meta:
model = User
fields = ['username', 'email'] # Contact is not part of User

def clean(self):
cleaned_data = super().clean()
password = cleaned_data.get("password")
confirm_password = cleaned_data.get("confirm_password")

if password and password != confirm_password:


raise [Link]("Passwords do not match!")
return cleaned_data

def save(self, commit=True):


user = super().save(commit=False)

if self.cleaned_data["password"]:
user.set_password(self.cleaned_data["password"]) # Hash password

if commit:
[Link]()
# Update or create UserProfile separately
[Link].update_or_create(user=user, defaults={"contact":
self.cleaned_data["contact"]})

return user
class EventRequestForm([Link]):
class Meta:
model = EventRequest
fields = ['title', 'description', 'start_date', 'end_date', 'client_budget']
widgets = {
'start_date': [Link](attrs={'type': 'date'}),
'end_date': [Link](attrs={'type': 'date'}),
}

class ForwardEventForm([Link]):
class Meta:
model = ForwardedEvent
fields = ['event_manager']
class ForwardClientForm([Link]):
client = [Link](
queryset=[Link](), # Fetch all users
empty_label="Select Client",
widget=[Link](attrs={'class': 'form-control'}),
)
class EventProposalForm([Link]):
class Meta:
model = EventProposal
fields = ['proposal_text', 'proposal_image', 'facility_document', 'required_payment']

class FinalizedEventForm([Link]):
class Meta:
model = FinalizedEvent
fields = ['finalized_by_admin']
class ClientResponseForm([Link]):
class Meta:
model = ClientResponse
fields = ['response']
widgets = {
'response': [Link](choices=ClientResponse.RESPONSE_CHOICES)
}

# [Link]
from django import forms

class PaymentForm([Link]):
payment_amount = [Link](label='Payment Amount', max_digits=10,
decimal_places=2)
payment_method = [Link](
label='Payment Method',
choices=[
('UPI', 'UPI'),
('NetBanking', 'Net Banking'),
('CreditCard', 'Credit Card'),
('DebitCard', 'Debit Card'),
]
)
class DashboardImageForm([Link]):
class Meta:
model = DashboardImage
fields = ["title", "image"]

class GalleryImageForm([Link]):
class Meta:
model = GalleryImage
fields = ['title', 'image']

class BlogForm([Link]):
class Meta:
model = Blog
fields = ['title', 'content', 'image']

from [Link] import render


from [Link] import render, redirect
from [Link] import authenticate, login
from [Link] import JsonResponse
from [Link] import never_cache
from [Link] import render, redirect, get_object_or_404
from [Link] import make_password
from [Link] import csrf_exempt
from [Link] import login_required,user_passes_test
from [Link] import messages
from [Link] import logout
from [Link] import redirect
from [Link] import User
from .forms import LoginForm,
RegisterForm,EventManagerForm,BlogForm,PaymentForm,EventRequestForm,GalleryI
mageForm, DashboardImageForm,ForwardClientForm,
ForwardEventForm,EventProposalForm,FinalizedEventForm,AdminForm,ClientRespon
seForm
from .models import
UserProfile,Role,Event,EventManager,Comment,Client,Blog,DashboardImage,GalleryI
mage,EventRequest,
Payment,ClientResponse,ForwardedEvent,EventProposal,FinalizedEvent
def image(request):
return render(request, 'eventapp/[Link]')
def aboutus(request):
return render(request, 'eventapp/[Link]')
def services(request):
return render(request, 'eventapp/[Link]')
def blog(request):
blogs = [Link]().order_by('-created_at')
return render(request, 'eventapp/[Link]', {'blogs': blogs})
def add_blog(request):
if [Link] == 'POST':
form = BlogForm([Link], [Link])
if form.is_valid():
blog = [Link](commit=False)

# Get the UserProfile associated with the logged-in user


user_profile = [Link](user=[Link])
[Link] = user_profile # Assign the correct UserProfile instance
[Link]()

return redirect('dashboard') # Redirect to blog listing page


else:
form = BlogForm()

return render(request, 'eventapp/add_blog.html', {'form': form})


def blog_list(request):
blogs = [Link]().order_by('-created_at')
return render(request, 'eventapp/add_blog.html', {'blogs': blogs})

def blog_detail(request, blog_id):


blog = get_object_or_404(Blog, id=blog_id)
return render(request, 'eventapp/blog_detail.html', {'blog': blog})

@csrf_exempt
@login_required
def post_comment(request):
if [Link] == "POST":
blog_id = [Link]("blog_id")
text = [Link]("text")

blog = get_object_or_404(Blog, id=blog_id)


comment = [Link](blog=blog, user=[Link], text=text)

return JsonResponse({
"success": True,
"username": [Link],
"comment_text": [Link]
})

return JsonResponse({"success": False})

def home(request):
return render(request, 'eventapp/[Link]')
def index(request):
form = LoginForm()
if [Link] == "POST":
form = LoginForm([Link])
if form.is_valid():
username = form.cleaned_data["username"]
password = form.cleaned_data["password"]
role = form.cleaned_data["role"].lower() # Convert role to lowercase

user = authenticate(request, username=username, password=password)

if user:
try:
user_profile = [Link](user=user)

# Check if the selected role matches the assigned role


if user_profile.[Link]() == role:
login(request, user)
[Link]['role'] = role # Store role in session

# Redirect based on role


if role == "admin":
return redirect("dashboard")
elif role == "event_manager":
return redirect("managerdashboard")
elif role == "client":
return redirect("userdashboard")
else:
[Link](request, "Incorrect role selected.")
except [Link]:
[Link](request, "Role not assigned to this user.")
else:
[Link](request, "Invalid username or password.")

return render(request, "eventapp/[Link]", {"form": form})

def signup(request):
if [Link] == "POST":
print(" Signup form submitted!")
form = RegisterForm([Link])
if form.is_valid():
print(" Form is valid!")
username = form.cleaned_data["username"]
email = form.cleaned_data["email"]
password = form.cleaned_data["password"]
confirm_password = form.cleaned_data["confirm_password"]
contact = form.cleaned_data["contact"]
address = form.cleaned_data["address"]

if [Link](email=email).exists():
[Link](request, "Email already exists.")
print(" Email already exists!")
return render(request, "eventapp/user_signin.html", {"form": form})

if password != confirm_password:
[Link](request, "Passwords do not match.")
print(" Passwords do not match!")
return render(request, "eventapp/user_signin.html", {"form": form})
user = [Link].create_user(username=username, email=email,
password=password)
[Link]()
print(f" User '{username}' created successfully!")
client_role, created = [Link].get_or_create(role="client")
print(f" Role '{client_role.role}' fetched!")

user_profile = [Link](user=user, role=client_role, contact=contact,


address=address)
user_profile.save()
print(f" UserProfile for '{username}' created successfully!")

[Link](request, "Signup successful! You can now log in.")


return redirect("index")
else:
print(" Form is not valid!")
print([Link])

else:
form = RegisterForm()

return render(request, "eventapp/user_signin.html", {"form": form})


@never_cache
@login_required
def dashboard(request):
if [Link]() != "admin":
[Link](request, "Access denied. Only Admins can access the dashboard.")
return redirect("index")

# Fetch only relevant data


event_requests = [Link](status="pending")
forwarded_events =
[Link].select_related("event_request").prefetch_related("eventproposal
")
client_responses =
[Link].select_related('event_request__client').order_by("-id")
print("Client Responses:")
for r in [Link]():
print(f"{[Link]} - {r.event_request.title} - {[Link]}")

forwarded_client_responses = [Link](status__in=["Accepted by
Client", "Rejected by Client"])
all_event_requests = [Link]()

return render(request, "eventapp/[Link]", {


"event_requests": event_requests,
"forwarded_events": forwarded_events,
"client_responses": client_responses,
"forwarded_client_responses": forwarded_client_responses,
"all_event_requests": all_event_requests,

})
def user_logout(request):
logout(request)
return redirect("index")
@login_required
def user_dashboard(request):
try:
user_profile = [Link] # Get UserProfile instance

if user_profile.[Link]() != "client":
[Link](request, "Unauthorized Access! You do not have permission to view this
page.")
return redirect("index")

# Fetch event requests where the client is the user


event_requests = [Link](client=[Link])
rejected_events = event_requests.filter(status='rejected')

# Fetch finalized and forwarded events where client is the user


finalized_events = [Link](client=user_profile)
forwarded_events = [Link](client=[Link])

# Combine the two querysets in Python


client_events = list(finalized_events) + list(forwarded_events) # Combine event lists

client_responses =
[Link](event_request__in=[event.event_request for event in
client_events])

# Attach client_response to each event


for event in client_events:
print(f"Dashboard Event ID: {[Link]}, EventRequest ID: {event.event_request.id}")

response = client_responses.filter(event_request=event.event_request).first()
event.client_response = [Link] if response else None # Assign response or
None
images = [Link]()
return render(request, "eventapp/[Link]", {
"event_requests": event_requests,
"rejected_events": rejected_events,
"finalized_events": finalized_events,
"client_responses": client_responses,
"forwarded_events": forwarded_events,
"client_events": client_events, # Pass the combined events to the template
"images": images,
'client_events': client_events
})
except [Link]:
[Link](request, "Role not assigned! Contact admin.")
return redirect("index")
@login_required
def register_manager(request):
if [Link]() != "admin":
[Link](request, "Only Admins can register Event Managers.")
return redirect("dashboard")

if [Link] == "POST":
username = [Link]("username")
email = [Link]("email")
contact = [Link]("contact")
address = [Link]("address")
password = [Link]("password")
confirm_password = [Link]("confirm_password")

if [Link](username=username).exists():
[Link](request, "Username already exists.")
return redirect("register_manager")

if password != confirm_password:
[Link](request, "Passwords do not match.")
return redirect("register_manager")

user = [Link].create_user(username=username, email=email,


password=password)
event_manager_role, _ = [Link].get_or_create(role="event_manager")
[Link](user=user, role=event_manager_role, contact=contact,
address=address)
[Link](request, "Event Manager registered successfully!")
return redirect("index")

return render(request, "eventapp/register_manager.html")

from [Link] import Paginator

@login_required
def list_managers(request):
event_managers =
[Link](role__role="event_manager").order_by("id")
paginator = Paginator(event_managers, 3)
page_number = [Link]("page")
page_obj = paginator.get_page(page_number)

return render(request, "eventapp/all_manager.html", {"event_managers": page_obj})


def edit_manager(request, id):
event_manager = get_object_or_404(UserProfile, id=id, role__role="event_manager")
user = event_manager.user
if [Link] == "POST":
form = EventManagerForm([Link], instance=user)

if form.is_valid():
password = form.cleaned_data.get("password")
if password:
user.set_password(password)
event_manager.contact = form.cleaned_data["contact"]
event_manager.save()

[Link](request, "Event Manager updated successfully!")


return redirect("list_managers")
else:
[Link](request, "Form is invalid. Please check the fields.")

else:

form = EventManagerForm(instance=user, initial={"contact":


event_manager.contact})

return render(request, "eventapp/edit_manager.html", {"form": form,


"event_manager": event_manager})
@login_required
def delete_manager(request, id):
event_manager = get_object_or_404(UserProfile, id=id, role__role="event_manager")
user = event_manager.user

[Link]()
event_manager.delete()
[Link](request, "Event Manager deleted successfully!")
return redirect("list_managers")

from [Link] import check_password

@login_required
def reset_manager_password(request, id):
event_manager = get_object_or_404(UserProfile, id=id, role__role="event_manager")
user = event_manager.user
if [Link] == "POST":
new_password = [Link]("new_password")
confirm_password = [Link]("confirm_new_password")
if new_password != confirm_password:
[Link](request, "Passwords do not match!")
else:
print(f" Old Hashed Password: {[Link]}")

user.set_password(new_password)
[Link]()

print(f" New Hashed Password: {[Link]}")

if check_password(new_password, [Link]):
print(" Password updated successfully!")
else:
print(" Password update failed!")

[Link](request, "Password reset successfully!")


return redirect("list_managers")

return render(request, "eventapp/resetpassword_manager.html", {"event_manager":


event_manager})
@login_required
def manager_dashboard(request):
if [Link]() != "event_manager":
[Link](request, "Access Denied. Only Event Managers can view this page.")
return redirect("index")

forwarded_events = [Link](event_manager=[Link],
status="pending")
proposals =
[Link](forwarded_event__event_manager=[Link]).exclude(st
atus="Pending")
return render(request, "eventapp/[Link]", {
"forwarded_events": forwarded_events,
"proposals": proposals
})
def is_admin(user):
return user.is_authenticated and [Link](user=user,
role__role='admin').exists()

@login_required
@user_passes_test(is_admin)
def admin_list(request):
""" Show all admins """
admins = [Link](userprofile__role__role="admin")
return render(request, "eventapp/all_admin.html", {"admins": admins})

@login_required
@user_passes_test(is_admin)
def create_admin(request):
""" Allow an admin to create another admin """
if [Link] == "POST":
form = AdminForm([Link])
if form.is_valid():
user = [Link](commit=False)
user.set_password(form.cleaned_data["password"])
[Link]()

# Assign admin role


admin_role, _ = [Link].get_or_create(role="admin")
[Link](user=user, role=admin_role,
contact=form.cleaned_data["contact"])
[Link](request, "New admin created successfully!")
return redirect("index")
else:
form = AdminForm()

return render(request, "eventapp/admin_registration.html", {"form": form, "title":


"Create Admin"})

@login_required
@user_passes_test(is_admin)
def edit_admin(request, user_id):
""" Edit admin details including User and UserProfile fields """
user = get_object_or_404(User, id=user_id)
user_profile, _ = [Link].get_or_create(user=user) # Ensure UserProfile
exists

if [Link] == "POST":
form = AdminForm([Link], instance=user) # Handle username & email

if form.is_valid():
user = [Link]() # Save User model (username, email)

# Update UserProfile model (contact)


user_profile.contact = [Link]("contact", user_profile.contact)
user_profile.save()

[Link](request, "Admin details updated successfully!")


return redirect("admin_list")
else:
form = AdminForm(instance=user)
return render(request, "eventapp/edit_admin.html", {
"form": form,
"user_profile": user_profile,
"title": "Edit Admin"
})
@login_required
@user_passes_test(is_admin)
def delete_admin(request, user_id):
""" Allow an admin to delete another admin """
user = get_object_or_404(User, id=user_id)

if [Link] == "POST":
if [Link] == "barsha": # Prevent deletion of the super admin
[Link](request, "Cannot delete the main super admin!")
else:
[Link]()
[Link](request, "Admin deleted successfully!")
return redirect("admin_list")
return render(request, "eventapp/delete_admin.html", {"admin": user})
@login_required
@user_passes_test(is_admin)
def reset_admin_password(request, user_id):
""" Allow an admin to reset another admin's password """
user = get_object_or_404(User, id=user_id)

if [Link] == "POST":
new_password = [Link]("new_password")
confirm_password = [Link]("confirm_password")

if new_password and new_password == confirm_password:


user.set_password(new_password)
[Link]()
[Link](request, "Password reset successfully!")
return redirect("admin_list")
else:
[Link](request, "Passwords do not match!")

return render(request, "eventapp/reset_admin_password.html", {"user": user})

@login_required
def request_event(request):
if [Link] == "POST":
form = EventRequestForm([Link])
if form.is_valid():
event_request = [Link](commit=False)
event_request.client = [Link]

# ✅ Ensure an Event is created and linked


event = [Link](
title=form.cleaned_data['title'], # Assuming form has title field
description=form.cleaned_data['description'], # Assuming form has
description
date=form.cleaned_data['start_date'], # Assuming event starts on request start
date
location="TBD", # Update later
status="Pending"
)
event_request.event = event # Link event request to event
event_request.save()

[Link](request, "Event request submitted successfully!")


return redirect("userdashboard")
else:
[Link](request, "There was an error submitting your request.")

else:
form = EventRequestForm()

return render(request, "eventapp/event_request_form.html", {"form": form})


def admin_event_requests(request):
event_requests = [Link](status='Pending') # Fetch only pending
events

return render(request, 'eventapp/[Link]', {'event_requests': event_requests})


from [Link] import render, redirect, get_object_or_404
from .models import EventRequest, ForwardedEvent
from .forms import ForwardEventForm

@login_required
def forward_event(request, event_id):
event_request = get_object_or_404(EventRequest, id=event_id)

if [Link] == "POST":
form = ForwardEventForm([Link])
if form.is_valid():
forwarded_event = [Link](commit=False)
forwarded_event.event_request = event_request
forwarded_event.event = event_request.event # ✅ Ensure event is linked

# ✅ Copy event details to forwarded event


forwarded_event.start_date = event_request.start_date
forwarded_event.end_date = event_request.end_date
forwarded_event.client_budget = event_request.client_budget

forwarded_event.save()
event_request.is_forwarded = True
event_request.save()

[Link](request, "Event successfully forwarded!")


return redirect("admin_event_requests")

else:
form = ForwardEventForm()

return render(request, "eventapp/forward_event.html", {"form": form,


"event_request": event_request})

from [Link] import render, get_object_or_404, redirect


from .models import ForwardedEvent, EventProposal

def submit_proposal(request, forwarded_event_id):


forwarded_event = get_object_or_404(ForwardedEvent, id=forwarded_event_id)

# Ensure an EventProposal exists or create one


proposal, created =
[Link].get_or_create(forwarded_event=forwarded_event)

if [Link] == "POST":
proposal_text = [Link]("proposal_text")
proposal_image = [Link]("proposal_image")
facility_document = [Link]("facility_document")
required_payment = [Link]("required_payment")
if not required_payment:
[Link](request, "Required payment cannot be empty!")
return redirect('eventapp/submit_proposal',
forwarded_event_id=forwarded_event_id)

try:
proposal.required_payment = float(required_payment)
except ValueError:
[Link](request, "Invalid payment amount.")
return redirect('submit_proposal', forwarded_event_id=forwarded_event_id)

# Update proposal details


proposal.proposal_text = proposal_text
if proposal_image:
proposal.proposal_image = proposal_image
if facility_document:
proposal.facility_document = facility_document
[Link]()

[Link](request, "Proposal submitted successfully!")


return redirect("managerdashboard") # Redirect after submission

return render(request, "eventapp/submit_proposal.html", {


"forwarded_event": forwarded_event,
"proposal": proposal
})
def finalize_event(request, proposal_id):
proposal = get_object_or_404(EventProposal, id=proposal_id)

if [Link] == "POST":
form = FinalizedEventForm([Link])
if form.is_valid():
finalized_event = [Link](commit=False)
finalized_event.event_proposal = proposal
finalized_event.finalized_by_admin = True
finalized_event.save()

[Link](request, "Event finalized and sent to client!")


return redirect("admin_event_requests")
else:
form = FinalizedEventForm()

return render(request, "eventapp/finalize_event.html", {"form": form, "proposal":


proposal})
def view_proposals(request, forwarded_id):
proposal = get_object_or_404(EventProposal, forwarded_event_id=forwarded_id)

if [Link] == "POST":
action = [Link]("action")

if action == "approve":
[Link] = "Approved"
[Link](request, "Proposal approved successfully!")
elif action == "reject":
[Link] = "Rejected"
[Link]() # Remove from database
[Link](request, "Proposal rejected and removed!")

[Link]()
return redirect("dashboard") # Redirect to admin dashboard after approval/rejection
return render(request, "eventapp/view_proposals.html", {"proposal": proposal})

from [Link] import JsonResponse


from [Link] import csrf_exempt
import json

@csrf_exempt # Disable CSRF for testing; remove later


def reject_event(request, event_id):
print(f"Reject event called for ID: {event_id}") # Debugging log

if [Link] == "POST":
try:
event = [Link](id=event_id)
[Link] = "Rejected"
[Link]()
print(f"Event {event_id} rejected successfully.") # Debugging log
return JsonResponse({"success": True})
except [Link]:
print(f"Event {event_id} not found.") # Debugging log
return JsonResponse({"success": False, "error": "Event not found"})

return JsonResponse({"success": False, "error": "Invalid request"})


@login_required
def accept_proposal(request, proposal_id):
proposal = get_object_or_404(EventProposal, id=proposal_id)
proposal.forwarded_event.status = "Reviewed"
proposal.forwarded_event.save()
return redirect("view_proposals")
@login_required
def forward_client(request, forwarded_event_id):
forwarded_event = get_object_or_404(ForwardedEvent, id=forwarded_event_id)

if [Link] == "POST":
client_id = [Link]("client")
print("Selected Client ID:", client_id)

if client_id:
try:
client = get_object_or_404(UserProfile, id=client_id)

# Fetch the proposal associated with this ForwardedEvent


proposal =
[Link](forwarded_event=forwarded_event).first()

if not proposal:
[Link](request, "No proposal found for this event.")
return redirect("dashboard")

# Create a Finalized Event for the client


finalized_event = [Link](
event_request=forwarded_event.event_request,
event=forwarded_event.event,
client=client,
proposal=proposal, #✅ Assign the EventProposal instance
status="Forwarded to Client"
)
print("Finalized Event Created:", finalized_event)

# Assign client to the forwarded event (if needed)


forwarded_event.client = [Link] # Ensure correct user assignment
forwarded_event.save()

[Link](request, "Event successfully forwarded to the client.")


return redirect("dashboard")

except Exception as e:
[Link](request, f"Error forwarding event: {str(e)}")

else:
[Link](request, "Please select a client before forwarding.")

client_role = get_object_or_404(Role, role="client")


clients = [Link](role=client_role)

return render(request, "eventapp/forward_client.html", {"clients": clients})

from [Link] import JsonResponse

def view_client(request, event_id):


# Step 1: Fetch the Finalized Event
finalized_event = get_object_or_404(FinalizedEvent, event_request__id=event_id)

# Step 2: Fetch the Forwarded Event using event_request


forwarded_event =
[Link](event_request=finalized_event.event_request).first()

if not forwarded_event:
return render(request, 'eventapp/clientview_proposal.html', {
'error_message': "No forwarded event found for this request.",
'finalized_event': finalized_event,
})

# Step 3: Fetch the Proposal linked to the Forwarded Event


proposal = [Link](forwarded_event=forwarded_event).first()

if not proposal:
return render(request, 'eventapp/clientview_proposal.html', {
'error_message': "No proposal linked to this event.",
'finalized_event': finalized_event,
})

# Step 4: Pass data to the template


return render(request, 'eventapp/clientview_proposal.html', {
'finalized_event': finalized_event,
'proposal': proposal
}) # Redirect to a safe page
def client_response(request, event_id, response):
response_text = "Accepted" if [Link]() == "yes" else "Rejected"

# ✅ Check in ForwardedEvent first


forwarded_event = [Link](id=event_id).first()
if forwarded_event:
print(f"✅ Event {event_id} found in ForwardedEvent. Processing response...")

forwarded_event.client_response = response_text
forwarded_event.save()

# ✅ Update or create a ClientResponse entry


client_response_obj, created = [Link].update_or_create(
event_request=forwarded_event.event_request,
client=[Link], # Assuming client is the logged-in user
defaults={"response": response_text},
)

if [Link]() == "no":
forwarded_event.delete() # Remove if rejected

return JsonResponse({
"success": True,
"status": [Link](),
"message": f"ForwardedEvent {event_id} updated"
}, status=200)

# ✅ Check in FinalizedEvent
finalized_event = [Link](id=event_id).first()
if finalized_event:
print(f"✅ Event {event_id} found in FinalizedEvent. Processing response...")

finalized_event.client_response = response_text
finalized_event.save()

# ✅ Update or create a ClientResponse entry


client_response_obj, created = [Link].update_or_create(
event_request=finalized_event.event_request,
client=[Link],
defaults={"response": response_text},
)
if [Link]() == "no":
finalized_event.delete() # Remove if rejected

return JsonResponse({
"success": True,
"status": [Link](),
"message": f"ForwardedEvent {event_id} updated"
}, status=200)

# ❌ If event not found


print(f"❌ Event {event_id} NOT found in ForwardedEvent or FinalizedEvent.")
return JsonResponse({"error": "Event not found"}, status=404)

def send_proposal_to_client(request, proposal_id):


proposal = get_object_or_404(EventProposal, id=proposal_id)

# Ensure forwarded_event exists


if not hasattr(proposal, "forwarded_event") or proposal.forwarded_event is None:
[Link](request, "This proposal has not been forwarded to an Event Manager
yet.")
return redirect("dashboard")

# Mark proposal as sent to the client


proposal.is_sent_to_client = True
proposal.forwarded_event.status = "Sent to Client"
proposal.forwarded_event.save()
[Link]()

[Link](request, "Proposal has been successfully sent to the client!")


return redirect("dashboard")
def approve_proposal(request, forwarded_id):
proposal =
[Link](forwarded_event_id=forwarded_id).latest("created_at") #
Get the latest one

if [Link] == "POST":
if not hasattr(proposal, "forwarded_event") or proposal.forwarded_event is None:
[Link](request, "Proposal has no associated ForwardedEvent.")
return redirect("dashboard")

proposal.forwarded_event.status = "Forwarded to Client"


proposal.forwarded_event.save()
[Link] = "Forwarded to Client"
[Link]()

[Link](request, "Proposal successfully forwarded to client.")


return redirect("dashboard")

return render(request, "eventapp/view_proposals.html", {"proposal": proposal})


@csrf_exempt # If using AJAX without CSRF token
def reject_forwarded_event(request, event_id):
if [Link] == "POST":
try:
event = get_object_or_404(EventRequest, id=event_id)
[Link]() # Remove the event from the database
return JsonResponse({"success": True})
except [Link]:
return JsonResponse({"success": False, "error": "Event not found"}, status=404)

return JsonResponse({"success": False, "error": "Invalid request"}, status=400)


@login_required
def upload_dashboard_image(request):
if [Link]() != "admin":
[Link](request, "Access denied. Only Admins can upload images.")
return redirect("index")

if [Link] == "POST":
form = DashboardImageForm([Link], [Link])
if form.is_valid():
[Link]()
[Link](request, "Image uploaded successfully!")
return redirect("dashboard")
else:
form = DashboardImageForm()

images = [Link]() # Fetch uploaded images


return render(request, "eventapp/upload_dashboard_image.html", {"form": form,
"images": images})

def upload_image(request):
if [Link] == "POST":
form = GalleryImageForm([Link], [Link])
if form.is_valid():
[Link]()
return redirect('dashboard') # Redirect to gallery page
else:
form = GalleryImageForm()
return render(request, 'eventapp/upload_image.html', {'form': form})

# Display images in gallery


def gallery(request):
images = [Link]().order_by('-uploaded_at')
return render(request, 'eventapp/[Link]', {'images': images})

# View to display clients and allow the admin to cancel/delete registrations


def manage_clients(request):
if not [Link].is_superuser: # Ensure only admins can access
return redirect('dashboard')

# Fetch clients based on role


try:
client_role = [Link](role='client') # Fetch "client" role
clients = [Link](userprofile__role=client_role) # Filter users with
"client" role
except [Link]:
clients = [Link]() # If role doesn't exist, return empty queryset

# Handle client cancellation (deletion)


if [Link] == 'POST' and 'cancel_registration' in [Link]:
client_id = [Link]('client_id')
try:
client = [Link](id=client_id)
[Link]() # Delete the client user
[Link](request, f"Client {[Link]} has been removed.")
except [Link]:
[Link](request, "Client not found.")

return redirect('manage_clients') # Refresh page after deletion

return render(request, 'eventapp/manage_clients.html', {'clients': clients})


def payment_page(request, event_request_id):
event_request = get_object_or_404(EventRequest, id=event_request_id)

response, _ = [Link].get_or_create(
event_request=event_request,
client=[Link],
defaults={'payment_status': 'Pending'}
)

if [Link] == 'POST':
form = PaymentForm([Link])
if form.is_valid():
response.payment_amount = form.cleaned_data['payment_amount']
response.payment_method = form.cleaned_data['payment_method']
response.payment_status = 'Completed'
[Link]()
print("Saved Amount:", response.payment_amount)

return redirect('proceed_payment', event_request_id=event_request.id,


method=response.payment_method)
else:
print("Form Errors:", [Link])
else:
form = PaymentForm(initial={
'payment_amount': response.payment_amount or '',
'payment_method': response.payment_method or ''
})
if response.payment_amount:
[Link]['payment_amount'].[Link]['readonly'] = True

return render(request, 'eventapp/payment_page.html', {


'form': form,
'event_request': event_request,
})
def proceed_payment(request, event_request_id, method):
event_request = get_object_or_404(EventRequest, id=event_request_id)

# ✅ Get the client response for the logged-in user


response = [Link](event_request=event_request,
client=[Link]).first()

context = {
'event_request': event_request,
'amount': response.payment_amount if response else None, #✅ Pass amount to
template
}

# Redirect to appropriate payment method page with context


if method == 'UPI':
return render(request, 'eventapp/payment_upi.html', context)
elif method == 'NetBanking':
return render(request, 'eventapp/payment_netbanking.html', context)
elif method == 'CreditCard':
return render(request, 'eventapp/payment_credit.html', context)
elif method == 'DebitCard':
return render(request, 'eventapp/payment_debit.html', context)
else:
return redirect('userdashboard')
5. SCREENSHOTS
[Link] AND DEBUGGING
After successful requirement analysis, designing & coding, the testing and debugging
phase was mandatory for successful completion of the project because the importance of
software testing to software quality can not be overemphasized. Once source code has
been generated, software must be tested to allow errors to be identified and removed
before delivery to the customer. While it is not possible to remove every error in a large
software package, the software engineer’s goal is to remove as many possible early in
the software development cycle. It is important to remember that testing can only find
errors; it cannot prove that a program is bug free. Two basic test techniques involve
testing module input/output (black-box) and exercising internal logic of software
components (white-box). Formal technical reviews by themselves can not find allow
software defects, test data must also be used. For large software projects, separate test
teams may be used to develop and execute the set of test cases used in testing. Testing
must be planned and designed. The SEPA web site contains template for a generic test
plan.
SOFTWARE TESTING OBJECTIVES:
• Testing is the process of executing a program with the intent of finding
errors.
• A good test case is one with a high probability of finding an as-yet
undiscovered error.
• A successful test is one that discovers an as-yet-undiscovered error.
SOFTWARE TESTING PRINCIPLES:
• All tests should be traceable to customer requirements.
• Test should be planned long before testing begins.
• The Pareto principle (80% of all errors will likely be found in 20% of the
code) applies to software testing.
• Testing should begin in the small and progress to the large.
• Exhaustive testing is not possible.
• To be most effective, testing should be conducted by an independent third
party.
The total project is divided into six modules. Each module is designed & tested
individually.
GOOD TEST ATTRIBUTES:
• A good test has a high probability of finding an error.
• A good test is not redundant.
• A good test should be best of breed.
• A good test should not be too simple or too complex.

TEST CASE-DESIGN STRATEGIES:


• Black-box or behavioral testing (knowing the specified function a product
is to perform and demonstrating correct operation based solely on its
specification without regard for its internal logic).
• White-box or glass-box testing (knowing the internal workings of a
product, tests are performed to check the workings of all independent logic
paths).
STRATEGIC APPROACH TO SOFTWARE TESTING:
• Testing begins at the component level and works outward toward the
integration of the entire computer-based system.
• Different testing techniques are appropriate at different points in time.
• The developer of the software conducts testing and may be assisted by
independent test groups for large projects.
• The role of the independent tester is to remove the conflict of interest
inherent when the builder is testing his or her own product.
• Testing and debugging are different activities.
• Debugging must be accommodated in any testing strategy.
STRATEGIC TESTING ISSUES:
• Specific product requirements in a quantifiable manner before testing
starts.
• Specific testing objectives explicitly.
• Identify the user classes of the software and develop a profile for each.
• Develop a test plan that emphasizes rapid cycle testing.
• Build robust software that is designed to test itself (e.g. uses ant bugging).
• Use effective formal reviews as a filter prior to testing.
• Conduct formal technical reviews to assess the test strategy and test
cases.
UNIT TESTING:
• Black box and white box testing.
• Module interfaces are tested for proper information flow.
• Local data are examined to ensure that integrity is maintained.
• Boundary conditions are tested.
• Basis path testing should be used.
• All error handling paths should be tested.
• Drivers and/or stubs need to be developed to test incomplete software.
7. SECURITY MECHANISMS AT VARIOUS LEVELS

According to security we provide security our application by using Java security levels like

1. Authentication
2. Authorization
3. Impersonation

1. Authentication
It is the process of validating the identity of a user to allow or deny a request. This involves
accepting credentials (e.g. username and password) from the users and validating it against a
designated authority. After the identity is verified and validated, the user is considered to be
legal and the resource request is fulfilled.

2. Authorization

The process of ensuring that users with valid identity are allowed to access specific resources.

3. Impersonation

This process enables an application to ensure the identity of the user, and in turn make
request to the other resources. Access to resources will be granted or denied based on the
identity that is being impersonated.

[Link]
Event management can provide improved accessibility for getting information. Such system
helps the user to keep in touch with the new events display product information in an easy
way.
The expense of logistics is reduced to almost nil after the initial setup is done. Electronic
technology speeds up the display of results. The user gets the information instantly. It bridges
the communication gap between the seller side and the customer side making a strong link.
The requirement of manpower is very minimal. Anybody can know about the craft product
details so easily.

BIBLIOGRAPHY
Bibliography
‘Instant Java Server Pages’ by CharlesHampfed,Universityof Toronto
‘Java Complete Reference’ by Herbert Schildt, Tata McGraw Hill,
Mastering Java2’ by John Zukowski, BPB Publications
‘Software engineering’ by Rajeev mall
Elmasri Navathe ‘Fundamentals of database systems’

Website
• [Link]
• [Link]/
• [Link]/wiki/java
• [Link]

You might also like