Mini Project Report on Online Shopping s
Mini Project Report on Online Shopping s
INTRODUCTION
This project is a web based shopping system for an existing shop.
The project objective is to deliver the online shopping
application into android platform.
The Server process the customers and the items are shipped to
the address submitted by them. The application was designed
into two modules first is for the customers who wish to buy the
articles. Second is for the storekeepers who maintains and
updates the information pertaining to the articles and those of
the customers. The end user of this product is a departmental
store where the application is hosted on the web and the
administrator maintains the database. The application which is
deployed at the customer database, the details of the items are
brought forward from the database for the customer view based
on the selection through the menu and the database of all the
products are updated at the end of each transaction. Data entry
into the application can be done through various screens
designed for various levels of users. Once the authorized
personnel feed the relevant data into the system, several reports
could be generated as per the security.
1.4.1 MODULES:
The system after careful analysis has been identified to be
presented with the following modules and roles.
The modules involved are:
Administrator
Moderators
Users
1.4.1.1 ADMINISTRATOR:
1. Manage Moderators
2. Manage Products
3. Manage Users
4. Manage Orders
Fig 1.1: Admin module
MANAGE MODERATOR
Fig 1.2: Manage Moderator
Add Moderator
Block moderator
Remove Moderator
Admin has privilege to delete a moderator who was added.
Search moderator:
MANAGE PRODUCTS
Add Products
The shopping cart project contains different kind of products. The
products can be classified into different categories by name.
Admin can add new products into the existing system with all its
details including an image.
Delete Products
Search products
Admin will have a list view of all the existing products. He can
also search for a particular product by name.
MANAGE USER
The admin will have a list view of all the users registered in
the system. Admin can view all the details of each user in the list
except password.
Add Users
MANAGE ORDERS
Fig 1.5: Manage Orders
View Order
Administrator can view the Orders which is generated by the
users. He can verify the details of the purchase.
Delete order
Admin can delete order from the orders list when the product is
taken for delivery.
1.4.1.2 MODERATORS
Manage products
Manage users
Manage orders
1.4.1.3 USERS
Login
A user must login with his user name and password to the system
after registration.
View Products
User can view the list of products based on their names after
successful login. A detailed description of a particular product
with product name, products details, product image, price can be
viewed by users.
Search Product
Add to cart:
The user can add the desired product into his cart by clicking add
to cart option on the product.
He can view his cart by clicking on the cart button. All products
added by cart can be viewed in the cart. User can remove an
item from the cart by clicking remove.
Submit Cart:
After confirming the items in the cart the user can submit the
cart by providing a delivery address.On successful submitting the
cart will become empty.
History
In the history the user will have a view of pending orders.
Edit Profile
SYSTEM ANALYSIS
The current system for shopping is to visit the shop manually and
from the available product choose the item customer want and
buying the item by payment of the price of the item .
1. It is less user-friendly.
Problem Statement:
i. EFFICIENCY REQUIREMENT
v. DELIVERY REQUIREMENT
USER
USER LOGIN
Description of feature
This feature used by the user to login into system. A user must
login with his user name and password to the system after
registration. If they are invalid, the user not allowed to enter the
system.
Functional requirement
Description of feature
Functional requirement
Description of feature
The user can add the desired product into his cart by clicking
add to cart option on the product. He can view his cart by
clicking on the cart button. All products added by cart can be
viewed in the cart. User can remove an item from the cart by
clicking remove. After confirming the items in the cart the user
can submit the cart by providing a delivery address. On
successful submitting the cart will become empty.
Functional requirement
MANAGE USER
Description of feature
The administrator can add user, delete user, view user and block user.
MANAGE MODERATOR
Description of feature
MANAGE PRODUCTS
Description of feature
The administrator can add product, delete product and view product.
MANAGE ORDERS
Description of feature
MODERATOR
Description of features
Functional requirement
SYSTEM DESIGN
Logical design
Physical design
Input design is the link that ties the information system into the world of its
3.2 DATABASE
DATABASE DESIGN:
3.3.1.FRONT END:
Java Script
Android
The back end is implemented using MySQL which is used to design the
databases.
MySQL
LOGIN
USER DETAILS
PRODUCT ORDERS
LOGIN
USER DETAILS
PRODUCT ORDERS
EXTERNAL ENTITY
PROCESS
DATAFLOW
DATA STORE
LOGIN DFD
Fig 3.10: Login DFD
REGISTRATION DFD
Fig 3.11: Registration DFD
ADMIN DFD
Fig 3.12: Admin DFD
MODERATOR DFD
LOGIN
REGISTRATION
HOME
ADMIN HOME
ADMIN PRODUCT
ADMIN ORDER
MODERATOR HOME
USER HOME
USER CART
3.8 SAMPLE CODE
LOGIN PAGE
<tr>
</tr>
<tr>
</tr>
<tr>
<td><div id="result"></div></td>
</tr>
</table>
</form>
<script type="text/javascript">
<%
if (request.getParameter("login") !=
null &&
request.getParameter("login").contentEquals("fa
iled")) {
%>
<% }
%>
<%
if (request.getParameter("login") != null
&&
request.getParameter("login").contentEquals("dissa
bled")) {
%>
<% }
%>
<%
if (request.getParameter("login") != null
&&
request.getParameter("login").contentEquals("unkn
own")) {
%>
<% }
%></script>
%@include file="template/body_end.jsp" %
REGISTRATION
<%@page import="DataBase.DB"%>
<%@page import="java.sql.ResultSet"%>
<div class="entry">
<table>
<tr>
<td>User Name
</td>
<td><input type="text" required="" name="uname"
id="uname"
/>
</td>
</tr>
<tr>
<td>Password
</td>
</td>
</tr>
<tr>
<td>Login Name
</td>
</td>
</tr>
<tr>
<td>Email
</td>
</td>
</tr>
<tr>
<td>Mobile No.
</td>
</td>
</tr>
<tr>
<td>
</td>
<td><button class="button"
type="submit">Register</button>
</td>
</tr>
</table>
</form>
</div>
<script type="text/javascript">
<%
%>
<% }
%>
<%
if (request.getParameter("reg") != null
&&
request.getParameter("reg").contentEquals("succ
ess")) {
%>
alert("Registration Completed")
<% }
%>
</script>
%@include file="template/body_end.jsp" %
DB REGISTRATION
<%@page import="config.Config"%>
<%@page import="java.io.File"%>
<%@page import="java.sql.ResultSet"%>
<%@page import="DataBase.DB"%>
<%
if (DB.executeUpdate("insert into login values("
+ "null" + ",'"
+ request.getParameter("uname") + "',SHA1('"
+ request.getParameter("upass") + "'),'"
+ "user" + "','"
+ "false" + "')")) {
login"); r.next();
+ uid + ",'"
+ request.getParameter("lname") + "','"
+ request.getParameter("emailid") + "','"
+ request.getParameter("mobno") + "')")) {
response.sendRedirect("index.jsp?reg=success");
} else {
response.sendRedirect("register.jsp?reg=failed");
}
%>
LOGIN BASE SELECTION
<%@page import="DataBase.DB"%>
<%@page import="java.sql.ResultSet"%>
<%
String uname =
= request.getParameter("upass");
if (r.getString("enabled") !=
null &&
r.getString("enabled").contentEquals("tr
ue")) {
session.setAttribute("uname", uname);
session.setAttribute("uid", r.getString("uid"));
session.setAttribute("utype",r.getString("utype"));
if (r.getString("utype").contentEquals("admin")) {
response.sendRedirect("adminindex.jsp");
} else if (r.getString("utype").contentEquals("mod")) {
response.sendRedirect("modindex.jsp");
} else if (r.getString("utype").contentEquals("user")) {
response.sendRedirect("userindex.jsp");
} else {
session.setAttribute("uname", null);
session.setAttribute("uid", null);
session.setAttribute("utype",null);
response.sendRedirect("login.jsp?login=unknown");
} else {
response.sendRedirect("login.jsp?login=dissabled");
} else {
response.sendRedirect("login.jsp?login=failed");
%>
DATABASE CONNECTION
package DataBase;
import
java.sql.*;
public class DB
ResultSet rs = null;
public static Connection
getConnection() { try {
Class.forName("com.mysql.jdbc.Driver");
con =
DriverManager.getConnection("jdbc:mysql://localhost:3306/online
_shoppi ng", "root", "root");
} catch (Exception e)
{ System.out.println("Exceptio
n" + e);
return con;
try {
con = getConnection();
stmt = con.createStatement();
int b =
stmt.executeUpdate(query); if
(b > 0) {
f = true;
} else {
f = false;
} catch (Exception e)
{ System.out.println("Exception" +
e);
return f;
sql) { try {
con = getConnection();
stmt =
con.createStatement(); rs
= stmt.executeQuery(sql);
return rs;
} catch (Exception e)
{ System.out.println("Exception"
close() { try {
con.close();
stmt.close();
rs.close();
} catch (Exception e)
{ System.out.println("Exceptio
n" + e);
package com.onlineshopping.activity;
import com.onlineshopping.activity.R;
import
com.onlineshopping.activity.custom.CustomWebChromeClien
t; import
com.onlineshopping.activity.custom.CustomWebViewClient;
import
android.annotation.SuppressLint;
import android.app.Activity;
import
android.content.res.Configuration;
import android.os.Bundle;
import android.view.KeyEvent;
import
android.webkit.WebSettings.PluginState;
import android.webkit.WebView;
@SuppressLint("SetJavaScriptEnabled")
public class WebViewActivity extends
Activity {
webView;
@Override
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_web_view);
// set the web view chrome client and set for showing a
progress
bar
this.webView.setWebChromeClient(new
CustomWebChromeClient(this));
this.webView.setWebViewClient(new
CustomWebViewClient(
getApplicationContext()));
processing runOnUiThread(new
Runnable() {
@SuppressWarnings("deprecation")
webView.getSettings().setJavaScriptEnabled(true);
webView.getSettings().setPluginState(PluginState.ON);
webView.loadUrl(SITE_URL_START
+
SITE_URL + SITE_URL_END);
});
}
// To handle "Back" key press event for WebView to go
back to previous
// screen.
@Overrid
webView.goBack();
return true;
@Override
super.onConfigurationChanged(newConfig);
}
}
CHAPTER 4
CONCLUSION
The system has been developed with much care and free of
errors and at the same time it is efficient and less time
consuming. The purpose of this project was to develop a web
application and an android application for purchasing items from
a shop.