0% found this document useful (0 votes)
34 views85 pages

Flower Shop Management Project Report

Flower management
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
34 views85 pages

Flower Shop Management Project Report

Flower management
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Avinash Vishwakarma - 61

PROJECT REPORT
On
“Flower Shop Management”

Submitted By
Avinash Vishwakarma

Under the guidance of


Mr.Rajesh Yadav

Submitted in partial fulfillment of the requirement


for qualifying
TYBSC Computer Science SEM V Examination
2022-23

Department of computer science

V.K.KRISHNA MENON COLLEGE


BHANDUP(E)- 400042
V.K Krishna Menon College of Science and Commerce
1
Avinash Vishwakarma - 61

CERTIFICATE

V.K KRISHNA MENON COLLEGE OF COMMERCE AND


ECONOMICS AND
SHARAD SHANKAR DIGHE COLLEGE OF SCIENCE
BHANDUP EAST, MUMBAI - 400042

This is to certify that Mr./Miss Avinash Vishwakarma Roll No 61 has successfully


completed the PROJECT titled “ Flower Shop Management ” of Sem V for partial
fulfillment of Bachelor of Science in Computer Science of University of Mumbai in
academic year 2022 -2023 under the guidance of
Mr.RAJESH YADAV

DATE: HEAD OF THE DEPARTMENT

PROJECT GUIDE EXAMINER

V.K Krishna Menon College of Science and Commerce


2
Avinash Vishwakarma - 61

ACKNOWLEDGEMENT
I have a great pleasure in representing this project report entitled “Flower Shop Management ”
and I grab this opportunity to convey my immense regards towards all the distinguished people
who have their valuable contribution in the hour of need.

I like to extend my gratitude to our beloved Principal Mrs. S.V Phadnis for her timely and
prestigious guidance.

I take this opportunity to thank Ms. Reena Shah, Coordinator of the Department and all the
faculty members of the Department of Computer Science of V.K Krishna Menon College of
Science and Commerce Bhandup (EAST), for giving me an opportunity to complete this project
and the most needed guidance throughout the duration of the programme.

I am extremely grateful to my project guides Mr. Rajesh Yadav for their valuable guidance and
necessary support during each phase of the project. She was the source of continuous
encouragement as each milestone was crossed.

A special thanks to the University of Mumbai for having prescribed this project work to me as a
part of the academic requirement in the Final year of Bachelor of Science in Computer Science.

Finally I also owe to my fellow friends who have been a constant source of help to solve the
problems that cropped up during the project development process.

Avinash Vishwakarma

V.K Krishna Menon College of Science and Commerce


3
Avinash Vishwakarma - 61

OVERVIEW

An online ordering system is software that lets your restaurant accept and manage orders placed
online. An online food ordering system generally has two components – a website or app that
allows customers to view the menu and place an order, and an admin interface that enables the
restaurant to receive and fulfil customer orders.

Online food ordering systems are a great option for restaurants looking to respond to a rapidly
changing operating environment – and most are relatively easy to set up. If you’ve been
considering adding an online sales channel to your restaurant but you’re not sure where to start,
read on for insights and tips on choosing the right online ordering system for your business.

V.K Krishna Menon College of Science and Commerce


4
Avinash Vishwakarma - 61

ABSTRACT

Our proposed system is an online food ordering system that enables ease for the customers. It
overcomes the disadvantages of the traditional queueing system. Our proposed system is a
medium to order online food hassle free from restaurants as well as mess service. This
system improves the method of taking the order from customer. The online food ordering system
sets up a food menu online and customers can easily place the order as per their wish. Also with
a food menu, customers can easily track the orders. This system also provides a feedback system
in which user can rate the food items. Also, the proposed system can recommend hotels,
food, based on the ratings given by the user, the hotel staff will be informed for the
improvements along with the quality. The payment can be made online or pay-on-delivery
system. For more secured ordering separate accounts are maintained for each user by
providing them an ID and a password.

V.K Krishna Menon College of Science and Commerce


5
Avinash Vishwakarma - 61

Declaration
I declare that this written submission represents my own ideas in my own words and
where others ideas or words have been included, I have adequately cited and referenced the
original sources. I also declare that I have adhered to all principles of academic honesty and
integrity and have not misrepresented or fabricated or falsified idea/fact/data/source in my
submission. I understand that any violation of the above will be cause for disciplinary action by
the Institute and can also evoke penal action from the sources which have thus not been properly
cited or from whom proper permission has not been taken when needed.

Avinash Vishwakarma

V.K Krishna Menon College of Science and Commerce


6
Avinash Vishwakarma - 61

OBJECTIVE

The general objectives of the study is to develop a reliable, convenient and accurate Ordering
System.

The study has the following specific objectives:

 To develop a system that will surely satisfied the customer service.


 To design a system able to accommodate huge amount of orders at a time
 To evaluate its performance and acceptability in terms of security, user-friendliness,
accuracy and reliability.
 To improve the communication between the client and the server and minimize the time
of ordering.

One of the main objectives of a restaurant to ensure customer satisfaction. Manual listing of
orders by the waiters/waitresses may result to slow response in customer service. Hence, if the
restaurant uses the proposed system, manipulation of orders to the customers be so easy and
quick by just touching on the tablet and choosing the desired menu.

 To automatically compute the bill.

The system will also automatically calculate and displays the final bill so the bills will
ready to print without having any error because the information for that item is already inserted.

V.K Krishna Menon College of Science and Commerce


7
Avinash Vishwakarma - 61

INTRODUCTION

Objective of the project:

 To automate the complete system of flower shop through computer with maximum user
interactions.
 Design a system to easier and flexible to handle.
 Computerization can provide fast services to the customers.

Description of the current system:

 Current system is a manual system


 The current system needs numbers of staff and a lot of time consumption on the process.

Limitations of current system:

 The current system needs a number of registers for handling the records. This leads to tedious
manual labour.
 The calculation require a large amount of clerical time.
 The system is less reliable due to human errors that occur while entering data and during
calculations.

Description of the proposed system:

 The proposed system can overcome all the limitations of the current system.
 The prosed system provides proper security and reduce manual work.
 More accurate and reliable than the current system.
 Records are maintained in a database by which data can be accessed easily.

Advantages of the proposed system:

 Time delay for any process is reduced.


 Cost of establishment and maintenance are lower than a current system.
 Faster and more accurate retrieval of information.
 Simple and easy to manage
 More efficient and reliable than the current system.

V.K Krishna Menon College of Science and Commerce


8
Avinash Vishwakarma - 61

Requirement Specification
Software Requirement
 Operating System – Microsoft Windows 2010
 Application Software – Front end: HTML CSS JavaScript Back end: PHP Mysql

Hardware Requirement
 Processor - 1.6 GHz
 RAM – 4GB or more
 Disk Space – 3 GB or less

Data Requirement
 Name
 Email
 Password
 Phone number
 Address
 City
 State
 Country
 Pin Code

Fact finding questions


 Why do we need this new system?
 What is the scope of this new system?
 Do you have any specific feature in this system?

V.K Krishna Menon College of Science and Commerce


9
Avinash Vishwakarma - 61

Feasibility Study

After doing the project Online Food Ordering System, study and analyzing all the
existing or required functionalities of the system, the next task is to do the feasibility
study for the project. All projects are feasible - given unlimited resources and infinite
time.
Feasibility study includes consideration of all the possible ways to provide a solution to
the given problem. The proposed solution should satisfy all the user requirements and should be
flexible enough so that future changes can be easily done based on the future upcoming
requirements.

A. Economical Feasibility
This is a very important aspect to be considered while developing a project. We decided
the technology based on minimum possible cost factor.
 All hardware and software cost has to be borne by the organization.
 Overall we have estimated that the benefits the organization is going to receive from
the proposed system will surely overcome the initial costs and the later on running cost
for system.

B. Technical Feasibility
This included the study of function, performance and constraints that may affect the
ability to achieve an acceptable system. For this feasibility study, we studied complete
functionality to be provided in the system, as described in the System Requirement
Specification (SRS), and checked if everything was possible using different type of frontend
and backend plaformst.

C. Operational Feasibility
No doubt the proposed system is fully GUI based that is very user friendly and all inputs
to be taken all self-explanatory even to a layman. Besides, a proper training has been conducted
to let know the essence of the system to the users so that they feel comfortable with newsystem.
As far our study is concerned the clients are comfortable and happy as the system has cutdown
their loads and doing.

V.K Krishna Menon College of Science and Commerce


10
Avinash Vishwakarma - 61

GANTT CHART

V.K Krishna Menon College of Science and Commerce


11
Avinash Vishwakarma - 61

System Design Details


Event Table :-
SR Events Trigger Source Activity Response Destination
NO.
1 Register Sing UP Users Validating Successful Redirect to
Button data or login.php
Unsuccessful
message
2 Login Login User/Admin Validating redirect to home.php
Button data On home.php
successful else give
Login error
message
3 logout Logout User/Admin Ending Redirect to login.php
Button Login login.php
session
4 Cart Add to User On redirect to cart.php
cart button Validating successful cart.php else
data Login give error
message
5 Orders Seeing User Validating redirect to orders.php
orders data orders.php
button else give
error
message
6 Wishlist Add to User Validating redirect to wishlist.php
wishlist data On wishlist.php
button successful else give
Login error
message

V.K Krishna Menon College of Science and Commerce


12
Avinash Vishwakarma - 61

CASS DIAGRAM

V.K Krishna Menon College of Science and Commerce


13
Avinash Vishwakarma - 61

USE CASE DAIGRAM

V.K Krishna Menon College of Science and Commerce


14
Avinash Vishwakarma - 61

SEQUENCE DIAGRAM

V.K Krishna Menon College of Science and Commerce


15
Avinash Vishwakarma - 61

ACTIVITY DIAGRAM

USER SIDE:-

V.K Krishna Menon College of Science and Commerce


16
Avinash Vishwakarma - 61

ADMIN SIDE:-

V.K Krishna Menon College of Science and Commerce


17
Avinash Vishwakarma - 61

STATE DIAGRAM

USER SIDE:-

V.K Krishna Menon College of Science and Commerce


18
Avinash Vishwakarma - 61

ADMIN SIDE:-

V.K Krishna Menon College of Science and Commerce


19
Avinash Vishwakarma - 61

PACKAGE DIAGRAM:-

V.K Krishna Menon College of Science and Commerce


20
Avinash Vishwakarma - 61

DEPLOYMENT DIAGRAM:-

V.K Krishna Menon College of Science and Commerce


21
Avinash Vishwakarma - 61

CODE IMPLEMENTATION:-
Starting page of website:
Home.php

