Om Final
Om Final
DEPARTMENT OF COMPUTER
ENGINEERING
“GROCERY WEBSITE”
GUIDED BY
Prof. Pranita Awari
SUBMITTED BY
Om Painjane
Sudhir Wadekar
Shreyash Tukrul
MAHARASHTRA STATE BOARD
OF TECHNICAL EDUCATION
CERTIFICATE
This is to certify the following students of final year semester of Diploma in “Computer
Engineering” of Institute, Viva college of Diploma Engineering and Technology (1508)
have carried out the project entitled in academic year 2023 – 2024
“GROCERY WEBSITE”
GROUP MEMBERS
62 – Om Painjane
65 – Sudhir Wadekar
70 – Shreyash Tukrul
Before presenting our project work entitled Grocery Website, we would like to convey
our sincere thanks to the people who guided us throughout the course of this project
work.
First, we would like to express our sincere thanks to our beloved Principal
Mr. Surendra D. Ghatol for providing various facilities to carry out this
report.
We would like to express our immense gratitude towards our Project Guide
Miss. Pranita Awari for the constant encouragement, support, guidance, and mentoring
at the ongoing stages of the project and report.
We would like to express our sincere thanks to our H.O.D. Miss. Poonam Jadhav, for
the encouragement, co-operation, and suggestions progressing stages of the report.
Finally, we would like to thank all the teaching and non-teaching staff of the college,
and our friends, for their moral support rendered during the course of the reported work,
and for their direct and indirect involvement in the completion of our report work, which
made our endeavor fruitful.
ABSTRACT
Our project is a website which is an online grocery store. The Internet has made all of our
lives easier. You can do almost anything online anymore, including purchasing your
groceries. A lot of people have come to prefer buying their groceries online today. This
website allows users to buy groceries online which are needed in day-to-day life. This
includes fruits, vegetables, pulses, household etc. This is a user-friendly website in which
customers can view the item and the price of the item it is buying. Whenever you
purchase your groceries online you will be able to shop any time of the day or night, at
your convenience, regardless of what the weather outside may be, and still get everything
that you need and want.
The purpose of an online grocery ordering system is to automate the existing manual
system with the help of computerized equipment and fully-fledged computer software
fulfilling their requirement so that their value data/information can be stored for a longer
period with easy accessing and manipulation of the same required software and hardware
are easily available and work to work on. The languages we have used to develop our
project are HTML, CSS, and Javascript and for the backend, we have used MySQL and
PHP.
INDEX
A grocery website is an online store that lets clients buy food and other household
necessities while relaxing in their own homes. These websites often provide a wide range
of goods, such as fresh fruit, fresh vegetables, and household. Customers can browse the
different categories, perform a search for particular goods, and then add those goods to
their virtual shopping basket. After that, they can use a safe online payment method to
check out and pay for their products.
The advantages of supermarket websites over conventional brick-and-mortar stores are
numerous. They mostly provide convenience. Customers don't need to leave their homes
to shop for groceries; they may do so from anywhere, at any time of the day or night.
Those who are time-constrained, old, or incapacitated will find this very helpful.
Grocery websites frequently have a larger assortment of products than physical stores, in
addition to being more convenient. They have access to a wide range of local and
worldwide vendors and may frequently provide specialty or difficult-to-find items.
Finally, because they have lower overhead costs than traditional stores, grocery websites
frequently offer competitive prices and discounts. Additionally, they might provide free
delivery or pick-up services, which can lower the price and hassle of grocery shopping.
Overall, a grocery website is a practical and simple option for modern consumers seeking
a quick and stress-free way to buy food and other necessities.
The primary objective of the "Grocery Gurus" project is to develop a user-friendly and
intuitive website interface that simplifies the shopping process. Customers will have the
ability to browse different categories, perform searches for specific items, and add
products to their virtual shopping cart seamlessly. Integration of secure online payment
methods will ensure safe transactions, while partnerships with local and global vendors
will enable access to a diverse range of products.
The "Grocery Gurus" website will offer a range of key features designed to enhance the
shopping experience. These include a comprehensive product catalog with a wide variety
of options, robust search and filtering functionalities for easy navigation, and a secure
checkout process. The platform will also provide flexible delivery options, including free
delivery or pick-up services, to cater to the diverse needs of customers. Additionally,
regular promotions, discounts, and loyalty programs will be implemented to provide
added value to shoppers.
1. User-Friendly Platform:
- Ensure easy navigation and search for products.
- Streamline the ordering process for hassle-free shopping.
- Prioritize mobile responsiveness for accessibility.
3. Personalized Recommendations:
- Utilize customer data for tailored product suggestions.
- Display recommendations prominently to encourage additional sales.
Technical Considerations:
- Frontend: HTML5, CSS3, JavaScript (React.js)
- Backend: Node.js, Express.js
- Database: MongoDB
- Payment Gateway: Stripe, PayPal
- Security Measures: SSL encryption, secure authentication.
The project structure for a software system adhering to Unified Modeling Language
(UML) principles encompasses various directories and files to organize the codebase
effectively.
Within the src directory, components are categorized based on different views of the
system as outlined by UML. The User Model View directory contains components
representing the system from the users' perspective, including features like user
dashboard, profile management, and preferences. In contrast, the Structural Model View
directory focuses on data and functionality within the system, containing components
related to static structures such as product listings, shopping cart management, and
product details. Finally, the Behavioural Model View directory captures the dynamic
interactions within the system, comprising components that depict user actions, product
interactions, and the checkout process.
The services directory hosts service files responsible for handling backend logic and
integrating with external APIs or databases. These services include user service, product
service, and checkout service, among others. The utils directory contains utility functions
and helpers used throughout the codebase for tasks like data validation and formatting.
In the public directory, static assets like images and favicon.ico are stored, along with the
main index.html file serving as the entry point for the web application.
The server directory houses backend server-related files, including controllers, models,
routes, middleware, configuration, and the main server file. These files handle server-side
logic, database interactions, and routing for API endpoints.
Documentation and project guides are stored in the docs directory, with markdown files
providing user guides, API references, and deployment instructions.
Automation scripts for tasks like starting the development server, building the production
version, and running tests are located in the scripts directory.
Methodology:
The literature search was conducted using academic databases, industry journals,
conference proceedings, and online repositories. Keywords such as "grocery website
development," "e-commerce best practices," "user experience," "search engine
optimization," "mobile optimization," "security," and "data management" were used to
identify relevant publications. Inclusion criteria included publications published within
the last five years, written in English, and focusing on topics directly related to grocery
website development.
The systematic literature review identified several key areas of focus in the development
of grocery websites. These include:
1. Website Design: Studies emphasized the importance of intuitive navigation, visually
appealing interfaces, and responsive design to enhance user experience and engagement.
2. Usability: Research highlighted the significance of user-centered design principles and
usability testing to optimize website functionality and ease of use.
Case Studies:
Analysis of successful grocery websites revealed common features and functionalities
contributing to their success. These include:
- Comprehensive product catalogs with detailed descriptions and images.
- Advanced search and filtering options for easy product discovery.
- Seamless checkout processes with multiple payment options and secure transactions.
- Integration with third-party logistics providers for efficient order fulfillment and
delivery.
- Personalized user accounts with order history, preferences, and recommendations.
1. Usability Testing:
Conduct comprehensive usability testing with target users to evaluate the
effectiveness of the website design and functionality. Gather feedback to identify
areas for improvement and refine the user experience.
2. Continuous Optimization:
Implement a strategy for ongoing optimization, focusing on areas such as SEO,
mobile responsiveness, security enhancements, and overall performance
improvements to ensure the website remains competitive and up-to-date.
The project aims to develop a comprehensive grocery website that offers users a seamless
and efficient online shopping experience. This involves creating a fully functional
platform with features such as a well-organized product catalog, intuitive search
functionality, a user-friendly shopping cart, and a secure checkout process.
The design and user experience of the website will be carefully crafted to ensure ease of
navigation, visually appealing layouts, and responsiveness across various devices. Special
attention will be given to mobile optimization, ensuring that users can access and
navigate the website seamlessly from smartphones and tablets.
Payment gateway integration will be a crucial aspect of the project, enabling users to
make purchases using various payment methods securely. The website will also feature
user account management functionalities, allowing users to register, log in, manage their
profiles, view order history, and track shipments.
Compliance with relevant regulations and legal considerations, such as GDPR and PCI
DSS, will be ensured throughout the development process to maintain data privacy and
consumer protection standards.
1. Front-End Development:
- Utilize HTML, CSS, and JavaScript to design and develop the user interface (UI) of the
website.
- Focus on creating an intuitive and visually appealing layout with easy navigation for
browsing products.
2. Back-End Development:
- Use PHP for server-side scripting and MySQL for database management to handle
dynamic content and user data.
3. Product Management:
- Develop a robust product management system to organize and display a wide range of
grocery items.
- Include features for adding, editing, and removing products, as well as managing
inventory and pricing.
4. Shopping Features:
- Enable users to browse products by categories, search for specific items, and add them
to a shopping cart.
VIVA COLLEGE OF DIPLOMA ENGG & TECH, COMPUTER 15
ENGG.
- Implement a secure checkout process with multiple payment options for seamless
transactions.
5. User Interaction:
- Provide a feedback mechanism for users to report issues, suggest improvements, and
share their shopping experience.
- Conduct thorough testing, including functional testing, usability testing, and cross-
browser compatibility testing
- Address any issues or bugs identified during testing to ensure a smooth and error-free
user experience.
- Deploy the website to a reliable web hosting server and ensure continuous availability
and performance.
- Provide ongoing maintenance and support to address any issues, implement updates,
and enhance features based on user feedback and evolving requirements.
login
Add
Grocery product
User website
Registration
Search View
product product
1. Entities:
- Admin: Represents the administrator or system manager responsible for managing the
online grocery website.
- Online Grocery Website: Represents the main system or platform where users can
access and interact with the website's features.
- User: Represents the individuals accessing the online grocery website to browse
products, make purchases, etc.
2. Processes:
- Request for Login: This process signifies a user's request to log in to the online
grocery website. It involves providing credentials such as a username and password to
access their account.
- Request for Registration: This process represents a user's request to create a new
account on the online grocery website. It typically involves providing necessary
information such as name, email address, and password to register as a new user.
3. Responses:
- Response (Login): After receiving a login request from the user, the system processes
the provided credentials. If the credentials are valid, the system responds with access to
the user's account/dashboard. If the credentials are invalid, the system may respond with
an error message indicating authentication failure.
- Response (Registration): After receiving a registration request from the user, the
3. Internet Connection:
- Requirement: Reliable internet connection with sufficient bandwidth.
4. Responsive Design:
- Requirement: Responsive design for seamless user experience across devices.
5. SSL Certificate:
- Requirement: SSL encryption for secure HTTPS connection.
FRONTEND: 1.HTML
2.CSS
3.Java script
BACKEND: MySQL, PHP
2. Performance: It delivers high performance even with large datasets, ensuring fast data
access and query execution. This is essential for maintaining responsiveness and
providing a smooth user experience on the website.
3. Security: MySQL offers robust security features, including user authentication, access
control, and data encryption, to protect sensitive data from unauthorized access and
ensure compliance with data protection regulations.
4. Scalability: The scalability of MySQL allows the website to handle increasing volumes
of data and traffic over time. It supports features such as replication and clustering,
enabling horizontal and vertical scaling as needed.
Login
Registration
Home
Orders
Search
x
VIVA COLLEGE OF DIPLOMA ENGG & TECH, COMPUTER 34
ENGG.
x
Shop Category
Category
Cart
Checkout
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);
$sql = "SELECT * FROM `users` WHERE email = ? AND password = ?";
$stmt = $conn->prepare($sql);
$stmt->execute([$email, $pass]);
$rowCount = $stmt->rowCount();
$row = $stmt->fetch(PDO::FETCH_ASSOC);
if($rowCount > 0){
if($row['user_type'] == 'admin'){
$_SESSION['admin_id'] = $row['id'];
header('location:admin_page.php'); }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>
VIVA COLLEGE OF DIPLOMA ENGG & TECH, COMPUTER 36
ENGG.
<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>
Logout.php
<?php
@include 'config.php';
session_start();
session_unset();
session_destroy();
header('location:login.php');
?>
Register
<?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);
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">
<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>
</section>
</body>
</html>
@include 'config.php';
session_start();
$user_id = $_SESSION['user_id'];
if(!isset($user_id)){
header('location:login.php');
};
if(isset($_POST['add_to_wishlist'])){
$pid = $_POST['pid'];
$pid = filter_var($pid, FILTER_SANITIZE_STRING);
$p_name = $_POST['p_name'];
$p_name = filter_var($p_name, FILTER_SANITIZE_STRING);
$p_price = $_POST['p_price'];
$p_price = filter_var($p_price, FILTER_SANITIZE_STRING);
$p_image = $_POST['p_image'];
$p_image = filter_var($p_image, FILTER_SANITIZE_STRING);
if(isset($_POST['add_to_cart'])){
$pid = $_POST['pid'];
$pid = filter_var($pid, FILTER_SANITIZE_STRING);
$p_name = $_POST['p_name'];
$p_name = filter_var($p_name, FILTER_SANITIZE_STRING);
$p_price = $_POST['p_price'];
$p_price = filter_var($p_price, FILTER_SANITIZE_STRING);
$p_image = $_POST['p_image'];
$p_image = filter_var($p_image, FILTER_SANITIZE_STRING);
$p_qty = $_POST['p_qty'];
$p_qty = filter_var($p_qty, FILTER_SANITIZE_STRING);
?>
<!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>home page</title>
</head>
<body>
<div class="home-bg">
<section class="home">
<div class="content">
</section>
</div>
<section class="home-category">
<div class="box-container">
<div class="box">
<img src="images/cat-1.png" alt="">
<h3>fruits</h3>
<div class="box">
<img src="images/cat-5.jpeg" alt="">
<h3>Household</h3>
<div class="box">
<img src="images/cat-3.png" alt="">
<h3>vegitables</h3>
<div class="box">
<img src="images/cat-6.png" alt="">
<h3>DAL AND PULESES </h3>
</div>
</section>
<section class="products">
<div class="box-container">
<?php
$select_products = $conn->prepare("SELECT * FROM `products` LIMIT 6");
$select_products->execute();
if($select_products->rowCount() > 0){
while($fetch_products = $select_products->fetch(PDO::FETCH_ASSOC)){
?>
<form action="" class="box" method="POST">
<div class="price">Rs<span><?= $fetch_products['price']; ?></span>/-</div>
<a href="view_page.php?pid=<?= $fetch_products['id']; ?>" class="fas fa-eye"></a>
<img src="<?= $fetch_products['image']; ?>" alt="">
<div class="name"><?= $fetch_products['name']; ?></div>
<input type="hidden" name="pid" value="<?= $fetch_products['id']; ?>">
<input type="hidden" name="p_name" value="<?= $fetch_products['name']; ?>">
<input type="hidden" name="p_price" value="<?= $fetch_products['price']; ?>">
<input type="hidden" name="p_image" value="<?= $fetch_products['image']; ?>">
<input type="number" min="1" value="1" name="p_qty" class="qty">
<input type="submit" value="add to wishlist" class="option-btn"
name="add_to_wishlist">
<input type="submit" value="add to cart" class="btn" name="add_to_cart">
</form>
<?php
}
}else{
echo '<p class="empty">no products added yet!</p>';
}
?>
</div>
</section>
<script src="js/script.js"></script>
</body>
@include 'config.php';
session_start();
$user_id = $_SESSION['user_id'];
if(!isset($user_id)){
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>orders</title>
</head>
<body>
<section class="placed-orders">
<?php
$select_orders = $conn->prepare("SELECT * FROM `orders` WHERE user_id = ?");
$select_orders->execute([$user_id]);
if($select_orders->rowCount() > 0){
while($fetch_orders = $select_orders->fetch(PDO::FETCH_ASSOC)){
?>
<div class="box">
<p> placed on : <span><?= $fetch_orders['placed_on']; ?></span> </p>
<p> name : <span><?= $fetch_orders['name']; ?></span> </p>
<p> number : <span><?= $fetch_orders['number']; ?></span> </p>
<p> email : <span><?= $fetch_orders['email']; ?></span> </p>
<p> address : <span><?= $fetch_orders['address']; ?></span> </p>
<p> payment method : <span><?= $fetch_orders['method']; ?></span> </p>
<p> your orders : <span><?= $fetch_orders['total_products']; ?></span> </p>
<p> total price : <span>Rs:<?= $fetch_orders['total_price']; ?>/-</span> </p>
<p> payment status : <span style="color:<?php if($fetch_orders['payment_status'] ==
'pending'){ echo 'red'; }else{ echo 'green'; }; ?>"><?= $fetch_orders['payment_status']; ?
></span> </p>
</div>
<?php
}
}else{
echo '<p class="empty">no orders placed yet!</p>';
}
?>
</div>
</section>
<script src="js/script.js"></script>
</body>
</html>
Search_Page
@include 'config.php';
session_start();
$user_id = $_SESSION['user_id'];
if(!isset($user_id)){
header('location:login.php');
};
if(isset($_POST['add_to_wishlist'])){
$pid = $_POST['pid'];
$pid = filter_var($pid, FILTER_SANITIZE_STRING);
$p_name = $_POST['p_name'];
$p_name = filter_var($p_name, FILTER_SANITIZE_STRING);
$p_price = $_POST['p_price'];
$p_price = filter_var($p_price, FILTER_SANITIZE_STRING);
$p_image = $_POST['p_image'];
$p_image = filter_var($p_image, FILTER_SANITIZE_STRING);
if(isset($_POST['add_to_cart'])){
$pid = $_POST['pid'];
$pid = filter_var($pid, FILTER_SANITIZE_STRING);
$p_name = $_POST['p_name'];
$p_name = filter_var($p_name, FILTER_SANITIZE_STRING);
$p_price = $_POST['p_price'];
$p_price = filter_var($p_price, FILTER_SANITIZE_STRING);
$p_image = $_POST['p_image'];
$p_image = filter_var($p_image, FILTER_SANITIZE_STRING);
$p_qty = $_POST['p_qty'];
$p_qty = filter_var($p_qty, FILTER_SANITIZE_STRING);
?>
<!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>search page</title>
</head>
<body>
<section class="search-form">
</section>
<?php
?>
<div class="box-container">
<?php
if(isset($_POST['search_btn'])){
$search_box = $_POST['search_box'];
$search_box = filter_var($search_box, FILTER_SANITIZE_STRING);
$select_products = $conn->prepare("SELECT * FROM `products` WHERE name
LIKE '%{$search_box}%' OR category LIKE '%{$search_box}%'");
$select_products->execute();
if($select_products->rowCount() > 0){
while($fetch_products = $select_products->fetch(PDO::FETCH_ASSOC)){
?>
<form action="" class="box" method="POST">
<div class="price">$<span><?= $fetch_products['price']; ?></span>/-</div>
<a href="view_page.php?pid=<?= $fetch_products['id']; ?>" class="fas fa-eye"></a>
<img src="uploaded_img/<?= $fetch_products['image']; ?>" alt="">
<div class="name"><?= $fetch_products['name']; ?></div>
<input type="hidden" name="pid" value="<?= $fetch_products['id']; ?>">
<input type="hidden" name="p_name" value="<?= $fetch_products['name']; ?>">
<input type="hidden" name="p_price" value="<?= $fetch_products['price']; ?>">
<input type="hidden" name="p_image" value="<?= $fetch_products['image']; ?>">
<input type="number" min="1" value="1" name="p_qty" class="qty">
<input type="submit" value="add to wishlist" class="option-btn"
name="add_to_wishlist">
<input type="submit" value="add to cart" class="btn" name="add_to_cart">
</form>
<?php
}
}else{
echo '<p class="empty">no result found!</p>';
}
};
?>
</div>
</section>
<script src="js/script.js"></script>
</body>
</html>
Footer
<footer class="footer">
<section class="box-container">
<div class="box">
<h3>quick links</h3>
<a href="home.php"> <i class="fas fa-angle-right"></i> home</a>
<a href="shop.php"> <i class="fas fa-angle-right"></i> shop</a>
<a href="about.php"> <i class="fas fa-angle-right"></i> about</a>
<a href="contact.php"> <i class="fas fa-angle-right"></i> contact</a>
</div>
<div class="box">
<h3>extra links</h3>
<a href="cart.php"> <i class="fas fa-angle-right"></i> cart</a>
<a href="wishlist.php"> <i class="fas fa-angle-right"></i> wishlist</a>
<a href="login.php"> <i class="fas fa-angle-right"></i> login</a>
<a href="register.php"> <i class="fas fa-angle-right"></i> register</a>
</div>
<div class="box">
<h3>contact info</h3>
<p> <i class="fas fa-phone"></i> +123-456-7890 </p>
<p> <i class="fas fa-phone"></i> +111-222-3333 </p>
<p> <i class="fas fa-envelope"></i> [email protected]</p>
<p> <i class="fas fa-map-marker-alt"></i> mumbai, india - 400104 </p>
</div>
Header
<?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>
';
}
}
?>
<header class="header">
<div class="flex">
<nav class="navbar">
<a href="home.php">home</a>
<a href="shop.php">shop</a>
<a href="orders.php">orders</a>
<a href="about.php">about</a>
<a href="contact.php">contact</a>
</nav>
<div class="profile">
<?php
$select_profile = $conn->prepare("SELECT * FROM `users` WHERE id = ?");
$select_profile->execute([$user_id]);
$fetch_profile = $select_profile->fetch(PDO::FETCH_ASSOC);
?>
<img src="uploaded_img/<?= $fetch_profile['image']; ?>" alt="">
<p><?= $fetch_profile['name']; ?></p>
<a href="user_profile_update.php" class="btn">update profile</a>
<a href="logout.php" class="delete-btn">logout</a>
<div class="flex-btn">
<a href="login.php" class="option-btn">login</a>
<a href="register.php" class="option-btn">register</a>
</div>
</div>
</div>
</header>
@include 'config.php';
session_start();
$user_id = $_SESSION['user_id'];
if(!isset($user_id)){
header('location:login.php');
};
if(isset($_GET['delete'])){
$delete_id = $_GET['delete'];
$delete_cart_item = $conn->prepare("DELETE FROM `cart` WHERE id = ?");
$delete_cart_item->execute([$delete_id]);
header('location:cart.php');
}
if(isset($_GET['delete_all'])){
$delete_cart_item = $conn->prepare("DELETE FROM `cart` WHERE user_id = ?");
$delete_cart_item->execute([$user_id]);
header('location:cart.php');
}
if(isset($_POST['update_qty'])){
$cart_id = $_POST['cart_id'];
$p_qty = $_POST['p_qty'];
$p_qty = filter_var($p_qty, FILTER_SANITIZE_STRING);
$update_qty = $conn->prepare("UPDATE `cart` SET quantity = ? WHERE id = ?");
$update_qty->execute([$p_qty, $cart_id]);
$message[] = 'cart quantity updated';
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
</head>
<body>
<section class="shopping-cart">
<div class="box-container">
<?php
$grand_total = 0;
$select_cart = $conn->prepare("SELECT * FROM `cart` WHERE user_id = ?");
$select_cart->execute([$user_id]);
if($select_cart->rowCount() > 0){
while($fetch_cart = $select_cart->fetch(PDO::FETCH_ASSOC)){
?>
<form action="" method="POST" class="box">
<a href="cart.php?delete=<?= $fetch_cart['id']; ?>" class="fas fa-times"
onclick="return confirm('delete this from cart?');"></a>
<a href="view_page.php?pid=<?= $fetch_cart['pid']; ?>" class="fas fa-eye"></a>
<img src="<?= $fetch_cart['image']; ?>" alt="">
<div class="name"><?= $fetch_cart['name']; ?></div>
<div class="price">Rs<?= $fetch_cart['price']; ?>/-</div>
<input type="hidden" name="cart_id" value="<?= $fetch_cart['id']; ?>">
<div class="flex-btn">
<input type="number" min="1" value="<?= $fetch_cart['quantity']; ?>" class="qty"
<div class="cart-total">
<p>grand total : <span>Rs<?= $grand_total; ?>/-</span></p>
<a href="shop.php" class="option-btn">continue shopping</a>
<a href="cart.php?delete_all" class="delete-btn <?= ($grand_total > 1)?'':'disabled'; ?
>">delete all</a>
<a href="checkout.php" class="btn <?= ($grand_total > 1)?'':'disabled'; ?>">proceed
to checkout</a>
</div>
</section>
<script src="js/script.js"></script>
</body></html>
Category
<?php
@include 'config.php';
session_start();
$user_id = $_SESSION['user_id'];
if(isset($_POST['add_to_wishlist'])){
$pid = $_POST['pid'];
$pid = filter_var($pid, FILTER_SANITIZE_STRING);
$p_name = $_POST['p_name'];
$p_name = filter_var($p_name, FILTER_SANITIZE_STRING);
$p_price = $_POST['p_price'];
$p_price = filter_var($p_price, FILTER_SANITIZE_STRING);
$p_image = $_POST['p_image'];
$p_image = filter_var($p_image, FILTER_SANITIZE_STRING);
if(isset($_POST['add_to_cart'])){
$pid = $_POST['pid'];
?>
<!DOCTYPE html>
<html lang="en">
</head>
<body>
<section class="products">
<div class="box-container">
<?php
$category_name = $_GET['category'];
$select_products = $conn->prepare("SELECT * FROM `products` WHERE category
= ?");
$select_products->execute([$category_name]);
if($select_products->rowCount() > 0){
while($fetch_products = $select_products->fetch(PDO::FETCH_ASSOC)){
?>
<form action="" class="box" method="POST">
<div class="price">Rs:-<span><?= $fetch_products['price']; ?></span>/-</div>
<a href="view_page.php?pid=<?= $fetch_products['id']; ?>" class="fas fa-eye"></a>
<img src="<?= $fetch_products['image']; ?>" alt="">
<div class="name"><?= $fetch_products['name']; ?></div>
<input type="hidden" name="pid" value="<?= $fetch_products['id']; ?>">
<input type="hidden" name="p_name" value="<?= $fetch_products['name']; ?>">
<input type="hidden" name="p_price" value="<?= $fetch_products['price']; ?>">
</div>
</section>
<script src="js/script.js"></script>
</body>
</html>
Checkout
<?php
@include 'config.php';
session_start();
$user_id = $_SESSION['user_id'];
if(!isset($user_id)){
header('location:login.php');
if(isset($_POST['order'])){
$name = $_POST['name'];
$name = filter_var($name, FILTER_SANITIZE_STRING);
$number = $_POST['number'];
$number = filter_var($number, FILTER_SANITIZE_STRING);
$email = $_POST['email'];
$email = filter_var($email, FILTER_SANITIZE_STRING);
$method = $_POST['method'];
$method = filter_var($method, FILTER_SANITIZE_STRING);
$address = 'flat no. '. $_POST['flat'] .' '. $_POST['street'] .' '. $_POST['city'] .' '.
$_POST['state'] .' '. $_POST['country'] .' - '. $_POST['pin_code'];
$address = filter_var($address, FILTER_SANITIZE_STRING);
$placed_on = date('d-M-Y');
$cart_total = 0;
$cart_products[] = '';
if($cart_total == 0){
$message[] = 'your cart is empty';
?>
<!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>checkout</title>
</head>
<body>
<section class="display-orders">
<?php
<section class="checkout-orders">
<div class="flex">
<div class="inputBox">
<span>your name :</span>
<input type="text" name="name" placeholder="enter your name" class="box"
required>
</div>
<div class="inputBox">
<span>your number :</span>
<input type="number" name="number" placeholder="enter your number"
class="box" required>
</div>
<div class="inputBox">
<span>your email :</span>
</form></section>
<script src="js/script.js"></script>
</body>
</html>
Config
<?php
$db_name = "mysql:host=localhost;dbname=shop_db";
$username = "root";
$password = "";
?>
Contact
<?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);
?>
<!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>
About
@include 'config.php';
session_start();
$user_id = $_SESSION['user_id'];
if(!isset($user_id)){
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>about</title>
</head>
<body>
<section class="about">
<div class="row">
<div class="box">
<img src="images/about-img-1.png" alt="">
<div class="box">
<img src="images/about-img-2.png" alt="">
<h3>what we provide?</h3>
<p>Lorem, ipsum dolor sit amet consectetur adipisicing elit. Quisquam, a quod,
quis alias eius dignissimos pariatur laborum dolorem ad ullam iure, consequatur autem
animi illo odit! Atque quia minima voluptatibus.</p>
<a href="shop.php" class="btn">our shop</a>
</div>
</div>
</section>
<script src="js/script.js"></script>
</body>
</html>
Shop
<?php
@include 'config.php';
session_start();
$user_id = $_SESSION['user_id'];
if(!isset($user_id)){
header('location:login.php');
};
$pid = $_POST['pid'];
$pid = filter_var($pid, FILTER_SANITIZE_STRING);
$p_name = $_POST['p_name'];
$p_name = filter_var($p_name, FILTER_SANITIZE_STRING);
$p_price = $_POST['p_price'];
$p_price = filter_var($p_price, FILTER_SANITIZE_STRING);
$p_image = $_POST['p_image'];
$p_image = filter_var($p_image, FILTER_SANITIZE_STRING);
if(isset($_POST['add_to_cart'])){
$pid = $_POST['pid'];
$pid = filter_var($pid, FILTER_SANITIZE_STRING);
$p_name = $_POST['p_name'];
$p_name = filter_var($p_name, FILTER_SANITIZE_STRING);
$p_price = $_POST['p_price'];
$p_price = filter_var($p_price, FILTER_SANITIZE_STRING);
?>
<!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>shop</title>
</head>
<body>
<section class="p-category">
<a href="category.php?category=fruits">fruits</a>
<a href="category.php?category=vegitables">vegitables</a>
<a href="category.php?category=DAL AND PULESES">DAL AND PULESES</a>
<a href="category.php?category=Household">Household</a>
</section>
<section class="products">
<div class="box-container">
<?php
$select_products = $conn->prepare("SELECT * FROM `products`");
$select_products->execute();
if($select_products->rowCount() > 0){
while($fetch_products = $select_products->fetch(PDO::FETCH_ASSOC)){
?>
<form action="" class="box" method="POST">
<div class="price">Rs<span><?= $fetch_products['price']; ?></span>/-</div>
<a href="view_page.php?pid=<?= $fetch_products['id']; ?>" class="fas fa-eye"></a>
<img src="<?= $fetch_products['image']; ?>" alt="">
<div class="name"><?= $fetch_products['name']; ?></div>
<input type="hidden" name="pid" value="<?= $fetch_products['id']; ?>">
</div>
</section>
<script src="js/script.js"></script>
</body>
</html>
<?php
Wishlist
@include 'config.php';
session_start();
$user_id = $_SESSION['user_id'];
if(!isset($user_id)){
header('location:login.php');
};
if(isset($_POST['add_to_cart'])){
if(isset($_GET['delete'])){
if(isset($_GET['delete_all'])){
?>
<!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>wishlist</title>
</head>
<body>
<section class="wishlist">
<div class="box-container">
<?php
$grand_total = 0;
$select_wishlist = $conn->prepare("SELECT * FROM `wishlist` WHERE user_id
= ?");
$select_wishlist->execute([$user_id]);
if($select_wishlist->rowCount() > 0){
while($fetch_wishlist = $select_wishlist->fetch(PDO::FETCH_ASSOC)){
?>
<form action="" method="POST" class="box">
<a href="wishlist.php?delete=<?= $fetch_wishlist['id']; ?>" class="fas fa-times"
onclick="return confirm('delete this from wishlist?');"></a>
<a href="view_page.php?pid=<?= $fetch_wishlist['pid']; ?>" class="fas fa-eye"></a>
<img src="<?= $fetch_wishlist['image']; ?>" alt="">
<div class="name"><?= $fetch_wishlist['name']; ?></div>
<div class="price">Rs:<?= $fetch_wishlist['price']; ?>/-</div>
<input type="number" min="1" value="1" class="qty" name="p_qty">
<input type="hidden" name="pid" value="<?= $fetch_wishlist['pid']; ?>">
<input type="hidden" name="p_name" value="<?= $fetch_wishlist['name']; ?>">
<input type="hidden" name="p_price" value="<?= $fetch_wishlist['price']; ?>">
<input type="hidden" name="p_image" value="<?= $fetch_wishlist['image']; ?>">
<input type="submit" value="add to cart" name="add_to_cart" class="btn">
</form>
<?php
$grand_total += $fetch_wishlist['price'];
}
}else{
echo '<p class="empty">your wishlist is empty</p>';
}
?>
</div>
<div class="wishlist-total">
<p>grand total : <span>Rs:<?= $grand_total; ?>/-</span></p>
<a href="shop.php" class="option-btn">continue shopping</a>
<a href="wishlist.php?delete_all" class="delete-btn <?= ($grand_total >
1)?'':'disabled'; ?>">delete all</a>
</section>
<script src="js/script.js"></script>
</body>
</html>
admin_contacts
<?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_message = $conn->prepare("DELETE FROM `message` WHERE id = ?");
$delete_message->execute([$delete_id]);
header('location:admin_contacts.php');
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
</head>
<body>
<section class="messages">
<h1 class="title">messages</h1>
<div class="box-container">
<?php
$select_message = $conn->prepare("SELECT * FROM `message`");
$select_message->execute();
if($select_message->rowCount() > 0){
while($fetch_message = $select_message->fetch(PDO::FETCH_ASSOC)){
?>
<div class="box">
<p> user id : <span><?= $fetch_message['user_id']; ?></span> </p>
<p> name : <span><?= $fetch_message['name']; ?></span> </p>
<p> number : <span><?= $fetch_message['number']; ?></span> </p>
<p> email : <span><?= $fetch_message['email']; ?></span> </p>
<p> message : <span><?= $fetch_message['message']; ?></span> </p>
<a href="admin_contacts.php?delete=<?= $fetch_message['id']; ?>" onclick="return
confirm('delete this message?');" class="delete-btn">delete</a>
</div>
<?php
}
}else{
echo '<p class="empty">you have no messages!</p>';
</section>
<script src="js/script.js"></script>
</body></html>
7.1 Conclusion:
In conclusion, grocery websites have try to revolutionized the way people shop for
groceries. With the advent of e-commerce, customers can now browse and purchase
groceries from the comfort of their own homes. This convenience has resulted in an
increase in online grocery shopping, particularly in the wake of the COVID-19 pandemic.
Grocery websites offer a wide range of products at competitive prices, making it easy for
customers to find what they need. Additionally, many sites offer features such as
personalized recommendations, online coupons, and subscription services, making it
easier than ever for customers to save time and money. Overall, grocery websites have
become an essential part of modern life, providing a convenient and efficient way to shop
for groceries. As technology continues to advance, we can expect grocery websites to
become even more user-friendly and personalized, further enhancing the customer
experience.
Expansion of product offerings: As the website gains popularity, it can expand its product
offerings to include a wider range of grocery items, such as organic foods, international
foods, and specialty products.
Integration of delivery services: The website can partner with delivery services or
establish its own delivery system to offer customers a more convenient and seamless
shopping experience.
Implementation of AI: With the help of AI the website can provide personalized
recommendations to customers based on their past shopping behavior and preferences.
Subscription model: The website can introduce a subscription model where customers
can sign up for regular deliveries of their preferred grocery items.
1. https://youtu.be/lCCN_lkl3Xw
2. https://www.slideshare.net
3. https://en.wikipedia.org.
4. https://www.freeprojectz.com