Professional Documents
Culture Documents
Mom's Choice Website
Mom's Choice Website
Mom's Choice Website
PURULIA
A Project submitted in
partial fulfillment of the
requirement for the
Honours Degree of
Bachelor of Computer
Application
Mom’s Choice
Paper Code: BBCACCHS602
Year of Examination: 2021-2022
6thSEMESTER
Submitted By
Nurjahan Khatun
Roll - 120661 No – 1915491
Reg. No. - 013671 of 2019-2020
Of
RAGHUNATHPUR COLLEGE
Page | 1
We express our special thanks of gratitude to our project guide Mr.Sougata Mukherjee
and Mrs. Sanchita Banerjee, professor of BCA department in Raghunathpur College. We also
express our special thanks to our Principal Dr. Phalguni Mukhopadhyay who gave us the
golden opportunity to do this project on the topic Moms Choice. Which help us in doing lot
of research and we come to know about many new things so we are very thankful to them.
We deeply appreciate our acknowledgement to Mr. Sougata Mukherjee and Mrs. Sanchita
Banerjee professors for their support and help for the development of the project.
I am very thankful for the open–handed support extended by many people. While no
list would be complete, it is my pleasure to acknowledge the assistance of my friends who
provided encouragement, knowledge and constructive suggestions.
Date:
________________
Nurjahan Khatun
___________________
Sanchayeta Nandi
____________________
Mili Karmakar
Page | 2
This is to certify that the project entitled “Mom’s Choice” is done by me, and it is
authentic work carried out for the partial fulfillment of the requirements for the degree of
BCA under the guidance of Mr. Sougata Mukharjee. I also certify that that I am aware of
the “BCA PROJECT, SIDHO-KANHO-BIRSHA UNIVERSITY, PURULIA” issued by
Sidho-Kanho-Birsha university, Purulia and this project report is based on that standard. The
matter embodies in this project has not submitted earlier for award of any degree or diploma
to the best of my knowledge and belief.
Sanchayeta Nandi
Roll: 120661 No:1915498
Registration No:013678 of 2019-2020
Raghunathpur College, Purulia
Page | 3
This is to certify that the project entitled “Mom’s Choice” is done by me, and it is
authentic work carried out for the partial fulfillment of the requirements for the degree of
BCA under the guidance of Mr. Sougata Mukharjee. I also certify that that I am aware of
the “BCA PROJECT, SIDHO-KANHO-BIRSHA UNIVERSITY, PURULIA” issued by
Sidho-Kanho-Birsha university, Purulia and this project report is based on that standard. The
matter embodies in this project has not submitted earlier for award of any degree or diploma
to the best of my knowledge and belief.
Nurjahan Khatun
Roll: 120661 No:1915491
Registration No:013671 of 2019-2020
Raghunathpur College, Purulia
Page | 4
This is to certify that the project entitled “Mom’s Choice” is done by me, and it is
authentic work carried out for the partial fulfillment of the requirements for the degree of
BCA under the guidance of Mr. Sougata Mukharjee. I also certify that that I am aware of
the “BCA PROJECT, SIDHO-KANHO-BIRSHA UNIVERSITY, PURULIA” issued by
Sidho-Kanho-Birsha university, Purulia and this project report is based on that standard. The
matter embodies in this project has not submitted earlier for award of any degree or diploma
to the best of my knowledge and belief.
Mili karmakar
Roll: 120661 No:1915490
Registration No:013670 of 2019-2020
Raghunathpur College, Purulia
Page | 5
Our “Mom’s Choice” website is a shopping system with full source code of online
shopping ordering system. This website has been developed to override the problems
prevailing in the practicing manual system.
INTRODUCTION:
In fast pace of time today everyone is squeeze for time people want to easily
shopping without going to shop. The software has ability to host allow a user to maintain the
online shopping system. In the online grocery shop to provide many facilities like home
delivery at the time, debit card/credit card/net banking/cash on delivery payments system,
add cart or remove etc. Basically this website is designed to enable customer to order the
groceries they need from home through this online website.
User Modules:
People can easily get their daily needs grocery items by using this online grocery
shopping website.
Page | 6
Chapter Contents Page No.
No.
1. INTRODUCTION
8-14
1.1 Motivation
1.2 Aim of Software
1.3 Benefits
1.4Theoretical Background
2. OBJECTIVES
3. IMPLEMENTATION
22-23
Scope of the Project
4. SYSTEM DESIGN
4.1 Entity Relationship Diagram(ERD) 24-31
4.2 Data Flow Diagram(DFD)
4.3 Table Design
5. Coding 32-39
6. Snapshots of the Project 40-43
7. Conclusion 44
8. Future Scope 45
9. Bibliography 46
Page | 7
CHAPTER 1
Now a days, shopping online is occupying an essential part of shopping, big and
small companies or stores need to have its commercial website ,any serious business can`t be
improved and reaches all over the world unless it has web site, even most families, clubs and
pet snakes do, too.
Having a web site gives people around the world opportunity to know your
business or provided services. It can spread your business so fast, therefore you can achieve
success. It’s easier for everyone to do shopping online and buy what needed without moving
from their home. Also another reason let people buy online, is that one line grocery stores
have a wider range of products and various kinds of the same products whereas the online
ones don`t have.
The “MOMS CHOICE PEOJECT” has been developed to override the problems
prevailing in the practicing manual system. This software is supported eliminate and in
some cases reduce the hardships faced by this existing system. Moreover this system is
designed for the particular need of the company carry out operations in a smooth and
effective manner.
This application is reduced as much as possible to avoid errors while entering the
data. It also provides error message while entering invalid data. No formal knowledge
is needed for the user to use this system. Thus by this all it proves it is user-friendly,
Moms Choice management system as described above, can lead to error free, secure,
reliable and fast management system. It can assist the user to concentrate on their other
activities rather to concentrate on record keeping. Thus it will help organization in
better utilization of resources.
Page | 8
1.1 MOTIVATION
Technology today has made the overall shopping experience easier and
convenient for many consumers. The online shopping experience is also improving based on
the continual technology advancements in the industry. For example, consumers today opt to
look to shop online whenever possible. They do so because they are now able to do much
more research on the products they are looking at before buying. Consumers also can look at
many different websites to compare costs before making a purchasing decision without
having to leave the convenience of their home. This provides the customers with better
knowledge of the products being purchased as well as providing them to potentially get the
best deal with relatively lost time investment. Compare that to a customer having to drive
from store to store looking for the best deal.
Page | 9
1.4 THEORETICAL BACKGROUND
HTML:
Hypertext markup language (HTML) is a Hypertext markup language, the
standard markup language for documents designed to displayed and viewed on the online
during a browser also helps to create the structure of the web page. because it is a markup
language, it consists of many tags. There are tags to display text, tables, ordered lists and
unordered lists, etc. There are two main sections on the HTML page: head and body
section. The data that describes the page also termed as metadata is inside the head section
while the body section includes all the tags that are necessary to represent the visible
content of the web page HTML is a platform-independent language so that can be made in
use in any platform like Windows, Linux, Macintosh, etc.
There are various HTML versions. The newest version is HTML 5. it’s more advanced
features like Geo-location, native audio, and video support, Canvas, web socket, etc.
Usually, HTML is a simple language to find out and use. A programmer can create an
HTML file employing a simple text editor and execute it employing a browser.
Advantages of HTML:
HTML helps to build structure of a website and is a widely used Markup language.
It is easy to learn.
Every browser supports HTML Language.
HTML is light weighted and fast to load.
Storage of big files are allowed because of the application cache feature.
Do not get to purchase any extra software because it’s by default in every window.
Loose syntax (although, being too flexible won’t suit standards).
HTML is simple to edit as being a plain text.
It integrates easily with other languages such as JavaScript, CSS etc.
HTML is that it is easy to code even for novice programmers.
HTML also allows the utilization of templates, which makes designing a webpage easy.
It is fast to download as the text is compressible.
Very useful for beginners in the web designing field.
Page | 10
CSS:
Cascading Style Sheets, fondly referred to as CSS, is a simply designed language
intended to simplify the process of making web pages presentable. CSS allows you to apply
styles to web pages. More importantly, CSS enables you to do this independent of the
HTML that makes up each web page. It describes how a webpage should look: it prescribes
colors, fonts, spacing, and much more. In short, you can make your website look however
you want. CSS lets developers and designers define how it behaves, including how
elements are positioned in the browser.
Cascading Style Sheets (CSS): CSS is defined as a method sheet language that
provides web designers control over how an internet site communicates with web browsers
including the formatting and display of their HTML documents.
CSS or cascading sheet may be a text-based coding language that specifies the website
formats and the way a site communicates with web browsers. The language allows web
developers to regulate various style elements and functionalities, like layout, color, fonts,
and therefore the formatting and display of HTML documents.
The main goal (as a method sheet language) was to separate document content
from document presentation, which incorporates style elements, like color, layout, and
fonts. CSS handles the design and feel a part of an internet page. Using CSS, you will
control the color of the text, the design of fonts, the spacing between paragraphs, how
columns are sized and laid out, etc.
CSS instructs the display of the HTML on how the web site will display at the
user’s end. Let us have a glance on the benefits and drawbacks of CSS.
Advantages of CSS:
CSS plays an important role, by using CSS you simply got to specify a repeated style for
element once & use it multiple times as because CSS will automatically apply the
required styles.
The main advantage of CSS is that style is applied consistently across variety of sites.
One instruction can control several areas which is advantageous.
Web designers needs to use few lines of programming for every page improving site
speed.
Cascading sheet not only simplifies website development, but also simplifies the
maintenance as a change of one line of code affects the whole web site and maintenance
time.
It helps to form spontaneous and consistent changes.
CSS changes are device friendly. With people employing a batch of various range of
smart devices to access websites over the web, there’s a requirement for responsive web
design.
Page | 11
PHP:
PHP is known as the general purpose programming language. It is used as a server-side
scripting language that is mainly used for the development of web sites. The PHP
frameworks also make web development easier. This framework helps in reusing the same
code and there is no need to write the lengthy and complex code for the web
applications. PHP frameworks are mainly open source and can be used easily. It was
developed by Rasmus Lerdorf and it was developed in the year 1994. PHP was written in C
language primarily but some of the components were written in C++ language as well.
Advantages of PHP:
many available specialists;
Page | 12
JS:
JavaScript is an object-based client-side scripting language that is very popular and used to
create dynamic and interactive web pages. Javascript is an interpreted language usually used
with HTML, and programs written in JavaScript are called lightweight scripts.
Earlier, JavaScript was named LiveScript, but later, Netscape changed its name to JavaScript
because its origin was from Java which was very popular at that time. JavaScript released its
first look for Netscape 2.0 in 1995 under the name "LiveScript".
JavaScript can interact with HTML DOM elements and dynamically control the
webpage.
You can perform client-side validation using Javascript.
Using JavaScript, you can create drop-down menus, pop-up windows, and dialog
boxes.
JavaScript can be used to load asynchronous data without refreshing the webpage.
JavaScript can be used in game development.
Advantages of JS:
Speed: Client-side JavaScript is very fast because it can be run immediately within the
client-side browser. Unless outside resources are required, JavaScript is unhindered by
network calls to a backend server.
Interoperability: JavaScript plays nicely with other languages and can be used in a huge
variety of applications.
Server Load: Being client-side reduces the demand on the website Server.
Page | 13
MYSQL:
Page | 14
CHAPTER 2
The Online Shopping System (OSS) is a web-based application. The purpose of the
application is to automate and facilitate the whole process of shopping. This application fixes
the limitation and problems of paper based processes. The main goal to increase the quantity
of sales by making the new technology of web pages design more attractive and to search a
lot of customers and company to their location. By this system we can advertise and send
procure to a lot of customer by sending email.
The requirements analysis and gathering processes are critical for the success of any software
engineering project. Requirements analysis in software engineering is a process that
determines the tasks that are required to determine the needs and conditions to design a
new product or to make modifications in any existing product/application. This process
considers all the stakeholders’ conflicting requirements, and analyzes the documentation and
validation of the system. The requirements should be actionable, measurable, testable, and
related to the defined needs of the system design. From the software-engineering perspective,
requirements analysis is a three-step process.
1. Requirements Elicitation:
Elicitation of requirements, also known as requirements gathering, includes the task
of identifying various requirement types from stakeholders or from project documentation.
2. Requirements Analysis:
Analysis of requirements determines if the gathered requirements are clear,
complete, and consistent. The analysis also handles any ambiguous requirements that do not
clearly state what needs to be implemented, which could create a loss of resources and time if
identified later in the development or testing phase .
Page | 15
Stakeholder analysis says that, to clearly gather the requirements of the project, analysts first
need to identify the stakeholders. Stakeholders are people or organizations that have a valid
interest or use in the system. The steps to identify the stakeholders are as follows:
Organizations that regulate the financial or safety aspects of the system Once the
stakeholders are successfully identified, interviews are conducted through different
processes; the needs and requirements of the system are identified, and are
requirements specification document is prepared. The document is then discussed with
the major stakeholders to identify any ambiguity with the requirements and
understanding of the system.
3. Requirements Documentation:
This step involves documenting the requirements in
various forms, including summary lists, natural language documents, visual documents, use
cases, user stories, or process specifications. A requirement specification document is
categorized in different ways according to the stakeholders’ need, helping to create a clear
contract between development and business. The following sections include the
different categories of requirements specification document that are essential for designing
this application: the functional requirements, constraints, system requirements, etc.
Page | 16
2.2 HARDWARE AND SOFTWARE INTERFACE
Hardware Interface
The online shopping-cart application shall provide minimum hardware requirements. The
following hardware configurations are required for a PC using the online shopping-cart
application:
Pentium processor 10
128 MB of RAM
Software Interface
This section lists the requirements that are needed to run the system efficiently. The
operating system needed for the system to run effectively, the interface to run the
application, the driver for running Java web applications, the integrated development
environment to develop the application, and the third-party tool used for editing purposes are
as follows:
OPERATING SYSTEM (Any one of the following):
Windows 7
Windows 8
Windows 10
Internet Explorer
Mozilla Firefox
Google Chrome
Page | 17
2.3 USER INTERFACE
The two interface types found in the online shopping-cart application are as follows:
1. User Interface:
Users are able to view the home page of the shopping-cart application, browse the different
categories, browse and add any number of items from any categories in the shopping cart,
look for information about each product, delete the items in the shopping cart, save the cart
for later viewing, check out or continue shopping after adding the item to the cart, and
check out the items by completing the required information in the order form.
2. Admin Interface:
The administrator is able to view the users’ information that was entered during checkout in
the database, can update the information, price, shipping costs of the items, add or remove
items from the main display.
The online shopping-cart application would have the following basic functions: 1.
Display all the categories available for shopping on the system’s main page.2.
Display all the items linked to each category listed on the main page.3.
Allow the administrator to add new items to the existing list of available items.4.
Page | 18
2.5 User Characteristics
The users of the online shopping-cart application, based on their roles, are customers(users)
and the administrator (owner). These users are identified based on their experience and
technical expertise.
1. Admin:
The administrator is the owner of this online shopping-cart application. One must have a
basic understanding of computers and the internet as well as prior knowledge for operating
the eclipse and Java programming languages. The administrator is responsible for
maintaining all the training documents required for the system. The administrator
can perform the following functions:
Assign or change the price of the items, update the items in the list, and delete the
items.
2. Users:
The users of this online shopping-cart application are all customers who would shop to test
the application. These users are anyone with shopping experience and the know-how to
browse through a shopping-cart application. They must have basic understandings about
computers and the internet. The users should be able to perform the following functions
using this system:
Page | 19
2.6 TECHNOLOGY USED
Platform: Windows 7
We have used XAMPP 1.8.2 which is a free and Open Source Cross-Platform Web
Server Solution Stack. It comes with Apache Web Server, MySQL Database, PHP and Perl
Programming Languages. A couple of advantages of using XAMPP for development are:
1. You can start and stop the whole web server + database stack with one command.
3. The security settings are strict by default, nobody but you will be able to access the
web server.
4. PHP error reporting is enabled by default, which helps when debugging scripts.
5. Easy to install.
Apache Server:
Web server apache is an open source server application. There are a lot of benefits and
advantages that are provided from the server. Numerous features like the openness,
extensibility, portability and flexibility of apache server provide advantages to administrator
leading to higher efficiency and utility.
MySQL:
MySQL is easy to use, yet extremely powerful, secure, and scalable. And because of
itssmall size and speed, it is the ideal database solution for Web sites. Some of its
advantages include the following:
Page | 20
1. It's easy to use:
While a basic knowledge of SQL is required—and most relational databases require
the same knowledge — MySQL is very easy to use. With only a few simple SQL statements,
you can build and interact with MySQL.
2. It's secure:
MySQL includes solid data security layers that protect sensitive data from intruders.
Rights can be set to allow some or all privileges to individuals. Passwords are encrypted.
3. It's inexpensive:
MySQL is available by free download from MySQL Web site.
4. It's fast:
In the interest of speed, MySQL designers made the decision to offer fewer features
than other major database competitors, such as Sybase* and Oracle*.However, despite
having fewer features than the other commercial database products, MySQL still offers all of
the features required by most database developers.
5. It's scalable:
MySQL can handle almost any amount of data, up to as much as 50million rows or
more. The default file size limit is about 4 GB. However, you can increase this number to a
theoretical limit of 8 TB of data.
6. It manages memory very well:
MySQL server has been thoroughly tested to prevent memory leaks.
7. It runs on many operating systems:
MySQL runs on many operating systems, including Novell NetWare, Windows*
Linux*, many varieties of UNIX* (such as Sun* Solaris*, AIX, and DEC* UNIX), OS/2,
FreeBSD*, and others.
8. It supports several development interfaces:
Development interfaces include JDBC,ODBC, and scripting (PHP and Perl),
letting you create database solutions that run not only in your NetWare 6.5 environment, but
across all major platforms, including Linux, UNIX, and Windows.
Page | 21
CHAPTER 3
This chapter includes the detailed design used to build the online shopping-cart
application. The system's design is used to create the functions and operations of the gathered
requirements in detail, including screen layouts, business rules, process diagrams, and other
documentation. The output of this chapter describes the new system which is defined as a
collection of modules and subsystems. This design stage takes the initial input requirements
that were identified in the approved requirements specification document. For each
requirement, there is a set of one or more design elements that are produced using the
different prototypes. These design elements describe the desired software features, in detail,
including functional hierarchy diagrams, screen layouts, activity diagrams, and class
diagrams. The intention of these diagrams is to describe the software in detail so that the
system can develop the application with less additional design input. The
system’s mock screen shots are shown later in this chapter.
The scope of this work is to design, develop, and test the application according to the
time table using Microsoft word database and Visual Studio code/Notepad++. In addition, we
will need to use Some Designer software to design the interface and system logo and photos.
This project is supposed to be delivered in three phases, with each phase being an
add-onto the project that makes it more usable and acceptable.
1. In the first delivery, the application must be able to add an item to the shopping cart
and case.
Page | 22
2. The application must be able to check out the items in the cart.
Continue shopping.
4. The application must bring up the order form for the check out.
Page | 23
CHAPTER 4
DETAILED LIFE CYCLE OF THE PROJECT
The entity is a person, object, place or event for which data is collected. The entity is
represented by a rectangle and labeled with a singular noun.
The relationship is the interaction between the entities. A relationship may be
represented by a diamond shape, or more simply, by the line connecting the entities.
In either case, verbs are used to label the relationships.
The cardinality defines the relationship between the entities in terms of numbers. An
entity may be optionalor mandatory. There are several different types of cardinality
notation; crow's foot notation, used here, is a common one. In crow's foot notation, a
single bar indicates one, a double bar indicates one and only one, a circle indicates
zero, and a crow's foot indicates many. The three main cardinal relationships are:
one- to-one, expressed as 1:1; one-to-many, expressed as 1: M; and many-to-many,
expressed as M: N.
Entity Relationship
Connector Attribute
Page | 24
4.1 ENTITY RELATIONSHIP DIAGRAM
name password
id
image
Users
IS A
User
type id
User
type name
Admin user
id image produce
price
name
id Payment_status
order
details
categories
User_id
Placed_on
name
Total_price
e
number
email Total_product
method
address
Page | 25
4.2 DATA FLOW DIAGRAM
A Data Flow Diagram (DFD) is a graphical representation of the "flow" of data through an
information system. A data flow diagram can also be used for the visualization of data processing (structured
design).
Process entity:
The Process entity identifies a process taking place; it must have at least oneinput and output. A process
with no input is known as a "miracle process" and one with nooutput is a "black hole process". Each process has the
following:
A Number
A Name (verb phrase)
A Description
At least one input
At least one output
A Name (Noun)
A Description
One or more connections to a process.
A Number
A Name
A Description
One or more input data flows.
One or more output data flows.
External entity:
The External Entity identifies external entities which interacts with the system,usually clients
but can be within the same organization. Each external entity has the following:
A Name (Noun)
A Description
Page | 26
The different notations to draw data flow diagrams, defining different visual
representations for Processes, Data Stores, Dataflow, and External Entities are as follows:
Dataflow (In)
Page | 27
TOP LEVEL DFD
MOM’S
Request Request
CHOICE
USER ADMIN
Response Response
Level 0
0.2 Wishlist
Product details + Product details +
userid + password userid + password
Cart
Create Create
Cart Product details
+userid+password Wishlist
0.3 0.4
Order
Product details Generation Bill
+userid+password
0.5
Page | 28
4.3 TABLE DESIGN
Database Tables:
Name: Cart
Description: Cart is to track and maintain all the products selecting by the users to complete a purchase
from shopping portal.
Name: Message
Description: Online retailers use messaging for customer sevice to differentiate themselves from
Competitors, provide a frictionless customer experience, drive waste out of the consumers
Path-to-purchase,
se, and meet their customers where they already are.
Page | 29
Name: Orders
Description: The goal of an order m
management system is to get a product into cu
ustomer’s hand as
efficiently as possible.. It manage the journey of each item in the cu ustomer’s order, from the
time it goes into theirr cart to the moment it arrives on their doorsteep- and any returns that
may follow.
Name: Products
Description: Online store enables the customer to brows the range of products and services, view
photos product specification, features and price.
Page | 30
Name: Users
Description: Users determine whether or not a user can connect to a computer, network or similar
Networks.
Name: Wishlist
Description: It allows shoppers to create personalized collections of products they want to buy and save
them in their user a/c for future reference.
Page | 31
CHAPTER 5
CODE
Config.php
<?php
$db_name = "mysql:host=localhost;dbname=shop_db";
$username = "root";
$password = "";
?>
contact.php
<?php
@include 'config.php';
session_start();
$user_id = $_SESSION['user_id'];
if(!isset($user_id)){
header('location:login.php');
};
if(isset($_POST['send'])){
$name = $_POST['name'];
$name = filter_var($name, FILTER_SANITIZE_STRING);
$email = $_POST['email'];
$email = filter_var($email, FILTER_SANITIZE_STRING);
$number = $_POST['number'];
$number = filter_var($number, FILTER_SANITIZE_STRING);
$msg = $_POST['msg'];
$msg = filter_var($msg, FILTER_SANITIZE_STRING);
$select_message = $conn->prepare("SELECT * FROM `message` WHERE name = ? AND email = ? AND number
= ? AND message = ?");
$select_message->execute([$name, $email, $number, $msg]);
Page | 32
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>contact</title>
</head>
<body>
<section class="contact">
</section>
<script src="js/script.js"></script>
</body>
</html>
Page | 33
admin_users.php
<?php
@include 'config.php';
session_start();
$admin_id = $_SESSION['admin_id'];
if(!isset($admin_id)){
header('location:login.php');
};
if(isset($_GET['delete'])){
$delete_id = $_GET['delete'];
$delete_users = $conn->prepare("DELETE FROM `users` WHERE id = ?");
$delete_users->execute([$delete_id]);
header('location:admin_users.php');
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>users</title>
</head>
<body>
<section class="user-accounts">
<div class="box-container">
<?php
$select_users = $conn->prepare("SELECT * FROM `users`");
$select_users->execute();
Page | 34
while($fetch_users = $select_users->fetch(PDO::FETCH_ASSOC)){
?>
<div class="box" style="<?php if($fetch_users['id'] == $admin_id){ echo 'display:none'; }; ?>">
<img src="uploaded_img/<?= $fetch_users['image']; ?>" alt="">
<p> user id : <span><?= $fetch_users['id']; ?></span></p>
<p> username : <span><?= $fetch_users['name']; ?></span></p>
<p> user type : <span style=" color:<?php if($fetch_users['user_type'] == 'admin'){ echo 'orange'; }; ?>"><?=
$fetch_users['user_type']; ?></span></p>
<a href="admin_users.php?delete=<?= $fetch_users['id']; ?>" onclick="return confirm('delete this user?');"
class="delete-btn">delete</a>
</div>
<?php
}
?>
</div>
</section>
login.php
<?php
@include 'config.php';
session_start();
if(isset($_POST['submit'])){
$email = $_POST['email'];
$email = filter_var($email, FILTER_SANITIZE_STRING);
$pass = md5($_POST['pass']);
$pass = filter_var($pass, FILTER_SANITIZE_STRING);
$row = $stmt->fetch(PDO::FETCH_ASSOC);
if($row['user_type'] == 'admin'){
$_SESSION['admin_id'] = $row['id'];
header('location:admin_page.php');
Page | 35
}elseif($row['user_type'] == 'user'){
$_SESSION['user_id'] = $row['id'];
header('location:home.php');
}else{
$message[] = 'no user found!';
}
}else{
$message[] = 'incorrect email or password!';
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>login</title>
</head>
<body>
<?php
if(isset($message)){
foreach($message as $message){
echo '
<div class="message">
<span>'.$message.'</span>
<i class="fas fa-times" onclick="this.parentElement.remove();"></i>
</div>
';
}
}
?>
<section class="form-container">
</section>
</body>
</html>
<script src="js/script.js"></script>
</body>
</html>
register.php
<?php
include 'config.php';
if(isset($_POST['submit'])){
$name = $_POST['name'];
$name = filter_var($name, FILTER_SANITIZE_STRING);
$email = $_POST['email'];
$email = filter_var($email, FILTER_SANITIZE_STRING);
$pass = md5($_POST['pass']);
$pass = filter_var($pass, FILTER_SANITIZE_STRING);
$cpass = md5($_POST['cpass']);
$cpass = filter_var($cpass, FILTER_SANITIZE_STRING);
$image = $_FILES['image']['name'];
$image = filter_var($image, FILTER_SANITIZE_STRING);
$image_size = $_FILES['image']['size'];
$image_tmp_name = $_FILES['image']['tmp_name'];
$image_folder = 'uploaded_img/'.$image;
if($insert){
if($image_size > 2000000){
$message[] = 'image size is too large!';
}else{
move_uploaded_file($image_tmp_name, $image_folder);
$message[] = 'registered successfully!';
header('location:login.php');
}
}
}
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>register</title>
</head>
<body>
<?php
if(isset($message)){
foreach($message as $message){
echo '
<div class="message">
<span>'.$message.'</span>
<i class="fas fa-times" onclick="this.parentElement.remove();"></i>
</div>
';
}
}
?>
<section class="form-container">
Page | 38
<form action="" enctype="multipart/form-data" method="POST">
<h3>register now</h3>
<input type="text" name="name" class="box" placeholder="enter your name" required>
<input type="email" name="email" class="box" placeholder="enter your email" required>
<input type="password" name="pass" class="box" placeholder="enter your password" required>
<input type="password" name="cpass" class="box" placeholder="confirm your password" required>
<input type="file" name="image" class="box" required accept="image/jpg, image/jpeg, image/png">
<input type="submit" value="register now" class="btn" name="submit">
<p>already have an account? <a href="login.php">login now</a></p>
</form>
</section>
</body>
</html>
logout.php
<?php
@include 'config.php';
session_start();
session_unset();
session_destroy();
header('location:login.php');
?>
Page | 39
CHAPTER 6
Home page
Page | 40
Shop page
Page | 41
Orders page
About page
Page | 42
Contact page
Page | 43
CHAPTER 7
Technology has made significant progress over the years to provide consumers a better online
shopping experience and will continue to do so for years to come. With the rapid growth of products and
brands, people have speculated that online shopping will overtake in-store shopping. While this has been the
case in some areas, there is still demand for brick and mortar stores in market areas where the consumer feels
more comfortable seeing and touching the product being bought. However, the availability of online
shopping has produced a more educated consumer that can shop around with relative ease without having to
spend a large amount of time. In exchange, online shopping has opened up doors to many small retailers
that would never be in business if they had to incur the high cost of owning a brick and mortar store. At the
end, it has been a win-win situation for both consumer and sellers.
Page | 44
CHAPTER 8
Page | 45
CHAPTER 9
Book Reference
Website Reference
www.w3schools.com/php/
http://phpacademy.org/
www.mysqltutorial.org/
Page | 46