Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
253 views295 pages

Table of Content: Online Complaint Management System

OCMS

Uploaded by

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

Table of Content: Online Complaint Management System

OCMS

Uploaded by

Pradeep Sharma
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 295

Online Complaint Management System

Table Of Content
Title Of The Project
--------------------------------------------------------------------------------------
1
Introduction
--------------------------------------------------------------------------------------
2
Objective
--------------------------------------------------------------------------------------
5
Tools And Languages Used
--------------------------------------------------------------------------------------
6
System Analysis
--------------------------------------------------------------------------------------
11
Identification Of Need
--------------------------------------------------------------------------------------
14
Preliminary Investigation
--------------------------------------------------------------------------------------
15
Requirement Analysis
--------------------------------------------------------------------------------------
19
Feasibility Study
--------------------------------------------------------------------------------------
21
Project Planning
--------------------------------------------------------------------------------------
26
Project Scheduling
--------------------------------------------------------------------------------------
27
Software Engineering Paradigm Applied
--------------------------------------------------------------------------------------
28
Software Requirement Specification

0
Online Complaint Management System

--------------------------------------------------------------------------------------
33
Data Flow Diagrams
--------------------------------------------------------------------------------------
38
Entity-Relation Diagram
--------------------------------------------------------------------------------------
45
Class Diagrams
--------------------------------------------------------------------------------------
48
System Design
--------------------------------------------------------------------------------------
57
Module Description
--------------------------------------------------------------------------------------
60
Database Design
--------------------------------------------------------------------------------------
64
Coding Efficiency
--------------------------------------------------------------------------------------
69
Optimization Of Code
--------------------------------------------------------------------------------------
71
Coding
--------------------------------------------------------------------------------------
73
Output Screens
--------------------------------------------------------------------------------------
248
Testing
--------------------------------------------------------------------------------------
261
Implementation
--------------------------------------------------------------------------------------
270
System Security

1
Online Complaint Management System

--------------------------------------------------------------------------------------
277
Reports
--------------------------------------------------------------------------------------
281
Pert Chart And Gantt Chart
--------------------------------------------------------------------------------------
286
Limitations
--------------------------------------------------------------------------------------
290
Future Scope
--------------------------------------------------------------------------------------
291
Bibliography
--------------------------------------------------------------------------------------
292

2
Online Complaint Management System

Title Of The Project

Online Complaint
Management
System

3
Online Complaint Management System

INTRODUCTION

This project is a web based – application for serving customers of


the company. Through this project, it can also develop a long –
term relationships between customers and companies and helps to
understand their requirements.

The primary theme is to develop an application that will help the


organization in establishing a strong relationship with the customer
through providing services to them. The application will gather
data from customers about the products they purchased and any
problem they encountered with the product. This data will be a
source for the organization to find out if there is a manufacturing
defect in the product or a problem during its use. If the complaints
are same for a product then the management assumes that there is a
manufacturing defect with the product and an appropriate action
needs to be taken if in case, the problem is encountered during its
use, then the service engineer can easily service the complaint. The
data will also be a source of input for the organization needed for
requirements gathering.

This product is specially designed keeping in mind the client’s


requirements. It can be customized as per other client’s
requirements who want to deploy similar kind of systems in their
businesses. Complaint management system’s main function is to
service customers by monitoring and making analysis of Customer
Complaints about a product sold by a manufacturer. Complaint
management system helps in Customer Support Service and helps
in serving the customer in a better way by adding more
functionality, and making desired and necessary changes in the
product. Complaint management system helps to fill the
communication gap between the manufacturer and end customer.

4
Online Complaint Management System

This is a competitive world. Every business today operates in a


hyperactive competitive environment. The businesses want to
attract more and more customers to increase their profit. But to
retain customer loyalty is a problem that every business faces
today. Today, businesses are customer – centric. Customers today
are more demanding and complaining. They tend to easily switch
brands and companies if they are not served properly. The
companies have to focus today on products that suits customers’
need. They also need to provide services after sales. Customers
today not only look for the features of the product delivered to
them but they also want more offers in form of after sales service
from manufacturer. They need easy ways to register their
complaints and get the complaints serviced. Many companies have
provided ways to serve their customer complaints through toll free
telephone calls. However, this is not a very effective solution as the
customer is not able to properly communicate her/his problems.
Most of the time the call ends up early and leaves customer in a
tizzy. To counter this situation, the client needed a solution where a
customer can register her/his complaints online and then their
complaints can be serviced through service engineers.

This product is specially designed keeping in mind the client’s


requirements. It can be customized as per other client’s
requirements who want to deploy similar kind of systems in their
businesses.

Complaint management system is a web – enabled solution for


corporate who want to serve their customer well. For whom
relationship with customer matters. Complaint management system
will help a corporate to maintain customers’ complaints about a
product. The manufacturer will receive the status of the complaint
through the Service Manager Report. Registered Customer will get
the privilege to register their complaints online. Customers can
also register themselves online and then register complaints.

5
Online Complaint Management System

Operators in various branch offices view the details of the


complaints registered by the customers. She/he will then fill the
daily complaints form. The detail complaints form that will be
filled by the Complaint Operator will have entries like, complaint
no., product id, and product name, manufacturing date, frequency
of a complaint related to a product, date, and complaint operator id.
This report will be source/input/feedback information to
Manufacture/Branch Office.

Manufacturer’s Branch Office gets the complete status of


complaints through Complaint Operators’ reports. The Complaint
Operator will then allot Service Engineer to solve complaints. If
Branch Office is not able to solve the complaint then the Branch
can request the Head office to solve the complaint.

The Service Engineer view the details of the complaint are allotted
to her/him. She/he daily fills Service detail form in response to a
type of complaint, which serves as source/input/feedback
information to Branch Office and Head Office.

6
Online Complaint Management System

OBJECTIVE
This project is based on developing a web based – application for
serving customers of the company. The project also aims at
developing long-term relationships with customers and helps to
understand their requirements.

The primary theme is to develop an application that will help the


organization in establishing a strong relationship with the customer
through providing services to them. The application will gather
data from customers about the products they purchased and any
problem they encountered with the product. This data will be a
source for the organization to find out if there is a manufacturing
defect in the product or a problem during its use. If the complaints
are same for a product then the management assumes that there is a
manufacturing defect with the product and an appropriate action
needs to be taken. If in case, the problem is encountered during its
use, then the complaint can be easily serviced by the service
engineer. The data will also be a source of input for the
organization needed for requirements gathering.

This product is specially designed keeping in mind the client’s


requirements. It can be customized as per other client’s
requirements who want to deploy similar kind of systems in their
businesses. Complaint management system’s main function is to
service customers by monitoring and making analysis of Customer
Complaints about a product sold by a manufacturer. Complaint
management system helps in Customer Support Service and helps
in serving the customer in a better way by adding more
functionality, and making desired and necessary changes in the
product. Complaint management system helps to fill the
communication gap between the manufacturer and end customer.

7
Online Complaint Management System

TOOLS/PLATFORM, HARDWARE & SOFTWARE


REQUIREMENT SPECIFICATIONS

J2EE
The main objective behind developing the Online Complaint
Management Systemapplication is to serve the customer of the
organization as best as the organization can. The OCMS
application aims at handling the customer complaints which are
located at different locations. So, in order to provide such facilities
our application need to be a web application, which can be
deployed on any web server so that any user can access the
application and use its features. So, I have used Java 2 Platform,
Enterprise Edition (J2EE) which provides a component-based
approach to the design, development, assembly, and deployment of
enterprise applications. The J2EE platform offers a multitiered
distributed application model, reusable components, a unified
security model, flexible transaction control, and Web services
support through integrated data interchange on Extensible Markup
Language (XML)-based open standards and protocols. Not only
can you deliver innovative business solutions to market faster than
ever, but your platform-independent J2EE component-based
solutions are not tied to the products and application programming
interfaces (APIs) of any one vendor. Vendors and customers enjoy
the freedom to choose the products and components that best meet
their business and technological requirements.
Struts
Struts is a Java MVC framework for building web applications on
the J2EE platform. Created by Craig McClanahan and donated to
the Apache Foundation in May, 2000 Open source framework that
facilitates J2EE web application development Uses and extends the
Java servlet API Based on MVC design pattern.All the core
components of Struts framework belong to Controller category.

8
Online Complaint Management System

Struts has no components in the Model category. Struts has only


auxiliary components in View category. A collection of custom
tags making it easy to interact with the controller. The View
category is neither the core of Struts framework nor is it necessary.
However it is a helpful library for using Struts effectively in JSP
based rendering.

Controller Category: The ActionServlet and the collaborating


classes form the controller and is the core of the framework. The
collaborating classes are RequestProcessor, ActionForm, Action,
ActionMapping and ActionForward.

View Category: The View category contains utility classes –


variety of custom tags making it easy to interact with the
controller. It is not mandatory to use these utility classes. You can
replace it with classes of your own. However when using Struts
Framework with JSP, you will be reinventing the wheel by writing
custom tags that mimic Struts view components. If you are using
Struts with Cocoon or Velocity, then have to roll out your own
classes for the View category.

Model Category: Struts does not offer any components in the


Model Category. You are on you own in this turf. This is probably
how it should be. Many component models (CORBA, EJB) are
available to implement the business tier. Your model components
are as unique as your business and should not have any
dependency on a presentation framework like Struts. This
philosophy of
limiting the framework to what is absolutely essential and helpful
and nothing more has revented bloating and made the Struts
framework generic and reusable.
MySQL
The MySQL (R) software delivers a very fast, multi-threaded,
multi-user, and robust SQL (Structured Query Language) database

9
Online Complaint Management System

server. MySQL Server is intended for mission-critical, heavy-load


production systems as well as for embedding into mass-deployed
software. MySQL is a registered trademark of MySQL AB. The
following list describes some of the important characteristics:
JavaScript
JavaScript Is a Scripting Language Scripting languages have been
in use long before the Web came around. In the UNIX
environment, scripts have been used to perform repetitive system
administration tasks and to automate many tasks for less computer-
literate users. In addition, scripting languages are the basis of much
of the CGI-BIN programming that is currently used to add a
limited form of interactivity to Web pages.

Examples of scripting languages include Perl, well known in CGI


programming, Awk and SED (designed for intensive text
processing), and even HyperTalk which, like JavaScript, is an
object-oriented scripting language.

Of course, this still doesn't tell you what the main advantages of
scripting languages are. Like all scripting languages, JavaScript is
interpreted, which provides an easy development process; it
contains a limited and easy-to-learn command set and syntax; and
it is designed for performing a well-defined set of tasks.

HTML
Short for Hyper Text Markup Language, the authoring language
used to create documents on the World Wide Web. HTML defines
the structure and layout of a Web document by using a variety of
tags and attributes. HTML is used to define the content and sketch
of the page. It’s tags is used inside the codes of java server
pages(jsp) directly in this project.HTML is a client-side
technology, it means an HTML document is processed entirely by
the client or browser. Using HTML tag we can pass the parameters
or query-string variables directly from one page of jsp to another

10
Online Complaint Management System

page. Actually HTML is not a programming language, but it is


used in jsp for all the above reasons.

Web Server (Apache Tomcat)

For administrators and web developers alike, there are some


important bits of information you should familiarize yourself with
before starting out. This document serves as a brief introduction to
some of the concepts and terminology behind the Tomcat
container.

Eclipse IDE
Eclipse is a powerful IDE for Java technologies™. Eclipse
provides the user with a wide range of functionality such as:
Project management, templates, Class browsers, code completion,
intelli – sense, debugger interface, syntax highlighting, wizards
and a fully customisable user interface. With Eclipse you can
directly compile or run your Java program without activating the
main document first. Eclipse will automatically find the file with
the main function or the html file holding the applet, and then it
will start the appropriate tool.
My Eclipse
My Eclipse Studio is a J2EE plug-in for Eclipse. My Eclipse
Studio is installed on top of existing Eclipse. It allows a user with
more project templates like Dynamic Web Project, Static Web
Project, EJB Project.
Application Project, Struts and Java Server Faces support and
Springs support. It also allows a developer to launch a number of
application servers from with in Eclipse. It allows having break
points in your web pages during development to debug
applications. My Eclipse Studio enhances the functionality of
Eclipse by allowing compiling, debugging, and running J2EE
applications from within Eclipse.

11
Online Complaint Management System

Software Environment
Following software are required for developing Web based application:

I. Operating Windows, 2000, XP Prof


System Etc.
II. Environment JAVA
III. Front-end Tool JAVA
IV. Technology STRUTS
V. Backend Tool MYSQL5.0

HARDWARE INTERFACES

It's a web – based project, so a robust hardware configuration is


required. The hardware requirements are:

I. Processor PIII 700 MHz and above.

II. Motherboard Intel 845 and above


III. RAM 256 to 768 MB
IV. Hard Disk 2 GB for j2EE/STRUTS and 1 GB for
Microsoft MYSQL.
V. Network Card Standard Ethernet card for networking.
VI. I/O Devices Keyboard, mouse and Color monitor
VII. Wires Twisted pair for networking.

12
Online Complaint Management System

SYSTEM ANALYSIS

For solving any problem, I develop a system i.e. a computer


system. Therefore, in order to enhance the relationship between the
customer and the company I had to develop a reliable system i.e.
(OCMS). Therefore, in order to develop any system I need to
analyze the requirements of the users. One can think of the systems
approach as an organized way of dealing with a problem. In this
application, the System Analysis mainly deals with the software
development requirements.

System Analysis by definition is a process of systematic


investigation for the purpose of gathering data, interpreting the
facts, diagnosing the problem and using this information either to
build a completely new system or to recommend the improvements
to the existing system.

A satisfactory system analysis involves the process of examining a


business situation with the intent of improving it through better
methods and procedures. In its core sense, the analysis phase
defines the requirements of the system and the problems which
user is trying to solve irrespective of how the requirements would
be accomplished.

The main points to be discussed in system analysis are:


 Specification of what the new system is to accomplish
based on the user requirements.
 Faults in the previous system
 Functional hierarchy showing the functions to be
performed by the new system and their relationship with
each other.

13
Online Complaint Management System

 Function network, which are similar to function hierarchy


but they highlight, those functions which are common to
more than one procedure.

List of attributes of the entities - these are the data items which
need to be held about each entity.

After the detailed study of above points, we came to following


Conclusion:

 Specifications for the tasks achieved by the Online


Complaint Management System, Here we highlighted
the main task i.e. to handle the problems of customer.
 We designed the relationship between various tasks to be
achieved by the system and the hierarchy of all tasks in
order of their priority.
 List of various attributes of various entities

In my project firstly I need to analyze the working of organization


and evaluate the most feasible requirements of the organization. In
this phase I would analyze the main issue to be resolved by this
application. So in order to perform all such activities I divided such
process into various sub parts.

 Problem identification
 Preliminary Investigation
o Techniques for fact gathering

14
Online Complaint Management System

 Requirement Analysis
 Feasibility Study
 Project Planning
 Project Scheduling

IDENTIFICATION OF NEED

Identification of need is very first step of system analysis. The


analyst meets in this phase my main focus is on evaluate the

15
Online Complaint Management System

central problem that the organization is facing currently and to


know why the previous system fails to provide such facilities.

With the customer and the end user. Here in my case both
customers are the telecom Organization and end-user are the
former and cell phone customer. In this step, I am interested to
understand the product’s objective and defined the goals required
to meet the objective. After identifying overall goals, I moved
towards evaluation of supplementary information during
preliminary investigation. I also focused on “does the technology
exist to build the system?” and “what bounds have been placed on
costs and schedule”. To perform it we scanned followings:

 The performance of the system


 The information being supplied and its
form
 The economy of processing
 The control of the information Processing
 The efficiency of the existing system
 The security of the data & software

PRELIMINARY INVESTIGATION

16
Online Complaint Management System

The basic purpose behind Preliminary Investigation is to first


clarify, understand and evaluate the Project Request.

As my Application “Online Complaint Management System” is


corporate level, application.The first step in the development of a
system life cycle is identification of the needs. In this phase, I tried
to investigate the most common and feasible requirements of
customer.In these phase I will try to get the answers of the
following questions:
 Is the application reliable?
 Weather they wanted to bind their data with certain
restrictions?
 Is the storage area is persistent?
 What is frequency of customer complaints?
 What is being done through this application?
 How it is being done?
 What are the problems in previous system?
 How the systems inter-relate the various kinds of users i.e.
(operator, service Engineer, administrator and customers)?
 What are the facilities provided by this system to various
levels of management i.e. higher level, Middle level and
lower level?
 What kind if facilities are provided by the organization to
the customers?

To know the answers to these questions I need to perform an


intensive investigation. For doing this I need to select an

17
Online Complaint Management System

appropriate technique so that I can evaluate a proper solution to all


such issues.

Techniques for Fact Gatherting:

Fact Gathering means learning as much as possible about the


present system and organizational workings.

To do fact gathering, the analyst has the following options:


 Interviews personnel
 Prepares questionnaires
 Observes the current system
 Gathers forms and documents currently in use
 Determines the flow of date through the system, and

Clearly defines the system requirements.

But I had used the interviewing technique for getting all


answers to my questions.

INTERVIEWING

By studying this organization chart, the analyst can confidently


schedule interviews with key personnel involved with the system.
Of course, there should be preliminary interviews. Later he/she
will conduct a detailed interview with all the people who actually
operate the system. Not only will these people use the newly
developed system, but they also may be the ones most afraid of
change, especially if they feel the computer might replace them.
Like an investigative reported trying to discover the who, what,
when, why and how of a story, the analyst should conduct the
interview in such a way that people provide honest descriptions of
their jobs. The following questions can help accomplish this goal.

18
Online Complaint Management System

 Who is involved with what you do?


 What do you do?
 What are the main
 Where do you do it?
 When do you do it?
 Why do you do it the way you do?
 How do you do it?
 Do you have suggestions of change?

Interviews help gather vital facts about existing problems, such as


lack of quality control or sufficient security, but they also allow the
analyst to involve people in change, easing them into it, After all, it
is the users’ system, not the analyst’s.
After interviewing a large number of individual I came to
following answers to these questions:

 In this software I will present a web application the main


theme is to develop this application, to establish a strong
relationship with the customer and organization through
providing service this application will gather data
/complaints from customer. After getting the data from
customer the problem will have solve by service engineer
or administrator.
 The project Online Complaint Management Systemmust be
reliable so that user can conclude decision on the basis of
the output generated by the system.
 Further more users also wanted to bind their data with
certain restrictions i.e. only a valid user can access the data
through the application.
 The users also wanted that their data must be secure
i.e.their data must not be hacked.

19
Online Complaint Management System

 The frequency of customer complaints is very high.


 The system must be able to handle multiple requests at
same time. If the number of request is far more than the
expectations then also system must generate reliable
output.
 The application need to be developed such as, the customer
who wants to register his/her complaints, must be register it
online. Then the customer have permitted to register their
complaints and post it to that firm from he/her bought such
product that’s he/she complaining.After getting complaints
the operator views or complaints and filtered the
complaints according to their locality and serverity.The
service engineer fills a daily complaints service form for
customer complaints, and solve these complaints.
 In the previous system I faced - network failure problem,
speed problems etc.but in this system we handled all the
problems.

After receiving all the requests I need to conclude that weather all
the requests are possible to achieve or not. So I need to perform a
proper feasibility study. But before feasibility study we need to
perform requirement analysis.

REQUIREMENT ANALYSIS

20
Online Complaint Management System

Requirement analysis is a software engineering task that bridges


the gap between system levels requirements engineering and
software design.

Requirement Specification of the Project from admin point of


view:-

 Updating of Employees and prospective Customer records


 Creation of Company Profile
 Assigning Task to the Employees
 Marinating of reports:
o Daily Enquiry Report
o Daily Follow up Report
o Daily task Report
o Employee Target Performance Report
 Viewing the size of the employees and prospective
customers

Requirement Specification of the Project from Customer point


of
 Can register with the project
 Can post complaint his/her complaint about the product
the/she is using
 Can view the status of his/her complaint
 Can view the details about various products

Requirement Specification of the Project from employee point


of view:-

21
Online Complaint Management System

 Viewing Company Information.


 View assigned Task of the Employee.
 Saving customer information document.
 View above generated reports
 Facility for saving company and customer information
documents.
 View various generated reports that how much customers
covered by them daily and what is their performance
level.

FEASIBILITY STUDY

22
Online Complaint Management System

A feasibility study determines whether the proposed solution is


feasible based on the priorities of the requirements of the
organization. A feasibility study culminates in a feasibility report
that recommends a solution. It helps us to evaluate the cost-
effectiveness of a proposed system.

The feasibility study is carried out to test if the proposed system is


worth being implemented. Given unlimited resources and infinite
time, all projects are feasible.
After performing a Preliminary Investigation, gathering and
interpreting data and details concerning the project, a Feasibility
Check is done which involves a series of steps to check the
Technical, Financial and Operational feasibilities.
During this phase, various solutions to the existing problems were
examined.
For each of these solutions the Cost and Benefits were the major
criteria to be examined before deciding on any of the proposed
systems.

These solutions would provide coverage of the


following:
a) Specification of information to be made available by the
system.
b) A clear-cut description of what tasks will be done manually
and what needs to be handled by the automated system.
c) Specifications of new computing equipment
needed.

A system that passes the feasibility tests is considered a feasible


system. The feasibility study is an investigative phase where a
variety of reasonable solutions are presented. Each feasible
alternative is described, the advantages and disadvantages are
identified and the cost is estimated. Both long and short term
advantages and disadvantages should be considered from all view

23
Online Complaint Management System

points: operational, technical, scheduling. Developing a number of


feasible solutions and gathering enough information on each
alternative to provide an indication of cost can be a very difficult
exercise. It may well exceed the work required to design and
implement the chosen alternative. Systems analysts must, in a
relatively short time, come to understand the constraints and
operations of the organization and add to this their own knowledge
and experience of software design and development. If their
solutions and advice is to be relevant, the systems analyst must
maintain an up to date knowledge of the developments in the IT
industry.

In feasibility study I will try to sort out some points that’s evaluate
weather the System are feasible:-
 Yes,the project Online Complaint Management Systemis
reliable with user and system also.
 Further more users also wanted to bind their data with certain
restrictions i.e. only a valid user can upload or download data
through the application.
 The users also wanted that their data must be secure i.e. the
their data must not be hacked.
 The frequency of customer complaints is very high.
 In this software I will present a web application the main
theme is to develop this application, to establish a strong
relationship with the customer and organization through
providing service this application will gather
data/complaints from customer. After getting the data from
customer the problem will have solve by service engineer or
administrator.
 The application has been done such as , the customer who
wants to register his/her complaints ,must have register itself
online , then the customer have permitted to register their
complaints and post it to that firm from he/her bought such

24
Online Complaint Management System

product that’s he/she complaining. After getting complaints


the operator views or complaints and filtered the complaints
according to their locality and severity. The service engineer
fills a daily complaints service form for customer complaints,
and solve these complaints.
 In the previous system I faced - network failure problem,
speed problems etc.but in this system we handled all the
problems.

In the feasibility study a cost-benefit analysis of each option is


undertaken. In cost-benefit analysis each option must be
understood in sufficient detail to assign a monetary value to
components. For each option the systems analyst must describe the
technical feasibility and determine the impact on, and the cost to,
the organization from a number of viewpoints:
operational;Technical; schedule.
In my Application Online Complaint Management SystemI have
performed following types of feasibility study:

 Technical feasibility:
It is related to the software and equipment specified in the design
for implementing a new system. Technical feasibility is a study of
function, performance and constraints that may affect the ability to
achieve an acceptable system. During technical analysis, the
analyst evaluates the technical merits of the system, at the same
time collecting additional information about performance,
reliability, maintainability and productivity. Technical feasibility is
frequently the most difficult areas to assess.
The main technical issue raised during feasibility is the
existence of necessary technology and whether the proposed
equipment has the capacity to hold required data. The technical

25
Online Complaint Management System

guarantee of accuracy, reliability, ease and data were also


investigated.

Assessing System Performance:

It involves ensuring that the system responds to


user queries and is efficient, reliable, accurate and easy to use.
Since I have the excellent network setup which is supported and
excellent configuration of servers with 80 GB hard disk and 512
MB RAM, it satisfies the performance requirement.
After conducting the technical analysis I found that my
project fulfills all the technical pre-require Software’s, the
network environments if necessary are also adaptable according
to the project.

Chapter 1 - Scheduling feasibility:

Here I evaluate the effect of each option on my scheduling


constraints. Every organization has a schedule of events it must
meet; for example:
In this phase I will try to make estimates about each and every
task that I need to acomplish in order to develop the application
and I will analyse wheather all such task are feasible to accomplish
with in the given time limit.

 Operational Feasibility:

Operation feasibility is a measure of how people feel about the


system. Operational Feasibility criteria measure the urgency of the
problem or the acceptability of a solution. Operational Feasibility
is dependent upon determining human resources for the project. It
refers to projecting whether the system will operate and be used
once it is installed.

26
Online Complaint Management System

If the ultimate users are comfortable with the present system and
they see no problem with its continuance, then resistance to its
operation will be zero.

Behaviorally also the proposed system is feasible. A particular


