Click here for PHP and MongoDB - Wildlife Sanctuary
Click here for PHP and MySQL - Hardware Store
Click here for PHP and MongoDB - Online Shopping Management System
Click here for JAVA Projects
Click here for PHP and MySQL - Hardware Store
Click here for PHP and MongoDB - Online Shopping Management System
Click here for JAVA Projects
A Project Report On
“Online Shopping Management System”
CONTENTS
Sr.No
|
TITLE
|
Page
no
|
1.
|
Content’s Abstract
|
5
|
2.
|
Introduction
|
6
|
3.
|
Overview
|
6
|
4.
|
Background and Motivation
|
6
|
5.
|
Methodology
|
7
|
6.
|
Scope
|
7
|
7.
|
Requirements
|
7
|
8.
|
Data
Directory
|
8
|
9.
|
E-R Diagram
|
10
|
10.
|
Relational Database Design
|
11
|
11.
|
Database Normalization
|
12
|
12.
|
Graphical User Interface
|
16
|
13.
|
Source Code
|
17
|
14.
|
Conclusion
|
37
|
ABSTRACT
In this project we are
created one application which is easy to access user friendly.For this
application we used the backend as Mongo DB to store the data which is used in
the application and for the user interface we had used the PHP and HTML.2 kinds
of people are able to use this application as manager and the customer as well.
The customer is able to do the online shopping very easily from any place by
reading the details of product and by seeing the product image.The manager is
the only person who is able to add and remove the products from the site.
INTRODUCATION
Overview: -
This report
discusses the result of the work done in development of "Airline
Reservation System on “PHP” Front-end Platform and “Mondo DB” as back-end
Platform.
At the
development of an application PHP provides a good connecting facility between
all pages, also the back-end Mongo DB is most important to save all the data
related the application.
Background and Motivation
The definition
of our problem lies in manual system and a fully automated system.
Manual
system: The system is very time consuming and lazy.
This system is more prone toErrors and sometimes the approaches to various
problems are unstructured.
Technical
system: With the advent of latest technology if we
do not update our system thenOur business results in losses gradually with
time. The technical systems contains the tools of latestTrend i.e. computers
printers, fax, Internet etc. The systems with this technology are very
fast,Accurate, user-friendly and reliable.
Objective
Need of Online
Shopping
1)
Convenience
2) Better
prices
3)
More variety
4) Price
comparisons
5) No crowds
Methodology
To implement the
above goals, the following methodology needs to be followed:
1. Specifying
the Application and various components of the Architecture.
2. Specifying
the bindings between the tasks and the resources either manually or by the
design
Tools.
3. Specifying
the port interconnections between the resources.
SCOPE OF PROJECT
The scope of the
project is clear to give a simple and attractive application to simplify the
work as well as to reduce the efforts while doing it offline or we can say by
doing it with old methods.
In this application
we are able to save database of all products present on the site.
In this we can buy any product very easily.
REQUIRMENTS
We are going to
perform the project on windows platform so we need the os as windows.Any
version of windows as windows xp, windows 7or windows 8.The system should have
minimum ram of 256MB as well as minimum storage capacity of 15GB.The system
should contain the server software named as “EasyPHP” of version 14.1VC11.And
mongo DB of version 2.6.3 or above.First we have to install both software and
we have to do connectivity between them by changing the configuration file of
“EasyPHP”.
DATA DIRICTORY
Table name:-Login
>
db.login.find();
{ "_id"
: ObjectId("57e926bb50f00d340d0018be"), "user" :
"ahtesham", "pass" : "1
2345",
"fname" : "ahtesham", "lname" : "shah",
"address" : "kondwa", "pincode" :
"411048", "phone" :
"9850" }
{ "_id"
: ObjectId("57e9375750f00d7416004cd4"), "user" :
"huzaif", "pass" : "say
yed",
"fname" : "huzaif", "lname" : "sayyed",
"address" : "kondwa khurd ,pune",
"pincode"
: "411048", "phone" : "839088" }
{ "_id"
: ObjectId("57e937db50f00d741600590e"), "user" : "darshan",
"pass" : "bh
avsar",
"fname" : "darshan", "lname" :
"bhavsar", "address" : "sinhagad road", "
pincode" :
"411042", "phone" : "705860" }
{ "_id"
: ObjectId("57e9383f50f00d7416003807"), "user" :
"moin", "pass" : "kazi"
,
"fname" : "moin", "lname" : "kazi",
"address" : "kausar bagh", "pincode" : "411042",
"phone" : "922654" }
Table name:-order_details
>
db.order_details.find();
{ "_id"
: ObjectId("57ef7c6250f00de40a000fc9"), "buyer fname" :
"ahtesham", "buy
er lname" :
"shah", "buyer address" : "kondwa", "buyer
pincode" : "411048", "buy
er phone" :
"9850", "buyer purchase pro_id" : "1",
"buyer purchase pro_name" : "
7999",
"buyer purchase pro_price" : "7999", "purchase
date" : ISODate("2016-09-2
5T22:00:00Z"),
"delivery date" : ISODate("2016-09-30T22:00:00Z") }
{ "_id"
: ObjectId("57ef7c6350f00de40a006732"), "buyer fname" :
"huzaif", "buyer
lname" : "sayyed", "buyer
address" : "kondwa khurd ,pune", "buyer pincode" :
"4
11048",
"buyer phone" : "839088", "buyer purchase pro_id"
: "3", "buyer purchase
pro_name" : "9000", "buyer
purchase pro_price" : "9000", "purchase date" : ISOD
ate("2016-09-25T22:00:00Z"),
"delivery date" : ISODate("2016-09-30T22:00:00Z") }
{ "_id"
: ObjectId("57ef7c6450f00de40a001dc0"), "buyer fname" :
"huzaif", "buyer
lname" : "sayyed", "buyer
address" : "kondwa khurd ,pune", "buyer pincode" :
"4
11048",
"buyer phone" : "839088", "buyer purchase pro_id"
: "5", "buyer purchase
pro_name" : "15000",
"buyer purchase pro_price" : "15000", "purchase
date" : IS
ODate("2016-09-25T22:00:00Z"),
"delivery date" : ISODate("2016-09-30T22:00:00Z")
}
{ "_id"
: ObjectId("57ef7c6550f00de40a000c15"), "buyer fname" :
"darshan", "buye
r lname" :
"bhavsar", "buyer address" : "sinhagad road",
"buyer pincode" : "4110
42",
"buyer phone" : "705860", "buyer purchase pro_id"
: "5", "buyer purchase pr
o_name" :
"15000", "buyer purchase pro_price" : "15000",
"purchase date" : ISODa
te("2016-09-25T22:00:00Z"),
"delivery date" : ISODate("2016-09-30T22:00:00Z") }
{ "_id"
: ObjectId("57ef7c6650f00de40a006a15"), "buyer fname" :
"darshan", "buye
r lname" :
"bhavsar", "buyer address" : "sinhagad road",
"buyer pincode" : "4110
42",
"buyer phone" : "705860", "buyer purchase pro_id"
: "6", "buyer purchase pr
o_name" :
"8500", "buyer purchase pro_price" : "8500",
"purchase date" : ISODate
("2016-09-25T22:00:00Z"),
"delivery date" : ISODate("2016-09-30T22:00:00Z") }
{ "_id"
: ObjectId("57ef7c6750f00de40a005ed0"), "buyer fname" :
"moin", "buyer l
name" :
"kazi", "buyer address" : "kausar bagh",
"buyer pincode" : "411042", "bu
yer phone" :
"922654", "buyer purchase pro_id" : "4",
"buyer purchase pro_name"
:
"28000", "buyer purchase pro_price" : "28000",
"purchase date" : ISODate("2016
-09-25T22:00:00Z"),
"delivery date" : ISODate("2016-09-30T22:00:00Z") }
{ "_id"
: ObjectId("57ef7c6850f00de40a001643"), "buyer fname" :
"moin", "buyer l
name" :
"kazi", "buyer address" : "kausar bagh",
"buyer pincode" : "411042", "bu
yer phone" :
"922654", "buyer purchase pro_id" : "2",
"buyer purchase pro_name"
: "7999",
"buyer purchase pro_price" : "7999", "purchase
date" : ISODate("2016-0
9-25T22:00:00Z"),
"delivery date" : ISODate("2016-09-30T22:00:00Z") }
>
Table name:-payment
> db.payment.find();
{ "_id" :
ObjectId("57e943bf50f00d500a005e14"), "buyer fname" :
"ahtesham", "buy
er lname" : "shah",
"buyer address" : "kondwa", "buyer pincode" :
"411048", "buy
er phone" : "9850",
"buyer purchase pro_id" : "1", "buyer purchase
pro_name" : "
Moto E3", "buyer purchase
pro_price" : "7999", "purchase date" : ISODate("2016-0
9-25T22:00:00Z") }
{ "_id" :
ObjectId("57e947d150f00d340c002059"), "buyer fname" :
"huzaif", "buyer
lname" : "sayyed", "buyer
address" : "kondwa khurd ,pune", "buyer pincode" :
"4
11048", "buyer phone" :
"839088", "buyer purchase pro_id" : "3", "buyer
purchase
pro_name" : "Lenovo Vibe",
"buyer purchase pro_price" : "9000", "purchase
date"
:
ISODate("2016-09-25T22:00:00Z") }
{ "_id" :
ObjectId("57e947d150f00d340c00205a"), "buyer fname" :
"huzaif", "buyer
lname" : "sayyed", "buyer
address" : "kondwa khurd ,pune", "buyer pincode" :
"4
11048", "buyer phone" :
"839088", "buyer purchase pro_id" : "5",
"buyer purchase
pro_name" : "Panasonic T50",
"buyer purchase pro_price" : "15000", "purchase da
te" :
ISODate("2016-09-25T22:00:00Z") }
{ "_id" : ObjectId("57e9482950f00d340c00282d"),
"buyer fname" : "darshan", "buye
r lname" : "bhavsar",
"buyer address" : "sinhagad road", "buyer
pincode" : "4110
42", "buyer phone" :
"705860", "buyer purchase pro_id" : "5",
"buyer purchase pr
o_name" : "Panasonic T50",
"buyer purchase pro_price" : "15000", "purchase
date"
:
ISODate("2016-09-25T22:00:00Z") }
{ "_id" :
ObjectId("57e9482950f00d340c00282e"), "buyer fname" :
"darshan", "buye
r lname" : "bhavsar",
"buyer address" : "sinhagad road", "buyer
pincode" : "4110
42", "buyer phone" :
"705860", "buyer purchase pro_id" : "6",
"buyer purchase pr
o_name" : "Samsung on7",
"buyer purchase pro_price" : "8500", "purchase
date" :
ISODate("2016-09-25T22:00:00Z") }
{ "_id" :
ObjectId("57e9485750f00dcc10002040"), "buyer fname" :
"moin", "buyer l
name" : "kazi", "buyer
address" : "kausar bagh", "buyer pincode" :
"411042", "bu
yer phone" : "922654",
"buyer purchase pro_id" : "4", "buyer purchase
pro_name"
: "One Plus 3", "buyer
purchase pro_price" : "28000", "purchase date" : ISODate(
"2016-09-25T22:00:00Z") }
{ "_id" :
ObjectId("57e9485750f00dcc10002041"), "buyer fname" :
"moin", "buyer l
name" : "kazi", "buyer
address" : "kausar bagh", "buyer pincode" :
"411042", "bu
yer phone" : "922654",
"buyer purchase pro_id" : "2", "buyer purchase
pro_name"
: "Moto E3", "buyer purchase
pro_price" : "7999", "purchase date" :
ISODate("201
6-09-25T22:00:00Z") }
{ "_id" :
ObjectId("57e9485750f00dcc10002042"), "buyer fname" :
"moin", "buyer l
name" : "kazi", "buyer
address" : "kausar bagh", "buyer pincode" :
"411042", "bu
yer phone" : "922654",
"buyer purchase pro_id" : "5", "buyer purchase
pro_name"
: "Panasonic T50", "buyer
purchase pro_price" : "15000", "purchase date" : ISODa
te("2016-09-25T22:00:00Z") }
Table name:-product
> db.product.find();
{ "_id"
: ObjectId("57e945c950f00dcc10004b9d"), "product id" : 2,
"product name"
: "Moto E3", "product
desc" : "<p>best mobile with battery of power 3500 mAh</p
>",
"product price" : "7999", "product stock" :
"", "product image" : "Moto-E3.j
pg" }
{ "_id"
: ObjectId("57e9466550f00dcc1000424c"), "product id" : 3,
"product name"
: "Lenovo Vibe", "product
desc" : "<p>this is the best mobile in lenovo product
s</p>",
"product price" : "9000", "product stock" :
"3", "product image" : "leno
vo vibe.jpg"
}
{ "_id"
: ObjectId("57e946c150f00dcc100009b3"), "product id" : 4,
"product name"
: "One Plus 3", "product
desc" : "<p>only the mobile with 6 GB ram</p>",
"produ
ct price" :
"28000", "product stock" : "5", "product
image" : "OnePlus 3.jpg" }
{ "_id"
: ObjectId("57e946f050f00dcc1000328a"), "product id" : 5,
"product name"
: "Panasonic T50", "product
desc" : "", "product price" : "15000",
"product sto
ck" :
"3", "product image" : "Panasonic T50.jpg" }
{ "_id"
: ObjectId("57ebd41f50f00ddc050071f2"), "product id" : 6,
"product name"
: "Samsung on 7", "product
desc" : "", "product price" : "12000",
"product stoc
k" :
"3", "product image" : "Samsung On7 Pro.jpg" }
{ "_id"
: ObjectId("57ebd4f150f00ddc050031be"), "product id" : 7,
"product name"
: "Redmi Note 3", "product
desc" : "", "product price" : "9999",
"product stock
" :
"2", "product image" : "redmi note3.jpg" }
E-R Diagram
RELATIONAL DATA BASE DESIGN
1]Login:-
User, pass, fname,
lname, address, pincode, phone
user
|
pass
|
fname
|
lname
|
address
|
pincode
|
phone
|
2] Order_details:-
buyer fname,buyer lname,buyer address,buyer pincodebuyer
phone,buyer purchase pro_id
buyer purchase
pro_name,delivery
date,purchase
date,buyer
purchase pro_price
buyer fname
|
buy
er lname
|
buyer address
|
buyer pincode
|
buy
er phone
|
buyer purchase pro_id
|
buyer purchase pro_name
|
delivery date
|
purchase date
|
buyer purchase pro_price
|
3] payment:-
buyer fname,buyer lname,buyer address,purchase
date,buyer phone,buyer purchase pro_id,
buyer purchase pro_name,buyer purchase
pro_price,buyer pincode
buyer fname
|
,buyer lname
|
buyer address
|
purchase date
|
buyer phone
|
buyer purchase pro_id
|
buyer purchase pro_name
|
buyer purchase pro_price
|
buyer pincode
|
4]Product:-
product id,product name,product desc,product price,product stock,product image
product id
|
product name
|
product desc
|
product price
|
product stock
|
product image
|
Database Normalization:
First
Normal Form:-
The relation is
in 1NF if it has no repeating groups. All
tables has no repeating groups so they are in 1NF.
Tables:-
1]Login:-
user
|
pass
|
fname
|
lname
|
address
|
pincode
|
phone
|
2]Order_details:-
buyer
fname
|
buy
erlname
|
buyer
address
|
buyer
pincode
|
buy
er
phone
|
buyer
purchase pro_id
|
buyer
purchase pro_name
|
delivery
date
|
purchase
date
|
buyer
purchase pro_price
|
3]payment:-
buyer fname
|
,buyer lname
|
buyer address
|
purchase date
|
buyer phone
|
buyer purchase
pro_id
|
buyer purchase
pro_name
|
buyer purchase
pro_price
|
buyer pincode
|
4]Product:-
product id
|
product name
|
product desc
|
product price
|
product stock
|
product image
|
Second
Normal Form
A relation is said to be in second normal form if it is already in first
normal form and it has no partial dependency
1)
Login:
The absence of partial dependency in relation takes it into 2NF
without any modification
2)
Order_details:
The absence of partial dependency in relation takes it into 2NF
without any modification.
3)
Payment:-
The
absence of partial dependency in relation takes it into 2NF without any
modification
4)
Product:-
The absence of partial dependency in relation takes it into 2NF
without any modification
Tables:-
1]Login:-
user
|
pass
|
fname
|
lname
|
address
|
pincode
|
phone
|
2]Order_details:-
buyer fname
|
buy
erlname
|
buyer address
|
buyer pincode
|
buy
er phone
|
buyer purchase pro_id
|
buyer purchase pro_name
|
delivery date
|
purchase date
|
buyer purchase pro_price
|
3]payment:-
buyer
fname
|
,buyer lname
|
buyer address
|
purchase date
|
buyer phone
|
buyer purchase
pro_id
|
buyer purchase
pro_name
|
buyer purchase
pro_price
|
buyer pincode
|
4]Product:-
product id
|
product name
|
product desc
|
product price
|
product stock
|
product image
|
Third
Normal Form
A relation is
said to be in third normal form if it is already in 1st and 2nd
NF and has no transitive dependency.
1)
Login:
In Customer every
attribute depends on primary key so it is in 3rd normal form
2)
Order_details:-
In order_details depends upon address so
another table with address and pincode is form to remove transitive functional
dependency.
buyeraddress
|
buyerpincode
|
3)
Payent:-
In Payment depends upon address so another
table with address and pincode is form to remove transitive functional
dependency.
buyeraddress
|
buyerpincode
|
4)
Product:-
In Product in both the table
every attribute depends upon the primary key so it is in 3rd NF.
Tables:
1]Login:-
user
|
pass
|
fname
|
lname
|
address
|
pincode
|
phone
|
2]Order_details:-
buyer
fname
|
buy
erlname
|
buyer
address
|
buyer
pincode
|
buy
er
phone
|
buyer
purchase pro_id
|
buyer
purchase pro_name
|
delivery
date
|
purchase
date
|
buyer
purchase pro_price
|
3]payment:-
buyer fname
|
,buyer lname
|
buyer address
|
purchase date
|
buyer phone
|
buyer purchase
pro_id
|
buyer purchase
pro_name
|
buyer purchase
pro_price
|
buyer pincode
|
4]Product:-
product id
|
product name
|
product desc
|
product price
|
product stock
|
product image
|
GRAPHICAL USER INTERFACE
The application
is very user friendly and uses a GUI interface implemented in PHP and HTML to
Communicate with the user. Various features are self – explanatory. Forms are
easy to fill in and components can be added, removed and updated very easily
through a Single dialog box. The application includes tool-tip hints to give a
brief description of the particular input Field.
List boxes are
used to display all the components at once so that user can see all the
components of a Particular type at once. One can just select the component and
modify and remove the component.(based on the access control of the person)
Features
1. Clean
separation of various components to facilitate easy modification and revision.
2. All the data is
maintained in a separate file to facilitate easy modification
3. All the data
required for different operations is kept in a separate file.
4. Quick and easy
saving and loading of database file.
SOURCECODE
1)Add to the Cart :
<?php
session_start();
?>
<?php
if(isset($_GET['add_cart'])){
$product_id=$_GET['add_cart'];
$m = new MongoClient();
$db = $m->ecommerce;
$coll = $db->product;
$cursor = $coll->find();
foreach ($cursor as $obj)
{
$product_name=$_GET['pro_name'];
$product_desc=$_GET['pro_desc'];
$product_img=$_GET['pro_img'];
}
}
if(isset($_GET['add_cart'])){
$product_id=$_GET['add_cart'];
$product_price=$_GET['pro_price'];
$product_name=$_GET['pro_name'];
$product_desc=$_GET['pro_desc'];
$product_img=$_GET['pro_img'];
$m = new MongoClient();
$db = $m->ecommerce;
$coll = $db->cart;
$insert_pro=array('product
id'=>$product_id,'product name'=> $product_name,'product
desc'=>$product_desc,'product price'=> $product_price,'product img'=>
$product_img);
$coll->insert($insert_pro);
}
?>
<?php
header('Location: main.php');
?>
2)Display the Cart :
<?php
session_start();
?>
<!DOCTYPE>
<html>
<head>
<title>My
Online Shopping Website</title>
<link
rel="stylesheet" href="css/style.css" media="all"
/>
</head>
<body>
<!--Main
Container starts here-->
<div class="main_wrapper">
<!--Header
Container starts here-->
<div
class="header_wrapper">
<img
id="banner" src="images/ad_banner.jpg">
</div>
<!--Header ends
here-->
<!--Navigation
starts here-->
<div
class="menubar">
<ul
id="menu">
<li> <a
href="main.php">Home</a></li>
<li> <a
href="main.php">All Product</a></li>
<li> <a
href="insert_product.php">Insert a Product</a></li>
<li> <a
href="#">My Account</a></li>
<li> <a
href="#">Sign Up</a></li>
<li> <a
href="#">Shopping Cart</a></li>
<li> <a
href="#">Contact Us</a></li>
</ul>
<div
id="form">
<form
method="get" action="results.php"
enctype="multipart/form-data">
<input
type="text" name="user_query" placeholder="Search a
Product"/>
<input
type="submit" name="search" value="Search"/>
</form>
</div>
</div>
<!--Navigation
ends here-->
<!--Content
starts here-->
<div
class="content_wrapper">
<!--Sidebar
starts here-->
<div
id="sidebar">
<div
id="sidebar_title">Product</div>
<ul
id="cats">
<?php
$m = new
MongoClient();
$db =
$m->ecommerce;
$coll =
$db->product;
$cursor =
$coll->find();
$num_docs =
$cursor->count();
if( $num_docs >
0 )
{
// loop over the
results
foreach ($cursor
as $obj)
{
$pro_id=$obj['product
id'];
$pro_name=$obj['product
name'];
echo
"<li><font color='white'><a href='details.php?pro_id=$pro_id'>$pro_name</font></li>";
}
}
?>
</ul>
</div>
<div
id="content_area">
<div
id="shopping_cart">
<span
style="float:right; font-size:18px; padding:5px;
line-height:40px;">
Welcome <?php
echo $_SESSION['fname'];echo " ".$_SESSION['lname'];?>! <b style="color:yellow">Shopping
Cart-</b>
Total
Item-<?php $m = new MongoClient();$db = $m->ecommerce;$coll =
$db->cart;$cursor=$coll->find();$product_item=$cursor->count();echo
$product_item;?>
Total Price-
<?php
$m = new
MongoClient();
$db =
$m->ecommerce;
$coll =
$db->cart;
$cursor=$coll->find();
$pro_price=0;
foreach ($cursor
as $obj)
{
$pro_price+=$obj['product
price'];
}
echo $pro_price;
?>
<a
style="color:yellow" href="cart.php"> Go To
Cart</a>
</span>
</div>
<div
id="product_box1">
<?php
$m = new
MongoClient();
$db =
$m->ecommerce;
$coll =
$db->cart;
$cursor =
$coll->find();
$p_id=1;
foreach ($cursor
as $obj)
{
$id=$obj['_id'];
$p_name=$obj['product
name'];
$p_price=$obj['product
price'];
$p_img=$obj['product
img'];
echo"
<div id='single_product1'>
<h4><b>Item
Number: $p_id</b></h4>
<h4><b>Product
Name: $p_name</b></h4>
<img
src='product_images/$p_img' height='100' width='100'/>
<h4><b>Product
Price:₹ $p_price</b></h4>
<a
href='remove.php?id=$id'><button>Remove</button></a>
</div>";
$p_id++;
}
?>
<div
id="single_product1">Total Price- <?php
$m = new
MongoClient();
$db =
$m->ecommerce;
$coll =
$db->cart;
$cursor=$coll->find();
$pro_price=0;
foreach ($cursor
as $obj)
{
$pro_price+=$obj['product
price'];
}
echo $pro_price;
?>
</div>
<div
id='single_product1'>
<a
href="payment.php?"><button>Proceed to
Pay</button></a>
</div>
</div>
</div>
</div>
<div
id="footer">
<h2
style="text-align:center; padding-top:30px">© 2016 by
www.professionalcipher.blogspot.com </h2>
</div>
</div>
<!--Main
Container ends here-->
</body>
</html>
3)Insert the Product:
<!DOCTYPE>
<html>
<head>
<title>Inserting Product</title>
<script
src="//cdn.tinymce.com/4/tinymce.min.js"></script>
<script>tinymce.init({ selector:'textarea' });</script>
<style>
.header_wrapper{
width:1000px;
height:100px;
margin:auto;
}
.main_wrapper{
width:1000px;
height:auto;
margin:auto;
}
</style>
</head>
<body bgcolor="skyblue">
<div class="main_wrapper">
<!--Header Container starts here-->
<div class="header_wrapper">
<img id="banner"
src="images/ad_banner.png">
</div>
</div>
<div>
<form action="insert_product.php"
method="post" enctype="multipart/form-data">
<table align="center"
width="700" border="2" bgcolor="orange">
<tr align="center">
<td colspan="8"><h2>Insert New
Product</h2></td>
</tr>
<tr>
<td align="right"><b>Product
ID:</b></td>
<td>
<?php
$m = new MongoClient();
$db = $m->ecommerce;
$coll = $db->product;
$cursor=$coll->find();
$product_id=$cursor->count();
$product_id++;
echo "<b> $product_id</b>";
?>
</td>
</tr>
<tr>
<td align="right"><b>Product
Name:</b></td>
<td><input type="text"
name="product_name" size="60" />
</tr>
<tr>
<td align="right"><b>Product
Description:</b></td>
<td><textarea name="product_desc"
cols="20" rows="10" ></textarea>
</tr>
<tr>
<td align="right"><b>Product
Image:</b></td>
<td><input type="file"
name="product_image"/>
</tr>
<tr>
<td align="right"><b>Product
Price:</b></td>
<td><input type="text"
name="product_price" size="60" />
</tr>
<tr>
<td align="right"><b>Product
Stock:</b></td>
<td><input type="text"
name="product_stock" size="60" />
</tr>
<tr align="center">
<td colspan="8"><input type="submit"
name="insert_post" value="Insert"/>
</tr>
</table>
</form>
<table align="center" width="700"
border="8" bgcolor="pink">
<tr align="center">
<td><form action="main.php"><button
type="submit">Home</button></form></td>
</tr>
</table>
</div>
</body>
</html>
<?php
$m = new MongoClient();
$db = $m->ecommerce;
$coll = $db->product;
$cursor=$coll->find();
$product_id=$cursor->count();
$product_id++;
if(isset($_POST['insert_post']))
{
//$product_id=$_POST['product_id'];
$product_name=$_POST['product_name'];
$product_desc=$_POST['product_desc'];
$product_price=$_POST['product_price'];
$product_stock=$_POST['product_stock'];
$product_image=$_FILES['product_image']['name'];
$product_image_tmp=$_FILES['product_image']['tmp_name'];
move_uploaded_file($product_image_tmp,"product_images/$product_image");
$doc=array('product id'=>$product_id,
'product name'=>$product_name,
'product desc'=>$product_desc,
'product price'=>$product_price,
'product stock'=>$product_stock,
'product image'=>$product_image,
);
$coll->insert($doc);
echo "
<form>
<table align='center' width='700' border='2' bgcolor='white'>
<tr align='center'>
<td colspan='8'><h2>Inserted Product
Details</h2></td>
</tr>
<tr>
<td align='right'><b>Product ID:</b></td>
<td>$product_id</td>
</tr>
<tr>
<td align='right'><b>Product Name:</b></td>
<td>$product_name</td>
</tr>
<tr>
<td align='right'><b>Product Description:</b></td>
<td>$product_desc</td>
</tr>
<tr>
<td align='right'><b>Product Image:</b></td>
<td><img src='product_images/$product_image' height='180'
width='180'/><td/>
</tr>
<tr>
<td align='right'><b>Product Price:</b></td>
<td>$product_price<td/>
</tr>
<tr>
<td align='right'><b>Product stock:</b></td>
<td>$product_stock<td/>
</tr>
</table>
</form> ";
}
?>
4)Remove the Product :
<!DOCTYPE>
<html>
<head>
<title>Remove Product</title>
<style>
.header_wrapper{
width:1000px;
height:100px;
margin:auto;
}
.main_wrapper{
width:1000px;
height:auto;
margin:auto;
}
</style>
</head>
<body bgcolor="skyblue">
<div class="main_wrapper">
<!--Header Container starts here-->
<div class="header_wrapper">
<img id="banner"
src="images/ad_banner.png">
</div>
</div>
<div>
<table align="center" width="700"
border="8" bgcolor="pink">
<tr align="center">
<td><form action="main.php"><button
type="submit">Home</button></form></td>
</tr>
</table>
</div>
</body>
</html>
<?php
$m = new MongoClient();
$db = $m->ecommerce;
$coll = $db->product;
$cursor=$coll->find();
$product_id=$cursor->count();
$product_id++;
foreach ($cursor as $obj)
{
$id=$obj['_id'];
$pro_id=$obj['product id'];
$pro_name=$obj['product name'];
$pro_desc=$obj['product desc'];
$pro_img=$obj['product image'];
$pro_stock=$obj['product stock'];
$pro_price=$obj['product price'];
echo "
<form>
<table align='center' width='700' border='2' bgcolor='white'>
<tr align='center'>
<td colspan='8'><h2>Inserted Product
Details</h2></td>
</tr>
<tr>
<td align='right'><b>Product ID:</b></td>
<td>$pro_id</td>
</tr>
<tr>
<td align='right'><b>Product Name:</b></td>
<td>$pro_name</td>
</tr>
<tr>
<td align='right'><b>Product
Description:</b></td>
<td>$pro_desc</td>
</tr>
<tr>
<td align='right'><b>Product Image:</b></td>
<td><img src='product_images/$pro_img' height='180'
width='180'/><td/>
</tr>
<tr>
<td align='right'><b>Product Price:</b></td>
<td>$pro_price<td/>
</tr>
<tr>
<td align='right'><b>Product Stock:</b></td>
<td>$pro_stock<td/>
</tr>
</table>
</form>
<center><a
href='remove1.php?id=$id'><button>Remove</button></a></center>
";
}
?>
5)Update the Product :
<!DOCTYPE>
<html>
<head>
<title>Remove Product</title>
<style>
.header_wrapper{
width:1000px;
height:100px;
margin:auto;
}
.main_wrapper{
width:1000px;
height:auto;
margin:auto;
}
</style>
</head>
<body bgcolor="skyblue">
<div class="main_wrapper">
<!--Header Container starts here-->
<div class="header_wrapper">
<img id="banner"
src="images/ad_banner.png">
</div>
</div>
<div>
<table align="center" width="700"
border="8" bgcolor="pink">
<tr align="center">
<td><form action="main.php"><button
type="submit">Home</button></form></td>
</tr>
</table>
</div>
</body>
</html>
<?php
$m = new MongoClient();
$db = $m->ecommerce;
$coll = $db->product;
$cursor=$coll->find();
$product_id=$cursor->count();
$product_id++;
foreach ($cursor as $obj)
{
$id=$obj['_id'];
$pro_id=$obj['product id'];
$pro_name=$obj['product name'];
$pro_desc=$obj['product desc'];
$pro_img=$obj['product image'];
$pro_stock=$obj['product stock'];
$pro_price=$obj['product price'];
echo "
<form>
<table align='center' width='700' border='2' bgcolor='white'>
<tr align='center'>
<td colspan='8'><h2>Inserted Product
Details</h2></td>
</tr>
<tr>
<td align='right'><b>Product ID:</b></td>
<td>$pro_id</td>
</tr>
<tr>
<td align='right'><b>Product Name:</b></td>
<td>$pro_name</td>
</tr>
<tr>
<td align='right'><b>Product
Description:</b></td>
<td>$pro_desc</td>
</tr>
<tr>
<td align='right'><b>Product Image:</b></td>
<td><img src='product_images/$pro_img' height='180'
width='180'/><td/>
</tr>
<tr>
<td align='right'><b>Product Price:</b></td>
<td>$pro_price<td/>
</tr>
<tr>
<td align='right'><b>Product Stock:</b></td>
<td>$pro_stock<td/>
</tr>
</table>
</form>
<center><a href='update.php?id=$id'><button>Update</button></a></center>
";}
?>
Snapshots of the application
Customer View:
ADMIN VIEW:
14) Conclusion:
THUS WE HAVE SUCCESSFULLY IMPLEMENTED ONLINE
SHOPPING DATABASE MANAGEMENT WHICH HELPS US IN CENTRALIZING THE DATA USED FOR
MANAGING THE TASKS PERFORMED IN A ONLINE SHOPPING
WE HAVE SUCCEFULLY
IMPLEMENTED VARIOUS FUNCTIONALITIES OF MONGODB AND PHP AND CREATED THE FULLY
FUNCTIONAL DATABASE MANAGEMENT SYSTEM FOR ONLINE SHOPPING.
CONCEPTS USED
1.MONGODB-(DATABASE BACKEND)
2.HTML & PHP-(FRONT END)
3.EASY PHP-(CONNECTIVITY)
4.PROCEDURES
SOFTWARE USED
1.EASYPHP DEVSERVER 14.1
2.BROWSER
USEFUL VIDEOS
USEFUL VIDEOS
3 Comments
Hello everyone, I'm Huzaif Sayyed(Professional Cipher)
ReplyDeleteDownload the project https://professionalcipher.blogspot.in/2017/04/dbms-mini-project.html
Candidates who applied for this Competitive Exam should download their E-admit Card or Hall Ticket to enter in prescribed Exam Centre of Assistant Loco Pilot Exam by Railway Recruitment Board. No Admit Card or Hall Ticket will reach home of Candidates by post, it can only be download in upcoming dates before Exam.
ReplyDeleteCan u please send this project code in some folder which would be easy to make out the code.
ReplyDelete