Project Report
Project Report
TECHONOLOGY
MAJOR PROJECT ON ONLINE SHOPPING
MENTORS
MR.RAMSUNDAR GHORAI
MR. SRIJIB SAMANTA
TAMRALIPTA INSTITUTE OF MANAGEMENT & TECHONOLOGY
Affilated to Moulana Abul Kalam Azad University of Technology,W.b
Formerly known as West Bengal University of Technology
(A Project of N.H.K Welfare Foundation)
College code: 212
This is certify that Moumita Sahoo bearing Moulana Abul Kalam Azad University of Technology ,W.B.
Roll No:21201214012 has worked from MARCH-2017 to MAY-2017 TAMRALIPTA INSTITUTE OF
MANAGEMENT & TECHONOLOGY under the supervision of Mr. Srijib Samanta, Asst. Professor of
BCA(H) department of TAMRALIPTA INSTITUTE OF MANAGEMENT & TECHONOLOGY in the
project entitled MyShop (Online Based Apparel Store) for the partial fulfillment of BCA(H) major
project (BCA-693).She is regular, hard working,sincere and co-operative.
BONAFIDE CERTIFICATE
This is to certify that this project “MyShop (Online Based Apparel Store)” is the
bonafide work of Moumita Sahoo (Roll No.- 21201214012) who carried out
the project work under my supervision.
SIGNATURE EXAMINER
ACKNOWLEDGEMENT
Moumita Sahoo
Roll No.- 21201214012
Project Report for MyShop
INDEX
INTRODUCTION
OBJECTIVES
TOOLS/ENVIRONMENT
SOFTWARE REQUIREMENT SPECIFICATION (SRS)
PROJECT PLANNING
ANALYSIS:
DFD LEVEL 0
DFD LEVEL 1
DFD LEVEL 2
ENTITY-RELATIONSHIP DIAGRAM
USE-CASE DIAGRAM
P ROCESS LOGIC DIAGRAM
SYSTEM DESIGN
SCREENSHOTS
PROGRAM CODE
TESTING
SYSTEM SECURITY MEASURES
TEST CASE DESIGN AND TEST REPORTS
FURTHER ENHANCEMENTS AND FUTURE SCOPE
BIBLIOGRAPHY AND REFERENCES
Page | 5
Project Report for MyShop
INTRODUCTION:
1. Title of the project:
2. Introduction:
There is no denying the fact that e-Commerce has entered India and is here to stay.
Even the small and medium retailers of the country want to ride the wave and are ready
to make a fortune out of the market place concept. It is now when e-Commerce is the
most growing sector of Information Technology. So I have kept the concept of e-
Commerce in mind and developed an “Online Based Apparel Store” for my BCA 6th Sem
Major project.
Online Apparel Store is an online store through which internet users can buy clothes,
shoes, accessories etc. from this website. Users can browse through various products
from different brands belonging to different price ranges. Users have to create a new
account using the registration page or he/she can directly buy products using the
default “Guest” account. The user can also update the quantity or remove products
from the cart by clicking on the “Go to Cart” button, after finalizing the cart the user can
proceed to the checkout page where he/she can select the payment method via
“PayPal” or “Cash on Delivery” and make the payment.
Page | 6
Project Report for MyShop
OBJECTIVES:
b. The application will enable visitors to perform activities such as search for items,
buy that online, and view the latest products.
c. The application will enable a registered user to select items for purchase using the
shopping cart.
d. The application will have an administrator’s page, which will enable administrators
to maintain user details and manage the shopping items in the inventory.
e. The application will allow users to search for products based on multiple keywords.
g. The users will be able to purchase the products and pay via Online payment portal
“PayPal”
h. The Administrator will be able to manage the content of the store by adding new
products, adding new categories and brands and also delete them whenever
required.
Page | 7
Project Report for MyShop
PROJECT CATEGORY:
Relational Database Management System (Online Website)
TOOLS/ENVIRONMENT:
SOFTWARE REQUIREMENT
SPECIFICATION (SRS):
(According to IEEE Standard 830 for SRS)
1) Introduction
1.1 Purpose:
The purpose of this phase is to understand the exact requirement of the system
and to document them properly. This activity is usually done to document all
functions, performance and interfacing requirements for the software designing
and management. The intended audience of this document include the site
administrator of the Online Store and the end users. Other intended audience
include development team, analysts, design team, testing team etc.
Page | 8
Project Report for MyShop
c) Provide a responsive website so that users can visit the website using their
smartphones.
d) The ease of payment through safe and secure PayPal portal.
Term Definition
User Online Users or Customers of online apparel store
Admin Administrator who maintains the website
1.4 Overview:
The document is organised as follows: Second section mainly provides the
interfaces and third section provides details about the important functional and
non-functional requirements.
2) General Description
2.1 Product Perspective:
This website will provide simple and clean user interfaces without complex
options.
Users will be able to open this website in any device such as PC, Tablets or
Smartphones as this website is completely responsive and will fit any screen
size. Users can browse products on the basis of brands or categories and can
also click on every product to see the product details.
Users will be able to buy products as guests or after registering to the website
and after they have brought the products a confirmation email will be sent to
them on their respective email addresses.
Login:
All the registered users will be able to login to their respective accounts and buy the
products, view their account and order details.
Customer Registration:
Users who are not registered to the website will be able to click the sign up link to
register and create an account in the website so that they can purchase the
products properly.
Page | 9
Project Report for MyShop
Search Product:
Users will be able to search products using the search bar which works by searching
products with similar keywords.
Add to Cart:
After selecting the desired product users will be able to add the products to the cart
to proceed to checkout. The cart also provides functions to update product quantity
and remove products if the user wants
Checkout:
When the users finalize their cart they can click the “Proceed to Checkout” button to
proceed for the final payment via PayPal.
Online Users:
These users are the customers of the Online Store who will access the system
online. The users can be from any part of the world and their preferred language is
English. We will assume that the users will have minimum technical knowledge and
hence a User-Friendly Interface has been designed.
3) Specific Requirements
Page | 10
Project Report for MyShop
Main page:
This page is the home page of the website, this will be the page which opens as soon
as a user opens this website. This page will contain some products which are
ordered randomly.
Customer Registration:
This page will open when a user clicks on the “Sign Up” link. This page will enable a
user to create a new account in the website for purchasing products. This page will
have a basic form with a few fields such as Username, Address, Email etc.
My Account:
This page will open when a user clicks on the “My Account” link. This page will show
the account details of the customer.
Shopping Cart:
This is the main “Shopping Cart/Bag” of the website. Whenever a user adds a
product to the cart the product will automatically go the cart. Later, the user will be
able to update the quantity of the products and also can delete the product from
this cart. This page will open on clicking the “Go to Cart” link.
Admin Panel:
This interface is the most important part of the website. Using this interface the
admin will log in to the website and then he/she can update, delete or insert new
products, categories and brands. It will also let the admin to check customer’s
accounts and the transactions.
The database of this website is created using XAMPP which is a free open-source
cross platform web-server. The database can be exported from the XAMPP software
for portability and can be implemented in any other server or PC.
There is no direct hardware interface specifically for the Online Store. This is a web
application which runs on application server hosted in-house on enterprise
hardware.
Database: XAMPP Admin Panel is the most preferred database interface for
viewing and controlling the database directly.
Page | 11
Project Report for MyShop
Business Rationale: Allows users to register to the website’s database and buy
products.
Exception Scenarios: If user misses any form field or enters invalid details then a
popup message will be shown regarding the error.
Dependencies: Authentication process of the system.
Page | 12
Project Report for MyShop
Business Rationale: Helps users to find product(s) easily without too much effort.
This will be supplemented by product recommendation and similar products to
boost sales value in future.
Exception Scenarios: “No products found!” will be displayed if no products match
the criteria.
Dependencies: FR2: Users should be logged in.
Page | 13
Project Report for MyShop
Business Rationale: Allows users to buy products and give them full control of their
transactions.
Exception Scenarios: If user adds the same product to cart then pop up will show
regarding it and if the product is not available then the user will not be able to add
the product to the cart.
Dependencies:
FR2: Users should be logged in.
FR3: Users should add at least one product to proceed to the checkout
operation.
Business Rationale: Provide users flexible payment methods and other options.
Exception Scenarios: If the redirection to PayPal is not completed then appropriate
error message will be displayed.
Dependencies:
FR2: Users should be logged in.
FR3: Users should add at least one product to proceed to the checkout operation
and clicked the checkout button.
Page | 14
Project Report for MyShop
3.6.1 Reliability:
The Online Apparel Store should provide reliable and relevant search results at all
times. The checkout operation should end reliably within 5 seconds.
3.6.2 Availability:
The Online Apparel Store should be available 99.99% of times on the World Wide
Web. All software updates, fixes, maintenance should be done without shutting
down the whole system. There should be a disaster recovery environment to handle
natural disasters.
3.6.3 Security:
Login operations should be performed using the transport layer security
(HTTPS).
Important fields of the database should be validated for SQL injection scenarios
and HTML reserved word scenarios.
3.6.4 Maintainability:
All code and artefacts should have proper documentation.
All code components should be thoroughly tested and the test coverage
should be more than 80%.
Page | 15
Project Report for MyShop
PROJECT PLANNING:
Effort:
For project development initially the concepts of E-Commerce, HTML, PHP, MySQL and
Bootstrap Front-End Framework has been studied. Then the requirement specification
document has been prepared. Then the proposed model of the website will be prepared and
finally the design, coding and testing will be done.
Cost:
Programmers can complete this project within 2 months working simultaneously. As I am
developing this website alone it took me around 3-4 months to develop and design this
website. Software and print costs are involved in this project.
Resource:
Software packages like Adobe Dreamweaver, Adobe Photoshop, XAMPP, Bootstrap Package
and minimum hardware infrastructure is required.
Project Duration:
Approximately 6 Months.
ANALYSIS:
Data Flow Diagrams:
1) DFD Level 0:
Page | 16
Project Report for MyShop
2) DFD Level 1:
Page | 17
Project Report for MyShop
Page | 18
Project Report for MyShop
Entity-Relationship Diagram:
Page | 19
Project Report for MyShop
Use-Case Diagram:
Page | 20
Project Report for MyShop
SYSTEM DESIGN:
Module Identification and Description:
1) Login and Registration:
This module will let the user to login into the system. The user will be able to buy
products by from the store. Guest users will be able to register and create a new
account in the system by using the Registration function.
2) Product Details:
Every product that will be available in the website will have an attribute called details (a
general description of the product). On clicking the “details” button users will be able to
see the details of the products in the same page.
3) Search Products:
This process will help the user to search products by entering keywords like price,
colour, brand or category and pressing the search button. The system will automatically
search the database for the matching keyword and proper search results will be shown.
5) Admin Panel:
This page will be a separate panel only for the administrators. The admins will be able
to login in to the system and perform several tasks such as Insert Product, Delete
Product, Insert New Brands and Categories, View Customers etc. through this panel.
6) Checkout:
The checkout module will enable the user to proceed to the payment options via
PayPal. The module will retrieve the total cart price from the database and prepare a
bill for the regarding transaction.
Page | 21
Project Report for MyShop
8) My Account:
The “My account” module will contain all the account details of the user who will be
logged in the system at a particular time. It will also enable the user to delete their
account, change the user password and other functions.
Database Design:
The database of “The Online Apparel Store” will have 6 tables. Each and every table is setup
with the proper Integrity constraints to work properly. The list of tables is given below:
2) cart:
Field Name Data Type Size (Width) Constraints
p_id int 10 Primary Key
ip_add varchar 255 Not null
qty int 10 Not null
Page | 22
Project Report for MyShop
3) categories:
4) products:
5) customers:
6) admins:
Page | 23
Project Report for MyShop
User Interfaces:
1) Online Apparel Store Home Page:
Page | 24
Project Report for MyShop
Page | 25
Project Report for MyShop
5) My Account page:
Page | 26
Project Report for MyShop
6) Cart page:
Page | 27
Project Report for MyShop
Page | 28
Project Report for MyShop
Page | 29
Project Report for MyShop
Page | 30
Project Report for MyShop
Page | 31
Project Report for MyShop
PROGRAM CODE:
1) index.php (Home Page):
<?php
error_reporting(0);
session_start();
include("Includes/db_1.php");
include("Functions/function.php");
?>
<body>
Page | 32
Project Report for MyShop
?>
<div class="container">
<div class="row">
<div class="well pull-right">
Page | 33
Project Report for MyShop
<a href="cart.php">Go To Cart</a>
<?php
if(!isset($_SESSION['customer_email'])){
echo "<a href='checkout.php'>Login</a>";
}
else{
echo "<a href='logout.php'>Logout</a>";
?>
Page | 34
Project Report for MyShop
</small>
</div>
</div>
</div>
<hr />
<div class="container">
<div class="row">
<div class="col-xs-6 col-md-3">
<h3>CATEGORIES</h3>
<div class="list-group" id="cats">
<?php
getCats();
?>
</div>
<hr />
<h3>BRANDS</h3>
<div class="list-group" id="brands">
<?php
getBrands();
?>
</div>
</div>
<?php getPro();?>
<?php getCatPro();?>
<?php getBrandPro();?>
</div>
</div>
</div>
</div>
</div>
</div>
<script src="JS/bootstrap.min.js"></script>
Page | 35
Project Report for MyShop
<script src="JS/jquery-2.1.4.min.js"></script>
</body>
</html>
<body onload="LoadOnce()">
Page | 36
Project Report for MyShop
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-
target="collapse">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="index.php">
<img src="Images/Brandlogo3.png" />
</a>
</div>
<!-- Collect the nav links, forms, and other content for toggling -->
<div class="collapse navbar-collapse" id="collapse">
<ul class="nav navbar-nav">
<li>
<a href="all_products.php">All Products</a>
</li>
<li>
<a href="my_account.php">My Account</a>
</li>
<li>
<a href="customer_registration.php">Sign Up</a>
</li>
<li>
<a href="cart.php">Shopping Cart</a>
</li>
<li>
<a href="#">Contact Us</a>
</li>
</ul>
<!--Search-Bar-->
<form method="get" action="results.php" enctype="multipart/form-data"
class="navbar-form navbar-right" role="search">
<div class="form-group">
<input type="text" name="user_query" class="form-control input-sm"
placeholder="Search Products">
</div>
<button type="submit" name="search" class="btn btn-info btn-sm">Go</button>
</form>
<!--End-Search-Bar-->
</div>
<!-- /.navbar-collapse -->
</div>
<!-- /.container -->
</nav>
<hr />
Page | 37
Project Report for MyShop
<?php
cart();
?>
<div class="container">
<div class="row">
<div class="well pull-right">
Welcome :<span class="badge">
<?php
if(isset($_SESSION['customer_email'])){
echo $_SESSION['customer_email'];
}
else{
echo"Guest";
}
?>
</span>
 
Items : <span class="badge"><?php if(!$_SESSION['customer_email']=='') total_items();
else echo "N/A";?></span>
 
Cart Amount : <span class="badge"><?php if(!$_SESSION['customer_email']=='')
total_price(); else echo "N/A"; ?></span>
 
<a href="cart.php">Mainpage</a>
<?php
if(!isset($_SESSION['customer_email'])){
echo "<a href='checkout.php'>Login</a>";
}
else{
echo "<a href='logout.php'>Logout</a>";
Page | 38
Project Report for MyShop
?>
</small>
</div>
</div>
</div>
<hr />
<div class="container">
<div class="row">
<div class="col-xs-6 col-md-3">
<h3>CATEGORIES</h3>
<div class="list-group" id="cats">
<?php
getCats();
?>
</div>
<hr />
<h3>BRANDS</h3>
<div class="list-group" id="brands">
<?php
getBrands();
?>
</div>
</div>
<?php
$total=0;
Page | 39
Project Report for MyShop
global $con;
$ip = getIp();
$sel_price = "select * from cart where ip_add='$ip'";
$run_price = mysqli_query($con,$sel_price);
while($p_price=mysqli_fetch_array($run_price)){
$pro_id = $p_price['p_id'];
$run_pro_price = mysqli_query($con,$pro_price);
while($pp_price = mysqli_fetch_array($run_pro_price)){
$product_price = array($pp_price['product_price']);
$product_title = $pp_price['product_title'];
$product_image = $pp_price['product_img1'];
$single_price = $pp_price['product_price'];
$values = array_sum($product_price);
$total +=$values;
?>
<tbody>
<tr>
<?php
if(isset($_POST['update_cart'])){
$qty = $_POST['qty'] ;
$_SESSION['qty']=$qty;
$total = $total*$qty;
}
?>
Page | 40
Project Report for MyShop
</table>
</form>
<?php
global $con;
$ip = getIp();
if(isset($_POST['update_cart'])){
foreach($_POST['remove'] as $remove_id){
}
}
if(isset($_POST['continue'])){
echo "<script>window.open('index.php','_self')</script>";
Page | 41
Project Report for MyShop
?>
</div>
</div>
</div>
</div>
<script src="JS/bootstrap.min.js"></script>
<script src="JS/jquery-2.1.4.min.js"></script>
</body>
</html>
<body>
Page | 42
Project Report for MyShop
Page | 43
Project Report for MyShop
?>
<div class="container">
<div class="row">
<div class="well pull-right">
Welcome :<span class="badge">
<?php
if(isset($_SESSION['customer_email'])){
echo $_SESSION['customer_email'];
}
else{
echo"Guest";
}
?>
</span>
 
Items : <span class="badge"><?php if(!$_SESSION['customer_email']=='') total_items(); else
echo "N/A";?></span>
 
Cart Amount : <span class="badge"><?php if(!$_SESSION['customer_email']=='') total_price();
else echo "N/A"; ?></span>
 
<a href="cart.php">Go To Cart</a>
<?php
if(!isset($_SESSION['customer_email'])){
echo "<a href='checkout.php'>Login</a>";
Page | 44
Project Report for MyShop
}
else{
echo "<a href='logout.php'>Logout</a>";
}
?>
</small>
</div>
</div>
</div>
<hr />
<div class="container">
<div class="row">
<div class="col-xs-6 col-md-3">
<h3>CATEGORIES</h3>
<div class="list-group" id="cats">
<?php
getCats();
?>
</div>
<hr />
<h3>BRANDS</h3>
<div class="list-group" id="brands">
<?php
getBrands();
?>
</div>
</div>
<ul>
<li><a href="my_account.php?my_orders">My Orders</a></li>
<li><a href="my_account.php?edit_account">Edit Account</a></li>
<li><a href="my_account.php?change_pass">Change Password</a></li>
<li><a href="my_account.php?delete_account">Delete Account</a></li>
</ul>
</div>
</div>
<?php
Page | 45
Project Report for MyShop
$user = $_SESSION['customer_email'];
$get_img = "select * from customers where customer_email='$user'";
$run_img = mysqli_query($con, $get_img);
$row_img = mysqli_fetch_array($run_img);
$c_image = $row_img['customer_image'];
$c_name = $row_img['customer_name'];
$c_email = $row_img['customer_email'];
$c_cont = $row_img['customer_contact'];
$c_city = $row_img['customer_city'];
?>
<?php
if(!$_SESSION['customer_email']==''){
if(!isset($_GET['my_orders'])){
if(!isset($_GET['edit_account'])){
if(!isset($_GET['change_pass'])){
if(!isset($_GET['delete_account'])){
echo"
<p style=''><img src='Customers/customer_images/$c_image' width='100' height='130'/></p>
<h5><b>NAME:</b>$c_name</h5>
<h5><b>EMAIL:</b>$c_email</h5>
<h5><b>ADDRESS:</b>$c_cont</h5>
<h5><b>CITY:</b>$c_city</h5>";
}
else
echo "<img src='loginfirst.png' style='margin-left:170px; margin-top:15px;'>";
?>
<?php
if(isset($_GET['edit_account'])){
include("edit_account.php");
}
if(isset($_GET['change_pass'])){
include("change_pass.php");
}
if(isset($_GET['delete_account'])){
include("delete_account.php");
}
?>
Page | 46
Project Report for MyShop
</div>
</div>
<script src="JS/bootstrap.min.js"></script>
<script src="JS/jquery-2.1.4.min.js"></script>
</body>
</html>
<body>
Page | 47
Project Report for MyShop
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="index.php">
<img src="Images/Brandlogo3.png" />
</a>
</div>
<!-- Collect the nav links, forms, and other content for toggling -->
<div class="collapse navbar-collapse" id="collapse">
<ul class="nav navbar-nav">
<li>
<a href="all_products.php">All Products</a>
</li>
<li>
<a href="my_account.php">My Account</a>
</li>
<li>
<a href="customer_registration.php">Sign Up</a>
</li>
<li>
<a href="cart.php">Shopping Cart</a>
</li>
<li>
<a href="#">Contact Us</a>
</li>
</ul>
<!--Search-Bar-->
<form method="get" action="results.php" enctype="multipart/form-data"
class="navbar-form navbar-right" role="search">
<div class="form-group">
<input type="text" name="user_query" class="form-control input-sm"
placeholder="Search Products">
</div>
<button type="submit" name="search" class="btn btn-info btn-sm">Go</button>
</form>
<!--End-Search-Bar-->
</div>
<!-- /.navbar-collapse -->
</div>
<!-- /.container -->
</nav>
<hr />
<?php
cart();
?>
<div class="container">
Page | 48
Project Report for MyShop
<div class="row">
<div class="well pull-right">
Welcome :<span class="badge">
<?php
if(isset($_SESSION['customer_email'])){
echo $_SESSION['customer_email'];
}
else{
echo"Guest";
}
?>
</span>
 
Items : <span class="badge"><?php if(!$_SESSION['customer_email']=='') total_items();
else echo "N/A";?></span>
 
Cart Amount : <span class="badge"><?php if(!$_SESSION['customer_email']=='')
total_price(); else echo "N/A"; ?></span>
 
<a href="cart.php">Go To Cart</a>
<?php
if(!isset($_SESSION['customer_email'])){
echo "<a href='checkout.php'>Login</a>";
}
else{
echo "<a href='logout.php'>Logout</a>";
?>
Page | 49
Project Report for MyShop
</small>
</div>
</div>
</div>
<div class="container">
<div class="row">
<div class="col-xs-6 col-md-3">
<h3>CATEGORIES</h3>
<div class="list-group" id="cats">
<?php
getCats();
?>
</div>
<hr />
<h3>BRANDS</h3>
<div class="list-group" id="brands">
<?php
getBrands();
?>
</div>
</div>
Page | 50
Project Report for MyShop
</form>
</div>
</div>
</div>
</div>
</div>
</div>
<?php
if(isset($_POST['register'])){
$ip = getIp();
$c_name = $_POST['c_name'];
$c_email = $_POST['c_email'];
$c_pass = $_POST['c_pass'];
$c_country = $_POST['c_country'];
$c_city = $_POST['c_city'];
$c_cont = $_POST['c_cont'];
Page | 51
Project Report for MyShop
$c_img = $_FILES['c_img']['name'];
$c_img_tmp = $_FILES['c_img']['tmp_name'];
move_uploaded_file($c_img_tmp,"Customers/customer_images/$c_img");
$insert_c = "INSERT INTO `myshop`.`customers` (`customer_id`, `customer_ip`,
`customer_name`, `customer_email`, `customer_pass`, `customer_country`,
`customer_city`, `customer_contact`, `customer_image`) VALUES (NULL, '$ip',
'$c_name', '$c_email', '$c_pass', '$c_country', '$c_city', '$c_cont', '$c_img')";
$run_c = mysqli_query($con,$insert_c);
if($run_c){
$sel_cart = "select * from cart where ip_add='$ip'";
$run_cart = mysqli_query($con,$sel_cart);
$check_cart = mysqli_num_rows($run_cart);
if($check_cart==0){
$_SESSION['customer_email']=$c_email;
}
else{
$_SESSION['customer_email']=$c_email;
}
}
}
?>
<script src="JS/bootstrap.min.js"></script>
<script src="JS/jquery-2.1.4.min.js"></script>
</body>
</html>
Page | 52
Project Report for MyShop
<?php
include("Includes/db_1.php");
?>
<body>
<!-- Main page products-->
<div class="container" id="product_content">
<div class="row">
<div class="row">
<div class="col-md-6 col-lg-4">
<div class="">
<div class="caption">
<div class="container">
<div class="row">
<div class="col-sm-4 col-md-4 col-md-offset-2">
<h1 class="text-center login-title">Please Log In</h1>
Page | 53
Project Report for MyShop
</form>
<?php
if(isset($_POST['login'])){
$c_email = $_POST['email'];
$c_pass = $_POST['pass'];
$check_customer = mysqli_num_rows($run_c);
if($check_customer==0){
echo "<script>alert('Password or Email Do Not Match')</script>";
exit();
}
$ip = getIp();
}
else{
$_SESSION['customer_email']=$c_email;
}
}
?>
Page | 54
Project Report for MyShop
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<script src="JS/bootstrap.min.js"></script>
<script src="JS/jquery-2.1.4.min.js"></script>
</body>
</html>
Page | 55
Project Report for MyShop
<div class="form-group">
<label for="exampleInputnewPassword1">New Password</label>
<input type="password" class="form-control" id="new_pass" name="new_pass"
placeholder="" required>
</div>
<div class="form-group">
<label for="exampleInputnewagainPassword1">New Password Again</label>
<input type="password" class="form-control" id="new_pass_again"
name="new_pass_again" placeholder="" required>
<button type="submit" id="submit" name="change_password" class="btn btn-
info">Change Password</button>
</div>
</div>
<?php
include("Includes/db_1.php");
if(isset($_POST['change_password'])){
$user = $_SESSION['customer_email'];
$current_pass = $_POST['current_pass'];
$new_pass = $_POST['new_pass'];
$new_pass_again = $_POST['new_pass_again'];
$sel_pass = "select * from customers where customer_pass='$current_pass' AND
customer_email='$user'";
$run_pass = mysqli_query($con,$sel_pass);
$check_pass = mysqli_num_rows($run_pass);
if($check_pass==0){
echo "<script>alert('Your Currrent Password is Incorrect')</script>";
exit();
}
if($new_pass!=$new_pass_again){
echo"<script>alert('Passwords Do not Match')</script>";
exit();
}
else{
$update_pass = "update customers set customer_pass='$new_pass' where
customer_email='$user'";
$run_update = mysqli_query($con,$update_pass);
echo"<script>alert('Password Changed Successfully')</script>";
echo"<script>window.open('my_account.php','_self')</script>";
}
}
?>
<script src="JS/bootstrap.min.js"></script>
<script src="JS/jquery-2.1.4.min.js"></script>
</body>
</html>
Page | 56
Project Report for MyShop
<body>
Page | 57
Project Report for MyShop
?>
<div class="container">
Page | 58
Project Report for MyShop
<div class="row">
<div class="well pull-right">
Welcome :<span class="badge"> <?php if(isset($_SESSION['customer_email'])){
echo $_SESSION['customer_email'];
}
else{
echo"Guest";
}?></span>
 
Items : <span class="badge"><?php if(!$_SESSION['customer_email']=='') total_items();
else echo "N/A";?></span>
 
Cart Amount : <span class="badge"0><?php if(!$_SESSION['customer_email']=='')
total_price(); else echo "N/A"; ?></span>
 
<a href="cart.php">Go To Cart</a>
<?php
if(!isset($_SESSION['customer_email'])){
echo "<a href='checkout.php'>Login</a>";
}
else{
echo "<a href='logout.php'>Logout</a>";
}
?>
</small>
</div>
</div>
</div>
<hr />
<div class="container">
<div class="row">
Page | 59
Project Report for MyShop
</body>
</html>
Page | 60
Project Report for MyShop
<body>
<div class="col-md-4 of">
<h5 class="">Do you really want to delete your account ?</h5>
<form method="post" action="" enctype="multipart/form-data">
<button type="submit" id="submit" name="yes" class="btn btn-sm btn-info">Yes, I
do</button>
<button type="submit" id="submit" name="no" class="btn btn-sm btn-danger">No, I
don't</button>
</form>
</div>
<?php
include("Includes/db_1.php");
$user = $_SESSION['customer_email'];
if(isset($_POST['yes'])){
$delete_customer = "delete from customers where customer_email='$user'";
$run_customer = mysqli_query($con,$delete_customer);
if($run_customer==true){
$_SESSION['customer_email']=='';
Page | 61
Project Report for MyShop
session_destroy();
session_unset();
echo"<script>alert('Account has been Deleted')</script>";
echo"<script>window.open('index.php','_self')</script>" ;
}
}
if(isset($_POST['no'])){
echo"<script>alert('Thank You')</script>";
echo"<script>window.open('my_account.php','_self')</script>" ;
}
?>
<script src="JS/bootstrap.min.js"></script>
<script src="JS/jquery-2.1.4.min.js"></script>
</body>
</html>
<?php
error_reporting(0);
session_start();
include("Includes/db_1.php");
include("Functions/function.php");
?>
<!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=utf-8" />
<title>Online Store</title>
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="Styles/bootstrap.min.css">
Page | 62
Project Report for MyShop
}
#buttons{
margin:40px;
}
</style>
</head>
<body>
Page | 63
Project Report for MyShop
?>
<div class="container">
<div class="row">
<div class="well pull-right">
Welcome :<span class="badge">
<?php
if(isset($_SESSION['customer_email'])){
echo $_SESSION['customer_email'];
}
else{
echo"Guest";
}
?>
</span>
 
Items : <span class="badge"><?php if(!$_SESSION['customer_email']=='') total_items();
else echo "N/A";?></span>
 
Cart Amount : <span class="badge"><?php if(!$_SESSION['customer_email']=='')
total_price(); else echo "N/A"; ?></span>
Page | 64
Project Report for MyShop
 
<a href="cart.php">Go To Cart</a>
<?php
if(!isset($_SESSION['customer_email'])){
echo "<a href='checkout.php'>Login</a>";
}
else{
echo "<a href='logout.php'>Logout</a>";
}
?>
</small>
</div>
</div>
</div>
<hr />
<div class="container">
<div class="row">
<div class="col-xs-6 col-md-3">
<h3>CATEGORIES</h3>
<div class="list-group" id="cats">
<?php
getCats();
?>
</div>
<hr />
<h3>BRANDS</h3>
<div class="list-group" id="brands">
<?php
getBrands();
?>
</div>
</div>
Page | 65
Project Report for MyShop
$product_id = $_GET['pro_id'];
$pro_id = $row_pro['product_id'];
$pro_title = $row_pro['product_title'];
$pro_price = $row_pro['product_price'];
$pro_img = $row_pro['product_img1'];
$pro_desc = $row_pro['product_des'];
$pro_id = $row_pro['product_id'];
$pro_title = $row_pro['product_title'];
$pro_price = $row_pro['product_price'];
$pro_img = $row_pro['product_img1'];
Page | 66
Project Report for MyShop
$pro_desc = $row_pro['product_des'];
echo "
<div id='buttons'>
<h2>$pro_title</h2/>
<h5>Price :Rs $pro_price</h5>
<h4>$pro_desc</h4>
<a href='index.php'><button class='btn btn-xs btn-success'>Go to
Mainpage</button></a>
<a href='index.php?add_cart=$pro_id''><button class='btn btn-xs btn-
info'>Add to Cart</button></a>
</div>
</div>
";
}
}
?>
<script src="JS/bootstrap.min.js"></script>
<script src="JS/jquery-2.1.4.min.js"></script>
</body>
</html>
<?php
$user = $_SESSION['customer_email'];
$get_customer = "select * from customers where customer_email='$user'";
$run_customer = mysqli_query($con, $get_customer);
$row_customer = mysqli_fetch_array($run_customer);
$c_id = $row_customer['customer_id'];
$name = $row_customer['customer_name'];
$email = $row_customer['customer_email'];
$country = $row_customer['customer_country'];
$city = $row_customer['customer_city'];
$cont = $row_customer['customer_contact'];
$image = $row_customer['customer_image'];
Page | 67
Project Report for MyShop
?>
Page | 68
Project Report for MyShop
<label for="exampleInputPassword1">Contact</label>
<input type="text" class="form-control" id="c_cont" name="c_cont" value="<?php
echo $cont;?>" required>
</div>
move_uploaded_file($c_img_tmp,"Customers/customer_images/$c_img");
$update_c = "update customers set customer_name='$c_name',
customer_email='$c_email', customer_pass='$c_pass', customer_country='$c_country',
customer_city='$c_city', customer_contact='$c_cont', customer_image='$c_img' where
customer_id='$customer_id'";
$run_update= mysqli_query($con,$update_c);
if($run_update){
echo "<script>alert('Your account has been successfully updated')</script>";
echo "<script>window.open('my_account.php','_self')</script>";
}
}
?>
<script src="JS/bootstrap.min.js"></script>
<script src="JS/jquery-2.1.4.min.js"></script>
</body>
Page | 69
Project Report for MyShop
</html>
</body>
</html>
Page | 70
Project Report for MyShop
<?php
error_reporting(0);
session_start();
include("Includes/db_1.php");
include("Functions/function.php");
?>
<!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=utf-8" />
<title>Online Store</title>
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="Styles/bootstrap.min.css">
<!-- Optional theme -->
<link rel="stylesheet" href="Styles/bootstrap-theme.min.css">
<style>
#single_product{
float:left;
margin:20px;
margin-bottom:30px;
}
#buttons{
margin:40px;
}
</style>
</head>
<body>
<nav class="navbar navbar-inverse navbar-fixed-top" role="navigation">
<div class="container">
<!-- Brand and toggle get grouped for better mobile display -->
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-
target="collapse">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="index.php">
<img src="Images/Brandlogo3.png" />
</a>
Page | 71
Project Report for MyShop
</div>
<!-- Collect the nav links, forms, and other content for toggling -->
<div class="collapse navbar-collapse" id="collapse">
<ul class="nav navbar-nav">
<li>
<a href="all_products.php">All Products</a>
</li>
<li>
<a href="Customer/my_account.php">My Account</a>
</li>
<li>
<a href="#">Sign Up</a>
</li>
<li>
<a href="cart.php">Shopping Cart</a>
</li>
<li>
<a href="#">Contact Us</a>
</li>
</ul>
<!--Search-Bar-->
<form method="get" action="results.php" enctype="multipart/form-data"
class="navbar-form navbar-right" role="search">
<div class="form-group">
<input type="text" name="user_query" class="form-control input-sm"
placeholder="Search Products">
</div>
<button type="submit" name="search" class="btn btn-info btn-sm">Go</button>
</form>
<!--End-Search-Bar-->
</div>
<!-- /.navbar-collapse -->
</div>
<!-- /.container -->
</nav>
<hr />
<?php
cart();
?>
<div class="container">
<div class="row">
<div class="well pull-right">
Welcome :<span class="badge">
Page | 72
Project Report for MyShop
<?php
if(isset($_SESSION['customer_email'])){
echo $_SESSION['customer_email'];
}
else{
echo"Guest";
}
?>
</span>
 
Items : <span class="badge"><?php if(!$_SESSION['customer_email']=='') total_items();
else echo "N/A";?></span>
 
Cart Amount : <span class="badge"><?php if(!$_SESSION['customer_email']=='')
total_price(); else echo "N/A"; ?></span>
 
<a href="cart.php">Go To Cart</a>
<?php
if(!isset($_SESSION['customer_email'])){
echo "<a href='checkout.php'>Login</a>";
}
else{
echo "<a href='logout.php'>Logout</a>";
}
?>
</small>
</div>
</div>
</div>
<hr />
Page | 73
Project Report for MyShop
<div class="container">
<div class="row">
<div class="col-xs-6 col-md-3">
<h3>CATEGORIES</h3>
<div class="list-group" id="cats">
<?php
getCats();
?>
</div>
<hr />
<h3>BRANDS</h3>
<div class="list-group" id="brands">
<?php
getBrands();
?>
</div>
</div>
<!-- Main page products-->
<div class="container" id="product_content">
<div class="row">
<div class="row">
<div class="col-md-6 col-lg-4">
<div class="">
<div class="caption">
<?php
if(isset($_GET['search'])){
$search_query = $_GET['user_query'];
$pro_id = $row_pro['product_id'];
$pro_cat = $row_pro['cat_id'];
$pro_brand = $row_pro['brand_id'];
$pro_title = $row_pro['product_title'];
$pro_price = $row_pro['product_price'];
$pro_img = $row_pro['product_img1'];
Page | 74
Project Report for MyShop
}
}
?>
</div>
</div>
</div>
</div>
</div>
</div>
<script src="JS/bootstrap.min.js"></script>
<script src="JS/jquery-2.1.4.min.js"></script>
</body>
</html>
Page | 75
Project Report for MyShop
<?php
$con = mysqli_connect("localhost","root","","myshop");
if(mysqli_connect_errno())
{
echo "Failed to Connect MYSQL: ". mysqli_connect_error();
}
//Function to Get User IP Address
function getIp() {
$ip = $_SERVER['REMOTE_ADDR'];
if (!empty($_SERVER['HTTP_CLIENT_IP'])) {
$ip = $_SERVER['HTTP_CLIENT_IP'];
} elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) {
$ip = $_SERVER['HTTP_X_FORWARDED_FOR'];
}
return $ip;
}
//Function to add products to Cart
function cart(){
if(isset($_GET['add_cart'])){
global $con;
$ip = getIp();
$pro_id = $_GET['add_cart'];
$check_pro = "select * from cart where ip_add='$ip' AND p_id='$pro_id'";
$run_check = mysqli_query($con, $check_pro);
if(mysqli_num_rows($run_check)>0){
echo "<script>alert('PRODUCT ALREADY ADDED')</script>";
}
else{
$insert_pro = "insert into cart (p_id,ip_add) values ('$pro_id','$ip')";
$run_pro = mysqli_query($con, $insert_pro);
echo "<script>window.open('index.php ','_self')</script>";
}
}
}
//Geting total Items in Cart
function total_items(){
if(isset($_GET['add_cart'])){
global $con;
$ip = getIp();
$get_items = "select * from cart where ip_add='$ip'";
$run_items = mysqli_query($con,$get_items);
Page | 76
Project Report for MyShop
$count_items = mysqli_num_rows($run_items);
}
else {
global $con;
$ip = getIp();
$get_items = "select * from cart where ip_add='$ip'";
$run_items = mysqli_query($con,$get_items);
$count_items = mysqli_num_rows($run_items);
}
echo $count_items;
}
//Function to get total price of items
function total_price(){
$total=0;
global $con;
$ip = getIp();
$sel_price = "select * from cart where ip_add='$ip'";
$run_price = mysqli_query($con,$sel_price);
while($p_price=mysqli_fetch_array($run_price)){
$pro_id = $p_price['p_id'];
$pro_price = "select * from products where product_id='$pro_id'";
$run_pro_price = mysqli_query($con,$pro_price);
while($pp_price = mysqli_fetch_array($run_pro_price)){
$product_price = array($pp_price['product_price']);
$values = array_sum($product_price);
$total +=$values;
}
}
echo " Rs. ". $total;
}
//Function to get dynamic categories
function getCats(){
global $con;
$get_cats = "select * from categories";
$run_cats = mysqli_query($con, $get_cats);
while($row_cats=mysqli_fetch_array($run_cats))
{
$cat_id = $row_cats['cat_id'];
$cat_title = $row_cats['cat_title'];
echo "<a href='index.php?cat=$cat_id' class='list-group-item'>$cat_title</a>";
}
}
//Function to get dynamic Brands
Page | 77
Project Report for MyShop
function getBrands(){
global $con;
$get_brands = "select * from brands";
$run_brands = mysqli_query($con, $get_brands);
while($row_brands=mysqli_fetch_array($run_brands)){
$brand_id = $row_brands['brand_id'];
$brand_title = $row_brands['brand_title'];
echo "<a href='index.php?brand=$brand_id' class='list-group-item'>$brand_title</a>";
}
}
//Function to get products on mainpage
function getPro(){
if(!isset($_GET['cat'])){
if(!isset($_GET['brand'])){
global $con;
$pro_id = $row_pro['product_id'];
$pro_cat = $row_pro['cat_id'];
$pro_brand = $row_pro['brand_id'];
$pro_title = $row_pro['product_title'];
$pro_price = $row_pro['product_price'];
$pro_img = $row_pro['product_img1'];
Page | 78
Project Report for MyShop
}
}
//Function to get category wise products
function getCatPro(){
if(isset($_GET['cat'])){
$cat_id = $_GET['cat'];
global $con;
$pro_id = $row_cat_pro['product_id'];
$pro_cat = $row_cat_pro['cat_id'];
$pro_brand = $row_cat_pro['brand_id'];
$pro_title = $row_cat_pro['product_title'];
$pro_price = $row_cat_pro['product_price'];
$pro_img = $row_cat_pro['product_img1'];
}
}
}
//function to get brand wise products
function getBrandPro(){
if(isset($_GET['brand'])){
$brand_id = $_GET['brand'];
global $con;
Page | 79
Project Report for MyShop
$pro_id = $row_brand_pro['product_id'];
$pro_cat = $row_brand_pro['cat_id'];
$pro_brand = $row_brand_pro['brand_id'];
$pro_title = $row_brand_pro['product_title'];
$pro_price = $row_brand_pro['product_price'];
$pro_img = $row_brand_pro['product_img1'];
}
}
?>
}
else{
?>
Page | 80
Project Report for MyShop
}
#right{
width:250px;
height:600px;
Page | 81
Project Report for MyShop
background:
#FC6;
float:right;
border:2px groove black;
}
</style>
</head>
<body>
<!-- Admin Controls -->
<div class="main_wrapper" align="center">
<div id="navbar">
<nav class="navbar navbar-inverse" role="navigation">
<div class="container-fluid">
<div class="navbar-header">
<a class="navbar-brand" href="index.php">
<img alt="Brand" src="Brandlogo_ADMIN.png" />
</a>
</div>
</div>
</nav>
</div>
<div id="right">
<h3 style="text-align:center">ADMIN CONTROLS</h3>
ADMIN: <span class="badge">
<?php
if(isset($_SESSION['user_email'])){
echo $_SESSION['user_email'];
}
?>
</span><br /><br />
<b><a href="logout.php">LOGOUT</a></b>
<ul class="list-group well-sm">
<a href="index.php" class="list-group-item">HOME</a>
<a href="index.php?insert_product" class="list-group-item">INSERT NEW PRODUCT</a>
<a href="index.php?view_products" class="list-group-item">VIEW ALL PRODUCTS</a>
<a href="index.php?insert_cat" class="list-group-item">INSERT NEW CATEGORIES</a>
<a href="index.php?view_cats" class="list-group-item">VIEW ALL CATEGORIES</a>
<a href="index.php?insert_brand" class="list-group-item">INSERT NEW BRAND</a>
<a href="index.php?view_brands" class="list-group-item">VIEW ALL BRANDS</a>
<a href="index.php?view_customers" class="list-group-item">VIEW CUSTOMERS</a>
<a href="index.php?view_orders" class="list-group-item disabled">VIEW ORDERS</a>
Page | 82
Project Report for MyShop
</ul>
</div>
<div id="left">
<?php
if(isset($_GET['insert_product'])){
include("insert_product_main.php");
if(isset($_GET['view_products'])){
include("view_products.php");
if(isset($_GET['edit_pro'])){
include("edit_pro.php");
if(isset($_GET['insert_cat'])){
include("insert_cat.php");
if(isset($_GET['view_cats'])){
include("view_cats.php");
if(isset($_GET['edit_cat'])){
include("edit_cat.php");
}
if(isset($_GET['insert_brand'])){
include("insert_brand.php");
if(isset($_GET['view_brands'])){
Page | 83
Project Report for MyShop
include("view_brands.php");
if(isset($_GET['edit_brand'])){
include("edit_brand.php");
if(isset($_GET['view_customers'])){
include("view_customers.php");
?>
</div>
</div>
<script src="JS/bootstrap.min.js"></script>
<script src="JS/jquery-2.1.4.min.js"></script>
</body>
</html><?php }?>
<?php
include("Includes/db_1.php");
include("Includes/function.php");
?>
<!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=utf-8" />
<title>Insert Product</title>
<link rel="stylesheet" href="Styles/bootstrap.min.css" />
<link rel="stylesheet" href="Styles/bootstrap-theme.min.css" />
</head>
<body>
Page | 84
Project Report for MyShop
<div class="container">
<div class="row">
<div class="pull-left col-md-6">
<table width="1000" height="550" align="left" border="0px" class="table table-bordered table-
condensed">
<tr>
<td>
<b>Product Title</b></td>
<td><input type="text" name="product_title" /></td>
</tr>
<tr>
<td><b>Product Category</b></td>
<td>
<select name="product_cat">
<option>Select Category</option>
<?php
$get_cats = "select * from categories";
$run_cats = mysqli_query($con, $get_cats);
while($row_cats=mysqli_fetch_array($run_cats)){
$cat_id = $row_cats['cat_id'];
$cat_title = $row_cats['cat_title'];
<tr>
<td><b>Product Brand</b></td>
<td>
<select name="product_brand">
<option>Select Brand</option>
<?php
$get_brands = "select * from brands";
$run_brands = mysqli_query($con, $get_brands);
while($row_brands=mysqli_fetch_array($run_brands)){
$brand_id = $row_brands['brand_id'];
$brand_title = $row_brands['brand_title'];
Page | 85
Project Report for MyShop
<tr>
<td><b>Product Image 1</b></td>
<td><input type="file" name="product_img1" /></td>
</tr>
<tr>
<td><b>Product Image 2</b></td>
<td><input type="file" name="product_img2" /></td>
</tr>
<tr>
<td><b>Product Image 3</b></td>
<td><input type="file" name="product_img3" /></td>
</tr>
<tr>
<td><b>Product Price</b></td>
<td><input type="text" name="product_price" /></td>
</tr>
<tr>
<td><b>Product Description</b></td>
<td><textarea name="product_des" cols="20" rows="10"></textarea></td>
</tr>
<tr>
<td><b>Product Keyword</b></td>
<td><input type="text" name="product_keyword" /></td>
</tr>
<tr align="center">
<td colspan="2"><input type="submit" name="insert_product" value="Insert Product" /></td>
</tr>
</table>
</div>
</div>
Page | 86
Project Report for MyShop
</div>
</form>
</body>
</html>
<?php
if(isset($_POST['insert_product'])){
$product_title = $_POST['product_title'];
$product_cat = $_POST['product_cat'];
$product_brand = $_POST['product_brand'];
$product_price = $_POST['product_price'];
$product_desc = $_POST['product_des'];
$status = 'on';
$product_keyword = $_POST['product_keyword'];
//Image Variables
$product_img1 = $_FILES['product_img1']['name'];
$product_img2 = $_FILES['product_img2']['name'];
$product_img3 = $_FILES['product_img3']['name'];
$temp_name1 = $_FILES['product_img1']['tmp_name'];
$temp_name2 = $_FILES['product_img2']['tmp_name'];
$temp_name3 = $_FILES['product_img3']['tmp_name'];
Page | 87
Project Report for MyShop
$run_product = mysqli_query($con,$insert_product);
if($run_product){
echo "<script>alert('Product Inserted Successfully')</script>";
echo "<script>window.open('index.php?insert_product','_self')</script>";
}
}
}
?>
$new_brand = $_POST['new_brand'];
$insert_brand = "INSERT INTO `myshop`.`brands` (`brand_id`, `brand_title`) VALUES
(NULL, '$new_brand');";
$run_brand = mysqli_query($con, $insert_brand);
if($run_brand){
Page | 88
Project Report for MyShop
?>
<script src="JS/bootstrap.min.js"></script>
<script src="JS/jquery-2.1.4.min.js"></script>
</body>
</html>
<?php
include("Includes/db_1.php");
if(isset($_POST['add_cat'])){
$new_cat = $_POST['new_cat'];
Page | 89
Project Report for MyShop
if($run_cat){
echo "<script>alert('New Category has been Inserted')</script>";
echo "<script>window.open('index.php?view_cats','_self')</script>";
}
}
?>
<script src="JS/bootstrap.min.js"></script>
<script src="JS/jquery-2.1.4.min.js"></script>
</body>
</html>
<?php
include("Includes/db_1.php");
if(isset($_GET['delete_brand'])){
$delete_id = $_GET['delete_brand'];
if($run_delete){
echo "<script>alert('The Brand Has Been Deleted')</script>";
echo "<script>window.open('index.php?view_brands','_self')</script>";
?>
<?php
Page | 90
Project Report for MyShop
include("Includes/db_1.php");
if(isset($_GET['delete_c'])){
$delete_id = $_GET['delete_c'];
if($run_delete){
echo "<script>alert('The Customer Has Been Deleted')</script>";
echo "<script>window.open('index.php?view_customers','_self')</script>";
}
}
?>
<?php
include("Includes/db_1.php");
if(isset($_GET['delete_cat'])){
$delete_id = $_GET['delete_cat'];
if($run_delete){
echo "<script>alert('The Category Has Been Deleted')</script>";
echo "<script>window.open('index.php?view_cats','_self')</script>";
}
}
?>
Page | 91
Project Report for MyShop
<?php
include("Includes/db_1.php");
if(isset($_GET['edit_brand'])){
$brand_id = $_GET['edit_brand'];
$get_brand = "select * from brands where brand_id='$brand_id'";
$run_brand = mysqli_query($con, $get_brand);
$row_brand = mysqli_fetch_array($run_brand);
$brand_id = $row_brand['brand_id'];
$brand_title = $row_brand['brand_title'];
}
?>
<!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=utf-8" />
<title>Edit Brands</title>
<link rel="stylesheet" href="Styles/bootstrap.min.css" />
<link rel="stylesheet" href="Styles/bootstrap-theme.min.css" />
</head>
<body>
<h3>EDIT BRANDS</h3>
<form method="post" action="" style="padding-left:360px;">
<div class="col-lg-6 alert alert-info">
<div class="input-group">
<input type="text" name="new_brand" class="form-control" value="<?php echo
$brand_title; ?>" required="required">
<span class="input-group-btn">
<button class="btn btn-default" type="submit"
name="update_brand">Update</button>
</span>
</div>
</div>
</form>
<?php
if(isset($_POST['update_brand'])){
$update_id = $brand_id;
$new_brand = $_POST['new_brand'];
Page | 92
Project Report for MyShop
?>
<script src="JS/bootstrap.min.js"></script>
<script src="JS/jquery-2.1.4.min.js"></script>
</body>
</html>
<?php
include("Includes/db_1.php");
if(isset($_GET['edit_cat'])){
$cat_id = $_GET['edit_cat'];
$get_cat = "select * from categories where cat_id='$cat_id'";
$run_cat = mysqli_query($con, $get_cat);
$row_cat = mysqli_fetch_array($run_cat);
$cat_id = $row_cat['cat_id'];
$cat_title = $row_cat['cat_title'];
}
?>
<!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=utf-8" />
<title>View Products</title>
<link rel="stylesheet" href="Styles/bootstrap.min.css" />
<link rel="stylesheet" href="Styles/bootstrap-theme.min.css" />
</head>
<body>
Page | 93
Project Report for MyShop
<h3>EDIT CATEGORY</h3>
<form method="post" action="" style="padding-left:360px;">
<div class="col-lg-6 alert alert-info">
<div class="input-group">
<input type="text" name="new_cat" class="form-control" value="<?php echo $cat_title; ?>"
required="required">
<span class="input-group-btn">
<button class="btn btn-default" type="submit" name="update_cat">Update</button>
</span>
</div>
</div>
</form>
<?php
if(isset($_POST['update_cat'])){
$update_id = $cat_id;
$new_cat = $_POST['new_cat'];
$update_cat = "update categories set cat_title='$new_cat' where cat_id='$update_id'";
$run_cat = mysqli_query($con, $update_cat);
if($run_cat){
echo "<script>alert('The Category has been Updated')</script>";
echo "<script>window.open('index.php?view_cats','_self')</script>";
}
}
?>
<script src="JS/bootstrap.min.js"></script>
<script src="JS/jquery-2.1.4.min.js"></script>
</body>
</html>
<?php
include("Includes/db_1.php");
include("Includes/function.php");
if(isset($_GET['edit_pro'])){
$get_id = $_GET['edit_pro'];
$get_pro = "select * from products where product_id='$get_id'";
$run_pro = mysqli_query($con,$get_pro);
$i=0;
$row_pro=mysqli_fetch_array($run_pro);
$pro_id = $row_pro['product_id'];
$pro_title = $row_pro['product_title'];
Page | 94
Project Report for MyShop
$pro_image = $row_pro['product_img1'];
$pro_price = $row_pro['product_price'];
$pro_des = $row_pro['product_des'];
$pro_keyword = $row_pro['product_keyword'];
$pro_cat = $row_pro['cat_id'];
$pro_brand = $row_pro['brand_id'];
$get_cat = "select * from categories where cat_id='$pro_cat'";
$run_cat=mysqli_query($con,$get_cat);
$row_cat=mysqli_fetch_array($run_cat);
$category_title = $row_cat['cat_title'];
$get_brand = "select * from brands where brand_id='$pro_brand'";
$run_brand=mysqli_query($con,$get_brand);
$row_brand=mysqli_fetch_array($run_brand);
$brand_title = $row_brand['brand_title'];
}
?>
<!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=utf-8" />
<title>Edit Products</title>
<link rel="stylesheet" href="Styles/bootstrap.min.css" />
<link rel="stylesheet" href="Styles/bootstrap-theme.min.css" />
</head>
<body>
<form method="post" action="" enctype="multipart/form-data">
<div class="container">
<div class="row">
<div class="pull-left col-md-6">
<table width="1000" height="550" align="left" border="0px" class="table table-bordered table-
condensed">
<tr>
<td>
<b>Product Title</b></td>
<td><input type="text" name="product_title" value="<?php echo $pro_title; ?>" /></td>
</tr>
<tr>
<td><b>Product Category</b></td>
<td>
<select name="product_cat">
<option><?php echo $category_title; ?></option>
<?php
$get_cats = "select * from categories";
Page | 95
Project Report for MyShop
Page | 96
Project Report for MyShop
<tr>
<td><b>Product Description</b></td>
<td><textarea name="product_des" cols="20" rows="10" /><?php echo $pro_des; ?>
</textarea></td>
</tr>
<tr>
<td><b>Product Keyword</b></td>
<td><input type="text" name="product_keyword" value="<?php echo $pro_keyword; ?>"
/></td>
</tr>
<tr align="center">
<td colspan="2"><input type="submit" name="update_product" value="Update Product"
/></td>
</tr>
</table>
</div>
</div>
</div>
</form>
</body>
</html>
<?php
if(isset($_POST['update_product'])){
//Text Field Variables
$update_id = $pro_id;
$product_title = $_POST['product_title'];
$product_cat = $_POST['product_cat'];
$product_brand = $_POST['product_brand'];
$product_price = $_POST['product_price'];
$product_desc = $_POST['product_des'];
$status = 'on';
$product_keyword = $_POST['product_keyword'];
//Image Variables
$product_img1 = $_FILES['product_img1']['name'];
$product_img2 = $_FILES['product_img2']['name'];
$product_img3 = $_FILES['product_img3']['name'];
Page | 97
Project Report for MyShop
if($product_title=='')
{
echo "<script>alert('PLEASE FILL ALL FIELDS')</script>";
}
else{
//Uploading Images
move_uploaded_file($temp_name1,"product_images/$product_img1");
move_uploaded_file($temp_name2,"product_images/$product_img2");
move_uploaded_file($temp_name3,"product_images/$product_img3");
$update_product = "update products set
cat_id='$product_cat',brand_id='$product_brand',product_title='$product_title',product_price
='$product_price',product_des='$product_des',product_img1='$product_img1',product_keywo
rd='$product_keyword' where product_id='$update_id'" ;
$run_product = mysqli_query($con, $update_product);
if($run_product){
echo "<script>alert('Product Updated Successfully')</script>";
echo "<script>window.open('index.php?view_products','_self')</script>";
}
}
}
?>
<?php
session_start();
?>
<!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=utf-8" />
<title>Admin Login</title>
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="Styles/bootstrap.min.css">
<!-- Optional theme -->
<link rel="stylesheet" href="Styles/bootstrap-theme.min.css">
<style>
body{
background-image:url(background.png);
}
Page | 98
Project Report for MyShop
</style>
</head>
<body>
<div id=""
<div class="container" style="margin-left:190px; margin-top:50px;">
<div class="row">
<div class="col-md-4 col-md-offset-3">
<form class="form-signin" action="login.php" method="post">
<h3 style="color:red; text-align:center;"><?php echo @$_GET['not_admin']; ?></h3>
<h3 style="color:red; text-align:center;"><?php echo @$_GET['logged_out'];
?></h3>
<h2 class="form-signin-heading" align="center">ADMIN LOGIN</h2>
<label for="inputEmail" class="sr-only">Email address</label>
<input type="email" id="inputEmail" name="email" class="form-control"
placeholder="Email address" required autofocus>
<label for="inputPassword" class="sr-only">Password</label>
<input type="password" id="inputPassword" name="pass" class="form-control"
placeholder="Password" required>
<div class="checkbox">
</div>
<button class="btn btn-lg btn-primary btn-block" type="submit" name="login">Log
In</button>
</form>
</div>
</div>
</div> <!-- /container -->
<script src="JS/bootstrap.min.js"></script>
<script src="JS/jquery-2.1.4.min.js"></script>
</body>
</html>
<?php
include("Includes/db_1.php");
if(isset($_POST['login'])){
$email = mysql_real_escape_string($_POST['email']);
$pass = mysql_real_escape_string($_POST['pass']);
if($check_user==0){
Page | 99
Project Report for MyShop
}
else{
$_SESSION['user_email']=$email;
echo "<script>alert('Admin Logged In Successfully ')</script>";
echo "<script>window.open('index.php?logged_in','_self')</script>";
}
}
?>
<?php
session_start();
session_destroy();
echo "<script>window.open('login.php?logged_out=You Have Logged
Out','_self')</script>";
?>
<body>
<table width="1000" align="center" border="" class="table table-bordered table-
condensed">
<tr align="center">
<td colspan="6"><h3 align="center">AVAILABLE BRANDS</h3></td>
</tr>
<tr align="center">
Page | 100
Project Report for MyShop
<th>BRAND ID</th>
<th>BRAND TITLE</th>
<th>EDIT</th>
<th>DELETE</th>
</tr>
<?php
include("Includes/db_1.php");
$get_brand = "select * from brands";
$run_brand = mysqli_query($con,$get_brand);
$i=0;
while ($row_brand=mysqli_fetch_array($run_brand)){
$brand_id = $row_brand['brand_id'];
$brand_title = $row_brand['brand_title'];
$i++;
?>
<tr>
<body>
Page | 101
Project Report for MyShop
Page | 102
Project Report for MyShop
</head>
<body>
<table width="1000" align="center" border="" class="table table-bordered table-
condensed">
<tr align="center">
<td colspan="6"><h3 align="center">REGISTERED CUSTOMERS</h3></td>
</tr>
<tr align="center">
<th>CUSTOMER ID</th>
<th>CUSTOMER NAME</th>
<th>CUSTOMER EMAIL</th>
<th>CUSTOMER IMAGE</th>
<th>DELETE</th>
</tr>
<?php
include("Includes/db_1.php");
$get_customer = "select * from customers";
$run_customer = mysqli_query($con,$get_customer);
$i=0;
while ($row_customer=mysqli_fetch_array($run_customer)){
$customer_id = $row_customer['customer_id'];
$customer_name = $row_customer['customer_name'];
$customer_email = $row_customer['customer_email'];
$customer_image = $row_customer['customer_image'];
$i++;
?>
<tr>
<td><?php echo $i; ?></td>
<td><?php echo $customer_name; ?></td>
<td><?php echo $customer_email; ?></td>
<td><img src="../Customers/customer_images/<?php echo $customer_image; ?>"
width="40" height="50" /></td>
<td><a href="delete_c.php?delete_c=<?php echo $customer_id; ?>">Delete</a></td>
</tr>
<?php }?>
</table>
</body>
</html>
Page | 103
Project Report for MyShop
Page | 104
Project Report for MyShop
Error Handling:
Error handling has been implemented for both client and server sides. Client side error
handling has been done with the help of javascript and server side errors are handled by
php.
Validation Checks:
Validation checks has been implemented for both client and server sides.
TESTING
Test Case Design and Test Reports:
Functional testing is a quality assurance (QA) process and a type of black-box testing that bases
its test cases on the specifications of the software component under test. Functions are tested
by feeding them input and examining the output, and internal program structure is rarely
considered (not like in white-box testing). Functional testing usually describes what the system
does.
Functional testing does not imply that you are testing a function (method) of your module or
class. Functional testing tests a slice of functionality of the whole system.
Functional testing typically involves six steps.
Page | 105
Project Report for MyShop
Page | 106
Project Report for MyShop
Page | 107
Project Report for MyShop
Test Reports:
Page | 108
Project Report for MyShop
Page | 109
Project Report for MyShop
Result Passed
Page | 110
Project Report for MyShop
Result Passed
The following section contains all the Input and Output screenshots of the Online Store.
a) Registration page.
b) Login Page.
c) User Password Change.
d) Adding same product to cart.
e) Admin panel login.
f) Inserting New Product
g) Inserting New Brand.
h) Inserting New Category
Registration Page:
Page | 111
Project Report for MyShop
Login Page:
Page | 112
Project Report for MyShop
Page | 113
Project Report for MyShop
Page | 114
Project Report for MyShop
Page | 115
Project Report for MyShop
Page | 116
Project Report for MyShop
Page | 117
Project Report for MyShop
Page | 118
Project Report for MyShop
Database/Data Security:
Database and data security has been achieved by creating diferent roles for the users.
The users are not authorized to view or modify another user’s data.
The following are the security requirements which are being considered:
a) Every user has unique customer_id and password.
b) Any user, if provides incorrect email or password will be notified.
c) Session tracking has been implemented.
d) Administrator has the right to modify or delete any unwanted content from the
website including users.
The users of this system are divided into 2 groups. Admins and Users/Customers.
The admin or the administrator plays the role of managing and viewing entire
contents of the website.
The users can only perform functions such as browsing, purchasing and creating
accounts. They will not have the right to modify any type of content on the website.
Page | 119
Project Report for MyShop
1. Further Enhancements:
The following features can be added to the system for enhancing its performance:
2. Future Scope:
This system can be implemented and used by business organisations who are willing
to sell their products online. Nowadays most of the domestic and international
companies are selling products online due to its advantages. Online stores are cheap
to set up and requires very less man power compared to big malls and shops.
Inventory can be easily maintained and managed by a few back-end administrators.
This system can also be used in small organisations like institutes, offices, hospitals
etc. to place orders for office items from their personal stores or warehouses and
can be used by any employee of the organisation.
Page | 120
Project Report for MyShop
Page | 121