C CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CCC CCC CCCCCCC C
C CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC CCC CCC CCCCCCC C
PROJECT REPORT ON
Submitted in the partial fulfilment for award of degree of Bachelor of Technology (Computer Science and Engineering) Submitted by:
ACKNOWL DG M NT
coul have been a better plat orm than this for me to express
my deep routed feelings for those who patronized the cause of our Project On ONLIN MU IC WORLD and paved our way to comprehend the facts in a better perspective. In consummation of any task is not only the reward to the person actively involved in the accompl ishing but also to those who inspire and guide. We are highly indebted to Mr. Sameer Srivastava, Professor and Head of Department of Computer Science & Engineering for his invaluable support. We would like to give our heartfel t thanks to Mr. Abhay Kumar Agarwal, Project Guide and Dr. A.K.Malviya, Project In-Charge, who very sincerely extended their help and provided resourceful inputs without which the work would never have been realized. The rigorous task of documentation is the outcome of skilled guidance and fruitful suggestions of mentioned above. the myriad of the persons
SYNOPSIS
INTRODUCTION: Online Transaction are playing an important role in the present world of computers. People are busy with their challenging professions . Time has become so precious that Quotation TIME IS MONEY is really playing an important role in every walk-of-life. things which are done manually takes a lot of time to complete a task . Shopping has long been considered a recreational activity by many. The goal of this application are: To develop a web based interface for online retailers. The system would be easy to use and hence make the shopping experience pleasant for the customers. The application will enable the visitor to register to Online music world by just giving few simple details and select a login id and password to access the online music world. To develop an easy to use web based interface where users can search for products, view a description of the products and order the products. The search engine would list a set of products based on the name of the product, name of the director, cast, year in which it is released and user can further filter the details and select a list of items. Drag and Drop feature which would allow the users to add a product to cart and remove a product from the shopping cart by dragging the product in to the shopping cart or out of the shopping cart. The user can come out of the Online Music World by logging out.
The application will have a administrator page which will perform several activities like creating stock for the products giving its details, delete a user, check the orders given by registered user, check the financial status of user and deliver the order given by user.
The development life cycle of a project usually involves two stages: Project initiation Project execution In the project initiation stage, the development team prepares the project plans and finalizes the outcome of each phase. In this stage, the team also prepares a comprehensive list of tasks involved in each phase, and the project manager assigns responsibilities to the team members, depending on their skills. In the project execution stage, the team develops the product. In the case of the music application development team, they will develop the online music application.
Enable a visitor to register with the application after validation has been performed on the data provided by the user Enable visitors to perform activities such as search for song items based on name of the song, cast, director and year in which it is released. Enable a registered user to select items for purchase. Enable registered users to select song items and place them in a shopping cart and can also remove the items from the shopping cart. Enable administrators to maintain user details and manage music items in the inventory.
SYSTEM REQUIREMENTS
TOOLS USED: Net Beans 6.5 My SQL Apache Tomcat Server(6.0.18)
CONCEPTS:
Java Server Pages (JSP) JDBC HTML Cascaded Style Sheet (CSS) Struts Java J2EE
HARDWARE: The screen resolution of the client must be a minimum of 800x600 for
proper viewing of site.
PROBLEM DEFINITION
The basic problems with the existing systems are: The non-interactive environment these systems provide to the users. The use of traditional user interfaces which make continuous post backs to the Server each post back makes a call to the server, gets the response and then refreshes the entire web form to display the result. This scenario adds an extra trade off causing a delay in displaying the results A search engine that would display the results without allowing the users to further filter the results based on various parameters. Use of traditional and non user friendly interfaces that are hard to use.
a. Purpose: The purpose of this project is to develop a online music store where a user can search songs based on various criteria and can order the item. The people are very busy in their life schedule so this system provides easy access for buying of CD, DVD.
b. Scope: The product is named as Online Music World . A portal to buy music CD, DVD. The user can register on online music store if he/she is not is
not yet registered on it.
The registered user will get a login id and password to access the online music world. The user can search a song based on various criteria and add it to a cart. The user can remove the selected items from the cart. The user can finally order the items c. Definitions Acronym and Abbreviations:
e. Technologies Used: HTML Java Server Pages J2EE CSS Java Struts
f. Tools Used:
g. Overview: The SRS consist of two sections namely overall description and specific Requirements. Overall description: This
will be
describing system
components and interconnections. Specific Requirements: This will describe roles and functions of actors.
2. OVERALL DESCRIPTION:
This application is going to give an online platform to the users to buy music products. Only authorized users can login access the online music world. into the portal and
a. Product Perspective: The application will be developed on the windows vista platform using the specified technologies.
i.
iii. Software Interfaces: Server Side: Windows Vista My SQL Database Server Client Side: Operating system (Windows Vista) Java enabled web browser. iv. Communication Interface: HTTP is used. v. Memory Constraint: At least 5 GB free space on the hard disk. RAM must be a minimum of 2 GB.
vi. Operations: The operations are divided in fields like admin, user.
b. Product Functions: User registration: The user will be registered . Login : The user can login to the site for viewing the details.
Add to Cart: The user can search the items & add to cart.
Remove from Cart: The user can remove the items from cart.
Place the order: The user can finally order the items .
i) The users that are going to use this application are as follows: Tech savvy people, those who are interested in
Accomplishing their work online to save time
ii) The expectations form the user who uses the application are:
3. SPECIFIC REQUIREMENTS:
a. Functions:
Enable a visitor to register with the application after validation has been performed on the data provided by the user Enable visitors to perform activities such as search for song items based on name of the song, cast, director and year in which it is released. Enable a registered user to select items for purchase. Enable registered users to select song items and place them in a shopping cart and can also remove the items from the shopping cart. Enable administrators to maintain user details and manage music items in the inventory.
Year Price
Visitor
By Year
Contains
By Name
Register
By Cast Search
Login id
Basic
Occupation
Administrator
Delete a stock id
Finance
Name Stock
Quantity
Login id
User
Password
Status
Content
Price
The Motive of this Online Shopping Web Application are: To allow the user to play with the search tool and create different combinatorial search criterion to perform exhaustive search. Provide Interactive interface through which a user can interact with different areas of application easily. The search engine would list a set of products based on the search term and the user can further filter the list based on various parameters. Provide Drag and Drop feature thereby allowing the user to add products to or remove products from the shopping cart by dragging the products in to or out of the shopping cart.
System Feasibility:
The system feasibility can be divided into the following sections:
Economic Feasibility
The project is economically feasible as the only cost involved is having a Computer with the minimum requirements mentioned earlier. For the users to access the application, the only cost involved will be in getting access to the Internet.
Technical Feasibility
To deploy the application, the only technical aspects needed are mentioned below: Operating Environment : Windows Vista Platform : Net Beans 6.5 Database : My SQL
For Users:
Internet Browser Internet Connection
Behavioural Feasibility
The application requires no special technical guidance and all the views available In the application are self explanatory. The users are well guided with warning and failure messages for all the actions taken.
DEVELOPMENT SCHEDULE
The analysis of the project is done based on user requirements. The synopsis of this Project is prepared by us in the 7th semester and approved by our project guide.
JAN
FEB
MAR
APR
MAY
SYSTEM REQUIREMENTS
TOOLS USED: Net Beans 6.5 My SQL Apache Tomcat Server(6.0.18)
CONCEPTS:
Java Server Pages (JSP) JDBC HTML Cascaded Style Sheet (CSS) Struts Java J2EE
HARDWARE: The screen resolution of the client must be a minimum of 800x600 for
proper viewing of site.
Update a Stock
Administrator
Manage Catalog
Browse Catalog
Register
Manage Account
Login
Logout
Place order
Cancel Order
Fi l Name
Size
Descri i
45 45 45 45
Fiel Name
Size
Descri i
Login id F name M name L name Basic E mail Dob Street City Pin code State Country Job/occupation
Varchar Varchar Varchar Varchar Integer Varchar Varchar Varchar Varchar Integer Varchar Varchar Varchar
45 45 45 45 20 45 45 45 45 20 45 45 45
Id of user First name Middle name Last name Basic phone no. Email address Date of birth Street name City name Pincode of city State name Country name Job of user
Fiel s
Size
Descri i
Login id Balance
Varchar Integer
45 20
Fiel s
Size
Descri i
Stock Id
Integer
20
Varchar Varchar
45 45
45 45 45 20 20
Integer
20
Price of item
Fiel s
Size
Descri i
Order id
Integer
20
Unique order
id
of
Login id Stock id
Varchar Varchar
45 45
Quantity
Integer
20
45 20 45
FLOWCHART
Start
Welcome screen
Is a customer or a Administrator
Administrartor C2
Customer
Registration form
Submit
C1
Se c by c s , ye , direc r ,price
Se rc by c s , ye r, direc r ,price
Add to cart
C2
Stock Form
If operation is add
If deletio n
If option deletio n
end
Administrator
Sales
stock information
Online Music World Personal details Purchase order Stock details Customer registered Visitor
Level 1:
Stock file
Customer
Add to cart
Order file
Stock file
User detail
SCREENSHOTS
Main Form:
Registration form
Cart Page:
Order Page:
ADMIN ACCOUNT
The above picture is the home page of administrator. We have given four options namely: stock, finance, check order and manage user account. An option for logout is also given which will redirect it to the login page.
When the admin click on the option stock, this page will be displayed. Here we have given all the stock information. An options for add , delete and update the options of stock is given. User can enter the desired field of the new stock. For delete option, stock id should be entered, and for update, we have to click on the link.
After the stock id for deletion is entered, the respective stock is deleted.
After clicking on the link for update, this page will be displayed. We have to enter the stock id, the respective field to be updated and the new value.
After clicking on submit button on previous page, this page will be displayed where the new stock table is displayed after update.
On clicking to FINANCE option on admin home page, this page will be redirected. This displays the user account details consisting of login id and balance.
On clicking to the link CHECK ORDERS, all the information related to placed orders will be displayed.
On clicking to the SERVICE ORDERS link, the user having pending status request will be set delivered.
On clicking to the MANAGE USER ACCOUNT, this page will be displayed which consists of user information table. The admin can also delete the user if he wants also the orders can also be serviced.
CODING
ADMIN.JSP
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>Untitled Document</title> <style type="text/css"> <!-a: { color="#330066" } .style1 { font-family: "Verdana"; font-size: 36px; color: #000000; } style4 {font-family: "COMIc Sans MS"; font-size: 16px; } .style7 {font-family: Geneva, Arial, Helvetica, sans -serif; font-weight: bold; font-size: 24px;} .style9 { font-family: "GEORGIA"; font-size: 18px; } .style10 { font-family: "Times New Roman"; font-size: 24px; } .style13 {font-size: 24px; font-family: Geneva, Arial, Helvetica, sans-serif;}
--> </style> </head> <body bgcolor="#9933cc" cellpadding="0" cellspacing="0"> <table width="100%"> <tr> <td height="150" background="header.jpg"><p align="center" class="style1">WELCOME TO </p> <p align="center" class="style1"><marquee behavior="alternate">ONLINE MUSIC WORLD......</marquee></p></td> </tr> <tr> <td height="141" colspan="3" bgcolor="#9933cc"> <marquee direction="right" behavior="alternate" bgcolor="black"> <img src="jashnn.jpg" width="153" height="153" /> <img src="letsdance.jpg" width="153" height="153" /> <img src="newyork.jpg" width="154" height="156" /> <img src="payingguests.jpg" width="149" height="151" /> <img src="runway.jpg" width="149" height="151" /> <img src="kambakkhtishq.jpg" width="150" height="149" /> <img src="shortkut.jpg" width="149" height="148" /></marquee> </tr> </table> <font size="6" color="pink" face="Comic Sans ms "><center>Welcome Administrator</center></font> <center> <table width="270" cellpadding="10" cellspacing="2" border="1" > <tr> <td> <center> <a href="Stock.jsp"><font class="style9" color="#330066">STOCK</font></a> </center>
</td> </tr> <tr> <td> <center> <a href="Finance.jsp"><font class="style9" color="#330066">FINANCE</font></a> </center> </td> </tr> <tr> <td> <center> <a href="CheckOrders.jsp"><font class="style9" color="#330066">CHECK ORDER</font></a> </center> </td> </tr> <tr> <td> <center> <a href="ManageUser.jsp"><font class="style9" color="#330066">MANAGE USER ACCOUNT</font></a> </center> </td> </tr> </table> </center> </body> </html>
ADDSTOCK..JSP
<%@ taglib uri="http://java.sun.com/jsp/jstl/sql" prefix="sql"%> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset= utf-8"/> <title>Untitled Document</title> <style type="text/css"> <!-.style1 { font-family: "Verdana"; font-size: 36px; color: #000000; } .style4 { font-family: "COMIc Sans MS"; font-size: 18px; } .style7 {font-family: Geneva, Arial, Helvetica, sans -serif; font-weight: bold; font-size: 24px;} .style9 { font-family: "georgia"; font-size: 16px; } .style10 { font-family: "Georgia"; font-size: 24px; } .style13 {font-size: 24px; font-family: Geneva, Arial, Helvetica, sans-serif;} --> </style> </head> <body bgcolor="#9933cc" cellpadding="0" cellspacing="0"> <table width="100%"> <tr>
<td height="150" background="header.jpg"><p align="center" class="style1">WELCOME TO </p> <p align="center" class="style1"><marquee behavior="alternate">ONLINE MUSIC WORLD......</marquee></p></td> </tr> </table> <br><br> <sql:setDataSource driver="com.mysql.jdbc.Driver" url="jdbc:mysql://localhost:3306/oes" user="root" password="strange"/> <sql:update var="rs" sql="insert into stock_master values(?,?,?,?,?,?,?,?,?)" > <sql:param value="${param.stock_id}"/> <sql:param value="${param.name}"/> <sql:param value="${param.disk_type}"/> <sql:param value="${param.content}"/> <sql:param value="${param.cast}"/> <sql:param value="${param.director}"/> <sql:param value="${param.year}"/> <sql:param value="${param.quantity}"/> <sql:param value="${param.price_per_unit}"/> </sql:update> <jsp:forward page="Stock.jsp"/> </body> </html>
DELETESTOCK..JSP
<%@ taglib uri="http://java.sun.com/jsp/jstl/sql" prefix="sql"%> <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="core" %> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset= utf-8"/>
<title>Untitled Document</title> <style type="text/css"> <!-.style1 { font-family: "Verdana"; font-size: 36px; color: #000000; } .style4 {font-family: "COMIc Sans MS"; font-size: 16px; } .style7 {font-family: Geneva, Arial, Helvetica, sans-serif; font-weight: bold; font-size: 24px;} .style9 { font-family: "GEORGIA"; font-size: 18px; } .style10 { font-family: "Times New Roman"; font-size: 24px; } .style13 {font-size: 24px; font-family: Geneva, Arial, Helvetica, sans-serif;} --> </style> </head> <body bgcolor="#9933cc" cellpadding="0" cellspacing="0"> <table width="100%"> <tr> <td height="150" background="header.jpg"><p align="center" class="style1">WELCOME TO </p> <p align="center" class="style1"><marquee behavior="alternate">ONLINE MUSIC WORLD......</marquee></p></td> </tr> </table>
<br><br> <sql:setDataSource driver="com.mysql.jdbc.Driver" url="jdbc:mysql://localhost:3306/oes" user="root" password="strange"/> <sql:update var="rs" sql="delete from stock_master where stock_id=?;" > <sql:param value="${param.stock_id}"/>\ </sql:update> <font size=4 color=black>The new Stock is after deletion</font> <sql:query var="rs" sql="select *from stock_master"/> <core:catch var="error"> <form> <center><table border="2" cellspacing="3" cellpadding="3"> <tr><th>STOCK ID</th><th>NAME</th><th>DISK TYPE</th><TH>CONTENT</TH><TH>CAST</TH><TH>DIRECTOR</TH><TH>YEAR</TH>< TH>QUANTITY</TH><TH>PRICE PER UNIT</TH></TR <core:forEach var="r" items="${rs.rows}" > <tr><td>${r.stock_id}</td><td>${r.name}</td><td>${r.disk_type}</td><td>${r.content}</td><td>$ {r.cast}</td><td>${r.director}</td><td>${r.year}</td><td>${r.quantity}</td><td>${r.price_per_unit }</td></tr> </core:forEach> <core:out value="${error}"/> </core:catch> </table> </center></form> </body> </html>
UPADATESTOCK.JSP <%@ taglib uri="http://java.sun.com/jsp/jstl/sql" prefix="sql"%> <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="core" %> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset= utf-8"/> <title>Untitled Document</title>
<style type="text/css"> <!-.style1 { font-family: "Verdana"; font-size: 36px; color: #000000; } .style4 {font-family: "COMIc Sans MS"; font-size: 16px; } .style7 {font-family: Geneva, Arial, Helvetica, sans -serif; font-weight: bold; font-size: 24px;} .style9 { font-family: "GEORGIA"; font-size: 18px; } .style10 { font-family: "Times New Roman"; font-size: 24px; } .style13 {font-size: 24px; font-family: Geneva, Arial, Helvetica, sans-serif;}
-->
</style> </head> <body bgcolor="#9933cc" cellpadding="0" cellspacing="0"> <table width="100%"> <tr> <td height="150" background="header.jpg"><p align="center" class="style1">WELCOME TO </p> <p align="center" class="style1"><marquee behavior="alternate">ONLINE MUSIC WORLD......</marquee></p></td> </tr> </table> <br><br>
<form action="UpdateStock2.jsp"><br> <font size="5" color="blue">Enter the Stock id to be updated<br> <input type="text" name="stock_id"> <br>Enter the field to be updated</font><br> <input type="radio" name="c" value="stock_id"/>STOCK ID<br> <input type="radio" name="c" value="name"/>NAME<br> <input type="radio" name="c" value="disk_type"/>DISK TYPE<br> <input type="radio" name="c" value="content"/>CONTENT<br> <input type="radio" name="c" value="cast"/>CAST<br> <input type="radio" name="c" value="director"/>DIRECTOR<br> <input type="radio" name="c" value="year"/>YEAR<br> <input type="radio" name="c" value="quantity"/>QUANTITY<br> <input type="radio" name="c" value="price_per_unit"/>PRICE PER UNIT<br> <br><font size="5" color="blue">Enter the new value to be submitted</font><br> <input type="text" name="newvalue"/> <input type="submit" value="enter"/> </form> </body> </html>
CHECKORDER.JSP
<%@ taglib uri="http://java.sun.com/jsp/jstl/sql" prefix="sql" %> <%@ taglib uri="http://java.sun.com/jsp/jstl/core"prefix="core" %> <%@ taglib uri="/WEB-INF/struts-html.tld" prefix="h"%> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset= utf-8"/> <title>Untitled Document</title> <style type="text/css">
<!-.style1 { font-family: "Verdana"; font-size: 36px; color: #000000; } .style4 { font-family: "COMIc Sans MS"; font-size: 18px; } .style7 {font-family: Geneva, Arial, Helvetica, sans -serif; font-weight: bold; font-size: 24px;} .style9 { font-family: "georgia"; font-size: 16px;} .style10 { font-family: "Georgia"; font-size: 24px; } .style13 {font-size: 24px; font-family: Geneva, Arial, Helvetica, sans-serif;} --> </style> </head> <body bgcolor="#9933cc" cellpadding="0" cellspacing="0"> <table width="100%"> <tr> <td height="150" background="header.jpg"><p align="center" class="style1">WELCOME TO </p> <p align="center" class="style1"><marquee behavior="alternate">ONLINE MUSIC WORLD......</marquee></p></td> </tr> </table> <BR>
<sql:setDataSource driver="com.mysql.jdbc.Driver" url="jdbc:mysql://localhost:3306/oes" user="root" password="strange"/> <sql:query var="rs" sql="select *from order_master"/> <center> <H1>PLACED ORDERS</H1> <table border="2" cellspacing="3" cellpadding="3">
<tr><th>LOGIN_ID</th><th>STOCK_ID</th><TH>QUANTITY</TH><TH>STATUS</TH><TH >PRICE</TH><TH>NAME</TH></TR> <core:forEach var="r" items="${rs.rows}" > <tr><td>${r.login_id}</td><td>${r.stock_id}</td><td>${r.quantity}</td><td>${r.status}</td><td>$ {r.price}</td><td>${r.name}</td></tr> </table><BR><BR><BR> <a href="ServiceOrders.jsp"><FONT SIZE="4" COLOR="BLACK">SERVICE ORDERS</font></a> </center> </BODY> </html>
FINANACE.JSP <%@ taglib uri="http://java.sun.com/jsp/jstl/sql" prefix="sql" %> <%@ taglib uri="http://java.sun.com/jsp/jstl/core"prefix="core" %> <%@ taglib uri="/WEB-INF/struts-html.tld" prefix="h"%>
<html> <head> <meta http-equiv="Content-Type" content="text/html; charset= utf-8"/> <title>Untitled Document</title> <style type="text/css"> <!-.style1 { font-family: "Verdana";
font-size: 36px; color: #000000; } .style4 { font-family: "COMIc Sans MS"; font-size: 18px; } .style7 {font-family: Geneva, Arial, Helvetica, sans -serif; font-weight: bold; font-size: 24px;} .style9 { font-family: "georgia"; font-size: 16px; } .style10 { font-family: "Georgia"; font-size: 24px; } .style13 {font-size: 24px; font-family: Geneva, Arial, Helvetica, sans-serif;} --> </style> </head> <body bgcolor="#9933cc" cellpadding="0" cellspacing="0"> <table width="100%"> <tr> <td height="150" background="header.jpg"><p align="center" class="style1">WELCOME TO </p> <p align="center" class="style1"><marquee behavior="alternate">ONLINE MUSIC WORLD......</marquee></p></td> </tr> </table> <BR><BR><BR>
<sql:query var="rs" sql="select * from user_acc_detail"/> <core:catch var="error"> <center><h1>USER ACCOUNT DETAILS</h1> <table border="2" cellspacing="3" cellpadding="3"> <tr><th>LOGIN_ID</th><th>BALANCE</th></TR> <core:forEach var="r" items="${rs.rows}" > <tr><td>${r.login_id}</td><td>${r.balance}</td></tr> <core:if test="${r.balance eq \"0\"}"> <sql:update var="r2" sql="update login_master set status='deactive' where login_id='${r.login_id} ' " ><font color="blue">${r.login_id}'s status changed </sql:update> </core:if> </core:forEach> <core:out value="${error}"/> </table> <br><font size="5" color="black">USERS STATUS SET DEACTIVE OF ZERO BALANCE</font> </center> </body> </html>
MANAGEUSERACCOUNT.JSP <%@ taglib uri="http://java.sun.com/jsp/jstl/sql" prefix="sql" %> <%@ taglib uri="http://java.sun.com/jsp/jstl/core"prefix="core" %> <%@ taglib uri="/WEB-INF/struts-html.tld" prefix="h"%> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset= utf-8"/> <title>Untitled Document</title> <style type="text/css"> <!--
.style1 { font-family: "Verdana"; font-size: 36px; color: #000000; } .style4 { font-family: "COMIc Sans MS"; font-size: 18px; } .style7 {font-family: Geneva, Arial, Helvetica, sans -serif; font-weight: bold; font-size: 24px;} .style9 { font-family: "georgia"; font-size: 16px; } .style10 { font-family: "Georgia"; font-size: 24px; } .style13 {font-size: 24px; font-family: Geneva, Arial, Helvetica, sans-serif;} </head> <body bgcolor="#9933cc" cellpadding="0" cellspacing="0"> <table width="100%"> <tr> <td height="150" background="header.jpg"><p align="center" class="style1">WELCOME TO </p> <p align="center" class="style1"><marquee behavior="alternate">ONLINE MUSIC WORLD......</marquee></p></td> </tr> </table> <BR> <sql:setDataSource driver="com.mysql.jdbc.Driver" url="jdbc:mysql://localhost:3306/oes" user="root" password="strange"/> <sql:query var="rs" sql="select *from order_master"/>
<tr><td>${r.order_id}</td><td>${r.login_id}</td><td>${r.stock_id}</td><td>${r.quantity}</td><td >${r.status}</td><td>${r.name}</td><td>${r.price}</td></tr> </core:forEach></table> <form action="DelUser.jsp"> <br><font size="5" color="blue">enter the login id to be deleted<br></font> <input type="text" name="login_id"/> <input type="submit" value="delete"/> </FORM> <BR><BR><BR> <a href="ServiceOrders.jsp"><FONT SIZE="4" COLOR="#330066">SERVICE ORDERS</font></a> </center> </BODY> </html>
DELETEUSER.JSP
<%@ taglib uri="http://java.sun.com/jsp/jstl/sql" prefix="sql"%> <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="core" %> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset= utf-8"/> <title>Untitled Document</title>
<style type="text/css"> <!-.style1 { font-family: "Verdana"; font-size: 36px; color: #000000; } .style4 { font-family: "COMIc Sans MS"; font-size: 18px; } .style7 {font-family: Geneva, Arial, Helvetica, sans -serif; font-weight: bold; font-size: 24px;} .style9 { font-family: "georgia"; font-size: 16px; } .style10 { font-family: "Georgia"; font-size: 24px; } .style13 {font-size: 24px; font-family: Geneva, Arial, Helvetica, sans-serif;} --> </style> </head> <body bgcolor="#9933cc" cellpadding="0" cellspacing="0"> <table width="100%"> <tr> <td height="150" background="header.jpg"><p align="center" class="style1">WELCOME TO </p> <p align="center" class="style1"><marquee behavior="alternate">ONLINE MUSIC WORLD......</marquee></p></td> </tr> </table>
<br><br> <sql:setDataSource driver="com.mysql.jdbc.Driver" url="jdbc:mysql://localhost:3306/oes" user="root" password="strange"/> <sql:update var="rs" sql="delete from login_master where login_id=?;" > <sql:param value="${param.login_id}"/> <sql:update var="rs" sql="delete from order_master where login_id=?;" > <sql:param value="${param.login_id}"/> <sql:update var="rs" sql="delete from member_detail where login_id=?;" > <sql:param value="${param.login_id}"/> <sql:update var="rs" sql="delete from user_acc_detail where login_id=?;" > <sql:param value="${param.login_id}"/> </sql:update> </sql:update> </sql:update> </sql:update> <font size=4 color="black">The user is deleted.</font> <sql:query var="rs" sql="select *from login_master"/> <core:catch var="error"> <form> <center><table border="2" cellspacing="3">
LOGINPAGE.JSP <%@ taglib uri="/WEB-INF/struts-html.tld" prefix="h" %> <head> <meta http-equiv="Content-Type" content="text/html; charset= utf-8"/> <title>Untitled Document</title> <style type="text/css"> <!-.style1 { font-family: "Verdana"; font-size: 36px; color: #000000; } .style4 {font-family: "COMIc Sans MS"; font-size: 16px; } .style7 {font-family: Geneva, Arial, Helvetica, sans -serif; font-weight: bold; font-size: 24px;} .style9 { font-family: "GEORGIA"; font-size: 18px; } .style10 { font-family: "Times New Roman"; font-size: 24px;} .style13 {font-size: 24px; font-family: Geneva, Arial, Helvetica, sans-serif;} --> </style> </head> <body bgcolor="#9933cc" cellpadding="0" cellspacing="0"> <table width="100%"> <tr> <td height="150" background="header.jpg"><p align="center" class="style1">WELCOME TO </p>
<p align="center" class="style1"><marquee behavior="alternate">ONLINE MUSIC WORLD......</marquee></p></td> </tr> <tr> <td height="141" colspan="3" bgcolor="#9933cc"> <marquee direction="right" behavior="alternate" bgcolor="black"> <img src="jashnn.jpg" width="153" height="153" /> <img src="letsdance.jpg" width="153" height="153" /> <img src="newyork.jpg" width="154" height="156" /> <img src="payingguests.jpg" width="149" height="151" /> <img src="runway.jpg" width="149" height="151" /> <img src="kambakkhtishq.jpg" width="150" height="149" /> <img src="shortkut.jpg" width="149" height="148" /> </marquee> </td> </tr> </table> <br><br> <center> <table cellpadding="2" border="1"> <tr> <td width="150" height="35" bgcolor="#9933cc"><div align="center" class="style4">LOGIN</div></td> <td width="150" bgcolor="#9933cc"><input type="text" name="textfield" /></td> </tr> <tr> <td bgcolor="#9933cc"><div align="center" class="style4">PASSWORD</div></td> <td height="35" bgcolor="#9933cc"><input type="text" name="textfield2" /></td> </tr> <tr> <td height="35" colspan="2" bgcolor="#9933cc">
<div align="center"> <input name="Submit" type="submit" class="style4" id="Submit" value="Submit" /> </div></td> </tr> <tr> <td height="35" colspan="2" bgcolor="#9933cc" class="style4"><div align="center"><u>NOT A USER YET? </u></div></td> </tr> <tr> <td height="35" colspan="2" bgcolor="#9933cc"><label for="label"></label> <div align="center"> <a href="Registeration.jsp"><font class="style4" color="#990066">Click Here To Register</a> </div></td> </tr> </table> </center>
REGISTRATION.JSP
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="h" %> <head> <meta http-equiv="Content-Type" content="text/html; charset= utf-8"/> <title>Untitled Document</title> <style type="text/css"> <!-.style1 { font-family: "Verdana"; font-size: 36px; color: #000000; }
.style4 { font-family: "COMIc Sans MS"; font-size: 18px; } .style7 {font-family: Geneva, Arial, Helvetica, sans -serif; font-weight: bold; font-size: 24px;} .style9 { font-family: "georgia"; font-size: 16px; } } .style13 {font-size: 24px; font-family: Geneva, Arial, Helvetica, sans-serif;} --> </style> </head>
<body bgcolor="#9933cc" cellpadding="0" cellspacing="0"> <table width="100%"> <tr> <td height="150" .style10 { font-family: "Georgia"; font-size: 24px;background="header.jpg"><p align="center" class="style1">WELCOME TO </p> <p align="center" class="style1"><marquee behavior="alternate">ONLINE MUSIC WORLD......</marquee></p></td> </tr> </table> <center> <font class="style10" color="#330066"> REGISTERATION FORM<br> </font> <center> <a href= welcomeStruts.jsp><font class="style4" color="blue">Click here to login</font></a
<br> <font class="style9" color="blue">${requestScope.q} <br> </font> </center> <font class="style4" color="#330066">Hello ......... <br>Just answer a few simple question, select an id and a password and you will get registered on online music world. <br> <br> </font> </center> <center> <table> <h:form action="/Register"> <tr><td><font class="style9"color="#330066">*First Name:</font></td><td> <h:text property="fname"/><h:errors property="fname"/></td></tr> <tr><td><font class="style9"color="#330066"> Middle name:</font> </td><td><h:text property="mname"/></td></tr> <tr><td><font class="style9"color="#330066">*Last Name: </font></td><td><h:text property="lname"/><h:errors property="lname"/></td></tr> <tr><td><font class="style9"color="#330066">*Login ID: </font></td><td><h:text property="id"/><h:errors property="id"/></td></tr> <tr><td><font class="style9"color="#330066"> Basic:</font> </td><td><h:text property="basic"/></td></tr> <tr><td><font class="style9"color="#330066">*Occupation: </font></td><td><h:text property="occupation"/><h:errors property="occupation"/></td></tr> <tr><td><font class="style9"color="#330066">*Email: </font></td><td><h:text property="email"/><font color="#330066"> "[email protected]"</font>^<h:errors property="email"/></td></tr>
<tr><td><font class="style9"color="#330066">*Password: </font></td><td><h:password property="password"/></td></tr> <tr><td><font class="style9"color="#330066">*Confirm Password:</font> </td><td><h:password property="confirm"/><h:errors property="same"/></td></tr>
<tr><td><font class="style9"color="#330066">*Date Of Birth: </font></td><td><h:text property="dob" /> <font color="#330066">"dd-mm-yy"</font></td></tr> <tr><td><font class="style9"color="#330066">*Street: </font></td><td><h:text property="street"/><h:errors property="street"/></td></tr> <tr><td><font class="style9"color="#330066">*City: </font></td><td><h:text property="city"/><h:errors property="city"/></td></tr> <tr><td><font class="style9"color="#330066">*State: </font></td><td><h:text property="state"/><h:errors property="state"/></td></tr> <tr><td><font class="style9"color="#330066"> Pincode: </font></td><td><h:text property="pincode"/></td></tr> <tr><td><font class="style9"color="#330066">*Country: </font></td><td><h:text property="country"/><h:errors property="country"/></td></tr> </table> <font class="style9" color="#330066">The Fields with * are necessary to be filled</font> <br> <h:submit /> </center> </h:form>
CART.JSP <%@ page import="java.sql.*,utility.*" %> <%@ taglib uri="http://jakarta.apache.org/struts/tags-bean" prefix="bean" %> <%@ taglib uri="http://jakarta.apache.org/struts/tags-html" prefix="h" %> <%@ taglib uri="http://jakarta.apache.org/struts/tags-logic" prefix="logic" %> <%@ taglib uri="http://java.sun.com/jsp/jstl/sql" prefix="s" %> <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> <h:html locale="true"> <head> <meta http-equiv="Content-Type" content="text/html; charset= utf-8"/> <title>Untitled Document</title> <style type="text/css"> <!-.style1 {
font-family: "Verdana"; font-size: 36px; color: black; } .style4 {font-family: "COMIc Sans MS"; font-size: 16px; } .style7 {font-family: Geneva, Arial, Helvetica, sans -serif; font-weight: bold; font-size: 24px;} .style9 { font-family: "GEORGIA"; font-size: 18px;} .style10 { font-family: "Times New Roman"; font-size: 24px; } .style13 {font-size: 24px; font-family: Geneva, Arial, Helvetica, sans-serif;} --> </style> </head> <body bgcolor="#9933cc" cellpadding="0" cellspacing="0"> <table width="100%"> <tr> <td height="150" background="header.jpg"><p align="center" class="style1">WELCOME TO </p> <p align="center" class="style1"><marquee behavior="alternate">ONLINE MUSIC WORLD......</marquee></p></td> </tr> <tr> <td height="141" colspan="3" bgcolor="#9933cc"> <marquee direction="right" behavior="alternate" bgcolor="black"> <img src="jashnn.jpg" width="153" height="153" /> <img src="letsdance.jpg" width="153" height="153" /> <img src="newyork.jpg" width="154" height="156" />
<img src="payingguests.jpg" width="149" height="151" /> <img src="runway.jpg" width="149" height="151" /> <img src="kambakkhtishq.jpg" width="150" height="149" /> <img src="shortkut.jpg" width="149" height="148" /></marquee> <!--<img src="../Desktop/runway.jpg" width="149" height="151"/></td>--> </tr> </table> <font size="6" color="pink" face="Comic Sans ms "><center>${sessionScope.loginid}'s Cart Contains</center></font> <center> <table cellpadding="20"> <center> <tr> <td><h:link action="/signout"> <font class="style9" color="blue">Logout</font> </h:link></td> <td><h:link action="/order"> <font class="style9" color="blue">Place Order</font> </h:link></td> <td><h:link action="/cancel"> <font class="style9" color="blue">Cancel Order </font> </h:link></td> </tr> </center> </table> </center> <br> <% int count=0; int bal=0;
int quant=0; int j=0; String id=(String)session.getAttribute("loginid"); String query = "select * from order_master where status='Pending' and login_id='"+id+"'"; ResultSet rs1= ConnectionService.select(query); while(rs1.next()) { count++; } String name[]= new String[count]; int price[]=new int[count]; String order[]=new String[count]; int sum=0; String query1 = "select * from order_master where status='Pending' and login_id='"+id+"'"; ResultSet rs= ConnectionService.select(query1); while(rs.next()) { price[j]=rs.getInt(6); name[j]=rs.getString(7); order[j]=rs.getString(1); sum+=price[j]; String query2="select * from stock_master where name='"+name[j]+"'"; ResultSet resa=ConnectionService.select(query2); while(resa.next()) { quant=resa.getInt(8)-1; } String query3="update stock_master where name='"+name[j]+"'"; int rsa=ConnectionService.update(query3); j++; }
String query4="select *from user_acc_detail where login_id='"+id+"'"; ResultSet red=ConnectionService.select(query4); while(red.next()) { bal=red.getInt(2); } int newbal=0; newbal=bal-sum; String query5="update user_acc_detail set balance='"+newbal+"' where login_id='"+id+"'"; int ress=ConnectionService.update(query5); %> <center> <table cellpadding="3" cellspacing="3" border="2"> <tr> <th> </th> <th> <font class="style9" color="#330066">ORDER ID</font> </th> <th> <font class="style9" color="#330066">NAME</font> </th> <th> <font class="style9" color="#330066">PRICE</font> </th> </tr> <h:form action="/remove"> <% for(int i=0;i<name.length;i++) { %>
<td><font class="style9" color="#330066"> <%=name[i]%> </font></td> <td><font class="style9" color="#330066"> <%=price[i]%> </font></td> <% } %> <center><h:submit value="Remove from cart"/></center> </h:form> </table> </center> <br> <br> <center> <font class="style9" color="blue"> Total Bill :Rs <%=sum%> </font> </center> <%session.setAttribute("bill",sum);%>
</h:html>
REGISTRATIONACTION.JAV A package pack; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import utility.*; import org.apache.struts.action.Action; import org.apache.struts.action.ActionForm; import org.apache.struts.action.ActionMapping; import org.apache.struts.action.ActionForward; public class RegisterAction extends Action {
public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { RegisterBean rb = (RegisterBean)form; String fname=rb.getFname(); String mname=rb.getMname(); String lname=rb.getLname(); String id=rb.getId(); int basic=rb.getBasic(); String occupation=rb.getOccupation(); String email=rb.getEmail(); String password=rb.getPassword(); String confirm=rb.getConfirm(); String dob=rb.getDob(); String street=rb.getStreet(); String city=rb.getCity(); String state=rb.getState();
int pincode=rb.getPincode(); String country=rb.getCountry(); String query1 = "insert into member_detail (login_id,f_name,m_name,l_name,basic,e_mail,dob,street,city,pincode,state,country,job/ccupation) values('"+id+"','"+fname+"','"+mname+"','"+lname+"','"+basic+"','"+email+"','"+dob+"','"+street+"','"+ city+"','"+pincode+"','"+state+"','"+country+"','"+occupation+"')"; String query2= "insert into login_master(login_id,password,role,status) values('"+id+"','"+password+"','user','activated')"; String query3= "insert into user_acc_detail(login_id,balance) values ('"+id+"',5000)"; int rs1 = ConnectionService.update(query1); int rs2 = ConnectionService.update(query2); int rs3 = ConnectionService.update(query3); if(rs1>0) { request.setAttribute(" ","Account created"); } else { request.setAttribute("q","Not Signed up"} return mapping.getInputForward()} }
LOGINACTION.JAVA
Logipackage pack; import javax.servlet.http.*; import org.apache.struts.action.Action; import org.apache.struts.action.ActionForm; import org.apache.struts.action.ActionMapping; import org.apache.struts.action.ActionForward; import java.sql.*; import utility.*; public class LoginAction extends Action {
public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { LoginBean lb = (LoginBean)form; String id = lb.getLoginid(); String pass = lb.getPassword(); String query = "select *from login_master where login_id='"+id+"' and password='"+pass+"';"; ResultSet rs = ConnectionService.select(query); if(rs.next()) { HttpSession session = request.getSession(); session.setAttribute("loginid",id) if(rs.getString(3).equals("admin")) return mapping.findForward("admin"); else return mapping.findForward("user"); } else { request.setAttribute("q","INVALID USER..try again"); } return mapping.getInputForward(); } }
CARTACTION.JAVA package pack; import java.sql.ResultSet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpSession;
import org.apache.struts.action.Action; import org.apache.struts.action.ActionForm; import org.apache.struts.action.ActionMapping; import org.apache.struts.action.ActionForward; import utility.ConnectionService; public class CartAction extends Action { public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { HttpSession session = request.getSession(false); if(session.getAttribute("loginid")!=null) { CartBean cb = (CartBean)form; String choice = cb.getChoice(); String name= new String(); String cast= new String(); String director= new String(); String year= new String(); int price = 0; String loginid =(String)session.getAttribute("loginid"); int stockid = 0; String query = "select * from stock_master where name='"+choice+"'"; request.setAttribute("query",query); ResultSet rs= ConnectionService.select(query); if(rs.next()) { stockid=rs.getInt(1); name=rs.getString(2); cast=rs.getString(5); director=rs.getString(6);
year=rs.getString(7); price=rs.getInt(9); } String query1="insert into order_master (login_id,stock_id,quantity,status,price,name) values ('"+loginid+"','"+stockid+"',1,'Pending','"+price+"','"+name+"')"; int num=ConnectionService.update(query1); request.setAttribute("q",loginid); } return mapping.findForward("home");} }
REMOVEACTION.JAVA package pack; import utility.*; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpSession; import java.sql.*; import org.apache.struts.action.Action; import org.apache.struts.action.ActionForm; import org.apache.struts.action.ActionMapping; import org.apache.struts.action.ActionForward; public class RemoveAction extends Action { public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { HttpSession session = request.getSession(false); RemoveBean rb=(RemoveBean)form; String name=rb.getChoice(); int order=Integer.parseInt(name);
request.setAttribute("o",name); String query = "delete from order_master where order_id ='"+order+"'"; request.setAttribute("que",query); int rs= ConnectionService.update(query) if(rs>0) {request.setAttribute("a","deleted"); } else { request.setAttribute("a","not deleted"); } return mapping.getInputForward(); } }
TEST CASES
The test cases have been generated from an examination of pre/post condition describing the expected behaviour of operation and the concept of equivalence sets. The precondition states that the operation work correctly for any registration, be it empty or not. The post condition indicates what is a valid value to return. For this reference either a object or null value is valid return value. We can identify the normal, boundary and illegal test cases for the equivalence sets Normal > 1 user Boundary > 0 or 1 user Illegal
FUTURE SCOPE
The current system can be extended to allow the users to listen the music on Online Music World. The users could subscribe for price alerts which would enable them to receive messages when price for products fall below a particular level. The current system is confined only to the shopping cart process. It can be extended to have a easy downloading of the music from Online music world. The current system can be elaborated and a user can vote for a song and view the highest voted songs.
BIBLIOGRAPHY
Books: The Complete Reference JSP 2.0(Phil Hanna) Instant Java Server Pages (Paul Tremblett) Struts In Action (David Winterfeldt )