Table of Content: Online Complaint Management System
Table of Content: 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
Online Complaint
Management
System
3
Online Complaint Management System
INTRODUCTION
4
Online Complaint Management System
5
Online Complaint Management System
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.
7
Online Complaint Management System
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
9
Online Complaint Management System
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
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:
HARDWARE INTERFACES
12
Online Complaint Management System
SYSTEM ANALYSIS
13
Online Complaint Management System
List of attributes of the entities - these are the data items which
need to be held about each entity.
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
15
Online Complaint Management System
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:
PRELIMINARY INVESTIGATION
16
Online Complaint Management System
17
Online Complaint Management System
INTERVIEWING
18
Online Complaint Management System
19
Online Complaint Management System
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
21
Online Complaint Management System
FEASIBILITY STUDY
22
Online Complaint Management System
23
Online Complaint Management System
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
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
Operational Feasibility:
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.
27
Online Complaint Management System
Project Planning
28
Online Complaint Management System
Project Schedule
Step # Time Frame
10 Days
Phase 1. Requirement Gathering
15 Days
Phase 2. System Design
29
Online Complaint Management System
System Engineering
30
Online Complaint Management System
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
Code Generation
Testing
Maintenance
32
Online Complaint Management System
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
34
Online Complaint Management System
Overview
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
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
Bibliography
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
Bibliography
APPENDIX
38
Online Complaint Management System
39
Online Complaint Management System
Context Diagram
CUSTOMER
COMPLAINT DATA
STORE
USER
Online
Complaint
Management
FIELD system REPORTS
ENGINEER
40
Online Complaint Management System
User Login
USER
2. Validate
1. Login User
3. Failure
4.
Success
5. Check
Authorization
41
Online Complaint Management System
Customer Registration
CUSTOMER 2. Validate
Registration
details
1. Enter
Registration
details
3. Validate
Unique
Emailed
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
44
Online Complaint Management System
User Task
USER
1.
Accesses
Complaint COMPLAINTS DATA STORE
s
3.
Calculate
Frequency
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
ComplaintSolved Reasons
Services
COMPLAINT
ComplaintText
ComplaintId
ComplaintDate
47
Online Complaint Management System
Password
UserNam RoleId RoleText
e Privilege
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:
58
Online Complaint Management System
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.
59
Online Complaint Management System
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
61
Online Complaint Management System
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.
Complaint Registration:
62
Online Complaint Management System
Service Engineer:
o The service engineer will read the complaints allotted to
her/him and then solve the complaints.
63
Online Complaint Management System
64
Online Complaint Management System
Database Design
65
Online Complaint Management System
66
Online Complaint Management System
67
Online Complaint Management System
68
Online Complaint Management System
Code Efficiency
69
Online Complaint Management System
70
Online Complaint Management System
Optimization of Code
71
Online Complaint Management System
72
Online Complaint Management System
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;
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
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
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
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;
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;
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;
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;
82
Online Complaint Management System
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;
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;
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;
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;
88
Online Complaint Management System
ResultSet rs=null;
Connection conn=null;
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;
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
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;
}
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;
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;
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;
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;
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;
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;
this.username="";
}
}
class3:Empprofiledto
package com.OCMS.beans;
import java.io.Serializable;
104
Online Complaint Management System
105
Online Complaint Management System
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;
107
Online Complaint Management System
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;
110
Online Complaint Management System
111
Online Complaint Management System
112
Online Complaint Management System
return state;
}
public void setState(String state) {
this.state = state;
}
class6:homelogindto
package com.OCMS.beans;
import java.io.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;
String username;
String password;
String role;
114
Online Complaint Management System
this.username=null;
this.password=null;
this.role=null;
}
}
class8:Newuserlogindto
package com.OCMS.beans;
import java.io.Serializable;
115
Online Complaint Management System
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;
118
Online Complaint Management System
119
Online Complaint Management System
return city;
}
120
Online Complaint Management System
121
Online Complaint Management System
122
Online Complaint Management System
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;
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;
125
Online Complaint Management System
this.category="";
class12:Productlistdto
package com.OCMS.beans;
import java.io.Serializable;
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;
127
Online Complaint Management System
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;
129
Online Complaint Management System
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;
}
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;
132
Online Complaint Management System
133
Online Complaint Management System
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;
}
135
Online Complaint Management System
class16:Searchdto
package com.OCMS.beans;
import java.io.Serializable;
136
Online Complaint Management System
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;
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;
}
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;
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;
static Connection
con=Dbconnectionfactory.getInstance().getConnection();
String s1=hlf.getUsername();
String s2=hlf.getPassword();
String s3=hlf.getRole();
con=ds.getConnection();
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;
145
Online Complaint Management System
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())
{
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;
}
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);
153
Online Complaint Management System
ps12.executeUpdate();
ps1.executeUpdate();
}
}
else
{
return null;
}
} catch (SQLException e) {
e.printStackTrace();
}
return list22;
}
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
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
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;
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;
}
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
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>
class1:OCMSadminsearchdata
<html>
<body>
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
<TR><TD height=4></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">
166
Online Complaint Management System
<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>
167
Online Complaint Management System
</TBODY>
</TABLE>
<pre>
<html:link page="/OCMShome.jsp">HOME</html:link>
</pre>
</html:form>
</body>
</html>
class3:OCMScustomer
<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>
<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>
</body>
</html>
class4:OCMSdatadisplay
<html>
<body>
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
172
Online Complaint Management System
</CENTER>
<BR><HR>
<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>
173
Online Complaint Management System
<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
<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
<html:form action="deleteuser">
<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
%>
<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>
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>
<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>
</body>
</html>
class9:OCMSemployeeprofile
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="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
<html>
<body>
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
</form>
</fieldset>
</body>
</html>
184
Online Complaint Management System
--------------------------------------------------------------------
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>
</p>
<p align="left">
<b><font color="#FF0000">( Field marked * are
necessary)</font> &
nbsp;
&nbs
p; &n
bsp; </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
<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>
<div align="center">
<center>
<table border="0" width="100%" height="201">
<tr>
<td width="23%" height="25"><b><bean:message
key="inputForm.address1"/> </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"/> </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"/> </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
189
Online Complaint Management System
</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>
191
Online Complaint Management System
</form>
</fieldset>
</body>
</html>
--------------------------------------------------------------------
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>
</p>
<p align="left">
<b><font color="#FF0000">( Field marked * are
necessary)</font> &
nbsp;
&nbs
193
Online Complaint Management System
p; &n
bsp; </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>
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"/> </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"/> </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"/> </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"/> </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
198
Online Complaint Management System
<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
</b></font>
</div>
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>
200
Online Complaint Management System
<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">
</TD>
</TR>
</TBODY>
</TABLE>
<DIV align=center><BR> <BR>
</DIV>
<TABLE width="100%">
<TBODY>
<TR>
<TD height=1 width="100%">
</TD>
</TR>
</TBODY>
</TABLE>
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>
203
Online Complaint Management System
<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>
<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>
<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>
<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>
208
Online Complaint Management System
class18:OCMSnewuser
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>
</p>
<p align="left">
<b><font color="#FF0000">( Field marked * are
necessary)</font> &
nbsp;
&nbs
p; &n
bsp; </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>
<div align="center">
<center>
<table border="0" width="100%" height="201">
<tr>
<td width="23%" height="25"><b><bean:message
key="inputForm.address1"/> </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"/> </b></td>
<td width="77%" height="25"><b><html:text
property="address2"/> </b> </td>
</tr>
<tr>
212
Online Complaint Management System
213
Online Complaint Management System
</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>
<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
<html>
<body>
<header><h2>Product Details</h2></header>
216
Online Complaint Management System
</logic:iterate>
</logic:notEmpty>
</table>
<pre>
<html:link page="/OCMShome.jsp">HOME</html:link>
</pre>
</body>
</html>
class21:OCMSproductlist
217
Online Complaint Management System
<html>
<body>
<header><h2>Product Details</h2></header>
</logic:iterate>
</logic:notEmpty>
</table>
218
Online Complaint Management System
<pre>
<html:link page="/OCMShome.jsp">HOME</html:link>
</pre>
</body>
</html>
class23:OCMSproductlist1
<html>
<body>
<header><h2>Product Details</h2></header>
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">
</logic:iterate>
</logic:notEmpty>
</table>
<pre>
<html:link page="/OCMShome.jsp">HOME</html:link>
220
Online Complaint Management System
</pre>
</body>
</html>
class23:OCMSproductlistbyemployee
<html>
<body>
<header><h2>Product Details</h2></header>
221
Online Complaint Management System
</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>
<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
Class29:struta-cofig
<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">
</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">
</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">
</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">
</action>
<action
path="/updatebyid"
type="com.OCMS.actions.EditAction"
name="Empprofileform1">
230
Online Complaint Management System
</action>
<action
path="/editbycustomerid"
type="com.OCMS.actions.EmployeeProfileAction"
name="Empprofileform">
</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
<!--
This is a blank Tiles definition file with a commented example.
-->
<tiles-definitions>
<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>
232
Online Complaint Management System
<definition name="${YOUR_DEFINITION_HERE}">
</definition>
</tiles-definitions>
class31:validation
<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
<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>
-->
<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
<!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>
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>
<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 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
262
Online Complaint Management System
263
Online Complaint Management System
264
Online Complaint Management System
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.
265
Online Complaint Management System
266
Online Complaint Management System
Equivalence Partitioning
267
Online Complaint Management System
268
Online Complaint Management System
Unit Testing:
It is based on the test plan foe various screens and their outputs.
System Testing:
It is based on the system test plan for concurrency and performance issues.
269
Online Complaint Management System
270
Online Complaint Management System
Implementation
271
Online Complaint Management System
272
Online Complaint Management System
Module name:
Program name:
Program description:
Author:
Date of Creation:
Modified Date:
Modified By:
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
275
Online Complaint Management System
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
278
Online Complaint Management System
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
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
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 :-
289
Online Complaint Management System
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.
290
Online Complaint Management System
291
Online Complaint Management System
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
WEBSITES:
293