Flower Shop Management Project Report
Flower Shop Management Project Report
PROJECT REPORT
On
“Flower Shop Management”
Submitted By
Avinash Vishwakarma
CERTIFICATE
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
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.
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.
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
OBJECTIVE
The general objectives of the study is to develop a reliable, convenient and accurate Ordering
System.
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.
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.
INTRODUCTION
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.
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.
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.
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
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.
GANTT CHART
CASS DIAGRAM
SEQUENCE DIAGRAM
ACTIVITY DIAGRAM
USER SIDE:-
ADMIN SIDE:-
STATE DIAGRAM
USER SIDE:-
ADMIN SIDE:-
PACKAGE DIAGRAM:-
DEPLOYMENT DIAGRAM:-
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
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>
<?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
<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
<?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
}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
--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);
}
48
V.K Krishna Menon College of Science and Commerce
Avinash Vishwakarma - 61
49
V.K Krishna Menon College of Science and Commerce
Avinash Vishwakarma - 61
50
V.K Krishna Menon College of Science and Commerce
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;
}
.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);
}
}
.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:
<?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);
?>
<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>
';
}
}
?>
<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">
};
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>
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{
none;
}
.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;
}
}
.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;
.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);
}
}
.header .flex .navbar a{ margin:2rem;
display: block;
}
}
@media (max-
width:450px){html{ font-
size: 50%;
}
.title{
font-size: 3.5rem;
}
}
DATABASE DESIGN:-
CART
ORDERS
PRODUCTS
USERS
WHISLIST
MESSAGE
SCREENSHOT
• In the Future, this system will be more user friendly. • More fields to store information would be available.
Conclusion
• In this busy world getting a flower is made easier through the website
References
https://stackoverflow.com/
https://www.youtube.com/
https://unsplash.com/
https://fonts.google.com/