application may be technically and but may fail to produce the
forecasted benefits, because the company is not able to get it to
work. For the system, it is not necessary that the user must be a
computer expert, but any computer operator given a little bit of
knowledge and training can easily operate.

My Project is operationally feasible since there is no need for


special training of staff member and whatever little instructions on
this system is required can be done so quite easily and quickly.
This project is being developed keeping in mind the general people
who one have very little knowledge of computer operation, but can
easily access their required database and other related information.
The redundancies can be decreased to a large extent, as the system
will be fully automated. Here I answer questions like:
 Is the system is easy to use?
 Weather existing premises need renovation?
 Will users accept these changes?
 Weather organization operations will be interrupted
while I set up?
 Will any changes in one section of the organization
adversely affect another section?

27
Online Complaint Management System

Project Planning

Phase 1 Requirement Gathering and Analysis


Gather system requirements and prepare a System Requirement
Specification document. After collect the information, it is
analyzed that the available resources can fulfill all the
requirements. In addition, it be examined that what resource will
be used.
Phase 2 System Design
Make a detailed analysis of the system and prepare a System
Design Document based on SRS.
Phase 3 Prepare UTC & STC for testing the software
Prepare Unit Test Cases document. This document will be used to
verify whether the functional requirements of the system have been
met.
Phase 4 Develop the software
Develop the planned system.
Phase 5 Test the software using the prepared UTC/STC and
Rework if needed
Run your software programs using the respective UTC to verify &
test the software.

Phase 6 Demonstrate the software to users & Implement it

28
Online Complaint Management System

Project Schedule
Step # Time Frame

10 Days
Phase 1. Requirement Gathering

15 Days
Phase 2. System Design

Phase 3. Prepare UTC & STC for Testing the 10 Days


software
30 Days
Phase 4. Develop the software

Phase 5. Test the software using UTC & STC 20 Days

Phase 6. Demonstrate the software to users & 4 Day


Implement it

Software Engineering Paradigm Applied


Introduction

29
Online Complaint Management System

Software engineering is a layered technology, which comprises of


four independent layers as a quality focus layer, the process layer,
the methods layer, and the tools layer. The foundation for the
software engineering is the process layer and together with the
technology layer helps the rational and timely development of
computer software. The method layer provides a technical way to
perform a broad array of tasks regarding requirements analysis,
design, program construction, testing, and maintenance. The tools
layer encompasses the software engineering tools to provide
automated or semi-automated support for the process and the
methods.

In real world, the software development is a teamwork that


incorporates a development strategy that encompasses the process,
methods, and tools layers and so the strategy is termed as a process
model or Software Engineering Paradigms.

According to Fritz Bauer “Software engineering is the


establishment and use of sound engineering principles in order to
obtain economically software that is reliable and works efficiently
on real machines”. There are several models suggested to go
through the software process. The one most suitable & we opted
the linear sequential model to develop the software.

System Engineering

The software is always part of a large system and is built using


modular approach. The very scratch work begins by establishing
requirements for all system elements and then allocating some
subset of these requirements for all system elements and then
allocating some subset of these requirements to the software. This
system view is essential whenever the software is intended to
interact with other system elements such as hardware, people, and
database. In due course the system engineering and the analysis

30
Online Complaint Management System

encompass requirements gathering at the system level with a small


amount of top-level design and analysis. Information engineering
encompasses requirements gathering at the strategic business level
and at the business area level.

Software Requirement Analysis

In the very first approach of software development, the


requirements gathering process is performed and later intensified
and focused on the software. To understand the various
characteristics of the software to be built, first we must have to
understand the information domain for the software, and the
required function, behavior, performance, and interface.
Requirements for both the system and the software are documented
and must be reviewed with the customer. Keeping this software
engineering paradigm we are having a proper documentation on
our software so that Librarian’s requirement should be reviewed
with the user. It helped us to minimize the distance between the
actual requirement and the software required and hence kept and
will keep the customer’s satisfaction very high.

Design

The design is almost and always a multi step process and focuses
on four distinct attributes of a program:
 Data Structure
 Software Architecture
 Interface Representations and
 Procedural Detail.
The design process translates requirements
into a representation of the software that can be assessed for

31
Online Complaint Management System

quality before coding begins. Like requirements, the design is


documented and becomes part of the software configuration.

Code Generation

The design is translated into a machine-readable form using some


programming tools.

Testing

Once the design is converted into machine-readable form the


program testing phase starts. The testing process on our software
mainly focused on the logical internals of the software, ensuring
that all statements have been tested properly, and on the functional
externals. Through testing we mainly intended to uncover errors
and ensured that the defined input produces the desired results that
agree with required results in the specification.

Maintenance

Software will undoubtedly undergo change after it is delivered to


the customer. Change will occur due to either errors have been
encountered or the software have been adapted to accommodate in
its external environment or the customer requires functional or
performance enhancements. Software support/ maintenance
reapplies each of the preceding phases to an existing program
rather than a new one. The linear nature of the classic life cycle
worked perfect without any “blocking states” as the project is to be

32
Online Complaint Management System

developed by me under the guidance of the project coordinator


only & hence we started the next phase as soon as the current
phase is finished without waiting for any one else.

The Spiral Model

This is developed to encompass the best features of both the


classical life cycle and prototyping, at the same time adding a new
element – risk analysis and hence known as a risk-oriented
software life cycle. Each spiral addresses major risks that have
been identified After all the risks have been addressed, the spiral
model terminates as a waterfall life cycle
The Spiral model uses an “evolutionary” approach and is
currently the more realistic approach, but like other paradigms the
spiral approach is not a panacea. This approach requires a
considerable risk assessment expertise. If a major risk is
unidentified, problems will undoubtedly occur. But this approach
has the primary advantage that its range of options accommodates
the good features of existing software process models, while its
risk driven approach avoids many of their difficulties

The Spiral Model, the Classic life cycle, or the Waterfall model
suggests a systematic and spiral approach to the software
development. The very first phase starts from the system level and
spirally progresses i.e. when ever the developer wants to change
design, coding etc, can easily perform the work. A pictorial view of
opted model to develop the software is depicted in figure 1.

33
Online Complaint Management System

Figure 2: Spiral Model

34
Online Complaint Management System

Software Requirement Specification

Overview

The software requirement specification (SRS) is very important


part of the software building process, which describes the actual
user level requirement from technical point of view. i.e. what the
user exactly wants ?or for what purpose we are making every thing
The objective of preparing the software requirement specification
is to represent the requirements of the software in such a manner
that ultimately leads to successful software implementation. It is
the result of the analysis process of the software development. It
should contain all the data the software is going to process, the
function it will provide, and the behavior it will exhibit. This
Software Requirements Specifications (SRS) is defined in IEEE
Std. 830-1993, IEEE Recommended Practice for Software
Requirements Specifications. The document is organized in the
following structure:
 Introduction
 Information Description
 Functional Description
 Behavior Description
 Validation Criteria
 Bibliography
 Appendix
Introduction

The introduction section describes the goals and objective the


software under going development in context of computer based
system. It mainly deals with the software scope. i.e. it will bind the
software application domain.

35
Online Complaint Management System

Information Description

This section of the SRS provides a detailed of the problem that the
software must solve. It should describe the core of the software –
i.e. The Data. The data or information the software is going to
work on is the most basic part of the software. The description of
each data or information entity is described here. It also gives
details of the relationships between the data elements of the
software. The information description helps the software designers
in their designing purpose.

Functional Description

This section of the SRS describes the each functions required to


solve the problem. It emphasizes on the core of the software on
which the data will be processed – i.e. The Function. It also
includes the process specification of each function, design
constraints, and performance characteristics. The DFD or any other
graphical diagram can also be added to describe the functionality
of the system.

Behavioral Description

This section of the SRS describes the behavior of the software will
exhibit. It is based on definition of the events and the operations
that it will perform because of events.

Validation Criteria

This section of the SRS contains the details of the tests that should
be performed to validate functions, performance, and behavior of

36
Online Complaint Management System

the software. It is one of the most important aspect of the software


which decides how much robust our software is.

Bibliography

This section contains references to all the related documents


related with the software. This may include any technical
document, standards document or software engineering paper.

Appendix

This section is supplementary and can include the matters that are
important for the software development. It may include the
statistical data, graphs or algorithm details.

SRS Document
Software Requirements Specification Document

Introduction
Through this software I want to serve almost every information
regarding Library activities to the general public as per their
requirements

Information
By registering on this Student can get books from library. When
Administrator starts the Software he will be given user id and
password so that he can be verified to use the software.

Function

37
Online Complaint Management System

After the Administrator enters the main form he can access the
facilities provided by the Software. He/she can add new books in
New Book Form. He/she can issue books to the students in Book
Issue Form also he/she can receive book in Book Receive Form.
Important Reports are generated when necessary. He a student is
issues a book he. She gets a slip with book ISBN, Issue-date and
Receive-Date. The slip helps the user of the system to enter the
entry of book receiving.

Behavior
According to behavioral description this software will provide
output in response of input, which is being provided by the user of
the desktop. Here output of the book details will be generated
when the user can know all necessary information about the book.

Validation criteria

In this we describe the successful implementation, testing,


functions, performance and constraints related to our software. The
testing of the software will be done on various levels by providing
the input constraints to check the validity of the required function.
The overall performance of the software will be parameterized by
above mentioned validation criteria.

Bibliography

In the course of development of the proposed system the


information will be collected from various documents to
synchronize the integrity of the contents present in the Software.

APPENDIX

38
Online Complaint Management System

To specify the Library Management system we have to use various


types of tabular data, charts and other material during the course of
software development. So that every user or vendor could know
the real data references. These all will be included in report
generation after the development of software.

Data Flow Diagrams:

39
Online Complaint Management System

 Context Diagram

CUSTOMER
COMPLAINT DATA
STORE

USER
Online
Complaint
Management
FIELD system REPORTS
ENGINEER

Online Complaint Management SystemContext


Diagram

40
Online Complaint Management System

 User Login

USER

2. Validate
1. Login User

USER DATA STORE

3. Failure
4.
Success
5. Check
Authorization

User Login DFD

41
Online Complaint Management System

 Customer Registration

CUSTOMER 2. Validate
Registration
details
1. Enter
Registration
details

3. Validate
Unique
Emailed

USER DATA STORE

Customer Registration DFD

42
Online Complaint Management System

 Com plaint

1.
Registers
Complaint COMPLAINT DATA STORE

CUSTOMER

4. Fill
2. Selects Item
Product Details

3. Selects
Brand

Complaint DFD

43
Online Complaint Management System

 Service Handler

FIELD ENGINEER
1. Access COMPLAINT DETAILS DATA
Complaint STORE
s

2. Solves
Complaint
s SERVICE DATA STORE
3. Fill
daily
service
form

Service Handler DFD

44
Online Complaint Management System

 User Task

USER
1.
Accesses
Complaint COMPLAINTS DATA STORE
s

2. Classify COMPLAINT DETAILS DATA


Complaint STORE
s

3.
Calculate
Frequency

User Task DFD

45
Online Complaint Management System

 Administrator

1. Create
Users USER DATA STORE

ADMIN
PRODUCT DATA STORE
2. Assign
Roles

USER LOG
2. Add
Brands
1. Add
Products

1. Check
Unauthorized
Access

Administrator DFD

E-R Diagrams:

46
Online Complaint Management System

Password
Privilege ServiceDate
ServiceI
UserId
d

USER (SERVICE Fills


ENGINEER) Service SERVICE
Form

ComplaintSolved Reasons
Services

COMPLAINT

ComplaintText

ComplaintId
ComplaintDate

47
Online Complaint Management System

Password
UserNam RoleId RoleText
e Privilege

USER Has ROLE

Has

LastNam BirthDat
e e FirstNam
e

Gender
USERDETAIL

Street

UserNam City
e

FirstNam
e Zip State

48
Online Complaint Management System

ManufactureDate
ItemId
PurchaseDate

ITEM

Belong
s To

BrandId

ProductId

Belongs BRAND
PRODUCT To

BrandText
ProductText

49
Online Complaint Management System

Class Diagrams

50
Online Complaint Management System

51
Online Complaint Management System

52
Online Complaint Management System

53
Online Complaint Management System

54
Online Complaint Management System

55
Online Complaint Management System

56
Online Complaint Management System

57
Online Complaint Management System

System Design

SCOPE
In this section we define the scope of the design effort. The design
phase is an important part of the system development phase. A
good design of the system needs creativity and flair from the
designer and is the key to effective and successful engineering. The
following are the basic objectives of the software design process:

- To describe the process of software design where informal


ideas are transformed into detailed implementation
description.
- Introduction of different stages in the design process.
- Understanding whether an Object Oriented or a Functional
Oriented approach or both should be applied to the software.
- Determining and improving, cohesion control and coupling
within subsystems.

In analysis of the system, we have seen what a system should do.


In system design phase the emphasis will be on how to do what a
system should do. There are two main approaches:

 Data centered approach.


 Process centered approach

“Complaint management system” main function is to service


customers by monitoring and making analysis of Customer
complaints about a product sold by a manufacturer. Complaint
management system helps in Customer Support Service and helps
in serving the customer in a better way by adding more
functionality, and making desired and necessary changes in the
product. Complaint management system helps to fill the

58
Online Complaint Management System

communication gap between the manufacturer and end customer.


At the end of the day “Customer is the Queen/King”. It works as
follows:

Processes are managed in following manner in Complaint


management system:

 First of all the administrator creates various users there are


basically 4 types of users which uses the system, i.e.
Customer, Manipulators, Handler and Field Engineer.

 Administrator creates various users and assigns them


various roles i.e. Manipulators, Handler or a Field
Engineer. By providing all the necessary details to the
system, then system reviews these details if these details
are valid then details are stored in the database.

 A log file is created every time user logs in or log out an


entry is made in this log file.

 Administrator can view this log file any time he wants to.
If he founds any invalid login then he informs the higher
authorities.

 After the user creation, the customers visits the web site, if
he is facing some problem with his/her product then
he/she can post his/her complaint online.

 In order to post any complaint about any product, the


customer must register himself to the application, only
then he can post any complaint about any product.

 If a customer is registered only then he can post any


complaint, if any customer posts any complaint, he/she

59
Online Complaint Management System

must give customer id, product id, description about


problem etc.

 The system Manipulators views the complaints daily. The


employee then filters the complaints according to locality
and severity. These Manipulators will then assign a Field
engineer to service a set of complaints in a particular
locality. The employee can also see the status of
complaints assigned to a Field engineer. The view shown
to the employee will contain daily complaints, classify
complaints, assign complaints and view status.

 Field engineer view will comprise of view complaints


assigned, severity of complaints and fill daily complaint
service form. She/he daily fills Service detail form in
response to a type of complaint which serves as
source/input/feedback information to Branch Office and
Head Office. If the engineer has visited the customer and
the complaint is closed then he makes a closing entry in
the daily complaint service form.

 The managers who want to assess the performance of


employees and the complaints related to products will be
provided with reports view. The reports will be displayed
in graphical and percentage format.

 Handler can view the various reports generated by the


Manipulators and field engineer. It evaluates their
performance by viewing these reports. These reports
shows average rate of closing entries by any field
engineer.

60
Online Complaint Management System

Module Description

In the project, the design phase has been identified as one of the
most crucial documents. In this phase, we have identified the
various aspects of the “OCMS”, which have to be implemented as
subsystems and their further components. The OCMS project has
been divided into following modules

 Customer Registration: The customer who is trying to


register complain must register online and provide complete
details about the product and herself/himself.

 Role & Responsibility – wise view generation: The system


has different type of users. Each will have a different view
according to their roles. The users are:

o Customer: The Customer is a person who purchased a


product and wants to register a complaint about the
product. The customer will be generally displayed the
home page and customer registration and complaint
registration page.

o Operator / Employee: Operator or employee is a branch


office / head office user who views the complaints daily.
The employee then filters the complaints according to
locality and severity. This employee will then assign a
service engineer to service a set of complaints in a
particular locality. The employee can also see the status
of complaints assigned to a service engineer. The view
shown to the employee will contain daily complaints,
classify complaints, assign complaints and view status.

61
Online Complaint Management System

o Service Engineer: Service engineer view will comprise


of view complaints assigned, severity of complaints and
fill daily complaint service form.

o Manager: The managers who want to assess the


performance of employees and the complaints related to
products will be provided with reports view. The reports
will be displayed in graphical and percentage format.

o Admin: The admin of the site will have a different view.


The admin view will consist of admin – related activities.

 User Management:
o The user of the system who is trying to access the
registered complaints must login to the system by
providing login id and password.

o The admin of the system will be able to add employees


to the system assign them roles and revoke and invoke
privileges.

o A log file must be created on the server side to view who


tried to access the system and what was the IP of the
system that accessed it.

 Complaint Registration:

o A complaint form should be provided to customer who


wants to register a complaint.

o The user (operator) of the system will access the


complaints registered and then classify the complaints
into different categories and fill the complaints in detail

62
Online Complaint Management System

complaints form. The user will also enter the frequency


of similar complaints.

 Service Engineer:
o The service engineer will read the complaints allotted to
her/him and then solve the complaints.

o The Service Engineer will then fill the Daily Service


Form which contains information about the complaints
solved.

o Reports: The reports section deals with the reports.


These reports will be viewed by the Branch Officers and
Head Officers. The reports will be categorized into:

 Complaints Solved Monthly by a Service Engineer.


 Complaints Solved Quarterly by a Service
Engineer.
 Complaints Solved Annually by a Service Engineer.
 Number of problems identified in a product.
 Number of problems solved in a product.
 Number of problems in waiting line

 Administrator: The admin of the site will have the


following responsibilities:

o An administrator shall control all activities taking place


on this web portal.
o An admin shall create users and grant them rights to view
particular pages.
o In case of unauthorized access, the admin must inform
the HO.

63
Online Complaint Management System

o The admin shall be able to view the reports.


o The admin of the system will be able to add/edit roles,
products, brands, items information.

 Make Call: This will be futures add - on where the employee


will be able to make calls to the customer to acknowledge
about the service and to the service engineer to know the
reasons (if any) why a complaint was not serviced.

64
Online Complaint Management System

Database Design

65
Online Complaint Management System

Overview of tables involved


S.No Name of the Purpose
. Table
1 Product Stores information about a product
2 Brand Stores information about a brand
3 Item Stores information about an item
4 Complaint Stores information about a complaint
5 Service Stores information about a service
6 Customer Stores information about a customer
7 User Stores user name, password, and privileges
8 Role Stores user roles
9 product_brand Sets relationship between product & brand
10 brand_item Sets relationship between brand & item
11 complaint_service Sets relationship between complaint & service
12 complaint_item Sets relationship between complaint & item
13 cust_complaint Sets relationship between customer & complaint
14 user_detail Stores users’ detailed information
15 service_engineer Sets relationship between service & service engineer
16 user_role Sets relationship between user & role

66
Online Complaint Management System

Table Name USER

67
Online Complaint Management System

Primary Key USERID

Table Name ROLE


Primary Key ROLEID

Table Name SERVICE


Primary Key SERVICEID

Table Name PRODUCT

Primary Key PRODUCTID

Table Name BRAND


Primary Key BRANDID

Table Name ITEM


Primary Key ITEMID

Table Name COMPLAINT


Primary Key COMPLAINTID

Table Name SERVICE_ENGINEER


Primary Key (SERVICEID, ENGINEERID)
Foreign Key SERVICEID references SERVICE.SERVICEID
Foreign Key ENGINEERID references USER.USERID
Table Name COMPLAINT_ITEM
Primary Key (COMPLAINTID, PRODUCTID, ITEMID)
Foreign Key COMPLAINTID references COMPLAINT.COMPLAINTID

Foreign Key PRODUCTID references PRODUCT.PRODUCTID

Foreign Key ITEMID references ITEM.ITEMID

Table Name CUST_COMPLAINT


Primary Key (CUSTOMERID, COMPLAINTID)
Foreign Key CUSTOMERID references CUSTOMER.EMAILID
Foreign Key COMPLAINTID references COMPLAINT.COMPLAINTID

Table Name PRODUCT_BRAND

68
Online Complaint Management System

Primary Key (PRODUCTID, BRANDID)


Foreign Key PRODUCTID references PRODUCT.PRODUCTID
Foreign Key BRANDID references BRAND.BRANDID

Table Name COMPLAINT_SERVICE


Primary Key (COMPLAINTID, SERVICEID)
Foreign Key COMPLAINTID references COMPLAINT.COMPLAINTID
Foreign Key SERVICEID references SERVICE.SERVICEID
Table Name BRAND_ITEM
Primary Key (BRANDID, ITEMID)
Foreign Key BRANDID references BRAND.BRANDID
Foreign Key ITEMID references ITEM.ITEMID
Table Name USER_ROLE
Primary Key (USERID, ROLEID)
Foreign Key USERID references USER.USERID
Foreign Key ROLEID references ROLE.ROLEID
Table Name USER_DETAIL

Primary Key USERID


Foreign Key USERID references USER.USERID

Table Name CUSTOMER

Primary Key EMAILID

Code Efficiency

For the code to be efficient to the requirement we used loops and


constructs. Visual interfaces have proper validation for invalid

69
Online Complaint Management System

inputs using alert and prompt message dialog boxes. Message


boxes interact directly with the end user and the appropriate event
is fired according to that. For example, in the registration page
when user tries to do the same mistake he is stopped to do so by
halting the browser and before that as in the userid case he is
properly suggested for the uniqnesss of user id.
An update interface for the control panel we used the generic code
but with proper validations to take action necessary to it. In update
form the end user is always prompted to select the data which he
should update which ensures that only the entry made will be
modified if anything has been committed wrong. As soon as the
user/ administrator login the user is displayed with details of the
work his id related to do. That is what the user is going to access or
modify. As the cookies and hidden data transfer from page to page
is used the user ones login has to do minimum work to get his
required worked done as most of the processes are atomized unto
the maximum extent. The data being inputted in to the table or
being output on the form from the table is validated properly show
that referential as well as data integrity is maintained. The interface
is designed in the way the user should have fewer problems in
filling the form as well as to do the job on the software. So the
code is efficient enough for the person as per the security is

70
Online Complaint Management System

concerned the software will be a more robust one as it is worth to


say hacker free but to a far extent we are in the way to do the same.

Optimization of Code

71
Online Complaint Management System

The code is optimized using loops and constructs. Run time


controls are generated and variables are declared and assigned
values whenever required. Generating run time controls does
memory usage and management. Memory is released whenever a
control goes out of scope and not required anymore. Memory stack
size is also taken into account consider the cost of a query from
database. Whenever the connection is not needed for each instance
the connection is being freed and memory is released so that the
server should not go down. Only one time one user can update the
database .The Functions and procedures are made and called
whenever required. A class module is designed for database
connectivity. Module is called only whenever a proper connection
with database is required. Permission policies taken into account
while opening the database and lock is granted whenever required.
To optimize the code naming convention is followed. Prefixes are
used to identify the control and interface. Since in coding controls
are referred by their name so a complicate name would create more
confusion and problem while coding. We used the name based on
the function and property of the control. Frames and command
buttons are to enable the user to refresh the interface. Code is
written in the appropriate event of a control.
. The event of the control is decided to optimize the code
efficiency. Validation like date is also done using functions and

72
Online Complaint Management System

checks on controls. That is a text box prompting to enter the


number accepts only numeric values. The code optimized to check
and ensure that the proper value is given as input. Date input box
can only contain date format prescribed. Indexing is used for fast
search of a record.
Code optimization evaluates the software
performance and handles errors smartly. A large number of KLOC
must be avoided and emphasis must be on the logical aspects
rather than physical structure of the program. For example in the
online examination case the data is handled efficiently first the
logic in fetching the data randomly from the database and then it is
transfer in to array which is further randomized with the answer to
output the question paper. Runtime record sets are also defined and
controls are unloaded which are generated at runtime. We tried a
lot to optimize the code but still are less confident whether the
code will handle all possible errors in future that were not in scope
during testing. It will be optimized more and more by getting
feedback from the end user. The end user will tell the problems
encountered and an updated version will be developed with more
optimized performance.

Coding
Actions

73
Online Complaint Management System

Class1: deleteuser

package com.OCMS.actions;

import java.util.ArrayList;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.sql.DataSource;

import org.apache.struts.action.Action;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;

import com.OCMS.beans.Deleteform;
import com.OCMS.dbconnection.Homelogindao;