<?php
@include 'config.php'; session_start();
$user_id = $_SESSION['user_id'];
if(!isset($user_id)){ header('location:login.php');
}
if(isset($_POST['add_to_wishlist'])){
$product_id = $_POST['product_id'];
$product_name = $_POST['product_name'];
$product_price = $_POST['product_price'];
$product_image = $_POST['product_image'];
$check_wishlist_numbers = mysqli_query($conn, "SELECT * FROM `wishlist` WHERE
name = '$product_name' AND user_id = '$user_id'") or die('query failed');
$check_cart_numbers = mysqli_query($conn, "SELECT * FROM `cart` WHERE name =
'$product_name' AND user_id = '$user_id'") or die('query failed');
if(mysqli_num_rows($check_wishlist_numbers) > 0){ $message[] = 'Already added to
wishlist';
}elseif(mysqli_num_rows($check_cart_numbers) > 0){
$message[] = 'Already added to cart';
}else{
mysqli_query($conn, "INSERT INTO `wishlist`(user_id, pid, name, price, image)
VALUES('$user_id', '$product_id', '$product_name', '$product_price', '$product_image')") or
die('query failed');
$message[] = 'Product added to wishlist';
}
}
if(isset($_POST['add_to_cart'])){
$product_id = $_POST['product_id'];
$product_name = $_POST['product_name'];
$product_price = $_POST['product_price'];
V.K Krishna Menon College of Science and Commerce
22
Avinash Vishwakarma - 61

$product_image = $_POST['product_image'];
$product_quantity = $_POST['product_quantity'];
$check_cart_numbers = mysqli_query($conn, "SELECT * FROM `cart` WHERE name =
'$product_name' AND user_id = '$user_id'") or die('query failed');
if(mysqli_num_rows($check_cart_numbers) > 0){
$message[] = 'Already added to cart';
}else{
$check_wishlist_numbers = mysqli_query($conn, "SELECT * FROM `wishlist` WHERE
name = '$product_name' AND user_id = '$user_id'") or die('query failed');
if(mysqli_num_rows($check_wishlist_numbers) > 0){
mysqli_query($conn, "DELETE FROM `wishlist` WHERE name = '$product_name'
AND user_id = '$user_id'") or die('query failed');
}
mysqli_query($conn, "INSERT INTO `cart`(user_id, pid, name, price, quantity, image)
VALUES('$user_id', '$product_id', '$product_name', '$product_price', '$product_quantity',
'$product_image')") or die('query failed');
$message[] = 'Product added to cart';
}
}
?>
<!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</title>
<!-- font awesome cdn link -->
<link rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/fontawesome/6.0.0/css/all.min.css">
<!-- custom admin css file link -->
<link rel="stylesheet" href="css/style.css">
</head>
<body>
<?php @include 'header.php'; ?>
<section class="home">
<div class="content">
<h3>New Collections</h3>
<p>Fresh Flowers & Perfect Gifts for all Occasions</p>
<a href="about.php" class="btn">Discover more</a>
</div>
</section>
<section class="products">
<h1 class="title">Latest products</h1>
<div class="box-container">
<?php
V.K Krishna Menon College of Science and Commerce
23
Avinash Vishwakarma - 61

$select_products = mysqli_query($conn, "SELECT * FROM `products` LIMIT 6") or


die('query failed'); if(mysqli_num_rows($select_products) >
0){ while($fetch_products = mysqli_fetch_assoc($select_products)){
?>
<form action="" method="POST" class="box">
<a href="view_page.php?pid=<?php echo $fetch_products['id']; ?>" class="fas
faeye"></a>
<div class="price">₹<?php echo $fetch_products['price']; ?>/-</div>
<img src="uploaded_img/<?php echo $fetch_products['image']; ?>" alt="" class="image">
<div class="name"><?php echo $fetch_products['name']; ?></div>
<input type="number" name="product_quantity" value="1" min="0" class="qty">
<input type="hidden" name="product_id" value="<?php echo $fetch_products['id']; ?>">
<input type="hidden" name="product_name" value="<?php echo $fetch_products['name'];
?>">
<input type="hidden" name="product_price" value="<?php echo $fetch_products['price'];
?>">
<input type="hidden" name="product_image" value="<?php echo
$fetch_products['image']; ?>">
<input type="submit" value="add to wishlist" name="add_to_wishlist" class="optionbtn">
<input type="submit" value="add to cart" name="add_to_cart" class="btn">
</form>
<?php
}
}else{
echo '<p class="empty">no products added yet!</p>';
}
?>
</div>
<div class="more-btn">
<a href="shop.php" class="option-btn">load more</a>
</div>
</section>
<section class="home-contact">
<div class="content">
<h3>Have any questions?</h3>
<p>If you have a question or a comment, please call us on +91 7387 837 133 or email us at
[email protected] or use the form below to contact us..</p>
<a href="contact.php" class="btn">contact us</a>
</div>
</section>
<?php @include 'footer.php'; ?>
<script src="js/script.js"></script>
</body>
</html>
Header.php <?php
if(isset($message)){ foreach($message as $message){
V.K Krishna Menon College of Science and Commerce
24
Avinash Vishwakarma - 61

echo '
<div class="message">
<span>'.$message.'</span>
<i class="fas fa-times" onclick="this.parentElement.remove();"></i>
</div>
';
}
}
?>
<header class="header">
<div class="flex">
<a href="home.php" class="logo">Flowers</a>
<nav class="navbar">
<ul>
<li><a href="home.php">Home</a></li>
<li><a href="#">Pages +</a>
<ul>
<li><a href="about.php">About</a></li>
<li><a href="contact.php">Contact</a></li>
</ul>
</li>
<li><a href="shop.php">Shop</a></li>
<li><a href="orders.php">Orders</a></li>
<li><a href="#">Account +</a>
<ul>
<li><a href="login.php">Login</a></li>
<li><a href="register.php">Register</a></li>
</ul>
</li>
</ul>
</nav>
<div class="icons">
<div id="menu-btn" class="fas fa-bars"></div>
<a href="search_page.php" class="fas fa-search"></a>
<div id="user-btn" class="fas fa-user"></div>
<?php
$select_wishlist_count = mysqli_query($conn, "SELECT * FROM `wishlist` WHERE
user_id = '$user_id'") or die('query failed');
$wishlist_num_rows = mysqli_num_rows($select_wishlist_count);
?>
<a href="wishlist.php"><i class="fas fa-heart"></i><span>(<?php echo
$wishlist_num_rows; ?>)</span></a>
<?php
$select_cart_count = mysqli_query($conn, "SELECT * FROM `cart` WHERE user_id
= '$user_id'") or die('query failed');
$cart_num_rows = mysqli_num_rows($select_cart_count);
V.K Krishna Menon College of Science and Commerce
25
Avinash Vishwakarma - 61

?>
<a href="cart.php"><i class="fas fa-shopping-cart"></i><span>(<?php echo
$cart_num_rows; ?>)</span></a>
</div>
<div class="account-box">
<p>Username : <span><?php echo $_SESSION['user_name']; ?></span></p>
<p>Email : <span><?php echo $_SESSION['user_email']; ?></span></p>
<a href="logout.php" class="delete-btn">logout</a>
</div>
</div>
</header>
Footer.php
<section class="footer">
<div class="box-container">
<div class="box">
<h3>Quick links</h3>
<a href="home.php">Home</a>
<a href="about.php">About</a>
<a href="contact.php">Contact</a>
<a href="shop.php">Shop</a>
</div>
<div class="box">
<h3>Extra links</h3>
<a href="login.php">Login</a>
<a href="register.php">Register</a>
<a href="orders.php">My Orders</a>
<a href="cart.php">My Cart</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 - 123-456 </p> </div>
</div>
</section>
About.php
<?php
@include 'config.php'; session_start();
$user_id = $_SESSION['user_id'];
if(!isset($user_id)){ header('location:login.php');
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
V.K Krishna Menon College of Science and Commerce
26
Avinash Vishwakarma - 61

<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>
<!-- font awesome cdn link -->
<link rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/fontawesome/6.0.0/css/all.min.css">
<!-- custom admin css file link -->
<link rel="stylesheet" href="css/style.css">
</head>
<body>
<?php @include 'header.php'; ?>
<section class="heading">
<h3>About us</h3>
<p> <a href="home.php">Home</a> / About </p>
</section>
<section class="about">
<div class="flex">
<div class="image">
<img src="images/about-img-1.png" alt="">
</div>
<div class="content">
<h3>Why choose us?</h3>
<p> We want you to be completely satisfied with our services. We will do whatever it
takes to make you happy. No hassles, no problems.</p>
<a href="shop.php" class="btn">shop now</a>
</div>
</div>
<div class="flex">
<div class="content">
<h3>What we provide?</h3>
<p>We provide cut flowers and floral arrangements for all these occasions. They not
only offer people beautiful flowers, but they help arrange flowers so they look good and make
recommendations if customers aren’t sure of what to get.</p>
<a href="contact.php" class="btn">Contact us</a>
</div>
<div class="image">
<img src="images/about-img-2.jpg" alt="">
</div>
</div>
<div class="flex">
<div class="image">
<img src="images/about-img-3.jpg" alt="">
</div>
<div class="content">
<h3>who we are?</h3>
V.K Krishna Menon College of Science and Commerce
27
Avinash Vishwakarma - 61

<p> We are family owned and operated with 1 location. We are committed to offering
only the finest floral arrangements and gifts, backed by service that is friendly and prompt.
Because all of our customers are important, our professional staff is dedicated to making your
experience a pleasant one. That is why we always go the extra mile to make your floral gift
perfect.</p>
<a href="#reviews" class="btn">clients reviews</a>
</div>
</div>
</section>
<section class="reviews" id="reviews">
<h1 class="title">Client's reviews</h1>
<div class="box-container">
<div class="box">
<img src="images/images (1).jpg" alt="">
<p>This is the best. On time delivery. Literally happy with experience . </p>
<div class="stars">
<i class="fas fa-star"></i>
<i class="fas fa-star"></i>
<i class="fas fa-star"></i>
<i class="fas fa-star"></i> <i class="fas fa-star"></i>
</div>
<h3>Arnel</h3>
</div>
<div class="box">
<img src="images/images.jpg" alt="">
<p>Excellent service and what arrived is exactly as on site. Highly recommend.</p>
<div class="stars">
<i class="fas fa-star"></i>
<i class="fas fa-star"></i>
<i class="fas fa-star"></i>
<i class="fas fa-star"></i>
<i class="fas fa-star-half-alt"></i>
</div>
<h3>Mary</h3>
</div>
<div class="box">
<img src="images/images (3).jpg" alt="">
<p>Delivery was on time and exactly as it was shown in the photo.</p>
<div class="stars">
<i class="fas fa-star"></i>
<i class="fas fa-star"></i>
<i class="fas fa-star"></i>
<i class="fas fa-star"></i>
<i class="fas fa-star-half-alt"></i>
</div>
<h3>Shane<h3>
V.K Krishna Menon College of Science and Commerce
28
Avinash Vishwakarma - 61

</div>
<div class="box">
<img src="images/images (5).jpg" alt="">
<p>The flowers arrived in good time and were beautiful and fresh</p>
<div class="stars">
<i class="fas fa-star"></i>
<i class="fas fa-star"></i> <i class="fas fa-star"></i> <i class="fas
fa-star"></i>
<i class="fas fa-star-half-alt"></i>
</div>
<h3>Yumna</h3>
</div>
<div class="box">
<img src="images/download (8).jpg" alt="">
<p>I had to place a last min order for same day delivery, great customer service.</p>
<div class="stars">
<i class="fas fa-star"></i>
<i class="fas fa-star"></i> <i class="fas fa-star"></i> <i class="fas
fa-star"></i>
<i class="fas fa-star-half-alt"></i>
</div>
<h3>Rakesh</h3>
</div>
<div class="box">
<img src="images/images (7).jpg" alt="">
<p>Awesome service friendly people and items delivered on time... keep up the great
work </p>
<div class="stars">
<i class="fas fa-star"></i>
<i class="fas fa-star"></i>
<i class="fas fa-star"></i>
<i class="fas fa-star"></i>
<i class="fas fa-star-half-alt"></i>
</div>
<h3>Lisa</h3>
</div>
</div>
</section>
<?php @include 'footer.php'; ?>

<script src="js/script.js"></script>
</body>
</html>
Contact.php
<?php
@include 'config.php'; session_start();
V.K Krishna Menon College of Science and Commerce
29
Avinash Vishwakarma - 61

$user_id = $_SESSION['user_id'];
if(!isset($user_id)){ header('location:login.php');
};
if(isset($_POST['send'])){
$name = mysqli_real_escape_string($conn, $_POST['name']);
$email = mysqli_real_escape_string($conn, $_POST['email']);
$number = mysqli_real_escape_string($conn, $_POST['number']);
$msg = mysqli_real_escape_string($conn, $_POST['message']);
$select_message = mysqli_query($conn, "SELECT * FROM `message` WHERE name =
'$name' AND email = '$email' AND number = '$number' AND message = '$msg'") or die('query
failed'); if(mysqli_num_rows($select_message) > 0){
$message[] = 'Message sent already!';
}else{
mysqli_query($conn, "INSERT INTO `message`(user_id, name, email, number, message)
VALUES('$user_id', '$name', '$email', '$number', '$msg')") or die('query failed');
$message[] = 'Message sent successfully!';
}
}
?>
<!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>
<!-- font awesome cdn link -->
<link rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/fontawesome/6.0.0/css/all.min.css">
<!-- custom admin css file link -->
<link rel="stylesheet" href="css/style.css">
</head>
<body>
<?php @include 'header.php'; ?>
<section class="heading">
<h3>Contact us</h3>
<p> <a href="home.php">Home</a> / Contact </p>
</section>
<section class="contact">
<form action="" method="POST">
<h3>Send us message!</h3>
<input type="text" name="name" placeholder="Enter your name" class="box" required>
<input type="email" name="email" placeholder="Enter your email" class="box" required>
<input type="number" name="number" placeholder="Enter your number" class="box"
required>

V.K Krishna Menon College of Science and Commerce


30
Avinash Vishwakarma - 61

<textarea name="message" class="box" placeholder="Enter your message" required


cols="30" rows="10"></textarea>
<input type="submit" value="send message" name="send" class="btn">
</form>
</section>
<?php @include 'footer.php'; ?>
<script src="js/script.js"></script>
</body>
</html>
Shop.php

<?php
@include 'config.php'; session_start();
$user_id = $_SESSION['user_id'];
if(!isset($user_id)){ header('location:login.php');
};
if(isset($_POST['add_to_wishlist'])){
$product_id = $_POST['product_id'];
$product_name = $_POST['product_name'];
$product_price = $_POST['product_price'];
$product_image = $_POST['product_image'];
$check_wishlist_numbers = mysqli_query($conn, "SELECT * FROM `wishlist` WHERE
name = '$product_name' AND user_id = '$user_id'") or die('query failed');
$check_cart_numbers = mysqli_query($conn, "SELECT * FROM `cart` WHERE name =
'$product_name' AND user_id = '$user_id'") or die('query failed');
if(mysqli_num_rows($check_wishlist_numbers) > 0){ $message[] = 'Already added to
wishlist';
}elseif(mysqli_num_rows($check_cart_numbers) > 0){
$message[] = 'Already added to cart';
}else{
mysqli_query($conn, "INSERT INTO `wishlist`(user_id, pid, name, price, image)
VALUES('$user_id', '$product_id', '$product_name', '$product_price', '$product_image')") or
die('query failed');
$message[] = 'Product added to wishlist';
}
}
if(isset($_POST['add_to_cart'])){
$product_id = $_POST['product_id'];
$product_name = $_POST['product_name'];
$product_price = $_POST['product_price'];
$product_image = $_POST['product_image'];
$product_quantity = $_POST['product_quantity'];
$check_cart_numbers = mysqli_query($conn, "SELECT * FROM `cart` WHERE name =
'$product_name' AND user_id = '$user_id'") or die('query failed');
if(mysqli_num_rows($check_cart_numbers) > 0){
$message[] = 'Already added to cart';
V.K Krishna Menon College of Science and Commerce
31
Avinash Vishwakarma - 61

}else{
$check_wishlist_numbers = mysqli_query($conn, "SELECT * FROM `wishlist` WHERE
name = '$product_name' AND user_id = '$user_id'") or die('query failed');
if(mysqli_num_rows($check_wishlist_numbers) > 0){
mysqli_query($conn, "DELETE FROM `wishlist` WHERE name = '$product_name'
AND user_id = '$user_id'") or die('query failed');
}
mysqli_query($conn, "INSERT INTO `cart`(user_id, pid, name, price, quantity, image)
VALUES('$user_id', '$product_id', '$product_name', '$product_price', '$product_quantity',
'$product_image')") or die('query failed');
$message[] = 'Product added to cart';
}
}
?>
<!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>
<!-- font awesome cdn link -->
<link rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/fontawesome/6.0.0/css/all.min.css">
<!-- custom admin css file link -->
<link rel="stylesheet" href="css/style.css">
</head>
<body>
<?php @include 'header.php'; ?>
<section class="heading">
<h3>Our shop</h3>
<p> <a href="home.php">Home</a> / Shop </p>
</section>
<section class="products">
<h1 class="title">Latest Products</h1>
<div class="box-container">
<?php
$select_products = mysqli_query($conn, "SELECT * FROM `products`") or die('query
failed');
if(mysqli_num_rows($select_products) > 0){ while($fetch_products =
mysqli_fetch_assoc($select_products)){
?>
<form action="" method="POST" class="box">
<a href="view_page.php?pid=<?php echo $fetch_products['id']; ?>" class="fas
faeye"></a>
<div class="price">₹<?php echo $fetch_products['price']; ?>/-</div>
V.K Krishna Menon College of Science and Commerce
32
Avinash Vishwakarma - 61

<img src="uploaded_img/<?php echo $fetch_products['image']; ?>" alt="" class="image">


<div class="name"><?php echo $fetch_products['name']; ?></div>
<input type="number" name="product_quantity" value="1" min="0" class="qty">
<input type="hidden" name="product_id" value="<?php echo $fetch_products['id']; ?>">
<input type="hidden" name="product_name" value="<?php echo $fetch_products['name'];
?>">
<input type="hidden" name="product_price" value="<?php echo $fetch_products['price'];
?>">
<input type="hidden" name="product_image" value="<?php echo
$fetch_products['image']; ?>">
<input type="submit" value="add to wishlist" name="add_to_wishlist" class="optionbtn">
<input type="submit" value="add to cart" name="add_to_cart" class="btn">
</form>
<?php
}
}else{
echo '<p class="empty">no products added yet!</p>';
}
?>
</div>
</section>
<?php @include 'footer.php'; ?>
<script src="js/script.js"></script>
</body>
</html>
Orders.php
<?php
@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>
<!-- font awesome cdn link -->
<link rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/fontawesome/6.0.0/css/all.min.css">
<!-- custom admin css file link -->
<link rel="stylesheet" href="css/style.css">
</head>
<body>
<?php @include 'header.php'; ?>
V.K Krishna Menon College of Science and Commerce
33
Avinash Vishwakarma - 61

<section class="heading">
<h3>your orders</h3>
<p> <a href="home.php">Home</a> / Order </p>
</section>
<section class="placed-orders">
<h1 class="title">Placed Orders</h1>
<div class="box-container">
<?php
$select_orders = mysqli_query($conn, "SELECT * FROM `orders` WHERE user_id =
'$user_id'") or die('query failed'); if(mysqli_num_rows($select_orders) >
0){ while($fetch_orders = mysqli_fetch_assoc($select_orders)){
?>
<div class="box">
<p> Placed on : <span><?php echo $fetch_orders['placed_on']; ?></span> </p>
<p> Name : <span><?php echo $fetch_orders['name']; ?></span> </p>
<p> Number : <span><?php echo $fetch_orders['number']; ?></span> </p>
<p> Email : <span><?php echo $fetch_orders['email']; ?></span> </p>
<p> Address : <span><?php echo $fetch_orders['address']; ?></span> </p>
<p> Payment method : <span><?php echo $fetch_orders['method']; ?></span> </p>
<p> Your orders : <span><?php echo $fetch_orders['total_products']; ?></span> </p>
<p> Total price : <span>₹<?php echo $fetch_orders['total_price']; ?>/-</span> </p>
<p> Payment status : <span style="color:<?php if($fetch_orders['payment_status'] ==
'pending'){echo 'tomato'; }else{echo 'green';} ?>"><?php echo $fetch_orders['payment_status'];
?></span> </p>
</div>
<?php
}
}else{
echo '<p class="empty">no orders placed yet!</p>';
}
?>
</div>
</section>
<?php @include 'footer.php'; ?>
<script src="js/script.js"></script>
</body>
</html>
Register.php
<?php
@include 'config.php'; if(isset($_POST['submit'])){
$filter_name = filter_var($_POST['name'], FILTER_SANITIZE_STRING);
$name = mysqli_real_escape_string($conn, $filter_name);
$filter_email = filter_var($_POST['email'], FILTER_SANITIZE_STRING);
$email = mysqli_real_escape_string($conn, $filter_email);
$filter_pass = filter_var($_POST['pass'], FILTER_SANITIZE_STRING);
$pass = mysqli_real_escape_string($conn, md5($filter_pass));
V.K Krishna Menon College of Science and Commerce
34
Avinash Vishwakarma - 61

$filter_cpass = filter_var($_POST['cpass'], FILTER_SANITIZE_STRING);


$cpass = mysqli_real_escape_string($conn, md5($filter_cpass));
$select_users = mysqli_query($conn, "SELECT * FROM `users` WHERE email = '$email'")
or die('query failed'); if(mysqli_num_rows($select_users) > 0){
$message[] = 'User already exist!';
}else{ if($pass != $cpass){
$message[] = 'Confirm password not matched!';
}else{
mysqli_query($conn, "INSERT INTO `users`(name, email, password) VALUES('$name',
'$email', '$pass')") or die('query failed'); $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>
<!-- font awesome cdn link -->
<link rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/fontawesome/6.0.0/css/all.min.css">
<!-- custom css file link -->
<link rel="stylesheet" href="css/style.css">
</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="" method="post">
<h3>Register now</h3>
<input type="text" name="name" class="box" placeholder="Enter your username" 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>

V.K Krishna Menon College of Science and Commerce


35
Avinash Vishwakarma - 61

<input type="password" name="cpass" class="box" placeholder="Confirm your password"


required>
<input type="submit" class="btn" name="submit" value="register now">
<p>Already have an account? <a href="login.php">Login now</a></p>
</form>
</section>
</body>
</html>
Login.php

<?php
@include 'config.php'; session_start(); if(isset($_POST['submit'])){
$filter_email = filter_var($_POST['email'], FILTER_SANITIZE_STRING);
$email = mysqli_real_escape_string($conn, $filter_email);
$filter_pass = filter_var($_POST['pass'], FILTER_SANITIZE_STRING);
$pass = mysqli_real_escape_string($conn, md5($filter_pass));
$select_users = mysqli_query($conn, "SELECT * FROM `users` WHERE email = '$email'
AND password = '$pass'") or die('query failed'); if(mysqli_num_rows($select_users) > 0){
$row = mysqli_fetch_assoc($select_users); if($row['user_type'] == 'admin'){
$_SESSION['admin_name'] = $row['name'];
$_SESSION['admin_email'] = $row['email']; $_SESSION['admin_id'] = $row['id'];
header('location:admin_page.php');
}elseif($row['user_type'] == 'user'){
$_SESSION['user_name'] = $row['name'];
$_SESSION['user_email'] = $row['email']; $_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>
<!-- font awesome cdn link -->
<link rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/fontawesome/6.0.0/css/all.min.css">
<!-- custom css file link -->
<link rel="stylesheet" href="css/style.css">
V.K Krishna Menon College of Science and Commerce
36
Avinash Vishwakarma - 61

</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="" method="post">
<h3>Login now</h3>
<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="submit" class="btn" name="submit" value="login now">
<p>Don't have an account? <a href="register.php">Register now</a></p>
</form>
</section>
</body>
</html>
Cart.php
<?php
@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'];
mysqli_query($conn, "DELETE FROM `cart` WHERE id = '$delete_id'") or die('query
failed'); header('location:cart.php');
}
if(isset($_GET['delete_all'])){
mysqli_query($conn, "DELETE FROM `cart` WHERE user_id = '$user_id'") or die('query
failed'); header('location:cart.php');
};
if(isset($_POST['update_quantity'])){
$cart_id = $_POST['cart_id'];
$cart_quantity = $_POST['cart_quantity'];
mysqli_query($conn, "UPDATE `cart` SET quantity = '$cart_quantity' WHERE id =
'$cart_id'") or die('query failed');
$message[] = 'Cart quantity updated!';
}
?>
V.K Krishna Menon College of Science and Commerce
37
Avinash Vishwakarma - 61

<!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>Shopping cart</title>
<!-- font awesome cdn link -->
<link rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/fontawesome/6.0.0/css/all.min.css">
<!-- custom admin css file link -->
<link rel="stylesheet" href="css/style.css">
</head>
<body>
<?php @include 'header.php'; ?>
<section class="heading">
<h3>Shopping cart</h3>
<p> <a href="home.php">Home</a> / Cart </p>
</section>
<section class="shopping-cart">
<h1 class="title">Products Added</h1>
<div class="box-container">
<?php
$grand_total = 0;
$select_cart = mysqli_query($conn, "SELECT * FROM `cart` WHERE user_id =
'$user_id'") or die('query failed'); if(mysqli_num_rows($select_cart) >
0){ while($fetch_cart = mysqli_fetch_assoc($select_cart)){
?>
<div class="box">
<a href="cart.php?delete=<?php echo $fetch_cart['id']; ?>" class="fas fa-times"
onclick="return confirm('delete this from cart?');"></a>
<a href="view_page.php?pid=<?php echo $fetch_cart['pid']; ?>" class="fas fa-eye"></a>
<img src="uploaded_img/<?php echo $fetch_cart['image']; ?>" alt="" class="image">
<div class="name"><?php echo $fetch_cart['name']; ?></div>
<div class="price">₹<?php echo $fetch_cart['price']; ?>/-</div>
<form action="" method="post">
<input type="hidden" value="<?php echo $fetch_cart['id']; ?>" name="cart_id">
<input type="number" min="1" value="<?php echo $fetch_cart['quantity']; ?>"
name="cart_quantity" class="qty">
<input type="submit" value="update" class="option-btn" name="update_quantity">
</form>
<div class="sub-total"> Sub-total : <span>₹<?php echo $sub_total = ($fetch_cart['price'] *
$fetch_cart['quantity']); ?>/-</span> </div>
</div>
<?php
$grand_total += $sub_total;
V.K Krishna Menon College of Science and Commerce
38
Avinash Vishwakarma - 61

}
}else{
echo '<p class="empty">your cart is empty</p>';
}
?>
</div>
<div class="more-btn">
<a href="cart.php?delete_all" class="delete-btn <?php echo ($grand_total >
1)?'':'disabled' ?>" onclick="return confirm('delete all from cart?');">delete all</a> </div>
<div class="cart-total">
<p>Grand total : <span>₹<?php echo $grand_total; ?>/-</span></p>
<a href="shop.php" class="option-btn">Continue shopping</a>
<a href="checkout.php" class="btn <?php echo ($grand_total > 1)?'':'disabled' ?>">Proceed
to checkout</a>
</div>
</section>
<?php @include 'footer.php'; ?>
<script src="js/script.js"></script>
</body>
</html>
Wishlist.php
<?php
@include 'config.php'; session_start();
$user_id = $_SESSION['user_id'];
if(!isset($user_id)){ header('location:login.php');
}
if(isset($_POST['add_to_cart'])){
$product_id = $_POST['product_id'];
$product_name = $_POST['product_name'];
$product_price = $_POST['product_price'];
$product_image = $_POST['product_image'];
$product_quantity = 1;
$check_cart_numbers = mysqli_query($conn, "SELECT * FROM `cart` WHERE name =
'$product_name' AND user_id = '$user_id'") or die('query failed');
if(mysqli_num_rows($check_cart_numbers) > 0){
$message[] = 'Already added to cart';
}else{
$check_wishlist_numbers = mysqli_query($conn, "SELECT * FROM `wishlist` WHERE
name = '$product_name' AND user_id = '$user_id'") or die('query failed');
if(mysqli_num_rows($check_wishlist_numbers) > 0){
mysqli_query($conn, "DELETE FROM `wishlist` WHERE name = '$product_name'
AND user_id = '$user_id'") or die('query failed');
}
mysqli_query($conn, "INSERT INTO `cart`(user_id, pid, name, price, quantity, image)
VALUES('$user_id', '$product_id', '$product_name', '$product_price', '$product_quantity',
'$product_image')") or die('query failed');
V.K Krishna Menon College of Science and Commerce
39
Avinash Vishwakarma - 61

$message[] = 'Product added to cart';


}
}
if(isset($_GET['delete'])){
$delete_id = $_GET['delete']; mysqli_query($conn, "DELETE FROM `wishlist` WHERE id
=
'$delete_id'") or die('query failed'); header('location:wishlist.php');
}
if(isset($_GET['delete_all'])){
mysqli_query($conn, "DELETE FROM `wishlist` WHERE user_id = '$user_id'") or
die('query failed'); header('location:wishlist.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>Wishlist</title>
<!-- font awesome cdn link -->
<link rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/fontawesome/6.0.0/css/all.min.css">
<!-- custom admin css file link -->
<link rel="stylesheet" href="css/style.css">
</head>
<body>
<?php @include 'header.php'; ?>
<section class="heading">
<h3>Your wishlist</h3>
<p> <a href="home.php">Home</a> / Wishlist </p>
</section>
<section class="wishlist">
<h1 class="title">Products added</h1>
<div class="box-container">
<?php
$grand_total = 0;
$select_wishlist = mysqli_query($conn, "SELECT * FROM `wishlist` WHERE user_id =
'$user_id'") or die('query failed'); if(mysqli_num_rows($select_wishlist) >
0){ while($fetch_wishlist = mysqli_fetch_assoc($select_wishlist)){
?>
<form action="" method="POST" class="box">
<a href="wishlist.php?delete=<?php echo $fetch_wishlist['id']; ?>" class="fas fa-times"
onclick="return confirm('delete this from wishlist?');"></a>
<a href="view_page.php?pid=<?php echo $fetch_wishlist['pid']; ?>" class="fas
faeye"></a>
V.K Krishna Menon College of Science and Commerce
40
Avinash Vishwakarma - 61

<img src="uploaded_img/<?php echo $fetch_wishlist['image']; ?>" alt="" class="image">


<div class="name"><?php echo $fetch_wishlist['name']; ?></div>
<div class="price">₹<?php echo $fetch_wishlist['price']; ?>/-</div>
<input type="hidden" name="product_id" value="<?php echo $fetch_wishlist['pid']; ?>">
<input type="hidden" name="product_name" value="<?php echo $fetch_wishlist['name'];
?>">
<input type="hidden" name="product_price" value="<?php echo $fetch_wishlist['price'];
?>">
<input type="hidden" name="product_image" value="<?php echo $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>₹<?php echo $grand_total; ?>/-</span></p>
<a href="shop.php" class="option-btn">Continue shopping</a>
<a href="wishlist.php?delete_all" class="delete-btn <?php echo ($grand_total >
1)?'':'disabled' ?>" onclick="return confirm('delete all from wishlist?');">Delete all</a> </div>
</section>
<?php @include 'footer.php'; ?>
<script src="js/script.js"></script>
</body>
</html>
Search _page.php
<?php
@include 'config.php'; session_start();
$user_id = $_SESSION['user_id'];
if(!isset($user_id)){ header('location:login.php');
}
if(isset($_POST['add_to_wishlist'])){
$product_id = $_POST['product_id'];
$product_name = $_POST['product_name'];
$product_price = $_POST['product_price'];
$product_image = $_POST['product_image'];
$check_wishlist_numbers = mysqli_query($conn, "SELECT * FROM `wishlist` WHERE
name = '$product_name' AND user_id = '$user_id'") or die('query failed');
$check_cart_numbers = mysqli_query($conn, "SELECT * FROM `cart` WHERE name =

V.K Krishna Menon College of Science and Commerce


41
Avinash Vishwakarma - 61

'$product_name' AND user_id = '$user_id'") or die('query failed');


if(mysqli_num_rows($check_wishlist_numbers) > 0){ $message[] = 'Already added to
wishlist';
}elseif(mysqli_num_rows($check_cart_numbers) > 0){
$message[] = 'Already added to cart';
}else{
mysqli_query($conn, "INSERT INTO `wishlist`(user_id, pid, name, price, image)
VALUES('$user_id', '$product_id', '$product_name', '$product_price', '$product_image')") or
die('query failed');
$message[] = 'Product added to wishlist';
}
}
if(isset($_POST['add_to_cart'])){
$product_id = $_POST['product_id'];
$product_name = $_POST['product_name'];
$product_price = $_POST['product_price'];
$product_image = $_POST['product_image'];
$product_quantity = $_POST['product_quantity'];
$check_cart_numbers = mysqli_query($conn, "SELECT * FROM `cart` WHERE name =
'$product_name' AND user_id = '$user_id'") or die('query failed');
if(mysqli_num_rows($check_cart_numbers) > 0){
$message[] = 'Already added to cart';
}else{
$check_wishlist_numbers = mysqli_query($conn, "SELECT * FROM `wishlist` WHERE
name = '$product_name' AND user_id = '$user_id'") or die('query failed');
if(mysqli_num_rows($check_wishlist_numbers) > 0){
mysqli_query($conn, "DELETE FROM `wishlist` WHERE name = '$product_name'
AND user_id = '$user_id'") or die('query failed');
}
mysqli_query($conn, "INSERT INTO `cart`(user_id, pid, name, price, quantity, image)
VALUES('$user_id', '$product_id', '$product_name', '$product_price', '$product_quantity',
'$product_image')") or die('query failed');
$message[] = 'Product added to cart';
}
}
?>
<!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>
<!-- font awesome cdn link -->
<link rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/fontawesome/6.0.0/css/all.min.css">
V.K Krishna Menon College of Science and Commerce
42
Avinash Vishwakarma - 61

<!-- custom admin css file link -->


<link rel="stylesheet" href="css/style.css">
</head>
<body>
<?php @include 'header.php'; ?>
<section class="heading">
<h3>Search page</h3>
<p> <a href="home.php">Home</a> / Search </p>
</section>
<section class="search-form">
<form action="" method="POST">
<input type="text" class="box" placeholder="search products..." name="search_box">
<input type="submit" class="btn" value="search" name="search_btn">
</form>
</section>
<section class="products" style="padding-top: 0;">
<div class="box-container">
<?php if(isset($_POST['search_btn'])){
$search_box = mysqli_real_escape_string($conn, $_POST['search_box']);
$select_products = mysqli_query($conn, "SELECT * FROM `products` WHERE name
LIKE
'%{$search_box}%'") or die('query failed'); if(mysqli_num_rows($select_products) >
0){while($fetch_products = mysqli_fetch_assoc($select_products)){
?>
<form action="" method="POST" class="box">
<a href="view_page.php?pid=<?php echo $fetch_products['id']; ?>" class="fas
faeye"></a>
<div class="price">₹<?php echo $fetch_products['price']; ?>/-</div>
<img src="uploaded_img/<?php echo $fetch_products['image']; ?>" alt="" class="image">
<div class="name"><?php echo $fetch_products['name']; ?></div>
<input type="number" name="product_quantity" value="1" min="0" class="qty">
<input type="hidden" name="product_id" value="<?php echo $fetch_products['id']; ?>">
<input type="hidden" name="product_name" value="<?php echo $fetch_products['name'];
?>">
<input type="hidden" name="product_price" value="<?php echo $fetch_products['price'];
?>">
<input type="hidden" name="product_image" value="<?php echo
$fetch_products['image']; ?>">
<input type="submit" value="add to wishlist" name="add_to_wishlist" class="optionbtn">
<input type="submit" value="add to cart" name="add_to_cart" class="btn">
</form>
<?php
}
}else{
echo '<p class="empty">no result found!</p>';
}
V.K Krishna Menon College of Science and Commerce
43
Avinash Vishwakarma - 61

}else{
echo '<p class="empty">search something!</p>';
}
?>
</div>
</section>
<?php @include 'footer.php'; ?>
<script src="js/script.js"></script>
</body>
</html>
View_page.php
<?php
@include 'config.php'; session_start();
$user_id = $_SESSION['user_id'];
if(!isset($user_id)){ header('location:login.php');
};
if(isset($_POST['add_to_wishlist'])){
$product_id = $_POST['product_id'];
$product_name = $_POST['product_name'];
$product_price = $_POST['product_price'];
$product_image = $_POST['product_image'];
$check_wishlist_numbers = mysqli_query($conn, "SELECT * FROM `wishlist` WHERE
name = '$product_name' AND user_id = '$user_id'") or die('query failed');
$check_cart_numbers = mysqli_query($conn, "SELECT * FROM `cart` WHERE name =
'$product_name' AND user_id = '$user_id'") or die('query failed');
if(mysqli_num_rows($check_wishlist_numbers) > 0){ $message[] = 'already added to
wishlist';
}elseif(mysqli_num_rows($check_cart_numbers) > 0){
$message[] = 'already added to cart';
}else{
mysqli_query($conn, "INSERT INTO `wishlist`(user_id, pid, name, price, image)
VALUES('$user_id', '$product_id', '$product_name', '$product_price', '$product_image')") or
die('query failed');
$message[] = 'product added to wishlist';
}
}
if(isset($_POST['add_to_cart'])){
$product_id = $_POST['product_id'];
$product_name = $_POST['product_name'];
$product_price = $_POST['product_price'];
$product_image = $_POST['product_image'];
$product_quantity = $_POST['product_quantity'];
$check_cart_numbers = mysqli_query($conn, "SELECT * FROM `cart` WHERE name =
'$product_name' AND user_id = '$user_id'") or die('query failed');
if(mysqli_num_rows($check_cart_numbers) > 0){
$message[] = 'Already added to cart';
V.K Krishna Menon College of Science and Commerce
44
Avinash Vishwakarma - 61

}else{
$check_wishlist_numbers = mysqli_query($conn, "SELECT * FROM `wishlist` WHERE
name = '$product_name' AND user_id = '$user_id'") or die('query failed');
if(mysqli_num_rows($check_wishlist_numbers) > 0){
mysqli_query($conn, "DELETE FROM `wishlist` WHERE name = '$product_name'
AND user_id = '$user_id'") or die('query failed');
}
mysqli_query($conn, "INSERT INTO `cart`(user_id, pid, name, price, quantity, image)
VALUES('$user_id', '$product_id', '$product_name', '$product_price', '$product_quantity',
'$product_image')") or die('query failed');
$message[] = 'Product added to cart';
}
}
?>
<!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>Quick view</title>
<!-- font awesome cdn link -->
<link rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/fontawesome/6.0.0/css/all.min.css">
<!-- custom admin css file link -->
<link rel="stylesheet" href="css/style.css">
</head>
<body>
<?php @include 'header.php'; ?>
<section class="quick-view">
<h1 class="title">Product Details</h1>
<?php if(isset($_GET['pid'])){
$pid = $_GET['pid'];
$select_products = mysqli_query($conn, "SELECT * FROM `products` WHERE id =
'$pid'") or die('query failed'); if(mysqli_num_rows($select_products) >
0){ while($fetch_products = mysqli_fetch_assoc($select_products)){
?>
<form action="" method="POST">
<img src="uploaded_img/<?php echo $fetch_products['image']; ?>" alt="" class="image">
<div class="name"><?php echo $fetch_products['name']; ?></div>
<div class="price">₹<?php echo $fetch_products['price']; ?>/-</div>
<div class="details"><?php echo $fetch_products['details']; ?></div>
<input type="number" name="product_quantity" value="1" min="0" class="qty">
<input type="hidden" name="product_id" value="<?php echo $fetch_products['id']; ?>">
<input type="hidden" name="product_name" value="<?php echo $fetch_products['name'];
?>">
V.K Krishna Menon College of Science and Commerce
45
Avinash Vishwakarma - 61

<input type="hidden" name="product_price" value="<?php echo $fetch_products['price'];


?>">
<input type="hidden" name="product_image" value="<?php echo
$fetch_products['image']; ?>">
<input type="submit" value="add to wishlist" name="add_to_wishlist" class="optionbtn">
<input type="submit" value="add to cart" name="add_to_cart" class="btn">
</form>
<?php
}
}else{
echo '<p class="empty">no products details available!</p>';
}
}
?>
<div class="more-btn">
<a href="home.php" class="option-btn">Go to home page</a>
</div>
</section>
<?php @include 'footer.php'; ?>
<script src="js/script.js"></script>
</body>
</html>
Config.php
<?php
$conn = mysqli_connect('localhost','root','','shop_db') or die('connection failed'); ?>
Script.js
let userBox = document.querySelector('.header .flex .account-box');
document.querySelector('#user-btn').onclick = () =>{ userBox.classList.toggle('active');
navbar.classList.remove('active');
}

let navbar = document.querySelector('.header .flex .navbar'); document.querySelector('#menu-


btn').onclick = () =>{ navbar.classList.toggle('active'); userBox.classList.remove('active');
}
window.onscroll = () =>{ userBox.classList.remove('active');
navbar.classList.remove('active');
}
@import
url('https://fonts.googleapis.com/css2?family=Rubik:wght@300;400;500
;600&display=swap');
:root{
--pink:#e84393;
--red:#c0392b;
--orange:#f39c12;
--black:#333;
--white:#fff;
V.K Krishna Menon College of Science and Commerce
46
Avinash Vishwakarma - 61

--light-color:#666;
--light-white:#ccc;
--light-bg:#f5f5f5;
--border:.2rem solid var(--black);
--box-shadow:0 .5rem 1rem rgba(0,0,255,0);
} *{
font-family: 'Rubik', sans-serif; margin:0; padding:0; box-sizing: border-box; outline:
none; border:none; text-decoration: none; transition:all .2s linear;
}
*::selection{
background-color: var(--pink); color:var(--white);
}

*::-webkit-scrollbar{ height: .5rem; width: 1rem;


}
*::-webkit-scrollbar-track{ background-color: transparent;
}
*::-webkit-scrollbar-thumb{ background-color: var(--pink);
}
html{ font-size: 62.5%; overflow-x: hidden; scroll-behavior: smooth; scroll-padding-top:
6.5rem;
} body{
background: var(--light-bg);
} section{ padding:3rem 2rem;
} .message{ position: sticky; top:0; margin:0 auto; max-width: 1200px; background-
color: var(--light-bg); display: flex; align-items: center; padding:2rem; gap:1.5rem; z-
index: 10000; justify-content: space-between;
} .message span{ color:var(--black); font-size: 2rem; } .message i{ font-size: 2.5rem;
color:var(--red); cursor: pointer; } .message i:hover{ transform: rotate(90deg);
} .disabled{ pointer-events:none; opacity: .5; user-select: none;
}
.btn,
.delete-btn, .option-btn{ display: inline-block; border-radius: .5rem; margin-top: 1rem;
font-size: 1.8rem; color:var(--white); cursor: pointer; padding:1rem 3rem; text-transform:
capitalize;
} .btn{
background-color: var(--pink);
} .delete-btn{ background-color: var(--red);
} .option-btn{
background-color: var(--orange);
}
.btn:hover,
.delete-btn:hover, .option-btn:hover{ background-color: var(--black);
} .empty{ padding:1.5rem; font-size: 2rem; color:var(--red); border:var(--border); box-
shadow: var(--box-shadow); text-align: center; background-color: var(--white); border-
radius: .5rem; text-transform: capitalize;
V.K Krishna Menon College of Science and Commerce
47
Avinash Vishwakarma - 61

} .more-btn{ margin-top: 2rem; text-align: center;


} .heading{ display: flex; flex-flow: column; align-items: center; justify-content: center;
gap:1rem; background-color: var(--black); text-align: center; min-height: 25vh; } .heading
h3{ font-size: 5.5rem; color:var(--white); text-transform: uppercase;
} .heading p{ font-size: 2.5rem; color:var(--light-white);
} .heading p a{ color:var(--pink); } .heading p a:hover{ text-decoration: underline;
} .title{ text-align: center; margin-bottom: 2rem; color:var(--black); text-transform:
uppercase; font-size: 4rem; }
@keyframes
fadeIn{ 0%{ transform:
translateY(1rem);
}
} .form-container{ display: flex; align-items: center; justify-content: center; min-height:
100vh;
} .form-container form{ padding:2rem; border-radius: .5rem; border:var(--border);
background-color: var(--white); box-shadow: var(--box-shadow); width: 50rem; text-align:
center; }
.form-container form h3{ font-size: 2.5rem; text-transform: uppercase; color:var(--black);
margin-bottom: 1rem; }
.form-container form .box{ width: 100%; padding:1.2rem 1.4rem; font-size: 1.8rem;
color:var(--black); border:var(--border); background-color: var(--light-bg); margin:1rem 0;
border-radius: .5rem; }
.form-container form p{ margin-top: 1.5rem; font-size: 2rem; color:var(--light-color);
}
.form-container form p a{ color:var(--pink);
}
.form-container form p a:hover{ text-decoration: underline;
} .header{ position: sticky; top:0; left:0; right:0; background-color: var(--white); z-index:
1000; box-shadow: var(--box-shadow);
} .header .flex{ margin: 0 auto; display: flex; align-items: center; justify-content: space-
between; padding:1.5rem 2rem; max-width: 1200px; position: relative; } .header .flex
.logo{ font-size: 2.5rem; color:var(--pink);
}
.header .flex .navbar ul{ list-style: none;
}
.header .flex .navbar ul li{ float: left; position: relative;
}
.header .flex .navbar ul li a{ font-size: 2rem; padding:1rem 1.5rem; display: block;
color:var(--light-color); text-transform: capitalize;
}
.header .flex .navbar ul li a:hover{ background-color: var(--pink); color:var(--white);
}
.header .flex .navbar ul li ul{ position: absolute; left:0; width: 15rem; background-color:
var(--white); animation: fadeIn .2s linear; display: none;
}

48
V.K Krishna Menon College of Science and Commerce
Avinash Vishwakarma - 61

.header .flex .navbar ul li ul li{ width: 100%;

49
V.K Krishna Menon College of Science and Commerce
Avinash Vishwakarma - 61

.header .flex .navbar ul li:hover ul{ display: inline-block;


}
.header .flex .icons > *{ font-size: 2.5rem; margin-left: 2rem; color:var(--black); cursor:
pointer;
}
.header .flex .icons > *:hover{ color:var(--pink);
}
.header .flex .icons span{ font-size: 2rem; } #menu-btn{ display: none;
}
.header .flex .account-box{ position: absolute; top:120%; right:2rem; background-color:
var(--white); border:var(--border); text-align: center; box-shadow: var(--box-shadow);
padding:2rem; border-radius: .5rem; width: 33rem; display: none;
animation: fadeIn .2s linear;
}
.header .flex .account-box.active{ display: block;
}
.header .flex .account-box p{ padding-bottom: 1rem; font-size: 2rem; color:var(--light-
color); line-height: 1.5;
}
.header .flex .account-box p span{ color:var(--pink);
}
.header .flex .account-box .delete-btn{ margin-top: .5rem;
} .home{ min-height: 60vh;
background:url(../images/home-bg.png) no-repeat; background-size: cover; background-
position: center; display: flex; align-items: center; justify-content: center;
}
.home .content{ text-align: center;
}
.home .content h3{ text-transform: uppercase; color:var(--black); font-size: 5.5rem; }
.home .content p{ max-width: 60rem; margin:1rem auto; line-height:2; font-size: 1.7rem;
color:var(--light-color);
}
.products .box-container{ max-width: 1200px; margin:0 auto; display: grid;
grid-template-columns: repeat(auto-fit, 33rem); gap:1.5rem; align-items: flex-start;
justify-content: center;
}
.products .box-container .box{ background-color: var(--white); border:var(--border); box-
shadow: var(--box-shadow); border-radius: .5rem; padding:2rem; text-align: center;
position: relative;
}
.products .box-container .box .image{
height: 35rem; width: 100%; object-fit: cover;
}
.products .box-container .box .fa-eye, .products .box-container .box .price{ position: absolute;
top:1rem; border-radius: .5rem;

50
V.K Krishna Menon College of Science and Commerce
Avinash Vishwakarma - 61

.products .box-container .box .price{ font-size: 2rem; padding:1rem; background-color:


var(--pink); color:var(--white); left:1rem;
}
.products .box-container .box .fa-eye{ right:1rem; height: 4.5rem; width: 4.5rem; line-
height: 4.2rem; font-size: 2rem; background-color: var(--white); color:var(--black);
border:var(--border);
}
.products .box-container .box .fa-eye:hover{ background-color: var(--black); color:var(--
white);
}
.products .box-container .box .name{ margin:1rem; font-size: 2rem; color:var(--black);
}
.products .box-container .box .qty{ width: 100%; padding:1.2rem 1.4rem; font-size:
1.8rem; color:var(--black); border:var(--border); border-radius: .5rem; margin:.5rem 0;
}
.products .box-container .box .btn, .products .box-container .box .option-btn{ width: 100%; }
.quick-view form{ max-width: 60rem; padding:2rem; text-align: center; border:var(--
border); box-shadow: var(--border); border-radius: .5rem; background-color: var(--white);
margin:0 auto;
}
.quick-view form .image{ height: 33rem; border:var(--border); border-radius: .5rem;
}
.quick-view form .name{ margin:1rem 0; font-size: 2rem; color:var(--black);
}
.quick-view form .price{ color:var(--red); font-size: 2.5rem; padding:.5rem 0;
}
.quick-view form .details{ padding:1rem 0; font-size: 1.5rem; color:var(--light-color);
line-height: 2;
}
.quick-view form .qty{ width: 100%; padding:1.2rem 1.4rem; font-size: 1.8rem;
color:var(--black); border-radius: .5rem; border:var(--border); margin:.5rem 0; } .home-
contact{ background-color: var(--black); text-align: center; }
.home-contact .content{ max-width: 50rem; margin:0 auto; }
.home-contact .content h3{ text-transform: uppercase; color:var(--white); font-size: 3rem; }
.home-contact .content p{ line-height: 2; font-size: 1.5rem; color:var(--light-white);
padding:1rem 0;
}
.home-contact .content .btn:hover{ background-color: var(--white); color:var(--black); }
.about .flex{ max-width: 1200px; margin:0 auto; display: flex; align-items: center; flex-
wrap: wrap; gap:1.5rem; } .about .flex .image{ flex:1 1 40rem; }
.about .flex .image img{ width: 100%; }
.about .flex .content{ flex:1 1 40rem; text-align: center; }
.about .flex .content h3{ font-size: 3rem; text-transform: capitalize; color:var(--black);
}
.about .flex .content p{ padding:1rem 0; font-size: 1.5rem; color:var(--light-color); line-
height: 2;

V.K Krishna Menon College of Science and Commerce 51


Avinash Vishwakarma - 61

}
.about .flex:nth-child(2){ margin:3rem auto; flex-wrap: wrap-reverse;
}
.reviews .box-container{ max-width: 1200px; margin:0 auto; display: grid;
grid-template-columns: repeat(auto-fit, minmax(30rem, 1fr)); gap:1.5rem; align-items:
flex-start; justify-content: center;
}
.reviews .box-container .box{ padding:2rem; text-align: center; background-color: var(--
white); box-shadow: var(--box-shadow); border:var(--border); border-radius: .5rem;
}
.reviews .box-container .box img{ height: 10rem; width: 10rem; border-radius: 50%;
}
.reviews .box-container .box p{ padding:1rem 0; font-size: 1.5rem; color:var(--light-color);
line-height: 2;
}
.reviews .box-container .box .stars{ display: inline-block; background: var(--light-bg);
border-radius: .5rem; padding:1rem 1.5rem; border:var(--border);
}
.reviews .box-container .box .stars i{ color:var(--orange); font-size: 1.7rem; margin:0
.3rem;
}
.reviews .box-container .box h3{ font-size: 2rem; color:var(--black); margin-top: 1rem; }
.contact form{ max-width: 50rem; background-color: var(--white); border-radius: .5rem;box-
shadow: var(--box-shadow); border:var(--border); text-align: center; padding:2rem; margin:0
auto; } .contact form h3{ font-size: 2.5rem; margin-bottom: 1rem; color:var(-- black); text-
transform: uppercase;
} .contact form .box{ width: 100%; border-radius: .5rem; border:var(--border);
margin:1rem 0; padding:1.2rem 1.4rem; font-size: 1.8rem; color:var(--black);
background-color: var(--light-bg);
}
.contact form textarea{ height: 15rem; resize: none; } .search-form form{ max-width:
1200px; margin:0 auto; display: flex; align-items: center; gap:1rem;
}
.search-form form .box{
width: 100%; border:var(--border); background-color: var(--white); box-shadow: var(--
box-shadow); padding:1.2rem 1.4rem; font-size: 1.8rem; border-radius: .5rem;
}
.search-form form .btn{ margin-top: 0;
}
.wishlist .box-container{ max-width: 1200px; margin:0 auto; display: grid;
grid-template-columns: repeat(auto-fit, 33rem); gap:1.5rem; align-items: flex-start;
justify-content: center;
}
.wishlist .box-container .box{ padding:2rem; text-align: center; background-color: var(--
white); border:var(--border); box-shadow: var(--box-shadow); border-radius: .5rem;
position: relative;

V.K Krishna Menon College of Science and Commerce 52


Avinash Vishwakarma - 61

}
.wishlist .box-container .box .image{ height: 35rem; width: 100%; object-fit: cover;
}
.wishlist .box-container .box .fa-eye, .wishlist .box-container .box .fa-times{ position: absolute;
top:1rem; height: 4.5rem; width: 4.5rem; line-height: 4.3rem; font-size: 2rem; border-
radius: .5rem;
}
.wishlist .box-container .box .fa-eye{ right:1rem; border:var(--border); background-color:
var(--white); color:var(--black);
}
.wishlist .box-container .box .fa-eye:hover{ background-color: var(--black); color:var(--
white);
}
.wishlist .box-container .box .fa-times{ background-color: var(--red); color:var(--white);
}
.wishlist .box-container .box .fa-times:hover{ background-color: var(--black);
}
.wishlist .box-container .box .name{ font-size: 2rem; color:var(--black); margin:1rem 0;
}
.wishlist .box-container .box .price{ font-size: 2.5rem; color:var(--red); margin:.5rem 0;
}
.wishlist .wishlist-total{ max-width: 1200px; margin:0 auto; padding:2rem; text-align:
center; background-color: var(--white); border:var(--border); box-shadow: var(--box-
shadow); border-radius: .5rem; margin-top: 2rem;
}
.wishlist .wishlist-total p{ font-size: 2.5rem; color:var(--light-color); margin-bottom: 1rem;
}
.wishlist .wishlist-total p span{ color:var(--red);
}
.shopping-cart .box-container{ max-width: 1200px; margin:0 auto; display: grid;
grid-template-columns: repeat(auto-fit, 33rem); gap:1.5rem;
align-items: flex-start; justify-content: center;
}
.shopping-cart .box-container .box{ padding:2rem; text-align: center; background-color:
var(--white); border:var(--border); box-shadow: var(--box-shadow); border-radius: .5rem;
position: relative;
}
.shopping-cart .box-container .box .image{ height: 35rem; width: 100%; object-fit: cover;
}
.shopping-cart .box-container .box .fa-eye, .shopping-cart .box-container .box .fa-
times{ position: absolute; top:1rem; height: 4.5rem; width: 4.5rem; line-
height: 4.3rem; font-size: 2rem; border-radius: .5rem;
}
.shopping-cart .box-container .box .fa-eye{ right:1rem; border:var(--border); background-
color: var(--white); color:var(--black);
}

V.K Krishna Menon College of Science and Commerce 53


Avinash Vishwakarma - 61

.shopping-cart .box-container .box .fa-eye:hover{ background-color: var(--black); color:var(-


-white);
}
.shopping-cart .box-container .box .fa-times{ background-color: var(--red); color:var(--
white);
}
.shopping-cart .box-container .box .fa-times:hover{ background-color: var(--black);
}
.shopping-cart .box-container .box .name{ font-size: 2rem; color:var(--black); margin:1rem
0;
}
.shopping-cart .box-container .box .price{ font-size: 2.5rem; color:var(--red); margin:.5rem
0;
}
.shopping-cart .box-container .box .qty{ width: 9rem; padding:1.2rem 1.4rem; border-
radius: .5rem; border:var(--border); font-size: 1.8rem;
}
.shopping-cart .box-container .box .sub-total{ margin-top: 1.5rem; font-size: 2rem;
color:var(--light-color);
}
.shopping-cart .box-container .box .sub-total span{ color:var(--red);
}
.shopping-cart .cart-total{ max-width: 1200px; margin:0 auto; padding:2rem; text-align:
center; background-color: var(--white); border:var(--border); box-shadow: var(--box-
shadow); border-radius: .5rem; margin-top: 2rem;
}
.shopping-cart .cart-total p{ font-size: 2.5rem; color:var(--light-color); margin-bottom:
1rem;
}
.shopping-cart .cart-total p span{ color:var(--red); }
.display-order{ max-width: 1200px; margin:0 auto; text-align: center; padding-bottom: 0;
}
.display-order p{ display: inline-block; border-radius: .5rem; font-size: 2rem; color:var(--
black); padding:1rem 1.5rem; margin:.5rem; background-color: var(--white); box-
shadow: var(--box-shadow); border:var(--border); }
.display-order p span{ color:var(--red);
}
.display-order .grand-total{ margin-top: 2rem; font-size: 2.5rem; color:var(--light-color);
}
.display-order .grand-total span{ color:var(--red); } .checkout form{ background-color: var(--
white); border:var(--border); max-width: 1200px; margin:0 auto; border-radius: .5rem;
padding:2rem; box-shadow: var(--border);
} .checkout form h3{ padding:1.5rem; font-size: 2.5rem; margin-bottom: 2rem;
background-color: var(--black); color:var(--white); border-radius: .5rem; text-align: center;
text-transform: capitalize; }
.checkout form .flex{ display: flex; flex-wrap: wrap; gap:1.5rem;

V.K Krishna Menon College of Science and Commerce 54


Avinash Vishwakarma - 61

}
.checkout form .flex .inputBox{ flex:1 1 40rem;
}
.checkout form .flex .inputBox input, .checkout form .flex .inputBox select{ margin:1rem 0;
width: 100%;
background-color: var(--light-bg); padding:1.2rem 1.4rem; border:var(--border); font-
size: 1.8rem; color:var(--black); border-radius: .5rem;
}
.checkout form .flex .inputBox span{ font-size: 2rem; color:var(--light-color);
}
.placed-orders .box-container{ max-width: 1200px; margin:0 auto; display: flex; flex-
wrap: wrap; gap:1.5rem;
align-items: flex-start;
}
.placed-orders .box-container .box{ background-color: var(--white); padding:1rem 2rem;
border:var(--border); box-shadow: var(--box-shadow); flex:1 1 40rem; border-radius:
.5rem;
}
.placed-orders .box-container .box p{ margin: 1rem 0; font-size: 2rem; line-height: 1.5;
color:var(--light-color);
}
.placed-orders .box-container .box p span{ color:var(--pink);
} .footer{
background-color: var(--white);
}
.footer .box-container{ max-width: 1200px; margin:0 auto; display: grid;
grid-template-columns: repeat(auto-fit, minmax(27rem, 1fr));
gap:1.5rem;
align-items: flex-start;
}
.footer .box-container .box h3{ font-size: 2.2rem; color:var(--black); margin-bottom:
1.5rem; text-transform: uppercase; }
.footer .box-container a, .footer .box-container p{ font-size: 1.7rem; color:var(--light-color);
padding:1rem 0; display: block; }
.footer .box-container a i, .footer .box-container p i{ color:var(--pink); padding-right: 1rem;
}
.footer .box-container a:hover{ text-decoration: underline; color:var(--
pink); } .footer .credit{text-align: center; padding-top: 2.5rem; margin-top: 2.5rem;
border-top: var(--border);
font-size: 2rem; color:var(--light-color); } .footer .credit span{ color:var(--pink); }
@media (max-width:991px){ html{ font-size: 55%;
}
}
@media (max-width:768px){ #menu-btn{ display: inline-block; }
.header .flex{padding:2rem; }
.header .flex .navbar{ position: absolute; top:99%; left:0; right:0; background-color:

V.K Krishna Menon College of Science and Commerce 55


Avinash Vishwakarma - 61

var(--white); border-top: var(--border); border-bottom: var(--border);

V.K Krishna Menon College of Science and Commerce 56


Avinash Vishwakarma - 61

clip-path: polygon(0 0, 100% 0, 100% 0, 0 0);


}
.header .flex .navbar.active{
clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
}
.header .flex .navbar ul li{ width: 100%; padding:.5rem;
}
.header .flex .navbar ul li ul{ position: static; width: 100%; animation: none;
background-color: var(--light-bg);
}
.header .flex .navbar ul li ul li{ padding-left: 2rem;
}
.home .content h3{ font-size: 3.5rem;
}
}
@media (max-width:450px){ html{ font-size: 50%; } .heading h3{ font-size: 4rem;
} .title{ font-size: 3rem;
}
}
ADMIN PANEL
Admin_page.php
<?php
@include 'config.php'; session_start();
$admin_id = $_SESSION['admin_id'];
if(!isset($admin_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>Dashboard</title>
<!-- font awesome cdn link -->
<link rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/fontawesome/6.0.0/css/all.min.css">
<!-- custom admin css file link -->
<link rel="stylesheet" href="css/admin_style.css">
</head>
<body>
<?php @include 'admin_header.php'; ?>
<section class="dashboard">
<h1 class="title">Dashboard</h1>
<div class="box-container">
<div class="box">

V.K Krishna Menon College of Science and Commerce 57


Avinash Vishwakarma - 61

<?php
$total_pendings = 0;
$select_pendings = mysqli_query($conn, "SELECT * FROM `orders` WHERE
payment_status = 'pending'") or die('query failed'); while($fetch_pendings =
mysqli_fetch_assoc($select_pendings)){
$total_pendings += $fetch_pendings['total_price'];
};
?>
<h3>₹<?php echo $total_pendings; ?>/-</h3>
<p>total pendings</p>
</div>
<div class="box">
<?php
$total_completes = 0;
$select_completes = mysqli_query($conn, "SELECT * FROM `orders` WHERE
payment_status = 'completed'") or die('query failed'); while($fetch_completes =
mysqli_fetch_assoc($select_completes)){
$total_completes += $fetch_completes['total_price'];
};
?>
<h3>₹<?php echo $total_completes; ?>/-</h3>
<p>Completed payments</p>
</div>
<div class="box">
<?php
$select_orders = mysqli_query($conn, "SELECT * FROM `orders`") or die('query
failed');
$number_of_orders = mysqli_num_rows($select_orders);
?>
<h3><?php echo $number_of_orders; ?></h3>
<p>Orders placed</p>
</div>
<div class="box">
<?php
$select_products = mysqli_query($conn, "SELECT * FROM `products`") or die('query
failed');
$number_of_products = mysqli_num_rows($select_products);
?>
<h3><?php echo $number_of_products; ?></h3>
<p>Products added</p>
</div>
<div class="box">
<?php
$select_users = mysqli_query($conn, "SELECT * FROM `users` WHERE user_type =
'user'") or die('query failed');
$number_of_users = mysqli_num_rows($select_users);

V.K Krishna Menon College of Science and Commerce 58


Avinash Vishwakarma - 61

?>
<h3><?php echo $number_of_users; ?></h3>
<p>Normal users</p>
</div>
<div class="box">
<?php
$select_admin = mysqli_query($conn, "SELECT * FROM `users` WHERE user_type =
'admin'") or die('query failed');
$number_of_admin = mysqli_num_rows($select_admin);
?>
<h3><?php echo $number_of_admin; ?></h3>
<p>Admin users</p>
</div>
<div class="box">
<?php
$select_account = mysqli_query($conn, "SELECT * FROM `users`") or die('query
failed');
$number_of_account = mysqli_num_rows($select_account);
?>
<h3><?php echo $number_of_account; ?></h3>
<p>Total accounts</p>
</div>
<div class="box">
<?php
$select_messages = mysqli_query($conn, "SELECT * FROM `message`") or die('query
failed');
$number_of_messages = mysqli_num_rows($select_messages);
?>
<h3><?php echo $number_of_messages; ?></h3>
<p>New messages</p>
</div>
</div>
</section>
<script src="js/admin_script.js"></script>
</body>
</html>
Admin_header.php
<?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>
';
}
}

V.K Krishna Menon College of Science and Commerce 59


Avinash Vishwakarma - 61

?>
<header class="header">
<div class="flex">
<a href="admin_page.php" class="logo">Admin<span>Panel</span></a>
<nav class="navbar">
<a href="admin_page.php">Home</a>
<a href="admin_products.php">Products</a>
<a href="admin_orders.php">Orders</a>
<a href="admin_users.php">Users</a>
<a href="admin_contacts.php">Messages</a>
</nav>
<div class="icons">
<div id="menu-btn" class="fas fa-bars"></div>
<div id="user-btn" class="fas fa-user"></div>
</div>
<div class="account-box">
<p>Username : <span><?php echo $_SESSION['admin_name']; ?></span></p>
<p>Email : <span><?php echo $_SESSION['admin_email']; ?></span></p>
<a href="logout.php" class="delete-btn">Logout</a>
<div>New <a href="login.php">Login</a> | <a href="register.php">Register</a> </div>
</div>
</div>
</header>
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'];
mysqli_query($conn, "DELETE FROM `users` WHERE id = '$delete_id'") or die('query
failed');
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>Dashboard</title>
<!-- font awesome cdn link -->
<link rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/fontawesome/6.0.0/css/all.min.css">

V.K Krishna Menon College of Science and Commerce 60


Avinash Vishwakarma - 61

<!-- custom admin css file link -->


<link rel="stylesheet" href="css/admin_style.css">
</head>
<body>
<?php @include 'admin_header.php'; ?>
<section class="users">
<h1 class="title">Users account</h1>
<div class="box-container">
<?php
$select_users = mysqli_query($conn, "SELECT * FROM `users`") or die('query failed');
if(mysqli_num_rows($select_users) > 0){ while($fetch_users =
mysqli_fetch_assoc($select_users)){
?>
<div class="box">
<p>User id : <span><?php echo $fetch_users['id']; ?></span></p>
<p>Username : <span><?php echo $fetch_users['name']; ?></span></p>
<p>Email : <span><?php echo $fetch_users['email']; ?></span></p>
<p>User type : <span style="color:<?php if($fetch_users['user_type'] == 'admin'){ echo
'var(--orange)'; }; ?>"><?php echo $fetch_users['user_type']; ?></span></p>
<a href="admin_users.php?delete=<?php echo $fetch_users['id']; ?>" onclick="return
confirm('delete this user?');" class="delete-btn">delete</a>
</div>
<?php
}
}
?>
</div>
</section>
<script src="js/admin_script.js"></script>
</body>
</html>
Admin_products.php
<?php
@include 'config.php'; session_start();
$admin_id = $_SESSION['admin_id'];
if(!isset($admin_id)){ header('location:login.php');
};
if(isset($_POST['add_product'])){
$name = mysqli_real_escape_string($conn, $_POST['name']);
$price = mysqli_real_escape_string($conn, $_POST['price']);
$details = mysqli_real_escape_string($conn, $_POST['details']);
$image = $_FILES['image']['name'];
$image_size = $_FILES['image']['size'];
$image_tmp_name = $_FILES['image']['tmp_name'];
$image_folter = 'uploaded_img/'.$image;

V.K Krishna Menon College of Science and Commerce 61


Avinash Vishwakarma - 61

$select_product_name = mysqli_query($conn, "SELECT name FROM `products` WHERE


name = '$name'") or die('query failed'); if(mysqli_num_rows($select_product_name) > 0){
$message[] = 'product name already exist!';
}else{
$insert_product = mysqli_query($conn, "INSERT INTO `products`(name, details, price,
image) VALUES('$name', '$details', '$price', '$image')") or die('query failed');
if($insert_product){ if($image_size > 2000000){
$message[] = 'image size is too large!';
}else{
move_uploaded_file($image_tmp_name, $image_folter);
$message[] = 'product added successfully!';
}
}
}
}
if(isset($_GET['delete'])){
$delete_id = $_GET['delete'];
$select_delete_image = mysqli_query($conn, "SELECT image FROM `products` WHERE id
= '$delete_id'") or die('query failed');
$fetch_delete_image = mysqli_fetch_assoc($select_delete_image);
unlink('uploaded_img/'.$fetch_delete_image['image']);
mysqli_query($conn, "DELETE FROM `products` WHERE id = '$delete_id'") or die('query
failed');
mysqli_query($conn, "DELETE FROM `wishlist` WHERE pid = '$delete_id'") or die('query
failed');
mysqli_query($conn, "DELETE FROM `cart` WHERE pid = '$delete_id'") or die('query
failed');
header('location:admin_products.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>Products</title>
<!-- font awesome cdn link -->
<link rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/fontawesome/6.0.0/css/all.min.css">
<!-- custom admin css file link -->
<link rel="stylesheet" href="css/admin_style.css">
</head>
<body>
<?php @include 'admin_header.php'; ?>
<section class="add-products">

V.K Krishna Menon College of Science and Commerce 62


Avinash Vishwakarma - 61

<form action="" method="POST" enctype="multipart/form-data">


<h3>Add new product</h3>
<input type="text" class="box" required placeholder="enter product name" name="name">
<input type="number" min="0" class="box" required placeholder="enter product price"
name="price">
<textarea name="details" class="box" required placeholder="enter product details" cols="30"
rows="10"></textarea>
<input type="file" accept="image/jpg, image/jpeg, image/png" required class="box"
name="image">
<input type="submit" value="add product" name="add_product" class="btn">
</form>
</section>
<section class="show-products">
<div class="box-container">
<?php
$select_products = mysqli_query($conn, "SELECT * FROM `products`") or die('query
failed');
if(mysqli_num_rows($select_products) > 0){ while($fetch_products =
mysqli_fetch_assoc($select_products)){
?>
<div class="box">
<div class="price">₹<?php echo $fetch_products['price']; ?>/-</div>
<img class="image" src="uploaded_img/<?php echo $fetch_products['image']; ?>" alt="">
<div class="name"><?php echo $fetch_products['name']; ?></div>
<div class="details"><?php echo $fetch_products['details']; ?></div>
<a href="admin_update_product.php?update=<?php echo $fetch_products['id']; ?>"
class="option-btn">update</a>
<a href="admin_products.php?delete=<?php echo $fetch_products['id']; ?>" class="delete-
btn" onclick="return confirm('delete this product?');">delete</a>
</div>
<?php
}
}else{
echo '<p class="empty">no products added yet!</p>';
}
?>
</div>
</section>
<script src="js/admin_script.js"></script>
</body>
</html>
Admin_orders.php
<?php
@include 'config.php'; session_start();
$admin_id = $_SESSION['admin_id'];
if(!isset($admin_id)){ header('location:login.php');

V.K Krishna Menon College of Science and Commerce 63


Avinash Vishwakarma - 61

};
if(isset($_POST['update_order'])){
$order_id = $_POST['order_id'];
$update_payment = $_POST['update_payment'];
mysqli_query($conn, "UPDATE `orders` SET payment_status = '$update_payment' WHERE
id = '$order_id'") or die('query failed');
$message[] = 'payment status has been updated!';
}
if(isset($_GET['delete'])){ $delete_id = $_GET['delete'];
mysqli_query($conn, "DELETE FROM `orders` WHERE id = '$delete_id'") or die('query
failed');
header('location:admin_orders.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>Dashboard</title>
<!-- font awesome cdn link -->
<link rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/fontawesome/6.0.0/css/all.min.css">
<!-- custom admin css file link -->
<link rel="stylesheet" href="css/admin_style.css">
</head>
<body>
<?php @include 'admin_header.php'; ?>
<section class="placed-orders">
<h1 class="title">Placed orders</h1>
<div class="box-container">
<?php
$select_orders = mysqli_query($conn, "SELECT * FROM `orders`") or die('query failed');
if(mysqli_num_rows($select_orders) > 0){ while($fetch_orders =
mysqli_fetch_assoc($select_orders)){
?>
<div class="box">
<p> User id : <span><?php echo $fetch_orders['user_id']; ?></span> </p>
<p> Placed on : <span><?php echo $fetch_orders['placed_on']; ?></span> </p>
<p> Name : <span><?php echo $fetch_orders['name']; ?></span> </p>
<p> Number : <span><?php echo $fetch_orders['number']; ?></span> </p>
<p> Email : <span><?php echo $fetch_orders['email']; ?></span> </p>
<p> Address : <span><?php echo $fetch_orders['address']; ?></span> </p>
<p> Total products : <span><?php echo $fetch_orders['total_products']; ?></span> </p>
<p> Total price : <span>₹<?php echo $fetch_orders['total_price']; ?>/-</span> </p>

V.K Krishna Menon College of Science and Commerce 64


Avinash Vishwakarma - 61

<p> Payment method : <span><?php echo $fetch_orders['method']; ?></span> </p>


<form action="" method="post">
<input type="hidden" name="order_id" value="<?php echo $fetch_orders['id']; ?>">
<select name="update_payment">
<option disabled selected><?php echo $fetch_orders['payment_status']; ?></option>
<option value="pending">Pending</option>
<option value="completed">Completed</option>
</select>
<input type="submit" name="update_order" value="update" class="option-btn">
<a href="admin_orders.php?delete=<?php echo $fetch_orders['id']; ?>" class="delete-
btn" onclick="return confirm('delete this order?');">delete</a> </form>
</div>
<?php
}
}else{
echo '<p class="empty">no orders placed yet!</p>';
}
?>
</div>
</section>
<script src="js/admin_script.js"></script>
</body>
</html>
Admin_update_products.php
<?php
@include 'config.php'; session_start();
$admin_id = $_SESSION['admin_id'];
if(!isset($admin_id)){
header('location:login.php');
};
if(isset($_POST['update_product'])){ $update_p_id = $_POST['update_p_id'];
$name = mysqli_real_escape_string($conn, $_POST['name']);
$price = mysqli_real_escape_string($conn, $_POST['price']);
$details = mysqli_real_escape_string($conn, $_POST['details']);
mysqli_query($conn, "UPDATE `products` SET name = '$name', details = '$details', price =
'$price' WHERE id = '$update_p_id'") or die('query failed');
$image = $_FILES['image']['name'];
$image_size = $_FILES['image']['size'];
$image_tmp_name = $_FILES['image']['tmp_name'];
$image_folter = 'uploaded_img/'.$image; $old_image = $_POST['update_p_image'];
if(!empty($image)){ if($image_size > 2000000){
$message[] = 'Image file size is too large!';
}else{
mysqli_query($conn, "UPDATE `products` SET image = '$image' WHERE id =
'$update_p_id'") or die('query failed');
move_uploaded_file($image_tmp_name, $image_folter);

V.K Krishna Menon College of Science and Commerce 65


Avinash Vishwakarma - 61

unlink('uploaded_img/'.$old_image); $message[] = 'Image updated successfully!';


}
}
$message[] = 'Product updated successfully!';
}
?>
<!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>Update product</title>
<!-- font awesome cdn link -->
<link rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/fontawesome/6.0.0/css/all.min.css">
<!-- custom admin css file link -->
<link rel="stylesheet" href="css/admin_style.css">
</head>
<body>
<?php @include 'admin_header.php'; ?>
<section class="update-product">
<?php
$update_id = $_GET['update'];
$select_products = mysqli_query($conn, "SELECT * FROM `products` WHERE id =
'$update_id'") or die('query failed'); if(mysqli_num_rows($select_products) > 0){
while($fetch_products = mysqli_fetch_assoc($select_products)){
?>
<form action="" method="post" enctype="multipart/form-data">
<img src="uploaded_img/<?php echo $fetch_products['image']; ?>" class="image" alt="">
<input type="hidden" value="<?php echo $fetch_products['id']; ?>" name="update_p_id">
<input type="hidden" value="<?php echo $fetch_products['image']; ?>"
name="update_p_image">
<input type="text" class="box" value="<?php echo $fetch_products['name']; ?>" required
placeholder="update product name" name="name">
<input type="number" min="0" class="box" value="<?php echo $fetch_products['price'];
?>" required placeholder="update product price" name="price">
<textarea name="details" class="box" required placeholder="update product details" cols="30"
rows="10"><?php echo $fetch_products['details']; ?></textarea> <input type="file"
accept="image/jpg, image/jpeg, image/png" class="box" name="image">
<input type="submit" value="update product" name="update_product" class="btn">
<a href="admin_products.php" class="option-btn">Go back</a>
</form>
<?php
}
}else{

V.K Krishna Menon College of Science and Commerce 66


Avinash Vishwakarma - 61

echo '<p class="empty">No update product select</p>';


}
?>
</section>
<script src="js/admin_script.js"></script>
</body>
</html>
Admin_script.js
let navbar = document.querySelector('.header .flex .navbar'); let userBox =
document.querySelector('.header .flex .account-box'); document.querySelector('#menu-
btn').onclick = () =>{ navbar.classList.toggle('active'); userBox.classList.remove('active');
} document.querySelector('#user-btn').onclick = () =>{ userBox.classList.toggle('active');
navbar.classList.remove('active');
} window.onscroll = () =>{ navbar.classList.remove('active');
userBox.classList.remove('active');
}
Admin_style.css
@import
url('https://fonts.googleapis.com/css2?family=Rubik:wght@300;400;500;600&display=swap
');
:root{
--pink:#e84393;
--red:#c0392b;
--orange:#f39c12;
--black:#333;
--white:#fff;
--light-color:#666; --light-white:#ccc;
--light-bg:#f5f5f5;
--border:.2rem solid var(--black);
--box-shadow:0 .5rem 1rem rgba(0,0,0,.1);
} *{ font-family: 'Rubik', sans-serif; margin:0; padding:0; box-sizing: border-box;
outline: none; border:none; text-decoration: none;
transition:all .2s linear;
}
*::selection{ background-color: var(--pink); color:var(--white);
}
*::-webkit-scrollbar{ height: .5rem; width: 1rem;
}
*::-webkit-scrollbar-track{ background-color: transparent;
}
*::-webkit-scrollbar-thumb{ background-color: var(--pink);
}
html{ font-size: 62.5%; overflow-x: hidden; scroll-behavior: smooth; scroll-padding-top:
6.5rem;
}

body{
V.K Krishna Menon College of Science and Commerce
67
Avinash Vishwakarma - 61

background: var(--light-bg);
}
section{ padding:3rem 2rem;
}
.title{
text-align: center;
margin-bottom: 2rem;
color:var(--black); text-transform: uppercase; font-size: 4rem;
}
.btn,
.delete-btn,
.option-btn{
display: inline-block; border-radius: .5rem; margin-top: 1rem; font-size: 1.8rem;
color:var(--white); cursor: pointer;
padding:1rem 3rem;
text-transform: capitalize;
}
.message{
position: sticky; top:0;
margin:0 auto; max-width: 1200px; background-color: var(--light-bg);
display: flex; align-items: center; padding:2rem; gap:1.5rem; z-index: 10000; justify-
content: space-between;
}
.message span{
color:var(--black); font-size: 2rem;
}
.message i{ font-size: 2.5rem; color:var(--red); cursor: pointer;
}
.message i:hover{ transform: rotate(90deg);
}
.empty{ padding:1.5rem; font-size: 2rem; color:var(--red); border:var(--border); box-
shadow: var(--box-shadow);
text-align: center; background-color: var(--white); border-radius: .5rem; text-transform:
capitalize;
}
.btn{ background-color: var(--pink);
}
.delete-btn{ background-color: var(--red);
}
.option-btn{ background-color: var(--orange);
}
.btn:hover,
.delete-btn:hover,
.option-btn:hover{ background-color: var(--black);
}
@keyframes fadeIn{

V.K Krishna Menon College of Science and Commerce 68


Avinash Vishwakarma - 61

0%{ transform: translateY(1rem);


}
}
.header{
position: sticky; top:0; left:0; right:0; z-index: 1000; background-color: var(--white);
box-shadow: var(--box-shadow);
}
.header .flex{
display: flex; align-items: center; justify-content: space-between; padding:2rem; max-
width: 1200px; margin:0 auto; position: relative;
}
.header .flex .account-box{ position: absolute; top:120%; right:2rem; width: 33rem;
border-radius: .5rem; box-shadow: var(--box-shadow); background-color: var(--white);
padding:2rem;
text-align: center; border:var(--border); display: none; animation: fadeIn .2s linear;
}
.header .flex .account-box.active{ display: inline-block;
}
.header .flex .account-box p{ padding-bottom: 1rem;
font-size: 2rem; color:var(--light-color); line-height: 1.5;
}
.header .flex .account-box p
span{color:var(--pink);
}
.header .flex .account-box div{ font-size: 2rem; margin-top: 2rem;
color:var(--light-color);
}
.header .flex .account-box div a{ color:var(--orange);
}
.header .flex .account-box div a:hover{ text-decoration: underline;
}
.header .flex .icons div{ font-size: 2.5rem; margin-left: 1.7rem; cursor: pointer;
color:var(--black);
}
.header .flex .icons div:hover{ color:var(--pink);
}
.header .flex .navbar a{ margin:0 1rem; font-size: 2rem; color:var(--light-color);
}
.header .flex .navbar a:hover{ text-decoration: underline; color:var(--pink);
}
.header .flex .logo{ font-size: 2.5rem; color:var(--black);
}
.header .flex .logo span{ color:var(--pink);
}
#menu-
btn{ display:

V.K Krishna Menon College of Science and Commerce 69


Avinash Vishwakarma - 61

none;

V.K Krishna Menon College of Science and Commerce 70


Avinash Vishwakarma - 61

}
.dashboard .box-
container{display: grid;
grid-template-columns: repeat(auto-fit, minmax(27rem, 1fr)); gap:1.5rem; align-items:
flex-start;
max-width: 1200px; margin: 0 auto;
}
.dashboard .box-container .box{
text-align: center; border:var(--border); background-color: var(--white); box-shadow:
var(--box-shadow); padding:2rem; border-radius: .5rem;
}
.dashboard .box-container .box h3{
font-size: 4.5rem; color:var(--black);
}
.dashboard .box-container .box p{ padding:1.5rem; border-radius: .5rem; background-color:
var(--light-bg); color:var(--light-color); border:var(--border); margin-top: 2rem; font-size:
2rem;
}
.add-products form{ max-width: 50rem; border-radius: .5rem; background-color: var(--
white); border:var(--border); padding:2rem;
text-align: center; margin:0 auto; box-shadow: var(--box-shadow);
}
.add-products form h3{
font-size: 2.5rem; text-transform: uppercase;
color:var(--black);
margin-bottom: 1rem;
}
.add-products form .box{ width: 100%; margin:1rem 0; font-size: 1.8rem; color:var(--black);
border-radius: .5rem; background-color: var(--light-bg); padding:1.2rem 1.4rem;border:var(--
border);
}
.add-products form textarea{ height: 15rem; resize: none;
}
.show-products .box-
container{display: grid;
grid-template-columns: repeat(auto-fit, 30rem); gap:1.5rem; align-items: flex-start;
max-width: 1200px; margin: 0 auto; justify-content: center;
}
.show-products .box-
container .box{text-align: center;
padding:2rem; border:var(--border); background-color: var(--white); box-shadow: var(--
box-shadow); border-radius: .5rem; position: relative;
}
.show-products .box-container .box .image{ height: 30rem; margin-bottom: .5rem;
}

V.K Krishna Menon College of Science and Commerce 71


Avinash Vishwakarma - 61

.show-products .box-container .box .price{ background-color: var(--pink); position: absolute;


top:1rem; left:1rem; border-radius: .5rem; color:var(--white);
padding:1rem; font-size: 2rem;
}
.show-products .box-container .box .name{ margin:1rem 0; font-size: 2rem; color:var(--
black);
}
.show-products .box-container .box .details{
line-height: 1.5; color:var(--light-color); font-size: 1.5rem; padding:.5rem 0;
}
.update-product form{ max-width: 50rem; border-radius: .5rem; background-color: var(--
white); border:var(--border); padding:2rem;
text-align: center; margin:0 auto; box-shadow: var(--box-shadow);
}
.update-product form h3{
font-size: 2.5rem; text-transform: uppercase;
color:var(--black);
margin-bottom: 1rem;

}
.update-product form .box{ width: 100%; margin:1rem 0; font-size: 1.8rem; color:var(--
black); border-radius: .5rem; background-color: var(--light-bg); padding:1.2rem 1.4rem;
border:var(--border);
}
.update-product form textarea{ height: 15rem; resize: none;
}
.update-product .image{ height: 30rem; border:var(--border); border-radius: .5rem;
}
.placed-orders .box-
container{display: grid;
grid-template-columns: repeat(auto-fit, 33rem); gap:1.5rem; align-items: flex-start;
max-width: 1200px; margin: 0 auto; justify-content: center; .placed-orders .box-container
.box{ padding:2rem; border:var(--border); background-color: var(--white); box-shadow:
var(--box-shadow); border-radius: .5rem;
}
.placed-orders .box-container .box p{ margin-bottom: 1rem;
font-size: 2rem; color:var(--light-color);
}
.placed-orders .box-container .box p
span{color:var(--pink);
}
.placed-orders .box-container .box form{ margin-top: 1rem;
text-align: center;
}
.placed-orders .box-container .box form select{ width: 100%; border:var(--border);
padding:1.2rem 1.4rem;

V.K Krishna Menon College of Science and Commerce 72


Avinash Vishwakarma - 61

font-size: 1.8rem; color:var(--black); border:var(--border); border-radius: .5rem;


margin:.5rem 0; .users .box-container{
display: grid;
grid-template-columns: repeat(auto-fit, 33rem); gap:1.5rem; align-items: flex-start;
max-width: 1200px; margin: 0 auto; justify-content: center;
}
.users .box-container .box{ padding:2rem; border:var(--border); background-color: var(--
white); box-shadow: var(--box-shadow); border-radius: .5rem; text-align: center;
}
.users .box-container .box p{ font-size: 2rem; color:var(--light-color);
margin-bottom: 1rem;
line-height: 1.5;
}
.users .box-container .box p
span{color:var(--pink);
}
.users .box-container .box .delete-btn{ margin-top: .5;

.messages .box-
container{display: grid;
grid-template-columns: repeat(auto-fit, 33rem); gap:1.5rem; align-items: flex-start;
max-width: 1200px; margin: 0 auto; justify-content: center;
}
.messages .box-container .box{ padding:2rem; border:var(--border); background-color:
var(--white); box-shadow: var(--box-shadow); border-radius: .5rem;
}
.messages .box-container .box p{
font-size: 2rem; color:var(--light-color);
margin-bottom: 1rem;
line-height: 1.5;
}
.messages .box-container .box p
span{color:var(--pink);
}
@media (max-
width:991px){html{ font-
size: 55%;
}
}
@media (max-width:768px){ #menu-
btn{display: inline-block;
}
.header .flex .navbar{ position: absolute; top:99%; left:0; right:0; background-color:
var(--white); border-top: var(--border); border-bottom: var(--border); clip-path:
polygon(0 0, 100% 0, 100% 0, 0 0);
}

V.K Krishna Menon College of Science and Commerce 73


Avinash Vishwakarma - 61

.header .flex .navbar.active{ clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);

V.K Krishna Menon College of Science and Commerce 74


Avinash Vishwakarma - 61

}
.header .flex .navbar a{ margin:2rem;
display: block;
}
}
@media (max-
width:450px){html{ font-
size: 50%;
}
.title{
font-size: 3.5rem;
}
}

V.K Krishna Menon College of Science and Commerce 75


Avinash Vishwakarma - 61

DATABASE DESIGN:-

CART

ORDERS

V.K Krishna Menon College of Science and Commerce 76


Avinash Vishwakarma - 61

PRODUCTS

USERS

WHISLIST

MESSAGE

V.K Krishna Menon College of Science and Commerce 77


Avinash Vishwakarma - 61

SCREENSHOT

V.K Krishna Menon College of Science and Commerce 78


Avinash Vishwakarma - 61

V.K Krishna Menon College of Science and Commerce 79


Avinash Vishwakarma - 61

V.K Krishna Menon College of Science and Commerce 80


Avinash Vishwakarma - 61

V.K Krishna Menon College of Science and Commerce 81


Avinash Vishwakarma - 61

V.K Krishna Menon College of Science and Commerce 82


Avinash Vishwakarma - 61

V.K Krishna Menon College of Science and Commerce 83


Avinash Vishwakarma - 61

V.K Krishna Menon College of Science and Commerce 84


Avinash Vishwakarma - 61

Conclusion and future scope:-


Future enhancement
• In Future this system will be updated as an online application.

• Security will be extended to a higher level of security.

• In the Future, this system will be more user friendly. • More fields to store information would be available.

• In future, we could introduce premium memberships.

Conclusion
• In this busy world getting a flower is made easier through the website

• Order your favourite flowers just by sitting at home

Website is easy to use for everyone

References
https://stackoverflow.com/
https://www.youtube.com/
https://unsplash.com/
https://fonts.google.com/

V.K Krishna Menon College of Science and Commerce 85

You might also like