Web PROJECT ON
“Bookflix & chill”
SUBMITTED BY
Mr. Aman Kumar Singh
Third Year Bachelor of science
(COMPUTER SCIENCE)
UNDER THE GUIDaNCE OF
Dr Ashwin Mehata
ISMAIL YUSUF COLLEGE OF ARTS, SCIENCE AND
COMMERCE
Jogeshwari-(East) MUMBAI-400060
Government of Maharashtra’s
ISMAIL YUSUF COLLEGE
Jogeshwari (East), Mumbai-400060
DEPARTMENT OF COMPUTER SCIENCE
CERTIFICATE
This is to certify that the project entitled
“Bookflix & Chill”
is completed by Mr. Aman Kumar Singh
(Seat No:_____________)
Under the guidance of
Dr Ashwin Mehata
In partial fulfilment for the Degree of Bachelor of Science
(Computer Science) of University of Mumbai
____________________ ____________________ ____________________
Prof.Incharge Head External Examiner
INDEX
Sr.No. Content Page No.
1. Acknowledgement 8
2. Introduction / Preliminary Investigation 10
• Organisational Overview 10
• Description of the Existing System 10
• Description of the Proposed System 11
• Feasibility Study 11
• System Requirements: Software/hardware/data 13
• Gantt Chart 14
3. System Design details 15
• Finding Facts Techniques 15
• Use Case Diagram 16
• Entity Relationship Diagram 17
• Activity Diagram 17
• Class Diagram 18
• Sequence Diagram 18
• State Diagram 19
• Package Diagram 19
• Component Diagram 20
• System Coding Diagram 20
• Deployment Diagram 21
5. System Implementation 22
Program Description. 22
6. Results: 24
1. List of Tables with attributes and constraints 24
2.Test Cases, Test Data, and Test Results 27
3. Screen Shots 28
7. Code implementation. 37
8. Conclusion and Future Scope 74
9. References 74
10. Phase Completion table 74
Acknowledgement
The project of “Bookflix & Chill” has been a unique experience for me. I
am very thankful to the Department of Computer Science of the Government of
Maharashtra’s Ismail Yusuf College, which gave me the opportunity to take on
this project.
I express my gratitude to our Head of Department Prof. Nitin D. Shelke and
my project guide Dr Ashwin Mehata for her invaluable support and guidance
during the course of the project.
I am also very much thankful to the “UNIVERSITY OF MUMBAI” for
including the project work as part of the syllabus, without which I would not have
gained the experience of developing software as this.
Last but not the least, I would like to express my gratitude to my Friends for
their support and guidance throughout this venture.
Thanking You
Introduction/ Preliminary Investigation
• Organisational overview
The main objective of the project is to create an online book store
that allows users to search and purchase a book based on title,
author and subject. The selected books are displayed in a tabular
format and the user can order their books online through credit
card payment. The Administrator will have additional
functionalities when compared to the common user.
DESCRIPTION OF THE EXISTING SYSTEM
Previously people have to go shop by shop to search and buy the books,
which is really time consuming and very difficult to get your favourite
book.
People had to wait for long time to get the new launched book.
Its had take many days for books to come in peoples near by store.
People was facing problems to get their favourite authors books.
Existing System:
• The Records are maintained manually in registers for old
students
• Peoples have to search for books store by store
• I.e. its very time consuming
• If there is any popular book launched recently it's very hard to
get it.
• The owner has to manually keep updating information by
entering the details in the logbook.
• Chance of human errors and manipulation.
DESCRIPTION OF THE PROPOSED SYSTEM
The main objective of the Bookflix & Chill is to manage the details of Books,
Customers, Payments, Delivery, and Bills. It manages all the information about
Books, Stock, Bills, and Books. The project is totally built at the administrative
end and thus only the administrator is guaranteed access. The purpose of the
project is to build an application program to reduce the manual work of managing
Books, Customers, Stock, and Payment. It tracks all the details about the Payment,
Delivery, and Bills.
Advantages:
• Very fast and accurate.
• Easy to use and understand.
• Secure.
• Easy Navigation.
• Time and Paperwork saving since it is automated.
• Reports can be generated at any time within a few seconds
Scope of the proposed system:
• To provide users to purchase books online.
• To add/delete users, and manage their accounts.
• To reduce users' searching time.
• To provide a wide collection of book ranges.
• To provide a user-friendly environment.
• To provide acknowledgment to the user.
Feasibility Study
Depending on the result of the initial investigation the survey was expanded to a
more detailed feasibility study.
Feasibility is the process of defining exactly what is and what strategic
issues need to be considered to access its feasibility, or likelihood of succeeding.
Feasibility studies are useful both when starting a new business and identifying a
new opportunity for example for an existing business.
The feasibility study is a test of a system proposal according to its
workability and impact on the organisation, ability to meet user needs and
effective use of resources.
Technical Feasibility:
We can strongly say that it is technically feasible since there will not be
much difficulty in getting required for the development and maintaining the system
as well. All the resources needed for the development of software as well as the
maintenance of the same are available in the organisation here we are utilising the
resources which are available already.
Economical Feasibility:
The development of this application is highly economically feasible. The
organisation needed not to spend much money on the development of the
system already available. The only thing be done in making an environment for
development with is to be done is making an environment for development with
effective supervision. If we are doing we can attain the maximum usability of the
corresponding resources even after the development the organisation will not be in
a condition to invest more in the organisation, therefore, the system is
economically feasible.
Requirement Specification
Software Requirements:
• Programming language/ Scripting languages used: Php, MySQL
• IDE used: Microsoft Visual Studio Code
Hardware requirement(Min):
• Hard disk: 40 GB
• RAM: 1GB
• Processor Speed: 3.00GHz
• Processor: Pentium IV Processor and above.
Client Side Scripting:
• HTML
• CSS
• JavaScript
Server Side Scripting: PHP
Back-End Tool:
Back-end: MySQL
Testing Server: Apache
Other Software Used:
• Canva
• Xampp Server
Data Requirements:
• Insert /Update/Deletion the data in the application manually
• Import from the existing system.
Operating system compatibility:
• MS Windows: Windows 7 and above.
• Linux: Ubuntu 16.04 and above, etc.
•
Gantt Chart
Project Phase December January February March
Planning
Analysis
Design
Coding
Testing &
Implementation
Documentation
Purposed Duration
Actual Duration
System Design Details
FACT FINDING TECHNIQUES
What is Fact Finding?
Fact Finding is the formal process of using research, interviews, questionnaires, and other
techniques to collect information about systems, requirements, and preferences.
It is also called information gathering or data collection.
Who does it?
The System Analyst. The Analyst especially needs to develop a detective mentality to be able to
discern relevant facts.
What is its Significance in SDLC?
Tools, such as data and process models, document facts, and conclusions are drawn from facts. If
facts are not collected, tool scant be used effectively and efficiently.
When is it done?
System Development Life Cycle.
• System Analysis Phase
• Study Phase
• Definition Phase
• Selection Phase
•Design
• Post Implementation Review
What are the facts to be collected?
Any information System can be examined in terms of four building blocks:
• Data: The raw material used to create useful info.
• Processes: The activities that carry out the mission.
• Interfaces: How the system interacts with people.
• Geography: Where data is stored, processes & interfaces happen
Fact Finding Techniques
There are seven fact-finding techniques:
1. Study & sampling of existing documentation, forms and databases.
2. Research and Site visits.
3. Observation of the work environment.
4. Questionnaires
5. Interviews
6. Joint Application Development (JAD)
7. Rapid Application Development (RAD) an Analyst usually applies several of these techniques
during a
single systems project.
Use-Case diagram
Description of use-case diagram
Admin side use case diagram :
Its indicates that Admin can
• Add, Edit, Delete Questions .
• Delete, Update Users Account.
• Generate Report / Activity Logs Of Users.
Users side use case diagram :
Its indicates that User can
• Add books to cart.
• Order the books.
• Generate the Invoice of the orders.
• Contact to admin.
ER diagram
Activity diagram
Class diagram
Sequence Diagram
State diagram
Package diagram
System design
Component diagram
System coding
Deployment diagram
Program description
Bookflix & Chill
This program is designed to sell books online, to make it easy to
search for a particular book and get all the books in the same place.
Working
Admin login-
• Admin will log in to the website by entering their particular email
id and password.
• Then the Admin Panel window gets opens in the admin panel
Window there is one menu bar and short details about what is on
the website.
• There are four menus in the menubar of the Admin Panel window
Add Books, Messages, Users, and logout.
Users(Staff) Login-
• Users will log in to the website by entering their particular email
id and password.
• Then the Home page of the website window gets open where he
can see the description of books, add books to the cart, purchase
the books, order history, print the order invoice, and log out.
•
MenuBar
Admin
ADD BOOKS
When you click on add books on the menubar, a web form page gets
open to adding new books to the website.
Here you can give the Books name, Author name, Price, category, book
description, and choose an image of the book which will be displayed
on the website, and when you click on the add book the book will be
live on the website.
After uploading a new book to the website admin can edit the
informations and also can delete the book.
User Detail
When admin clicks on the user detail in the menu the information
about the user section gets open where he can update & Delete the
particular user.
Messages
When admin clicks on the message in the menu a section gets open
where the queries ask by the users are listed there.
User
Home
When a user login to the website he get redirected to the home page
where he can see the lots of books listed according to category.
Cart
When a user like the book and he wants to buy it he can click on the
shopping cart icon on the home page or on the books details page
when he clicks on that the particular book added to his cart. In the cart
page if users want to buy the book he can click on the Checkout Now
button then he will redirected to the checkout page where he has to fill
the a small details form and choose a payment method then click on
buy now button then books will be ordered.
Orders
When user click on the order in menu page the order history page gets
open where all the details of the all orders displayed and user can print
the invoice of all the particular order.
Tables
Users Table
Books Table
Cart Table
Message Table
Orders Table
Confirm Orders Table
Test cases,Test data and test results
Sr
no
Test Cases Expected Result Actual
Result
Pass/Fail
1 Login
Test(Admin,Users)
Check for data in
table and login.
Output as
expected.
Pass
2 Insert records in
Database(Admin,Users)
Only Valid data
must
be Enter
Output as
expected.
Pass
3 Remove Data from
Database(Admin,Users)
Delete data as
per
Requirement
Output as
expected.
Pass
4 Update Data from Update data as Output as Pass
Database(Admin,Users) per
Requirement
expected.
5 Generate
invoice/datalist from
Database(Admin,Users)
Generate
invoice/datalist
as
per Requirement
Output as
expected.
Pass
Screen layouts
Admin and User registration page
Admin and User login page
User Screen layouts
User Home Page with category wise section
Single Book Details Page
Contact to Admin page
Cart Page
Checkout Page
Order History Page
Searching Page
Users Header & Footer Section
Admin Panel layouts
Admin Dashboard
Placed Order Page
Add Book Page
Books Details Page
Books Update Page
Message Box page
Users Details Page
User Update Page
Index_header.Php
<!DOCTYPE html>
<html lang="en">
<link rel="stylesheet" href="./css/hello.css">
<style>
.sub-menu-wrap{
position: fixed;
top: 9%;
right: -1%;
width: 320px;
max-height: 0px;
overflow: hidden;
transition: max-height 0.5s;
z-index: 100;
}
.sub-menu-wrap.open-menu{ max-height: 400px;
}
.sub-menu{
background: #fff;
padding: 20px;
margin: 10px;
border-bottom-right-radius: 16px;
border-bottom-left-radius: 16px;
}
.user-info{
display: flex;
align-items: center;
}
.user-info h3{
font-weight: 500;
}
.user-info img{
width: 60px;
border-radius: 50%;
margin-right: 15px;
}
.sub-menu hr{
border: 0;
height: 1px;
width: 100%;
background: #ccc;
margin: 15px 10px;
}
.sub-menu-link{
display: flex;
align-items: center;
text-decoration: none;
color: #525252;
margin: 12px e;
}
.sub-menu-link p{
width: 100%;
}
.sub-menu-link img{
width: 40px;
background: #e5e5e5;
border-radius: 50%;
padding: 8px;
margin-right: 15px;
}
.sub-menu-link span{
font-size: 22px;
transition: transform 0.5s;
}
.sub-menu-link:hover span{
transform: translateX(5px);
}
.sub-menu-link:hover p{
font-weight: 600;
}
.link_btn{
background-color: brown;
padding: 6px;
border-radius: 10px;
margin-left: 10px;
color: white;
font-weight: 500;
}
</style>
<body>
<header>
<div class="logo">
<a href="index.php"><span>Bookflix &</span>
<span class="me">Chill</span></a>
</div>
<div class="nav">
<a href="index.php">Home</a>
<div class="dropdown">
<button class="dropbtn">Category </button>
<div class="dropdown-content">
<a href="http://localhost/bookflix/index.php#New">New Arrived</a>
<a href="http://localhost/bookflix/index.php#Adventure">Adventure</a>
<a href="http://localhost/bookflix/index.php#Magical">Magic</a>
<a href="http://localhost/bookflix/index.php#Knowledge">Knowledge</a>
</div>
</div>
<a href="contact-us.php">Contact US</a>
<a href="cart.php">Cart</a>
<a href="orders.php">Orders</a>
</div>
<div class="user-box" style="display: flex; align-items:center;">
<a class="Btn" href="search_books.php"><img style="height:30px;" src="./images/sea2.png" alt=""></a>
<?php if(isset($_SESSION['user_name'])){echo' <img style="height:40px; margin-left:10px ;" src="images/ds2.png"
class="user-pic" onclick="toggleMenu()" />';}
else{
echo'<div class="use_links"><a class="link_Btn" style="background-color: rgb(0, 167, 245);
padding: 6px;
border-radius: 10px;
margin-left: 10px;
color: white;
font-weight: 500;" href="login.php">Login</a><a class="link_Btn" style="background-color: rgb(0, 167, 245);
padding: 6px;
border-radius: 10px;
margin-left: 10px;
color: white;
font-weight: 500;" href="register.php">Register</a></div>';
}?>
</div>
</header>
<div class="sub-menu-wrap" id="subMenu">
<div class="sub-menu">
<div class="user-info">
<img src="images/ds2.png" />
<div class="user-info" style="display: block;">
<h3>Hello, <?php echo $_SESSION['user_name']?></h3>
<h6><?php echo $_SESSION['user_email']?></h6>
</div>
</div>
<hr />
<a href="cart.php" class="sub-menu-link">
<p>Cart</p>
<span>></span>
</a>
<a href="contact-us.php" class="sub-menu-link">
<p>Contact Us</p>
<span>></span>
</a>
<a href="orders.php" class="sub-menu-link">
<p>Order history</p>
<span>></span>
</a>
<a href="logout.php" class="sub-menu-link">
<p style="background-color: red; border-radius:8px; text-align:center; color:white; font-weight:600; margin-
top:5px; padding:5px;">Logout</p>
</a>
</div>
</div>
<script>
let subMenu = document.getElementById("subMenu");
function toggleMenu(){ subMenu.classList.toggle("open-menu");
}
</script>
</body>
</html>
Index_footer.Php
<head>
<style>
* {
text-decoration: none;
list-style: none;
color: black;
}
footer {
background-color: rgba(0, 0, 0, 0.2);
}
h2 {
font-size: 20px;
font-weight: 700
}
.flex {
display: flex;
}
ul li:not(:first-child) {
padding: 5px;
}
.short_links ul {
margin: 0 110px;
}
.sub_main .dropdown .dropbtn {
border: none;
cursor: pointer;
}
/* The container <div> - needed to position the dropdown content */
.sub_main .dropdown {
position: relative;
display: inline-block;
}
/* Dropdown Content (Hidden by Default) */
.sub_main .dropdown .dropdown-content {
display: none;
position: absolute;
background-color: #CCCCCC;
min-width: 160px;
box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
z-index: 1;
}
/* Links inside the dropdown */
.sub_main .dropdown .dropbtn .dropdown-content a {
color: black;
padding: 12px 16px;
text-decoration: none;
display: block;
}
/* Change color of dropdown links on hover */
.sub_main .dropdown .dropbtn .dropdown-content a:hover {background-color: #f1f1f1}
/* Show the dropdown menu on hover */
.sub_main .dropdown:hover .dropdown-content {
display: flex;
flex-direction: column;
}
</style>
<link rel="stylesheet" href="./css/hello.css">
</head>
<footer style="margin: 30px auto 0;">
<div class="main" style="align-items:center; padding:40px; ">
<div class="sub_main">
<div class="short_links flex" style="justify-content:center; ">
<ul>
<h2>Quick Links</h2>
<li><a href="index.php">Home</a></li>
<li>
<div class="dropdown">
<a class="dropbtn">Category🔻</a>
<div class="dropdown-content">
<a href="index.php#Adventure">Adventure</a>
<a href="index.php#Magical">Magic</a>
<a href="index.php#Knowledge">Knowledge</a>
</div>
</div>
</li>
<li><a href="about-us.php">About Us</a></li>
</ul>
<?php
if(isset($_SESSION['user_name'])){echo'
<ul class="account">
<h2>Account</h2>
<li><a href="">Profile</a></li>
<li><a href="cart.php">Cart</a></li>
<li><a href="orders.php">Order History</a></li>
<li><a href="logout.php">LogOut</a></li>
</ul>';}
?>
<ul>
<h2>Contact</h2>
<li><a href="contact-us.php">Contact Form</a></li>
<li>+91 5324851596</li>
<li>contact@bookflix.com</li>
<li>Address: Mumbai 400065</li>
</ul>
</div>
</div>
<div style=" align-items:center; justify-content:center; margin:20px 0 0 ;" class="cmsg flex">
<p>Designed By Aman Singh | Copyright &copy; <script>
document.write(new Date().getFullYear())
</script> All Rights are reserved by &nbsp</p>
<div style="font-size: 30px;" class="logo">
<a href="index.php"><span style="font-size: 15px;"> Bookflix & </span>
<span class="me" style="font-size: 15px;">Chill</span></a>
</div>
</div>
</div>
</footer>
config.Php
<?php
$conn = new mysqli('localhost','root','','bookflixdb') or die('Connection Failed'.mysqli_error($conn));
?>
register.Php
<?php
include 'config.php';
if(isset($_POST['submit'])) {
$name = mysqli_real_escape_string($conn, $_POST['Name']);
$Sname = mysqli_real_escape_string($conn, $_POST['Sname']);
$email = mysqli_real_escape_string($conn, $_POST['email']);
$password = mysqli_real_escape_string($conn, ($_POST['password']));
$cpassword = mysqli_real_escape_string($conn, ($_POST['cpassword']));
$user_type = $_POST['user_type'];
$select_users = $conn->query("SELECT * FROM users_info WHERE email = '$email'") or die('query failed');
if(mysqli_num_rows($select_users)!=0){
$message[]='User Already exits!';
}else{
if($password !=$cpassword){
$message[] = 'Confirm password not matched.';
}else{
mysqli_query($conn, "INSERT INTO users_info(`name`, `surname`, `email`, `password`, `user_type`)
VALUES('$name','$Sname','$email','$password','$user_type')") or die('Query failed');
$message[]='Registration Done 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" />
<link rel="stylesheet" href="css/register.css " />
<title>Register</title>
<style>
.container2 {
display: flex;
justify-content: center;
background-image: linear-gradient(45deg,
rgba(0, 0, 3, 0.1),
rgba(0, 0, 0, 0.5)), url(../bgimg/2.jpg);
background-repeat: no-repeat;
background-position: center;
background-size: cover;
height: 98vh;
}
</style>
<style>
.container form .link{
text-decoration: none; color:white; border-radius: 17px; padding: 8px 18px; margin: 0px 10px;
background: rgb(0, 0, 0); font-size: 20px;
}
.container form .link:hover{
background: rgb(0, 167, 245);
}
</style>
</head>
<body>
<?php
if(isset($message)){
foreach($message as $message){
echo '
<div class="message" id= "messages"><span>'.$message.'</span>
</div>
';
}
}
?>
<div class="container">
<form action="" method="post">
<h3 style="color:white">Register to Use <a href="index.php"><span>Bookflix &
</span><span>Chill</span></a></h3>
<input type="text" name="Name" placeholder="Enter Name" required class="text_field ">
<input type="text" name="Sname" placeholder="Enter Surname" required class="text_field">
<input type="email" name="email" placeholder="Enter Email Id" required class="text_field">
<input type="password" name="password" placeholder="Enter password" required class="text_field">
<input type="password" name="cpassword" placeholder="Confirm password" required class="text_field">
<select name="user_type" id="" required class="text_field">
<option value="User">User</option>
<option value="Admin">Admin</option>
</select>
<input type="submit" value="Register" name="submit" class="btn text_field">
<p>Already have a Account? <br> <a class="link" href="login.php">Login</a><a class="link"
href="index.php">Back</a></p>
</form>
</div>
<script>
setTimeout(() => {
const box = document.getElementById('messages');
// 👇️ hides element (still takes up space on page)
box.style.display = 'none';
}, 8000);
</script>
</body>
</html>
Iogin.Php
<?php
include 'config.php';
session_start();
if (isset($_POST['login'])) {
$email = mysqli_real_escape_string($conn, $_POST['email']);
$password = mysqli_real_escape_string($conn, $_POST['password']);
$select_users = $conn->query("SELECT * FROM users_info WHERE email = '$email' and password='$password' ") or
die('query failed');
if (mysqli_num_rows($select_users) ==1) {
$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_index.php');
} elseif ($row['user_type'] == 'User') {
$_SESSION['user_name'] = $row['name'];
$_SESSION['user_email'] = $row['email'];
$_SESSION['user_id'] = $row['Id'];
header('location:index.php');
}
}
else {
$message[] = 'Incorrect Email Id 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" />
<link rel="stylesheet" href="css/register.css" />
<title>Login Here</title>
<style>
.container form .link{
text-decoration: none; color:white; border-radius: 17px; padding: 8px 18px; margin: 0px 10px;
background: rgb(0, 0, 0); font-size: 20px;
}
.container form .link:hover{
background: rgb(0, 167, 245);
}
</style>
</head>
<body>
<?php
if(isset($message)){
foreach($message as $message){
echo '
<div class="message" id="messages"><span>'.$message.'</span>
</div>
';
}
}
?>
<div class="container">
<form action="" method="post">
<h3 style="color:white">login to <a href="index.php"><span>bookflix &
</span><span>Chill</span></a></h3>
<input type="email" name="email" placeholder="Enter Email Id" required class="text_field">
<input type="password" name="password" placeholder="Enter password" required class="text_field">
<input type="submit" value="Login" name="login" class="btn text_field">
<p>Don't have an Account? <br> <a class="link" href="Register.php">Sign Up</a><a class="link"
href="index.php">Back</a></p>
</form>
</div>
<script>
setTimeout(() => {
const box = document.getElementById('messages');
// 👇️ hides element (still takes up space on page)
box.style.display = 'none';
}, 8000);
</script>
</body>
</html>
logout.php
<?php
include 'config.php';
session_start();
session_unset();
session_destroy();
header('location:index.php');
?>
Index.php
<?php
include 'config.php';
error_reporting(0);
session_start();
$user_id = $_SESSION['user_id'];
if (isset($_POST['add_to_cart'])) {
if (!isset($user_id)) {
$message[] = 'Please Login to get your books';
} else {
$book_name = $_POST['book_name'];
$book_id = $_POST['book_id'];
$book_image = $_POST['book_image'];
$book_price = $_POST['book_price'];
$book_quantity = '1';
$total_price = number_format($book_price * $book_quantity);
$select_book = $conn->query("SELECT * FROM cart WHERE book_id= '$book_id' AND user_id='$user_id' ") or
die('query failed');
if (mysqli_num_rows($select_book) > 0) {
$message[] = 'This Book is alredy in your cart';
} else {
$conn->query("INSERT INTO cart (`user_id`,`book_id`,`name`, `price`, `image`,`quantity` ,`total`)
VALUES('$user_id','$book_id','$book_name','$book_price','$book_image','$book_quantity', '$total_price')") or
die('Add to cart Query failed');
$message[] = 'Book Added To Cart Successfully';
header('location:index.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">
<link rel="stylesheet" href="css/hello.css">
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.0/dist/css/bootstrap.min.css" rel="stylesheet"
integrity="sha384-KyZXEAg3QhqLMpG8r+8fhAXLRk2vvoC2f3B09zVXn8CA5QIVfZOJ3BCsw2P0p/We" crossorigin="anonymous">
<link href="https://unpkg.com/tailwindcss@^1.0/dist/tailwind.min.css" rel="stylesheet" />
<title>Bookflix & Chill</title>
<style>
img {
border: none;
}
.message {
position: sticky;
top: 0;
margin: 0 auto;
width: 61%;
background-color: #fff;
padding: 6px 9px;
display: flex;
align-items: center;
justify-content: space-between;
z-index: 100;
gap: 0px;
border: 2px solid rgb(68, 203, 236);
border-top-right-radius: 8px;
border-bottom-left-radius: 8px;
}
.message span {
font-size: 22px;
color: rgb(240, 18, 18);
font-weight: 400;
}
.message i {
cursor: pointer;
color: rgb(3, 227, 235);
font-size: 15px;
}
</style>
</head>
<body>
<?php include 'index_header.php' ?>
<?php
if (isset($message)) {
foreach ($message as $message) {
echo '
<div class="message" id= "messages"><span>' . $message . '</span>
</div>
';
}
}
?>
<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-
KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js" integrity="sha384-
ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q" crossorigin="anonymous"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js" integrity="sha384-
JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous"></script>
<div id="carouselExampleIndicators" class="carousel slide" data-ride="carousel">
<ol class="carousel-indicators">
<li data-target="#carouselExampleIndicators" data-slide-to="0" class="active"></li>
<li data-target="#carouselExampleIndicators" data-slide-to="1"></li>
<li data-target="#carouselExampleIndicators" data-slide-to="2"></li>
</ol>
<div class="carousel-inner">
<div class="carousel-item active">
<img class="d-block w-100 " src="https://source.unsplash.com/2200x800/?books" alt="First
slide">
</div>
<div class="carousel-item">
<img class="d-block w-100" src="https://source.unsplash.com/2200x800/?novel books" alt="Second
slide">
</div>
<div class="carousel-item">
<img class="d-block w-100" src="https://source.unsplash.com/2200x800/?pyshological books"
alt="Third slide">
</div>
</div>
<a class="carousel-control-prev" href="#carouselExampleIndicators" role="button" data-slide="prev">
<span class="carousel-control-prev-icon" aria-hidden="true"></span>
<span class="sr-only">Previous</span>
</a>
<a class="carousel-control-next" href="#carouselExampleIndicators" role="button" data-slide="next">
<span class="carousel-control-next-icon" aria-hidden="true"></span>
<span class="sr-only">Next</span>
</a>
</div>
<section id="New">
<div class="container px-5 mx-auto">
<h2 class="m-8 font-extrabold text-4xl text-center border-t-2 " style="color: rgb(0, 167, 245);">
New Arrived
</h2>
</div>
</section>
<section class="show-products">
<div class="box-container">
<?php
$select_book = mysqli_query($conn, "SELECT * FROM `book_info` ORDER BY date DESC LIMIT 8") or
die('query failed');
if (mysqli_num_rows($select_book) > 0) {
while ($fetch_book = mysqli_fetch_assoc($select_book)) {
?>
<div class="box" style="width: 255px; height:355px;">
<a href="book_details.php?details=<?php echo $fetch_book['bid'];
echo '-name=', $fetch_book['name']; ?>"> <img
style="height: 200px;width: 125px;margin: auto;" class="books_images" src="added_books/<?php echo
$fetch_book['image']; ?>" alt=""></a>
<div style="text-align:left ;">
<div style="font-weight: 500; font-size:18px; text-align: center; " class="name">
<?php echo $fetch_book['name']; ?></div>
</div>
<div class="price">Price: ₹ <?php echo $fetch_book['price']; ?>/-</div>
<!-- <button name="add_cart"><img src="./images/cart2.png" alt=""></button> -->
<form action="" method="POST">
<input class="hidden_input" type="hidden" name="book_name" value="<?php echo
$fetch_book['name'] ?>">
<input class="hidden_input" type="hidden" name="book_id" value="<?php echo
$fetch_book['bid'] ?>">
<input class="hidden_input" type="hidden" name="book_image" value="<?php echo
$fetch_book['image'] ?>">
<input class="hidden_input" type="hidden" name="book_price" value="<?php echo
$fetch_book['price'] ?>">
<button onclick="myFunction()" name="add_to_cart"><img src="./images/cart2.png"
alt="Add to cart">
<a href="book_details.php?details=<?php echo $fetch_book['bid'];
echo '-name=', $fetch_book['name']; ?>"
class="update_btn">Know More</a>
</form>
<!-- <button name="add_to_cart" ><img src="./images/cart2.png" alt="Add to
cart"></button> -->
<!-- <input type="submit" name="add_cart" value="cart"> -->
</div>
<?php
}
} else {
echo '<p class="empty">no products added yet!</p>';
}
?>
</div>
</section>
<section id="Adventure">
</div>
<div class="container px-5 mx-auto">
<h2 class="text-gray-400 m-8 font-extrabold text-4xl text-center border-t-2 text-red-800"
style="color: rgb(0, 167, 245);" >
Adventure
</h2>
</div>
</section>
<section class="show-products">
<div class="box-container">
<?php
$select_book = mysqli_query($conn, "SELECT * FROM `book_info` where category='Adventure'") or
die('query failed');
if (mysqli_num_rows($select_book) > 0) {
while ($fetch_book = mysqli_fetch_assoc($select_book)) {
?>
<div class="box" style="width: 255px;height: 355px;">
<a href="book_details.php?details=<?php echo $fetch_book['bid'];
echo '-name=', $fetch_book['name']; ?>"> <img
style="height: 200px;width: 125px;margin: auto;" class="books_images" src="added_books/<?php echo
$fetch_book['image']; ?>" alt=""></a>
<div style="text-align:left ;">
<div style="font-weight: 500; font-size:18px; text-align: center; " class="name">
<?php echo $fetch_book['name']; ?></div>
</div>
<div class="price">Price: ₹ <?php echo $fetch_book['price']; ?>/-</div>
<!-- <button name="add_cart"><img src="./images/cart2.png" alt=""></button> -->
<form action="" method="POST">
<input class="hidden_input" type="hidden" name="book_name" value="<?php echo
$fetch_book['name'] ?>">
<input class="hidden_input" type="hidden" name="book_image" value="<?php echo
$fetch_book['image'] ?>">
<input class="hidden_input" type="hidden" name="book_price" value="<?php echo
$fetch_book['price'] ?>">
<button name="add_to_cart"><img src="./images/cart2.png" alt="Add to cart">
<a href="book_details.php?details=<?php echo $fetch_book['bid'];
echo '-name=', $fetch_book['name']; ?>"
class="update_btn">Know More</a>
</form>
<!-- <button name="add_to_cart" ><img src="./images/cart2.png" alt="Add to
cart"></button> -->
<!-- <input type="submit" name="add_cart" value="cart"> -->
</div>
<?php
}
} else {
echo '<p class="empty">no products added yet!</p>';
}
?>
</div>
</section>
<hr style="color: black; width:5px;">
<section id="Magical">
<div class="container px-5 mx-auto">
<h2 class="text-gray-400 m-8 font-extrabold text-4xl text-center border-t-2 text-red-
800"style="color: rgb(0, 167, 245);">
Magical
</h2>
</div>
</section>
<section class="show-products">
<div class="box-container">
<?php
$select_book = mysqli_query($conn, "SELECT * FROM `book_info` where category='Magic'") or
die('query failed');
if (mysqli_num_rows($select_book) > 0) {
while ($fetch_book = mysqli_fetch_assoc($select_book)) {
?>
<div class="box" style="width: 255px;height: 355px;">
<a href="book_details.php?details=<?php echo $fetch_book['bid'];
echo '-name=', $fetch_book['name']; ?>"> <img
style="height: 200px;width: 125px;margin: auto;" class="books_images" src="added_books/<?php echo
$fetch_book['image']; ?>" alt=""></a>
<div style="text-align:left ;">
<div style="font-weight: 500; font-size:18px; text-align: center;" class="name">
<?php echo $fetch_book['name']; ?></div>
</div>
<div class="price">Price: ₹ <?php echo $fetch_book['price']; ?>/-</div>
<!-- <button name="add_cart"><img src="./images/cart2.png" alt=""></button> -->
<form action="" method="POST">
<input class="hidden_input" type="hidden" name="book_name" value="<?php echo
$fetch_book['name'] ?>">
<input class="hidden_input" type="hidden" name="book_image" value="<?php echo
$fetch_book['image'] ?>">
<input class="hidden_input" type="hidden" name="book_price" value="<?php echo
$fetch_book['price'] ?>">
<button name="add_to_cart"><img src="./images/cart2.png" alt="Add to cart">
<a href="book_details.php?details=<?php echo $fetch_book['bid'];
echo '-name=', $fetch_book['name']; ?>"
class="update_btn">Know More</a>
</form>
<!-- <button name="add_to_cart" ><img src="./images/cart2.png" alt="Add to
cart"></button> -->
<!-- <input type="submit" name="add_cart" value="cart"> -->
</div>
<?php
}
} else {
echo '<p class="empty">no products added yet!</p>';
}
?>
</div>
</section>
<section id="Knowledge">
<div class="container px-5 mx-auto">
<h2 class="text-gray-400 m-8 font-extrabold text-4xl text-center border-t-2 text-red-800"
style="color: rgb(0, 167, 245);">
Knowledge
</h2>
</div>
</section>
<section class="show-products">
<div class="box-container">
<?php
$select_book = mysqli_query($conn, "SELECT * FROM `book_info` Where category='knowledge'") or
die('query failed');
if (mysqli_num_rows($select_book) > 0) {
while ($fetch_book = mysqli_fetch_assoc($select_book)) {
?>
<div class="box" style="width: 255px;height: 355px;">
<a href="book_details.php?details=<?php echo $fetch_book['bid'];
echo '-name=', $fetch_book['name']; ?>"> <img
style="height: 200px;width: 125px;margin: auto;" class="books_images" src="added_books/<?php echo
$fetch_book['image']; ?>" alt=""></a>
<div style="text-align:left ;">
<div style="font-weight: 500; font-size:18px; text-align: center;" class="name">
<?php echo $fetch_book['name']; ?></div>
</div>
<div class="price">Price: ₹ <?php echo $fetch_book['price']; ?>/-</div>
<!-- <button name="add_cart"><img src="./images/cart2.png" alt=""></button> -->
<form action="" method="POST">
<input class="hidden_input" type="hidden" name="book_name" value="<?php echo
$fetch_book['name'] ?>">
<input class="hidden_input" type="hidden" name="book_image" value="<?php echo
$fetch_book['image'] ?>">
<input class="hidden_input" type="hidden" name="book_price" value="<?php echo
$fetch_book['price'] ?>">
<button name="add_to_cart"><img src="./images/cart2.png" alt="Add to cart">
<a href="book_details.php?details=<?php echo $fetch_book['bid'];
echo '-name=', $fetch_book['name']; ?>"
class="update_btn">Know More</a>
</form>
<!-- <button name="add_to_cart" ><img src="./images/cart2.png" alt="Add to
cart"></button> -->
<!-- <input type="submit" name="add_cart" value="cart"> -->
</div>
<?php
}
} else {
echo '<p class="empty">no products added yet!</p>';
}
?>
</div>
</section>
<?php include 'index_footer.php'; ?>
<script>
setTimeout(() => {
const box = document.getElementById('messages');
// 👇️ hides element (still takes up space on page)
box.style.display = 'none';
}, 8000);
</script>
</body>
</html>
Book Details.Php
<?php
include 'config.php';
error_reporting(0);
session_start();
$user_id = $_SESSION['user_id'];
if (isset($_POST['add_to_cart'])) {
if(!isset($user_id)){
$message[]= 'Please Login to get your books';
}else{
$book_name = $_POST['book_name'];
$book_id = $_POST['book_id'];
$book_image = $_POST['book_image'];
$book_price = $_POST['book_price'];
$book_quantity = $_POST['quantity'];
$total_price =number_format($book_price * $book_quantity);
$select_book = $conn->query("SELECT * FROM cart WHERE name= '$book_name' AND user_id='$user_id' ") or
die('query failed');
if (mysqli_num_rows($select_book) > 0) {
$message[] = 'This Book is alredy in your cart';
} else {
$conn->query("INSERT INTO cart (`book_id`,`user_id`,`name`, `price`, `image`, `quantity` ,`total`)
VALUES('$book_id','$user_id','$book_name','$book_price','$book_image','$book_quantity', '$total_price')") or
die('Add to cart Query failed');
$message[] = 'Book Added To Cart 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">
<link rel="stylesheet" href="./css/index_book.css">
<title>Document</title>
<style>
.message {
position: sticky;
top: 0;
margin: 0 auto;
width: 61%;
background-color: #fff;
padding: 6px 9px;
display: flex;
align-items: center;
justify-content: space-between;
z-index: 100;
gap: 0px;
border: 2px solid rgb(68, 203, 236);
border-top-right-radius: 8px;
border-bottom-left-radius: 8px;
}
.message span {
font-size: 22px;
color: rgb(240, 18, 18);
font-weight: 400;
}
.message i {
cursor: pointer;
color: rgb(3, 227, 235);
font-size: 15px;
}
</style>
</head>
<body>
<?php
include 'index_header.php';
?>
<?php
if(isset($message)){
foreach($message as $message){
echo '
<div class="message" id= "messages"><span>'.$message.'</span>
</div>
';
}
}
?>
<div class="details">
<?php
if (isset($_GET['details'])) {
$get_id = $_GET['details'];
$get_book = mysqli_query($conn, "SELECT * FROM `book_info` WHERE bid = '$get_id'") or die('query
failed');
if (mysqli_num_rows($get_book) > 0) {
while ($fetch_book = mysqli_fetch_assoc($get_book)) {
?>
<div class="row_box">
<form style="display: flex ;" action="" method="POST">
<div class="col_box">
<img src="./added_books/<?php echo $fetch_book['image']; ?>" alt="<?php echo
$fetch_book['name']; ?>">
</div>
<div class="col_box">
<h4>Author: <?php echo $fetch_book['title']; ?></h4>
<h1>Name: <?php echo $fetch_book['name']; ?></h1>
<h3>Price: ₹ <?php echo $fetch_book['price']; ?>/-</h3>
<label for="quantity">Quantity:</label>
<input type="number" name="quantity" value="1" min="1" max="10" id="quantity">
<div class="buttons">
<input class="hidden_input" type="hidden" name="book_name" value="<?php
echo $fetch_book['name'] ?>">
<input class="hidden_input" type="hidden" name="book_id" value="<?php echo
$fetch_book['bid'] ?>">
<input class="hidden_input" type="hidden" name="book_image" value="<?php
echo $fetch_book['image'] ?>">
<input class="hidden_input" type="hidden" name="book_price" value="<?php
echo $fetch_book['price'] ?>">
<input type="submit" name="add_to_cart" value="Add To Cart" class="btn">
<!-- <input type="submit" name="add_to_cart" value="Add to cart"
class="btn"> -->
<button name="add_to_cart" ><img style="height: 40px;"
src="./images/cart1.png" alt="Add to cart"></button>
</div>
<h3>Book Details</h3>
<p><?php echo $fetch_book['description']; ?></p>
</div>
</form>
</div>
<?php
}
}
} else {
echo '<script>document.querySelector(".edit-product-form").style.display = "none";</script>';
}
?>
</div>
<script src="./js/admin.js"></script>
<script>
setTimeout(() => {
const box = document.getElementById('messages');
// 👇️ hides element (still takes up space on page)
box.style.display = 'none';
}, 5000);
</script>
</body>
</html>
Cart.Php
<?php
include 'config.php';
session_start();
$user_id = $_SESSION['user_id'];
$user_name =$_SESSION['user_name'];
if(!isset($user_id)){
header('location:login.php');
}
if(isset($_GET['remove'])){
$remove_id=$_GET['remove'];
mysqli_query($conn, "DELETE FROM `cart` WHERE id='$remove_id'") or die('query failed');
$message[]='Removed Successfully';
header('location:cart.php');
}
if(isset($_POST['update'])){
$update_cart_id =$_POST['cart_id'];
$book_price=$_POST['book_price'];
$update_quantity =$_POST['update_quantity'];
$total_price =$book_price * $update_quantity;
mysqli_query($conn, "UPDATE `cart` SET `quantity`='$update_quantity', `total`='$total_price' WHERE
`id`='$update_cart_id'") or die('query failed');
$message[]=''.$user_name.' your cart updated successfully';
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<link rel="stylesheet" href="css/hello.css">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Cart</title>
<style>
.cart-btn1,.cart-btn2{
display: inline-block;
margin: auto;
padding:0.8rem 1.2rem;
cursor: pointer;
color:white;
font-size: 15px;
border-radius: .5rem;
text-transform: capitalize;
}
.cart-btn1{
margin-left: 40%;
background-color: #ffa41c;
color: black;
}
.cart-btn2{
background-color: rgb(0, 167, 245);
color: black;
}
.message {
position: sticky;
top: 0;
margin: 0 auto;
width: 61%;
background-color: #fff;
padding: 6px 9px;
display: flex;
align-items: center;
justify-content: space-between;
z-index: 100;
gap: 0px;
border: 2px solid rgb(68, 203, 236);
border-top-right-radius: 8px;
border-bottom-left-radius: 8px;
}
.message span {
font-size: 22px;
color: rgb(240, 18, 18);
font-weight: 400;
}
.message i {
cursor: pointer;
color: rgb(3, 227, 235);
font-size: 15px;
}
</style>
</head>
<body>
<?php
include 'index_header.php';
?>
<div class="cart_form">
<?php
if(isset($message)){
foreach($message as $message){
echo '
<div class="message" id="messages"><span>'.$message.'</span>
</div>
';
}
}
?>
<table style="width: 70%; align-items:center; margin:10px auto;" >
<thead>
<th>Image</th>
<th>Name</th>
<th>price</th>
<th>Quatity</th>
<th>Total (₹)</th>
</thead>
<tbody>
<?php
$total = 0;
$select_book = $conn->query("SELECT id, name,price, image ,quantity,total FROM cart Where
user_id= $user_id");
if ($select_book->num_rows > 0) {
while ($row = $select_book->fetch_assoc()) {
?>
<tr>
<td><img style="height: 90px;" src="./added_books/<?php echo $row['image']; ?>"
alt=""></td>
<td><?php echo $row['name']; ?></td>
<td><?php echo $row['price']; ?></td>
<td>
<form action="" method="POST">
<input type="number" name="update_quantity" min="1" max="10" value="<?php
echo $row['quantity']; ?>">
<input type="hidden" name="cart_id" value="<?php echo $row['id']; ?>">
<input class="hidden_input" type="hidden" name="book_price" value="<?php
echo $row['price'] ?>">
<!-- <input type="submit" name="update" value="update"> -->
<button style="background:transparent ;" name="update"><img style="height:
26px; cursor:pointer;" src="./images/update1.png" alt="update"></button> |
<a style="color: red;" href="cart.php?remove=<?php echo $row['id'];?>">
Remove</a>
</form>
</td>
<td><?php $sub_total=$row['price']*$row['quantity']; echo
$subtotal=number_format($row['price']*$row['quantity']); ?></td>
</tr>
<?php
$total += $sub_total;
}
} else {
echo '<p class="empty">There is nothing in cart yet !!!!!!!!</p>';
}
?>
<tr>
<th style="text-align:center;" colspan="3">Total</th>
<th colspan="2">₹ <?php echo $total; ?>/- </th>
</tr>
</tbody>
</table>
<a href="checkout.php" class="btn cart-btn1" style="display:<?php if($total>1){ echo 'inline-block';
}else{ echo 'none'; };?>" > &nbsp; Proceed to Checkout</a> <a class="cart-btn2" href="index.php">Continue
Shoping</a>
</div>
<?php include'index_footer.php'; ?>
<script>
setTimeout(() => {
const box = document.getElementById('messages');
// 👇️ hides element (still takes up space on page)
box.style.display = 'none';
}, 5000);
</script>
</body>
</html>
checkout.Php
<?php include 'config.php';
session_start();
$user_id = $_SESSION['user_id'];
if (!isset($user_id)) {
header('location:login.php');
}
if (isset($_POST['checkout'])) {
$name = mysqli_real_escape_string($conn, $_POST['firstname']);
$number = $_POST['number'];
$email = mysqli_real_escape_string($conn, $_POST['email']);
$method = mysqli_real_escape_string($conn, $_POST['method']);
$address = mysqli_real_escape_string($conn, $_POST['address']);
$city = mysqli_real_escape_string($conn, $_POST['city']);
$state = mysqli_real_escape_string($conn, $_POST['state']);
$country = mysqli_real_escape_string($conn, $_POST['country']);
$pincode = mysqli_real_escape_string($conn, $_POST['pincode']);
$full_address = mysqli_real_escape_string($conn, $_POST['address'] . ', ' . $_POST['city'] . ', ' .
$_POST['state'] . ', ' . $_POST['country'] . ' - ' . $_POST['pincode']);
$placed_on = date('d-M-Y');
$cart_total = 0;
$cart_products[] = '';
if (empty($name)) {
$message[] = 'Please Enter Your Name';
} elseif (empty($email)) {
$message[] = 'Please Enter Email Id';
} elseif (empty($number)) {
$message[] = 'Please Enter Mobile Number';
} elseif (empty($address)) {
$message[] = 'Please Enter Address';
} elseif (empty($city)) {
$message[] = 'Please Enter city';
} elseif (empty($state)) {
$message[] = 'Please Enter state';
} elseif (empty($country)) {
$message[] = 'Please Enter country';
} elseif (empty($pincode)) {
$message[] = 'Please Enter your area pincode';
} else {
$cart_query = mysqli_query($conn, "SELECT * FROM `cart` WHERE user_id = '$user_id'") or die('query
failed');
if (mysqli_num_rows($cart_query) > 0) {
while ($cart_item = mysqli_fetch_assoc($cart_query)) {
$cart_products[] = $cart_item['name'] . ' #' . $cart_item['book_id'] . ',(' . $cart_item['quantity'] .
') ';
$quantity=$cart_item['quantity'];
$unit_price=$cart_item['price'];
$cart_books = $cart_item['name'];
$sub_total = ($cart_item['price'] * $cart_item['quantity']);
$cart_total += $sub_total;
}
}
$total_books = implode(' ', $cart_products);
$order_query = mysqli_query($conn, "SELECT * FROM `confirm_order` WHERE name = '$name' AND number = '$number'
AND email = '$email' AND payment_method = '$method' AND address = '$address' AND total_books = '$total_books'
AND total_price = '$cart_total'") or die('query failed');
if (mysqli_num_rows($order_query) > 0) {
$message[] = 'order already placed!';
}
else {
mysqli_query($conn, "INSERT INTO `confirm_order`(user_id, name, number, email, payment_method,
address,total_books, total_price, order_date) VALUES('$user_id','$name', '$number', '$email','$method',
'$full_address', '$total_books', '$cart_total', '$placed_on')") or die('query failed');
$conn_oid= $conn->insert_id;
$_SESSION['id'] = $conn_oid;
// $select_book = mysqli_query($conn, "SELECT * FROM `confirm_order`") or die('query failed');
// if(mysqli_num_rows($select_book) > 0){
// $fetch_book = mysqli_fetch_assoc($select_book);
// $orders_id= $fetch_book['order_id'];
// }
$cart_query = mysqli_query($conn, "SELECT * FROM `cart` WHERE user_id = '$user_id'") or die('query
failed');
if (mysqli_num_rows($cart_query) > 0) {
while ($cart_item = mysqli_fetch_assoc($cart_query)) {
$cart_products[] = $cart_item['name'] . ' #' . $cart_item['book_id'] . ',(' .
$cart_item['quantity'] . ') ';
$quantity=$cart_item['quantity'];
$unit_price=$cart_item['price'];
$cart_books = $cart_item['name'];
$sub_total = ($cart_item['price'] * $cart_item['quantity']);
$cart_total += $sub_total;
mysqli_query($conn, "INSERT INTO
`orders`(user_id,id,address,city,state,country,pincode,book,quantity,unit_price,sub_total)
VALUES('$user_id','$conn_oid','$address','$city','$state','$country','$pincode','$cart_books','$quantity','$uni
t_price','$sub_total')") or die('query failed');
}
}
$message[] = 'order placed successfully!';
mysqli_query($conn, "DELETE FROM `cart` WHERE user_id = '$user_id'") or die('query failed');
}
}
}
?>
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Checkout</title>
<style>
body {
font-family: Arial;
font-size: 17px;
padding: 8px;
overflow-x: hidden;
}
* {
box-sizing: border-box;
}
.row {
display: -ms-flexbox;
/* IE10 */
display: flex;
-ms-flex-wrap: wrap;
/* IE10 */
flex-wrap: wrap;
margin: 0 -16px;
padding: 30px;
}
.col-25 {
-ms-flex: 25%;
/* IE10 */
flex: 25%;
}
.col-50 {
-ms-flex: 50%;
/* IE10 */
flex: 50%;
}
.col-75 {
-ms-flex: 75%;
/* IE10 */
flex: 75%;
}
.col-25,
.col-50,
.col-75 {
padding: 0 16px;
}
.container {
background-color: #f2f2f2;
padding: 5px 20px 15px 20px;
border: 1px solid lightgrey;
border-radius: 3px;
}
input[type=text],
select {
width: 100%;
margin-bottom: 20px;
padding: 12px;
border: 1px solid #ccc;
border-radius: 3px;
}
label {
margin-bottom: 10px;
display: block;
color: black;
}
.icon-container {
margin-bottom: 20px;
padding: 7px 0;
font-size: 24px;
}
.btn {
background-color: rgb(28 146 197);
color: white;
padding: 12px;
margin: 10px 0;
border: none;
width: 100%;
border-radius: 3px;
cursor: pointer;
font-size: 17px;
}
.btn:hover {
background-color: rgb(6 157 21);
letter-spacing: 1px;
font-weight: 600;
}
a {
color: #rgb(28 146 197);
}
hr {
border: 1px solid lightgrey;
}
span.price {
float: right;
color: grey;
}
@media (max-width: 800px) {
.row {
flex-direction: column-reverse;
padding: 0;
}
.col-25 {
margin-bottom: 20px;
}
}
.message {
position: sticky;
top: 0;
margin: 0 auto;
width: 61%;
background-color: #fff;
padding: 6px 9px;
display: flex;
align-items: center;
justify-content: space-between;
z-index: 100;
gap: 0px;
border: 2px solid rgb(68, 203, 236);
border-top-right-radius: 8px;
border-bottom-left-radius: 8px;
}
.message span {
font-size: 22px;
color: rgb(240, 18, 18);
font-weight: 400;
}
.message i {
cursor: pointer;
color: rgb(3, 227, 235);
font-size: 15px;
}
</style>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-
awesome.min.css">
<script src="https://kit.fontawesome.com/493af71c35.js" crossorigin="anonymous"></script>
</head>
<body>
<?php include 'index_header.php'; ?>
<?php
if (isset($message)) {
foreach ($message as $message) {
echo '
<div class="message" id= "messages"><span>' . $message . '</span>
</div>
';
}
}
?>
<h1 style="text-align: center; margin-top:15px; color:rgb(9, 152, 248);">Place Your Order Here</h1>
<p style="text-align: center; ">Just One Step away from getting your books</p>
<div class="row">
<div class="col-75">
<div class="container">
<form action="" method="POST">
<div class="row">
<div class="col-50">
<h3>Billing Address</h3>
<label for="fname"><i class="fa fa-user"></i> Full Name</label>
<input type="text" id="fname" name="firstname" placeholder="Aman Singh">
<label for="email"><i class="fa fa-envelope"></i> Email</label>
<input type="text" id="email" name="email" placeholder="example@gmail.com">
<label for="email"><i class="fa fa-envelope"></i> Number</label>
<input type="text" id="email" name="number" placeholder="+91987456123">
<label for="adr"><i class="fa fa-address-card-o"></i> Address</label>
<input type="text" id="adr" name="address" placeholder="Mumbai 60">
<label for="city"><i class="fa fa-institution"></i> City</label>
<input type="text" id="city" name="city" placeholder="Mumbai">
<label for="city"><i class="fa fa-institution"></i> State</label>
<input type="text" id="city" name="state" placeholder="Maharashtra">
<div style="padding: 0px;" class="row">
<div class="col-50">
<label for="state">Country</label>
<input type="text" id="state" name="country" placeholder="india">
</div>
<div class="col-50">
<label for="zip">Pincode</label>
<input type="text" id="zip" name="pincode" placeholder="400060">
</div>
</div>
</div>
<div class="col-50">
<div class="col-25">
<div class="container">
<h4>Books In Cart</h4>
<?php
$grand_total = 0;
$select_cart = mysqli_query($conn, "SELECT * FROM `cart`") or die('query failed');
if (mysqli_num_rows($select_cart) > 0) {
while ($fetch_cart = mysqli_fetch_assoc($select_cart)) {
$total_price = ($fetch_cart['price'] * $fetch_cart['quantity']);
$grand_total += $total_price;
?>
<p> <a href="book_details.php?details=<?php echo $fetch_cart['book_id']; ?>"><?php echo
$fetch_cart['name']; ?></a><span class="price">(<?php echo '₹ ' . $fetch_cart['price'] . '/-' . ' x ' .
$fetch_cart['quantity']; ?>)</span> </p>
<?php
}
} else {
echo '<p class="empty">your cart is empty</p>';
}
?>
<hr>
<p>Grand total : <span class="price" style="color:black">₹ <b><?php echo $grand_total; ?>/-
</b></span></p>
</div>
</div>
<div style="margin: 20px;">
<h3>Payment </h3>
<label for="fname">Accepted Payment Gateways</label>
<div class="icon-container">
<i class="fa fa-cc-visa" style="color:navy;"></i>
<i class="fa-brands fa-cc-amazon-pay"></i>
<i class="fa-brands fa-google-pay" style="color:red;"></i>
<i class="fa fa-cc-paypal" style="color:#3b7bbf;"></i>
</div>
<div class="inputBox">
<label for="method">Choose Payment Method :</label>
<select name="method" id="method">
<option value="cash on delivery">Cash on delivery</option>
<option value="Debit card">Debit card</option>
<option value="Amazon Pay">Amazon Pay</option>
<option value="Paypal">Paypal</option>
<option value="Google Pay">Google Pay</option>
</select>
</div>
</div>
</div>
</div>
<label>
<input type="checkbox" checked="checked" name="sameadr"> Shipping address same as billing
</label>
<input type="submit" name="checkout" value="Continue to checkout" class="btn">
</form>
</div>
</div>
</div>
<?php include 'index_footer.php'; ?>
<script>
setTimeout(() => {
const box = document.getElementById('messages');
// 👇️ hides element (still takes up space on page)
box.style.display = 'none';
}, 5000);
</script>
</body>
</html>
contact-us.Php
<?php
include 'config.php';
session_start();
$user_id = $_SESSION['user_id'];
$user_name =$_SESSION['user_name'];
if(!isset($user_id)){
header('location:login.php');
}
if(isset($_POST['send_msg'])) {
$name = mysqli_real_escape_string($conn, $_POST['name']);
$msg = mysqli_real_escape_string($conn, $_POST['msg']);
$email = mysqli_real_escape_string($conn, $_POST['email']);
$phone = mysqli_real_escape_string($conn, $_POST['phone']);
mysqli_query($conn, "INSERT INTO msg (`user_id`,`name`,`email`, `number`, `msg`)
VALUES('$user_id','$name','$email','$phone','$msg')") or die('Mesage send Query failed');
$message[]='Message Send Successfully';
}
?>
<!DOCTYPE html>
<html lang="en" dir="ltr">
<head>
<meta charset="utf-8">
<title>Contact-Us</title>
<link rel="stylesheet" href="style.css">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="./css/hello.css">
</head>
<body>
<?php
include 'index_header.php';
?>
<?php
if(isset($message)){
foreach($message as $message){
echo '
<div class="message" id= "messages"><span>'.$message.'</span>
</div>
';
}
}
?>
<div class="contact-section" >
<h1>Contact Us</h1>
<h3>Hello, <span><?php echo $user_name;?> </span> &nbsp;how we can help you?</h3>
<div class="border"></div>
<form class="contact-form" action="" method="post">
<input type="text" class="contact-form-text" name="name" placeholder="Your name">
<input type="email" class="contact-form-text" name="email" placeholder="Your email">
<input type="int" class="contact-form-text" name="phone" placeholder="Your phone">
<textarea class="contact-form-text" name="msg" placeholder="Your message"></textarea>
<input type="submit" class="contact-form-btn" name="send_msg" value="Send">
<a href="index.php" class="contact-form-btn" >Back</a>
</form>
</div>
<?php include'index_footer.php';?>
<script>
setTimeout(() => {
const box = document.getElementById('messages');
// 👇️ hides element (still takes up space on page)
box.style.display = 'none';
}, 5000);
</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/font-awesome/6.0.0/css/all.min.css">
<link rel="stylesheet" href="./css/hello.css">
<style>
.placed-orders .title{
text-align: center;
margin-bottom: 20px;
text-transform: uppercase;
color:black;
font-size: 40px;
}
.placed-orders .box-container{
max-width: 1200px;
margin:0 auto;
display:flex;
flex-wrap: wrap;
align-items: center;
gap:20px;
}
.placed-orders .box-container .empty{
flex:1;
}
.placed-orders .box-container .box{
flex:1 1 400px;
border-radius: .5rem;
padding:15px;
border:2px solid brown;
background-color: white;
padding:10px 20px;
}
.placed-orders .box-container .box p{
padding:10px 0 0 0;
font-size: 20px;
color:gray;
}
.placed-orders .box-container .box p span{
color:black;
}
</style>
</head>
<body>
<?php include 'index_header.php'; ?>
<section class="placed-orders">
<h1 class="title">placed orders</h1>
<div class="box-container">
<?php
$select_book = mysqli_query($conn, "SELECT * FROM `confirm_order`WHERE user_id = '$user_id' ORDER BY
order_date DESC") or die('query failed');
if(mysqli_num_rows($select_book) > 0){
while($fetch_book = mysqli_fetch_assoc($select_book)){
?>
<div class="box">
<p> Order Date : <span><?php echo $fetch_book['order_date']; ?></span> </p>
<p> Order Id : <span># <?php echo $fetch_book['order_id']; ?> </p>
<p> Name : <span><?php echo $fetch_book['name']; ?></span> </p>
<p> Mobile Number : <span><?php echo $fetch_book['number']; ?></span> </p>
<p> Email Id : <span><?php echo $fetch_book['email']; ?></span> </p>
<p> Address : <span><?php echo $fetch_book['address']; ?></span> </p>
<p> Payment Method : <span><?php echo $fetch_book['payment_method']; ?></span> </p>
<p> Your orders : <span><?php echo $fetch_book['total_books']; ?></span> </p>
<p> Total price : <span>₹ <?php echo $fetch_book['total_price']; ?>/-</span> </p>
<p> Payment status : <span style="color:<?php if($fetch_book['payment_status'] == 'pending'){ echo
'orange'; }else{ echo 'green'; } ?>;"><?php echo $fetch_book['payment_status']; ?></span> </p>
<p><a href="invoice.php?order_id=<?php echo $fetch_book['order_id']; ?>" target="_blank">Print
Recipt</a></p>
</div>
<!-- <form action="" method="POST">
<input type="hidden" name="order_id" value="<?php echo $fetch_book['order_id']; ?>">
</form> -->
<?php
}
}else{
echo '<p class="empty">You have not placed any order yet!!!!</p>';
}
?>
</div>
</section>
<?php include 'index_footer.php'; ?>
<!-- custom js file link -->
<script src="js/script.js"></script>
</body>
</html>
search_books.Php
<?php
include 'config.php';
session_start();
if(isset($_SESSION['user_name'])){
$user_id = $_SESSION['user_id'];
if (isset($_POST['add_to_cart'])) {
$book_name = $_POST['book_name'];
$book_id= $_POST['book_id'];
$book_image = $_POST['book_image'];
$book_price = $_POST['book_price'];
$book_quantity = '1';
$total_price = number_format($book_price * $book_quantity);
$select_book = $conn->query("SELECT * FROM cart WHERE bid= '$book_id' AND user_id='$user_id' ") or
die('query failed');
if (mysqli_num_rows($select_book) > 0) {
$message[] = 'This Book is alredy in your cart';
} else {
$conn->query("INSERT INTO cart (`user_id`,`book_id`,`name`, `price`, `image`,`quantity` ,`total`)
VALUES('$user_id','$book_id','$book_name','$book_price','$book_image','$book_quantity', '$total_price')") or
die('Add to cart Query failed');
$message[] = 'Book Added To Successfully';
header('location:index.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>search page</title>
<!-- font awesome cdn link -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.1.1/css/all.min.css">
<!-- custom css file link -->
<link rel="stylesheet" href="css/style.css">
<style>
.search-form form {
max-width: 1200px;
margin: 30px auto;
display: flex;
gap: 15px;
}
.search-form form .search_btn {
margin-top: 0;
}
.search-form form .box {
width: 100%;
padding: 12px 14px;
border: 2px solid rgb(0, 167, 245);
font-size: 20px;
color: black;
border-radius: 5px;
}
.search_btn {
display: inline-block;
padding: 10px 25px;
cursor: pointer;
color: white;
font-size: 18px;
border-radius: 5px;
text-transform: capitalize;
background-color: rgb(0, 167, 245);
}
</style>
</head>
<body>
<?php include 'index_header.php'; ?>
<section class="search-form">
<form action="" method="POST">
<input type="text" class="box" name="search_box" placeholder="search products...">
<input type="submit" name="search_btn" value="search" class="search_btn">
</form>
</section>
<div class="msg">
<?php
if (isset($_POST['search_btn'])) {
$search_box = $_POST['search_box'];
echo '<h4>Search Result for "'. $search_box.'"is:</h4>';
};
?>
</div>
<section class="show-products">
<div class="box-container">
<?php
if (isset($_POST['search_btn'])) {
$search_box = $_POST['search_box'];
$search_box = filter_var($search_box, FILTER_SANITIZE_STRING);
$select_products = mysqli_query($conn, "SELECT * FROM `book_info` WHERE name LIKE '%{$search_box}%'
OR title LIKE '%{$search_box}%' OR category LIKE '%{$search_box}%'");
if (mysqli_num_rows($select_products) > 0) {
while ($fetch_book = mysqli_fetch_assoc($select_products)) {
?>
<div class="box" style="width: 255px;height: 342px;">
<a href="book_details.php?details=<?php echo $fetch_book['bid'];
echo '-name=', $fetch_book['name']; ?>"> <img
style="height: 200px;width: 125px;margin: auto;" class="books_images" src="added_books/<?php echo
$fetch_book['image']; ?>" alt=""></a>
<div style="text-align:left ;">
<div class="name" style="font-size: 12px;">Aurthor: <?php echo $fetch_book['title'];
?></div>
<div style="font-weight: 500; font-size:18px; " class="name">Name: <?php echo
$fetch_book['name']; ?></div>
</div>
<div class="price">Price: ₹ <?php echo $fetch_book['price']; ?>/-</div>
<!-- <button name="add_cart"><img src="./images/cart2.png" alt=""></button> -->
<form action="" method="POST">
<input class="hidden_input" type="hidden" name="book_name" value="<?php echo
$fetch_book['name'] ?>">
<input class="hidden_input" type="hidden" name="book_image" value="<?php echo
$fetch_book['image'] ?>">
<input class="hidden_input" type="hidden" name="book_price" value="<?php echo
$fetch_book['price'] ?>">
<button onclick="myFunction()" name="add_to_cart"><img src="./images/cart2.png"
alt="Add to cart">
<a href="book_details.php?details=<?php echo $fetch_book['bid'];
echo '-name=', $fetch_book['name']; ?>"
id="adventure" class="update_btn">Know More</a>
</form>
</div>
<?php
}
} else {
echo '<p class="empty">Could not find "'. $search_box.'"! </p>';
}
};
?>
</div>
</section>
<?php include 'index_footer.php'; ?>
<script src="js/script.js"></script>
</body>
</html>
ADMIN PANEL
admin_header.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">
<link rel="stylesheet" href="./css/admin.css">
<title>Admin Page</title>
</head>
<body>
<header><div class="mainlogo">
<div class="logo">
<a href="admin_index.php"><span>Bookflix &</span>
<span class="me">Chill</span></a>
</div><p>Admin Pannel</p></div>
<div class="nav">
<a href="admin_index.php">Home</a>
<a href="add_books.php">Add Books</a>
<a href="admin_orders.php">Orders</a>
<a href="message_admin.php">Message</a>
<a href="users_detail.php">Users</a>
</div>
<div class="right">
<div class="log_info">
<p>Hello <?php echo $_SESSION['admin_name'];?></p>
</div>
<a class="Btn" href="logout.php?logout=<?php echo $_SESSION['admin_name'];?>">logout</a>
</div>
</header>
</body>
</html>
admin_index.Php
<?php include 'config.php';
session_start();
$admin_id = $_SESSION['admin_id'];
if(!isset($admin_id)){
header('location:login.php');
}
$users_no = $conn->query("SELECT * FROM users_info ") or die('query failed');
$usercount = mysqli_num_rows( $users_no );
$admin_no = $conn->query("SELECT * FROM users_info WHERE user_type='Admin' ") or die('query failed');
$admin_count = mysqli_num_rows( $admin_no );
$books_no = $conn->query("SELECT * FROM book_info ") or die('query failed');
$bookscount = mysqli_num_rows( $books_no );
$orders = $conn->query("SELECT * FROM confirm_order ") or die('query failed');
$orders_count = mysqli_num_rows( $orders );
$msg_no = $conn->query("SELECT * FROM msg ") or die('query failed');
$msgcount = mysqli_num_rows( $msg_no );
?>
<!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" />
<!-- <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.0.0/dist/css/bootstrap.min.css"
integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous"> --
>
<link rel="stylesheet" href="./css/admin.css" />
<title>Bookflix & Chill Admin</title>
</head>
<body >
<?php include'admin_header.php';?>
<div class="main_box">
<div class="card" style="width: 15rem">
<?php
$total_pendings = 0;
$select_pending = mysqli_query($conn, "SELECT total_price FROM `confirm_order` WHERE payment_status
= 'pending'") or die('query failed');
if(mysqli_num_rows($select_pending) > 0){
while($fetch_pendings = mysqli_fetch_assoc($select_pending)){
$total_price = $fetch_pendings['total_price'];
$total_pendings += $total_price;
};
};
?>
<img class="card-img-top" src="./images/pen3.png" alt="Card image cap" />
<div class="card-body">
<h5 class="card-title">Number Of Pending Orders in ₨</h5>
<p class="card-text">
<?php echo $total_pendings ?>
</p>
<div class="buttons" style="display: flex;">
<a href="admin_orders.php" class="btn btn-primary">Details</a>
</div>
</div>
</div>
<div class="card" style="width: 15rem">
<?php
$total_completed = 0;
$select_completed = mysqli_query($conn, "SELECT total_price FROM `confirm_order` WHERE
payment_status = 'completed'") or die('query failed');
if(mysqli_num_rows($select_completed) > 0){
while($fetch_completed = mysqli_fetch_assoc($select_completed)){
$total_price = $fetch_completed['total_price'];
$total_completed += $total_price;
};
};
?>
<img class="card-img-top" src="./images/compn.png" alt="Card image cap" />
<div class="card-body">
<h5 class="card-title">Number Of Completed Orders in ₨</h5>
<p class="card-text">
<?php echo $total_completed; ?>
</p>
<div class="buttons" style="display: flex;">
<a href="admin_orders.php" class="btn btn-primary">Details</a>
</div>
</div>
</div>
<div class="card" style="width: 15rem">
<img class="card-img-top" src="./images/orderpn.png" alt="Card image cap" />
<div class="card-body">
<h5 class="card-title">Number Of Orders Recived</h5>
<p class="card-text">
<?php echo $orders_count; ?>
</p>
<a href="admin_orders.php" class="btn btn-primary">Details</a>
</div>
</div>
<div class="card" style="width: 15rem">
<img class="card-img-top" src="./images/nu. books.png" alt="Card image cap" />
<div class="card-body">
<h5 class="card-title">Number Of Books Available</h5>
<p class="card-text">
<?php echo $bookscount; ?>
</p>
<div class="buttons" style="display: flex;">
<a href="total_books.php" class="btn btn-primary">See Books</a>
<a href="add_books.php" class="btn btn-primary">Add Books</a>
</div>
</div>
</div>
<div class="card" style="width: 15rem">
<img class="card-img-top" src="./images/whatpm.png" alt="Card image cap" />
<div class="card-body">
<h5 class="card-title">Number Of Users Queries</h5>
<p class="card-text">
<?php echo $msgcount; ?>
</p>
<a href="message_admin.php" class="btn btn-primary">Details</a>
</div>
</div>
<div class="card" style="width: 15rem">
<img class="card-img-top" src="./images/adminpn2.png" alt="Card image cap" />
<div class="card-body">
<h5 class="card-title">Number Of Registered Admins</h5>
<p class="card-text">
<?php echo $admin_count; ?>
</p>
<a href="users_detail.php" class="btn btn-primary">Details</a>
</div>
</div>
<div class="card" style="width: 15rem">
<img class="card-img-top" src="./images/userspm.png" alt="Card image cap" />
<div class="card-body">
<h5 class="card-title">Number Of Registered Users</h5>
<p class="card-text">
<?php echo $usercount; ?>
</p>
<a href="users_detail.php" class="btn btn-primary">Details</a>
</div>
</div>
</div>
</body>
</html>
add_books.Php
<?php
include 'config.php';
session_start();
$admin_id = $_SESSION['admin_id'];
if(!isset($admin_id)){
header('location:login.php');
};
if (isset($_POST['add_books'])) {
$bname = mysqli_real_escape_string($conn, $_POST['bname']);
$btitle = mysqli_real_escape_string($conn, $_POST['btitle']);
$category = mysqli_real_escape_string($conn, $_POST['Category']);
$price = $_POST['price'];
$desc = mysqli_real_escape_string($conn, ($_POST['bdesc']));
$img = $_FILES["image"]["name"];
$img_temp_name = $_FILES["image"]["tmp_name"];
$img_file = "./added_books/" . $img;
if (empty($bname)) {
$message[] = 'Please Enter book name';
} elseif (empty($btitle)) {
$message[] = 'Please Enter book title';
} elseif (empty($price)) {
$message[] = 'Please Enter book price';
} elseif (empty($category)) {
$message[] = 'Please Choose a category';
} elseif (empty($desc)) {
$message[] = 'Please Enter book descriptions';
} elseif (empty($img)) {
$message[] = 'Please Choose Image';
} else {
$add_book = mysqli_query($conn, "INSERT INTO book_info(`name`, `title`, `price`, `category`, `description`,
`image`) VALUES('$bname','$btitle','$price','$category','$desc','$img')") or die('Query failed');
if ($add_book) {
move_uploaded_file($img_temp_name, $img_file);
$message[] = 'New Book Added Successfully';
} else {
$message = 'Book Not Added Successfully';
}
}
}
if(isset($_GET['delete'])){
$delete_id = $_GET['delete'];
mysqli_query($conn, "DELETE FROM `book_info` WHERE bid = '$delete_id'") or die('query failed');
header('location:add_books.php');
}
if(isset($_POST['update_product'])){
$update_p_id = $_POST['update_p_id'];
$update_name = $_POST['update_name'];
$update_title = $_POST['update_title'];
$update_description = $_POST['update_description'];
$update_price = $_POST['update_price'];
mysqli_query($conn, "UPDATE `book_info` SET name = '$update_name', title='$update_title', description
='$update_description', price = '$update_price',category='$update_category' WHERE bid = '$update_p_id'") or
die('query failed');
$update_image = $_FILES['update_image']['name'];
$update_image_tmp_name = $_FILES['update_image']['tmp_name'];
$update_image_size = $_FILES['update_image']['size'];
$update_folder = './added_books/'.$update_image;
$update_old_image = $_POST['update_old_image'];
if(!empty($update_image)){
if($update_image_size > 2000000){
$message[] = 'image file size is too large';
}else{
mysqli_query($conn, "UPDATE `book_info` SET image = '$update_image' WHERE bid = '$update_p_id'") or
die('query failed');
move_uploaded_file($update_image_tmp_name, $update_folder);
unlink('uploaded_img/'.$update_old_image);
}
}
header('location:./add_books.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">
<link rel="stylesheet" href="./css/register.css">
<title>Add Books</title>
</head>
<body>
<?php
include './admin_header.php'
?>
<?php
if (isset($message)) {
foreach ($message as $message) {
echo '
<div class="message" id="messages"><span>' . $message . '</span>
</div>
';
}
}
?>
<a class="update_btn" style="position: fixed ; z-index:100;" href="total_books.php">See All Books</a>
<div class="container_box">
<form action="" method="POST" enctype="multipart/form-data">
<h3>Add Books To <a href="index.php"><span>Bookflix & </span><span>Chill</span></a></h3>
<input type="text" name="bname" placeholder="Enter book Name" class="text_field ">
<input type="text" name="btitle" placeholder="Enter Author name" class="text_field">
<input type="number" min="0" name="price" class="text_field" placeholder="enter product price">
<select name="Category" id="" required class="text_field">
<option value="Adventure">Adventure</option>
<option value="Magic">Magic</option>
<option value="knowledge">knowledge</option>
</select>
<textarea name="bdesc" placeholder="Enter book description" id="" class="text_field" cols="18"
rows="5"></textarea>
<input type="file" name="image" accept="image/jpg, image/jpeg, image/png" class="text_field">
<input type="submit" value="Add Book" name="add_books" class="btn text_field">
</form>
</div>
<section class="edit-product-form">
<?php
if(isset($_GET['update'])){
$update_id = $_GET['update'];
$update_query = mysqli_query($conn, "SELECT * FROM `book_info` WHERE bid = '$update_id'") or die('query
failed');
if(mysqli_num_rows($update_query) > 0){
while($fetch_update = mysqli_fetch_assoc($update_query)){
?>
<form action="" method="post" enctype="multipart/form-data">
<input type="hidden" name="update_p_id" value="<?php echo $fetch_update['bid']; ?>">
<input type="hidden" name="update_old_image" value="<?php echo $fetch_update['image']; ?>">
<img src="./added_books/<?php echo $fetch_update['image']; ?>" alt="">
<input type="text" name="update_name" value="<?php echo $fetch_update['name']; ?>" class="box" required
placeholder="Enter Book Name">
<input type="text" name="update_title" value="<?php echo $fetch_update['title']; ?>" class="box" required
placeholder="Enter Author Name">
<select name="update_category" value="<?php echo $fetch_update['category']; ?> required class="text_field">
<option value="Adventure">Adventure</option>
<option value="Magic">Magic</option>
<option value="knowledge">knowledge</option>
</select>
<input type="text" name="update_description" value="<?php echo $fetch_update['description']; ?>" class="box"
required placeholder="enter product description">
<input type="number" name="update_price" value="<?php echo $fetch_update['price']; ?>" min="0" class="box"
required placeholder="enter product price">
<input type="file" class="box" name="update_image" accept="image/jpg, image/jpeg, image/png">
<input type="submit" value="update" name="update_product" class="delete_btn" >
<input type="reset" value="cancel" id="close-update" class="update_btn" >
</form>
<?php
}
}
}else{
echo '<script>document.querySelector(".edit-product-form").style.display = "none";</script>';
}
?>
</section>
<section class="show-products">
<div class="box-container">
<?php
$select_book = mysqli_query($conn, "SELECT * FROM book_info ORDER BY date DESC LIMIT 2;") or
die('query failed');
if(mysqli_num_rows($select_book) > 0){
while($fetch_book = mysqli_fetch_assoc($select_book)){
?>
<div class="box">
<img class="books_images" src="added_books/<?php echo $fetch_book['image']; ?>" alt="">
<div class="name">Aurthor: <?php echo $fetch_book['title']; ?></div>
<div class="name">Name: <?php echo $fetch_book['name']; ?></div>
<div class="price">Price: ₹ <?php echo $fetch_book['price']; ?>/-</div>
<a href="add_books.php?update=<?php echo $fetch_book['bid']; ?>" class="update_btn">update</a>
<a href="add_books.php?delete=<?php echo $fetch_book['bid']; ?>" 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>
<section class="edit-product-form">
<?php
if(isset($_GET['update'])){
$update_id = $_GET['update'];
$update_query = mysqli_query($conn, "SELECT * FROM `book_info` WHERE bid = '$update_id'") or
die('query failed');
if(mysqli_num_rows($update_query) > 0){
while($fetch_update = mysqli_fetch_assoc($update_query)){
?>
<form action="" method="post" enctype="multipart/form-data">
<input type="hidden" name="update_p_id" value="<?php echo $fetch_update['bid']; ?>">
<input type="hidden" name="update_old_image" value="<?php echo $fetch_update['image']; ?>">
<img src="./added_books/<?php echo $fetch_update['image']; ?>" alt="">
<input type="text" name="update_name" value="<?php echo $fetch_update['name']; ?>" class="box" required
placeholder="Enter Book Name">
<input type="text" name="update_title" value="<?php echo $fetch_update['title']; ?>" class="box" required
placeholder="Enter Author Name">
<select name="update_category" value="<?php echo $fetch_update['category']; ?> required
class="text_field">
<option value="Adventure">Adventure</option>
<option value="Magic">Magic</option>
<option value="knowledge">knowledge</option>
</select>
<input type="text" name="update_description" value="<?php echo $fetch_update['description']; ?>"
class="box" required placeholder="enter product description">
<input type="number" name="update_price" value="<?php echo $fetch_update['price']; ?>" min="0"
class="box" required placeholder="enter product price">
<input type="file" class="box" name="update_image" accept="image/jpg, image/jpeg, image/png">
<input type="submit" value="update" name="update_product" class="delete_btn" >
<input type="reset" value="cancel" id="close-update" class="update_btn" >
</form>
<?php
}
}
}else{
echo '<script>document.querySelector(".edit-product-form").style.display = "none";</script>';
}
?>
</section>
<script src="./js/admin.js"></script>
<script>
setTimeout(() => {
const box = document.getElementById('messages');
// 👇️ hides element (still takes up space on page)
box.style.display = 'none';
}, 8000);
</script>
</body>
</html>
total_books.Php
<?php
include 'config.php';
session_start();
$admin_id = $_SESSION['admin_id'];
if(isset($_GET['delete'])){
$delete_id = $_GET['delete'];
mysqli_query($conn, "DELETE FROM `book_info` WHERE bid = '$delete_id'") or die('query failed');
header('location:total_books.php');
}
if(isset($_POST['update_product'])){
$update_p_id = $_POST['update_p_id'];
$update_name = $_POST['update_name'];
$update_title = $_POST['update_title'];
$update_description = $_POST['update_description'];
$update_price = $_POST['update_price'];
$update_category = $_POST['update_category'];
mysqli_query($conn, "UPDATE `book_info` SET name = '$update_name', title='$update_title', description
='$update_description', price = '$update_price', category='$update_category' WHERE bid = '$update_p_id'") or
die('query failed');
$update_image = $_FILES['update_image']['name'];
$update_image_tmp_name = $_FILES['update_image']['tmp_name'];
$update_image_size = $_FILES['update_image']['size'];
$update_folder = './added_books/'.$update_image;
$update_old_image = $_POST['update_old_image'];
if(!empty($update_image)){
if($update_image_size > 2000000){
$message[] = 'image file size is too large';
}else{
mysqli_query($conn, "UPDATE `book_info` SET image = '$update_image' WHERE bid = '$update_p_id'") or
die('query failed');
move_uploaded_file($update_image_tmp_name, $update_folder);
unlink('uploaded_img/'.$update_old_image);
}
}
header('location:total_books.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">
<link rel="stylesheet" href="./css/register.css">
<title>Add Books</title>
</head>
<body>
<?php
include './admin_header.php'
?>
<?php
if (isset($message)) {
foreach ($message as $message) {
echo '
<div class="message"><span>' . $message . '</span><i onclick="this.parentElement.remove();">Close</i>
</div>
';
}
}
?>
<a class="update_btn" style="position: fixed ; z-index:100;" href="add_books.php">Add More Books</a>
<section class="edit-product-form">
<?php
if(isset($_GET['update'])){
$update_id = $_GET['update'];
$update_query = mysqli_query($conn, "SELECT * FROM `book_info` WHERE bid = '$update_id'") or
die('query failed');
if(mysqli_num_rows($update_query) > 0){
while($fetch_update = mysqli_fetch_assoc($update_query)){
?>
<form action="" method="post" enctype="multipart/form-data">
<input type="hidden" name="update_p_id" value="<?php echo $fetch_update['bid']; ?>">
<input type="hidden" name="update_old_image" value="<?php echo $fetch_update['image']; ?>">
<img src="./added_books/<?php echo $fetch_update['image']; ?>" alt="">
<input type="text" name="update_name" value="<?php echo $fetch_update['name']; ?>" class="box" required
placeholder="Enter Book Name">
<input type="text" name="update_title" value="<?php echo $fetch_update['title']; ?>" class="box" required
placeholder="Enter Author Name">
<select name="update_category" value="<?php echo $fetch_update['category']; ?> required
class="text_field">
<option value="Adventure">Adventure</option>
<option value="Magic">Magic</option>
<option value="knowledge">knowledge</option>
</select>
<input type="text" name="update_description" value="<?php echo $fetch_update['description']; ?>"
class="box" required placeholder="enter product description">
<input type="number" name="update_price" value="<?php echo $fetch_update['price']; ?>" min="0"
class="box" required placeholder="enter product price">
<input type="file" class="box" name="update_image" accept="image/jpg, image/jpeg, image/png">
<input type="submit" value="update" name="update_product" class="delete_btn" >
<input type="reset" value="cancel" id="close-update" class="update_btn" >
</form>
<?php
}
}
}else{
echo '<script>document.querySelector(".edit-product-form").style.display = "none";</script>';
}
?>
</section>
<section class="show-products">
<div class="box-container">
<?php
$select_book = mysqli_query($conn, "SELECT * FROM `book_info` ORDER BY date DESC") or die('query
failed');
if(mysqli_num_rows($select_book) > 0){
while($fetch_book = mysqli_fetch_assoc($select_book)){
?>
<div class="box">
<img class="books_images" src="added_books/<?php echo $fetch_book['image']; ?>" alt="">
<div class="name">Aurthor: <?php echo $fetch_book['title']; ?></div>
<div class="name">Name: <?php echo $fetch_book['name']; ?></div>
<div class="price">Price: ₹ <?php echo $fetch_book['price']; ?>/-</div>
<a href="total_books.php?update=<?php echo $fetch_book['bid']; ?>" class="update_btn">update</a>
<a href="total_books.php?delete=<?php echo $fetch_book['bid']; ?>" 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.js"></script>
</body>
</html>
users_details.Php
<?php
include 'config.php';
session_start();
$admin_id = $_SESSION['admin_id'];
if(!isset($admin_id)){
header('location:login.php');
}
if (isset($_GET['delete_user'])) {
$delete_id = $_GET['delete_user'];
mysqli_query($conn, "DELETE FROM `users_info` WHERE Id = '$delete_id'") or die('query failed');
header('location:users_detail.php');
}
if (isset($_POST['update_user'])) {
$update_id = $_POST['update_id'];
$update_name = $_POST['update_name'];
$update_sname = $_POST['update_sname'];
$update_email = $_POST['update_email'];
$update_password = $_POST['update_password'];
$update_user_type = $_POST['update_user_type'];
mysqli_query($conn, "UPDATE `users_info` SET name = '$update_name', surname='$update_name', email
='$update_email', password = '$update_password', user_type='$update_user_type' WHERE Id = '$update_id'") or
die('query failed');
header('location:./users_detail.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">
<link rel="stylesheet" href="./css/register.css">
<link rel="stylesheet" href="./css/index_book.css">
<title> User Data</title>
</head>
<body>
<?php
include 'admin_header.php';
?>
<section class="show-products">
<div class="box-container">
<?php
$select_user = mysqli_query($conn, "SELECT Id,name,surname,email,password,user_type FROM users_info") or
die('query failed');
if(mysqli_num_rows($select_user) > 0){
while($fetch_user = mysqli_fetch_assoc($select_user)){
?>
<div class="box">
<div class="name">User ID: <?php echo $fetch_user['Id']; ?></div>
<div class="name">Name: <?php echo $fetch_user['name']; ?>&nbsp;<?php echo $fetch_user['surname'];
?></div>
<div class="name">Email ID: <?php echo $fetch_user['email']; ?></div>
<div class="password">Password: <?php echo $fetch_user['password']; ?></div>
<div class="price"style="color:<?php if($fetch_user['user_type'] == 'Admin'){ echo 'red'; }else{ echo
'blue'; } ?>;">User type: <?php echo $fetch_user['user_type']; ?></div>
<a style="color:rgb(255, 187, 0);" href="users_detail.php?update_user=<?php echo $fetch_user['Id'];
?>">Update</a>
<a href="users_detail.php?delete_user=<?php echo $fetch_user['Id']; ?>" onclick="return confirm('Are you
sure you want to delete this user');">Delete</a>
</div>
<?php
}
}else{
echo '<p class="empty">no products added yet!</p>';
}
?>
</div>
</section>
<section class="edit_user-form">
<div class="edit-product-form">
<?php
if (isset($_GET['update_user'])) {
$update_id = $_GET['update_user'];
$update_query = mysqli_query($conn, "SELECT * FROM `users_info` WHERE Id = '$update_id'") or
die('query failed');
if (mysqli_num_rows($update_query) > 0) {
while ($fetch_update = mysqli_fetch_assoc($update_query)) {
?>
<form action="" method="POST" enctype="multipart/form-data">
<input type="hidden" name="update_id" value="<?php echo $fetch_update['Id']; ?>">
<input type="text" value="<?php echo $fetch_update['name'] ?>" name="update_name"
placeholder="Enter Name" required class="box ">
<input type="text" value="<?php echo $fetch_update['surname'] ?>"
name="update_sname" placeholder="Enter Surname" required class="box">
<input type="email" value="<?php echo $fetch_update['email'] ?>"
name="update_email" placeholder="Enter Email Id" required class="box">
<input type="password" value="<?php echo $fetch_update['password'] ?>"
name="update_password" placeholder="Enter password" required class="box">
<select name="update_user_type" id="" required class="box">
<option value="User">User</option>
<option value="Admin">Admin</option>
</select>
<input type="submit" value="Update" name="update_user" class="delete_btn">
<input type="reset" value="cancel" id="close-update_user" class="update_btn">
</form>
<?php
}
}
} else {
echo '<script>document.querySelector(".edit-product-form").style.display = "none";</script>';
}
?>
</div>
</section>
<script>
document.querySelector('#close-update_user').onclick = () => {
document.querySelector('.edit-product-form').style.display = 'none';
window.location.href = 'users_detail.php';
}
</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');
}
if (isset($_POST['update_order'])) {
$order_update_id = $_POST['order_id'];
$update_payment = $_POST['update_payment'];
$date = date("d.m.Y");
mysqli_query($conn, "UPDATE `confirm_order` SET payment_status = '$update_payment',date='$date' WHERE
order_id = '$order_update_id'") or die('query failed');
$message[] = 'payment status has been updated!';
}
if (isset($_GET['delete'])) {
$delete_id = $_GET['delete'];
mysqli_query($conn, "DELETE FROM `confirm_order` WHERE order_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>orders</title>
<!-- font awesome cdn link -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css">
<link rel="stylesheet" href="./css/hello.css">
<style>
.cart-btn1,
.cart-btn2 {
display: inline-block;
margin-top: 0.4rem;
padding:0.2rem 0.8rem;
cursor: pointer;
color:white;
font-size: 15px;
border-radius: .5rem;
text-transform: capitalize;
}
.cart-btn1 {
margin-left: 40%;
background-color: red;
}
.cart-btn2 {
background-color: #ffa41c;
color: black;
}
.placed-orders .title {
text-align: center;
margin-bottom: 20px;
text-transform: uppercase;
color: black;
font-size: 40px;
}
.placed-orders .box-container {
max-width: 1200px;
margin: 0 auto;
display: flex;
flex-wrap: wrap;
align-items: center;
gap: 20px;
}
.placed-orders .box-container .empty {
flex: 1;
}
.placed-orders .box-container .box {
flex: 1 1 400px;
border-radius: .5rem;
padding: 15px;
border: 2px solid rgb(9, 218, 255);
background-color: white;
padding: 10px 20px;
}
.placed-orders .box-container .box p {
padding: 10px 0 0 0;
font-size: 20px;
color: gray;
}
.placed-orders .box-container .box p span {
color: black;
}
.message {
position: sticky;
top: 0;
margin: 0 auto;
width: 61%;
background-color: #fff;
padding: 6px 9px;
display: flex;
align-items: center;
justify-content: space-between;
z-index: 100;
gap: 0px;
border: 2px solid rgb(68, 203, 236);
border-top-right-radius: 8px;
border-bottom-left-radius: 8px;
}
.message span {
font-size: 22px;
color: rgb(240, 18, 18);
font-weight: 400;
}
.message i {
cursor: pointer;
color: rgb(3, 227, 235);
font-size: 15px;
}
</style>
</head>
<body>
<?php include 'admin_header.php'; ?>
<?php
if (isset($message)) {
foreach ($message as $message) {
echo '
<div class="message" id= "messages"><span>' . $message . '</span>
</div>
';
}
}
?>
<section class="placed-orders">
<h1 class="title">placed orders</h1>
<div class="box-container">
<?php
$select_orders = mysqli_query($conn, "SELECT * FROM `confirm_order`") or die('query failed');
if (mysqli_num_rows($select_orders) > 0) {
while ($fetch_book = mysqli_fetch_assoc($select_orders)) {
?>
<div class="box">
<p> Order Date : <span><?php echo $fetch_book['order_date']; ?></span> </p>
<p> Order Id : <span>#<?php echo $fetch_book['order_id']; ?> </p>
<p> Name : <span><?php echo $fetch_book['name']; ?></span> </p>
<p> Mobile Number : <span><?php echo $fetch_book['number']; ?></span> </p>
<p> Email Id : <span><?php echo $fetch_book['email']; ?></span> </p>
<p> Address : <span><?php echo $fetch_book['address']; ?></span> </p>
<p> Payment Method : <span><?php echo $fetch_book['payment_method']; ?></span> </p>
<p> Your orders : <span><?php echo $fetch_book['total_books']; ?></span> </p>
<p> Total price : <span>₹ <?php echo $fetch_book['total_price']; ?>/-</span> </p>
<form action="" method="post">
<input type="hidden" name="order_id" value="<?php echo $fetch_book['order_id']; ?>">
Payment Status :<select name="update_payment">
<option value="" selected disabled><?php echo $fetch_book['payment_status'];
?></option>
<option value="pending">pending</option>
<option value="completed">completed</option>
</select>
<input type="submit" value="update" name="update_order" class="cart-btn2">
<a class="cart-btn1" href="admin_orders.php?delete=<?php echo $fetch_book['order_id']; ?>"
onclick="return confirm('delete this order?');">delete</a>
</form>
</div>
<?php
}
} else {
echo '<p class="empty">no orders placed yet!</p>';
}
?>
</div>
</section>
<!-- custom admin js file link -->
<script src="js/admin_script.js"></script>
<script>
setTimeout(() => {
const box = document.getElementById('messages');
// 👇️ hides element (still takes up space on page)
box.style.display = 'none';
}, 8000);
</script>
</body>
</html>
message_admin.Php
<?php
include 'config.php';
session_start();
$admin_id = $_SESSION['admin_id'];
if(!isset($admin_id)){
header('location:login.php');
};
if (isset($_GET['delete_msg'])) {
$msg_id = $_GET['delete_msg'];
mysqli_query($conn, "DELETE FROM `msg` WHERE id = '$msg_id'") or die('query failed');
header('location:message_admin.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">
<link rel="stylesheet" href="./css/register.css">
<link rel="stylesheet" href="./css/index_book.css">
<title>Messages</title>
</head>
<body>
<?php
include 'admin_header.php';
?>
<section class="show-products">
<div class="box-container">
<?php
$select_user = mysqli_query($conn, "SELECT id,name,email,number,msg,date FROM msg") or die('query
failed');
if(mysqli_num_rows($select_user) > 0){
while($fetch_user = mysqli_fetch_assoc($select_user)){
?>
<div class="box">
<div class="name">Message ID: <?php echo $fetch_user['id']; ?></div>
<div class="name">Name: <?php echo $fetch_user['name']; ?></div>
<div class="name">Email ID: <?php echo $fetch_user['email']; ?></div>
<div class="password">Number: <?php echo $fetch_user['number']; ?></div>
<div class="price">Message: <?php echo wordwrap($fetch_user['msg'],30,"<br>n",TRUE); ?></div>
<div class="price">Date: <?php echo $fetch_user['date']; ?></div>
<a href="message_admin.php?delete_msg=<?php echo $fetch_user['id']; ?>" onclick="return confirm('delete
this message?');">Delete</a>
</div>
<?php
}
}else{
echo '<p class="empty">No any message recived yet!</p>';
}
?>
</div>
</section>
</body>
</html>
admin.css
@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@100;200;300;400;500;600;700&display=swap");
* {
text-decoration: none;
margin: 0;
padding: 0;
font-family: "Poppins", sans-serif;
box-sizing: border-box;
outline: none;
border: none;
}
header {
background: #f2f1f1;
display: flex;
justify-content: space-between;
top: 0;
left: 0;
right: 0;
padding: 10px 1%;
align-items: center;
position: sticky;
z-index: 1000;
box-shadow: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.1);
}
.logo a {
display: flex;
cursor: pointer;
}
.logo a span {
color: rgb(255, 5, 5);
font-weight: bold;
padding-right: 5px;
font-size: 40px;
}
.logo a .me {
color: black;
font-weight: 500;
}
.nav a {
padding: 0.5rem 1rem;
color: rgb(2, 120, 238);
font-weight: 600;
transition: 0.2s ease;
}
.nav a:hover {
color: red;
border-bottom:3px solid black;
}
header .right {
align-items: center;
display: flex;
}
header .right .Btn {
color: rgb(15, 155, 248);
margin: 0 15px;
padding: 5px 3px;
font-size: 25px;
font-weight: 600;
transition: 0.2s ease;
}
header .right .Btn:hover {
color: rgb(255, 6, 6);
border-bottom: 3px solid #0e0e0d;
}
header .right .log_info {
font-size: 25px;
}
/* *************Admin Home Section************************** */
.main_box{
display: grid;
grid-template-columns: repeat(auto-fit, 17rem);
justify-content: center;
gap:1.5rem;
max-width: 1200px;
margin:0 auto;
align-items: flex-start;
}
.card {
position: relative;
display: flex;
flex-direction: column;
min-width: 0;
word-wrap: break-word;
background-color: #fff;
background-clip: border-box;
border-radius: 0.25rem;
margin: 5px;
border-radius: 0.5rem;
border: 2px solid rgb(9, 218, 255);
}
.card-img-top {
width: 64%;
height: 130px;
margin: auto;
border-top-left-radius: calc(0.25rem - 1px);
border-top-right-radius: calc(0.25rem - 1px);
}
.card img {
vertical-align: middle;
border-style: none;
}
.card-body {
-ms-flex: 1 1 auto;
flex: 1 1 auto;
padding: 1.25rem;
}
.card-title {
margin-bottom: 0.75rem;
}
.card-body h5 {
font-size: 1.25rem;
margin-bottom: 0.5rem;
font-family: inherit;
font-weight: 500;
line-height: 1.2;
color: inherit;
margin-top: 0;
}
.card-body p {
margin-top: 0;
margin-bottom: 1rem;
font-size: 35px;
font-weight: 700;
}
.btn:not(:disabled):not(.disabled) {
cursor: pointer;
}
.btn-primary {
color: #fff;
background-color: rgb(68, 109, 245);
border-color: rgb(14, 13, 13);
}
.btn {
display: inline-block;
font-weight: 400;
text-align: center;
white-space: nowrap;
vertical-align: middle;
user-select: none;
border: 1px solid transparent;
padding: 0.375rem 0.75rem;
font-size: 13px;
margin: 3px;
line-height: 1.5;
border-radius: 0.25rem;
transition: color .15s ease-in-out,background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow
.15s ease-in-out;
}
a {
color: #ff0000;
text-decoration: none;
background-color: transparent;
}
/* *************Admin Home Section************************** */
details.css
@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@100;200;300;400;500;600;700&display=swap");
section{
color: black;
font-family: "Poppins", sans-serif;
overflow: hidden;
}
section .main{
padding: 100px 20px;
margin: auto 0;
}
section .main .container{
display: flex;
flex-wrap: wrap;
margin: 0 auto;
justify-content: center;
}
section .main .container img{
align-items:center;
object-fit: cover;
object-position: center;
display: block;
position: relative;
height: 278px;
border: 4px solid rgb(77, 165, 42);
margin: 20px;
padding: 20px 10px;
border-radius: 10px;
}
section .main .container .right{
padding: 30px;
width: 400px;
border: 2px solid rgb(19, 212, 12);
}
section .main .container .right h2{
text-transform: capitalize;
font-size: 25px;
color: rgb(107 114 128);
letter-spacing: 2px;
}
section .main .container .right h1{
font-size: 30px;
font-weight: 500;
}
section .main .container .right p{
line-height: 1.625;
display: flex;
flex-wrap: wrap;
width: auto;
}
section .main .container .right .flex{
display: flex;
justify-content: space-around;
padding: 30px 0;
}
hello.css
@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@100;200;300;400;500;600;700&display=swap");
@import url('https://fonts.googleapis.com/css2?family=Comfortaa:wght@400;500;700&display=swap');
* {
text-decoration: none;
margin: 0;
padding: 0;
font-family: "Poppins", sans-serif;
box-sizing: border-box;
outline: none; border:none;
}
header {
background: #f2f1f1;
display: flex;
justify-content: space-between;
top: 0; left: 0; right: 0;
padding: 10px 1%;
align-items: center;
position: sticky;
z-index: 1000;
box-shadow: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.1);
}
.logo a{
display: flex;
cursor: pointer;
}
.logo a span {
color: rgb(255, 0, 0);
font-weight: bold;
padding-right: 5px;
font-size: 40px;
}
.logo a .me {
color: rgb(0, 0, 0);
font-weight: 500;
}
.nav a {
padding: 0.5rem 1rem;
color: rgb(9, 152, 248);
font-weight: 600;
transition: 0.2s ease;
}
.nav a:hover {
color: black;
border-bottom: 3px solid rgb(245, 12, 12);
}
header .right .Btn {
color: rgb(236, 6, 6);
margin: 0 15px;
padding: 5px 3px;
font-size: 13px;
font-weight: 600;
transition: 0.2s ease;
}
header .right .Btn:hover {
color: black;
border-bottom: 3px solid #e6e208;
}
/* **********Header Close********************* */
section .banner{
background-image: url(../images/imgg.png);
background-position: center;
background-size: cover;
background-repeat: no-repeat;
width: auto;
height: 144px;
margin: 1rem 0;
z-index: 1000;
}
/* showing books on home page */
.show-products .box-container{
display: grid;
grid-template-columns: repeat(auto-fit, 17rem);
justify-content: center;
gap:1.5rem;
max-width: 1200px;
margin:0 auto;
align-items: flex-start;
}
.show-products{
padding-top: 0;
margin-top: 55px;
}
.show-products .box-container .box{
text-align: center;
padding:10px;
border-radius: .5rem;
border: 2px solid rgb(9, 218, 255);
}
#home .container h2{
font-family: 'Comfortaa', cursive;
font-weight: bolder;
}
.show-products .box-container .box img{
height: 25px;
display: inline-block;
}
.show-products .box-container .box .name{
font-size: 1rem;
color:black;
text-transform: capitalize;
}
.show-products .box-container .box .price{
margin: 8px 0;
font-size: 17px;
color: #f35516;
font-weight: 400;
}
.show-products .box-container .box .update_btn,.update_btn{
padding: 4px 4px;
margin: 4px;
border-radius: 7px;
color: rgb(0, 167, 245);
text-transform: capitalize;
text-decoration: none;
}
.show-products .box-container .box .delete_btn, .delete_btn{
padding: 5px 5px;
margin: 2px;
}
/* Scrollbarr */
::-webkit-scrollbar {
width: 6px;
}
::-webkit-scrollbar-track {
background: #f2f1f1;
border-radius: 10px;
}
::-webkit-scrollbar-thumb {
background: rgb(0, 167, 245);
width: 5px;
border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
background: black;
}
/* Scrollbarr */
/* css for Cart Page */
.cart_form{
margin: 20px auto;
}
.cart_form table{
border-collapse: collapse;
width: 100%;
}
.book_info{
display: flex;
flex-wrap: wrap;
}
.cart_form table tr th{
text-align: left;
padding: 6px;
color: #fff;
background: rgb(0, 167, 245);
}
.cart_form table tr td{
padding: 10px 5px;
}
.cart_form table tr td input{
width: 40px;
height: 30px;
padding: 5px;
}
td .book_info a{
color: rgb(0, 167, 245);
font-size: 12px;
}
td .book_info img{
width: 80px;
height: 80px;
margin-right: 10px;
}
/* css for Cart Page */
/* ********************CONTACT PAGE************* */
.contact-section{
background: url(bg.png) no-repeat center;
background-size: cover;
padding: 40px 0;
}
.contact-section h1{
text-align: center;
color: #ddd;
}
.border{
width: 100px;
height: 10px;
background: #131414;
margin: 40px auto;
}
.contact-section{
justify-content: center;
background-image: linear-gradient(45deg,
rgba(0, 0, 3, 0.1),
rgba(0, 0, 0, 0.5)), url(../images/c1.jpg);
background-repeat: no-repeat;
background-position: center;
background-size: cover;
}
.contact-form{
max-width: 600px;
margin: auto;
padding: 0 10px;
overflow: hidden;
}
.contact-form-text{
display: block;
width: 100%;
box-sizing: border-box;
margin: 16px 0;
border: 0;
background: rgba(19, 18, 18, 0.9);
padding: 20px 40px;
outline: none;
color: #ddd;
font-size: 15px;
border-radius: 8px;
transition: 0.5s;
}
.contact-form-text:focus{
box-shadow: 0 0 10px 4px rgb(0, 167, 245);
}
textarea.contact-form-text{
resize: none;
height: 120px;
}
.contact-form-btn{
float: right;
border: 0;
background:rgb(15, 15, 15);
color: #fff;
padding: 12px 50px;
border-radius: 20px;
cursor: pointer;
transition: 0.5s;
}
.contact-form-btn:hover{
background: rgb(0, 167, 245);
}
/* ********************CONTACT PAGE************* */
/* Style The Dropdown Button */
header .nav .dropdown .dropbtn {
color: rgb(0, 167, 245);
padding: 8px 10px;
font-weight: bold;
border: none;
cursor: pointer;
}
/* The container <div> - needed to position the dropdown content */
header .nav .dropdown {
position: relative;
display: inline-block;
}
/* Dropdown Content (Hidden by Default) */
header .nav .dropdown .dropdown-content {
display: none;
position: absolute;
background-color: #f9f9f9;
min-width: 160px;
box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
z-index: 1;
}
/* Links inside the dropdown */
header .nav .dropdown .dropbtn .dropdown-content a {
color: black;
padding: 12px 16px;
text-decoration: none;
display: block;
}
/* Change color of dropdown links on hover */
header .nav .dropdown .dropbtn .dropdown-content a:hover {background-color: #f1f1f1}
/* Show the dropdown menu on hover */
header .nav .dropdown:hover .dropdown-content {
display: flex;
flex-direction: column;
}
/* **********************************ORDER PAGE*********************************** */
.placed-orders .title{
text-align: center;
margin-bottom: 20px;
text-transform: uppercase;
color:black;
font-size: 40px;
}
.placed-orders .box-container{
max-width: 1200px;
margin:0 auto;
display:flex;
flex-wrap: wrap;
align-items: center;
gap:20px;
}
.placed-orders .box-container .empty{
flex:1;
}
.placed-orders .box-container .box{
flex:1 1 400px;
border-radius: .5rem;
padding:15px;
border:2px solid rgb(14, 152, 231);
background-color: white;
padding:10px 20px;
}
.placed-orders .box-container .box p{
padding:10px 0 0 0;
font-size: 20px;
color:gray;
}
.placed-orders .box-container .box p span{
color:black;
}
.message {
position: sticky;
top: 0;
margin: 0 auto;
width: 61%;
background-color: #fff;
padding: 6px 9px;
display: flex;
align-items: center;
justify-content: space-between;
z-index: 100;
gap: 0px;
border: 2px solid rgb(68, 203, 236);
border-top-right-radius: 8px;
border-bottom-left-radius: 8px;
}
/* **********************************ORDER PAGE*********************************** */
index_book.css
@import url('https://fonts.googleapis.com/css2?family=Comfortaa:wght@400;500;700&display=swap');
@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@100;200;300;400;500;600;700&display=swap");
* {
text-decoration: none;
margin: 0;
padding: 0;
font-family: "Poppins", sans-serif;
box-sizing: border-box;
outline: none; border:none;
}
.show-products .box-container{
display: grid;
grid-template-columns: repeat(auto-fit, 20rem);
justify-content: center;
gap:1.5rem;
max-width: 1200px;
margin:0 auto;
align-items: flex-start;
}
.show-products{
padding-top: 0;
margin-top: 15px;
}
.show-products .box-container .box{
text-align: center;
padding:10px;
border-radius: .5rem;
border:2px solid rgb(9, 218, 255);
}
#home .container h2{
font-family: 'Comfortaa', cursive;
font-weight: bolder;
}
.show-products .box-container .box img{
height: 190px;
display: inline-block;
}
.show-products .box-container .box .name{
font-size: 1rem;
color:black;
text-transform: capitalize;
}
.show-products .box-container .box .price{
margin: 8px 0px;
font-size: 17px;
color: rgb(3, 180, 224);
font-weight: 400;
}
.show-products .box-container .box .update_btn,.update_btn{
background-color: rgb(253, 15, 7);
padding: 9px 15px;
margin: 6px;
border-radius: 10px;
color: white;
text-transform: capitalize;
}
.show-products .box-container .box .delete_btn, .delete_btn{
background-color: rgb(255, 208, 0);
padding: 9px 15px;
margin: 6px;
border-radius: 10px;
color: rgb(255,255, 255);
text-transform: capitalize;
}
/* details book */
.details{
margin-top: 80px;
}
.details .row_box{
display: flex;
justify-content: center;
align-items: center;
}
.details .col_box img{
height: 420px;
}
.details .col_box{
padding: 80px;
}
.details .col_box img{
padding: 0;
}
.details h3{
margin: 20px 0;
font-size: 22px;
font-weight: bold;
}
.details label{
font-size: 17px;
font-weight: 700;
}
.details input{
width: 130px;
height: 41px;
padding-left: 3px;
font-size: 20px;
margin-left: 10px;
border-radius: 5px;
border: 1px solid rgb(0, 240, 248);
}
input:focus{
outline: none;
}
.details .col_box .buttons{
display: flex;
margin: 12px;
}
.details .buttons a{
background-color: rgb(6, 144, 236);
color: white;
font-size: 15px;
font-weight: bold;
border-radius: 17px;
padding: 12px;
margin-right: 10px;
text-decoration: none;
}
/* details book */
register.css
@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@100;200;300;400;500;600;700&display=swap");
* {
text-decoration: none;
}
body {
background: #fff;
font-family: "Poppins", sans-serif;
}
html {
overflow-x: hidden;
top: 0;
bottom: 0;
left: 0;
right: 0;
}
.container {
display: flex;
justify-content: center;
background-image: linear-gradient(
45deg,
rgba(0, 0, 3, 0.1),
rgba(0, 0, 0, 0.5)
),
url(../bgimg/3.jpg);
background-repeat: no-repeat;
background-position: center;
background-size: cover;
height: 98vh;
}
.container_box {
display: flex;
justify-content: center;
align-items: center;
}
.container form,
.container_box form {
margin: auto;
display: flex;
flex-direction: column;
width: 60rem;
text-align: center;
align-items: center;
}
.container form h3,
.container_box form h3 {
font-size: 32px;
margin-bottom: 0.5rem;
margin-top: 5px;
text-transform: capitalize;
color: rgb(22, 21, 21);
}
.container_box form h3 a :first-child,
.container form h3 a :first-child {
color: rgb(233, 3, 3);
}
.container form h3 a :last-child,
.container_box form h3 a :last-child {
color: rgb(14, 13, 13);
}
.container form .text_field,
.container_box form .text_field {
width: 40%;
border-radius: 8px;
margin: 5px 0;
padding: 13px 13px;
font-size: 15px;
color: black;
border: 2px solid rgb(0, 181, 226);
}
.container form p,
.container_box form p {
padding-top: 5px;
font-size: 25px;
color: white;
}
.container form p a,
.container_box form p a {
color: rgb(20, 20, 20);
}
.container form .btn,
.container_box form .btn {
background-color: #fff9f9;
color: rgb(7, 7, 7);
font-size: 20px;
}
.container form .btn:hover,
.container_box form .btn:hover {
background: rgb(0, 167, 245);
border-radius: 8px solid rgb(248, 240, 240);
cursor: pointer;
}
/* Message */
.message {
position: sticky;
top: 0;
margin: 0 auto;
width: 61%;
background-color: #fff;
padding: 6px 9px;
display: flex;
align-items: center;
justify-content: space-between;
z-index: 100;
gap: 0px;
border: 2px solid rgb(68, 203, 236);
border-top-right-radius: 8px;
border-bottom-left-radius: 8px;
}
.message span {
font-size: 22px;
color: rgb(240, 18, 18);
font-weight: 400;
}
.message i {
cursor: pointer;
color: rgb(3, 227, 235);
font-size: 15px;
}
.show-products .box-container {
display: grid;
grid-template-columns: repeat(auto-fit, 27rem);
justify-content: center;
gap: 1.5rem;
max-width: 1200px;
margin: 0 auto;
align-items: flex-start;
}
.show-products {
padding-top: 0;
margin-top: 15px;
}
.show-products .box-container .box {
text-align: center;
padding: 12px;
border-radius: 0.5rem;
border: 2px solid rgb(15, 156, 221);
}
.show-products .box-container .box img {
height: 180px;
}
.show-products .box-container .box .name {
font-size: 1rem;
color: black;
text-transform: capitalize;
}
.show-products .box-container .box .price {
margin: 15px;
font-size: 20px;
color: rgb(32, 31, 31);
}
.show-products .box-container .box .update_btn,
.update_btn {
background-color: rgb(255, 187, 0);
padding: 9px 15px;
margin: 6px;
border-radius: 10px;
color: white;
text-transform: capitalize;
}
.show-products .box-container .box .delete_btn,
.delete_btn {
background-color: rgb(238, 0, 0);
padding: 9px 15px;
margin: 6px;
border-radius: 10px;
color: white;
text-transform: capitalize;
}
.edit-product-form {
/* min-height: 128vh; */
background-color: white;
display: flex;
align-items: center;
justify-content: center;
padding: 2rem;
overflow-y: scroll;
/* position: fixed; */
top: 0;
left: 0;
z-index: 1200;
width: 100%;
}
.edit-product-form form {
width: 50rem;
padding: 2rem;
text-align: center;
border-radius: 0.5rem;
background-color: var(--white);
}
.edit-product-form form img {
height: 233px;
margin-bottom: 1rem;
}
.edit-product-form form .box {
margin: 6px 0;
padding: 1rem 3.4rem;
border: 2px solid rgb(76, 202, 240);
border-radius: 0.5rem;
background-color: white;
font-size: 18px;
color: black;
width: 89%;
}
Future enhancement
Following expansion can be done
• Users can buy subscription to read online.
• Users can select whether he want to purchase a hard copy or soft copy, if user
wants soft copy after successfull of payment he can download the pdf form of
the book.
References
www.google.com
www.w3school.com
www.php.net
www.youtube.com
PHASE COMPLETION TABLE
PHASE EXCEPTED DATE
OF COMPLETION
ACTUAL DATE OF
COMPLETION
REMARKS
Planning 19th
December
2023
25th
December 2023
Analysis 10thJanuary 2023 18thJanuary
2023
Design 25thJanuary 2023 30thJanuary
2023
Coding 3rd February
2023
20th February
2022
Testing&
Implementation
22st
February2023
24st February
2023
Documentation 25th
February
2023
1st March 2023

More Related Content

DOC
SYNOPSIS ON BANK MANAGEMENT SYSTEM
DOC
College management
PDF
04.project billing system
PPTX
Library management system project
DOCX
Mingle box - Online Job seeking System
PDF
Near east university
DOCX
RUNNING HEAD New Castle County Library System.1RUNNING HEAD.docx
PPTX
Online Library Management
SYNOPSIS ON BANK MANAGEMENT SYSTEM
College management
04.project billing system
Library management system project
Mingle box - Online Job seeking System
Near east university
RUNNING HEAD New Castle County Library System.1RUNNING HEAD.docx
Online Library Management

Similar to amansingh.docx (20)

PPTX
Crime security.
DOC
Database project
PDF
Mis project report on DELHI INFO.COM MANAGEMENT INFORMATION SYSTEM
PDF
A CASE STUDY ON ONLINE TICKET BOOKING SYSTEM PROJECT.pdf
PDF
Library management system project report II..pdf
DOCX
J2ee project lists:-Mumbai Academics
DOC
Print report
DOCX
COMPUTER APPLICATION PROJECT ON
DOC
Synopsis on billing system
PDF
Real estate
DOCX
Document(1)
DOCX
Online movie ticket booking
PDF
Library management system
DOCX
college website project report
PDF
A CASE STUDY ON ONLINE TICKET BOOKING SYSTEM PROJECT.pdf
PPTX
agri-commerce hub project-documentation report.pptx
PPTX
Issue tracking system
PDF
Cosmetic shop management system project report.pdf
DOCX
Major File On web Development
PDF
Online job placement system project report.pdf
Crime security.
Database project
Mis project report on DELHI INFO.COM MANAGEMENT INFORMATION SYSTEM
A CASE STUDY ON ONLINE TICKET BOOKING SYSTEM PROJECT.pdf
Library management system project report II..pdf
J2ee project lists:-Mumbai Academics
Print report
COMPUTER APPLICATION PROJECT ON
Synopsis on billing system
Real estate
Document(1)
Online movie ticket booking
Library management system
college website project report
A CASE STUDY ON ONLINE TICKET BOOKING SYSTEM PROJECT.pdf
agri-commerce hub project-documentation report.pptx
Issue tracking system
Cosmetic shop management system project report.pdf
Major File On web Development
Online job placement system project report.pdf
Ad

Recently uploaded (20)

PDF
Fun with Grammar (Communicative Activities for the Azar Grammar Series)
PDF
Literature_Review_methods_ BRACU_MKT426 course material
PDF
Race Reva University – Shaping Future Leaders in Artificial Intelligence
PDF
FOISHS ANNUAL IMPLEMENTATION PLAN 2025.pdf
PPTX
Macbeth play - analysis .pptx english lit
PDF
LIFE & LIVING TRILOGY - PART (3) REALITY & MYSTERY.pdf
PPTX
DRUGS USED FOR HORMONAL DISORDER, SUPPLIMENTATION, CONTRACEPTION, & MEDICAL T...
PPTX
Core Concepts of Personalized Learning and Virtual Learning Environments
PDF
Journal of Dental Science - UDMY (2022).pdf
PDF
CISA (Certified Information Systems Auditor) Domain-Wise Summary.pdf
PDF
LIFE & LIVING TRILOGY - PART - (2) THE PURPOSE OF LIFE.pdf
PDF
Compact First Student's Book Cambridge Official
PDF
plant tissues class 6-7 mcqs chatgpt.pdf
PDF
My India Quiz Book_20210205121199924.pdf
PDF
AI-driven educational solutions for real-life interventions in the Philippine...
PDF
Laparoscopic Colorectal Surgery at WLH Hospital
PDF
LEARNERS WITH ADDITIONAL NEEDS ProfEd Topic
PDF
Skin Care and Cosmetic Ingredients Dictionary ( PDFDrive ).pdf
PDF
Vision Prelims GS PYQ Analysis 2011-2022 www.upscpdf.com.pdf
PPTX
Education and Perspectives of Education.pptx
Fun with Grammar (Communicative Activities for the Azar Grammar Series)
Literature_Review_methods_ BRACU_MKT426 course material
Race Reva University – Shaping Future Leaders in Artificial Intelligence
FOISHS ANNUAL IMPLEMENTATION PLAN 2025.pdf
Macbeth play - analysis .pptx english lit
LIFE & LIVING TRILOGY - PART (3) REALITY & MYSTERY.pdf
DRUGS USED FOR HORMONAL DISORDER, SUPPLIMENTATION, CONTRACEPTION, & MEDICAL T...
Core Concepts of Personalized Learning and Virtual Learning Environments
Journal of Dental Science - UDMY (2022).pdf
CISA (Certified Information Systems Auditor) Domain-Wise Summary.pdf
LIFE & LIVING TRILOGY - PART - (2) THE PURPOSE OF LIFE.pdf
Compact First Student's Book Cambridge Official
plant tissues class 6-7 mcqs chatgpt.pdf
My India Quiz Book_20210205121199924.pdf
AI-driven educational solutions for real-life interventions in the Philippine...
Laparoscopic Colorectal Surgery at WLH Hospital
LEARNERS WITH ADDITIONAL NEEDS ProfEd Topic
Skin Care and Cosmetic Ingredients Dictionary ( PDFDrive ).pdf
Vision Prelims GS PYQ Analysis 2011-2022 www.upscpdf.com.pdf
Education and Perspectives of Education.pptx
Ad

amansingh.docx

  • 1. Web PROJECT ON “Bookflix & chill” SUBMITTED BY Mr. Aman Kumar Singh Third Year Bachelor of science (COMPUTER SCIENCE) UNDER THE GUIDaNCE OF Dr Ashwin Mehata ISMAIL YUSUF COLLEGE OF ARTS, SCIENCE AND COMMERCE Jogeshwari-(East) MUMBAI-400060
  • 2. Government of Maharashtra’s ISMAIL YUSUF COLLEGE Jogeshwari (East), Mumbai-400060 DEPARTMENT OF COMPUTER SCIENCE CERTIFICATE This is to certify that the project entitled “Bookflix & Chill” is completed by Mr. Aman Kumar Singh (Seat No:_____________) Under the guidance of Dr Ashwin Mehata In partial fulfilment for the Degree of Bachelor of Science (Computer Science) of University of Mumbai
  • 3. ____________________ ____________________ ____________________ Prof.Incharge Head External Examiner INDEX Sr.No. Content Page No. 1. Acknowledgement 8 2. Introduction / Preliminary Investigation 10 • Organisational Overview 10 • Description of the Existing System 10 • Description of the Proposed System 11 • Feasibility Study 11 • System Requirements: Software/hardware/data 13 • Gantt Chart 14 3. System Design details 15 • Finding Facts Techniques 15 • Use Case Diagram 16 • Entity Relationship Diagram 17 • Activity Diagram 17 • Class Diagram 18 • Sequence Diagram 18 • State Diagram 19 • Package Diagram 19
  • 4. • Component Diagram 20 • System Coding Diagram 20 • Deployment Diagram 21 5. System Implementation 22 Program Description. 22 6. Results: 24 1. List of Tables with attributes and constraints 24 2.Test Cases, Test Data, and Test Results 27 3. Screen Shots 28 7. Code implementation. 37 8. Conclusion and Future Scope 74 9. References 74 10. Phase Completion table 74 Acknowledgement
  • 5. The project of “Bookflix & Chill” has been a unique experience for me. I am very thankful to the Department of Computer Science of the Government of Maharashtra’s Ismail Yusuf College, which gave me the opportunity to take on this project. I express my gratitude to our Head of Department Prof. Nitin D. Shelke and my project guide Dr Ashwin Mehata for her invaluable support and guidance during the course of the project. I am also very much thankful to the “UNIVERSITY OF MUMBAI” for including the project work as part of the syllabus, without which I would not have gained the experience of developing software as this. Last but not the least, I would like to express my gratitude to my Friends for their support and guidance throughout this venture. Thanking You Introduction/ Preliminary Investigation • Organisational overview The main objective of the project is to create an online book store that allows users to search and purchase a book based on title, author and subject. The selected books are displayed in a tabular
  • 6. format and the user can order their books online through credit card payment. The Administrator will have additional functionalities when compared to the common user. DESCRIPTION OF THE EXISTING SYSTEM Previously people have to go shop by shop to search and buy the books, which is really time consuming and very difficult to get your favourite book. People had to wait for long time to get the new launched book. Its had take many days for books to come in peoples near by store. People was facing problems to get their favourite authors books. Existing System: • The Records are maintained manually in registers for old students • Peoples have to search for books store by store • I.e. its very time consuming • If there is any popular book launched recently it's very hard to get it. • The owner has to manually keep updating information by entering the details in the logbook. • Chance of human errors and manipulation. DESCRIPTION OF THE PROPOSED SYSTEM The main objective of the Bookflix & Chill is to manage the details of Books, Customers, Payments, Delivery, and Bills. It manages all the information about Books, Stock, Bills, and Books. The project is totally built at the administrative end and thus only the administrator is guaranteed access. The purpose of the project is to build an application program to reduce the manual work of managing
  • 7. Books, Customers, Stock, and Payment. It tracks all the details about the Payment, Delivery, and Bills. Advantages: • Very fast and accurate. • Easy to use and understand. • Secure. • Easy Navigation. • Time and Paperwork saving since it is automated. • Reports can be generated at any time within a few seconds Scope of the proposed system: • To provide users to purchase books online. • To add/delete users, and manage their accounts. • To reduce users' searching time. • To provide a wide collection of book ranges. • To provide a user-friendly environment. • To provide acknowledgment to the user. Feasibility Study Depending on the result of the initial investigation the survey was expanded to a more detailed feasibility study.
  • 8. Feasibility is the process of defining exactly what is and what strategic issues need to be considered to access its feasibility, or likelihood of succeeding. Feasibility studies are useful both when starting a new business and identifying a new opportunity for example for an existing business. The feasibility study is a test of a system proposal according to its workability and impact on the organisation, ability to meet user needs and effective use of resources. Technical Feasibility: We can strongly say that it is technically feasible since there will not be much difficulty in getting required for the development and maintaining the system as well. All the resources needed for the development of software as well as the maintenance of the same are available in the organisation here we are utilising the resources which are available already. Economical Feasibility: The development of this application is highly economically feasible. The organisation needed not to spend much money on the development of the system already available. The only thing be done in making an environment for development with is to be done is making an environment for development with effective supervision. If we are doing we can attain the maximum usability of the corresponding resources even after the development the organisation will not be in a condition to invest more in the organisation, therefore, the system is economically feasible. Requirement Specification
  • 9. Software Requirements: • Programming language/ Scripting languages used: Php, MySQL • IDE used: Microsoft Visual Studio Code Hardware requirement(Min): • Hard disk: 40 GB • RAM: 1GB • Processor Speed: 3.00GHz • Processor: Pentium IV Processor and above. Client Side Scripting: • HTML • CSS • JavaScript Server Side Scripting: PHP Back-End Tool: Back-end: MySQL Testing Server: Apache Other Software Used: • Canva • Xampp Server Data Requirements: • Insert /Update/Deletion the data in the application manually • Import from the existing system. Operating system compatibility: • MS Windows: Windows 7 and above.
  • 10. • Linux: Ubuntu 16.04 and above, etc. • Gantt Chart Project Phase December January February March Planning Analysis Design Coding Testing & Implementation Documentation Purposed Duration Actual Duration System Design Details FACT FINDING TECHNIQUES What is Fact Finding? Fact Finding is the formal process of using research, interviews, questionnaires, and other techniques to collect information about systems, requirements, and preferences. It is also called information gathering or data collection.
  • 11. Who does it? The System Analyst. The Analyst especially needs to develop a detective mentality to be able to discern relevant facts. What is its Significance in SDLC? Tools, such as data and process models, document facts, and conclusions are drawn from facts. If facts are not collected, tool scant be used effectively and efficiently. When is it done? System Development Life Cycle. • System Analysis Phase • Study Phase • Definition Phase • Selection Phase •Design • Post Implementation Review What are the facts to be collected? Any information System can be examined in terms of four building blocks: • Data: The raw material used to create useful info. • Processes: The activities that carry out the mission. • Interfaces: How the system interacts with people. • Geography: Where data is stored, processes & interfaces happen Fact Finding Techniques There are seven fact-finding techniques: 1. Study & sampling of existing documentation, forms and databases. 2. Research and Site visits. 3. Observation of the work environment. 4. Questionnaires 5. Interviews 6. Joint Application Development (JAD) 7. Rapid Application Development (RAD) an Analyst usually applies several of these techniques during a single systems project. Use-Case diagram
  • 12. Description of use-case diagram Admin side use case diagram : Its indicates that Admin can • Add, Edit, Delete Questions . • Delete, Update Users Account. • Generate Report / Activity Logs Of Users. Users side use case diagram : Its indicates that User can • Add books to cart. • Order the books. • Generate the Invoice of the orders.
  • 13. • Contact to admin. ER diagram Activity diagram
  • 19. Program description Bookflix & Chill This program is designed to sell books online, to make it easy to search for a particular book and get all the books in the same place. Working Admin login- • Admin will log in to the website by entering their particular email id and password. • Then the Admin Panel window gets opens in the admin panel Window there is one menu bar and short details about what is on the website. • There are four menus in the menubar of the Admin Panel window Add Books, Messages, Users, and logout. Users(Staff) Login-
  • 20. • Users will log in to the website by entering their particular email id and password. • Then the Home page of the website window gets open where he can see the description of books, add books to the cart, purchase the books, order history, print the order invoice, and log out. • MenuBar Admin ADD BOOKS When you click on add books on the menubar, a web form page gets open to adding new books to the website. Here you can give the Books name, Author name, Price, category, book description, and choose an image of the book which will be displayed on the website, and when you click on the add book the book will be live on the website. After uploading a new book to the website admin can edit the informations and also can delete the book. User Detail When admin clicks on the user detail in the menu the information about the user section gets open where he can update & Delete the particular user. Messages When admin clicks on the message in the menu a section gets open where the queries ask by the users are listed there. User Home When a user login to the website he get redirected to the home page where he can see the lots of books listed according to category. Cart
  • 21. When a user like the book and he wants to buy it he can click on the shopping cart icon on the home page or on the books details page when he clicks on that the particular book added to his cart. In the cart page if users want to buy the book he can click on the Checkout Now button then he will redirected to the checkout page where he has to fill the a small details form and choose a payment method then click on buy now button then books will be ordered. Orders When user click on the order in menu page the order history page gets open where all the details of the all orders displayed and user can print the invoice of all the particular order. Tables Users Table
  • 24. Test cases,Test data and test results Sr no Test Cases Expected Result Actual Result Pass/Fail 1 Login Test(Admin,Users) Check for data in table and login. Output as expected. Pass 2 Insert records in Database(Admin,Users) Only Valid data must be Enter Output as expected. Pass 3 Remove Data from Database(Admin,Users) Delete data as per Requirement Output as expected. Pass 4 Update Data from Update data as Output as Pass
  • 25. Database(Admin,Users) per Requirement expected. 5 Generate invoice/datalist from Database(Admin,Users) Generate invoice/datalist as per Requirement Output as expected. Pass Screen layouts Admin and User registration page Admin and User login page
  • 26. User Screen layouts User Home Page with category wise section
  • 28. Contact to Admin page Cart Page
  • 29. Checkout Page Order History Page Searching Page
  • 30. Users Header & Footer Section
  • 31. Admin Panel layouts Admin Dashboard Placed Order Page
  • 35. Users Details Page User Update Page
  • 36. Index_header.Php <!DOCTYPE html> <html lang="en"> <link rel="stylesheet" href="./css/hello.css"> <style> .sub-menu-wrap{ position: fixed; top: 9%; right: -1%; width: 320px; max-height: 0px; overflow: hidden; transition: max-height 0.5s; z-index: 100; } .sub-menu-wrap.open-menu{ max-height: 400px; } .sub-menu{ background: #fff; padding: 20px; margin: 10px; border-bottom-right-radius: 16px; border-bottom-left-radius: 16px; } .user-info{ display: flex; align-items: center; }
  • 37. .user-info h3{ font-weight: 500; } .user-info img{ width: 60px; border-radius: 50%; margin-right: 15px; } .sub-menu hr{ border: 0; height: 1px; width: 100%; background: #ccc; margin: 15px 10px; } .sub-menu-link{ display: flex; align-items: center; text-decoration: none; color: #525252; margin: 12px e; } .sub-menu-link p{ width: 100%; } .sub-menu-link img{ width: 40px; background: #e5e5e5; border-radius: 50%; padding: 8px; margin-right: 15px; } .sub-menu-link span{ font-size: 22px; transition: transform 0.5s; } .sub-menu-link:hover span{ transform: translateX(5px); } .sub-menu-link:hover p{ font-weight: 600; } .link_btn{ background-color: brown; padding: 6px; border-radius: 10px; margin-left: 10px; color: white; font-weight: 500; } </style> <body> <header> <div class="logo"> <a href="index.php"><span>Bookflix &</span> <span class="me">Chill</span></a> </div> <div class="nav"> <a href="index.php">Home</a> <div class="dropdown"> <button class="dropbtn">Category </button> <div class="dropdown-content"> <a href="http://localhost/bookflix/index.php#New">New Arrived</a> <a href="http://localhost/bookflix/index.php#Adventure">Adventure</a> <a href="http://localhost/bookflix/index.php#Magical">Magic</a>
  • 38. <a href="http://localhost/bookflix/index.php#Knowledge">Knowledge</a> </div> </div> <a href="contact-us.php">Contact US</a> <a href="cart.php">Cart</a> <a href="orders.php">Orders</a> </div> <div class="user-box" style="display: flex; align-items:center;"> <a class="Btn" href="search_books.php"><img style="height:30px;" src="./images/sea2.png" alt=""></a> <?php if(isset($_SESSION['user_name'])){echo' <img style="height:40px; margin-left:10px ;" src="images/ds2.png" class="user-pic" onclick="toggleMenu()" />';} else{ echo'<div class="use_links"><a class="link_Btn" style="background-color: rgb(0, 167, 245); padding: 6px; border-radius: 10px; margin-left: 10px; color: white; font-weight: 500;" href="login.php">Login</a><a class="link_Btn" style="background-color: rgb(0, 167, 245); padding: 6px; border-radius: 10px; margin-left: 10px; color: white; font-weight: 500;" href="register.php">Register</a></div>'; }?> </div> </header> <div class="sub-menu-wrap" id="subMenu"> <div class="sub-menu"> <div class="user-info"> <img src="images/ds2.png" /> <div class="user-info" style="display: block;"> <h3>Hello, <?php echo $_SESSION['user_name']?></h3> <h6><?php echo $_SESSION['user_email']?></h6> </div> </div> <hr /> <a href="cart.php" class="sub-menu-link"> <p>Cart</p> <span>></span> </a> <a href="contact-us.php" class="sub-menu-link"> <p>Contact Us</p> <span>></span> </a> <a href="orders.php" class="sub-menu-link"> <p>Order history</p> <span>></span> </a> <a href="logout.php" class="sub-menu-link"> <p style="background-color: red; border-radius:8px; text-align:center; color:white; font-weight:600; margin- top:5px; padding:5px;">Logout</p> </a> </div> </div> <script> let subMenu = document.getElementById("subMenu"); function toggleMenu(){ subMenu.classList.toggle("open-menu"); } </script> </body>
  • 39. </html> Index_footer.Php <head> <style> * { text-decoration: none; list-style: none; color: black; } footer { background-color: rgba(0, 0, 0, 0.2); } h2 { font-size: 20px; font-weight: 700 } .flex { display: flex; } ul li:not(:first-child) { padding: 5px; } .short_links ul { margin: 0 110px; } .sub_main .dropdown .dropbtn { border: none; cursor: pointer; } /* The container <div> - needed to position the dropdown content */ .sub_main .dropdown { position: relative; display: inline-block; } /* Dropdown Content (Hidden by Default) */ .sub_main .dropdown .dropdown-content { display: none; position: absolute; background-color: #CCCCCC; min-width: 160px; box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2); z-index: 1; } /* Links inside the dropdown */ .sub_main .dropdown .dropbtn .dropdown-content a { color: black; padding: 12px 16px; text-decoration: none; display: block; } /* Change color of dropdown links on hover */ .sub_main .dropdown .dropbtn .dropdown-content a:hover {background-color: #f1f1f1}
  • 40. /* Show the dropdown menu on hover */ .sub_main .dropdown:hover .dropdown-content { display: flex; flex-direction: column; } </style> <link rel="stylesheet" href="./css/hello.css"> </head> <footer style="margin: 30px auto 0;"> <div class="main" style="align-items:center; padding:40px; "> <div class="sub_main"> <div class="short_links flex" style="justify-content:center; "> <ul> <h2>Quick Links</h2> <li><a href="index.php">Home</a></li> <li> <div class="dropdown"> <a class="dropbtn">Category🔻</a> <div class="dropdown-content"> <a href="index.php#Adventure">Adventure</a> <a href="index.php#Magical">Magic</a> <a href="index.php#Knowledge">Knowledge</a> </div> </div> </li> <li><a href="about-us.php">About Us</a></li> </ul> <?php if(isset($_SESSION['user_name'])){echo' <ul class="account"> <h2>Account</h2> <li><a href="">Profile</a></li> <li><a href="cart.php">Cart</a></li> <li><a href="orders.php">Order History</a></li> <li><a href="logout.php">LogOut</a></li> </ul>';} ?> <ul> <h2>Contact</h2> <li><a href="contact-us.php">Contact Form</a></li> <li>+91 5324851596</li> <li>[email protected]</li> <li>Address: Mumbai 400065</li> </ul> </div> </div> <div style=" align-items:center; justify-content:center; margin:20px 0 0 ;" class="cmsg flex"> <p>Designed By Aman Singh | Copyright &copy; <script> document.write(new Date().getFullYear()) </script> All Rights are reserved by &nbsp</p> <div style="font-size: 30px;" class="logo"> <a href="index.php"><span style="font-size: 15px;"> Bookflix & </span> <span class="me" style="font-size: 15px;">Chill</span></a> </div> </div> </div> </footer> config.Php <?php $conn = new mysqli('localhost','root','','bookflixdb') or die('Connection Failed'.mysqli_error($conn));
  • 41. ?> register.Php <?php include 'config.php'; if(isset($_POST['submit'])) { $name = mysqli_real_escape_string($conn, $_POST['Name']); $Sname = mysqli_real_escape_string($conn, $_POST['Sname']); $email = mysqli_real_escape_string($conn, $_POST['email']); $password = mysqli_real_escape_string($conn, ($_POST['password'])); $cpassword = mysqli_real_escape_string($conn, ($_POST['cpassword'])); $user_type = $_POST['user_type']; $select_users = $conn->query("SELECT * FROM users_info WHERE email = '$email'") or die('query failed'); if(mysqli_num_rows($select_users)!=0){ $message[]='User Already exits!'; }else{ if($password !=$cpassword){ $message[] = 'Confirm password not matched.'; }else{ mysqli_query($conn, "INSERT INTO users_info(`name`, `surname`, `email`, `password`, `user_type`) VALUES('$name','$Sname','$email','$password','$user_type')") or die('Query failed'); $message[]='Registration Done 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" /> <link rel="stylesheet" href="css/register.css " /> <title>Register</title> <style> .container2 { display: flex; justify-content: center; background-image: linear-gradient(45deg, rgba(0, 0, 3, 0.1), rgba(0, 0, 0, 0.5)), url(../bgimg/2.jpg); background-repeat: no-repeat; background-position: center; background-size: cover; height: 98vh; } </style> <style> .container form .link{ text-decoration: none; color:white; border-radius: 17px; padding: 8px 18px; margin: 0px 10px; background: rgb(0, 0, 0); font-size: 20px; } .container form .link:hover{
  • 42. background: rgb(0, 167, 245); } </style> </head> <body> <?php if(isset($message)){ foreach($message as $message){ echo ' <div class="message" id= "messages"><span>'.$message.'</span> </div> '; } } ?> <div class="container"> <form action="" method="post"> <h3 style="color:white">Register to Use <a href="index.php"><span>Bookflix & </span><span>Chill</span></a></h3> <input type="text" name="Name" placeholder="Enter Name" required class="text_field "> <input type="text" name="Sname" placeholder="Enter Surname" required class="text_field"> <input type="email" name="email" placeholder="Enter Email Id" required class="text_field"> <input type="password" name="password" placeholder="Enter password" required class="text_field"> <input type="password" name="cpassword" placeholder="Confirm password" required class="text_field"> <select name="user_type" id="" required class="text_field"> <option value="User">User</option> <option value="Admin">Admin</option> </select> <input type="submit" value="Register" name="submit" class="btn text_field"> <p>Already have a Account? <br> <a class="link" href="login.php">Login</a><a class="link" href="index.php">Back</a></p> </form> </div> <script> setTimeout(() => { const box = document.getElementById('messages'); // 👇️ hides element (still takes up space on page) box.style.display = 'none'; }, 8000); </script> </body> </html> Iogin.Php <?php include 'config.php'; session_start(); if (isset($_POST['login'])) { $email = mysqli_real_escape_string($conn, $_POST['email']); $password = mysqli_real_escape_string($conn, $_POST['password']);
  • 43. $select_users = $conn->query("SELECT * FROM users_info WHERE email = '$email' and password='$password' ") or die('query failed'); if (mysqli_num_rows($select_users) ==1) { $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_index.php'); } elseif ($row['user_type'] == 'User') { $_SESSION['user_name'] = $row['name']; $_SESSION['user_email'] = $row['email']; $_SESSION['user_id'] = $row['Id']; header('location:index.php'); } } else { $message[] = 'Incorrect Email Id 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" /> <link rel="stylesheet" href="css/register.css" /> <title>Login Here</title> <style> .container form .link{ text-decoration: none; color:white; border-radius: 17px; padding: 8px 18px; margin: 0px 10px; background: rgb(0, 0, 0); font-size: 20px; } .container form .link:hover{ background: rgb(0, 167, 245); } </style> </head> <body> <?php if(isset($message)){ foreach($message as $message){ echo ' <div class="message" id="messages"><span>'.$message.'</span> </div> '; } } ?> <div class="container"> <form action="" method="post">
  • 44. <h3 style="color:white">login to <a href="index.php"><span>bookflix & </span><span>Chill</span></a></h3> <input type="email" name="email" placeholder="Enter Email Id" required class="text_field"> <input type="password" name="password" placeholder="Enter password" required class="text_field"> <input type="submit" value="Login" name="login" class="btn text_field"> <p>Don't have an Account? <br> <a class="link" href="Register.php">Sign Up</a><a class="link" href="index.php">Back</a></p> </form> </div> <script> setTimeout(() => { const box = document.getElementById('messages'); // 👇️ hides element (still takes up space on page) box.style.display = 'none'; }, 8000); </script> </body> </html> logout.php <?php include 'config.php'; session_start(); session_unset(); session_destroy(); header('location:index.php'); ?> Index.php <?php include 'config.php'; error_reporting(0); session_start(); $user_id = $_SESSION['user_id']; if (isset($_POST['add_to_cart'])) { if (!isset($user_id)) { $message[] = 'Please Login to get your books'; } else { $book_name = $_POST['book_name']; $book_id = $_POST['book_id']; $book_image = $_POST['book_image']; $book_price = $_POST['book_price']; $book_quantity = '1'; $total_price = number_format($book_price * $book_quantity);
  • 45. $select_book = $conn->query("SELECT * FROM cart WHERE book_id= '$book_id' AND user_id='$user_id' ") or die('query failed'); if (mysqli_num_rows($select_book) > 0) { $message[] = 'This Book is alredy in your cart'; } else { $conn->query("INSERT INTO cart (`user_id`,`book_id`,`name`, `price`, `image`,`quantity` ,`total`) VALUES('$user_id','$book_id','$book_name','$book_price','$book_image','$book_quantity', '$total_price')") or die('Add to cart Query failed'); $message[] = 'Book Added To Cart Successfully'; header('location:index.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"> <link rel="stylesheet" href="css/hello.css"> <link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-KyZXEAg3QhqLMpG8r+8fhAXLRk2vvoC2f3B09zVXn8CA5QIVfZOJ3BCsw2P0p/We" crossorigin="anonymous"> <link href="https://unpkg.com/tailwindcss@^1.0/dist/tailwind.min.css" rel="stylesheet" /> <title>Bookflix & Chill</title> <style> img { border: none; } .message { position: sticky; top: 0; margin: 0 auto; width: 61%; background-color: #fff; padding: 6px 9px; display: flex; align-items: center; justify-content: space-between; z-index: 100; gap: 0px; border: 2px solid rgb(68, 203, 236); border-top-right-radius: 8px; border-bottom-left-radius: 8px; } .message span { font-size: 22px; color: rgb(240, 18, 18); font-weight: 400; } .message i { cursor: pointer; color: rgb(3, 227, 235);
  • 46. font-size: 15px; } </style> </head> <body> <?php include 'index_header.php' ?> <?php if (isset($message)) { foreach ($message as $message) { echo ' <div class="message" id= "messages"><span>' . $message . '</span> </div> '; } } ?> <script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384- KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js" integrity="sha384- ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q" crossorigin="anonymous"></script> <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js" integrity="sha384- JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous"></script> <div id="carouselExampleIndicators" class="carousel slide" data-ride="carousel"> <ol class="carousel-indicators"> <li data-target="#carouselExampleIndicators" data-slide-to="0" class="active"></li> <li data-target="#carouselExampleIndicators" data-slide-to="1"></li> <li data-target="#carouselExampleIndicators" data-slide-to="2"></li> </ol> <div class="carousel-inner"> <div class="carousel-item active"> <img class="d-block w-100 " src="https://source.unsplash.com/2200x800/?books" alt="First slide"> </div> <div class="carousel-item"> <img class="d-block w-100" src="https://source.unsplash.com/2200x800/?novel books" alt="Second slide"> </div> <div class="carousel-item"> <img class="d-block w-100" src="https://source.unsplash.com/2200x800/?pyshological books" alt="Third slide"> </div> </div> <a class="carousel-control-prev" href="#carouselExampleIndicators" role="button" data-slide="prev"> <span class="carousel-control-prev-icon" aria-hidden="true"></span> <span class="sr-only">Previous</span> </a> <a class="carousel-control-next" href="#carouselExampleIndicators" role="button" data-slide="next"> <span class="carousel-control-next-icon" aria-hidden="true"></span> <span class="sr-only">Next</span> </a> </div> <section id="New"> <div class="container px-5 mx-auto"> <h2 class="m-8 font-extrabold text-4xl text-center border-t-2 " style="color: rgb(0, 167, 245);">
  • 47. New Arrived </h2> </div> </section> <section class="show-products"> <div class="box-container"> <?php $select_book = mysqli_query($conn, "SELECT * FROM `book_info` ORDER BY date DESC LIMIT 8") or die('query failed'); if (mysqli_num_rows($select_book) > 0) { while ($fetch_book = mysqli_fetch_assoc($select_book)) { ?> <div class="box" style="width: 255px; height:355px;"> <a href="book_details.php?details=<?php echo $fetch_book['bid']; echo '-name=', $fetch_book['name']; ?>"> <img style="height: 200px;width: 125px;margin: auto;" class="books_images" src="added_books/<?php echo $fetch_book['image']; ?>" alt=""></a> <div style="text-align:left ;"> <div style="font-weight: 500; font-size:18px; text-align: center; " class="name"> <?php echo $fetch_book['name']; ?></div> </div> <div class="price">Price: ₹ <?php echo $fetch_book['price']; ?>/-</div> <!-- <button name="add_cart"><img src="./images/cart2.png" alt=""></button> --> <form action="" method="POST"> <input class="hidden_input" type="hidden" name="book_name" value="<?php echo $fetch_book['name'] ?>"> <input class="hidden_input" type="hidden" name="book_id" value="<?php echo $fetch_book['bid'] ?>"> <input class="hidden_input" type="hidden" name="book_image" value="<?php echo $fetch_book['image'] ?>"> <input class="hidden_input" type="hidden" name="book_price" value="<?php echo $fetch_book['price'] ?>"> <button onclick="myFunction()" name="add_to_cart"><img src="./images/cart2.png" alt="Add to cart"> <a href="book_details.php?details=<?php echo $fetch_book['bid']; echo '-name=', $fetch_book['name']; ?>" class="update_btn">Know More</a> </form> <!-- <button name="add_to_cart" ><img src="./images/cart2.png" alt="Add to cart"></button> --> <!-- <input type="submit" name="add_cart" value="cart"> --> </div> <?php } } else { echo '<p class="empty">no products added yet!</p>'; } ?> </div> </section> <section id="Adventure"> </div> <div class="container px-5 mx-auto"> <h2 class="text-gray-400 m-8 font-extrabold text-4xl text-center border-t-2 text-red-800" style="color: rgb(0, 167, 245);" > Adventure
  • 48. </h2> </div> </section> <section class="show-products"> <div class="box-container"> <?php $select_book = mysqli_query($conn, "SELECT * FROM `book_info` where category='Adventure'") or die('query failed'); if (mysqli_num_rows($select_book) > 0) { while ($fetch_book = mysqli_fetch_assoc($select_book)) { ?> <div class="box" style="width: 255px;height: 355px;"> <a href="book_details.php?details=<?php echo $fetch_book['bid']; echo '-name=', $fetch_book['name']; ?>"> <img style="height: 200px;width: 125px;margin: auto;" class="books_images" src="added_books/<?php echo $fetch_book['image']; ?>" alt=""></a> <div style="text-align:left ;"> <div style="font-weight: 500; font-size:18px; text-align: center; " class="name"> <?php echo $fetch_book['name']; ?></div> </div> <div class="price">Price: ₹ <?php echo $fetch_book['price']; ?>/-</div> <!-- <button name="add_cart"><img src="./images/cart2.png" alt=""></button> --> <form action="" method="POST"> <input class="hidden_input" type="hidden" name="book_name" value="<?php echo $fetch_book['name'] ?>"> <input class="hidden_input" type="hidden" name="book_image" value="<?php echo $fetch_book['image'] ?>"> <input class="hidden_input" type="hidden" name="book_price" value="<?php echo $fetch_book['price'] ?>"> <button name="add_to_cart"><img src="./images/cart2.png" alt="Add to cart"> <a href="book_details.php?details=<?php echo $fetch_book['bid']; echo '-name=', $fetch_book['name']; ?>" class="update_btn">Know More</a> </form> <!-- <button name="add_to_cart" ><img src="./images/cart2.png" alt="Add to cart"></button> --> <!-- <input type="submit" name="add_cart" value="cart"> --> </div> <?php } } else { echo '<p class="empty">no products added yet!</p>'; } ?> </div> </section> <hr style="color: black; width:5px;"> <section id="Magical"> <div class="container px-5 mx-auto"> <h2 class="text-gray-400 m-8 font-extrabold text-4xl text-center border-t-2 text-red- 800"style="color: rgb(0, 167, 245);"> Magical </h2> </div> </section> <section class="show-products">
  • 49. <div class="box-container"> <?php $select_book = mysqli_query($conn, "SELECT * FROM `book_info` where category='Magic'") or die('query failed'); if (mysqli_num_rows($select_book) > 0) { while ($fetch_book = mysqli_fetch_assoc($select_book)) { ?> <div class="box" style="width: 255px;height: 355px;"> <a href="book_details.php?details=<?php echo $fetch_book['bid']; echo '-name=', $fetch_book['name']; ?>"> <img style="height: 200px;width: 125px;margin: auto;" class="books_images" src="added_books/<?php echo $fetch_book['image']; ?>" alt=""></a> <div style="text-align:left ;"> <div style="font-weight: 500; font-size:18px; text-align: center;" class="name"> <?php echo $fetch_book['name']; ?></div> </div> <div class="price">Price: ₹ <?php echo $fetch_book['price']; ?>/-</div> <!-- <button name="add_cart"><img src="./images/cart2.png" alt=""></button> --> <form action="" method="POST"> <input class="hidden_input" type="hidden" name="book_name" value="<?php echo $fetch_book['name'] ?>"> <input class="hidden_input" type="hidden" name="book_image" value="<?php echo $fetch_book['image'] ?>"> <input class="hidden_input" type="hidden" name="book_price" value="<?php echo $fetch_book['price'] ?>"> <button name="add_to_cart"><img src="./images/cart2.png" alt="Add to cart"> <a href="book_details.php?details=<?php echo $fetch_book['bid']; echo '-name=', $fetch_book['name']; ?>" class="update_btn">Know More</a> </form> <!-- <button name="add_to_cart" ><img src="./images/cart2.png" alt="Add to cart"></button> --> <!-- <input type="submit" name="add_cart" value="cart"> --> </div> <?php } } else { echo '<p class="empty">no products added yet!</p>'; } ?> </div> </section> <section id="Knowledge"> <div class="container px-5 mx-auto"> <h2 class="text-gray-400 m-8 font-extrabold text-4xl text-center border-t-2 text-red-800" style="color: rgb(0, 167, 245);"> Knowledge </h2> </div> </section> <section class="show-products"> <div class="box-container"> <?php $select_book = mysqli_query($conn, "SELECT * FROM `book_info` Where category='knowledge'") or die('query failed');
  • 50. if (mysqli_num_rows($select_book) > 0) { while ($fetch_book = mysqli_fetch_assoc($select_book)) { ?> <div class="box" style="width: 255px;height: 355px;"> <a href="book_details.php?details=<?php echo $fetch_book['bid']; echo '-name=', $fetch_book['name']; ?>"> <img style="height: 200px;width: 125px;margin: auto;" class="books_images" src="added_books/<?php echo $fetch_book['image']; ?>" alt=""></a> <div style="text-align:left ;"> <div style="font-weight: 500; font-size:18px; text-align: center;" class="name"> <?php echo $fetch_book['name']; ?></div> </div> <div class="price">Price: ₹ <?php echo $fetch_book['price']; ?>/-</div> <!-- <button name="add_cart"><img src="./images/cart2.png" alt=""></button> --> <form action="" method="POST"> <input class="hidden_input" type="hidden" name="book_name" value="<?php echo $fetch_book['name'] ?>"> <input class="hidden_input" type="hidden" name="book_image" value="<?php echo $fetch_book['image'] ?>"> <input class="hidden_input" type="hidden" name="book_price" value="<?php echo $fetch_book['price'] ?>"> <button name="add_to_cart"><img src="./images/cart2.png" alt="Add to cart"> <a href="book_details.php?details=<?php echo $fetch_book['bid']; echo '-name=', $fetch_book['name']; ?>" class="update_btn">Know More</a> </form> <!-- <button name="add_to_cart" ><img src="./images/cart2.png" alt="Add to cart"></button> --> <!-- <input type="submit" name="add_cart" value="cart"> --> </div> <?php } } else { echo '<p class="empty">no products added yet!</p>'; } ?> </div> </section> <?php include 'index_footer.php'; ?> <script> setTimeout(() => { const box = document.getElementById('messages'); // 👇️ hides element (still takes up space on page) box.style.display = 'none'; }, 8000); </script> </body> </html> Book Details.Php <?php
  • 51. include 'config.php'; error_reporting(0); session_start(); $user_id = $_SESSION['user_id']; if (isset($_POST['add_to_cart'])) { if(!isset($user_id)){ $message[]= 'Please Login to get your books'; }else{ $book_name = $_POST['book_name']; $book_id = $_POST['book_id']; $book_image = $_POST['book_image']; $book_price = $_POST['book_price']; $book_quantity = $_POST['quantity']; $total_price =number_format($book_price * $book_quantity); $select_book = $conn->query("SELECT * FROM cart WHERE name= '$book_name' AND user_id='$user_id' ") or die('query failed'); if (mysqli_num_rows($select_book) > 0) { $message[] = 'This Book is alredy in your cart'; } else { $conn->query("INSERT INTO cart (`book_id`,`user_id`,`name`, `price`, `image`, `quantity` ,`total`) VALUES('$book_id','$user_id','$book_name','$book_price','$book_image','$book_quantity', '$total_price')") or die('Add to cart Query failed'); $message[] = 'Book Added To Cart 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"> <link rel="stylesheet" href="./css/index_book.css"> <title>Document</title> <style> .message { position: sticky; top: 0; margin: 0 auto; width: 61%; background-color: #fff; padding: 6px 9px; display: flex; align-items: center; justify-content: space-between; z-index: 100; gap: 0px; border: 2px solid rgb(68, 203, 236); border-top-right-radius: 8px; border-bottom-left-radius: 8px; }
  • 52. .message span { font-size: 22px; color: rgb(240, 18, 18); font-weight: 400; } .message i { cursor: pointer; color: rgb(3, 227, 235); font-size: 15px; } </style> </head> <body> <?php include 'index_header.php'; ?> <?php if(isset($message)){ foreach($message as $message){ echo ' <div class="message" id= "messages"><span>'.$message.'</span> </div> '; } } ?> <div class="details"> <?php if (isset($_GET['details'])) { $get_id = $_GET['details']; $get_book = mysqli_query($conn, "SELECT * FROM `book_info` WHERE bid = '$get_id'") or die('query failed'); if (mysqli_num_rows($get_book) > 0) { while ($fetch_book = mysqli_fetch_assoc($get_book)) { ?> <div class="row_box"> <form style="display: flex ;" action="" method="POST"> <div class="col_box"> <img src="./added_books/<?php echo $fetch_book['image']; ?>" alt="<?php echo $fetch_book['name']; ?>"> </div> <div class="col_box"> <h4>Author: <?php echo $fetch_book['title']; ?></h4> <h1>Name: <?php echo $fetch_book['name']; ?></h1> <h3>Price: ₹ <?php echo $fetch_book['price']; ?>/-</h3> <label for="quantity">Quantity:</label> <input type="number" name="quantity" value="1" min="1" max="10" id="quantity"> <div class="buttons"> <input class="hidden_input" type="hidden" name="book_name" value="<?php echo $fetch_book['name'] ?>"> <input class="hidden_input" type="hidden" name="book_id" value="<?php echo $fetch_book['bid'] ?>"> <input class="hidden_input" type="hidden" name="book_image" value="<?php echo $fetch_book['image'] ?>"> <input class="hidden_input" type="hidden" name="book_price" value="<?php echo $fetch_book['price'] ?>"> <input type="submit" name="add_to_cart" value="Add To Cart" class="btn">
  • 53. <!-- <input type="submit" name="add_to_cart" value="Add to cart" class="btn"> --> <button name="add_to_cart" ><img style="height: 40px;" src="./images/cart1.png" alt="Add to cart"></button> </div> <h3>Book Details</h3> <p><?php echo $fetch_book['description']; ?></p> </div> </form> </div> <?php } } } else { echo '<script>document.querySelector(".edit-product-form").style.display = "none";</script>'; } ?> </div> <script src="./js/admin.js"></script> <script> setTimeout(() => { const box = document.getElementById('messages'); // 👇️ hides element (still takes up space on page) box.style.display = 'none'; }, 5000); </script> </body> </html> Cart.Php <?php include 'config.php'; session_start(); $user_id = $_SESSION['user_id']; $user_name =$_SESSION['user_name']; if(!isset($user_id)){ header('location:login.php'); } if(isset($_GET['remove'])){ $remove_id=$_GET['remove']; mysqli_query($conn, "DELETE FROM `cart` WHERE id='$remove_id'") or die('query failed'); $message[]='Removed Successfully'; header('location:cart.php'); } if(isset($_POST['update'])){ $update_cart_id =$_POST['cart_id']; $book_price=$_POST['book_price']; $update_quantity =$_POST['update_quantity']; $total_price =$book_price * $update_quantity; mysqli_query($conn, "UPDATE `cart` SET `quantity`='$update_quantity', `total`='$total_price' WHERE `id`='$update_cart_id'") or die('query failed');
  • 54. $message[]=''.$user_name.' your cart updated successfully'; } ?> <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <link rel="stylesheet" href="css/hello.css"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Cart</title> <style> .cart-btn1,.cart-btn2{ display: inline-block; margin: auto; padding:0.8rem 1.2rem; cursor: pointer; color:white; font-size: 15px; border-radius: .5rem; text-transform: capitalize; } .cart-btn1{ margin-left: 40%; background-color: #ffa41c; color: black; } .cart-btn2{ background-color: rgb(0, 167, 245); color: black; } .message { position: sticky; top: 0; margin: 0 auto; width: 61%; background-color: #fff; padding: 6px 9px; display: flex; align-items: center; justify-content: space-between; z-index: 100; gap: 0px; border: 2px solid rgb(68, 203, 236); border-top-right-radius: 8px; border-bottom-left-radius: 8px; } .message span { font-size: 22px; color: rgb(240, 18, 18); font-weight: 400; } .message i { cursor: pointer; color: rgb(3, 227, 235); font-size: 15px;
  • 55. } </style> </head> <body> <?php include 'index_header.php'; ?> <div class="cart_form"> <?php if(isset($message)){ foreach($message as $message){ echo ' <div class="message" id="messages"><span>'.$message.'</span> </div> '; } } ?> <table style="width: 70%; align-items:center; margin:10px auto;" > <thead> <th>Image</th> <th>Name</th> <th>price</th> <th>Quatity</th> <th>Total (₹)</th> </thead> <tbody> <?php $total = 0; $select_book = $conn->query("SELECT id, name,price, image ,quantity,total FROM cart Where user_id= $user_id"); if ($select_book->num_rows > 0) { while ($row = $select_book->fetch_assoc()) { ?> <tr> <td><img style="height: 90px;" src="./added_books/<?php echo $row['image']; ?>" alt=""></td> <td><?php echo $row['name']; ?></td> <td><?php echo $row['price']; ?></td> <td> <form action="" method="POST"> <input type="number" name="update_quantity" min="1" max="10" value="<?php echo $row['quantity']; ?>"> <input type="hidden" name="cart_id" value="<?php echo $row['id']; ?>"> <input class="hidden_input" type="hidden" name="book_price" value="<?php echo $row['price'] ?>"> <!-- <input type="submit" name="update" value="update"> --> <button style="background:transparent ;" name="update"><img style="height: 26px; cursor:pointer;" src="./images/update1.png" alt="update"></button> | <a style="color: red;" href="cart.php?remove=<?php echo $row['id'];?>"> Remove</a> </form> </td> <td><?php $sub_total=$row['price']*$row['quantity']; echo $subtotal=number_format($row['price']*$row['quantity']); ?></td>
  • 56. </tr> <?php $total += $sub_total; } } else { echo '<p class="empty">There is nothing in cart yet !!!!!!!!</p>'; } ?> <tr> <th style="text-align:center;" colspan="3">Total</th> <th colspan="2">₹ <?php echo $total; ?>/- </th> </tr> </tbody> </table> <a href="checkout.php" class="btn cart-btn1" style="display:<?php if($total>1){ echo 'inline-block'; }else{ echo 'none'; };?>" > &nbsp; Proceed to Checkout</a> <a class="cart-btn2" href="index.php">Continue Shoping</a> </div> <?php include'index_footer.php'; ?> <script> setTimeout(() => { const box = document.getElementById('messages'); // 👇️ hides element (still takes up space on page) box.style.display = 'none'; }, 5000); </script> </body> </html> checkout.Php <?php include 'config.php'; session_start(); $user_id = $_SESSION['user_id']; if (!isset($user_id)) { header('location:login.php'); } if (isset($_POST['checkout'])) { $name = mysqli_real_escape_string($conn, $_POST['firstname']); $number = $_POST['number']; $email = mysqli_real_escape_string($conn, $_POST['email']); $method = mysqli_real_escape_string($conn, $_POST['method']); $address = mysqli_real_escape_string($conn, $_POST['address']); $city = mysqli_real_escape_string($conn, $_POST['city']); $state = mysqli_real_escape_string($conn, $_POST['state']); $country = mysqli_real_escape_string($conn, $_POST['country']);
  • 57. $pincode = mysqli_real_escape_string($conn, $_POST['pincode']); $full_address = mysqli_real_escape_string($conn, $_POST['address'] . ', ' . $_POST['city'] . ', ' . $_POST['state'] . ', ' . $_POST['country'] . ' - ' . $_POST['pincode']); $placed_on = date('d-M-Y'); $cart_total = 0; $cart_products[] = ''; if (empty($name)) { $message[] = 'Please Enter Your Name'; } elseif (empty($email)) { $message[] = 'Please Enter Email Id'; } elseif (empty($number)) { $message[] = 'Please Enter Mobile Number'; } elseif (empty($address)) { $message[] = 'Please Enter Address'; } elseif (empty($city)) { $message[] = 'Please Enter city'; } elseif (empty($state)) { $message[] = 'Please Enter state'; } elseif (empty($country)) { $message[] = 'Please Enter country'; } elseif (empty($pincode)) { $message[] = 'Please Enter your area pincode'; } else { $cart_query = mysqli_query($conn, "SELECT * FROM `cart` WHERE user_id = '$user_id'") or die('query failed'); if (mysqli_num_rows($cart_query) > 0) { while ($cart_item = mysqli_fetch_assoc($cart_query)) { $cart_products[] = $cart_item['name'] . ' #' . $cart_item['book_id'] . ',(' . $cart_item['quantity'] . ') '; $quantity=$cart_item['quantity']; $unit_price=$cart_item['price']; $cart_books = $cart_item['name']; $sub_total = ($cart_item['price'] * $cart_item['quantity']); $cart_total += $sub_total; } } $total_books = implode(' ', $cart_products); $order_query = mysqli_query($conn, "SELECT * FROM `confirm_order` WHERE name = '$name' AND number = '$number' AND email = '$email' AND payment_method = '$method' AND address = '$address' AND total_books = '$total_books' AND total_price = '$cart_total'") or die('query failed'); if (mysqli_num_rows($order_query) > 0) { $message[] = 'order already placed!'; } else { mysqli_query($conn, "INSERT INTO `confirm_order`(user_id, name, number, email, payment_method, address,total_books, total_price, order_date) VALUES('$user_id','$name', '$number', '$email','$method', '$full_address', '$total_books', '$cart_total', '$placed_on')") or die('query failed'); $conn_oid= $conn->insert_id; $_SESSION['id'] = $conn_oid; // $select_book = mysqli_query($conn, "SELECT * FROM `confirm_order`") or die('query failed'); // if(mysqli_num_rows($select_book) > 0){
  • 58. // $fetch_book = mysqli_fetch_assoc($select_book); // $orders_id= $fetch_book['order_id']; // } $cart_query = mysqli_query($conn, "SELECT * FROM `cart` WHERE user_id = '$user_id'") or die('query failed'); if (mysqli_num_rows($cart_query) > 0) { while ($cart_item = mysqli_fetch_assoc($cart_query)) { $cart_products[] = $cart_item['name'] . ' #' . $cart_item['book_id'] . ',(' . $cart_item['quantity'] . ') '; $quantity=$cart_item['quantity']; $unit_price=$cart_item['price']; $cart_books = $cart_item['name']; $sub_total = ($cart_item['price'] * $cart_item['quantity']); $cart_total += $sub_total; mysqli_query($conn, "INSERT INTO `orders`(user_id,id,address,city,state,country,pincode,book,quantity,unit_price,sub_total) VALUES('$user_id','$conn_oid','$address','$city','$state','$country','$pincode','$cart_books','$quantity','$uni t_price','$sub_total')") or die('query failed'); } } $message[] = 'order placed successfully!'; mysqli_query($conn, "DELETE FROM `cart` WHERE user_id = '$user_id'") or die('query failed'); } } } ?> <!DOCTYPE html> <html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>Checkout</title> <style> body { font-family: Arial; font-size: 17px; padding: 8px; overflow-x: hidden; } * { box-sizing: border-box; } .row { display: -ms-flexbox; /* IE10 */ display: flex; -ms-flex-wrap: wrap; /* IE10 */ flex-wrap: wrap; margin: 0 -16px; padding: 30px;
  • 59. } .col-25 { -ms-flex: 25%; /* IE10 */ flex: 25%; } .col-50 { -ms-flex: 50%; /* IE10 */ flex: 50%; } .col-75 { -ms-flex: 75%; /* IE10 */ flex: 75%; } .col-25, .col-50, .col-75 { padding: 0 16px; } .container { background-color: #f2f2f2; padding: 5px 20px 15px 20px; border: 1px solid lightgrey; border-radius: 3px; } input[type=text], select { width: 100%; margin-bottom: 20px; padding: 12px; border: 1px solid #ccc; border-radius: 3px; } label { margin-bottom: 10px; display: block; color: black; } .icon-container { margin-bottom: 20px; padding: 7px 0; font-size: 24px; } .btn { background-color: rgb(28 146 197); color: white; padding: 12px; margin: 10px 0; border: none;
  • 60. width: 100%; border-radius: 3px; cursor: pointer; font-size: 17px; } .btn:hover { background-color: rgb(6 157 21); letter-spacing: 1px; font-weight: 600; } a { color: #rgb(28 146 197); } hr { border: 1px solid lightgrey; } span.price { float: right; color: grey; } @media (max-width: 800px) { .row { flex-direction: column-reverse; padding: 0; } .col-25 { margin-bottom: 20px; } } .message { position: sticky; top: 0; margin: 0 auto; width: 61%; background-color: #fff; padding: 6px 9px; display: flex; align-items: center; justify-content: space-between; z-index: 100; gap: 0px; border: 2px solid rgb(68, 203, 236); border-top-right-radius: 8px; border-bottom-left-radius: 8px; } .message span { font-size: 22px; color: rgb(240, 18, 18); font-weight: 400; } .message i { cursor: pointer; color: rgb(3, 227, 235); font-size: 15px;
  • 61. } </style> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font- awesome.min.css"> <script src="https://kit.fontawesome.com/493af71c35.js" crossorigin="anonymous"></script> </head> <body> <?php include 'index_header.php'; ?> <?php if (isset($message)) { foreach ($message as $message) { echo ' <div class="message" id= "messages"><span>' . $message . '</span> </div> '; } } ?> <h1 style="text-align: center; margin-top:15px; color:rgb(9, 152, 248);">Place Your Order Here</h1> <p style="text-align: center; ">Just One Step away from getting your books</p> <div class="row"> <div class="col-75"> <div class="container"> <form action="" method="POST"> <div class="row"> <div class="col-50"> <h3>Billing Address</h3> <label for="fname"><i class="fa fa-user"></i> Full Name</label> <input type="text" id="fname" name="firstname" placeholder="Aman Singh"> <label for="email"><i class="fa fa-envelope"></i> Email</label> <input type="text" id="email" name="email" placeholder="[email protected]"> <label for="email"><i class="fa fa-envelope"></i> Number</label> <input type="text" id="email" name="number" placeholder="+91987456123"> <label for="adr"><i class="fa fa-address-card-o"></i> Address</label> <input type="text" id="adr" name="address" placeholder="Mumbai 60"> <label for="city"><i class="fa fa-institution"></i> City</label> <input type="text" id="city" name="city" placeholder="Mumbai"> <label for="city"><i class="fa fa-institution"></i> State</label> <input type="text" id="city" name="state" placeholder="Maharashtra"> <div style="padding: 0px;" class="row"> <div class="col-50"> <label for="state">Country</label> <input type="text" id="state" name="country" placeholder="india"> </div> <div class="col-50"> <label for="zip">Pincode</label> <input type="text" id="zip" name="pincode" placeholder="400060"> </div> </div> </div> <div class="col-50">
  • 62. <div class="col-25"> <div class="container"> <h4>Books In Cart</h4> <?php $grand_total = 0; $select_cart = mysqli_query($conn, "SELECT * FROM `cart`") or die('query failed'); if (mysqli_num_rows($select_cart) > 0) { while ($fetch_cart = mysqli_fetch_assoc($select_cart)) { $total_price = ($fetch_cart['price'] * $fetch_cart['quantity']); $grand_total += $total_price; ?> <p> <a href="book_details.php?details=<?php echo $fetch_cart['book_id']; ?>"><?php echo $fetch_cart['name']; ?></a><span class="price">(<?php echo '₹ ' . $fetch_cart['price'] . '/-' . ' x ' . $fetch_cart['quantity']; ?>)</span> </p> <?php } } else { echo '<p class="empty">your cart is empty</p>'; } ?> <hr> <p>Grand total : <span class="price" style="color:black">₹ <b><?php echo $grand_total; ?>/- </b></span></p> </div> </div> <div style="margin: 20px;"> <h3>Payment </h3> <label for="fname">Accepted Payment Gateways</label> <div class="icon-container"> <i class="fa fa-cc-visa" style="color:navy;"></i> <i class="fa-brands fa-cc-amazon-pay"></i> <i class="fa-brands fa-google-pay" style="color:red;"></i> <i class="fa fa-cc-paypal" style="color:#3b7bbf;"></i> </div> <div class="inputBox"> <label for="method">Choose Payment Method :</label> <select name="method" id="method"> <option value="cash on delivery">Cash on delivery</option> <option value="Debit card">Debit card</option> <option value="Amazon Pay">Amazon Pay</option> <option value="Paypal">Paypal</option> <option value="Google Pay">Google Pay</option> </select> </div> </div> </div> </div> <label> <input type="checkbox" checked="checked" name="sameadr"> Shipping address same as billing </label> <input type="submit" name="checkout" value="Continue to checkout" class="btn"> </form> </div> </div> </div> <?php include 'index_footer.php'; ?> <script> setTimeout(() => {
  • 63. const box = document.getElementById('messages'); // 👇️ hides element (still takes up space on page) box.style.display = 'none'; }, 5000); </script> </body> </html> contact-us.Php <?php include 'config.php'; session_start(); $user_id = $_SESSION['user_id']; $user_name =$_SESSION['user_name']; if(!isset($user_id)){ header('location:login.php'); } if(isset($_POST['send_msg'])) { $name = mysqli_real_escape_string($conn, $_POST['name']); $msg = mysqli_real_escape_string($conn, $_POST['msg']); $email = mysqli_real_escape_string($conn, $_POST['email']); $phone = mysqli_real_escape_string($conn, $_POST['phone']); mysqli_query($conn, "INSERT INTO msg (`user_id`,`name`,`email`, `number`, `msg`) VALUES('$user_id','$name','$email','$phone','$msg')") or die('Mesage send Query failed'); $message[]='Message Send Successfully'; } ?> <!DOCTYPE html> <html lang="en" dir="ltr"> <head> <meta charset="utf-8"> <title>Contact-Us</title> <link rel="stylesheet" href="style.css"> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="stylesheet" href="./css/hello.css"> </head> <body> <?php include 'index_header.php'; ?> <?php if(isset($message)){ foreach($message as $message){ echo ' <div class="message" id= "messages"><span>'.$message.'</span>
  • 64. </div> '; } } ?> <div class="contact-section" > <h1>Contact Us</h1> <h3>Hello, <span><?php echo $user_name;?> </span> &nbsp;how we can help you?</h3> <div class="border"></div> <form class="contact-form" action="" method="post"> <input type="text" class="contact-form-text" name="name" placeholder="Your name"> <input type="email" class="contact-form-text" name="email" placeholder="Your email"> <input type="int" class="contact-form-text" name="phone" placeholder="Your phone"> <textarea class="contact-form-text" name="msg" placeholder="Your message"></textarea> <input type="submit" class="contact-form-btn" name="send_msg" value="Send"> <a href="index.php" class="contact-form-btn" >Back</a> </form> </div> <?php include'index_footer.php';?> <script> setTimeout(() => { const box = document.getElementById('messages'); // 👇️ hides element (still takes up space on page) box.style.display = 'none'; }, 5000); </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/font-awesome/6.0.0/css/all.min.css">
  • 65. <link rel="stylesheet" href="./css/hello.css"> <style> .placed-orders .title{ text-align: center; margin-bottom: 20px; text-transform: uppercase; color:black; font-size: 40px; } .placed-orders .box-container{ max-width: 1200px; margin:0 auto; display:flex; flex-wrap: wrap; align-items: center; gap:20px; } .placed-orders .box-container .empty{ flex:1; } .placed-orders .box-container .box{ flex:1 1 400px; border-radius: .5rem; padding:15px; border:2px solid brown; background-color: white; padding:10px 20px; } .placed-orders .box-container .box p{ padding:10px 0 0 0; font-size: 20px; color:gray; } .placed-orders .box-container .box p span{ color:black; } </style> </head> <body> <?php include 'index_header.php'; ?> <section class="placed-orders"> <h1 class="title">placed orders</h1> <div class="box-container"> <?php $select_book = mysqli_query($conn, "SELECT * FROM `confirm_order`WHERE user_id = '$user_id' ORDER BY order_date DESC") or die('query failed'); if(mysqli_num_rows($select_book) > 0){ while($fetch_book = mysqli_fetch_assoc($select_book)){ ?> <div class="box">
  • 66. <p> Order Date : <span><?php echo $fetch_book['order_date']; ?></span> </p> <p> Order Id : <span># <?php echo $fetch_book['order_id']; ?> </p> <p> Name : <span><?php echo $fetch_book['name']; ?></span> </p> <p> Mobile Number : <span><?php echo $fetch_book['number']; ?></span> </p> <p> Email Id : <span><?php echo $fetch_book['email']; ?></span> </p> <p> Address : <span><?php echo $fetch_book['address']; ?></span> </p> <p> Payment Method : <span><?php echo $fetch_book['payment_method']; ?></span> </p> <p> Your orders : <span><?php echo $fetch_book['total_books']; ?></span> </p> <p> Total price : <span>₹ <?php echo $fetch_book['total_price']; ?>/-</span> </p> <p> Payment status : <span style="color:<?php if($fetch_book['payment_status'] == 'pending'){ echo 'orange'; }else{ echo 'green'; } ?>;"><?php echo $fetch_book['payment_status']; ?></span> </p> <p><a href="invoice.php?order_id=<?php echo $fetch_book['order_id']; ?>" target="_blank">Print Recipt</a></p> </div> <!-- <form action="" method="POST"> <input type="hidden" name="order_id" value="<?php echo $fetch_book['order_id']; ?>"> </form> --> <?php } }else{ echo '<p class="empty">You have not placed any order yet!!!!</p>'; } ?> </div> </section> <?php include 'index_footer.php'; ?> <!-- custom js file link --> <script src="js/script.js"></script> </body> </html> search_books.Php <?php include 'config.php'; session_start(); if(isset($_SESSION['user_name'])){ $user_id = $_SESSION['user_id']; if (isset($_POST['add_to_cart'])) { $book_name = $_POST['book_name']; $book_id= $_POST['book_id']; $book_image = $_POST['book_image']; $book_price = $_POST['book_price']; $book_quantity = '1'; $total_price = number_format($book_price * $book_quantity);
  • 67. $select_book = $conn->query("SELECT * FROM cart WHERE bid= '$book_id' AND user_id='$user_id' ") or die('query failed'); if (mysqli_num_rows($select_book) > 0) { $message[] = 'This Book is alredy in your cart'; } else { $conn->query("INSERT INTO cart (`user_id`,`book_id`,`name`, `price`, `image`,`quantity` ,`total`) VALUES('$user_id','$book_id','$book_name','$book_price','$book_image','$book_quantity', '$total_price')") or die('Add to cart Query failed'); $message[] = 'Book Added To Successfully'; header('location:index.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>search page</title> <!-- font awesome cdn link --> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.1.1/css/all.min.css"> <!-- custom css file link --> <link rel="stylesheet" href="css/style.css"> <style> .search-form form { max-width: 1200px; margin: 30px auto; display: flex; gap: 15px; } .search-form form .search_btn { margin-top: 0; } .search-form form .box { width: 100%; padding: 12px 14px; border: 2px solid rgb(0, 167, 245); font-size: 20px; color: black; border-radius: 5px; } .search_btn { display: inline-block; padding: 10px 25px; cursor: pointer; color: white; font-size: 18px; border-radius: 5px; text-transform: capitalize; background-color: rgb(0, 167, 245);
  • 68. } </style> </head> <body> <?php include 'index_header.php'; ?> <section class="search-form"> <form action="" method="POST"> <input type="text" class="box" name="search_box" placeholder="search products..."> <input type="submit" name="search_btn" value="search" class="search_btn"> </form> </section> <div class="msg"> <?php if (isset($_POST['search_btn'])) { $search_box = $_POST['search_box']; echo '<h4>Search Result for "'. $search_box.'"is:</h4>'; }; ?> </div> <section class="show-products"> <div class="box-container"> <?php if (isset($_POST['search_btn'])) { $search_box = $_POST['search_box']; $search_box = filter_var($search_box, FILTER_SANITIZE_STRING); $select_products = mysqli_query($conn, "SELECT * FROM `book_info` WHERE name LIKE '%{$search_box}%' OR title LIKE '%{$search_box}%' OR category LIKE '%{$search_box}%'"); if (mysqli_num_rows($select_products) > 0) { while ($fetch_book = mysqli_fetch_assoc($select_products)) { ?> <div class="box" style="width: 255px;height: 342px;"> <a href="book_details.php?details=<?php echo $fetch_book['bid']; echo '-name=', $fetch_book['name']; ?>"> <img style="height: 200px;width: 125px;margin: auto;" class="books_images" src="added_books/<?php echo $fetch_book['image']; ?>" alt=""></a> <div style="text-align:left ;"> <div class="name" style="font-size: 12px;">Aurthor: <?php echo $fetch_book['title']; ?></div> <div style="font-weight: 500; font-size:18px; " class="name">Name: <?php echo $fetch_book['name']; ?></div> </div> <div class="price">Price: ₹ <?php echo $fetch_book['price']; ?>/-</div> <!-- <button name="add_cart"><img src="./images/cart2.png" alt=""></button> --> <form action="" method="POST"> <input class="hidden_input" type="hidden" name="book_name" value="<?php echo $fetch_book['name'] ?>"> <input class="hidden_input" type="hidden" name="book_image" value="<?php echo $fetch_book['image'] ?>"> <input class="hidden_input" type="hidden" name="book_price" value="<?php echo $fetch_book['price'] ?>">
  • 69. <button onclick="myFunction()" name="add_to_cart"><img src="./images/cart2.png" alt="Add to cart"> <a href="book_details.php?details=<?php echo $fetch_book['bid']; echo '-name=', $fetch_book['name']; ?>" id="adventure" class="update_btn">Know More</a> </form> </div> <?php } } else { echo '<p class="empty">Could not find "'. $search_box.'"! </p>'; } }; ?> </div> </section> <?php include 'index_footer.php'; ?> <script src="js/script.js"></script> </body> </html> ADMIN PANEL admin_header.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"> <link rel="stylesheet" href="./css/admin.css"> <title>Admin Page</title> </head> <body> <header><div class="mainlogo"> <div class="logo"> <a href="admin_index.php"><span>Bookflix &</span> <span class="me">Chill</span></a> </div><p>Admin Pannel</p></div> <div class="nav"> <a href="admin_index.php">Home</a> <a href="add_books.php">Add Books</a> <a href="admin_orders.php">Orders</a> <a href="message_admin.php">Message</a> <a href="users_detail.php">Users</a> </div> <div class="right"> <div class="log_info">
  • 70. <p>Hello <?php echo $_SESSION['admin_name'];?></p> </div> <a class="Btn" href="logout.php?logout=<?php echo $_SESSION['admin_name'];?>">logout</a> </div> </header> </body> </html> admin_index.Php <?php include 'config.php'; session_start(); $admin_id = $_SESSION['admin_id']; if(!isset($admin_id)){ header('location:login.php'); } $users_no = $conn->query("SELECT * FROM users_info ") or die('query failed'); $usercount = mysqli_num_rows( $users_no ); $admin_no = $conn->query("SELECT * FROM users_info WHERE user_type='Admin' ") or die('query failed'); $admin_count = mysqli_num_rows( $admin_no ); $books_no = $conn->query("SELECT * FROM book_info ") or die('query failed'); $bookscount = mysqli_num_rows( $books_no ); $orders = $conn->query("SELECT * FROM confirm_order ") or die('query failed'); $orders_count = mysqli_num_rows( $orders ); $msg_no = $conn->query("SELECT * FROM msg ") or die('query failed'); $msgcount = mysqli_num_rows( $msg_no ); ?> <!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" /> <!-- <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous"> -- > <link rel="stylesheet" href="./css/admin.css" /> <title>Bookflix & Chill Admin</title> </head> <body > <?php include'admin_header.php';?> <div class="main_box"> <div class="card" style="width: 15rem"> <?php $total_pendings = 0; $select_pending = mysqli_query($conn, "SELECT total_price FROM `confirm_order` WHERE payment_status = 'pending'") or die('query failed'); if(mysqli_num_rows($select_pending) > 0){ while($fetch_pendings = mysqli_fetch_assoc($select_pending)){ $total_price = $fetch_pendings['total_price']; $total_pendings += $total_price;
  • 71. }; }; ?> <img class="card-img-top" src="./images/pen3.png" alt="Card image cap" /> <div class="card-body"> <h5 class="card-title">Number Of Pending Orders in ₨</h5> <p class="card-text"> <?php echo $total_pendings ?> </p> <div class="buttons" style="display: flex;"> <a href="admin_orders.php" class="btn btn-primary">Details</a> </div> </div> </div> <div class="card" style="width: 15rem"> <?php $total_completed = 0; $select_completed = mysqli_query($conn, "SELECT total_price FROM `confirm_order` WHERE payment_status = 'completed'") or die('query failed'); if(mysqli_num_rows($select_completed) > 0){ while($fetch_completed = mysqli_fetch_assoc($select_completed)){ $total_price = $fetch_completed['total_price']; $total_completed += $total_price; }; }; ?> <img class="card-img-top" src="./images/compn.png" alt="Card image cap" /> <div class="card-body"> <h5 class="card-title">Number Of Completed Orders in ₨</h5> <p class="card-text"> <?php echo $total_completed; ?> </p> <div class="buttons" style="display: flex;"> <a href="admin_orders.php" class="btn btn-primary">Details</a> </div> </div> </div> <div class="card" style="width: 15rem"> <img class="card-img-top" src="./images/orderpn.png" alt="Card image cap" /> <div class="card-body"> <h5 class="card-title">Number Of Orders Recived</h5> <p class="card-text"> <?php echo $orders_count; ?> </p> <a href="admin_orders.php" class="btn btn-primary">Details</a> </div> </div> <div class="card" style="width: 15rem"> <img class="card-img-top" src="./images/nu. books.png" alt="Card image cap" /> <div class="card-body"> <h5 class="card-title">Number Of Books Available</h5> <p class="card-text"> <?php echo $bookscount; ?> </p> <div class="buttons" style="display: flex;"> <a href="total_books.php" class="btn btn-primary">See Books</a> <a href="add_books.php" class="btn btn-primary">Add Books</a> </div> </div>
  • 72. </div> <div class="card" style="width: 15rem"> <img class="card-img-top" src="./images/whatpm.png" alt="Card image cap" /> <div class="card-body"> <h5 class="card-title">Number Of Users Queries</h5> <p class="card-text"> <?php echo $msgcount; ?> </p> <a href="message_admin.php" class="btn btn-primary">Details</a> </div> </div> <div class="card" style="width: 15rem"> <img class="card-img-top" src="./images/adminpn2.png" alt="Card image cap" /> <div class="card-body"> <h5 class="card-title">Number Of Registered Admins</h5> <p class="card-text"> <?php echo $admin_count; ?> </p> <a href="users_detail.php" class="btn btn-primary">Details</a> </div> </div> <div class="card" style="width: 15rem"> <img class="card-img-top" src="./images/userspm.png" alt="Card image cap" /> <div class="card-body"> <h5 class="card-title">Number Of Registered Users</h5> <p class="card-text"> <?php echo $usercount; ?> </p> <a href="users_detail.php" class="btn btn-primary">Details</a> </div> </div> </div> </body> </html> add_books.Php <?php include 'config.php'; session_start(); $admin_id = $_SESSION['admin_id']; if(!isset($admin_id)){ header('location:login.php'); }; if (isset($_POST['add_books'])) { $bname = mysqli_real_escape_string($conn, $_POST['bname']); $btitle = mysqli_real_escape_string($conn, $_POST['btitle']); $category = mysqli_real_escape_string($conn, $_POST['Category']); $price = $_POST['price']; $desc = mysqli_real_escape_string($conn, ($_POST['bdesc'])); $img = $_FILES["image"]["name"]; $img_temp_name = $_FILES["image"]["tmp_name"]; $img_file = "./added_books/" . $img; if (empty($bname)) {
  • 73. $message[] = 'Please Enter book name'; } elseif (empty($btitle)) { $message[] = 'Please Enter book title'; } elseif (empty($price)) { $message[] = 'Please Enter book price'; } elseif (empty($category)) { $message[] = 'Please Choose a category'; } elseif (empty($desc)) { $message[] = 'Please Enter book descriptions'; } elseif (empty($img)) { $message[] = 'Please Choose Image'; } else { $add_book = mysqli_query($conn, "INSERT INTO book_info(`name`, `title`, `price`, `category`, `description`, `image`) VALUES('$bname','$btitle','$price','$category','$desc','$img')") or die('Query failed'); if ($add_book) { move_uploaded_file($img_temp_name, $img_file); $message[] = 'New Book Added Successfully'; } else { $message = 'Book Not Added Successfully'; } } } if(isset($_GET['delete'])){ $delete_id = $_GET['delete']; mysqli_query($conn, "DELETE FROM `book_info` WHERE bid = '$delete_id'") or die('query failed'); header('location:add_books.php'); } if(isset($_POST['update_product'])){ $update_p_id = $_POST['update_p_id']; $update_name = $_POST['update_name']; $update_title = $_POST['update_title']; $update_description = $_POST['update_description']; $update_price = $_POST['update_price']; mysqli_query($conn, "UPDATE `book_info` SET name = '$update_name', title='$update_title', description ='$update_description', price = '$update_price',category='$update_category' WHERE bid = '$update_p_id'") or die('query failed'); $update_image = $_FILES['update_image']['name']; $update_image_tmp_name = $_FILES['update_image']['tmp_name']; $update_image_size = $_FILES['update_image']['size']; $update_folder = './added_books/'.$update_image; $update_old_image = $_POST['update_old_image']; if(!empty($update_image)){ if($update_image_size > 2000000){ $message[] = 'image file size is too large'; }else{ mysqli_query($conn, "UPDATE `book_info` SET image = '$update_image' WHERE bid = '$update_p_id'") or die('query failed'); move_uploaded_file($update_image_tmp_name, $update_folder); unlink('uploaded_img/'.$update_old_image); }
  • 74. } header('location:./add_books.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"> <link rel="stylesheet" href="./css/register.css"> <title>Add Books</title> </head> <body> <?php include './admin_header.php' ?> <?php if (isset($message)) { foreach ($message as $message) { echo ' <div class="message" id="messages"><span>' . $message . '</span> </div> '; } } ?> <a class="update_btn" style="position: fixed ; z-index:100;" href="total_books.php">See All Books</a> <div class="container_box"> <form action="" method="POST" enctype="multipart/form-data"> <h3>Add Books To <a href="index.php"><span>Bookflix & </span><span>Chill</span></a></h3> <input type="text" name="bname" placeholder="Enter book Name" class="text_field "> <input type="text" name="btitle" placeholder="Enter Author name" class="text_field"> <input type="number" min="0" name="price" class="text_field" placeholder="enter product price"> <select name="Category" id="" required class="text_field"> <option value="Adventure">Adventure</option> <option value="Magic">Magic</option> <option value="knowledge">knowledge</option> </select> <textarea name="bdesc" placeholder="Enter book description" id="" class="text_field" cols="18" rows="5"></textarea> <input type="file" name="image" accept="image/jpg, image/jpeg, image/png" class="text_field"> <input type="submit" value="Add Book" name="add_books" class="btn text_field"> </form> </div> <section class="edit-product-form"> <?php if(isset($_GET['update'])){ $update_id = $_GET['update']; $update_query = mysqli_query($conn, "SELECT * FROM `book_info` WHERE bid = '$update_id'") or die('query failed');
  • 75. if(mysqli_num_rows($update_query) > 0){ while($fetch_update = mysqli_fetch_assoc($update_query)){ ?> <form action="" method="post" enctype="multipart/form-data"> <input type="hidden" name="update_p_id" value="<?php echo $fetch_update['bid']; ?>"> <input type="hidden" name="update_old_image" value="<?php echo $fetch_update['image']; ?>"> <img src="./added_books/<?php echo $fetch_update['image']; ?>" alt=""> <input type="text" name="update_name" value="<?php echo $fetch_update['name']; ?>" class="box" required placeholder="Enter Book Name"> <input type="text" name="update_title" value="<?php echo $fetch_update['title']; ?>" class="box" required placeholder="Enter Author Name"> <select name="update_category" value="<?php echo $fetch_update['category']; ?> required class="text_field"> <option value="Adventure">Adventure</option> <option value="Magic">Magic</option> <option value="knowledge">knowledge</option> </select> <input type="text" name="update_description" value="<?php echo $fetch_update['description']; ?>" class="box" required placeholder="enter product description"> <input type="number" name="update_price" value="<?php echo $fetch_update['price']; ?>" min="0" class="box" required placeholder="enter product price"> <input type="file" class="box" name="update_image" accept="image/jpg, image/jpeg, image/png"> <input type="submit" value="update" name="update_product" class="delete_btn" > <input type="reset" value="cancel" id="close-update" class="update_btn" > </form> <?php } } }else{ echo '<script>document.querySelector(".edit-product-form").style.display = "none";</script>'; } ?> </section> <section class="show-products"> <div class="box-container"> <?php $select_book = mysqli_query($conn, "SELECT * FROM book_info ORDER BY date DESC LIMIT 2;") or die('query failed'); if(mysqli_num_rows($select_book) > 0){ while($fetch_book = mysqli_fetch_assoc($select_book)){ ?> <div class="box"> <img class="books_images" src="added_books/<?php echo $fetch_book['image']; ?>" alt=""> <div class="name">Aurthor: <?php echo $fetch_book['title']; ?></div> <div class="name">Name: <?php echo $fetch_book['name']; ?></div> <div class="price">Price: ₹ <?php echo $fetch_book['price']; ?>/-</div> <a href="add_books.php?update=<?php echo $fetch_book['bid']; ?>" class="update_btn">update</a> <a href="add_books.php?delete=<?php echo $fetch_book['bid']; ?>" class="delete_btn" onclick="return confirm('delete this product?');">delete</a> </div> <?php } }else{ echo '<p class="empty">no products added yet!</p>'; } ?> </div>
  • 76. </section> <section class="edit-product-form"> <?php if(isset($_GET['update'])){ $update_id = $_GET['update']; $update_query = mysqli_query($conn, "SELECT * FROM `book_info` WHERE bid = '$update_id'") or die('query failed'); if(mysqli_num_rows($update_query) > 0){ while($fetch_update = mysqli_fetch_assoc($update_query)){ ?> <form action="" method="post" enctype="multipart/form-data"> <input type="hidden" name="update_p_id" value="<?php echo $fetch_update['bid']; ?>"> <input type="hidden" name="update_old_image" value="<?php echo $fetch_update['image']; ?>"> <img src="./added_books/<?php echo $fetch_update['image']; ?>" alt=""> <input type="text" name="update_name" value="<?php echo $fetch_update['name']; ?>" class="box" required placeholder="Enter Book Name"> <input type="text" name="update_title" value="<?php echo $fetch_update['title']; ?>" class="box" required placeholder="Enter Author Name"> <select name="update_category" value="<?php echo $fetch_update['category']; ?> required class="text_field"> <option value="Adventure">Adventure</option> <option value="Magic">Magic</option> <option value="knowledge">knowledge</option> </select> <input type="text" name="update_description" value="<?php echo $fetch_update['description']; ?>" class="box" required placeholder="enter product description"> <input type="number" name="update_price" value="<?php echo $fetch_update['price']; ?>" min="0" class="box" required placeholder="enter product price"> <input type="file" class="box" name="update_image" accept="image/jpg, image/jpeg, image/png"> <input type="submit" value="update" name="update_product" class="delete_btn" > <input type="reset" value="cancel" id="close-update" class="update_btn" > </form> <?php } } }else{ echo '<script>document.querySelector(".edit-product-form").style.display = "none";</script>'; } ?> </section> <script src="./js/admin.js"></script> <script> setTimeout(() => { const box = document.getElementById('messages'); // 👇️ hides element (still takes up space on page) box.style.display = 'none'; }, 8000); </script> </body> </html> total_books.Php
  • 77. <?php include 'config.php'; session_start(); $admin_id = $_SESSION['admin_id']; if(isset($_GET['delete'])){ $delete_id = $_GET['delete']; mysqli_query($conn, "DELETE FROM `book_info` WHERE bid = '$delete_id'") or die('query failed'); header('location:total_books.php'); } if(isset($_POST['update_product'])){ $update_p_id = $_POST['update_p_id']; $update_name = $_POST['update_name']; $update_title = $_POST['update_title']; $update_description = $_POST['update_description']; $update_price = $_POST['update_price']; $update_category = $_POST['update_category']; mysqli_query($conn, "UPDATE `book_info` SET name = '$update_name', title='$update_title', description ='$update_description', price = '$update_price', category='$update_category' WHERE bid = '$update_p_id'") or die('query failed'); $update_image = $_FILES['update_image']['name']; $update_image_tmp_name = $_FILES['update_image']['tmp_name']; $update_image_size = $_FILES['update_image']['size']; $update_folder = './added_books/'.$update_image; $update_old_image = $_POST['update_old_image']; if(!empty($update_image)){ if($update_image_size > 2000000){ $message[] = 'image file size is too large'; }else{ mysqli_query($conn, "UPDATE `book_info` SET image = '$update_image' WHERE bid = '$update_p_id'") or die('query failed'); move_uploaded_file($update_image_tmp_name, $update_folder); unlink('uploaded_img/'.$update_old_image); } } header('location:total_books.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"> <link rel="stylesheet" href="./css/register.css"> <title>Add Books</title> </head>
  • 78. <body> <?php include './admin_header.php' ?> <?php if (isset($message)) { foreach ($message as $message) { echo ' <div class="message"><span>' . $message . '</span><i onclick="this.parentElement.remove();">Close</i> </div> '; } } ?> <a class="update_btn" style="position: fixed ; z-index:100;" href="add_books.php">Add More Books</a> <section class="edit-product-form"> <?php if(isset($_GET['update'])){ $update_id = $_GET['update']; $update_query = mysqli_query($conn, "SELECT * FROM `book_info` WHERE bid = '$update_id'") or die('query failed'); if(mysqli_num_rows($update_query) > 0){ while($fetch_update = mysqli_fetch_assoc($update_query)){ ?> <form action="" method="post" enctype="multipart/form-data"> <input type="hidden" name="update_p_id" value="<?php echo $fetch_update['bid']; ?>"> <input type="hidden" name="update_old_image" value="<?php echo $fetch_update['image']; ?>"> <img src="./added_books/<?php echo $fetch_update['image']; ?>" alt=""> <input type="text" name="update_name" value="<?php echo $fetch_update['name']; ?>" class="box" required placeholder="Enter Book Name"> <input type="text" name="update_title" value="<?php echo $fetch_update['title']; ?>" class="box" required placeholder="Enter Author Name"> <select name="update_category" value="<?php echo $fetch_update['category']; ?> required class="text_field"> <option value="Adventure">Adventure</option> <option value="Magic">Magic</option> <option value="knowledge">knowledge</option> </select> <input type="text" name="update_description" value="<?php echo $fetch_update['description']; ?>" class="box" required placeholder="enter product description"> <input type="number" name="update_price" value="<?php echo $fetch_update['price']; ?>" min="0" class="box" required placeholder="enter product price"> <input type="file" class="box" name="update_image" accept="image/jpg, image/jpeg, image/png"> <input type="submit" value="update" name="update_product" class="delete_btn" > <input type="reset" value="cancel" id="close-update" class="update_btn" > </form> <?php } } }else{ echo '<script>document.querySelector(".edit-product-form").style.display = "none";</script>'; } ?> </section> <section class="show-products"> <div class="box-container">
  • 79. <?php $select_book = mysqli_query($conn, "SELECT * FROM `book_info` ORDER BY date DESC") or die('query failed'); if(mysqli_num_rows($select_book) > 0){ while($fetch_book = mysqli_fetch_assoc($select_book)){ ?> <div class="box"> <img class="books_images" src="added_books/<?php echo $fetch_book['image']; ?>" alt=""> <div class="name">Aurthor: <?php echo $fetch_book['title']; ?></div> <div class="name">Name: <?php echo $fetch_book['name']; ?></div> <div class="price">Price: ₹ <?php echo $fetch_book['price']; ?>/-</div> <a href="total_books.php?update=<?php echo $fetch_book['bid']; ?>" class="update_btn">update</a> <a href="total_books.php?delete=<?php echo $fetch_book['bid']; ?>" 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.js"></script> </body> </html> users_details.Php <?php include 'config.php'; session_start(); $admin_id = $_SESSION['admin_id']; if(!isset($admin_id)){ header('location:login.php'); } if (isset($_GET['delete_user'])) { $delete_id = $_GET['delete_user']; mysqli_query($conn, "DELETE FROM `users_info` WHERE Id = '$delete_id'") or die('query failed'); header('location:users_detail.php'); } if (isset($_POST['update_user'])) { $update_id = $_POST['update_id']; $update_name = $_POST['update_name']; $update_sname = $_POST['update_sname']; $update_email = $_POST['update_email'];
  • 80. $update_password = $_POST['update_password']; $update_user_type = $_POST['update_user_type']; mysqli_query($conn, "UPDATE `users_info` SET name = '$update_name', surname='$update_name', email ='$update_email', password = '$update_password', user_type='$update_user_type' WHERE Id = '$update_id'") or die('query failed'); header('location:./users_detail.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"> <link rel="stylesheet" href="./css/register.css"> <link rel="stylesheet" href="./css/index_book.css"> <title> User Data</title> </head> <body> <?php include 'admin_header.php'; ?> <section class="show-products"> <div class="box-container"> <?php $select_user = mysqli_query($conn, "SELECT Id,name,surname,email,password,user_type FROM users_info") or die('query failed'); if(mysqli_num_rows($select_user) > 0){ while($fetch_user = mysqli_fetch_assoc($select_user)){ ?> <div class="box"> <div class="name">User ID: <?php echo $fetch_user['Id']; ?></div> <div class="name">Name: <?php echo $fetch_user['name']; ?>&nbsp;<?php echo $fetch_user['surname']; ?></div> <div class="name">Email ID: <?php echo $fetch_user['email']; ?></div> <div class="password">Password: <?php echo $fetch_user['password']; ?></div> <div class="price"style="color:<?php if($fetch_user['user_type'] == 'Admin'){ echo 'red'; }else{ echo 'blue'; } ?>;">User type: <?php echo $fetch_user['user_type']; ?></div> <a style="color:rgb(255, 187, 0);" href="users_detail.php?update_user=<?php echo $fetch_user['Id']; ?>">Update</a> <a href="users_detail.php?delete_user=<?php echo $fetch_user['Id']; ?>" onclick="return confirm('Are you sure you want to delete this user');">Delete</a> </div> <?php } }else{ echo '<p class="empty">no products added yet!</p>'; } ?> </div> </section>
  • 81. <section class="edit_user-form"> <div class="edit-product-form"> <?php if (isset($_GET['update_user'])) { $update_id = $_GET['update_user']; $update_query = mysqli_query($conn, "SELECT * FROM `users_info` WHERE Id = '$update_id'") or die('query failed'); if (mysqli_num_rows($update_query) > 0) { while ($fetch_update = mysqli_fetch_assoc($update_query)) { ?> <form action="" method="POST" enctype="multipart/form-data"> <input type="hidden" name="update_id" value="<?php echo $fetch_update['Id']; ?>"> <input type="text" value="<?php echo $fetch_update['name'] ?>" name="update_name" placeholder="Enter Name" required class="box "> <input type="text" value="<?php echo $fetch_update['surname'] ?>" name="update_sname" placeholder="Enter Surname" required class="box"> <input type="email" value="<?php echo $fetch_update['email'] ?>" name="update_email" placeholder="Enter Email Id" required class="box"> <input type="password" value="<?php echo $fetch_update['password'] ?>" name="update_password" placeholder="Enter password" required class="box"> <select name="update_user_type" id="" required class="box"> <option value="User">User</option> <option value="Admin">Admin</option> </select> <input type="submit" value="Update" name="update_user" class="delete_btn"> <input type="reset" value="cancel" id="close-update_user" class="update_btn"> </form> <?php } } } else { echo '<script>document.querySelector(".edit-product-form").style.display = "none";</script>'; } ?> </div> </section> <script> document.querySelector('#close-update_user').onclick = () => { document.querySelector('.edit-product-form').style.display = 'none'; window.location.href = 'users_detail.php'; } </script> </body> </html> admin_orders.Php <?php include 'config.php'; session_start(); $admin_id = $_SESSION['admin_id'];
  • 82. if (!isset($admin_id)) { header('location:login.php'); } if (isset($_POST['update_order'])) { $order_update_id = $_POST['order_id']; $update_payment = $_POST['update_payment']; $date = date("d.m.Y"); mysqli_query($conn, "UPDATE `confirm_order` SET payment_status = '$update_payment',date='$date' WHERE order_id = '$order_update_id'") or die('query failed'); $message[] = 'payment status has been updated!'; } if (isset($_GET['delete'])) { $delete_id = $_GET['delete']; mysqli_query($conn, "DELETE FROM `confirm_order` WHERE order_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>orders</title> <!-- font awesome cdn link --> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css"> <link rel="stylesheet" href="./css/hello.css"> <style> .cart-btn1, .cart-btn2 { display: inline-block; margin-top: 0.4rem; padding:0.2rem 0.8rem; cursor: pointer; color:white; font-size: 15px; border-radius: .5rem; text-transform: capitalize; } .cart-btn1 { margin-left: 40%; background-color: red; } .cart-btn2 { background-color: #ffa41c; color: black; } .placed-orders .title {
  • 83. text-align: center; margin-bottom: 20px; text-transform: uppercase; color: black; font-size: 40px; } .placed-orders .box-container { max-width: 1200px; margin: 0 auto; display: flex; flex-wrap: wrap; align-items: center; gap: 20px; } .placed-orders .box-container .empty { flex: 1; } .placed-orders .box-container .box { flex: 1 1 400px; border-radius: .5rem; padding: 15px; border: 2px solid rgb(9, 218, 255); background-color: white; padding: 10px 20px; } .placed-orders .box-container .box p { padding: 10px 0 0 0; font-size: 20px; color: gray; } .placed-orders .box-container .box p span { color: black; } .message { position: sticky; top: 0; margin: 0 auto; width: 61%; background-color: #fff; padding: 6px 9px; display: flex; align-items: center; justify-content: space-between; z-index: 100; gap: 0px; border: 2px solid rgb(68, 203, 236); border-top-right-radius: 8px; border-bottom-left-radius: 8px; } .message span { font-size: 22px; color: rgb(240, 18, 18); font-weight: 400; } .message i {
  • 84. cursor: pointer; color: rgb(3, 227, 235); font-size: 15px; } </style> </head> <body> <?php include 'admin_header.php'; ?> <?php if (isset($message)) { foreach ($message as $message) { echo ' <div class="message" id= "messages"><span>' . $message . '</span> </div> '; } } ?> <section class="placed-orders"> <h1 class="title">placed orders</h1> <div class="box-container"> <?php $select_orders = mysqli_query($conn, "SELECT * FROM `confirm_order`") or die('query failed'); if (mysqli_num_rows($select_orders) > 0) { while ($fetch_book = mysqli_fetch_assoc($select_orders)) { ?> <div class="box"> <p> Order Date : <span><?php echo $fetch_book['order_date']; ?></span> </p> <p> Order Id : <span>#<?php echo $fetch_book['order_id']; ?> </p> <p> Name : <span><?php echo $fetch_book['name']; ?></span> </p> <p> Mobile Number : <span><?php echo $fetch_book['number']; ?></span> </p> <p> Email Id : <span><?php echo $fetch_book['email']; ?></span> </p> <p> Address : <span><?php echo $fetch_book['address']; ?></span> </p> <p> Payment Method : <span><?php echo $fetch_book['payment_method']; ?></span> </p> <p> Your orders : <span><?php echo $fetch_book['total_books']; ?></span> </p> <p> Total price : <span>₹ <?php echo $fetch_book['total_price']; ?>/-</span> </p> <form action="" method="post"> <input type="hidden" name="order_id" value="<?php echo $fetch_book['order_id']; ?>"> Payment Status :<select name="update_payment"> <option value="" selected disabled><?php echo $fetch_book['payment_status']; ?></option> <option value="pending">pending</option> <option value="completed">completed</option> </select> <input type="submit" value="update" name="update_order" class="cart-btn2"> <a class="cart-btn1" href="admin_orders.php?delete=<?php echo $fetch_book['order_id']; ?>" onclick="return confirm('delete this order?');">delete</a> </form> </div> <?php } } else { echo '<p class="empty">no orders placed yet!</p>'; }
  • 85. ?> </div> </section> <!-- custom admin js file link --> <script src="js/admin_script.js"></script> <script> setTimeout(() => { const box = document.getElementById('messages'); // 👇️ hides element (still takes up space on page) box.style.display = 'none'; }, 8000); </script> </body> </html> message_admin.Php <?php include 'config.php'; session_start(); $admin_id = $_SESSION['admin_id']; if(!isset($admin_id)){ header('location:login.php'); }; if (isset($_GET['delete_msg'])) { $msg_id = $_GET['delete_msg']; mysqli_query($conn, "DELETE FROM `msg` WHERE id = '$msg_id'") or die('query failed'); header('location:message_admin.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"> <link rel="stylesheet" href="./css/register.css"> <link rel="stylesheet" href="./css/index_book.css"> <title>Messages</title> </head> <body> <?php include 'admin_header.php'; ?>
  • 86. <section class="show-products"> <div class="box-container"> <?php $select_user = mysqli_query($conn, "SELECT id,name,email,number,msg,date FROM msg") or die('query failed'); if(mysqli_num_rows($select_user) > 0){ while($fetch_user = mysqli_fetch_assoc($select_user)){ ?> <div class="box"> <div class="name">Message ID: <?php echo $fetch_user['id']; ?></div> <div class="name">Name: <?php echo $fetch_user['name']; ?></div> <div class="name">Email ID: <?php echo $fetch_user['email']; ?></div> <div class="password">Number: <?php echo $fetch_user['number']; ?></div> <div class="price">Message: <?php echo wordwrap($fetch_user['msg'],30,"<br>n",TRUE); ?></div> <div class="price">Date: <?php echo $fetch_user['date']; ?></div> <a href="message_admin.php?delete_msg=<?php echo $fetch_user['id']; ?>" onclick="return confirm('delete this message?');">Delete</a> </div> <?php } }else{ echo '<p class="empty">No any message recived yet!</p>'; } ?> </div> </section> </body> </html> admin.css @import url("https://fonts.googleapis.com/css2?family=Poppins:wght@100;200;300;400;500;600;700&display=swap"); * { text-decoration: none; margin: 0; padding: 0; font-family: "Poppins", sans-serif; box-sizing: border-box; outline: none; border: none; } header { background: #f2f1f1; display: flex; justify-content: space-between; top: 0; left: 0; right: 0; padding: 10px 1%; align-items: center; position: sticky; z-index: 1000; box-shadow: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.1); }
  • 87. .logo a { display: flex; cursor: pointer; } .logo a span { color: rgb(255, 5, 5); font-weight: bold; padding-right: 5px; font-size: 40px; } .logo a .me { color: black; font-weight: 500; } .nav a { padding: 0.5rem 1rem; color: rgb(2, 120, 238); font-weight: 600; transition: 0.2s ease; } .nav a:hover { color: red; border-bottom:3px solid black; } header .right { align-items: center; display: flex; } header .right .Btn { color: rgb(15, 155, 248); margin: 0 15px; padding: 5px 3px; font-size: 25px; font-weight: 600; transition: 0.2s ease; } header .right .Btn:hover { color: rgb(255, 6, 6); border-bottom: 3px solid #0e0e0d; } header .right .log_info { font-size: 25px; } /* *************Admin Home Section************************** */ .main_box{ display: grid; grid-template-columns: repeat(auto-fit, 17rem); justify-content: center; gap:1.5rem; max-width: 1200px; margin:0 auto; align-items: flex-start; } .card { position: relative;
  • 88. display: flex; flex-direction: column; min-width: 0; word-wrap: break-word; background-color: #fff; background-clip: border-box; border-radius: 0.25rem; margin: 5px; border-radius: 0.5rem; border: 2px solid rgb(9, 218, 255); } .card-img-top { width: 64%; height: 130px; margin: auto; border-top-left-radius: calc(0.25rem - 1px); border-top-right-radius: calc(0.25rem - 1px); } .card img { vertical-align: middle; border-style: none; } .card-body { -ms-flex: 1 1 auto; flex: 1 1 auto; padding: 1.25rem; } .card-title { margin-bottom: 0.75rem; } .card-body h5 { font-size: 1.25rem; margin-bottom: 0.5rem; font-family: inherit; font-weight: 500; line-height: 1.2; color: inherit; margin-top: 0; } .card-body p { margin-top: 0; margin-bottom: 1rem; font-size: 35px; font-weight: 700; } .btn:not(:disabled):not(.disabled) { cursor: pointer; } .btn-primary { color: #fff; background-color: rgb(68, 109, 245); border-color: rgb(14, 13, 13); } .btn { display: inline-block; font-weight: 400;
  • 89. text-align: center; white-space: nowrap; vertical-align: middle; user-select: none; border: 1px solid transparent; padding: 0.375rem 0.75rem; font-size: 13px; margin: 3px; line-height: 1.5; border-radius: 0.25rem; transition: color .15s ease-in-out,background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out; } a { color: #ff0000; text-decoration: none; background-color: transparent; } /* *************Admin Home Section************************** */ details.css @import url("https://fonts.googleapis.com/css2?family=Poppins:wght@100;200;300;400;500;600;700&display=swap"); section{ color: black; font-family: "Poppins", sans-serif; overflow: hidden; } section .main{ padding: 100px 20px; margin: auto 0; } section .main .container{ display: flex; flex-wrap: wrap; margin: 0 auto; justify-content: center; } section .main .container img{ align-items:center; object-fit: cover; object-position: center; display: block; position: relative; height: 278px; border: 4px solid rgb(77, 165, 42); margin: 20px; padding: 20px 10px; border-radius: 10px; } section .main .container .right{ padding: 30px; width: 400px; border: 2px solid rgb(19, 212, 12);
  • 90. } section .main .container .right h2{ text-transform: capitalize; font-size: 25px; color: rgb(107 114 128); letter-spacing: 2px; } section .main .container .right h1{ font-size: 30px; font-weight: 500; } section .main .container .right p{ line-height: 1.625; display: flex; flex-wrap: wrap; width: auto; } section .main .container .right .flex{ display: flex; justify-content: space-around; padding: 30px 0; } hello.css @import url("https://fonts.googleapis.com/css2?family=Poppins:wght@100;200;300;400;500;600;700&display=swap"); @import url('https://fonts.googleapis.com/css2?family=Comfortaa:wght@400;500;700&display=swap'); * { text-decoration: none; margin: 0; padding: 0; font-family: "Poppins", sans-serif; box-sizing: border-box; outline: none; border:none; } header { background: #f2f1f1; display: flex; justify-content: space-between; top: 0; left: 0; right: 0; padding: 10px 1%; align-items: center; position: sticky; z-index: 1000; box-shadow: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.1); } .logo a{ display: flex; cursor: pointer;
  • 91. } .logo a span { color: rgb(255, 0, 0); font-weight: bold; padding-right: 5px; font-size: 40px; } .logo a .me { color: rgb(0, 0, 0); font-weight: 500; } .nav a { padding: 0.5rem 1rem; color: rgb(9, 152, 248); font-weight: 600; transition: 0.2s ease; } .nav a:hover { color: black; border-bottom: 3px solid rgb(245, 12, 12); } header .right .Btn { color: rgb(236, 6, 6); margin: 0 15px; padding: 5px 3px; font-size: 13px; font-weight: 600; transition: 0.2s ease; } header .right .Btn:hover { color: black; border-bottom: 3px solid #e6e208; } /* **********Header Close********************* */ section .banner{ background-image: url(../images/imgg.png); background-position: center; background-size: cover; background-repeat: no-repeat; width: auto; height: 144px; margin: 1rem 0; z-index: 1000; } /* showing books on home page */ .show-products .box-container{ display: grid; grid-template-columns: repeat(auto-fit, 17rem); justify-content: center; gap:1.5rem; max-width: 1200px; margin:0 auto; align-items: flex-start; } .show-products{
  • 92. padding-top: 0; margin-top: 55px; } .show-products .box-container .box{ text-align: center; padding:10px; border-radius: .5rem; border: 2px solid rgb(9, 218, 255); } #home .container h2{ font-family: 'Comfortaa', cursive; font-weight: bolder; } .show-products .box-container .box img{ height: 25px; display: inline-block; } .show-products .box-container .box .name{ font-size: 1rem; color:black; text-transform: capitalize; } .show-products .box-container .box .price{ margin: 8px 0; font-size: 17px; color: #f35516; font-weight: 400; } .show-products .box-container .box .update_btn,.update_btn{ padding: 4px 4px; margin: 4px; border-radius: 7px; color: rgb(0, 167, 245); text-transform: capitalize; text-decoration: none; } .show-products .box-container .box .delete_btn, .delete_btn{ padding: 5px 5px; margin: 2px; } /* Scrollbarr */ ::-webkit-scrollbar { width: 6px; } ::-webkit-scrollbar-track { background: #f2f1f1; border-radius: 10px; } ::-webkit-scrollbar-thumb { background: rgb(0, 167, 245); width: 5px; border-radius: 10px;
  • 93. } ::-webkit-scrollbar-thumb:hover { background: black; } /* Scrollbarr */ /* css for Cart Page */ .cart_form{ margin: 20px auto; } .cart_form table{ border-collapse: collapse; width: 100%; } .book_info{ display: flex; flex-wrap: wrap; } .cart_form table tr th{ text-align: left; padding: 6px; color: #fff; background: rgb(0, 167, 245); } .cart_form table tr td{ padding: 10px 5px; } .cart_form table tr td input{ width: 40px; height: 30px; padding: 5px; } td .book_info a{ color: rgb(0, 167, 245); font-size: 12px; } td .book_info img{ width: 80px; height: 80px; margin-right: 10px; } /* css for Cart Page */ /* ********************CONTACT PAGE************* */ .contact-section{ background: url(bg.png) no-repeat center; background-size: cover; padding: 40px 0; } .contact-section h1{ text-align: center; color: #ddd; } .border{ width: 100px; height: 10px; background: #131414; margin: 40px auto; }
  • 94. .contact-section{ justify-content: center; background-image: linear-gradient(45deg, rgba(0, 0, 3, 0.1), rgba(0, 0, 0, 0.5)), url(../images/c1.jpg); background-repeat: no-repeat; background-position: center; background-size: cover; } .contact-form{ max-width: 600px; margin: auto; padding: 0 10px; overflow: hidden; } .contact-form-text{ display: block; width: 100%; box-sizing: border-box; margin: 16px 0; border: 0; background: rgba(19, 18, 18, 0.9); padding: 20px 40px; outline: none; color: #ddd; font-size: 15px; border-radius: 8px; transition: 0.5s; } .contact-form-text:focus{ box-shadow: 0 0 10px 4px rgb(0, 167, 245); } textarea.contact-form-text{ resize: none; height: 120px; } .contact-form-btn{ float: right; border: 0; background:rgb(15, 15, 15); color: #fff; padding: 12px 50px; border-radius: 20px; cursor: pointer; transition: 0.5s; } .contact-form-btn:hover{ background: rgb(0, 167, 245); } /* ********************CONTACT PAGE************* */ /* Style The Dropdown Button */ header .nav .dropdown .dropbtn { color: rgb(0, 167, 245); padding: 8px 10px; font-weight: bold; border: none; cursor: pointer;
  • 95. } /* The container <div> - needed to position the dropdown content */ header .nav .dropdown { position: relative; display: inline-block; } /* Dropdown Content (Hidden by Default) */ header .nav .dropdown .dropdown-content { display: none; position: absolute; background-color: #f9f9f9; min-width: 160px; box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2); z-index: 1; } /* Links inside the dropdown */ header .nav .dropdown .dropbtn .dropdown-content a { color: black; padding: 12px 16px; text-decoration: none; display: block; } /* Change color of dropdown links on hover */ header .nav .dropdown .dropbtn .dropdown-content a:hover {background-color: #f1f1f1} /* Show the dropdown menu on hover */ header .nav .dropdown:hover .dropdown-content { display: flex; flex-direction: column; } /* **********************************ORDER PAGE*********************************** */ .placed-orders .title{ text-align: center; margin-bottom: 20px; text-transform: uppercase; color:black; font-size: 40px; } .placed-orders .box-container{ max-width: 1200px; margin:0 auto; display:flex; flex-wrap: wrap; align-items: center; gap:20px; } .placed-orders .box-container .empty{ flex:1; } .placed-orders .box-container .box{ flex:1 1 400px; border-radius: .5rem; padding:15px;
  • 96. border:2px solid rgb(14, 152, 231); background-color: white; padding:10px 20px; } .placed-orders .box-container .box p{ padding:10px 0 0 0; font-size: 20px; color:gray; } .placed-orders .box-container .box p span{ color:black; } .message { position: sticky; top: 0; margin: 0 auto; width: 61%; background-color: #fff; padding: 6px 9px; display: flex; align-items: center; justify-content: space-between; z-index: 100; gap: 0px; border: 2px solid rgb(68, 203, 236); border-top-right-radius: 8px; border-bottom-left-radius: 8px; } /* **********************************ORDER PAGE*********************************** */ index_book.css @import url('https://fonts.googleapis.com/css2?family=Comfortaa:wght@400;500;700&display=swap'); @import url("https://fonts.googleapis.com/css2?family=Poppins:wght@100;200;300;400;500;600;700&display=swap"); * { text-decoration: none; margin: 0; padding: 0; font-family: "Poppins", sans-serif; box-sizing: border-box; outline: none; border:none; } .show-products .box-container{ display: grid; grid-template-columns: repeat(auto-fit, 20rem); justify-content: center; gap:1.5rem; max-width: 1200px; margin:0 auto; align-items: flex-start; } .show-products{ padding-top: 0;
  • 97. margin-top: 15px; } .show-products .box-container .box{ text-align: center; padding:10px; border-radius: .5rem; border:2px solid rgb(9, 218, 255); } #home .container h2{ font-family: 'Comfortaa', cursive; font-weight: bolder; } .show-products .box-container .box img{ height: 190px; display: inline-block; } .show-products .box-container .box .name{ font-size: 1rem; color:black; text-transform: capitalize; } .show-products .box-container .box .price{ margin: 8px 0px; font-size: 17px; color: rgb(3, 180, 224); font-weight: 400; } .show-products .box-container .box .update_btn,.update_btn{ background-color: rgb(253, 15, 7); padding: 9px 15px; margin: 6px; border-radius: 10px; color: white; text-transform: capitalize; } .show-products .box-container .box .delete_btn, .delete_btn{ background-color: rgb(255, 208, 0); padding: 9px 15px; margin: 6px; border-radius: 10px; color: rgb(255,255, 255); text-transform: capitalize; } /* details book */ .details{ margin-top: 80px; } .details .row_box{ display: flex; justify-content: center; align-items: center; } .details .col_box img{
  • 98. height: 420px; } .details .col_box{ padding: 80px; } .details .col_box img{ padding: 0; } .details h3{ margin: 20px 0; font-size: 22px; font-weight: bold; } .details label{ font-size: 17px; font-weight: 700; } .details input{ width: 130px; height: 41px; padding-left: 3px; font-size: 20px; margin-left: 10px; border-radius: 5px; border: 1px solid rgb(0, 240, 248); } input:focus{ outline: none; } .details .col_box .buttons{ display: flex; margin: 12px; } .details .buttons a{ background-color: rgb(6, 144, 236); color: white; font-size: 15px; font-weight: bold; border-radius: 17px; padding: 12px; margin-right: 10px; text-decoration: none; } /* details book */ register.css @import url("https://fonts.googleapis.com/css2?family=Poppins:wght@100;200;300;400;500;600;700&display=swap"); * { text-decoration: none; } body { background: #fff; font-family: "Poppins", sans-serif; } html { overflow-x: hidden; top: 0; bottom: 0;
  • 99. left: 0; right: 0; } .container { display: flex; justify-content: center; background-image: linear-gradient( 45deg, rgba(0, 0, 3, 0.1), rgba(0, 0, 0, 0.5) ), url(../bgimg/3.jpg); background-repeat: no-repeat; background-position: center; background-size: cover; height: 98vh; } .container_box { display: flex; justify-content: center; align-items: center; } .container form, .container_box form { margin: auto; display: flex; flex-direction: column; width: 60rem; text-align: center; align-items: center; } .container form h3, .container_box form h3 { font-size: 32px; margin-bottom: 0.5rem; margin-top: 5px; text-transform: capitalize; color: rgb(22, 21, 21); } .container_box form h3 a :first-child, .container form h3 a :first-child { color: rgb(233, 3, 3); } .container form h3 a :last-child, .container_box form h3 a :last-child { color: rgb(14, 13, 13); } .container form .text_field, .container_box form .text_field { width: 40%; border-radius: 8px; margin: 5px 0; padding: 13px 13px; font-size: 15px; color: black;
  • 100. border: 2px solid rgb(0, 181, 226); } .container form p, .container_box form p { padding-top: 5px; font-size: 25px; color: white; } .container form p a, .container_box form p a { color: rgb(20, 20, 20); } .container form .btn, .container_box form .btn { background-color: #fff9f9; color: rgb(7, 7, 7); font-size: 20px; } .container form .btn:hover, .container_box form .btn:hover { background: rgb(0, 167, 245); border-radius: 8px solid rgb(248, 240, 240); cursor: pointer; } /* Message */ .message { position: sticky; top: 0; margin: 0 auto; width: 61%; background-color: #fff; padding: 6px 9px; display: flex; align-items: center; justify-content: space-between; z-index: 100; gap: 0px; border: 2px solid rgb(68, 203, 236); border-top-right-radius: 8px; border-bottom-left-radius: 8px; } .message span { font-size: 22px; color: rgb(240, 18, 18); font-weight: 400; } .message i { cursor: pointer; color: rgb(3, 227, 235); font-size: 15px; } .show-products .box-container { display: grid; grid-template-columns: repeat(auto-fit, 27rem); justify-content: center; gap: 1.5rem; max-width: 1200px;
  • 101. margin: 0 auto; align-items: flex-start; } .show-products { padding-top: 0; margin-top: 15px; } .show-products .box-container .box { text-align: center; padding: 12px; border-radius: 0.5rem; border: 2px solid rgb(15, 156, 221); } .show-products .box-container .box img { height: 180px; } .show-products .box-container .box .name { font-size: 1rem; color: black; text-transform: capitalize; } .show-products .box-container .box .price { margin: 15px; font-size: 20px; color: rgb(32, 31, 31); } .show-products .box-container .box .update_btn, .update_btn { background-color: rgb(255, 187, 0); padding: 9px 15px; margin: 6px; border-radius: 10px; color: white; text-transform: capitalize; } .show-products .box-container .box .delete_btn, .delete_btn { background-color: rgb(238, 0, 0); padding: 9px 15px; margin: 6px; border-radius: 10px; color: white; text-transform: capitalize; } .edit-product-form { /* min-height: 128vh; */ background-color: white; display: flex; align-items: center; justify-content: center; padding: 2rem; overflow-y: scroll; /* position: fixed; */ top: 0;
  • 102. left: 0; z-index: 1200; width: 100%; } .edit-product-form form { width: 50rem; padding: 2rem; text-align: center; border-radius: 0.5rem; background-color: var(--white); } .edit-product-form form img { height: 233px; margin-bottom: 1rem; } .edit-product-form form .box { margin: 6px 0; padding: 1rem 3.4rem; border: 2px solid rgb(76, 202, 240); border-radius: 0.5rem; background-color: white; font-size: 18px; color: black; width: 89%; } Future enhancement Following expansion can be done • Users can buy subscription to read online. • Users can select whether he want to purchase a hard copy or soft copy, if user wants soft copy after successfull of payment he can download the pdf form of the book. References
  • 103. www.google.com www.w3school.com www.php.net www.youtube.com PHASE COMPLETION TABLE PHASE EXCEPTED DATE OF COMPLETION ACTUAL DATE OF COMPLETION REMARKS Planning 19th December 2023 25th December 2023 Analysis 10thJanuary 2023 18thJanuary 2023 Design 25thJanuary 2023 30thJanuary 2023 Coding 3rd February 2023 20th February 2022 Testing& Implementation 22st February2023 24st February 2023 Documentation 25th February 2023 1st March 2023