public class Deleteuser extends Action{

public ActionForward execute(ActionMapping map, ActionForm


form, HttpServletRequest req, HttpServletResponse res) throws
Exception {

Deleteform dlf=(Deleteform)form;
System.out.println("hello delete");
try {

DataSource ds=getDataSource(req);
System.out.println("hello delete1111");
ArrayList list=Homelogindao.deleteuser(ds,dlf);
if(list!=null)
{
return map.findForward("delete");
}

74
Online Complaint Management System

else
{
return map.findForward("invalid");
}

} catch (Exception e) {
e.printStackTrace();
}

return null;
}

Class2:displayalldata

package com.OCMS.actions;

import java.util.ArrayList;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.sql.DataSource;

import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.actions.DispatchAction;

import com.OCMS.beans.Roleselectionform;
import com.OCMS.dbconnection.Homelogindao;

75
Online Complaint Management System

public class Displayalldata extends DispatchAction{

public ActionForward admin(ActionMapping map, ActionForm form,


HttpServletRequest req, HttpServletResponse res) throws Exception {

Roleselectionform rselection=(Roleselectionform)form;

try {

DataSource ds=getDataSource(req);
ArrayList list=Homelogindao.datadisplay(ds,rselection);
System.out.println("hello display admin");

req.setAttribute("list",list);
if(list!=null)
{
return map.findForward("admindata");
}
else
{
return map.findForward("admin");
}

} catch (Exception e) {
e.printStackTrace();
}
return null;

76
Online Complaint Management System

public ActionForward employee(ActionMapping map, ActionForm


form, HttpServletRequest req, HttpServletResponse res) throws
Exception {

Roleselectionform rselection=(Roleselectionform)form;
System.out.println("hello employee");
try {

DataSource ds=getDataSource(req);

ArrayList list=Homelogindao.datadisplay(ds,rselection);

req.setAttribute("list",list);
if(list!=null)
{
return map.findForward("employeedata");
}
else
{
return map.findForward("admin");
}

} catch (Exception e) {
e.printStackTrace();
}
return null;

77
Online Complaint Management System

public ActionForward customer(ActionMapping map, ActionForm


form, HttpServletRequest req, HttpServletResponse res) throws
Exception {

Roleselectionform rselection=(Roleselectionform)form;

try {

DataSource ds=getDataSource(req);
ArrayList list=Homelogindao.datadisplay(ds,rselection);

req.setAttribute("list",list);
if(list!=null)
{
return map.findForward("customerdata");
}
else
{
return map.findForward("admin");
}

} catch (Exception e) {
e.printStackTrace();
}
return null;

public ActionForward employeedelete(ActionMapping map,


ActionForm form, HttpServletRequest req, HttpServletResponse res)
throws Exception {

78
Online Complaint Management System

return map.findForward("OCMSdeleteuser");
}
public ActionForward customerdelete(ActionMapping map,
ActionForm form, HttpServletRequest req, HttpServletResponse res)
throws Exception {

return map.findForward("OCMSdeleteuser");

class3:editaction

package com.OCMS.actions;

import java.util.ArrayList;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.sql.DataSource;

import org.apache.struts.action.Action;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;

import com.OCMS.beans.Empprofileform1;

79
Online Complaint Management System

import com.OCMS.dbconnection.Homelogindao;

public class EditAction extends Action{


public ActionForward execute(ActionMapping map, ActionForm
form, HttpServletRequest req, HttpServletResponse res) throws
Exception {

Empprofileform1 empform1=(Empprofileform1)form;

String s1=empform1.getUsername();

try
{

DataSource ds=getDataSource(req);
ArrayList list= Homelogindao.updateemp(ds,empform1);

} catch (Exception e) {
e.printStackTrace();
}
return map.findForward("success");

}
}

class4:employeeaction

package com.OCMS.actions;

import java.util.ArrayList;

80
Online Complaint Management System

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import javax.sql.DataSource;

import org.apache.struts.action.Action;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;

import com.OCMS.beans.Searchform;
import com.OCMS.dbconnection.Homelogindao;

public class Employeeaction extends Action{

public ActionForward execute(ActionMapping map, ActionForm


form, HttpServletRequest req, HttpServletResponse res) throws
Exception {

Searchform sform=(Searchform)form;

try {

DataSource ds=getDataSource(req);
ArrayList
list12=Homelogindao.searchuser(ds,sform);
req.setAttribute("list12",list12);
if(list12!=null)
{
return
map.findForward("databyemployeesearch");
}
else
{

81
Online Complaint Management System

return map.findForward("invalidentry");
}

} catch (Exception e) {
e.printStackTrace();
}

return null;

class5:employeeprofileaction

package com.OCMS.actions;

import java.util.ArrayList;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import javax.sql.DataSource;

import org.apache.struts.action.Action;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;

import com.OCMS.beans.Searchform;
import com.OCMS.dbconnection.Homelogindao;

public class Employeeaction extends Action{

82
Online Complaint Management System

public ActionForward execute(ActionMapping map, ActionForm


form, HttpServletRequest req, HttpServletResponse res) throws
Exception {

Searchform sform=(Searchform)form;

try {

DataSource ds=getDataSource(req);
ArrayList
list12=Homelogindao.searchuser(ds,sform);
req.setAttribute("list12",list12);
if(list12!=null)
{
return
map.findForward("databyemployeesearch");
}
else
{
return map.findForward("invalidentry");
}

} catch (Exception e) {
e.printStackTrace();
}

return null;

83
Online Complaint Management System

class6:empproductlist

package com.OCMS.actions;

import java.util.ArrayList;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.sql.DataSource;

import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.actions.DispatchAction;

import com.OCMS.beans.Productcategoryform;
import com.OCMS.dbconnection.Homelogindao;

public class Empproductlist extends DispatchAction{

public ActionForward shirt(ActionMapping map, ActionForm


form, HttpServletRequest req, HttpServletResponse res) throws
Exception {

Productcategoryform pform=(Productcategoryform)form;

try {

84
Online Complaint Management System

DataSource ds=getDataSource(req);
ArrayList
list23=Homelogindao.productdatadisplay(ds,pform);
//System.out.println("hellomethod product data
display");
req.setAttribute("list23",list23);
if(list23!=null)
{
return map.findForward("productcategory");
}
else
{
return map.findForward("searchbyinvalid");
}

} catch (Exception e) {
e.printStackTrace();
}
return null;

public ActionForward trouser(ActionMapping map, ActionForm


form, HttpServletRequest req, HttpServletResponse res) throws
Exception {

Productcategoryform pform=(Productcategoryform)form;
try {

DataSource ds=getDataSource(req);
ArrayList
list23=Homelogindao.productdatadisplay(ds,pform);

85
Online Complaint Management System

req.setAttribute("list23",list23);
if(list23!=null)
{
return map.findForward("productcategory");
}
else
{
return map.findForward("searchbyinvalid");
}

} catch (Exception e) {
e.printStackTrace();
}
return null;

Class7:empproductsearch

package com.OCMS.actions;

import java.util.ArrayList;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

86
Online Complaint Management System

import javax.sql.DataSource;

import org.apache.struts.action.Action;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;

import com.OCMS.beans.Productlistform;
import com.OCMS.dbconnection.Homelogindao;

public class Empproductsearch extends Action{

public ActionForward execute(ActionMapping map, ActionForm


form, HttpServletRequest req, HttpServletResponse res) throws
Exception {

Productlistform pform=(Productlistform)form;
try {

DataSource ds=getDataSource(req);
ArrayList
list21=Homelogindao.searchproduct(ds,pform);
req.setAttribute("list21",list21);
if(list21!=null)
{
return map.findForward("product");
}
else
{
return map.findForward("searchbyinvalid");
}

} catch (Exception e) {
e.printStackTrace();

87
Online Complaint Management System

}
return null;

class8:homeloginaction

package com.OCMS.actions;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;

import javax.servlet.RequestDispatcher;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.sql.DataSource;

import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.actions.DispatchAction;

import com.OCMS.beans.Homeloginform;

public class Homeloginaction extends DispatchAction{

88
Online Complaint Management System

ResultSet rs=null;
Connection conn=null;

public ActionForward admin(ActionMapping map, ActionForm


form, HttpServletRequest req, HttpServletResponse res) throws
Exception {
Homeloginform hlf=(Homeloginform)form;

try {
DataSource ds=getDataSource(req);
String s1=hlf.getUsername();
String s2=hlf.getPassword();
String s3=hlf.getRole();
conn=ds.getConnection();
PreparedStatement ps=conn.prepareStatement("select
* from user_auth where username=? and password=? and role=?");
ps.setString(1,s1);
ps.setString(2,s2);
ps.setString(3,s3);

rs=ps.executeQuery();

if(rs.next())
{
return map.findForward("admin");

else
{
return map.findForward("invalid");

89
Online Complaint Management System

} catch (Exception e) {
e.printStackTrace();
}

return null;
}
public ActionForward employee(ActionMapping
map, ActionForm form, HttpServletRequest req, HttpServletResponse
res) throws Exception {
Homeloginform hlf=(Homeloginform)form;
System.out.println("resulet setfffff");

try {
DataSource ds=getDataSource(req);
String s1=hlf.getUsername();
String s2=hlf.getPassword();
String s3=hlf.getRole();
conn=ds.getConnection();
System.out.println("resulet set");
PreparedStatement
ps=conn.prepareStatement("select * from user_auth where username=?
and password=? and role=?");
System.out.println("resulet
setqqqqqqqq");
ps.setString(1,s1);
ps.setString(2,s2);
ps.setString(3,s3);

System.out.println("resulet
setqqqqqqqq");
rs=ps.executeQuery();
System.out.println("resulet
qqqqqqqqqqq");

90
Online Complaint Management System

if(rs.next())
{
/* String str1=rs.getString(1);
String str2=rs.getString(2);
String str3=rs.getString(3);*/

return
map.findForward("employee");

else
{
return map.findForward("invalid");

} catch (Exception e) {
e.printStackTrace();
}

return null;
}

public ActionForward
customer(ActionMapping map, ActionForm form, HttpServletRequest
req, HttpServletResponse res) throws Exception {
Homeloginform
hlf=(Homeloginform)form;

try {

91
Online Complaint Management System

DataSource
ds=getDataSource(req);
String s1=hlf.getUsername();
String s2=hlf.getPassword();
String s3=hlf.getRole();
conn=ds.getConnection();
PreparedStatement
ps=conn.prepareStatement("select * from user_auth where username=?
and password=? and role=?");
ps.setString(1,s1);
ps.setString(2,s2);
ps.setString(3,s3);

rs=ps.executeQuery();

if(rs.next())
{
return
map.findForward("customer");

else
{
return
map.findForward("invalid");

} catch (Exception e) {
e.printStackTrace();
}

92
Online Complaint Management System

finally
{
conn.close();
rs.close();
}

return null;

class9:homeloginactiondao

package com.OCMS.actions;

import java.util.ArrayList;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import javax.sql.DataSource;

import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.actions.DispatchAction;

import com.OCMS.beans.Homelogindto;

93
Online Complaint Management System

import com.OCMS.beans.Homeloginform;
import com.OCMS.dbconnection.Homelogindao;

public class Homeloginactiondao extends DispatchAction {

public ActionForward admin(ActionMapping map, ActionForm


form, HttpServletRequest req, HttpServletResponse res) throws
Exception {

try {

Homeloginform hlform=(Homeloginform)form;
DataSource ds=getDataSource(req);

Homelogindto list =
Homelogindao.user_auth(ds,hlform);

if(list!=null)
{
return map.findForward("admin");
}
else
{
return map.findForward("invalid");
}

} catch (Exception e) {
e.printStackTrace();
}

return null;

94
Online Complaint Management System

public ActionForward employee(ActionMapping map,


ActionForm form, HttpServletRequest req, HttpServletResponse res)
throws Exception {
Homeloginform hlform=(Homeloginform)form;

try {

DataSource ds=getDataSource(req);
Homelogindto list = Homelogindao.user_auth(ds,hlform);

if(list!=null)
{
req.setAttribute("ListContents",list);
return map.findForward("employee");
}
else
{
return map.findForward("invalid");
}

} catch (Exception e) {
e.printStackTrace();
}
return null;
}

public ActionForward customer(ActionMapping map,


ActionForm form, HttpServletRequest req, HttpServletResponse res)
throws Exception {
Homeloginform hlform=(Homeloginform)form;

95
Online Complaint Management System

try {
DataSource ds=getDataSource(req);
Homelogindto list = Homelogindao.user_auth(ds,hlform);

if(list!=null)
{
req.setAttribute("ListContents",list);
return map.findForward("customer");
}
else
{
return map.findForward("invalid");
}

} catch (Exception e) {
e.printStackTrace();
}
return null;
}

class10:Newuserloginaction

package com.OCMS.actions;

import java.util.ArrayList;

96
Online Complaint Management System

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.sql.DataSource;

import org.apache.struts.action.Action;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;

import com.OCMS.beans.Newuserloginform;
import com.OCMS.dbconnection.Homelogindao;

public class Newuserloginaction extends Action {

public ActionForward execute(ActionMapping map, ActionForm


form, HttpServletRequest req, HttpServletResponse res) throws
Exception {

Newuserloginform newloginform
=(Newuserloginform)form;

DataSource ds=getDataSource(req);
ArrayList list =
Homelogindao.insertuser(ds,newloginform);
System.out.println("new user login");

if(list!=null)
{

return map.findForward("alreadyexist");
}
else
{
return map.findForward("newusercongrat");
}

97
Online Complaint Management System

}
}

class11:Productcategoryaction

package com.OCMS.actions;

import java.util.ArrayList;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.sql.DataSource;

import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.actions.DispatchAction;

import com.OCMS.beans.Productcategoryform;
import com.OCMS.dbconnection.Homelogindao;

public class Productcategoryaction extends DispatchAction {

public ActionForward shirt(ActionMapping map, ActionForm


form, HttpServletRequest req, HttpServletResponse res) throws
Exception {

Productcategoryform pform=(Productcategoryform)form;

try {

98
Online Complaint Management System

DataSource ds=getDataSource(req);
ArrayList
list125=Homelogindao.productdatadisplay(ds,pform);
//System.out.println("hellomethod product data
display");
req.setAttribute("list125",list125);
if(list125!=null)
{
return map.findForward("productlistcategory");
}
else
{
return map.findForward("searchbyinvalid");
}

} catch (Exception e) {
e.printStackTrace();
}
return null;

public ActionForward trouser(ActionMapping map, ActionForm


form, HttpServletRequest req, HttpServletResponse res) throws
Exception {

Productcategoryform pform=(Productcategoryform)form;
try {

DataSource ds=getDataSource(req);
ArrayList
list125=Homelogindao.productdatadisplay(ds,pform);

99
Online Complaint Management System

req.setAttribute("list125",list125);
if(list125!=null)
{
return
map.findForward("productlistcategory");
}
else
{
return map.findForward("searchbyinvalid");
}

} catch (Exception e) {
e.printStackTrace();
}
return null;

Class12:Productsearchaction

package com.OCMS.actions;

import java.util.ArrayList;

import javax.servlet.http.HttpServletRequest;

100
Online Complaint Management System

import javax.servlet.http.HttpServletResponse;
import javax.sql.DataSource;

import org.apache.struts.action.Action;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;

import com.OCMS.beans.Productlistform;
import com.OCMS.dbconnection.Homelogindao;

public class Productsearchaction extends Action{


public ActionForward execute(ActionMapping map, ActionForm form,
HttpServletRequest req, HttpServletResponse res) throws Exception {

Productlistform pform=(Productlistform)form;
try {

DataSource ds=getDataSource(req);
ArrayList list124=Homelogindao.searchproduct(ds,pform);
req.setAttribute("list124",list124);
if(list124!=null)
{
return map.findForward("productlistshow");
}
else
{
return map.findForward("searchbyinvalid");
}

} catch (Exception e) {
e.printStackTrace();
}

101
Online Complaint Management System

return null;

class13:searchaction

package com.OCMS.actions;
import java.util.ArrayList;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.sql.DataSource;
import org.apache.struts.action.Action;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import com.OCMS.beans.Roleselectionform;
import com.OCMS.beans.Searchform;
import com.OCMS.dbconnection.Homelogindao;
public class Searchaction extends Action{
public ActionForward execute(ActionMapping map, ActionForm
form, HttpServletRequest req, HttpServletResponse res) throws
Exception {
Searchform sform=(Searchform)form;
try {
DataSource ds=getDataSource(req);
ArrayList list123=Homelogindao.searchuser(ds,sform);
req.setAttribute("list123",list123);
if(list123!=null)
{
return map.findForward("adminsearchdata");
}
else

102
Online Complaint Management System

{
return map.findForward("searchbyinvalid");
}
} catch (Exception e)
{
e.printStackTrace();
}
return null;
}
}

Java Beans

Class1:Deletedto

package com.OCMS.beans;

import java.io.Serializable;

public class Deletedto implements Serializable{


protected String username;

public String getUsername() {


return username;
}

public void setUsername(String username) {


this.username = username;
}

class2:Controlform

103
Online Complaint Management System

package com.OCMS.beans;

import javax.servlet.http.HttpServletRequest;

import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionMapping;

public class Deleteform extends ActionForm{


protected String username;

public String getUsername() {


return username;
}

public void setUsername(String username) {


this.username = username;
}

public void reset(ActionMapping map, HttpServletRequest req) {

this.username="";
}
}

class3:Empprofiledto

package com.OCMS.beans;

import java.io.Serializable;

public class Empprofiledto implements Serializable{


protected String username;
protected String password;
protected String firstname;

104
Online Complaint Management System

protected String middlename;


protected String lastname;
protected String role;
protected String address1;
protected String address2;
protected String city;
protected String state;
protected String pincode;
protected String emailid;
protected String phonenumber;
public String getAddress1() {
return address1;
}
public void setAddress1(String address1) {
this.address1 = address1;
}
public String getAddress2() {
return address2;
}
public void setAddress2(String address2) {
this.address2 = address2;
}
public String getCity() {
return city;
}
public void setCity(String city) {
this.city = city;
}
public String getEmailid() {
return emailid;
}
public void setEmailid(String emailid) {
this.emailid = emailid;
}
public String getFirstname() {
return firstname;
}

105
Online Complaint Management System

public void setFirstname(String firstname) {


this.firstname = firstname;
}
public String getLastname() {
return lastname;
}
public void setLastname(String lastname) {
this.lastname = lastname;
}
public String getMiddlename() {
return middlename;
}
public void setMiddlename(String middlename) {
this.middlename = middlename;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
public String getPhonenumber() {
return phonenumber;
}
public void setPhonenumber(String phonenumber) {
this.phonenumber = phonenumber;
}
public String getPincode() {
return pincode;
}
public void setPincode(String pincode) {
this.pincode = pincode;
}
public String getRole() {
return role;
}
public void setRole(String role) {

106
Online Complaint Management System

this.role = role;
}
public String getState() {
return state;
}
public void setState(String state) {
this.state = state;
}
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}

class4:Empprofileform

package com.OCMS.beans;

import javax.servlet.http.HttpServletRequest;

import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionMapping;

public class Empprofileform extends ActionForm{

protected String username;


protected String password;
protected String firstname;
protected String middlename;

107
Online Complaint Management System

protected String lastname;


protected String role;
protected String address1;
protected String address2;
protected String city;
protected String state;
protected String pincode;
protected String emailid;
protected String phonenumber;
public String getAddress1() {
return address1;
}
public void setAddress1(String address1) {
this.address1 = address1;
}
public String getAddress2() {
return address2;
}
public void setAddress2(String address2) {
this.address2 = address2;
}
public String getCity() {
return city;
}
public void setCity(String city) {
this.city = city;
}
public String getEmailid() {
return emailid;
}
public void setEmailid(String emailid) {
this.emailid = emailid;
}
public String getFirstname() {
return firstname;
}
public void setFirstname(String firstname) {

108
Online Complaint Management System

this.firstname = firstname;
}
public String getLastname() {
return lastname;
}
public void setLastname(String lastname) {
this.lastname = lastname;
}
public String getMiddlename() {
return middlename;
}
public void setMiddlename(String middlename) {
this.middlename = middlename;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
public String getPhonenumber() {
return phonenumber;
}
public void setPhonenumber(String phonenumber) {
this.phonenumber = phonenumber;
}
public String getPincode() {
return pincode;
}
public void setPincode(String pincode) {
this.pincode = pincode;
}
public String getRole() {
return role;
}
public void setRole(String role) {
this.role = role;

109
Online Complaint Management System

}
public String getState() {
return state;
}
public void setState(String state) {
this.state = state;
}
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}

class5:Empprofileform1

package com.OCMS.beans;

import javax.servlet.http.HttpServletRequest;

import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionMapping;

public class Empprofileform1 extends ActionForm{


protected String username;
protected String password;
protected String firstname;
protected String middlename;
protected String lastname;
protected String role;

110
Online Complaint Management System

protected String address1;


protected String address2;
protected String city;
protected String state;
protected String pincode;
protected String emailid;
protected String phonenumber;
public String getAddress1() {
return address1;
}
public void setAddress1(String address1) {
this.address1 = address1;
}
public String getAddress2() {
return address2;
}
public void setAddress2(String address2) {
this.address2 = address2;
}
public String getCity() {
return city;
}
public void setCity(String city) {
this.city = city;
}
public String getEmailid() {
return emailid;
}
public void setEmailid(String emailid) {
this.emailid = emailid;
}
public String getFirstname() {
return firstname;
}
public void setFirstname(String firstname) {
this.firstname = firstname;
}

111
Online Complaint Management System

public String getLastname() {


return lastname;
}
public void setLastname(String lastname) {
this.lastname = lastname;
}
public String getMiddlename() {
return middlename;
}
public void setMiddlename(String middlename) {
this.middlename = middlename;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
public String getPhonenumber() {
return phonenumber;
}
public void setPhonenumber(String phonenumber) {
this.phonenumber = phonenumber;
}
public String getPincode() {
return pincode;
}
public void setPincode(String pincode) {
this.pincode = pincode;
}
public String getRole() {
return role;
}
public void setRole(String role) {
this.role = role;
}
public String getState() {

112
Online Complaint Management System

return state;
}
public void setState(String state) {
this.state = state;
}

public String getUsername() {


return username;
}
public void setUsername(String username) {
this.username = username;
}
}

class6:homelogindto

package com.OCMS.beans;

import java.io.Serializable;

public class Homelogindto implements Serializable {

String username;
String password;
String role;
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
public String getRole() {
return role;
}
public void setRole(String role) {
this.role = role;

113
Online Complaint Management System

}
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}

class7:Homeloginform

package com.OCMS.beans;

import javax.servlet.http.HttpServletRequest;

import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionMapping;

public class Homeloginform extends ActionForm{

String username;
String password;
String role;

public String getPassword() {


return password;
}
public void setPassword(String password) {
this.password = password;
}
public String getRole() {
return role;
}

114
Online Complaint Management System

public void setRole(String role) {


this.role = role;
}
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}

public void reset(ActionMapping map, HttpServletRequest req) {

this.username=null;
this.password=null;
this.role=null;
}
}

class8:Newuserlogindto

package com.OCMS.beans;

import java.io.Serializable;

public class Newuserlogindto implements Serializable{

protected String username;


protected String password;
protected String pass1;
protected String firstname;
protected String middlename;
protected String lastname;
protected String role;
protected String address1;

115
Online Complaint Management System

protected String address2;


protected String city;
protected String state;
protected String pincode;
protected String emailid;
protected String phonenumber;
public String getAddress1() {
return address1;
}
public void setAddress1(String address1) {
this.address1 = address1;
}
public String getAddress2() {
return address2;
}
public void setAddress2(String address2) {
this.address2 = address2;
}
public String getCity() {
return city;
}
public void setCity(String city) {
this.city = city;
}
public String getEmailid() {
return emailid;
}
public void setEmailid(String emailid) {
this.emailid = emailid;
}
public String getFirstname() {
return firstname;
}
public void setFirstname(String firstname) {
this.firstname = firstname;
}
public String getLastname() {

116
Online Complaint Management System

return lastname;
}
public void setLastname(String lastname) {
this.lastname = lastname;
}
public String getMiddlename() {
return middlename;
}
public void setMiddlename(String middlename) {
this.middlename = middlename;
}
public String getPass1() {
return pass1;
}
public void setPass1(String pass1) {
this.pass1 = pass1;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
public String getPhonenumber() {
return phonenumber;
}
public void setPhonenumber(String phonenumber) {
this.phonenumber = phonenumber;
}
public String getPincode() {
return pincode;
}
public void setPincode(String pincode) {
this.pincode = pincode;
}
public String getRole() {
return role;

117
Online Complaint Management System

}
public void setRole(String role) {
this.role = role;
}
public String getState() {
return state;
}
public void setState(String state) {
this.state = state;
}
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}

class:9Newuserloginform

package com.OCMS.beans;

import javax.servlet.http.HttpServletRequest;

import org.apache.struts.action.ActionMapping;
import org.apache.struts.validator.ValidatorForm;

public class Newuserloginform extends ValidatorForm{

protected String username;


protected String password;
protected String pass1;
protected String firstname;
protected String middlename;

118
Online Complaint Management System

protected String lastname;


protected String role;
protected String address1;
protected String address2;
protected String city;
protected String state;
protected String pincode;
protected String emailid;
protected String phonenumber;

public String getAddress1() {


return address1;
}

public void setAddress1(String address1) {


this.address1 = address1;
}

public String getAddress2() {


return address2;
}

public void setAddress2(String address2) {


this.address2 = address2;
}

public String getCity() {

119
Online Complaint Management System

return city;
}

public void setCity(String city) {


this.city = city;
}

public String getEmailid() {


return emailid;
}

public void setEmailid(String emailid) {


this.emailid = emailid;
}

public String getFirstname() {


return firstname;
}

public void setFirstname(String firstname) {


this.firstname = firstname;
}

public String getLastname() {


return lastname;

120
Online Complaint Management System

public void setLastname(String lastname) {


this.lastname = lastname;
}

public String getMiddlename() {


return middlename;
}

public void setMiddlename(String middlename) {


this.middlename = middlename;
}

public String getPass1() {


return pass1;
}

public void setPass1(String pass1) {


this.pass1 = pass1;
}

public String getPassword() {


return password;
}

121
Online Complaint Management System

public void setPassword(String password) {


this.password = password;
}

public String getPhonenumber() {


return phonenumber;
}

public void setPhonenumber(String phonenumber) {


this.phonenumber = phonenumber;
}

public String getPincode() {


return pincode;
}

public void setPincode(String pincode) {


this.pincode = pincode;
}

public String getRole() {


return role;
}

122
Online Complaint Management System

public void setRole(String role) {


this.role = role;
}

public String getState() {


return state;
}

public void setState(String state) {


this.state = state;
}

public String getUsername() {


return username;
}

public void setUsername(String username) {


this.username = username;
}

public void reset(ActionMapping map, HttpServletRequest req) {


this.username="";
this.password="";
this.pass1="";
this.firstname="";

123
Online Complaint Management System

this.middlename="";
this.lastname="";
this.role="";
this.address1="";
this.address2="";
this.city="";
this.state="";
this.pincode="";
this.emailid="";
this.phonenumber="";

class10:Productcategorydto

package com.OCMS.beans;

import java.io.Serializable;

public class Productcategorydto implements Serializable{

protected String id;


protected String name;
protected String description;
protected double price;
protected String category;
public String getCategory() {
return category;
}
public void setCategory(String category) {
this.category = category;
}
public String getDescription() {

124
Online Complaint Management System

return description;
}
public void setDescription(String description) {
this.description = description;
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public double getPrice() {
return price;
}
public void setPrice(double price) {
this.price = price;
}

}
class11:Productcategoryform

package com.OCMS.beans;

import javax.servlet.http.HttpServletRequest;

import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionMapping;

public class Productcategoryform extends ActionForm{

protected String category;

125
Online Complaint Management System

public String getCategory() {


return category;
}

public void setCategory(String category) {


this.category = category;
}

public void reset(ActionMapping map, HttpServletRequest req) {

this.category="";

class12:Productlistdto

package com.OCMS.beans;

import java.io.Serializable;

public class Productlistdto implements Serializable{

protected String id;


protected String name;
protected String description;
protected double price;
protected String category;
public String getCategory() {
return category;
}
public void setCategory(String category) {
this.category = category;
}
public String getDescription() {

126
Online Complaint Management System

return description;
}
public void setDescription(String description) {
this.description = description;
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public double getPrice() {
return price;
}
public void setPrice(double price) {
this.price = price;
}

class13:Productlistform

package com.OCMS.beans;

import javax.servlet.http.HttpServletRequest;

import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionMapping;

public class Productlistform extends ActionForm{

127
Online Complaint Management System

protected String id;


protected String name;
protected String description;
protected double price;
protected String category;
public String getCategory() {
return category;
}
public void setCategory(String category) {
this.category = category;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}

public double getPrice() {


return price;
}
public void setPrice(double price) {
this.price = price;

128
Online Complaint Management System

}
public void reset(ActionMapping map, HttpServletRequest req) {
this.id="";
this.name="";
this.description="";
this.price=0;
this.category="";

class14:Roleslectiondto

package com.OCMS.beans;

import java.io.Serializable;

public class Roleselectiondto implements Serializable{


protected String username;
protected String password;
protected String firstname;
protected String middlename;
protected String lastname;
protected String role;
protected String address1;
protected String address2;
protected String city;
protected String state;
protected String pincode;
protected String emailid;
protected String phonenumber;
protected String role1;
public String getAddress1() {
return address1;
}

129
Online Complaint Management System

public void setAddress1(String address1) {


this.address1 = address1;
}
public String getAddress2() {
return address2;
}
public void setAddress2(String address2) {
this.address2 = address2;
}
public String getCity() {
return city;
}
public void setCity(String city) {
this.city = city;
}
public String getEmailid() {
return emailid;
}
public void setEmailid(String emailid) {
this.emailid = emailid;
}

public String getLastname() {


return lastname;
}
public void setLastname(String lastname) {
this.lastname = lastname;
}

public String getPhonenumber() {


return phonenumber;
}
public void setPhonenumber(String phonenumber) {
this.phonenumber = phonenumber;
}
public String getPincode() {
return pincode;

130
Online Complaint Management System

}
public void setPincode(String pincode) {
this.pincode = pincode;
}
public String getRole() {
return role;
}
public void setRole(String role) {
this.role = role;
}
public String getState() {
return state;
}
public void setState(String state) {
this.state = state;
}
public String getFirstname() {
return firstname;
}
public void setFirstname(String firstname) {
this.firstname = firstname;
}
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}

public String getMiddlename() {


return middlename;

131
Online Complaint Management System

}
public void setMiddlename(String middlename) {
this.middlename = middlename;
}
public String getRole1() {
return role1;
}
public void setRole1(String role1) {
this.role1 = role1;
}

class15:Roleselectionform

package com.OCMS.beans;

import javax.servlet.http.HttpServletRequest;

import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionMapping;

public class Roleselectionform extends ActionForm {

protected String username;


protected String password;
protected String firstname;
protected String middlename;
protected String lastname;
protected String role;
protected String address1;
protected String address2;
protected String city;
protected String state;
protected String pincode;

132
Online Complaint Management System

protected String emailid;


protected String phonenumber;
protected String role1;

public String getAddress1() {


return address1;
}
public void setAddress1(String address1) {
this.address1 = address1;
}
public String getAddress2() {
return address2;
}
public void setAddress2(String address2) {
this.address2 = address2;
}
public String getCity() {
return city;
}
public void setCity(String city) {
this.city = city;
}
public String getEmailid() {
return emailid;
}
public void setEmailid(String emailid) {
this.emailid = emailid;
}
public String getFirstname() {
return firstname;
}
public void setFirstname(String firstname) {
this.firstname = firstname;
}

133
Online Complaint Management System

public String getLastname() {


return lastname;
}
public void setLastname(String lastname) {
this.lastname = lastname;
}
public String getMiddlename() {
return middlename;
}
public void setMiddlename(String middlename) {
this.middlename = middlename;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
public String getPhonenumber() {
return phonenumber;
}
public void setPhonenumber(String phonenumber) {
this.phonenumber = phonenumber;
}
public String getPincode() {
return pincode;
}
public void setPincode(String pincode) {
this.pincode = pincode;
}
public String getRole() {
return role;
}
public void setRole(String role) {
this.role = role;
}
public String getState() {

134
Online Complaint Management System

return state;
}
public void setState(String state) {
this.state = state;
}
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}

public String getRole1() {


return role1;
}
public void setRole1(String role1) {
this.role1 = role1;
}
public void reset(ActionMapping map, HttpServletRequest req) {
this.username="";
this.password="";
this.firstname="";
this.middlename="";
this.lastname="";
this.role="";
this.address1="";
this.address2="";
this.city="";
this.state="";
this.pincode="";
this.emailid="";
this.phonenumber="";
this.role1="";

135
Online Complaint Management System

class16:Searchdto

package com.OCMS.beans;

import java.io.Serializable;

public class Searchdto implements Serializable{


protected String username;
protected String password;
protected String firstname;
protected String middlename;
protected String lastname;
protected String role;
protected String address1;
protected String address2;
protected String city;
protected String state;
protected String pincode;
protected String emailid;
protected String phonenumber;
public String getAddress1() {
return address1;
}
public void setAddress1(String address1) {
this.address1 = address1;
}
public String getAddress2() {
return address2;
}
public void setAddress2(String address2) {
this.address2 = address2;
}
public String getCity() {
return city;
}

136
Online Complaint Management System

public void setCity(String city) {


this.city = city;
}
public String getEmailid() {
return emailid;
}
public void setEmailid(String emailid) {
this.emailid = emailid;
}
public String getFirstname() {
return firstname;
}
public void setFirstname(String firstname) {
this.firstname = firstname;
}
public String getLastname() {
return lastname;
}
public void setLastname(String lastname) {
this.lastname = lastname;
}
public String getMiddlename() {
return middlename;
}
public void setMiddlename(String middlename) {
this.middlename = middlename;
}
public String getPhonenumber() {
return phonenumber;
}
public void setPhonenumber(String phonenumber) {
this.phonenumber = phonenumber;
}
public String getPincode() {
return pincode;
}
public void setPincode(String pincode) {

137
Online Complaint Management System

this.pincode = pincode;
}
public String getRole() {
return role;
}
public void setRole(String role) {
this.role = role;
}
public String getState() {
return state;
}
public void setState(String state) {
this.state = state;
}
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}

class17:Searchform

package com.OCMS.beans;

import javax.servlet.http.HttpServletRequest;

import org.apache.struts.action.ActionForm;

138
Online Complaint Management System

import org.apache.struts.action.ActionMapping;

public class Searchform extends ActionForm{

protected String username;


protected String password;
protected String firstname;
protected String middlename;
protected String lastname;
protected String role;
protected String address1;
protected String address2;
protected String city;
protected String state;
protected String pincode;
protected String emailid;
protected String phonenumber;
public String getAddress1() {
return address1;
}
public void setAddress1(String address1) {
this.address1 = address1;
}
public String getAddress2() {
return address2;
}
public void setAddress2(String address2) {
this.address2 = address2;
}
public String getCity() {
return city;
}
public void setCity(String city) {
this.city = city;
}
public String getEmailid() {

139
Online Complaint Management System

return emailid;
}
public void setEmailid(String emailid) {
this.emailid = emailid;
}
public String getFirstname() {
return firstname;
}
public void setFirstname(String firstname) {
this.firstname = firstname;
}
public String getLastname() {
return lastname;
}
public void setLastname(String lastname) {
this.lastname = lastname;
}
public String getMiddlename() {
return middlename;
}
public void setMiddlename(String middlename) {
this.middlename = middlename;
}
public String getPhonenumber() {
return phonenumber;
}
public void setPhonenumber(String phonenumber) {
this.phonenumber = phonenumber;
}
public String getPincode() {
return pincode;
}
public void setPincode(String pincode) {
this.pincode = pincode;
}
public String getRole() {
return role;

140
Online Complaint Management System

}
public void setRole(String role) {
this.role = role;
}
public String getState() {
return state;
}
public void setState(String state) {
this.state = state;
}
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}

public String getPassword() {


return password;
}
public void setPassword(String password) {
this.password = password;
}
public void reset(ActionMapping map, HttpServletRequest req) {
this.username="";
this.password="";
this.firstname="";
this.middlename="";
this.lastname="";
this.role="";
this.address1="";
this.address2="";
this.city="";
this.state="";
this.pincode="";
this.emailid="";
this.phonenumber="";

141
Online Complaint Management System

Dbconnection

Class1:Dbconnectionfactory

package com.OCMS.dbconnection;
import java.sql.Connection;
import java.sql.SQLException;

import javax.naming.InitialContext;
import javax.naming.NamingException;
import javax.sql.DataSource;

public class Dbconnectionfactory {


private Dbconnectionfactory()
{}
private static Dbconnectionfactory instance;

public static Dbconnectionfactory getInstance()


{
if(instance== null)
{
instance=new Dbconnectionfactory();
}

return instance;
}
public Connection getConnection()
{ Connection con=null;
try {
InitialContext ctx=new InitialContext();

142
Online Complaint Management System

DataSource ds=(DataSource)ctx.lookup("jndiname");
con=ds.getConnection();

} catch (SQLException e) {

e.printStackTrace();
}

catch (NamingException e) {

e.printStackTrace();
}

return con;
}
}

class2:Homelogindao

package com.OCMS.dbconnection;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.ArrayList;

import javax.sql.DataSource;

import com.OCMS.beans.Deletedto;
import com.OCMS.beans.Deleteform;
import com.OCMS.beans.Empprofiledto;
import com.OCMS.beans.Empprofileform;

143
Online Complaint Management System

import com.OCMS.beans.Empprofileform1;
import com.OCMS.beans.Homelogindto;
import com.OCMS.beans.Homeloginform;
import com.OCMS.beans.Newuserlogindto;
import com.OCMS.beans.Newuserloginform;
import com.OCMS.beans.Productcategorydto;
import com.OCMS.beans.Productcategoryform;
import com.OCMS.beans.Productlistdto;
import com.OCMS.beans.Productlistform;
import com.OCMS.beans.Roleselectiondto;
import com.OCMS.beans.Roleselectionform;
import com.OCMS.beans.Searchdto;
import com.OCMS.beans.Searchform;

public class Homelogindao {

static Connection
con=Dbconnectionfactory.getInstance().getConnection();

public static Homelogindto user_auth(DataSource


ds,Homeloginform hlf)
{
Homelogindto hldto=new Homelogindto();
ResultSet rs=null;
PreparedStatement pstmt=null;
try {

String s1=hlf.getUsername();
String s2=hlf.getPassword();
String s3=hlf.getRole();
con=ds.getConnection();

pstmt=con.prepareStatement("select * from user_auth


where username=? and password=? and role=?");

144
Online Complaint Management System

pstmt.setString(1,s1);
pstmt.setString(2,s2);
pstmt.setString(3,s3);

rs=pstmt.executeQuery();

if(rs.next())
{

hldto.setUsername(rs.getString("username"));
hldto.setPassword(rs.getString("password"));
hldto.setRole(rs.getString("role"));
return hldto;

}
else
{
return null;
}

} catch (SQLException e) {

e.printStackTrace();
}

return hldto;

public static ArrayList insertuser(DataSource


ds,Newuserloginform newloginform)
{

145
Online Complaint Management System

ArrayList list1= new ArrayList();


ResultSet rs1=null;

try {
String s1=newloginform.getUsername();
String s2= newloginform.getPassword();
String s3= newloginform.getFirstname();
String s4 = newloginform.getMiddlename();
String s5= newloginform.getLastname();
String s6= newloginform.getRole();
String s7= newloginform.getAddress1();
String s8= newloginform.getAddress2();
String s9= newloginform.getCity();
String s10= newloginform.getState();
String s11= newloginform.getPincode();
String s12= newloginform.getEmailid();
String s13= newloginform.getPhonenumber();
con=ds.getConnection();

PreparedStatement
pstmt1=con.prepareStatement("select * from user_auth where
username = ? ");
pstmt1.setString(1,s1);
rs1=pstmt1.executeQuery();

if(rs1.next())
{

Newuserlogindto newlogindto = new


Newuserlogindto();

newlogindto.setUsername(rs1.getString("username"));
list1.add(newlogindto);
//return list1;

146
Online Complaint Management System

else if(s6.equals("customer"))
{

PreparedStatement
pstmt11=con.prepareStatement("insert into customer_profile
values(?,?,?,?,?,?,?,?,?,?,?,?,?)");
pstmt11.setString(1,s1);
pstmt11.setString(2,s2);
pstmt11.setString(3,s3);
pstmt11.setString(4,s4);
pstmt11.setString(5,s5);
pstmt11.setString(6,s6);
pstmt11.setString(7,s7);
pstmt11.setString(8,s8);
pstmt11.setString(9,s9);
pstmt11.setString(10,s10);
pstmt11.setString(11,s11);
pstmt11.setString(12,s12);
pstmt11.setString(13,s13);

PreparedStatement
pstmt111=con.prepareStatement("insert into user_auth values(?,?,?)");
pstmt111.setString(1,s1);
pstmt111.setString(2,s2);
pstmt111.setString(3,s6);

pstmt111.executeUpdate();
pstmt11.executeUpdate();

return null;

147
Online Complaint Management System

else if(s6.equals("employee"))
{
System.out.println("hello employee");
PreparedStatement
p1=con.prepareStatement("insert into employee_profile
values(?,?,?,?,?,?,?,?,?,?,?,?,?)");
p1.setString(1,s1);
p1.setString(2,s2);
p1.setString(3,s3);
p1.setString(4,s4);
p1.setString(5,s5);
p1.setString(6,s6);
p1.setString(7,s7);
p1.setString(8,s8);
p1.setString(9,s9);
p1.setString(10,s10);
p1.setString(11,s11);
p1.setString(12,s12);
p1.setString(13,s13);

PreparedStatement
p2=con.prepareStatement("insert into user_auth values(?,?,?)");
p2.setString(1,s1);
p2.setString(2,s2);
p2.setString(3,s6);

p2.executeUpdate();
p1.executeUpdate();
System.out.println("Data Insert");
return null;

else

148
Online Complaint Management System

{
return null;

}
catch (Exception e) {

e.printStackTrace();
}

return list1;
}

public static ArrayList datadisplay(DataSource


ds,Roleselectionform rselection)
{
ArrayList list2= new ArrayList();
ResultSet rs2=null;

try {

con=ds.getConnection();
String s1=rselection.getRole();

System.out.println("hello first");
if(s1.equals("admin"))
{

Statement ps=con.createStatement();
rs2=ps.executeQuery("select * from admin_profile");

149
Online Complaint Management System

while(rs2.next())
{
Roleselectiondto rdto=new Roleselectiondto();
rdto.setUsername(rs2.getString("username"));
rdto.setPassword(rs2.getString("password"));
rdto.setFirstname(rs2.getString("firstname"));

rdto.setMiddlename(rs2.getString("middlename"));
rdto.setLastname(rs2.getString("lastname"));
rdto.setRole(rs2.getString("role"));
rdto.setPincode(rs2.getString("pincode"));
rdto.setAddress1(rs2.getString("address1"));
rdto.setAddress2(rs2.getString("address2"));
rdto.setCity(rs2.getString("city"));
rdto.setState(rs2.getString("state"));
rdto.setPincode(rs2.getString("pincode"));
rdto.setEmailid(rs2.getString("emailid"));

rdto.setPhonenumber(rs2.getString("phonenumber"));
list2.add(rdto);

}
else if(s1.equals("customer"))
{

Statement ps=con.createStatement();
rs2=ps.executeQuery("select * from customer_profile");

while(rs2.next())
{
Roleselectiondto rdto=new Roleselectiondto();
rdto.setUsername(rs2.getString("username"));
rdto.setPassword(rs2.getString("password"));
rdto.setFirstname(rs2.getString("firstname"));

150
Online Complaint Management System

rdto.setMiddlename(rs2.getString("middlename"));
rdto.setLastname(rs2.getString("lastname"));
rdto.setRole(rs2.getString("role"));
rdto.setAddress1(rs2.getString("address1"));
rdto.setAddress2(rs2.getString("address2"));
rdto.setCity(rs2.getString("city"));
rdto.setState(rs2.getString("state"));
rdto.setPincode(rs2.getString("pincode"));
rdto.setEmailid(rs2.getString("emailid"));

rdto.setPhonenumber(rs2.getString("phonenumber"));

list2.add(rdto);

else if(s1.equals("employee"))
{

Statement ps=con.createStatement();
rs2=ps.executeQuery("select * from employee_profile");

while(rs2.next())
{
Roleselectiondto rdto=new Roleselectiondto();
rdto.setUsername(rs2.getString("username"));
rdto.setPassword(rs2.getString("password"));
rdto.setFirstname(rs2.getString("firstname"));

151
Online Complaint Management System

rdto.setMiddlename(rs2.getString("middlename"));
rdto.setLastname(rs2.getString("lastname"));
rdto.setRole(rs2.getString("role"));
rdto.setAddress1(rs2.getString("address1"));
rdto.setAddress2(rs2.getString("address2"));
rdto.setCity(rs2.getString("city"));
rdto.setState(rs2.getString("state"));
rdto.setPincode(rs2.getString("pincode"));
rdto.setEmailid(rs2.getString("emailid"));

rdto.setPhonenumber(rs2.getString("phonenumber"));

list2.add(rdto);

} catch (SQLException e) {

e.printStackTrace();
}

return list2;

}
public static ArrayList deleteuser(DataSource ds,Deleteform dlf)
{
ArrayList list22= new ArrayList();
ResultSet rs2=null;
ResultSet rs3=null;

152
Online Complaint Management System

String s1=dlf.getUsername();

try
{
con=ds.getConnection();
PreparedStatement ps23=con.prepareStatement("select *
from user_auth where username = ?");
ps23.setString(1,s1);
rs3=ps23.executeQuery();
if(rs3.next())
{
Deletedto dto=new Deletedto();
dto.setUsername(rs3.getString("username"));
list22.add(dto);

PreparedStatement ps=con.prepareStatement("select * from


employee_profile where username=?");
ps.setString(1,s1);
rs2=ps.executeQuery();
if(rs2.next())
{
PreparedStatement ps1=con.prepareStatement("delete
from user_auth where username ='"+s1+"'");
PreparedStatement ps12=con.prepareStatement("delete
from employee_profile where username ='"+s1+"'");
ps12.executeUpdate();
ps1.executeUpdate();
}
else
{
PreparedStatement
ps1=con.prepareStatement("delete from user_auth where username
='"+s1+"'");
PreparedStatement
ps12=con.prepareStatement("delete from customer_profile where
username ='"+s1+"'");

153
Online Complaint Management System

ps12.executeUpdate();
ps1.executeUpdate();
}

}
else
{
return null;
}

} catch (SQLException e) {

e.printStackTrace();
}

return list22;
}

public static ArrayList searchuser(DataSource ds,Searchform


sform)
{
Searchdto sdto=new Searchdto();

ArrayList list6= new ArrayList();


ResultSet rs6=null;
ResultSet rs7=null;

String s1=sform.getUsername();

try
{
con=ds.getConnection();
PreparedStatement ps23=con.prepareStatement("select *
from user_auth where username = ?");
ps23.setString(1,s1);

154
Online Complaint Management System

rs6=ps23.executeQuery();
if(rs6.next())
{

sdto.setUsername(rs6.getString("username"));
PreparedStatement ps=con.prepareStatement("select
* from customer_profile where username=?");
ps.setString(1,s1);
rs7=ps.executeQuery();
if(rs7.next())
{

sdto.setUsername(rs7.getString("username"));
sdto.setPassword(rs7.getString("password"));
sdto.setFirstname(rs7.getString("firstname"));

sdto.setMiddlename(rs7.getString("middlename"));
sdto.setLastname(rs7.getString("lastname"));
sdto.setRole(rs7.getString("role"));
sdto.setAddress1(rs7.getString("address1"));
sdto.setAddress2(rs7.getString("address2"));
sdto.setCity(rs7.getString("city"));
sdto.setState(rs7.getString("state"));
sdto.setPincode(rs7.getString("pincode"));
sdto.setEmailid(rs7.getString("emailid"));

sdto.setPhonenumber(rs7.getString("phonenumber"));
list6.add(sdto);
}

else
{

PreparedStatement
ps11=con.prepareStatement("select * from employee_profile where
username=?");

155
Online Complaint Management System

ps11.setString(1,s1);
rs7=ps11.executeQuery();
while(rs7.next())
{
sdto.setUsername(rs7.getString("username"));
sdto.setPassword(rs7.getString("password"));
sdto.setFirstname(rs7.getString("firstname"));

sdto.setMiddlename(rs7.getString("middlename"));
sdto.setLastname(rs7.getString("lastname"));
sdto.setRole(rs7.getString("role"));
sdto.setAddress1(rs7.getString("address1"));
sdto.setAddress2(rs7.getString("address2"));
sdto.setCity(rs7.getString("city"));
sdto.setState(rs7.getString("state"));
sdto.setPincode(rs7.getString("pincode"));
sdto.setEmailid(rs7.getString("emailid"));

sdto.setPhonenumber(rs7.getString("phonenumber"));
list6.add(sdto);
}
}

}
else
{
return null;
}

}catch (Exception e) {
e.printStackTrace();
}
return list6;
}

156
Online Complaint Management System

public static ArrayList searchproduct(DataSource


ds,Productlistform pform)
{
Productlistdto pdto=new Productlistdto();
ArrayList list10= new ArrayList();
ResultSet rs10=null;

String s1=pform.getId();

try
{
con=ds.getConnection();
PreparedStatement ps23=con.prepareStatement("select *
from product_profile where id = ?");
ps23.setString(1,s1);
rs10=ps23.executeQuery();
if(rs10.next())
{
pdto.setId(rs10.getString("id"));
pdto.setName(rs10.getString("name"));
pdto.setDescription(rs10.getString("description"));
pdto.setPrice(rs10.getDouble("price"));
pdto.setCategory(rs10.getString("category"));
list10.add(pdto);
}
else
{
return null;
}
}catch (Exception e) {
e.printStackTrace();
}
return list10;
}

157
Online Complaint Management System

public static ArrayList productdatadisplay(DataSource


ds,Productcategoryform pform)
{

Productcategorydto pdto=null;
ArrayList list22=new ArrayList();
ResultSet rs22=null;

try {

con=ds.getConnection();
String s1=pform.getCategory();
PreparedStatement ps=con.prepareStatement("select
* from product_profile where category =?");
ps.setString(1,s1);
rs22=ps.executeQuery();

while(rs22.next())
{

pdto=new Productcategorydto();
pdto.setCategory(rs22.getString("category"));
pdto.setId(rs22.getString("id"));
pdto.setName(rs22.getString("name"));

pdto.setDescription(rs22.getString("description"));
pdto.setPrice(rs22.getDouble("price"));
list22.add(pdto);

158
Online Complaint Management System

}catch (Exception e) {
e.printStackTrace();
}
return list22;

public static Empprofileform1 Profile(DataSource


ds,Empprofileform eform)
{

ResultSet rs3=null;
ResultSet rs4=null;
Empprofileform1 eform1=new Empprofileform1();

try {

con=ds.getConnection();
String s1=eform.getUsername();
System.out.println("hello "+s1);
Statement ps=con.createStatement();
Statement ps1=con.createStatement();
rs3=ps.executeQuery("select * from
employee_profile where username='"+s1+"'");

if(rs3.next())
{

eform1.setUsername(rs3.getString("username"));

eform1.setPassword(rs3.getString("password"));

159
Online Complaint Management System

eform1.setFirstname(rs3.getString("firstname"));

eform1.setMiddlename(rs3.getString("middlename"));

eform1.setLastname(rs3.getString("lastname"));
eform1.setRole(rs3.getString("role"));
eform1.setPincode(rs3.getString("pincode"));
eform1.setAddress1(rs3.getString("address1"));
eform1.setAddress2(rs3.getString("address2"));
eform1.setCity(rs3.getString("city"));
eform1.setState(rs3.getString("state"));
eform1.setPincode(rs3.getString("pincode"));
eform1.setEmailid(rs3.getString("emailid"));

eform1.setPhonenumber(rs3.getString("phonenumber"));

else
{
System.out.println("hello custttt");
rs4=ps1.executeQuery("select * from
customer_profile where username='"+s1+"'");
System.out.println("hello rs ps1");
while(rs4.next())
{

eform1.setUsername(rs4.getString("username"));

eform1.setPassword(rs4.getString("password"));

eform1.setFirstname(rs4.getString("firstname"));

eform1.setMiddlename(rs4.getString("middlename"));

160
Online Complaint Management System

eform1.setLastname(rs4.getString("lastname"));
eform1.setRole(rs4.getString("role"));

eform1.setPincode(rs4.getString("pincode"));

eform1.setAddress1(rs4.getString("address1"));

eform1.setAddress2(rs4.getString("address2"));
eform1.setCity(rs4.getString("city"));
eform1.setState(rs4.getString("state"));

eform1.setPincode(rs4.getString("pincode"));

eform1.setEmailid(rs4.getString("emailid"));

eform1.setPhonenumber(rs4.getString("phonenumber"));
}
}

}catch (Exception e) {
e.printStackTrace();
}
return eform1;
}

public static ArrayList updateemp(DataSource ds,


Empprofileform1 edto)
{

try {

con=ds.getConnection();

String s1=edto.getUsername();
String s2=edto.getRole();

161
Online Complaint Management System

if(s2.equals("employee"))
{

PreparedStatement
pstmt=con.prepareStatement("update employee_profile set
password=?,firstname=?,middlename=?,lastname=?,address1=?,addres
s2=?,city=?,state=?,pincode=?,emailid=?,phonenumber=? where
username='"+s1+"'");
pstmt.setString(1,edto.getPassword());
pstmt.setString(2,edto.getFirstname());
pstmt.setString(3,edto.getMiddlename());
pstmt.setString(4,edto.getLastname());
pstmt.setString(5,edto.getAddress1());
pstmt.setString(6,edto.getAddress2());
pstmt.setString(7,edto.getCity());
pstmt.setString(8,edto.getState());
pstmt.setString(9,edto.getPincode());
pstmt.setString(10,edto.getEmailid());
pstmt.setString(11,edto.getPhonenumber());

pstmt.executeUpdate();

}
else
{
PreparedStatement
pstmt1=con.prepareStatement("update customer_profile set
password=?,firstname=?,middlename=?,lastname=?,address1=?,addres
s2=?,city=?,state=?,pincode=?,emailid=?,phonenumber=? where
username='"+s1+"'");
pstmt1.setString(1,edto.getPassword());
pstmt1.setString(2,edto.getFirstname());
pstmt1.setString(3,edto.getMiddlename());
pstmt1.setString(4,edto.getLastname());
pstmt1.setString(5,edto.getAddress1());
pstmt1.setString(6,edto.getAddress2());
pstmt1.setString(7,edto.getCity());

162
Online Complaint Management System

pstmt1.setString(8,edto.getState());
pstmt1.setString(9,edto.getPincode());
pstmt1.setString(10,edto.getEmailid());
pstmt1.setString(11,edto.getPhonenumber());

pstmt1.executeUpdate();
}

}catch (Exception e) {
e.printStackTrace();
}

return null;
}

class3:Applicationresourses

errors.minlength={0} can not be less than {1} characters.


errors.maxlength={0} can not be greater than {1} characters.
errors.invalid={0} is invalid(First letter should be Alphabet).
errors.required={0} is required.
inputForm.username=User Name*:
inputForm.password=Password*:
inputForm.pass1=Conform Password*
inputForm.firstname=First Name*:
inputForm.middlename=Middle Name:
inputForm.lastname=Last Name:
inputForm.role= Role*:
inputForm.address1=Address1*:
inputForm.address2=Address2:

163
Online Complaint Management System

inputForm.city=City*:
inputForm.state=State*:
inputForm.pincode=PinCode*:
inputForm.emailid=EmailId*:
inputForm.phonenumber=Phone Number*:
errors.header=<h3><font color="red">Error List</font></h3><ul>
errors.footer=</ul><hr>

view for the project

class1:OCMSadminsearchdata

<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%>


<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%>

<html>
<body>

<table width="700" border=1>


<tr bgcolor="#D6DAF5">
<td><b><FONT
color="blue">UserName</FONT></b></td>
<td><b><FONT
color="blue">Password</FONT></b></td>
<td><b><FONT color="blue">First
Name</FONT></b></td>
<td><b><FONT color="blue">Middle
Name</FONT></b></td>
<td><b><FONT color="blue">Last
Name</FONT></b></td>

164
Online Complaint Management System

<td><b><FONT
color="blue">Role</FONT></b></td>
<td><b><FONT
color="blue">Address1</FONT></b></td>
<td><b><FONT
color="blue">Address2</FONT></b></td>
<td><b><FONT
color="blue">City</FONT></b></td>
<td><b><FONT
color="blue">State</FONT></b></td>
<td><b><FONT
color="blue">Pincode</FONT></b></td>
<td><b><FONT color="blue">Email-
Id</FONT></b></td>
<td><b><FONT color="blue">Phone
Number</FONT></b></td>
</tr>
<logic:notEmpty name="list123">
<logic:iterate id="ABC" name="list123">
<tr align="left">
<td><bean:write name="ABC" property="username"/></td>
<td><bean:write name="ABC" property="password"/></td>
<td><bean:write name="ABC" property="firstname"/></td>
<td><bean:write name="ABC" property="middlename"/></td>
<td><bean:write name="ABC" property="lastname"/></td>
<td><bean:write name="ABC" property="role"/></td>
<td><bean:write name="ABC" property="address1"/></td>
<td><bean:write name="ABC" property="address2"/></td>
<td><bean:write name="ABC" property="city"/></td>
<td><bean:write name="ABC" property="state"/></td>
<td><bean:write name="ABC" property="pincode"/></td>
<td><bean:write name="ABC" property="emailid"/></td>
<td><bean:write name="ABC" property="phonenumber"/></td>

</tr>

</logic:iterate>

165
Online Complaint Management System

</logic:notEmpty>
</table>

class2:OCMSadmin

<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>


<html>
<body bgcolor="#D6DAF5">
<center><h1><font color="red"><i>ADMINISTRATOR
FUNCTIONS</font></h1></center>
<br><br><br>
<html:form action="searchbyadmin">
<TABLE border=0 cellPadding=0 cellSpacing=0 width="100%">
<TBODY>
<tr>
<TD><h2>Search</h2></TD>
<TD><html:text property ="username"/>
</TD>
</TR>

<TR><TD height=4></TD></TR>

<tr><TD align=right colSpan=2><html:submit


value="Search"/></TD></tr>

</TBODY>
</TABLE>
</html:form>
<hr></hr>
<h2>For Details of Admin, Customer and Employee,Select Role</h2>
<html:form action="display">

<div align="left">

<TABLE border=0 cellPadding=0 cellSpacing=0 width="100%">


<TBODY>

166
Online Complaint Management System

<TR>

<td width="20%"><b>Select Role</b></td>


<td width="70%"><html:select property="role" size="0">
<option selected value="Select Role">Select Role</option>
<html:option value="admin">Admin</html:option>
<html:option value="employee">Employee</html:option>
<html:option value="customer">Customer</html:option>
</html:select></td>

<TD width="10%"><html:submit value="Select Role"/></TD>


</TR>

</TBODY>
</TABLE>
</div>
</html:form>
<hr><h2>Add The Employee/Customer Details</h2></hr>
<center>
<html:link page="/OCMSnewuser.jsp">ADD
EMPLOYEE</html:link><br><br>
</centre>
<hr><H2 align ="left">Select For Deletion OF Employee OR
Customer</H2> </hr>

<html:form action="display1">
<TABLE border=0 cellPadding=0 cellSpacing=0 width="100%">
<TBODY>
<TR>

<td width="20%"><b>Select Role</b></td>


<td width="70%"><html:select property="role1" size="0">
<option selected value="Select Role1">Select Role</option>
<html:option value="employeedelete">Employee</html:option>
<html:option value="customerdelete">Customer</html:option>
</html:select></td>

167
Online Complaint Management System

<TD width="10%"><html:submit value="Select Role"/></TD>


</TR>

</TBODY>
</TABLE>

<pre>

<html:link page="/OCMShome.jsp">HOME</html:link>

</pre>
</html:form>
</body>
</html>

class3:OCMScustomer

<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>


<%@ page import="com.OCMS.beans.*"%>

<html>
<body bgcolor="#D6DAF5">
<% Homelogindto listbean
=(Homelogindto)request.getAttribute("ListContents");
String id=listbean.getUsername();

%>
<center><h1><font color="red"><i>Customer
Functions</font></h1></center>
<br><br><br>
<html:form action="editbycustomerid">
<TABLE border=0 cellPadding=0 cellSpacing=0 width="100%">
<TBODY>

168
Online Complaint Management System

<tr>
<TD><h2>Edit the Customer</h2></TD>
<TD><html:text property ="username" value="<%=id%>"/>
</TD>
</TR>

<TR><TD height=4></TD></TR>

<tr><TD align=right colSpan=2><html:submit


value="Show/Edit"/></TD></tr>
</TBODY></TABLE>
</html:form>

<html:form action="searchbycustomer">
<TABLE border=0 cellPadding=0 cellSpacing=0 width="100%">
<TBODY>
<tr>
<hr>
<TD><h2>Search The product</h2></TD>
<TD><html:text property ="id"/>
</TD>
</TR>

<TR><TD height=4></TD></TR>
<tr><TD align=right colSpan=2><html:submit
value="Search"/></TD></tr>
</TBODY></TABLE>
</html:form>

<hr></hr>

<html:form action="productlist">
<TABLE border=0 cellPadding=0 cellSpacing=0 width="100%">
<TBODY>

169
Online Complaint Management System

<TR>

<td width="20%"><h3>Select Product Category</h3></td>


<td width="70%"><html:select property="category" size="0">
<option selected value="Select Category">Select Category</option>
<html:option value="shirt">Shirt</html:option>
<html:option value="trouser">Trouser</html:option>
</html:select></td>

<TD width="10%"><html:submit value="Select Category"/></TD>


</TR>
</TBODY></TABLE>
</html:form>

</body>
</html>

class4:OCMSdatadisplay

<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%>


<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%>

<html>
<body>

<table width="700" border=1>


<tr bgcolor="#D6DAF5">
<td><b><FONT
color="blue">UserName</FONT></b></td>
<td><b><FONT
color="blue">Password</FONT></b></td>
<td><b><FONT color="blue">First
Name</FONT></b></td>
<td><b><FONT color="blue">Middle
Name</FONT></b></td>

170
Online Complaint Management System

<td><b><FONT color="blue">Last
Name</FONT></b></td>
<td><b><FONT
color="blue">Role</FONT></b></td>
<td><b><FONT
color="blue">Address1</FONT></b></td>
<td><b><FONT
color="blue">Address2</FONT></b></td>
<td><b><FONT
color="blue">City</FONT></b></td>
<td><b><FONT
color="blue">State</FONT></b></td>
<td><b><FONT
color="blue">Pincode</FONT></b></td>
<td><b><FONT color="blue">Email-
Id</FONT></b></td>
<td><b><FONT color="blue">Phone
Number</FONT></b></td>
</tr>
<logic:notEmpty name="list">
<logic:iterate id="rdto" name="list">
<tr align="left">
<td><bean:write name="rdto" property="username"/></td>
<td><bean:write name="rdto" property="password"/></td>
<td><bean:write name="rdto" property="firstname"/></td>
<td><bean:write name="rdto" property="middlename"/></td>
<td><bean:write name="rdto" property="lastname"/></td>
<td><bean:write name="rdto" property="role"/></td>
<td><bean:write name="rdto" property="address1"/></td>
<td><bean:write name="rdto" property="address2"/></td>
<td><bean:write name="rdto" property="city"/></td>
<td><bean:write name="rdto" property="state"/></td>
<td><bean:write name="rdto" property="pincode"/></td>
<td><bean:write name="rdto" property="emailid"/></td>
<td><bean:write name="rdto" property="phonenumber"/></td>

</tr>

171
Online Complaint Management System

</logic:iterate>
</logic:notEmpty>
</table>

<pre>

<html:link page="/OCMShome.jsp">HOME</html:link>
<html:link page="/OCMSadmin.jsp">Admin Page</html:link>

</pre>
</body>
</html>

class5:OCMSdeletebyadmin

<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%>


<html>
<head>
<title>User Has Deleted</title>
</head>
<body bgcolor="#CCFFFF">
<CENTER>
<H1> User Has Deleted Successfully </H1>

172
Online Complaint Management System

</CENTER>
<BR><HR>

<form method="POST" action="">

<pre>

<html:link page="/OCMShome.jsp">HOME</html:link>
<html:link page="/OCMSadmin.jsp">Admin Page</html:link>

</pre>

</form>
</body>
</html>

class6:OCMSalreadyexist

<html>
<head>
<title>User Already Exist</title>
</head>
<body bgcolor="#CCFFFF">
<CENTER>
<H1> User Already Exist in Database </H1>
</CENTER>
<BR><HR>

<form method="POST" action="">


<p align="center">
<font size="5" color=#000000>The specified user exist in
Database. </font>
<BR>
<BR>
<BR>

173
Online Complaint Management System

<TABLE ALIGN="center" BORDER=0 height="102"


width="359">

<tr>
<td height="1" width="190">
<font size="4">Enter Again New Username</font>
</td>
<td height="1" width="155">
<font color="#0000FF"><a
href="OCMSnewuser.jsp"><font size="4">Click
here</font></a></font>
</td>
</tr>

</TABLE>
</form>
</body>
</html>

class7:OCMSdeleteuser

<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%>

<html>
<HEAD>
<TITLE>Customer Relationship Management</TITLE>
</head>
<BODY leftMargin=0 topMargin=0 marginwidth="0"
marginheight="0" bgcolor="#D6DAF5">
<TABLE border=0 cellPadding=0 cellSpacing=0 width="100%">
<TBODY>
<TR bgcolor="#D6DAF5">
<TD align=middle width="100%">

<div align="left">

174
Online Complaint Management System

<h5 align="center"><b><i><font face="Georgia, Times New


Roman, Times, serif" color="#993333" size="6">C</font><font
face="Georgia, Times New Roman, Times, serif" color="#3399FF"
size="6">ustomer
Service Management</font></i></b></h5>
</div>
</TD>
</TR>
</TBODY>
</TABLE>
<h2>Delete The User According to Their ID(UserName)</h2>

<html:form action="deleteuser">

<TABLE border=0 cellPadding=0 cellSpacing=0 width="100%">


<TBODY>
<tr>
<TD><b>UserName</b></TD>
<TD><html:text property ="username"/>
</TD>
</TR>

<TR><TD height=4></TD></TR>

<tr>
<TD align=right colSpan=2>
<html:submit value="Delete"/>

</TD>
</tr>

</TBODY>
</TABLE>
</html:form>
</BODY>
</HTML>

175
Online Complaint Management System

class8:OCMSemploy

<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>


<%@ page import="com.OCMS.beans.*"%>
<html>
<body bgcolor="#D6DAF5">
<% Homelogindto listbean
=(Homelogindto)request.getAttribute("ListContents");
String id=listbean.getUsername();

%>
<center><h1><font color="red"><i>Employee
Functions</font></h1></center>
<br><br>
<hr>

<html:form action="editbyid">
<TABLE border=0 cellPadding=0 cellSpacing=0 width="100%">
<TBODY>
<tr>
<TD><h2>Edit the Employee</h2></TD>
<TD><html:text property ="username" value="<%=id%>"/>

</TD>
</TR>

<TR><TD height=4></TD></TR>

<tr><TD align=right colSpan=2><html:submit


value="Show/Edit"/></TD></tr>
</TBODY></TABLE>
</html:form>

176
Online Complaint Management System

<hr></hr>

<br>

<html:form action="searchbyemployee">
<TABLE border=0 cellPadding=0 cellSpacing=0 width="100%">
<TBODY>
<tr>
<TD><h2>Search The Employee/Customer</h2></TD>
<TD><html:text property ="username"/>
</TD>
</TR>

<TR><TD height=4></TD></TR>

<tr><TD align=right colSpan=2><html:submit


value="Search"/></TD></tr>
</TBODY></TABLE>
</html:form>
<hr></hr>

<html:form action="employeeproductsearch">
<TABLE border=0 cellPadding=0 cellSpacing=0 width="100%">
<TBODY>
<tr>
<TD><h2>Search The product</h2></TD>
<TD><html:text property ="id"/>
</TD>
</TR>

<TR><TD height=4></TD></TR>
<tr><TD align=right colSpan=2><html:submit
value="Search"/></TD></tr>
</TBODY></TABLE>

177
Online Complaint Management System

</html:form>

<hr></hr>

<html:form action="productlistbyemployee">
<TABLE border=0 cellPadding=0 cellSpacing=0 width="100%">
<TBODY>
<TR>

<td width="20%"><h3>Select Product Category</h3></td>


<td width="70%"><html:select property="category" size="0">
<option selected value="Select Category">Select Category</option>
<html:option value="shirt">Shirt</html:option>
<html:option value="trouser">Trouser</html:option>
</html:select></td>

<TD width="10%"><html:submit value="Select Category"/></TD>


</TR>
</TBODY></TABLE>
</html:form>

</body>
</html>

class9:OCMSemployeeprofile

<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%>


<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%>
<%@ page import="com.OCMS.beans.*" %>
<html>
<body>
<% Empprofileform1
bean=(Empprofileform1)request.getAttribute("edto");
String s0=bean.getUsername();

178
Online Complaint Management System

String s1=bean.getPassword();
String s2=bean.getFirstname();
String s3=bean.getMiddlename();
String s4=bean.getLastname();
String s5=bean.getRole();
String s6=bean.getAddress1();
String s7=bean.getAddress2();
String s8=bean.getCity();
String s9=bean.getState();
String s10=bean.getPincode();
String s11=bean.getEmailid();
String s12=bean.getPhonenumber();

%>
<html:form action="updatebyid">
<FONT color="#2a00ff" size="2">
<div align="left">
<table border="0" width="100%">
<tr>
<td width="23%">Username</td>
<td width="77%"><html:text property="username" value="<
%=s0%>"/></td></tr>
<tr>
<td width="23%">Password</td>
<td width="77%"><html:password property="password" value="<
%=s1%>"/></td></tr>
<tr>
<td width="23%">First Name</td>
<td width="77%"><html:text property="firstname" value="<
%=s2%>"/></td></tr>

<tr>
<td width="23%">Middle Name</td>
<td width="77%"><html:text property="middlename" value="<
%=s3%>" /></td></tr>
<tr>
<td width="23%">Last Name</td>

179
Online Complaint Management System

<td width="77%"><html:text property="lastname" value="<


%=s4%>"/></td></tr>
<tr>
<td width="23%">Role</td>
<td width="77%"><html:text property="role" value="<
%=s5%>"/></td></tr>
<tr>
<td width="23%">Address1</td>
<td width="77%"><html:text property="address1" value="<
%=s6%>"/></td></tr>
<tr>

<td width="23%">Address2</td>
<td width="77%"><html:text property="address2" value="<
%=s7%>" /></td></tr>
<tr>

<td width="23%">City</td>
<td width="77%"><html:text property="city" value="<
%=s8%>"/></td></tr>
<tr>
<td width="23%">State</td>
<td width="77%"><html:text property="state" value="<
%=s9%>"/></td></tr>
<tr>
<td width="23%">PinCode</td>
<td width="77%"><html:text property="pincode" value="<
%=s10%>"/></td></tr>

<tr>
<td width="23%">Email Id</td>
<td width="77%"><html:text property="emailid" value="<
%=s11%>"/></td></tr>
<tr>
<td width="23%">Phone Number</td>
<td width="77%"><html:text property="phonenumber" value="<
%=s12%>"/></td></tr>

180
Online Complaint Management System

<tr>
<td width="23%" height="21"></td>
<td width="77%" height="21">

<html:submit value="Edit"/></td></tr>

</table>
</div>
</FONT>
</html:form>

</body>
</html>

class10:OCMSempsearch

<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%>


<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%>

<html>
<body>

<table width="700" border=1>


<tr bgcolor="#D6DAF5">
<td><b><FONT
color="blue">UserName</FONT></b></td>
<td><b><FONT color="blue">First
Name</FONT></b></td>
<td><b><FONT color="blue">Middle
Name</FONT></b></td>

181
Online Complaint Management System

<td><b><FONT color="blue">Last
Name</FONT></b></td>
<td><b><FONT
color="blue">Role</FONT></b></td>
<td><b><FONT color="blue">Phone
Number</FONT></b></td>
</tr>
<logic:notEmpty name="list12">
<logic:iterate id="rdto" name="list12">
<tr align="left">
<td><bean:write name="rdto" property="username"/></td>
<td><bean:write name="rdto" property="firstname"/></td>
<td><bean:write name="rdto" property="middlename"/></td>
<td><bean:write name="rdto" property="lastname"/></td>
<td><bean:write name="rdto" property="role"/></td>
<td><bean:write name="rdto" property="phonenumber"/></td>

</tr>

</logic:iterate>
</logic:notEmpty>
</table>

<pre>

182
Online Complaint Management System

<html:link page="/OCMShome.jsp">HOME</html:link>
<html:link page="/OCMSadmin.jsp">Admin Page</html:link>
<html:link page="/OCMSemployee.jsp">Back Page</html:link>

</pre>
</body>
</html>

class11:OCMSfeedback

<html>
<head>
<h1 align="centre">Submission Your Query</h1>
<h3 align="right">Enquiry Form</h3>

<body bgcolor="#ffffff">

<fieldset>
<legend>
Your Contact Information :
</legend>
<form action="MAILTO:[email protected]" method="post"
enctype="text/plain">
Organisation/Company : <input type="text" name="organisation"
value="organisation Name" size="40">
<br><br>
Your Name: <input type="text" name="name"value="your Name"
size="40">
<br><br>
Your E-Mail: <input type="text" name="mail"value="your E-Mail"
size="40">
<br><br>
<pre> Country Code Area Code Phone Number</pre>
<pre>phone: <input type="text" name="phone" "value="CC"
size="10"> <input type="text" name="phone" "value="Ac"

183
Online Complaint Management System

size="10"> <input type="text" name="phone" "value="PH number"


size="10"></pre>

<pre>Fax: <input type="text" name="phone" "value="CC"


size="10"> <input type="text" name="phone" "value="Ac"
size="10"> <input type="text" name="phone" "value="PH number"
size="10"></pre>
<br>
Street Address: <input type="text" name="mail"value="your Address"
size="40">
<br><br>
City/State: <input type="text" name="mail"value="State"
size="40">
<br><br>
Zip/Postal code: <input type="text" name="mail"value="Postal code"
size="40">
<br><br>
Country: <input type="text" name="mail"value="Country"
size="40">
<br><br>
Message: <input type="text" name="mail" value="Message"
size="60">
<br><br>

<input type="submit" value="Submit">


<input type="reset" value="Reset">

</form>
</fieldset>

</body>
</html>

184
Online Complaint Management System

--------------------------------------------------------------------

<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%>


<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%>
<html>
<head>

<title>New User Registration</title>


</head>
<body bgcolor="#D6DAF5">
<script language="javascript">

function validate()
{

if(document.forms[0].password.value!
=document.forms[0].pass1.value)
{
alert("Password mismatch");

}
document.forms[0].submit();

}
</script>

<CENTER>
<H1> <u>Customer Service Management</u> </H1>
</CENTER>
<html:messages id="error">
<li><%=error%></li>
</html:messages>
<html:form action="newuser" >

185
Online Complaint Management System

<p align="center">
<b><font size="5"> New User Registration</font></b>&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</p>
<p align="left">
&nbsp;<b><font color="#FF0000">( Field marked * are
necessary)</font>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&
nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n
bsp;&nbsp;</b>
</p>
<div align="left">
<table border="0" width="100%">
<tr>
<td width="23%"><b><bean:message
key="inputForm.username"/></b></td>
<td width="77%">
<b>
<html:text property="username"/>
</b>
</td>

</tr>
<tr>
<td width="23%">
<b>
<bean:message key="inputForm.password"/></b></td>
<td width="77%"><b><html:password property="password"/>
</b>
</td>
</tr>
<tr>
<td width="23%">
<b>
<bean:message key="inputForm.pass1"/>:</b>
</td>

186
Online Complaint Management System

<td width="77%"><b><html:password property="pass1"/>


</b>
</td>
</tr>
<tr>
<td width="23%">
<b>
<bean:message key="inputForm.firstname"/></b></td>
<td width="77%">
<b>
<html:text property="firstname"/>
</b>
</td>
</tr>
<tr>
<td width="23%">
<b>
<bean:message key="inputForm.middlename"/></b></td>
<td width="77%">
<b>
<html:text property="middlename"/>
</b>
</td>
</tr>
<tr>
<td width="23%">
<b>
<bean:message key="inputForm.lastname"/></b></td>
<td width="77%">
<b><html:text property="lastname"/>
</b>
</td>
</tr>

<tr>
<td width="23%">
<b>

187
Online Complaint Management System

<bean:message key="inputForm.role"/></b></td>
<td width="77%" height="25"><b>
<html:select property="role" size="0">
<option selected value="Select Role">Select Role</option>
<html:option value="customer">Customer</html:option>
<html:option value="employee">Employee</html:option>

</html:select> </b> </td>


</tr>
</table>

<div align="center">
<center>
<table border="0" width="100%" height="201">
<tr>
<td width="23%" height="25"><b><bean:message
key="inputForm.address1"/>&nbsp;&nbsp;</b></td>
<td width="77%" height="25"><b><html:text
property="address1"/> </b> </td>
</tr>
<tr>
<td width="23%" height="25"><b><bean:message
key="inputForm.address2"/>&nbsp;</b></td>
<td width="77%" height="25"><b><html:text
property="address2"/> </b> </td>
</tr>
<tr>
<td width="23%" height="25"><b><bean:message
key="inputForm.city"/>&nbsp;</b></td>
<td width="77%" height="25"><b><html:text property="city"/>
</b> </td>
</tr>
<tr>
<td width="23%" height="25"><b><bean:message
key="inputForm.state"/></b></td>
<td width="77%" height="25"><b>
<html:select property="state" size="0">

188
Online Complaint Management System

<option selected value="Select State">Select State</option>


<html:option value="assam">Assam</html:option>
<html:option value="arunachal Pradesh">Arunachal
Pradesh</html:option>
<html:option value="haryana">Haryana</html:option>
<html:option
value="maharashtra">Maharashtra</html:option>
<html:option
value="rajasthan">Rajasthan</html:option>
<html:option
value="uttarPradesh">UttarPradesh</html:option>
<html:option
value="bihar">Bihar</html:option>
<html:option value="westbengal">West
Bengal</html:option>
</html:select> </b> </td>
</tr>
<tr>
<td width="23%" height="25"><b><bean:message
key="inputForm.pincode"/>&nbsp;</b></td>
<td width="77%" height="25"><b><html:text
property="pincode"/> </b> </td>
</tr>
<tr>
<td width="23%" height="25"><b><bean:message
key="inputForm.emailid"/></b></td>
<td width="77%" height="25"><b><html:text
property="emailid"/> </td>
</tr>
<tr>
<td width="23%" height="25"><b><bean:message
key="inputForm.phonenumber"/></b></td>
<td width="77%" height="25"><b><html:text
property="phonenumber"/> </b> </td>
</tr>
<tr>
<td width="23%" height="1"></td>

189
Online Complaint Management System

<td width="77%" height="1"> </td>


</tr>
<tr>
<td width="23%" height="21"></td>
<td width="77%" height="21">
<b>
<html:submit onclick="validate();"/>
</b>
</td>
</tr>
</table>

</div>

</html:form>

<pre>

<html:link page="/OCMShome.jsp">HOME</html:link>

</pre>

</body>

</HTML>

190
Online Complaint Management System

<html>
<head>
<h1 align="centre">Submission Your Query</h1>
<h3 align="right">Enquiry Form</h3>

<body bgcolor="#ffffff">

<fieldset>
<legend>
Your Contact Information :
</legend>
<form action="MAILTO:[email protected]" method="post"
enctype="text/plain">
Organisation/Company : <input type="text" name="organisation"
value="organisation Name" size="40">
<br><br>
Your Name: <input type="text" name="name"value="your Name"
size="40">
<br><br>
Your E-Mail: <input type="text" name="mail"value="your E-Mail"
size="40">
<br><br>
<pre> Country Code Area Code Phone Number</pre>
<pre>phone: <input type="text" name="phone" "value="CC"
size="10"> <input type="text" name="phone" "value="Ac"
size="10"> <input type="text" name="phone" "value="PH number"
size="10"></pre>

<pre>Fax: <input type="text" name="phone" "value="CC"


size="10"> <input type="text" name="phone" "value="Ac"
size="10"> <input type="text" name="phone" "value="PH number"
size="10"></pre>
<br>

191
Online Complaint Management System

Street Address: <input type="text" name="mail"value="your Address"


size="40">
<br><br>
City/State: <input type="text" name="mail"value="State"
size="40">
<br><br>
Zip/Postal code: <input type="text" name="mail"value="Postal code"
size="40">
<br><br>
Country: <input type="text" name="mail"value="Country"
size="40">
<br><br>
Message: <input type="text" name="mail" value="Message"
size="60">
<br><br>

<input type="submit" value="Submit">


<input type="reset" value="Reset">

</form>
</fieldset>

</body>
</html>

--------------------------------------------------------------------

<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%>


<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%>
<html>
<head>

<title>New User Registration</title>

192
Online Complaint Management System

</head>
<body bgcolor="#D6DAF5">
<script language="javascript">

function validate()
{

if(document.forms[0].password.value!
=document.forms[0].pass1.value)
{
alert("Password mismatch");

}
document.forms[0].submit();

}
</script>

<CENTER>
<H1> <u>Customer Service Management</u> </H1>
</CENTER>
<html:messages id="error">
<li><%=error%></li>
</html:messages>
<html:form action="newuser" >

<p align="center">
<b><font size="5"> New User Registration</font></b>&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</p>
<p align="left">
&nbsp;<b><font color="#FF0000">( Field marked * are
necessary)</font>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&
nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs

193
Online Complaint Management System

p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n
bsp;&nbsp;</b>
</p>
<div align="left">
<table border="0" width="100%">
<tr>
<td width="23%"><b><bean:message
key="inputForm.username"/></b></td>
<td width="77%">
<b>
<html:text property="username"/>
</b>
</td>

</tr>
<tr>
<td width="23%">
<b>
<bean:message key="inputForm.password"/></b></td>
<td width="77%"><b><html:password property="password"/>
</b>
</td>
</tr>
<tr>
<td width="23%">
<b>
<bean:message key="inputForm.pass1"/>:</b>
</td>
<td width="77%"><b><html:password property="pass1"/>
</b>
</td>
</tr>
<tr>
<td width="23%">
<b>
<bean:message key="inputForm.firstname"/></b></td>
<td width="77%">

194
Online Complaint Management System

<b>
<html:text property="firstname"/>
</b>
</td>
</tr>
<tr>
<td width="23%">
<b>
<bean:message key="inputForm.middlename"/></b></td>
<td width="77%">
<b>
<html:text property="middlename"/>
</b>
</td>
</tr>
<tr>
<td width="23%">
<b>
<bean:message key="inputForm.lastname"/></b></td>
<td width="77%">
<b><html:text property="lastname"/>
</b>
</td>
</tr>

<tr>
<td width="23%">
<b>
<bean:message key="inputForm.role"/></b></td>
<td width="77%" height="25"><b>
<html:select property="role" size="0">
<option selected value="Select Role">Select Role</option>
<html:option value="customer">Customer</html:option>
<html:option value="employee">Employee</html:option>

</html:select> </b> </td>


</tr>

195
Online Complaint Management System

</table>

<div align="center">
<center>
<table border="0" width="100%" height="201">
<tr>
<td width="23%" height="25"><b><bean:message
key="inputForm.address1"/>&nbsp;&nbsp;</b></td>
<td width="77%" height="25"><b><html:text
property="address1"/> </b> </td>
</tr>
<tr>
<td width="23%" height="25"><b><bean:message
key="inputForm.address2"/>&nbsp;</b></td>
<td width="77%" height="25"><b><html:text
property="address2"/> </b> </td>
</tr>
<tr>
<td width="23%" height="25"><b><bean:message
key="inputForm.city"/>&nbsp;</b></td>
<td width="77%" height="25"><b><html:text property="city"/>
</b> </td>
</tr>
<tr>
<td width="23%" height="25"><b><bean:message
key="inputForm.state"/></b></td>
<td width="77%" height="25"><b>
<html:select property="state" size="0">
<option selected value="Select State">Select State</option>
<html:option value="assam">Assam</html:option>
<html:option value="arunachal Pradesh">Arunachal
Pradesh</html:option>
<html:option value="haryana">Haryana</html:option>
<html:option
value="maharashtra">Maharashtra</html:option>
<html:option
value="rajasthan">Rajasthan</html:option>

196
Online Complaint Management System

<html:option
value="uttarPradesh">UttarPradesh</html:option>
<html:option
value="bihar">Bihar</html:option>
<html:option value="westbengal">West
Bengal</html:option>
</html:select> </b> </td>
</tr>
<tr>
<td width="23%" height="25"><b><bean:message
key="inputForm.pincode"/>&nbsp;</b></td>
<td width="77%" height="25"><b><html:text
property="pincode"/> </b> </td>
</tr>
<tr>
<td width="23%" height="25"><b><bean:message
key="inputForm.emailid"/></b></td>
<td width="77%" height="25"><b><html:text
property="emailid"/> </td>
</tr>
<tr>
<td width="23%" height="25"><b><bean:message
key="inputForm.phonenumber"/></b></td>
<td width="77%" height="25"><b><html:text
property="phonenumber"/> </b> </td>
</tr>
<tr>
<td width="23%" height="1"></td>
<td width="77%" height="1"> </td>
</tr>
<tr>
<td width="23%" height="21"></td>
<td width="77%" height="21">
<b>
<html:submit onclick="validate();"/>
</b>
</td>

197
Online Complaint Management System

</tr>
</table>

</div>

</html:form>

<pre>

<html:link page="/OCMShome.jsp">HOME</html:link>

</pre>

</body>

</HTML>

Class12:OCMShome

<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%>


<html>
<HEAD>
<TITLE>Customer Relationship Management</TITLE>
</head>

198
Online Complaint Management System

<BODY leftMargin=0 topMargin=0 marginwidth="0"


marginheight="0" bgcolor="#D6DAF5">
<TABLE border=0 cellPadding=0 cellSpacing=0 width="100%">
<TBODY>
<TR bgcolor="#D6DAF5">
<TD align=middle width="100%">

<div align="left">
<h5 align="center"><b><i><font face="Georgia, Times New
Roman, Times, serif" color="#993333" size="6">C</font><font
face="Georgia, Times New Roman, Times, serif" color="#3399FF"
size="6">ustomer
Relationship Management</font></i></b></h5>
</div>
</TD>
</TR>
</TBODY>
</TABLE>

<html:form action="OCMS">

<br>
<div align="right"><font size="2" face="Arial, Helvetica, sans-serif"
color="#CC0033"><b>Login
Here&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;</b></font>
</div>

<TABLE border=0 cellPadding=0 cellSpacing=0 width="100%">


<TBODY>
<TR>
<TD align=middle width="13" height="192">&nbsp;
</TD>

<TD vAlign=center width="125" height="192">


<TABLE border=0 cellPadding=1 cellSpacing=1 width="100%">

199
Online Complaint Management System

<TBODY>
<TR><TD><b><font color="#993333"><html:link
page="/AboutOCMS.jsp">About
OCMS</html:link></font></b></TD></TR>
<TR><TD><b><font color="#993333"><html:link
page="/OCMSworks.jsp">How OCMS
Works</html:link></font></b></TD></TR>
<TR><TD><b><font color="#993333"><html:link
page="/Dos.jsp">Do and Don'ts</html:link></font></b></TD></TR>
<TR><TD><b><font color="#993333"><html:link
page="/Faq.jsp">FAQ</html:link></font></b></TD></TR>
<TR><TD><b><font color="#993333"><html:link
page="/Terms.jsp">Terms &
Condition</html:link></font></b></TD></TR>
<TR><TD><b><font color="#993333"><html:link
page="mailto:[email protected]?subject=Query about
%20Product">Contact Us</html:link></font></b></TD></TR>

</TBODY>
</TABLE>
</TD>

<TD align=middle width="29" height="192">&nbsp;


</TD>
<TD colspan="2" height="192" valign="top">
<p><font face="Arial, Helvetica, sans-serif" size="3">
The OCMS application is designed for sales representatives, sales
managers, and customer service representatives to manage the sales and
customer service process of an organization. Its helps in serving the
customer in a better way by adding more functionality, and making
desired and necessary changes in the product. OCMS helps to fill the
communication gap between the manufacturer and end customer.
</font> </p>
</TD>

200
Online Complaint Management System

<TD align=middle rowSpan=5 width="12"


height="192">&nbsp;</TD>
<TD width="202" height="192">
<TABLE border=0 cellPadding=0 cellSpacing=0 width="100%">
<TBODY>
<TR>

<td><b>Select Role</b></td>
<td width="40"><html:select property="role" size="0">
<option selected value="Select Role">Select Role</option>
<html:option value="admin">Admin</html:option>
<html:option value="employee">Employee</html:option>
<html:option value="customer">Customer</html:option>
</html:select></td></tr>
<tr>
<TD><b>LoginName</b></TD>
<TD><html:text property ="username"/>
</TD>
</TR>

<TR><TD height=4></TD></TR>

<TR>
<TD><b>Password</b></TD>
<TD><html:password property ="password"/>
</TD>
</TR>

<TR>
<TD height=4></TD>
</TR>

<tr>
<TD align=right colSpan=2>
<html:submit value="Sign in"/>

</TD>

201
Online Complaint Management System

</tr>

<TR>
<TD align=right colSpan=2><B><BR>
<html:link page="/OCMSnewuser.jsp">New user? Sign
Up</html:link></B></TD></TR>
<TR><TD align=right colSpan=2><B><BR>

<html:link page="/OCMSfeedback.jsp">Your
FeedBack</html:link></B></TD></TR>

</TBODY>
</TABLE>
</TD>
<TD width="14" height="192">&nbsp;
</TD>
</TR>
</TBODY>
</TABLE>
<DIV align=center><BR> <BR>
</DIV>
<TABLE width="100%">
<TBODY>
<TR>
<TD height=1 width="100%">
</TD>
</TR>
</TBODY>
</TABLE>

<TABLE border=0 cellPadding=0 cellSpacing=0 width="100%">


<TBODY>
<TR>
<TD align=left vAlign=center height="35"><FONT face=Arial
size=2>

202
Online Complaint Management System

<P align=center> |
<html:link page="/OCMShome.jsp">HOME</html:link>|
<html:link page="/Enquiry.jsp">Enquiry </html:link>
| <html:link page="/Privacy.jsp">Privacy Policy</html:link>
| <html:link page="/http://www.google.com">Google</html:link> |
<BR>
OCMS.com - Online Tracking The Sales Record in India </P>
</FONT> </TD>
</TR>
</TBODY>
</TABLE>
</html:form>
</BODY>
</HTML>

class13:OCMSinvalid

<html>
<head>
<title>Invalid User</title>
</head>
<body bgcolor="#CCFFFF">
<CENTER>
<H1> Invalid User </H1>
</CENTER>
<BR><HR>

<form method="POST" action="">


<p align="center">
<font size="5" color=#000000>The specified user does not exist
in Database. </font>
<BR>
<BR>
<BR>

203
Online Complaint Management System

<TABLE ALIGN="center" BORDER=0 height="102"


width="359">

<tr>
<td height="1" width="190">
<font size="4">Enter Again Valid Username</font>
</td>
<td height="1" width="155">
<font color="#0000FF"><a
href="OCMSdeleteuser.jsp"><font size="4">Click
here</font></a></font>
</td>
</tr>

<tr>
<td height="1" width="190">
<font size="4">Enter Again Select Valid Role</font>
</td>
<td height="1" width="155">
<font color="#0000FF"><a
href="OCMSadmin.jsp"><font size="4">Click here</font></a></font>
</td>
</tr>
</TABLE>
</form>
</body>
</html>

class14:OCMSinvalidentry

<html>
<head>
<title>Invalid Entry</title>
</head>

204
Online Complaint Management System

<body bgcolor="#CCFFFF">
<CENTER>
<H1> Invalid Entry </H1>
</CENTER>
<BR><HR>

<form method="POST" action="">


<p align="center">
<font size="5" color=#000000>The specified user does not exist
in Database. </font>
<BR>
<BR>
<BR>
<TABLE ALIGN="center" BORDER=0 height="102"
width="359">

<tr>
<td height="1" width="190">
<font size="4">Enter Again Valid Username</font>
</td>
<td height="1" width="155">
<font color="#0000FF"><a
href="OCMSemployee.jsp"><font size="4">Click
here</font></a></font>
</td>
</tr>

</TABLE>
</form>
</body>
</html>

class15:OCMSinvalidproduct

205
Online Complaint Management System

<html>
<head>
<title>Invalid Entry</title>
</head>
<body bgcolor="#CCFFFF">
<CENTER>
<H1> Invalid Entry </H1>
</CENTER>
<BR><HR>

<form method="POST" action="">


<p align="center">
<font size="5" color=#000000>The specified Product does not
exist in Database. </font>
<BR>
<BR>
<BR>
<TABLE ALIGN="center" BORDER=0 height="102"
width="359">

<tr>
<td height="1" width="190">
<font size="4">Enter Again Valid ProductID</font>
</td>
<td height="1" width="155">
<font color="#0000FF"><a
href="OCMScustomer.jsp"><font size="4">Click
here</font></a></font>
</td>
</tr>

</TABLE>
</form>
</body>
</html>

class16:OCMSvalidproduct

206
Online Complaint Management System

<html>
<head>
<title>Invalid Entry</title>
</head>
<body bgcolor="#CCFFFF">
<CENTER>
<H1> Invalid Entry </H1>
</CENTER>
<BR><HR>

<form method="POST" action="">


<p align="center">
<font size="5" color=#000000>The specified Product does not
exist in Database. </font>
<BR>
<BR>
<BR>
<TABLE ALIGN="center" BORDER=0 height="102"
width="359">

<tr>
<td height="1" width="190">
<font size="4">Enter Again Valid ProductID</font>
</td>
<td height="1" width="155">
<font color="#0000FF"><a
href="OCMSemployee.jsp"><font size="4">Click
here</font></a></font>
</td>
</tr>

</TABLE>
</form>
</body>
</html>

207
Online Complaint Management System

class17:OCMSvaliduser

<html>
<head>
<title>Invalid User</title>
</head>
<body bgcolor="#CCFFFF">
<CENTER>
<H1> Invalid User </H1>
</CENTER>
<BR><HR>

<form method="POST" action="">


<p align="center">
<font size="5" color=#000000>The specified user does not exist.
</font>
<BR>
<BR>
<BR>
<TABLE ALIGN="center" BORDER=0 height="102"
width="359">
<TR>
<TD height="37" width="190">
<font size="4">Create New Account</font>
</TD>
<TD height="37" width="155">
<p align="left"><a href="OCMSnewuser.jsp"><font
size="4">Click here</font></a></p>
</TD>
</TR>
<tr>
<td height="1" width="190">
<font size="4">Login Again</font>
</td>

208
Online Complaint Management System

<td height="1" width="155">


<font color="#0000FF"><a
href="OCMShome.jsp"><font size="4">Click here</font></a></font>
</td>
</tr>
</TABLE>
</form>
</body>
</html>

class18:OCMSnewuser

<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%>


<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%>
<html>
<head>

<title>New User Registration</title>


</head>
<body bgcolor="#D6DAF5">
<script language="javascript">

function validate()
{

if(document.forms[0].password.value!
=document.forms[0].pass1.value)
{
alert("Password mismatch");

}
document.forms[0].submit();

}
</script>

209
Online Complaint Management System

<CENTER>
<H1> <u>Customer Service Management</u> </H1>
</CENTER>
<html:messages id="error">
<li><%=error%></li>
</html:messages>
<html:form action="newuser" >

<p align="center">
<b><font size="5"> New User Registration</font></b>&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</p>
<p align="left">
&nbsp;<b><font color="#FF0000">( Field marked * are
necessary)</font>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&
nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n
bsp;&nbsp;</b>
</p>
<div align="left">
<table border="0" width="100%">
<tr>
<td width="23%"><b><bean:message
key="inputForm.username"/></b></td>
<td width="77%">
<b>
<html:text property="username"/>
</b>
</td>

</tr>
<tr>
<td width="23%">
<b>

210
Online Complaint Management System

<bean:message key="inputForm.password"/></b></td>
<td width="77%"><b><html:password property="password"/>
</b>
</td>
</tr>
<tr>
<td width="23%">
<b>
<bean:message key="inputForm.pass1"/>:</b>
</td>
<td width="77%"><b><html:password property="pass1"/>
</b>
</td>
</tr>
<tr>
<td width="23%">
<b>
<bean:message key="inputForm.firstname"/></b></td>
<td width="77%">
<b>
<html:text property="firstname"/>
</b>
</td>
</tr>
<tr>
<td width="23%">
<b>
<bean:message key="inputForm.middlename"/></b></td>
<td width="77%">
<b>
<html:text property="middlename"/>
</b>
</td>
</tr>
<tr>
<td width="23%">
<b>

211
Online Complaint Management System

<bean:message key="inputForm.lastname"/></b></td>
<td width="77%">
<b><html:text property="lastname"/>
</b>
</td>
</tr>

<tr>
<td width="23%">
<b>
<bean:message key="inputForm.role"/></b></td>
<td width="77%" height="25"><b>
<html:select property="role" size="0">
<option selected value="Select Role">Select Role</option>
<html:option value="customer">Customer</html:option>
<html:option value="employee">Employee</html:option>

</html:select> </b> </td>


</tr>
</table>

<div align="center">
<center>
<table border="0" width="100%" height="201">
<tr>
<td width="23%" height="25"><b><bean:message
key="inputForm.address1"/>&nbsp;&nbsp;</b></td>
<td width="77%" height="25"><b><html:text
property="address1"/> </b> </td>
</tr>
<tr>
<td width="23%" height="25"><b><bean:message
key="inputForm.address2"/>&nbsp;</b></td>
<td width="77%" height="25"><b><html:text
property="address2"/> </b> </td>
</tr>
<tr>

212
Online Complaint Management System

<td width="23%" height="25"><b><bean:message


key="inputForm.city"/>&nbsp;</b></td>
<td width="77%" height="25"><b><html:text property="city"/>
</b> </td>
</tr>
<tr>
<td width="23%" height="25"><b><bean:message
key="inputForm.state"/></b></td>
<td width="77%" height="25"><b>
<html:select property="state" size="0">
<option selected value="Select State">Select State</option>
<html:option value="assam">Assam</html:option>
<html:option value="arunachal Pradesh">Arunachal
Pradesh</html:option>
<html:option value="haryana">Haryana</html:option>
<html:option
value="maharashtra">Maharashtra</html:option>
<html:option
value="rajasthan">Rajasthan</html:option>
<html:option
value="uttarPradesh">UttarPradesh</html:option>
<html:option
value="bihar">Bihar</html:option>
<html:option value="westbengal">West
Bengal</html:option>
</html:select> </b> </td>
</tr>
<tr>
<td width="23%" height="25"><b><bean:message
key="inputForm.pincode"/>&nbsp;</b></td>
<td width="77%" height="25"><b><html:text
property="pincode"/> </b> </td>
</tr>
<tr>
<td width="23%" height="25"><b><bean:message
key="inputForm.emailid"/></b></td>

213
Online Complaint Management System

<td width="77%" height="25"><b><html:text


property="emailid"/> </td>
</tr>
<tr>
<td width="23%" height="25"><b><bean:message
key="inputForm.phonenumber"/></b></td>
<td width="77%" height="25"><b><html:text
property="phonenumber"/> </b> </td>
</tr>
<tr>
<td width="23%" height="1"></td>
<td width="77%" height="1"> </td>
</tr>
<tr>
<td width="23%" height="21"></td>
<td width="77%" height="21">
<b>
<html:submit onclick="validate();"/>
</b>
</td>
</tr>
</table>

</div>

</html:form>

<pre>

<html:link page="/OCMShome.jsp">HOME</html:link>

</pre>

214
Online Complaint Management System

</body>

</HTML>

class19:OCMSnweusercongrat

<html>
<head>
<title>New User Registered</title>
</head>
<body bgcolor="#CCFFFF">
<CENTER>
<H1> Welcome, U have Successfully Registered </H1>
</CENTER>
<BR><HR>

<TABLE ALIGN="center" BORDER=0 height="102"


width="359">

<tr>
<td height="1" width="190">
<font size="4">U can Login Now</font>
</td>
<td height="1" width="155">
<font color="#0000FF"><a
href="OCMShome.jsp"><font size="4">Click here</font></a></font>
</td>
</tr>

215
Online Complaint Management System

</TABLE>

</body>
</html>

class20:OCMSproductcategory

<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%>


<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%>

<html>
<body>
<header><h2>Product Details</h2></header>

<table width="700" border=1>


<tr bgcolor="#D6DAF5">
<td><b><FONT color="blue">Product
ID</FONT></b></td>
<td><b><FONT color="blue">Product
Name</FONT></b></td>
<td><b><FONT
color="blue">Description</FONT></b></td>
<td><b><FONT
color="blue">Price</FONT></b></td>
<td><b><FONT
color="blue">Category</FONT></b></td>
</tr>
<logic:notEmpty name="list23">
<logic:iterate id="ABCDE" name="list23">
<tr align="left">
<td><bean:write name="ABCDE" property="id"/></td>

216
Online Complaint Management System

<td><bean:write name="ABCDE" property="name"/></td>


<td><bean:write name="ABCDE" property="description"/></td>
<td><bean:write name="ABCDE" property="price"/></td>
<td><bean:write name="ABCDE" property="category"/></td>
</tr>

</logic:iterate>
</logic:notEmpty>
</table>

<pre>

<html:link page="/OCMShome.jsp">HOME</html:link>

</pre>
</body>
</html>

class21:OCMSproductlist

<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%>

217
Online Complaint Management System

<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%>


<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%>

<html>
<body>
<header><h2>Product Details</h2></header>

<table width="700" border=1>


<tr bgcolor="#D6DAF5">
<td><b><FONT color="blue">Product
ID</FONT></b></td>
<td><b><FONT color="blue">Product
Name</FONT></b></td>
<td><b><FONT
color="blue">Description</FONT></b></td>
<td><b><FONT
color="blue">Price</FONT></b></td>
<td><b><FONT
color="blue">Category</FONT></b></td>
</tr>
<logic:notEmpty name="list124">
<logic:iterate id="ABCD" name="list124">
<tr align="left">
<td><bean:write name="ABCD" property="id"/></td>
<td><bean:write name="ABCD" property="name"/></td>
<td><bean:write name="ABCD" property="description"/></td>
<td><bean:write name="ABCD" property="price"/></td>
<td><bean:write name="ABCD" property="category"/></td>
</tr>

</logic:iterate>
</logic:notEmpty>
</table>

218
Online Complaint Management System

<pre>

<html:link page="/OCMShome.jsp">HOME</html:link>

</pre>
</body>
</html>

class23:OCMSproductlist1

<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%>


<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%>

<html>
<body>
<header><h2>Product Details</h2></header>

<table width="700" border=1>


<tr bgcolor="#D6DAF5">
<td><b><FONT color="blue">Product
ID</FONT></b></td>
<td><b><FONT color="blue">Product
Name</FONT></b></td>

219
Online Complaint Management System

<td><b><FONT
color="blue">Description</FONT></b></td>
<td><b><FONT
color="blue">Price</FONT></b></td>
<td><b><FONT
color="blue">Category</FONT></b></td>
</tr>
<logic:notEmpty name="list125">
<logic:iterate id="AB" name="list125">
<tr align="left">

<td><bean:write name="AB" property="id"/></td>


<td><bean:write name="AB" property="name"/></td>
<td><bean:write name="AB" property="description"/></td>
<td><bean:write name="AB" property="price"/></td>
<td><bean:write name="AB" property="category"/></td>
</tr>

</logic:iterate>
</logic:notEmpty>
</table>

<pre>

<html:link page="/OCMShome.jsp">HOME</html:link>

220
Online Complaint Management System

</pre>
</body>
</html>

class23:OCMSproductlistbyemployee

<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%>


<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%>

<html>
<body>
<header><h2>Product Details</h2></header>

<table width="700" border=1>


<tr bgcolor="#D6DAF5">
<td><b><FONT color="blue">Product
ID</FONT></b></td>
<td><b><FONT color="blue">Product
Name</FONT></b></td>
<td><b><FONT
color="blue">Description</FONT></b></td>
<td><b><FONT
color="blue">Price</FONT></b></td>
<td><b><FONT
color="blue">Category</FONT></b></td>
</tr>
<logic:notEmpty name="list21">
<logic:iterate id="xyz" name="list21">
<tr align="left">
<td><bean:write name="xyz" property="id"/></td>
<td><bean:write name="xyz" property="name"/></td>
<td><bean:write name="xyz" property="description"/></td>

221
Online Complaint Management System

<td><bean:write name="xyz" property="price"/></td>


<td><bean:write name="xyz" property="category"/></td>
</tr>

</logic:iterate>
</logic:notEmpty>
</table>

<pre>

<html:link page="/OCMShome.jsp">HOME</html:link>

</pre>
</body>
</html>

class24:OCMSprofileupdate

successfulyy Edited

class25:OCMSsearchbyinvalid

222
Online Complaint Management System

<html>
<head>
<title>Invalid User</title>
</head>
<body bgcolor="#CCFFFF">
<CENTER>
<H1> Invalid User </H1>
</CENTER>
<BR><HR>

<form method="POST" action="">


<p align="center">
<font size="5" color=#000000>The specified user does not exist
in Database. </font>
<BR>
<BR>
<BR>
<TABLE ALIGN="center" BORDER=0 height="102"
width="359">

<tr>
<td height="1" width="190">
<font size="4">Enter Again Valid Username</font>
</td>
<td height="1" width="155">
<font color="#0000FF"><a
href="OCMSadmin.jsp"><font size="4">Click here</font></a></font>
</td>
</tr>

</TABLE>
</form>
</body>
</html>

223
Online Complaint Management System

class26:OCMSsearchdisplay

ddddddd

class27:search

delet user

class28:useralreadyexist

User Already Exits

Class29:struta-cofig

<?xml version="1.0" encoding="ISO-8859-1" ?>

<!DOCTYPE struts-config PUBLIC


"-//Apache Software Foundation//DTD Struts Configuration
1.2//EN"
"http://jakarta.apache.org/struts/dtds/struts-config_1_2.dtd">

<struts-config>

<data-sources>
<data-source type="org.apache.commons.dbcp.BasicDataSource">
<set-property
property="driverClassName"
value="com.mysql.jdbc.Driver" />
<set-property
property="url"
value="jdbc:mysql://localhost:3306/OCMS" />
<set-property
property="username"

224
Online Complaint Management System

value="root" />
<set-property
property="password"
value="root" />

</data-source>
</data-sources>

<form-beans>

<form-bean
name="Roleselectionform"
type="com.OCMS.beans.Roleselectionform"/>

<form-bean
name="Homeloginform"
type="com.OCMS.beans.Homeloginform"/>

<form-bean
name="Newuserloginform"
type="com.OCMS.beans.Newuserloginform"/>

<form-bean
name="Deleteform"
type="com.OCMS.beans.Deleteform"/>

<form-bean
name="Searchform"
type="com.OCMS.beans.Searchform"/>

<form-bean
name="Productlistform"
type="com.OCMS.beans.Productlistform"/>

<form-bean
name="Productcategoryform"

225
Online Complaint Management System

type="com.OCMS.beans.Productcategoryform"/>

<form-bean
name="Empprofileform"
type="com.OCMS.beans.Empprofileform"/>

<form-bean
name="Empprofileform1"
type="com.OCMS.beans.Empprofileform1"/>

</form-beans>
<action-mappings>
<action
path="/OCMS"
type="com.OCMS.actions.Homeloginactiondao"
name="Homeloginform"
parameter="role">

<forward name="admin" path="/OCMSadmin.jsp"/>


<forward name="invalid" path="/OCMSinvaliduser.jsp"/>
<forward name="employee" path="/OCMSemployee.jsp"/>
<forward name="customer" path="/OCMScustomer.jsp"/>

</action>

<action

path="/newuser"
name="Newuserloginform"
parameter="role,state"
type="com.OCMS.actions.Newuserloginaction"
scope="request"
validate="true"
input="/OCMSnewuser.jsp">

226
Online Complaint Management System

<forward name="alreadyexist"
path="/OCMSalreadyexist.jsp"/>
<forward name="newusercongrat"
path="/OCMSnewusercongrat.jsp"/>

</action>

<action
path="/display"
type="com.OCMS.actions.Displayalldata"
name="Roleselectionform"
parameter="role">

<forward name="admindata" path="/OCMSdatadisplay.jsp"/>


<forward name="customerdata"
path="/OCMSdatadisplay.jsp"/>
<forward name="employeedata"
path="/OCMSdatadisplay.jsp"/>

</action>

<action
path="/display1"
type="com.OCMS.actions.Displayalldata"
name="Roleselectionform"
parameter="role1">

<forward name="OCMSdeleteuser"
path="/OCMSdeleteuser.jsp"/>

</action>

227
Online Complaint Management System

<action
path="/deleteuser"
type="com.OCMS.actions.Deleteuser"
name="Deleteform">

<forward name="delete" path="/OCMSdeletebyadmin.jsp"/>


<forward name="invalid" path="/OCMSinvalid.jsp"/>

</action>

<action
path="/searchbyadmin"
type="com.OCMS.actions.Searchaction"
name="Searchform">

<forward name="adminsearchdata"
path="/OCMSadminsearchdata.jsp"/>
<forward name="searchbyinvalid"
path="/OCMSsearchbyinvalid.jsp"/>

</action>

<action
path="/searchbyemployee"
type="com.OCMS.actions.Employeeaction"
name="Searchform">

<forward name="databyemployeesearch"
path="/OCMSempsearch.jsp"/>
<forward name="invalidentry"
path="/OCMSinvalidentry.jsp"/>

228
Online Complaint Management System

</action>

<action
path="/employeeproductsearch"
type="com.OCMS.actions.Empproductsearch"
name="Productlistform">

<forward name="product"
path="/OCMSproductlistbyemployee.jsp"/>
<forward name="searchbyinvalid"
path="/OCMSinvalidproduct.jsp"/>

</action>

<action
path="/productlistbyemployee"
type="com.OCMS.actions.Empproductlist"
name="Productcategoryform"
parameter="category">

<forward name="productcategory"
path="/OCMSproductcategory.jsp"/>

</action>

<action
path="/searchbycustomer"
type="com.OCMS.actions.Productsearchaction"
name="Productlistform">

229
Online Complaint Management System

<forward name="productlistshow"
path="/OCMSproductlist.jsp"/>
<forward name="searchbyinvalid"
path="/OCMSinvalididproduct.jsp"/>

</action>

<action
path="/productlist"
type="com.OCMS.actions.Productcategoryaction"
name="Productcategoryform"
parameter="category">

<forward name="productlistcategory"
path="/OCMSproductlist1.jsp"/>
<forward name="searchbyinvalid"
path="/OCMSinvalidentry.jsp"/>

</action>

<action
path="/editbyid"
type="com.OCMS.actions.EmployeeProfileAction"
name="Empprofileform">

<forward name="show" path="/OCMSemployeeprofile.jsp"/>

</action>

<action
path="/updatebyid"
type="com.OCMS.actions.EditAction"
name="Empprofileform1">

230
Online Complaint Management System

<forward name="success" path="/OCMSprofileupdate.jsp"/>

</action>

<action
path="/editbycustomerid"
type="com.OCMS.actions.EmployeeProfileAction"
name="Empprofileform">

<forward name="show" path="/OCMSemployeeprofile.jsp"/>

</action>

</action-mappings>
<message-resources
parameter="ApplicationResources.ApplicationResources_en_US" />

<plug-in className="org.apache.struts.validator.ValidatorPlugIn">
<set-property
property="pathnames"
value="/WEB-INF/validator-rules.xml,/WEB-
INF/validation.xml"/>
</plug-in>

</struts-config>

class30:tiles-defs

231
Online Complaint Management System

<?xml version="1.0" encoding="ISO-8859-1" ?>

<!DOCTYPE tiles-definitions PUBLIC


"-//Apache Software Foundation//DTD Tiles Configuration
1.1//EN"
"http://jakarta.apache.org/struts/dtds/tiles-config_1_1.dtd">

<!--
This is a blank Tiles definition file with a commented example.
-->

<tiles-definitions>

<!-- sample tiles definitions


<definition name=".mainLayout"
path="/common/layouts/classicLayout.jsp">
<put name="title" value="Sample Page Title" />
<put name="header" value="/common/header.jsp" />
<put name="menu" value=".mainMenu" />
<put name="footer" value="/common/footer.jsp" />
<put name="body" value=".portal.body" />
</definition>

<definition name=".mainMenu"
path="/common/layouts/vboxLayout.jsp" >
<putList name="list" >
<add value=".menu.links" />
<add value=".menu.taglib.references" />
<add value=".menu.printer.friendly" />
<add value=".menu.old.documents" />
</putList>
</definition>

<definition name="aPage" extends=".mainLayout">

232
Online Complaint Management System

<put name="title" value="Another Title" />


<put name="body" value=".aPage.body" />
</definition>

end samples -->

<definition name="${YOUR_DEFINITION_HERE}">
</definition>

</tiles-definitions>

class31:validation

<?xml version="1.0" encoding="ISO-8859-1" ?>

<!DOCTYPE form-validation PUBLIC


"-//Apache Software Foundation//DTD Commons Validator
Rules Configuration 1.1.3//EN"
"http://jakarta.apache.org/commons/dtds/validator_1_1_3.dtd">

<form-validation>

<formset>

<form name="Newuserloginform">
<field
property="username"
depends="required,minlength,maxlength,mask">
<arg key="inputForm.username"/>
<arg1 key="${var:minlength}"
name="minlength" resource="false"/>
<arg key="inputForm.username"/>
<arg1 key="${var:maxlength}"
name="maxlength" resource="false"/>
<var>
<var-name>minlength</var-name>

233
Online Complaint Management System

<var-value>5</var-value>
</var>

<var>
<var-name>maxlength</var-name>
<var-value>10</var-value>
</var>
<var>
<var-name>mask</var-name>
<var-value>^[a-z A-z]{1}[a-z 0-9]*$</var-value>
</var>

</field>

<field
property="password"
depends="required,minlength,maxlength,mask">
<arg key="inputForm.password"/>
<arg1 key="${var:minlength}"
name="minlength" resource="false"/>
<arg key="inputForm.password"/>
<arg1 key="${var:maxlength}"
name="maxlength" resource="false"/>
<var>
<var-name>minlength</var-name>
<var-value>5</var-value>
</var>

<var>
<var-name>maxlength</var-name>
<var-value>10</var-value>
</var>
<var>
<var-name>mask</var-name>
<var-value>^[a-z A-z]{1}[a-z 0-9]*$</var-value>
</var>

234
Online Complaint Management System

</field>
<field
property="pass1"
depends="required,minlength,maxlength,mask">
<arg key="inputForm.pass1"/>
<arg1 key="${var:minlength}"
name="minlength" resource="false"/>
<arg key="inputForm.password"/>
<arg1 key="${var:maxlength}"
name="maxlength" resource="false"/>
<var>
<var-name>minlength</var-name>
<var-value>5</var-value>
</var>

<var>
<var-name>maxlength</var-name>
<var-value>10</var-value>
</var>
<var>
<var-name>mask</var-name>
<var-value>^[a-z A-z]{1}[a-z 0-9]*$</var-value>
</var>
</field>
<field
property="firstname"
depends="required">
<arg key="inputForm.firstname"/>
</field>
<field
property="middlename"
depends="required">
<arg key="inputForm.middlename"/>
</field>
<field
property="lastname"
depends="required">

235
Online Complaint Management System

<arg key="inputForm.lastname"/>
</field>

<field
property="role"
depends="required">
<arg key="inputForm.role"/>
</field>

<field
property="address1"
depends="required">
<arg key="inputForm.address1"/>
</field>
<field
property="address2"
depends="required">
<arg key="inputForm.address2"/>
</field>
<field
property="city"
depends="required">
<arg key="inputForm.city"/>
</field>
<field
property="state"
depends="required">
<arg key="inputForm.state"/>
</field>
<field
property="pincode"
depends="required">
<arg key="inputForm.pincode"/>
</field>
<field
property="emailid"
depends="required">

236
Online Complaint Management System

<arg key="inputForm.emailid"/>
</field>
<field
property="phonenumber"
depends="required">
<arg key="inputForm.phonenumber"/>
</field>

</form>

</formset>
</form-validation>

class32:validator-rules

<!DOCTYPE form-validation PUBLIC


"-//Apache Software Foundation//DTD Commons Validator
Rules Configuration 1.1.3//EN"
"http://jakarta.apache.org/commons/dtds/validator_1_1_3.dtd">
<!--
$Header: /home/cvs/jakarta-struts/conf/share/validator-rules.xml,v
1.52 2004/07/25 12:00:20 niallp Exp $
$Revision: 1.52 $
$Date: 2004/07/25 12:00:20 $

This file contains the default Struts Validator pluggable validator


definitions. It should be placed somewhere under /WEB-INF and
referenced in the struts-config.xml under the plug-in element
for the ValidatorPlugIn.

<plug-in className="org.apache.struts.validator.ValidatorPlugIn">
<set-property property="pathnames" value="/WEB-INF/validator-
rules.xml,
/WEB-INF/validation.xml"/>

237
Online Complaint Management System

</plug-in>

These are the default error messages associated with


each validator defined in this file. They should be
added to your projects ApplicationResources.properties
file or you can associate new ones by modifying the
pluggable validators msg attributes in this file.

# Struts Validator Error Messages


errors.required={0} is required.
errors.minlength={0} can not be less than {1} characters.
errors.maxlength={0} can not be greater than {1} characters.
errors.invalid={0} is invalid.

errors.byte={0} must be a byte.


errors.short={0} must be a short.
errors.integer={0} must be an integer.
errors.long={0} must be a long.
errors.float={0} must be a float.
errors.double={0} must be a double.

errors.date={0} is not a date.


errors.range={0} is not in the range {1} through {2}.
errors.creditcard={0} is an invalid credit card number.
errors.email={0} is an invalid e-mail address.

Note: Starting in Struts 1.2.0 the default javascript definitions have


been consolidated to commons-validator. The default can be
overridden
by supplying a <javascript> element with a CDATA section, just
as
in struts 1.1.

-->

<form-validation>

238
Online Complaint Management System

<global>

<validator name="required"
classname="org.apache.struts.validator.FieldChecks"
method="validateRequired"
methodParams="java.lang.Object,
org.apache.commons.validator.ValidatorAction,
org.apache.commons.validator.Field,
org.apache.struts.action.ActionMessages,
javax.servlet.http.HttpServletRequest"
msg="errors.required"/>

<validator name="requiredif"
classname="org.apache.struts.validator.FieldChecks"
method="validateRequiredIf"
methodParams="java.lang.Object,
org.apache.commons.validator.ValidatorAction,
org.apache.commons.validator.Field,
org.apache.struts.action.ActionMessages,
org.apache.commons.validator.Validator,
javax.servlet.http.HttpServletRequest"
msg="errors.required"/>

<validator name="validwhen"
msg="errors.required"

classname="org.apache.struts.validator.validwhen.ValidWhen"
method="validateValidWhen"
methodParams="java.lang.Object,
org.apache.commons.validator.ValidatorAction,
org.apache.commons.validator.Field,
org.apache.struts.action.ActionMessages,
org.apache.commons.validator.Validator,
javax.servlet.http.HttpServletRequest"/>

<validator name="minlength"

239
Online Complaint Management System

classname="org.apache.struts.validator.FieldChecks"
method="validateMinLength"
methodParams="java.lang.Object,
org.apache.commons.validator.ValidatorAction,
org.apache.commons.validator.Field,
org.apache.struts.action.ActionMessages,
javax.servlet.http.HttpServletRequest"
depends=""
msg="errors.minlength"

jsFunction="org.apache.commons.validator.javascript.validateMinLeng
th"/>

<validator name="maxlength"
classname="org.apache.struts.validator.FieldChecks"
method="validateMaxLength"
methodParams="java.lang.Object,
org.apache.commons.validator.ValidatorAction,
org.apache.commons.validator.Field,
org.apache.struts.action.ActionMessages,
javax.servlet.http.HttpServletRequest"
depends=""
msg="errors.maxlength"

jsFunction="org.apache.commons.validator.javascript.validateMaxLen
gth"/>

<validator name="mask"
classname="org.apache.struts.validator.FieldChecks"
method="validateMask"
methodParams="java.lang.Object,
org.apache.commons.validator.ValidatorAction,
org.apache.commons.validator.Field,
org.apache.struts.action.ActionMessages,

240
Online Complaint Management System

javax.servlet.http.HttpServletRequest"
depends=""
msg="errors.invalid"/>

<validator name="byte"
classname="org.apache.struts.validator.FieldChecks"
method="validateByte"
methodParams="java.lang.Object,
org.apache.commons.validator.ValidatorAction,
org.apache.commons.validator.Field,
org.apache.struts.action.ActionMessages,
javax.servlet.http.HttpServletRequest"
depends=""
msg="errors.byte"
jsFunctionName="ByteValidations"/>

<validator name="short"
classname="org.apache.struts.validator.FieldChecks"
method="validateShort"
methodParams="java.lang.Object,
org.apache.commons.validator.ValidatorAction,
org.apache.commons.validator.Field,
org.apache.struts.action.ActionMessages,
javax.servlet.http.HttpServletRequest"
depends=""
msg="errors.short"
jsFunctionName="ShortValidations"/>

<validator name="integer"
classname="org.apache.struts.validator.FieldChecks"
method="validateInteger"
methodParams="java.lang.Object,
org.apache.commons.validator.ValidatorAction,
org.apache.commons.validator.Field,

241
Online Complaint Management System

org.apache.struts.action.ActionMessages,
javax.servlet.http.HttpServletRequest"
depends=""
msg="errors.integer"
jsFunctionName="IntegerValidations"/>

<validator name="long"
classname="org.apache.struts.validator.FieldChecks"
method="validateLong"
methodParams="java.lang.Object,
org.apache.commons.validator.ValidatorAction,
org.apache.commons.validator.Field,
org.apache.struts.action.ActionMessages,
javax.servlet.http.HttpServletRequest"
depends=""
msg="errors.long"/>

<validator name="float"
classname="org.apache.struts.validator.FieldChecks"
method="validateFloat"
methodParams="java.lang.Object,
org.apache.commons.validator.ValidatorAction,
org.apache.commons.validator.Field,
org.apache.struts.action.ActionMessages,
javax.servlet.http.HttpServletRequest"
depends=""
msg="errors.float"
jsFunctionName="FloatValidations"/>

<validator name="double"
classname="org.apache.struts.validator.FieldChecks"
method="validateDouble"
methodParams="java.lang.Object,
org.apache.commons.validator.ValidatorAction,

242
Online Complaint Management System

org.apache.commons.validator.Field,
org.apache.struts.action.ActionMessages,
javax.servlet.http.HttpServletRequest"
depends=""
msg="errors.double"/>

<validator name="date"
classname="org.apache.struts.validator.FieldChecks"
method="validateDate"
methodParams="java.lang.Object,
org.apache.commons.validator.ValidatorAction,
org.apache.commons.validator.Field,
org.apache.struts.action.ActionMessages,
javax.servlet.http.HttpServletRequest"
depends=""
msg="errors.date"
jsFunctionName="DateValidations"/>

<validator name="intRange"
classname="org.apache.struts.validator.FieldChecks"
method="validateIntRange"
methodParams="java.lang.Object,
org.apache.commons.validator.ValidatorAction,
org.apache.commons.validator.Field,
org.apache.struts.action.ActionMessages,
javax.servlet.http.HttpServletRequest"
depends="integer"
msg="errors.range"/>

<validator name="floatRange"
classname="org.apache.struts.validator.FieldChecks"
method="validateFloatRange"
methodParams="java.lang.Object,
org.apache.commons.validator.ValidatorAction,

243
Online Complaint Management System

org.apache.commons.validator.Field,
org.apache.struts.action.ActionMessages,
javax.servlet.http.HttpServletRequest"
depends="float"
msg="errors.range"/>

<validator name="creditCard"
classname="org.apache.struts.validator.FieldChecks"
method="validateCreditCard"
methodParams="java.lang.Object,
org.apache.commons.validator.ValidatorAction,
org.apache.commons.validator.Field,
org.apache.struts.action.ActionMessages,
javax.servlet.http.HttpServletRequest"
depends=""
msg="errors.creditcard"/>

<validator name="email"
classname="org.apache.struts.validator.FieldChecks"
method="validateEmail"
methodParams="java.lang.Object,
org.apache.commons.validator.ValidatorAction,
org.apache.commons.validator.Field,
org.apache.struts.action.ActionMessages,
javax.servlet.http.HttpServletRequest"
depends=""
msg="errors.email"/>

<validator name="url"
classname="org.apache.struts.validator.FieldChecks"
method="validateUrl"
methodParams="java.lang.Object,
org.apache.commons.validator.ValidatorAction,
org.apache.commons.validator.Field,
org.apache.struts.action.ActionMessages,

244
Online Complaint Management System

javax.servlet.http.HttpServletRequest"
depends=""
msg="errors.url"/>

<!--
This simply allows struts to include the validateUtilities into a
page, it should
not be used as a validation rule.
-->
<validator name="includeJavaScriptUtilities"
classname=""
method=""
methodParams=""
depends=""
msg=""

jsFunction="org.apache.commons.validator.javascript.validateUtilities"
/>

</global>

</form-validation>

class33:web

<?xml version="1.0" encoding="ISO-8859-1"?>

<!DOCTYPE web-app
PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN"
"http://java.sun.com/j2ee/dtds/web-app_2_2.dtd">

<web-app>
<display-name>Struts Blank Application</display-name>

<!-- Standard Action Servlet Configuration (with debugging) -->


<servlet>
<servlet-name>action</servlet-name>

245
Online Complaint Management System

<servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
<init-param>
<param-name>config</param-name>
<param-value>/WEB-INF/struts-config.xml</param-value>
</init-param>
<init-param>
<param-name>debug</param-name>
<param-value>2</param-value>
</init-param>
<init-param>
<param-name>detail</param-name>
<param-value>2</param-value>
</init-param>
<load-on-startup>2</load-on-startup>
</servlet>

<!-- Standard Action Servlet Mapping -->


<servlet-mapping>
<servlet-name>action</servlet-name>
<url-pattern>*.do</url-pattern>
</servlet-mapping>

<!-- The Usual Welcome File List -->


<welcome-file-list>
<welcome-file>OCMShome.jsp</welcome-file>
</welcome-file-list>

<!-- Struts Tag Library Descriptors -->


<taglib>
<taglib-uri>/tags/struts-bean</taglib-uri>
<taglib-location>/WEB-INF/struts-bean.tld</taglib-location>
</taglib>

<taglib>

246
Online Complaint Management System

<taglib-uri>/tags/struts-html</taglib-uri>
<taglib-location>/WEB-INF/struts-html.tld</taglib-location>
</taglib>

<taglib>
<taglib-uri>/tags/struts-logic</taglib-uri>
<taglib-location>/WEB-INF/struts-logic.tld</taglib-location>
</taglib>

<taglib>
<taglib-uri>/tags/struts-nested</taglib-uri>
<taglib-location>/WEB-INF/struts-nested.tld</taglib-location>
</taglib>

<taglib>
<taglib-uri>/tags/struts-tiles</taglib-uri>
<taglib-location>/WEB-INF/struts-tiles.tld</taglib-location>
</taglib>

</web-app>

247
Online Complaint Management System

<pre>

<html:link page="/OCMShome.jsp">HOME</html:link>
<html:link page="/OCMSadmin.jsp">Admin Page</html:link>

</pre>
</body>
</html>

248
Online Complaint Management System

Output Screens

249
Online Complaint Management System

250
Online Complaint Management System

251
Online Complaint Management System

252
Online Complaint Management System

253
Online Complaint Management System

254
Online Complaint Management System

255
Online Complaint Management System

256
Online Complaint Management System

257
Online Complaint Management System

258
Online Complaint Management System

259
Online Complaint Management System

260
Online Complaint Management System

261
Online Complaint Management System

Testing

Testing is the filter to catch defects before they are “discovered” by


the customer or end user. Every time a customer runs the program,
he/she generates a “test-case”. We tried the test cases to find the
defects first since software development is a human activity and
there may be potential errors. So testing before the product is
delivered helped us to assure the quality and saved resources.

Testing Objective
Objective of testing is to find errors, demonstrate that software
functions that satisfy the specification, reduce the number of errors
detected by customer, have “confidence” in the software system. A
good test always tries to discover undetected errors and is
successful when errors are found since zero defects is not possible.
There is always a condition or usage that can lead to an incorrect
behavior.

Testing Steps
We started testing each individual new component and worked out
as unit test, integration test, high order test, customer acceptance
testing and different testing techniques are used at different times
in the process.

Testing Techniques

Following testing techniques are used.

White Box Testing


In white box testing we exercises the internal logic of a program,
examine internal program structure and derived tests from an

262
Online Complaint Management System

examination of the program’s logic, tested internal paths and


working of the software. To perform this we used to develop test
cases for unit and integration testing.

Black Box Testing


In black box testing we exercises the input and output requirements
of a program, tested by conducting specifications of requirement
for which the software should do. This test is derived from the I/O
specification and used in most functional tests.

White Box Strategies


White box testing strategies uses the control structure of the
program and design to derive test cases.

Basis Path Testing


Test cases are derived to exercise the basis set that guarantee that
every statement in the program is executed at least once during
testing. It is applied in series of steps.

Test case for login button of the login form:


Test case 1: All the following combinations are tested
Password is valid and Username is valid
Password is valid and Username is invalid
Password is invalid and Username is invalid
Password is invalid and Username is valid

Expected results: No error crossing this stage when Password


& Username are both permissible combination of characters. In all
other case error message is displayed.

Test case 2: Following input combination is tried where


permissible set of characters for username & password are entered
which are non-existent in table.
 Password is valid, existent and Username is valid, existent

263
Online Complaint Management System

 Password is valid, existent and Username is valid,


nonexistent
 Password is valid, nonexistent and Username is valid,
existent
 Password is valid, nonexistent and Username is valid,
nonexistent

Expected Results: If no entry into the system then error


message displayed and user is linked to the registration page.

Test Case 3: To test this both username & password to be entered


must be valid & existent in the registration table.
Password = Valid, Existent and Username = Valid, Existent.
Similarly, all the other internal paths & logic can be tested.

Control Structure Testing


Condition testing
Condition testing is a test case design method that exercises the
logical conditions contained in a program module. If a condition is
incorrect, then at least one of the conditions is incorrect. So, types
of errors in a condition include Boolean operator error
(incorrect/missing/extra Boolean operators), Boolean variable
error, Boolean parenthesis error, relational operator error and
arithmetic expression error. It mainly focuses on testing each
condition in the program. The condition testing strategies to be
employed are:

Branch testing: For a compound condition C, the true and false


branches of C and every simple condition in C need to be executed
at least once.

Domain testing: It requires three or four tests to be derived for a


relational expression. For a relational expression of the form
E1 <relational operator> E2

264
Online Complaint Management System

Three tests are required to make the value of E1 greater than,


equal to, or less than that of E2.

Boolean Expression testing: A condition without relational


expression with n variables, all of 2n possible tests are required
provided n > 0. This strategy can detect Boolean operator, variable,
and parenthesis errors, but it is practical only if n is small.

Loop testing
Loops are cornerstone for the vast majority of all algorithms
implemented in software. Loop testing focuses exclusively on the
validity of loop constructs. Testing approach for different types of
loops is listed below.
Simple loops: The following set of tests will be applied to simple
loops, where n is the maximum number of allowable passes
through the loop.
 Skip the loop entirely
 Only one pass through the loop
 Two passes through the loop
 m passes through the loop where m < n
 n – 1, n, n + 1 passes through the loop.

Nested loops: Simple loop testing strategy if applied to the nested


loops will increase the no. of possible tests geometrically.
Approach for nested loops are:
 Start at the innermost loop. Set all other loops to
minimum values
 Conduct simple loop tests for the innermost loop
while holding the outer loops at their minimum
iteration parameter values. Add other tests for out-
of-range or excluded values.
 Work outward, conducting tests for the next loop,
but keep all other outer loops at minimum values
and other nested loops to typical values.

265
Online Complaint Management System

 Continue till all loops have been tested.

Concatenated loops: When concatenated loops are independent


then approach for simple loop was applied & if they happen to be
dependent the nested loop approach was applied.

Unstructured loops: This class of loops was redesigned to reflect


the use of the structured programming constructs.

Black Box Strategies

Black Box testing strategy focuses on the functional requirements


of the software without any regard to the internal structure. It is
used in most system level testing where functional, performance,
recovery and security & stress are main issues. This applied
strategy finds errors in incorrect or missing functions (compared to
white box), interface errors, errors in external data structures and in
behavior performance problems (Combinations of input make it
behave poorly). It also finds errors in initialization and termination
(Sensitive to certain inputs (e.g. performance). It is performed
much later in process than white box...
A test strategy that uses every possible input condition as a test
case would be ideal but is not possible. We apply following Black-
Box Testing Strategies.

Graph Based Testing


The first step in black box testing is to understand the objects that
are modeled in software and the relationships that connect the
objects. Once this has been accomplished, the next step is to define
a series of tests that verify all objects that have the expected
relationship with another.

266
Online Complaint Management System

Equivalence Partitioning

It is a black-box testing method that divides the input domain of a


program into classes of data from which test cases can be derived.
It reduces, by more than one, the number of test cases that must be
developed since one test case might uncover a class of errors. It
covers a large set of other possible test cases hence helps reduce
the number of inputs. Incorrect processing of all integer number is
detected.
Identifying Equivalence Classes: Each input condition (a sentence
or phrase in the specification) is taken & divided into 2 or more
classes as valid equivalence class and invalid equivalence class.
Rules for Equivalence Classes:
Range - If an input condition specifies a range (i.e. n is an integer
from 1 to 10) then
i) 1 valid (if 1<= n and <= 1000)
ii) 2 invalid (if n < 1 and > 1000)
Specified Value - An input condition specifies a specific value e.g.
10 character string then
i) 1 valid (10 character string)
ii) 2 invalid (any character string less than 10)
Value Set - If the input specifies a set of valid values, then
i) 1 valid condition within the set.
ii) 1 invalid condition outside the set.
Boolean - If an input condition specifies a “must be” situation (e.g.
either Yes or No) then
i) 1 valid (if Yes).
ii) 1 invalid (else No).

Boundary Value Analysis

267
Online Complaint Management System

It is a test case design technique that complements equivalence


partitioning, by selecting test cases at the “edges” of the class.
Greater no. Of errors tends to occur at the boundaries of the input
domain rather than in the “Center”. Rather than any element in
class, BVA selects tests at the edge of the class. In addition to input
condition, test cases can be derived for output conditions. Similar
to Equivalence partitioning, BVA, equivalence classes are
identified first then boundaries.

Some guidelines for BVA:


1. If an input condition specifies a range bounded by values a and b
then test cases will be designed with values a and b and just above
and just below a and b.
2. If an input condition specifies a number of values, test
cases will be developed that exercise the minimum and
maximum numbers. Values just above and just below
minimum and maximum are also tested.
These 2 guidelines are also applied to the
output conditions. Designing test case to exercise the data structure
at its boundary will test boundaries prescribed on internal program
data structures.

268
Online Complaint Management System

Unit Testing:
It is based on the test plan foe various screens and their outputs.

S.No. Test Condition ExpectedResult Remarks


Should prompt for
Enter a username not permitting blank
1. Done
with a blank space. space and bring
focus on that field.
Should prompt for
invalid password
Enter an invalid
2. after verifying from Done
password
database and refocus
that field.
Press Login without Should prompt for
3. entering the username username or Done
or password. password.

System Testing:
It is based on the system test plan for concurrency and performance issues.

S.No. Test Condition Expected Result Remarks


Log on to the system using Should give
same username and message that
1. Done
password from two somebody is
different machines. already logged in.
Should redirect
Go to Daily Report section
2. you back to the Done
without logging in.
login page.

269
Online Complaint Management System

Log on to the system using


different user-id’s from Should allow but
3. Done
different machines and try do sequentially.
editing the same inquiry.
Log on to the system using
Should take
different user-id and
minimum time for
4. password from different Done
processing the
machines & do same
same inquiry.
inquiry.

270
Online Complaint Management System

Implementation

Implementation is undertaken once the design phase is complete.


In this phase, every module identified and specified in the design
document is independently coded and unit tested. Unit testing is
testing of different units or modules of a system in isolation.
The objective of the implementation phase is
 To define the organization of the code, in terms of
implementation subsystems organized in layers,
 To implement classes and objects in terms of components
(source files, binaries, executables, and others),
 To test the developed components as units, and
 To integrate the results produced by individual
implementers (or teams), into an executable system.
The Implementation phase limits its scope to how individual
classes are to be unit tested. System test and integration test are
described in the Testing phase
Coding Guidelines
This Section defines the coding guidelines to be adopted during
development of IMAR tool. Coding guidelines are essential for any
software the development, maintenance and enhancements of
which includes multiple programmers. In addition to providing for
better team development, a standard also allows for the
development of software tools to aid in the creation, testing, and
documentation of code.

Need of Code Conventions


Code conventions are important to programmers for a number of
reasons:
 80% of the lifetime cost of a piece of software goes to
maintenance.

271
Online Complaint Management System

 Hardly any software is maintained for its entire life span


by the original author.
 Code conventions improve the readability of the software,
allowing engineers to understand new codes more quickly and
thoroughly.
 By following coding conventions the development time
is reduced tremendously.
 It gradually develops a discipline among S/W Enggs. And
this discipline amounts to minimum number of bugs in the S/W
you write.
Java Source Files
Each Java source file contains a single public or default class or
interface. Interfaces associated with a class must be in different
source file. The public or default class should be the first class in
the file.
Java source files have the following ordering:
1) Package and Import statements.
2) Beginning comments.
3) Class/ interface implementation comment (/** … */)
4) Specific Comments (// for both single and multiple line
comments);
5) Class and interface declarations
6) Class/ interface statement
7) Static variables (in sequence)
8) Constructors
9) Method Comments
1.1.1 Beginning comments
All source files should begin with a JavaDoc-style comment that
lists the following things:
Project name:

272
Online Complaint Management System

Module name:
Program name:
Program description:
Author:
Date of Creation:
Modified Date:
Modified By:

Package and Import Statements


The first non-comment line of most Java source files is a package
statement. After that, import statements can follow. For example:
package java.awt;
import java.awt.peer.CanvasPeer;

Class/ interface implementation comment (/**...*/)


Class name:
Class description:
Author name @ author:
Date of creation:
Methods

Comments
Method name:
Method description:
Parameter @param:
Returns @return:
Exception @exception:
Author Name @ author:
Date @date:

Method Definition
Given below sequence is to be followed when defining methods:
private methods

273
Online Complaint Management System

protected methods
public methods
Note: All variables/ objects of same type should be clubbed
together i.e. all int should be at one place and strings type in one
place.
Naming Convention
Naming conventions make programs more understandable by
making them easier to read. They can also give information about
the function of the identifier-for example, whether it's a constant,
package, or class-which can be helpful in understanding the code.
 Naming Convention Will Be Uniform for the whole
project:
 The JAVA CLASS names Must Be Self Explanatory.
 First letter in lowercase, with the first letter of each
internal word in uppercase.
 Member Variables must start with m_ e.g. m_myChar
 For static variables the First Letter must be 's_'
 The names of variables declared class constants and of
ANSI constants should be all uppercase with words separated
by underscores ("_").
Coding Convention:
This Coding convention is uniform through out the project and it is
mandatory to follow these steps for all Classes we write:
These are the recommendations for code readability.
 The term compute can be used in methods where
something is computed.
 The term find can be used in methods where something is
looked up.
 The terms get/set must be used where an attribute is
accessed directly.

274
Online Complaint Management System

 The term initialise can be used where an object or a


concept is established.
 List suffix should be used on names representing a list of
objects.
 n prefix should be used for variables representing a
number of objects.
 No suffix should be used for variables representing an
entity number.
 Iterator variables can be called i, j, k etc.
 is prefix should be used for Boolean variables and
methods.
 Complement names must be used for complement entities.
get/set, add/remove, create/destroy, start/stop, insert/delete,
increment/decrement, old/new, begin/end, first/last, up/down,
min/max, next/previous, old/new, open/close, show/hide
 Abbreviations in names should be avoided.
 Negated Boolean variable names must be avoided
 Associated constants (final variables) should be prefixed
by a common type name.
 Exception classes should be suffixed with Exception.
 Default interface implementations can be prefixed by
Default.
Files
 Classes should be declared in individual files with the file
name matching the class name.
 File content must be kept within 80 columns.
 Special characters like TAB and page break must be
avoided.
 The incompleteness of split lines must be made obvious.

275
Online Complaint Management System

 Split lines occurs when a statement exceed the 80 column


limit given above. It is difficult to give rigid rules for how lines
should be split. In general:
 Break after a comma.
 Break after an operator.
 Align the new line with the beginning of the expression on
the previous line.
 Variables should be initialised where they are declared and
they should be declared in the smallest scope possible.
 Variables must never have dual meaning.
 Class variables should never be declared public.
 Related variables of the same type can be declared in a
common statement.
 Unrelated variables should not be declared in the same
statement.
 Variables should be kept alive for as short a time as
possible.
Comments
 Tricky code should not be commented but rewritten.
 Making the code self-documenting by names and an
explicit logical structure should in general minimize the use of
comments.
 Use // for all comments, also multi line comments for
description only.
 Comments should be indented relative to their position in
the code.
 The declaration of collection variables should be followed
by a comment stating the common type of the elements of the
collection.

276
Online Complaint Management System

Code Statistics
Statistic Value
Number of .java files 42
Number of Classes 50
Lines of Code 11659
Non Commented Lines of Code 7610
Number of statements 5669
Reusable Lines of Code

Code Listing
As the source code is the copy right of <Company Name>,
therefore it was not permitted to attach the code here.
Unit Testing
Unit testing (or module testing) is the testing of different units or
modules of a system in isolation.
Verification and Validation
Verification is the process of determining whether one phase of a
software product conforms to its previous phase, whereas
validation is the process of determining whether a fully developed
system conforms to its requirements specification. Thus while
verification is concerned with phase containment of errors, the aim
of validation is to make the final product error free.
Conclusion
System is implemented as per guidelines and handed over to the
testing team for Integration and System testing.

277
Online Complaint Management System

System Security

Introduction

Software security applies information security principles to


software development. Information security is commonly defined
as "the protection of information systems against unauthorized
access to or modification of information, whether in storage,
processing or transit, and against the denial of service to authorized
users of the provision of service to unauthorized users, including
those measures necessary to detect, document, and counter such
threats." Many questions regarding security are related to the
software life cycle itself. In particular, the security of code and
software processes must be considered during the design and
development phase. In addition, security must be preserved during
operation and maintenance to ensure the integrity of a piece of
software.

The mass of security functionality employed by today's networked


world, might deceive us into believing that our jobs as secure
system designers are already done. However, computers and
networks are incredibly insecure. The lack of security stems from
two fundamental problems. Systems, which are theoretically
secure, may not be secure in practice. Furthermore, systems are
increasingly complex; complexity provides more opportunities for
attacks. It is much easier to prove that a system is insecure than to
demonstrate that one is secure -- to prove insecurity, one simply
exploits certain system vulnerability. On the other hand, proving a
system secure requires demonstrating that all possible exploits can
be defended against (a very daunting, if not impossible, task).

278
Online Complaint Management System

There is presently no single solution for secure software


engineering. However, there are specific approaches, which
improve the likelihood that a system is secure. In particular, we can
improve software reliability. We can also improve our
understanding of what must be required to trust a given piece of
software.
Good Practice
Security requires more managing and mitigating risk than it does
technology. When developing software one must first determine
the risks of a particular application. For example, today's typical
web site may be subject to a variety of risks, ranging from
defacement, to distributed denial of service (DDoS, described in
detail later) attacks, to transactions with the wrong party.
Once the risks are identified, identifying appropriate security
measures becomes tractable. In particular, when defining
requirements, it is important to consider how the application will
be used, who will be using the application, etc. With that
knowledge, one can decide whether or not to support complex
features like auditing, accounting, no repudiation, etc.
Another potentially important issue is how to support naming. The
rise of distributed systems has made naming increasingly
important. Naming is typically handled by rendezvous: a principal
exporting a name advertises it somewhere, and someone wishing to
use that name searches for it (phone books and directories are
examples). For example, in a system such as a resource discovery
system, both the resources and the individuals using those
resources must be named. Often there are tradeoffs with respect to
naming: while naming can provide a level of indirection, it also
can create additional problems if the names are not stable. Names
can allow principals to play different roles in a particular system
that can also be useful.

279
Online Complaint Management System

Security in OCMS
OCMS is fully secured system. Each user has a unique user-id and
password. Password is stored in encrypted form. Further users are
categorised into three classes:

Administrator
Administrator user has all the rights. He/She has full access to the
system. The main rights of the system administrator are:
 Add New Employee
 Edit Employee, Customer, Product Details
 Delete user(i.e. employee or customer)
 Search customer
 View Reports

User
User has following rights:
 Add New Product
 Edit Product Details
 Assign Complaints
 View Complaints
 View Reports

Customer
Customer has very limited access to the system. He/She can only
post the new complaints and can view the status of his/her own
posted complaint nothing else.
Maintenance
Software maintenance traditionally denotes the process of
modifying a software product after it has been delivered to the

280
Online Complaint Management System

customer. Maintenance is inevitable for almost any kind of


product. Most products need maintenance due to wear and tear
caused by use. On the other hand, software products do not need
maintenance on this count, but need maintenance on account of the
following three main reasons:
Corrective Maintenance
Corrective maintenance of a software product may be necessary
either to rectify some bugs observed while the system is in user or
to enhance the performance of system.
Adaptive Maintenance
A software product might need maintenance to support the new
features that the users want or to change different functionalities of
the systems, or when they need the product to interface with new
hardware or software.
Perfective Maintenance
A software product needs maintenance to support the new features
that the users want or to change different functionalities of the
system according to customer demands.
OCMS Maintenance
OCMS is developed in JAVA, which is platform independent so
there is no need of adaptive maintenance. OCMS needs Corrective
and perfective maintenance, because it is a new system and has
very high scope of extension.
Conclusion
OCMS is a secured system, as all measures are taken into account
so that unauthorised person could not access the system.

281
Online Complaint Management System

Reports

282
Online Complaint Management System

283
Online Complaint Management System

284
Online Complaint Management System

285
Online Complaint Management System

286
Online Complaint Management System

Pert Chart And Gantt Chart:-

The Gantt chart uses horizontal bars to show the durations of


actions or tasks. The left end marks the beginning of the task while
the right end its finish. Earlier tasks appear in the upper left and
later ones in the lower right. The PERT chart makes use of tasks. It
shows achievements. These achievements however are not task
achievements. They are terminal achievements, called events.
Arrows are used to represent tasks and circles represent the
beginning or completion of a task. The PERT chart uses these
paths and events to show the interrelationships of project activities.
In this project there are twelve activities/tasks.

1. Need Identification
2. Complete Project Proposal
3. Feasibility Study
4. Software Requirement Analysis
5. System Design
6. Coding
7. Test Run (Lab testing)
8. Modifications (if any)
9. Final Launch
10. Documentation

287
Online Complaint Management System

 Gantt Chart:-

288
Online Complaint Management System

 Pert Chart :-

The list of tasks and events is networked in a PERT chart in above


figure. The arrow length is not significant, but the sequence and

289
Online Complaint Management System

interconnections must give a true picture of the precedence of


activities to be completed. The numbers on the activity lines are
the time (in weeks) required between events.
Note: No. in circle denotes events serial no., while those with
the arrow denote taken in weeks.

PERT chart is valuable when a project is being planned. When the


network is finished, the next step is to determine the critical path.
According to above diagram the critical path is:

Critical Path = Start # – 0 – 2 – 3 – 4 – 5 – 7 – 9 – 10 – 11 – 12

Duration (in weeks) 4 + 4 + 1 + 4 + 5 + 2 + 1 + 2 + 1 = 24


weeks

The critical path is the longest path through the network. No task
on the critical path can be held up without delaying the start of the
next tasks and, ultimately, the completion of the project. So the
critical path determines the project completion date.

LIMITATION OF THE PROJECT

290
Online Complaint Management System

 OCMS system must be web – based

 The system requires persistent data.

 The system can only be deployed on server operating system.

 An IBM xSeries or equivalent or higher configuration server


is required.

 The system uses HTTP 1.1 protocols.

 IE 6.0 or compatible browser is required to access the


system.

 A minimum of 1024 MB RAM is required for running an


Application Server along with Oracle or MS SQL Server
2000 or IBM DB2 or MySQL.

291
Online Complaint Management System

Future scope/Further Enhancement

The future scope of the application is very vast, the project may
include the graphical tools, charts graph etc. It gives a visual effect
and one can easily find out one of things with just one view easily.
This application is very useful for any organization, which can be
access on the intranet. All the project details are stored in the
database and displays to the manager very easily, by which he or
she can manage his task and team members very easily.
There are certain future requirements, which are being considered
while studying the existing Complaints system currently system is
for few products but a large no. of products are to be listed and will
be able to serve the customers in a better way. These requirements
will be made available to our customers in the future

292
Online Complaint Management System

Bibliography

Java 2 : ---------------- THE COMPLETE REFERENCE


Servlet Programming: ----------- WROX PUBLICATIONS
System Analysis and Design Methods:------------ Elias M Awad
Software Engineering: --------------ROGER PRESSMAN
HTML --------------------Unleashed
JDBC:--------------------- WROX PUBLICATIONS & SUN
SERIES
Java Server Pages:--------------- WROX PUBLICATIONS
Java Beans:---------------- OREILLY

WEBSITES:

www.java.sun.com ------------ site for java documentation


www.xml.com ------------ site for XML documentation
www.w3.org/XML/ ------------ home page of XML Standards
www.hcltechnologies.com ----------- connects to HCL’s homepage
www.oracle.com ----------------- for SQL references
http://www.google.com -------------- search Engine

293

You might also like