Project Report

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 149

A Project Report

On

MY Doctor Portal

Submitted to:

P.G Department of Computer Applications (MCA)


MODEL INSTITUTE OF ENGINEERING AND TECHNOLOGY (Autonomous)

In partial fulfilment of the requirement for the Award of Degree of

MASTER OF COMPUTER APPLICATIONS

Submitted By: Under the Guidance of:


Arun Kumar Mr. Mohan Singh
2020D1L013 Assistant Professor

(Session: 2020 - 2022)


MODEL INSTITUTE OF ENGINEERING AND TECHNOLOGY(Autonomous)
NAAC Accredited: A Grade Affiliated to University of Jammu
Kot Bhalwal, Jammu
CERTIFICATE

This is to certify that the project entitled “My Doctor Portal” submitted by Mr.
ARUN KUMAR bearing university Roll no 2020D1L013, in partial fulfilment of
the requirements for the award of the degree of Master of Computer
Application (MCA) Course Session 2020-2022, P.G. Department of Computer
Applications of Model Institute of Engineering and Technology (Autonomus),
Jammu, is a record of the student’s own work carried out under my supervision
and guidance. To the best of our knowledge, this project has not been
submitted to any other university or institute for award of a degree.

Internal Guide Head of Department


ACKNOWLEDGEMENT

Apart from the efforts of me, the success of any project depends largely on the
encouragement and guidelines of many others. I take this opportunity to
express my gratitude to the people who have been instrumental in the
successful completion of this project.

The satisfaction that accompanies that the successful completion of any task
would be complete without the mention of people whose ceaseless cooperation
made it possible, whose constant guidance and encouragement crown all efforts
with success.

I express my profound gratitude and deep regard to Prof. GS Sambyal & Prof
Mr. Vishal Gupta for their guidance and constant encouragement through the
MCA course.

I would like to show my greatest appreciation to internal guide Assistant


Professor Mr. MOHAN SINGH. I can’t say thank you enough for his tremendous
support and help. I feel motivated and encouraged every time I attend his
meeting. Without his encouragement, meticulous effort, and guidance this
project would not have materialized.

Finally, I wish to express my sincere thanks to all my family members, who


always help me and encourage me whenever I got hacked with difficulties in my
project work. They were always there to protect me without their moral support
or encouragement, maybe I am not able to complete this project work in time.

ARUN KUMAR
2020D1L013
DECLARATION

I, ARUN SHARMA, hereby declare that the project work entitled “ONLINE BOOK
STORE” submitted to Model Institute of Engineering and Technology (MIET),
Jammu is a record of an original work done by me under the guidance of Mr.
MOHAN SINGH, Assistant Professor, MIET. And this project work is submitted
in partial fulfilment of the requirements for the award of the degree of Master
of Computer Application (MCA), P.G. Department of Computer Applications and
has not presented as a part of any other academic work to any other University
or Institute for the award of any degree or diploma.

ARUN SHARMA
2020D1L015
Table of Contents

S No. Contents Page No.


1. Introduction 8
2. Objective of the Project 9
3. Project Category 10
4. Tools and Platform 11
5. System Analysis 12
6. Data Flow Diagram (DFD) 13 - 17
7. Entity Relationship Diagram (ERD) 18
8. Data Dictionary 19 - 22
9. Input to the System 23
10. Module Description 24 - 28
11. User Interface Design 29 - 40
13. Source Code (Coding) 41 - 149
14. Testing 150
15. Scope of Future Application 151
1. INTRODUCTION

The main objective of the project is to create an ONLINE BOOKSTORE 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 card payment. The Administrator will have additional
functionalities when compared to the common user.

The motivation to create this project has many sources

• Interest to develop a good user-friendly website with many online


transactions using a database.

• To increase my knowledge horizon in technologies like PHP, SQL, CSS, HTML,


JavaScript

• To gain good experience in Web Development before joining in a full-time job.

• To gain expertise using Data Grid, Data Set, Data Table, Data Adapter and Data
Readers.
2. OBJECTIVE OF THE PROJECT

Our Aim is to create an ecommerce which let the user to make its order books
online based on title, author & genre using Internet.

Objectives:
 This site is giving all the information about the e-shopping to provide
better service for the customer.

 It provides the facility to the customers who want to order online due to
lack of time.

 It’s providing the full details about the product and related information
about the product like cost, Genre etc.

 With the help of it we can save the time and money also.

 It provides the remote order by the cash.

 It provides better security and good delivery service to the customer.


3. PROJECT CATEGORY

My undergoing project falls under Web Based Application.

Web based project management software is the collection of programs,


processes and information that is used to manage various phases of a project
and that is accessible on the Internet. Project management entails processes
such as scheduling, calculating a critical path, building timelines, creating task
lists, managing resources, controlling documents, and providing audit trails.
Each of these processes can be controlled and sometimes automated through
project management software solutions.

Web based solutions are coded in a browser supported language such as HTML,
CSS, JavaScript, PHP. So, they can be accessed by clients through a web browser.
One main software version is installed and maintained on a server so that more
than one client can access this version.

One disadvantage to using Web-based software is that the program is usually


slower to respond than a typical desktop or client application, Web-based
applications are limited by the speed of one's Internet connection, while client
applications operate as quickly as the client's processor speed. In addition, most
information in Web-based applications is not accessible when a user is offline.
4. TOOLS & PLATFORM

Software Tools:

 Operating System: Windows 10 or above (Using Chrome Browser)

 Browser: Chrome Browser

 Data Base Server: MY SQL (XAMPP sever)

 Languages: PHP, HTML, CSS, JavaScript

 IDE: VS Code, Chrome Developer Tools

Hardware Tools:

 Processor: Intel Core i3 6th Gen or Above Processor

 Storage: 265GB SSD or HDD

 Memory: 4GB RAM

 Monitor: 768p or above


5. SYSTEM ANALYSIS

Systems Analysis is a problem-solving technique that decomposes a system into


its component pieces for the purpose of the studying how well those
component parts work and interact to accomplish their purpose". According to
the Merriam Webster dictionary, systems analysis is "the process of studying a
procedure or business in order to identify its goals and purposes and create
systems and procedures that will achieve them in an efficient way". Analysis and
synthesis, as scientific methods, always go hand in hand; they complement one
another. Every synthesis is built upon the results of a preceding analysis, and
every analysis requires a subsequent synthesis to verify and correct its results. In
a broad sense, a general methodology (not a fixed set of techniques) that
applies a 'systems' or 'holistic' perspective by taking all aspects of the situation
into account, and by concentrating on the interactions between its different
elements. It provides a framework in which judgments of the experts in
different fields can be combined to determine what must be done, and what is
the best way to accomplish it considering current and future needs. Although
closely associated with data or information processing, the practice of SA has
been in existence since long before computers were invented. In a narrow
sense, analysis of the current and future roles of proposed computer system in
an organization, the system analyst (usually a software engineer or
programmer) examines the flow of documents, information, and material to
design a system that best meets the cost, performance, and scheduling
objectives.
6. Data Flow Diagram (DFD)

0 Level DFD
1 Level DFD
2 Level DFD

a. Order Module
b. Customer Module
c. Book Module
7. Entity Relationship Diagram (ERD)
8. DATA DICTIONARY

Database Name: book_store


Table 1: book

S No. Field Name Data Constrain Size Description


type
1. book_code varchar Primary 8 Book Code
key
2. book_name Varchar Not null 50 Book Full Name

3. price Integer Not null 4 Book Price


4. category Varchar Not null 30 Book category
5. author varchar Not null 30 Book author
6. publisher Varchar Not null 30 Book publisher
7. quantity Integer Not null 2 Book Quantity
8. image Text Not null _ Book image
9. description Text Not null _ Book description
10. Isbn Number Not Null 13 Book ISBN number
11. Edition Varchar Not Null 20 Book Edition
Table 2: customer

S Field name Data Constrain Size Description


No. type

1. customer_id Integer Primary 8 Auto generated customer


key id
2. name Varchar Not null 30 Customer full name
3. email varchar Not null 40 Customer email address
4. password Varchar Not null 30 Customer password

Table 3: cart

S Field Name Data Constrain Size Description


No. type

1. order_id integer Primary key 8 Order id for cart


2. customer_id Integer Foreign Key 8 Foreign Key Customer id

3. Book_code Varchar Foreign Key 8 Foreign Key Book code


4. Book_name varchar Not null 50 Book name

5. Quantity Integer Not null 2 Book quantity

6. Price Integer Not null 4 Book price


Table 4: Order

S No. Field name Data Constrain Size Description


type
1. order_id Integer Primary 8 Auto generated
key
2. customer_i d Integer Foreign 8 Foreign Key Customer
Key id
3. customer_name Varchar Not null 30 Book received
customer name
4. order_date Date Not null _ Order date
5. address Text Not null _ Delivery address
6. Phone_no Integer Not null 13 Customer phone
number
7. status Varchar Not null 15 Status for track
customer order
8. mode Varchar Not Null 17 Payment mode (debit
card or cash)
9. card_no Number Null 20 Debit card number
10. security_code Varchar Null 10 Debit card pin number
11. card_name Varchar Null 30 Debit card name

Table 5: admin

S No. Field name Data type Constrain Size Description

1. email_id varchar Primary 30 Admin email id


Key
2. password varchar Not null 30 Admin password
9. INPUT TO THE SYSTEM

User: Admin:

 Registration  Login

 Login  Add Book

 Search Book  Edit Book

 Category Display  Check All Orders

 View All Books  Bill Generation

 Book Add to Shopping Cart  View Sales Details

 Pay Payment  View All User info

 Get Bill Receipt  View All book

 Check Your order states  Search Book, order, user

 Filter by price rang

10. MODULE DESCRIPTION


A. CUSTOMER

1) Search for a Book

 Purpose: A user can search for a book of his choice by selecting category
and title. Then a select query is used to retrieve data from the database
and display the selected information.
 Actor: Customer
 Input: The user will select a category and enter title in a text box provided.
 Output: The system will display the books which matches the selected
search criteria. A dataset is created because of select query. Later the
dataset is binded to the data repeater to display the selected data.

2) Perform Advanced Search

 Purpose: If the user wants to perform an advanced search, he can search


for a book of his choice by selecting category, title, author, and price
range. Then a select query is used to retrieve data from the database and
display the selected information.
 Actor: customer
 Input: The user will select a category and enter title, author, and price
range in a text box provided.
 Output: The system will display the books which matches the selected
search criteria. A dataset is created because of select query. Later the
dataset is binded to the data repeater to display the selected data.

3) Register
 Purpose: If the user does not have an account, then he will be asked to
register.
 Actor: Customer
 Input: The user will enter details in the registration form according to the
required fields which include Customer id, Password, Full Name, Email and
Address.
 Output: After registration, the user will be directed to the main home
page.

4) Login

 Purpose: If the user wants to get access to all the functionalities of Online
Book Store, he should login using his username and password.
 Actor: customer
 Input: The user will enter his username and password.
 Output: If it is a successful login the user will be directed to the main home
page. Else if the user enters invalid information, he will be asked to check
the entered information.

5) Logout

 Purpose: If the user wants to end his session and sign out of the website
then he can use the logout option.
 Actor: customer
 Input: The user will click the logout button.
 Output: The user’s account session comes to an end and he should login
again if he wants to enter into the website.
6) Shopping Cart
 Purpose: If the user wants to purchase a book, then he can place an order
by selecting the add to shopping cart button and entering the quantity
required under the book description.
 Actor: customer
 Input: The user will enter the quantity required and click the add to
shopping cart button.
 Output: The order will be added to the user’s shopping cart.

B. ADMINISTRATOR

1) Login

 Purpose: If the Administrator wants to get access to all the functionalities


of Online Book Store, he should login using his username and password.
 Actor: Administrator
 Input: The Administrator will enter his username and password.
 Output: If it is a successful login the Administrator will be directed to his
menu page. Else if the Administrator enters invalid information, he will be
asked to check the entered information

2) Add, edit or Delete Book


 Purpose: If the Administrator wants to add or delete a book then he can
insert or delete a book using his administration rights and the book table
will be updated in the database.
 Actor: Administrator
 Input: If the Administrator wants to add a book, then he should click the
insert link button in the book page and fill the fields
 Output: The updated books list will be displayed in the main home page
under their category.

3) Manage Orders

 Purpose: If the Administrator wants to add or delete an order then he can


insert or delete an order using his administration rights.
 Actor: Administrator
 Input: If the Administrator wants to add an order, then he should click the
insert link button in the orders page else he can delete a particular
selected order
 Output: The updated orders list will be processed to the users.

4) Add, Edit or Delete Customer


 Purpose: If the Administrator wants to add or delete a book category then
he can insert or delete a book category using his administration rights and
the category table will be updated in the database. -
 Actor: Administrator
 Input: If the Administrator wants to add a book category, then he should
click the insert link button in the category page else he can delete a
particular selected book category.
 Output: The updated categories list will be displayed in the main home
page.

5) Logout

 Purpose: If the Administrator wants to end his session and sign out of the
website then he can use the logout option.
 Actor: Administrator
 Input: The Administrator will click the logout button.
 Output: The Administrator’s account session comes to an end, and he
should login again if he wants to enter the website

11. USER INTERFACE DESIGN


1. Customer Interface Design

a. Home Page

b. Books Page
c. Search Book Page
d. Book Information Page

e. Login and Registration Page


f. Cart

g. Order Details
h. Order Receipt

i. Order Tracking Details


j. About and Help

2. Admin Interface Design


a. Home Page

b. Add Book Page


c. View & Update Book Page
d. Update Book Page
d. View and update orders page
e. Order Status Update Page

f. Customer Management Page


g. Admin Login Page

13. Source Code (Coding)


1. adminhome.php

<?php
include_once('config.php');

session_start();;
if(isset($_SESSION['admin'])){
   
}else{
    header("Location: adminlogin.php");
    die();
}

?>

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-
scale=1.0">
    <title>Admin</title>
    <link rel="stylesheet" href="./css/adminindex.css">
    <link rel="stylesheet" href="./css/orderstable.css">
    <link rel="stylesheet" href="./css/home.css">
    <script src="./js/jquery.js"></script>
    <script src="./js/ajex.js"></script>
   
</head>
<body>
    <div class="container">
        <div class="side-menus">
            <img src="./icons/logo.png" alt="">
            <ul class="menus">
            <a href="adminhome.php"><li>Home</li></a>
                <a href="adminindex.php"><li>Add Book</li></a>
                <a href="booktable.php"><li>Book Table</li></a>
                <a href="orderstable.php"><li>Orders</li></a>
                <a href="customertable.php"><li>Customer</li></a>
                <a href="adminlogout.php"><li>Log Out</li></a>
           
            </ul>
        </div>
     <div class="main" id="main1">
           
            <div class="box0"><a href="neworders.php"><div
class="box"><img src="./icons/order.png" alt=""><h3>New
Orders</h3></div></a></div>
            <div class="box0"><a href="recievedorders.php"><div
class="box"><img src="./icons/recieved.png" alt=""><h3>Recieved
Orders</h3></div></a></div>
            <div class="box0"><a href="packedorders.php"><div
class="box"><img src="./icons/packed.png" alt=""><h3>Packed
Orders</h3></div></a></div>
            <div class="box0"> <a href="deliveredorders.php"><div
class="box"><img src="./icons/delivered.png" alt=""><h3>Delivered
Orders</h3></div></a></div>

               
           
   
     </div>
   
    </div>

</body>
</html>

2. adminlogin.php

<?php
    include_once("config.php");

    if (isset($_POST['login'])){

        $email = isset($_POST['email-id']) ? $_POST['email-id'] :


'';
        $password = isset($_POST['password']) ? $_POST['password'] :
'';
        $query = "select * from `admin` where `email`=:email and
`password` = :password";
        $stmt = $con->prepare($query);
        $stmt->bindParam('email', $email, PDO::PARAM_STR);
        $stmt->bindParam('password', $password, PDO::PARAM_STR);
        $stmt->execute();
        $count= $stmt->rowCount();
        $row = $stmt->fetch(PDO::FETCH_ASSOC);
   
        if($count==1){
            session_start();
            $_SESSION['admin'] = "admin";

            echo "<script>alert('Login_succeed');</script>";
            header("Location: adminhome.php");
        }else{
            echo "<script>alert('Incorrect email id or
password');</script>";
        }
    }    

?>

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-
scale=1.0">
    <link rel="stylesheet" href="./css/index.css">
    <link rel="stylesheet" href="./css/login.css">
    <script src="./js/jquery.js"></script>
    <script src="./js/ajex.js"></script>
    <script src="./js/register.js"></script>

   
   
   
    <title>Book Store</title>

</head>
<body>
   

    <!-- Start Main -->

    <div class="body-container">
       
        <div class="book-container">
        <div class="book-container3">
            <div class="login-div">
                <h2>Admin Login</h2>
                <form action="" method="POST"
enctype="multipart/form-data">
                    <input type="text" name="email-id"
placeholder="Email ID" required>
                    <input type="password" name="password"
placeholder="Password" required>
                    <input type="submit" class="button"
name="login"value="Login">
                </form>

            </div>
           
        </div>
     
    </div>

    <!-- End Main -->

     
</body>
</html>

3. adminindex.php

<?php
include_once('config.php');
session_start();;
if(isset($_SESSION['admin'])){
   
}else{
    header("Location: adminlogin.php");
    die();
}
if(isset($_POST['submit'])){

    $code = isset($_POST['book-code']) ? $_POST['book-code'] : '';


    $name = isset($_POST['book-name']) ? $_POST['book-name'] : '';
    $price = isset($_POST['book-price']) ? $_POST['book-price'] :
'';
    $quantity = isset($_POST['book-quantity']) ? $_POST['book-
quantity'] : '';
    $author = isset($_POST['book-author']) ? $_POST['book-author'] :
'';
    $publisher = isset($_POST['book-publisher']) ? $_POST['book-
publisher'] : '';
    $category = isset($_POST['category']) ? $_POST['category'] : '';
    $img = isset($_FILES['book-img']['name']) ? $_FILES['book-img']
['name'] : '';
    $description = isset($_POST['description']) ?
$_POST['description'] : '';
    $isbn = isset($_POST['book-isbn']) ? $_POST['book-isbn'] : '';
    $edition = isset($_POST['book-edition']) ? $_POST['book-
edition'] : '';
   
        //upload image

        $file_name = $_FILES['book-img']['name'];
        $file_tmp =$_FILES['book-img']['tmp_name'];
        $uploadOk = 1;
        if(move_uploaded_file($file_tmp,"uploads/".$file_name)){
         $uploadOk = 1;
        }else{ $uploadOk = 0;}

        // insert book details

        if($uploadOk == 1){

            $sql = "INSERT INTO book (book_code, book_name,


book_price, book_quantity, book_author, book_publisher,
book_category, book_img, book_description, book_isbn, book_edition)
VALUES (?,?,?,?,?,?,?,?,?,?,?)";
            $stmt= $con->prepare($sql);
            $stmt->execute([$code, $name, $price , $quantity,
$author, $publisher, $category, $img, $description, $isbn,
$edition]);
            $err = $stmt->errorInfo();
                if (isset($err[1])){
                    // 1062 - Duplicate entry
                    if ($err[1] == 1062)
                    echo("<script>alert('Sorry book code is already
exist!');</script>");
                   }else{
                    echo("<script>alert('Book add
successfully');</script>");
                   }
           
        }
}

?>

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-
scale=1.0">
    <title>Admin</title>
    <link rel="stylesheet" href="./css/adminindex.css">
    <script src="./js/jquery.js"></script>
    <script src="./js/adminindex.js"></script>
    <script src="./js/ajex.js"></script>
   
</head>
<body>
    <div class="container">
        <div class="side-menus">
            <img src="./icons/logo.png" alt="">
            <ul class="menus">
            <a href="adminhome.php"><li>Home</li></a>
                <a href="adminindex.php"><li>Add Book</li></a>
                <a href="booktable.php"><li>Book Table</li></a>
                <a href="orderstable.php"><li>Orders</li></a>
                <a href="customertable.php"><li>Customer</li></a>
                <a href="adminlogout.php"><li>Log Out</li></a>
           
            </ul>

        </div>
        <div class="main">
            <div class="title">
                <h1>1</h1>
                <h2>Add Book</h2>
            </div>

            <div class="main-content">
                <h4>Book Details :</h4>
                <hr class='line'>
                <form name="details-form" id="details-form"
action="adminindex.php" method="POST" onsubmit="return
validateForm();"  enctype="multipart/form-data">
                    <label for="book-code">Book Code : must contain
one charactor :-<span id="error"></span></label>
                    <input type="text" id="book-code" name="book-
code" placeholder="Book Code" required onfocusout="bookCode()">  
                   
                    <label for="book-name">Book Name :-<span
id="errorname"></span></label>
                    <input type="text" id="book-name" name="book-
name" placeholder="Book Name" required>  

                    <label for="book-isbn">ISBN No. :-<span


id="errorisbn"></span></label>
                    <input type="text" id="book-isbn" name="book-
isbn" placeholder="Book ISBN No." required>  
                   
                    <label for="book-edition">Edition :-<span
id="erroredition"></span></label>
                    <input type="text" id="book-edition" name="book-
edition" placeholder="Book Edition" required>  
                   

                    <label for="book-price">Book Price :-<span


id="errorprice"></span></label>
                    <input type="number" id="book-price" name="book-
price" placeholder="Book price" required >  
                   
                    <label for="book-quantity">Book Quantity :-<span
id="errorquantity"></span></label>
                    <input type="number" id="book-quantity"
name="book-quantity" placeholder="Book Quantity" required>

                    <label for="book-author">Book Author:-<span


id="errorauthor"></span></label>
                    <input type="text" id="book-author" name="book-
author" placeholder="Book Author" required>  
                   
                    <label for="book-publiher">Book Publisher :-
<span id="errorpublisher"></span></label>
                    <input type="text" id="book-publisher"
name="book-publisher" placeholder="Book Publisher" required>  
                   
                    <label for="category">Book Category :-<span
id="errorcategory"></span></label>
                    <select name="category" id="category" required>
                   
                    <option value=""></option>
                    <option value="Action and Adventure">Action and
Adventure</option>
                    <option value="Classics">Classics</option>
                    <option value="Comic Book or Graphic
Novel">Comic Book or Graphic Novel</option>
                    <option value="Detective and Mystery">Detective
and Mystery</option>
                    <option value="Fantasy">Fantasy</option>
                    <option value="Historical Fiction">Historical
Fiction</option>
                    <option value="Horror">Horror</option>
                    <option value="Literary Fiction">Literary
Fiction</option>
                    <option value="Romance">Romance</option>
                    <option value="Science Fiction (Sci-Fi)">Science
Fiction (Sci-Fi)</option>
                    <option value="Short Stories">Short
Stories</option>
                   </select>

                    <label for="book-img">Book Image :-<span


id="errorimg"></span></label>
                    <input type="file" id="book-img" name="book-img"
placeholder="Book img" required>  
                   
                    <label for="description">Book Description :-
<span id="errordescription"></span></label>
                    <textarea name="description" id="" cols="65"
rows="6" form="details-form" required></textarea>
                   

                    <input id="submit" name="submit" type="submit"


value="ADD BOOK">
                    <input id="reset" type="reset" value="RESET">
                </form>
            </div>

        </div>
    </div>
</body>
</html>
4. adminlogout.php

<?php
session_start();
session_destroy();
header("location: adminlogin.php");
?>

5. customertable.php

<?php
include_once('config.php');
session_start();;
if(isset($_SESSION['admin'])){
   
}else{
    header("Location: adminlogin.php");
    die();
}

?>

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-
scale=1.0">
    <title>Admin</title>
    <link rel="stylesheet" href="./css/adminindex.css">
    <link rel="stylesheet" href="./css/orderstable.css">
    <script src="./js/jquery.js"></script>
    <script src="./js/ajex.js"></script>
   
</head>
<body>
    <div class="container">
        <div class="side-menus">
            <img src="./icons/logo.png" alt="">
            <ul class="menus">
                <a href="adminhome.php"><li>Home</li></a>
                <a href="adminindex.php"><li>Add Book</li></a>
                <a href="booktable.php"><li>Book Table</li></a>
                <a href="orderstable.php"><li>Orders</li></a>
                <a href="customertable.php"><li>Customer</li></a>
                <a href="adminlogout.php"><li>Log Out</li></a>
            </ul>

        </div>
        <div class="main">
            <div class="title">
                <h1>9</h1>
                <h2>Customer Table</h2>
            </div>

            <div class="main-content">
            <div class="search-box">
            <input type="text" id="myInput" onkeyup="myFunction()"
placeholder="ID">
            <input type="text" id="myInput2" onkeyup="myFunction2()"
placeholder="Name">
            <input type="text" id="myInput3" onkeyup="myFunction3()"
placeholder="Email">
            </div>

        <table id="myTable">
        <tr>
            <th>Customer ID</th>
            <th>Name</th>
            <th>Email ID</th>
            <th>Delete</th>
        </tr>
        <?php
       $stmt = $con->query("SELECT * FROM customer ");
       while ($res = $stmt->fetch()) {    
            echo "<tr>";
            echo "<td >".$res['customer_id']."</td>";
            echo "<td >".$res['name']."</td>";
            echo "<td >".$res['email']."</td>";
            echo "<td > <a href=\"deletecustomer.php?
id=$res[customer_id]\" onClick=\"return confirm('Are you sure you
want to delete?')\"><div class='delete'>Delete</div></a></td>";
      echo "</tr>";
        }
        ?>
    </table>

            </div>
        </div>
    </div>

     <!-- Search Script -->


     
     <script>
function myFunction() {
  // Declare variables
  var input, filter, table, tr, td, i, txtValue;
  input = document.getElementById("myInput");
  filter = input.value.toUpperCase();
  table = document.getElementById("myTable");
  tr = table.getElementsByTagName("tr");

  // Loop through all table rows, and hide those who don't match the
search query
  for (i = 0; i < tr.length; i++) {
    td = tr[i].getElementsByTagName("td")[0];
    if (td) {
      txtValue = td.textContent || td.innerText;
      if (txtValue.toUpperCase().indexOf(filter) > -1) {
        tr[i].style.display = "";
      } else {
        tr[i].style.display = "none";
      }
    }
  }
}

function myFunction2() {
  // Declare variables
  var input, filter, table, tr, td, i, txtValue;
  input = document.getElementById("myInput2");
  filter = input.value.toUpperCase();
  table = document.getElementById("myTable");
  tr = table.getElementsByTagName("tr");

  // Loop through all table rows, and hide those who don't match the
search query
  for (i = 0; i < tr.length; i++) {
    td = tr[i].getElementsByTagName("td")[1];
    if (td) {
      txtValue = td.textContent || td.innerText;
      if (txtValue.toUpperCase().indexOf(filter) > -1) {
        tr[i].style.display = "";
      } else {
        tr[i].style.display = "none";
      }
    }
  }
}

function myFunction3() {
  // Declare variables
  var input, filter, table, tr, td, i, txtValue;
  input = document.getElementById("myInput3");
  filter = input.value.toUpperCase();
  table = document.getElementById("myTable");
  tr = table.getElementsByTagName("tr");

  // Loop through all table rows, and hide those who don't match the
search query
  for (i = 0; i < tr.length; i++) {
    td = tr[i].getElementsByTagName("td")[2];
    if (td) {
      txtValue = td.textContent || td.innerText;
      if (txtValue.toUpperCase().indexOf(filter) > -1) {
        tr[i].style.display = "";
      } else {
        tr[i].style.display = "none";
      }
    }
  }
}

</script>

</body>
</html>

6. editbook.php

<?php
include_once('config.php');
session_start();
if(isset($_SESSION['admin'])){
   
}else{
    header("Location: adminlogin.php");
    die();
}

if(isset($_POST['submit'])){
    $upimg ="0";
    $code = isset($_POST['book-code']) ? $_POST['book-code'] : '';
    $name = isset($_POST['book-name']) ? $_POST['book-name'] : '';
    $price = isset($_POST['book-price']) ? $_POST['book-price'] :
'';
    $quantity = isset($_POST['book-quantity']) ? $_POST['book-
quantity'] : '';
    $author = isset($_POST['book-author']) ? $_POST['book-author'] :
'';
    $publisher = isset($_POST['book-publisher']) ? $_POST['book-
publisher'] : '';
    $category = isset($_POST['category']) ? $_POST['category'] : '';
    $isbn = isset($_POST['book-isbn']) ? $_POST['book-isbn'] : '';
    $edition = isset($_POST['book-edition']) ? $_POST['book-
edition'] : '';
    if(empty($_FILES['book-img']['error'])){
        $img = isset($_FILES['book-img']['name']) ? $_FILES['book-
img']['name'] : '';
        $upimg ="1";
    }else{ $upimg = "0"; }
    $description = isset($_POST['description']) ?
$_POST['description'] : '';
   
        //upload image

        $file_name = $_FILES['book-img']['name'];
        $file_tmp =$_FILES['book-img']['tmp_name'];
        if(move_uploaded_file($file_tmp,"uploads/".$file_name)){
        }

        // insert book details

        if($upimg =="1"){
         

            try {
                 
                $con->exec("SET CHARACTER SET utf8");      // Sets
encoding UTF-8
                $con->setAttribute(PDO::ATTR_ERRMODE,
PDO::ERRMODE_EXCEPTION);
               $sql =  "UPDATE `book`  
        SET `book_name` = :book_name,
            `book_price` = :book_price,
            `book_quantity` = :book_quantity,
            `book_author` = :book_author,
            `book_publisher` = :book_publisher,
            `book_category` = :book_category,
            `book_img` = :book_img ,
            `book_isbn` = :book_isbn,
            `book_edition` = :book_edition ,
            `book_description` = :book_description
            WHERE `book_code` = :book_code";
               
                $statement = $con->prepare($sql);
                $statement->bindValue(":book_name", $name);
                $statement->bindValue(":book_price", $price);
                $statement->bindValue(":book_quantity", $quantity);
                $statement->bindValue(":book_author", $author);
                $statement->bindValue(":book_publisher",
$publisher);
                $statement->bindValue(":book_category", $category);
                $statement->bindValue(":book_img", $img);
                $statement->bindValue(":book_isbn", $isbn);
                $statement->bindValue(":book_edition", $edition);
                $statement->bindValue(":book_description",
$description);
                $statement->bindValue(":book_code", $code);
                $cont = $statement->execute();
                echo("<script>alert('Book updated
successfully');</script>");
                header("Location: booktable.php");

               }catch(PDOException $e) {echo $e->getMessage();}


               
        }else{

            try {
                 
                $con->exec("SET CHARACTER SET utf8");      // Sets
encoding UTF-8
                $con->setAttribute(PDO::ATTR_ERRMODE,
PDO::ERRMODE_EXCEPTION);
               $sql =  "UPDATE `book`  
        SET `book_name` = :book_name,
            `book_price` = :book_price,
            `book_quantity` = :book_quantity,
            `book_author` = :book_author,
            `book_publisher` = :book_publisher,
            `book_category` = :book_category,
            `book_isbn` = :book_isbn,
            `book_edition` = :book_edition ,
            `book_description` = :book_description
            WHERE `book_code` = :book_code";
               
                $statement = $con->prepare($sql);
                $statement->bindValue(":book_name", $name);
                $statement->bindValue(":book_price", $price);
                $statement->bindValue(":book_quantity", $quantity);
                $statement->bindValue(":book_author", $author);
                $statement->bindValue(":book_publisher",
$publisher);
                $statement->bindValue(":book_category", $category);
                $statement->bindValue(":book_isbn", $isbn);
                $statement->bindValue(":book_edition", $edition);
                $statement->bindValue(":book_description",
$description);
                $statement->bindValue(":book_code", $code);
                $cont = $statement->execute();
                echo("<script>alert('Book updated
successfully');</script>");
                header("Location: booktable.php");

               }catch(PDOException $e) {echo $e->getMessage();}


           
        }
   

?>

<?php
    $id = $_REQUEST['id'];
    $query = $con->prepare('SELECT * FROM book WHERE book_code
= :id');
    if (!$query) return false;
    if (!$query->execute(array(':id' => $id))) return false;
    $results = $query->fetchAll(\PDO::FETCH_ASSOC);
    if (empty($results)) return false;
    foreach ($results as $row){
    $code2 = $row['book_code'];
    $name2 = $row['book_name'];
    $price2 = $row['book_price'];
    $quantity2 = $row['book_quantity'];
    $author2 = $row['book_author'];
    $publisher2 = $row['book_publisher'];
    $category2 = $row['book_category'];
    $img = $img2 = $row['book_img'];
    $isbn2 = $row['book_isbn'];
    $edition2 = $row['book_edition'];
    $description2 = $row['book_description'];
    }

    $con = null;

?>

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-
scale=1.0">
    <title>Admin</title>
    <link rel="stylesheet" href="./css/adminindex.css">
    <script src="./js/editbook.js"></script>
   
   
</head>
<body>
    <div class="container">
        <div class="side-menus">
            <img src="./icons/logo.png" alt="">
            <ul class="menus">
            <a href="adminhome.php"><li>Home</li></a>
                <a href="adminindex.php"><li>Add Book</li></a>
                <a href="booktable.php"><li>Book Table</li></a>
                <a href="orderstable.php"><li>Orders</li></a>
                <a href="customertable.php"><li>Customer</li></a>
                <a href="adminlogout.php"><li>Log Out</li></a>
           
            </ul>

        </div>
        <div class="main">
            <div class="title">
                <h1>2</h1>
                <h2>Edit Book</h2>
            </div>

            <div class="main-content">
                <h4>Book Details :</h4>
                <hr class='line'>
                <form name="details-form" id="details-form"
action="editbook.php" method="POST" onsubmit="return
validateForm();"  enctype="multipart/form-data">
                    <input type="hidden" id="book-code" name="book-
code" placeholder="Book Code" value="<?php echo isset($code2) ?
$code2 : ''; ?>">  
                   
                    <label for="book-name">Book Name :-<span
id="errorname"></span></label>
                    <input type="text" id="book-name" name="book-
name" placeholder="Book Name" value="<?php echo isset($name2) ?
$name2 : ''; ?>" required>  
                   
                    <label for="book-isbn">ISBN No. :-<span
id="errorisbn"></span></label>
                    <input type="text" id="book-isbn" name="book-
isbn" placeholder="Book ISBN No." value="<?php echo isset($isbn2) ?
$isbn2 : ''; ?>" required>  
                   
                    <label for="book-edition">Edition :-<span
id="erroredition"></span></label>
                    <input type="text" id="book-edition" name="book-
edition" placeholder="Book Edition" value="<?php echo
isset($edition2) ? $edition2 : ''; ?>" required>  
                   

                    <label for="book-price">Book Price :-<span


id="errorprice"></span></label>
                    <input type="number" id="book-price" name="book-
price" placeholder="Book price" value="<?php echo isset($price2) ?
$price2 : ''; ?>" required >  
                   
                    <label for="book-quantity">Book Quantity :-<span
id="errorquantity"></span></label>
                    <input type="number" id="book-quantity"
name="book-quantity" placeholder="Book Quantity" value="<?php echo
isset($quantity2) ? $quantity2 : ''; ?>" required>
                    <label for="book-author">Book Author:-<span
id="errorauthor"></span></label>
                    <input type="text" id="book-author" name="book-
author" placeholder="Book Author" value="<?php echo
isset($author2) ? $author2 : ''; ?>" required>  
                   
                    <label for="book-publiher">Book Publisher :-
<span id="errorpublisher"></span></label>
                    <input type="text" id="book-publisher"
name="book-publisher" placeholder="Book Publisher" value="<?php echo
isset($publisher2) ? $publisher2 : ''; ?>" required>  
                   
                    <label for="category">Book Category :-<span
id="errorcategory"></span></label>
                    <select name="category" id="category" required>
                   
                    <option value="<?php echo isset($category2) ?
$category2 : ''; ?> " selected > <?php echo isset($category2) ?
$category2 : ''; ?></option>
                    <option value="Action and Adventure">Action and
Adventure</option>
                    <option value="Classics">Classics</option>
                    <option value="Comic Book or Graphic
Novel">Comic Book or Graphic Novel</option>
                    <option value="Detective and Mystery">Detective
and Mystery</option>
                    <option value="Fantasy">Fantasy</option>
                    <option value="Historical Fiction">Historical
Fiction</option>
                    <option value="Horror">Horror</option>
                    <option value="Literary Fiction">Literary
Fiction</option>
                    <option value="Romance">Romance</option>
                    <option value="Science Fiction (Sci-Fi)">Science
Fiction (Sci-Fi)</option>
                    <option value="Short Stories">Short
Stories</option>
                   
                    </select>

                    <label for="book-img">Book Image :-<span


id="errorimg"></span></label>
                    <input type="file" id="book-img" name="book-img"
placeholder="Book img" >  
                 
                   
                    <label for="description">Book Description :-
<span id="errordescription"></span></label>
                    <textarea name="description" id="" cols="65"
rows="6" form="details-form" required><?php echo
isset($description2) ? $description2 : ''; ?></textarea>
                   
                   
                    <input id="submit" name="submit" type="submit"
value="UPDATE BOOK">
                    <input id="reset" type="reset" value="RESET">
                </form>
            </div>

        </div>
    </div>
</body>
</html>

7. index.php

<?php
    include_once('config.php');
?>

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-
scale=1.0">
   
    <link rel="stylesheet" href="./css/index.css">
    <link rel="stylesheet" href="./css/displaybook.css">

    <script src="./js/jquery.js"></script>
    <script src="./js/ajex.js"></script>
   
    <title>Book Store</title>

</head>
<body>
    <!-- Navbar -->
    <?php
        include_once('navbar.php');
    ?>
    <!-- Navbar -->

    <!-- Start Main -->

    <div class="body-container">
        <div class="sidebar">
            <img src="./icons/banner2.jpg" alt="" class="banner2">
        </div>
        <div class="book-container">
        <div class="slider">
            <div id="img">
                <img src="./icons/slider1.jpg" alt="">
            </div>
        </div>
        <h1>I LOVE BOOKS</h1><hr>
        <?php
            $uresult = $con->query("SELECT * FROM book LIMIT 30");
            if ($uresult) {
                while ($row = $uresult->fetch(PDO::FETCH_ASSOC)) {
                    $quantity = $row['book_quantity'];
                    echo "<div class='product_wrapper'
id='product_wrapper'>
                        <form method='GET' action='bookdetails.php'>
                        <input type='hidden' name='book-code'
value=".$row['book_code']." />
                        <div class='image'><a
href='./bookdetails.php?book-code=".$row['book_code']."'><img
src='uploads/".$row['book_img']."' /></a></div>
                        <div class='book-name'>".
$row['book_name']."</div>
                        <div class='book-price'>Rs ".
$row['book_price']."</div>
                        <div class='book-
author'>Author:&nbsp;&nbsp;".$row['book_author']."</div>"
                        ;
                        if($quantity>0){
                        echo "<button type='submit' id='submit'
name='submit' class='buy'>Buy & View</button>
                        </form>
                        </div>";}else{
                            echo "<button  disabled name='submit'
class='unavailable'>Unavailable</button>
                            </form>
                            </div>";
                            }
                }
            }
        ?>
        </div>
    </div>

    <!-- End Main -->

    <!-- Footer -->


    <?php
        include_once('footer.php');
    ?>
    <!-- Footer -->

    <script src="./js/slider.js"></script>
    <script src="./js/checklogin.js"></script>

</body>
</html>

8. login.php

<?php
    include_once("config.php");
    if(isset($_POST['register'])){
        $name = isset($_POST['name2']) ? $_POST['name2'] : '';
        $email = isset($_POST['email-id2']) ? $_POST['email-id2'] :
'';
        $password = isset($_POST['password2']) ? $_POST['password2']
: '';

        $query = "select * from `customer` where `email`=:email";


        $stmt = $con->prepare($query);
        $stmt->bindParam('email', $email, PDO::PARAM_STR);
        $stmt->execute();
        $count= $stmt->rowCount();
        $row = $stmt->fetch(PDO::FETCH_ASSOC);
        if($count == 1){
            echo("<script>alert('Sorry email id already
exist');</script>");
       
        }else{
        $sql = "INSERT INTO customer (name, email, password) VALUES
(?,?,?)";
        $stmt= $con->prepare($sql);
        $stmt->execute([$name, $email , $password]);
        echo("<script>alert('Registration
successfully');</script>");
        }      
    }

    //****login****//

    if (isset($_POST['login'])){

        $email = isset($_POST['email-id']) ? $_POST['email-id'] :


'';
        $password = isset($_POST['password']) ? $_POST['password'] :
'';
        $query = "select * from `customer` where `email`=:email and
`password` = :password";
        $stmt = $con->prepare($query);
        $stmt->bindParam('email', $email, PDO::PARAM_STR);
        $stmt->bindParam('password', $password, PDO::PARAM_STR);
        $stmt->execute();
        $count= $stmt->rowCount();
        $row = $stmt->fetch(PDO::FETCH_ASSOC);
   
        if($count==1){
            session_start();
            $_SESSION['customer_id'] = $row['customer_id'];
            $_SESSION['customer_name'] = $row['name'];
            echo "<script>alert('Login_succeed');</script>";
            header("Location: displaybook.php");
        }else{
            echo "<script>alert('Incorrect email id or
password');</script>";
        }
    }    

?>

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-
scale=1.0">
    <link rel="stylesheet" href="./css/index.css">
    <link rel="stylesheet" href="./css/login.css">
    <script src="./js/jquery.js"></script>
    <script src="./js/ajex.js"></script>
    <script src="./js/register.js"></script>

   
   
   
    <title>Book Store</title>

</head>
<body>
    <!-- Navbar -->
    <?php
        include_once('navbar.php');
    ?>
    <!-- Navbar -->

    <!-- Start Main -->

    <div class="body-container">
       
        <div class="book-container">
        <div class="book-container3">
            <div class="login-div">
                <h3>Login</h3>
                <form action="" method="POST"
enctype="multipart/form-data">
                    <input type="text" name="email-id"
placeholder="Email ID" required>
                    <input type="password" name="password"
placeholder="Password" required>
                    <input type="submit" class="button"
name="login"value="Login">
                </form>

            </div>
            <div class="register-div">
            <h3>Register</h3>
            <form name="details-form" id="details-form" action=""
method="POST" onsubmit="return validation();"
enctype="multipart/form-data">
                    <input type="text" name="name2"
placeholder="Full Name" ><span id="error2"></span>
                    <input type="email" name="email-id2" id="email-
id" placeholder="Email ID" ><span id="error"></span>
                    <input type="password" name="password2"
placeholder="New Password" ><span id="error3" ></span>
                    <input class="button" type="submit"
name="register"value="Register">
                </form>
            </div>
     
            </div>
        </div>
        <div class="sidebar">
            <img src="./icons/banner2.jpg" alt="" class="banner2">
       
        </div>
    </div>

    <!-- End Main -->

    <!-- Footer -->


    <?php
        include_once('footer.php');
    ?>
    <!-- Footer -->

    <script src="./js/checklogin.js"></script>
   
</body>
</html>

9. orderstable.php

<?php
include_once('config.php');
session_start();;
if(isset($_SESSION['admin'])){
   
}else{
    header("Location: adminlogin.php");
    die();
}
?>

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-
scale=1.0">
    <title>Admin</title>
    <link rel="stylesheet" href="./css/adminindex.css">
    <link rel="stylesheet" href="./css/orderstable.css">
    <script src="./js/jquery.js"></script>
    <script src="./js/ajex.js"></script>
   
</head>
<body>
    <div class="container">
        <div class="side-menus">
            <img src="./icons/logo.png" alt="">
            <ul class="menus">
            <a href="adminhome.php"><li>Home</li></a>
                <a href="adminindex.php"><li>Add Book</li></a>
                <a href="booktable.php"><li>Book Table</li></a>
                <a href="orderstable.php"><li>Orders</li></a>
                <a href="customertable.php"><li>Customer</li></a>
                <a href="adminlogout.php"><li>Log Out</li></a>
           
            </ul>

        </div>
        <div class="main">
            <div class="title">
                <h1>4</h1>
                <h2>Orders Table</h2>
            </div>

            <div class="main-content">
            <div class="search-box">
            <input type="text" id="myInput" onkeyup="myFunction()"
placeholder="Order ID">
            <input type="text" id="myInput2" onkeyup="myFunction2()"
placeholder="Customer ID">
            <input type="text" id="myInput3" onkeyup="myFunction3()"
placeholder="Name">
            </div>
        <table id="myTable">
        <tr>
            <th>Order ID</th>
            <th>Customer ID</th>
            <th>Name</th>
      <th>Status</th>
            <th>Order Date</th>
            <th>FullView</th>
        </tr>
        <?php
       $stmt = $con->query("SELECT * FROM orders ");
       while ($res = $stmt->fetch()) {    
            echo "<tr>";
            echo "<td >".$res['order_id']."</td>";
            echo "<td >".$res['customer_id']."</td>";
            echo "<td >".$res['name']."</td>";
      echo "<td >".$res['status']."</td>";
            echo "<td >".$res['date1']."</td>";
            echo "<td id='fv'><a  href=\"orderlist.php?
id=$res[order_id]-$res[customer_id]\"><div
class='edit'>View/Edit</div></a> <a href=\"deleteorder.php?
id=$res[order_id]-$res[customer_id]\" onClick=\"return confirm('Are
you sure you want to delete?')\"><div
class='delete'>Delete</div></a></td>";
      echo "</tr>";
        }
        ?>
    </table>

            </div>

        </div>
    </div>

     <!-- Search Script -->


     
     <script>
function myFunction() {
  // Declare variables
  var input, filter, table, tr, td, i, txtValue;
  input = document.getElementById("myInput");
  filter = input.value.toUpperCase();
  table = document.getElementById("myTable");
  tr = table.getElementsByTagName("tr");
  // Loop through all table rows, and hide those who don't match the
search query
  for (i = 0; i < tr.length; i++) {
    td = tr[i].getElementsByTagName("td")[0];
    if (td) {
      txtValue = td.textContent || td.innerText;
      if (txtValue.toUpperCase().indexOf(filter) > -1) {
        tr[i].style.display = "";
      } else {
        tr[i].style.display = "none";
      }
    }
  }
}

function myFunction2() {
  // Declare variables
  var input, filter, table, tr, td, i, txtValue;
  input = document.getElementById("myInput2");
  filter = input.value.toUpperCase();
  table = document.getElementById("myTable");
  tr = table.getElementsByTagName("tr");

  // Loop through all table rows, and hide those who don't match the
search query
  for (i = 0; i < tr.length; i++) {
    td = tr[i].getElementsByTagName("td")[1];
    if (td) {
      txtValue = td.textContent || td.innerText;
      if (txtValue.toUpperCase().indexOf(filter) > -1) {
        tr[i].style.display = "";
      } else {
        tr[i].style.display = "none";
      }
    }
  }
}

function myFunction3() {
  // Declare variables
  var input, filter, table, tr, td, i, txtValue;
  input = document.getElementById("myInput3");
  filter = input.value.toUpperCase();
  table = document.getElementById("myTable");
  tr = table.getElementsByTagName("tr");
  // Loop through all table rows, and hide those who don't match the
search query
  for (i = 0; i < tr.length; i++) {
    td = tr[i].getElementsByTagName("td")[2];
    if (td) {
      txtValue = td.textContent || td.innerText;
      if (txtValue.toUpperCase().indexOf(filter) > -1) {
        tr[i].style.display = "";
      } else {
        tr[i].style.display = "none";
      }
    }
  }
}

</script>

</body>
</html>

10. orderlist.php

<?php
    include_once('config.php');

    session_start();;
if(isset($_SESSION['admin'])){
   
}else{
    header("Location: adminlogin.php");
    die();
}

    if(isset($_GET['id'])){  

        $value =explode("-",$_GET['id']);
        $customer_id = $value[1];
        $order_id = $value[0];

        if(isset($_POST['track'])){
            $change = $_POST['status'];
            try {
                     
                $con->exec("SET CHARACTER SET utf8");      // Sets
encoding UTF-8
                $con->setAttribute(PDO::ATTR_ERRMODE,
PDO::ERRMODE_EXCEPTION);
               $sql =  "UPDATE `orders`  
        SET `order_id` = :order_id,
            `customer_id` = :customer_id,
            `status` = :status
            WHERE `order_id` = :order_id and `customer_id`
= :customer_id";
               
                $statement = $con->prepare($sql);
                $statement->bindValue(":order_id", $order_id);
                $statement->bindValue(":customer_id", $customer_id);
                $statement->bindValue(":status", $change);
                $cont = $statement->execute();
                echo("<script>alert('Status updated
successfully');</script>");
       
   
               }catch(PDOException $e) {echo $e->getMessage();}
           
   
        }

     
       
        $query = $con->prepare('SELECT * FROM orders WHERE order_id
= :order_id and customer_id = :customer_id');
     

        if (!$query->execute(array(':order_id' => $order_id,


':customer_id' => $customer_id))) return false;
        $count= $query->rowCount();
        if ($count == 0){
            echo("<script>alert('ORDER NOT FOUND !');</script>");
       
   
        }else{

        $results = $query->fetchAll(\PDO::FETCH_ASSOC);
        if (empty($results)) return false;
       
        foreach ($results as $row){
            $status = $row['status'];
            $name = $row['name'];
            $address = $row['address'];
            $phone = $row['phone'];
            $mode = $row['mode'];
            $date = $row['date1'];

        }

    }

    }

?>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-
scale=1.0">
    <link rel="stylesheet" href="./css/index.css">
    <link rel="stylesheet" href="./css/track.css">
    <link rel="stylesheet" href="./css/orderlist.css">
    <script src="./js/jquery.js"></script>
    <script src="./js/ajex.js"></script>
   

    <title>My Online Book Store</title>

</head>
<body>
    <!-- Start Main -->

    <div class="body-container">
        <div class="sidebar">
            <h2>Change Status :</h2>
            <hr>
            <form action="" method="post" enctype="multipart/form-
data">

            <select name="status" id="status" required>


                   
                    <option value=""></option>
                    <option value="received">Received</option>
                    <option value="packed">Packed</option>
                    <option value="delivered">Delivered</option>
                    </select>
                  <input type="submit" id="track" value="UPDATE"
name="track">

            </form>
            <a href="orderstable.php"><button
id="back">BACK</button></a>
        </div>
        <div class="book-container">
            <div><h2>Order Status : <span id="tk"><?php echo
isset($status) ? $status : ''; ?></span></h2>
            <h2>Customer Name : <span><?php echo isset($name) ?
$name : ''; ?></span></h2>
            <h2>Delivery Address : <span><?php echo
isset($address) ? $address : ''; ?></span></h2>
            <h2>Phone No. : <span><?php echo isset($phone) ?
$phone : ''; ?></span></h2>
            <h2>Payment Mode : <span><?php echo isset($mode) ? $mode
: ''; ?></span></h2>
            <h2>Oreder Date : <span><?php echo isset($date) ?
$date : ''; ?></span></h2>
           
            </div>
            <div>
               

            <table id="myTable">
            <tr>
            <th>Book Name</th>
            <th>Book Code</th>
            <th>Price</th>
            <th>Quantity</th>
            <th>ITEM TOTAL</th>
        </tr>
        <?php
            $sub_total = 0;
            if(isset($order_id) && isset($customer_id)){
                $query = $con->prepare('SELECT * FROM cart WHERE
order_id = :order_id and customer_id = :customer_id');
     

                if (!$query->execute(array(':order_id' => $order_id,


':customer_id' => $customer_id))) return false;
                $results = $query->fetchAll(\PDO::FETCH_ASSOC);
                $count2= $query->rowCount();
                if($count2 != 0){
                if (empty($results)) return false;
                foreach ($results as $res){
                 echo "<tr>";
                 echo "<td id='code'>".$res['book_name']."</td>";
                 echo "<td id='name'>".$res['book_code']."</td>";
                 echo "<td id='name'>".$res['price']."</td>";

                 echo "<td id='price'>".$res['quantity']."</td>";


                 $sub_total +=$res['price']*$res['quantity'];
                 echo "<td id='quantity'>".
$res['price']*$res['quantity']."</td>";
             
                echo "</tr>";
            }
        }
         }
        ?>
    </table>
   
    <h1>Total Amount : Rs. <span><?php echo isset($sub_total) ?
$sub_total : ''; ?></span></h1>            
    <button id="print">Print Bill</button>            
               
            </div>
        </div>
    </div>

 
    <!-- End Main -->

</body>
</html>

11. about.php

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-
scale=1.0">
    <link rel="stylesheet" href="./css/index.css">
    <link rel="stylesheet" href="./css/about.css">
    <script src="./js/jquery.js"></script>
    <script src="./js/ajex.js"></script>
   

    <title>My Online Book Store</title>

</head>
<body>
    <!-- Navbar -->
    <?php
        include_once('navbar.php');
    ?>
    <!-- Navbar -->

    <!-- Start Main -->

    <div class="body-container">
        <div class="sidebar">
         <h2>Admin</h2>
         <hr>
            <h4>Name : Sumit Sharma</h4>
            <h4>Email ID : <a href = "mailto:
[email protected]" >[email protected]</a></h4>
            <h4>GitHub : <a href ="https://github.com/emsumit"
target="_blank">@emsumit</a></h4>
         <hr>
            <h4>Name : Arun Sharma</h4>
            <h4>Email ID : <a href = "mailto:
[email protected]">[email protected]</a></h4>
            <h4>GitHub : <a href ="https://github.com/arunsharma748"
target="_blank">@arunsharma748</a></h4>
        </div>
        <div class="book-container">
           <img src="./icons/slider1.jpg" alt="">
 
        </div>
    </div>

 
    <!-- End Main -->

    <!-- Footer -->


    <?php
        include_once('footer.php');
    ?>
    <!-- Footer -->

    <script src="./js/checklogin.js"></script>

</body>
</html>

12. cart.php

<?php
session_start();
$status="";
if (isset($_POST['action']) && $_POST['action']=="remove"){
if(!empty($_SESSION["shopping_cart"])) {
    foreach($_SESSION["shopping_cart"] as $key => $value) {
      if($_POST["code"] == $key){
      unset($_SESSION["shopping_cart"][$key]);
      }
      if(empty($_SESSION["shopping_cart"]))
      unset($_SESSION["shopping_cart"]);
      }
}
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=, initial-scale=1.0">
    <link rel="stylesheet" href="./css/cart.css">
    <title>Document</title>
</head>
<body>
<h2>Your Shopping Cart</h2>
<div class="cart">

<?php
if(isset($_SESSION["shopping_cart"])){
    $total_price = 0;
?>
<table style="text-align:center" class="table">
  <tbody>
    <tr id="heading_tr">
      <td></td>
      <td id="hname">BOOK NAME</td>
      <td style="text-align:center">QUANTITY</td>
      <td style="text-align:center">UNIT PRICE</td>
      <td style="text-align:center">ITEMS TOTAL</td>
    </tr>
    <?php
    foreach ($_SESSION["shopping_cart"] as $product){
    ?>
    <tr>
      <td>
        <img src='./uploads/<?php echo $product["img"]; ?>'
width="50" height="60" />
      </td>
      <td id="name_td"><?php echo $product["name"]; ?><br /></td>
      <td><?php echo $product["qnt"]; ?><br /></td>
      <td><?php echo "Rs. ".$product["price"]; ?></td>
      <td><?php echo "Rs. ".$product["total"]; ?></td>
      <td>
        <form method="post" action="">
          <input type='hidden' name='code' value="<?php echo
$product["code"]; ?>" />
          <input type="hidden" name="action" value="remove" />
          <button type="submit" class="remove"><img
src="./icons/remove.png" alt="" class="del" /></button>
        </form>
      </td>
    </tr>
    <?php
    $total_price += ($product["price"]*$product["qnt"]);
    }
    ?>
    <tr>
        <td></td>
        <td></td>
        <td></td>
        <td></td>
        <td style="text-align:center" >
        <strong
          >TOTAL:
          <?php echo "Rs. ".$total_price; ?>
        </strong>
        </td>
      <td >
       
      </td>
    </tr>
  </tbody>
</table>
  <?php
}else{
 echo "<h3>Your cart is empty!</h3>";
 }
?>
</div>
 
<div style="clear:both;"></div>
 
<div class="div_button">
    <a href="displaybook.php"><button class="button cint">Continue
Shopping</button></a>
    <a href="checkout.php"><button class="button
check">Checkout</button></a>
</div>

<div class="message_box" style="margin:10px 0px;">


<?php echo $status; ?>
</div>
</body>
</html>

13. checkout.php

<?php
include_once('config.php');

session_start();
if(isset($_SESSION["shopping_cart"]) &&
isset($_SESSION["customer_id"])) {
   
    if(!empty($_SESSION["shopping_cart"]) && !
empty($_SESSION["customer_id"])) {
       
    }else{ header("location:login.php");
      die();
    }

}else{header("location:login.php");
    die();
}

    if(isset($_POST['order'])){
   
        $name = isset($_POST['name']) ? $_POST['name'] : '';
        $customer_id = $_SESSION["customer_id"];
        $phone = isset($_POST['phone']) ? $_POST['phone'] : '';
        $address = isset($_POST['address']) ? $_POST['address'] :
'';
        $date = date("Y-m-d");
        $status = "order";
        $mode = isset($_POST['mode']) ? $_POST['mode'] : '';
        $card_no = !empty($_POST['card-no']) ? $_POST['card-no'] :
0;
        $security_code = !empty($_POST['security-code']) ?
$_POST['security-code'] : 'null  ';
        $card_name = !empty($_POST['card-name']) ? $_POST['card-
name'] : 'null';
 
        $sql = "INSERT INTO orders (customer_id, name, phone,
address, date1, status, mode, card_no, security_code, card_name)
VALUES (?,?,?,?,?,?,?,?,?,?)";
        $stmt= $con->prepare($sql);
        $stmt->execute([$customer_id, $name, $phone , $address,
$date, $status, $mode, $card_no, $security_code, $card_name]);
        $order_id = $con->lastInsertId();
        if($order_id != 0){

            foreach ($_SESSION["shopping_cart"] as $product){  


 
                $sql = "INSERT INTO cart (order_id, customer_id,
book_name, book_code, quantity, price) VALUES (?,?,?,?,?,?)";
                $stmt= $con->prepare($sql);
                $stmt->execute([$order_id, $customer_id,
$product["name"], $product["code"], $product["qnt"],
$product["price"]]);

                try {
                 
                    $con->exec("SET CHARACTER SET utf8");      //
Sets encoding UTF-8
                    $con->setAttribute(PDO::ATTR_ERRMODE,
PDO::ERRMODE_EXCEPTION);
                    $sql2 =  "UPDATE `book` SET
                    `book_code` = :book_code,
                    `book_quantity` = :book_quantity
                    WHERE `book_code` = :book_code";
                    $statement = $con->prepare($sql2);
                    $qm = ((int)$product["qnt2"])-((int)
$product["qnt"]);
                    $statement->bindValue(":book_code",
$product["code"]);
                    $statement->bindValue(":book_quantity", $qm);
                    $cont = $statement->execute();
           
                   }catch(PDOException $e) {echo $e->getMessage();}
         
            }
       
            $reciept = "<h1>Order Reciept</h1>
            <table class='rtab'>
            <tr>
            <td><h5>Order id </td><td style='width:25px'>: </td>
<td>$order_id</h5></td>
            </tr>
            <tr>
            <td><h5>Customer id </td><td style='width:25px'>: </td>
<td>$customer_id</h5></td>
            </tr>
            <tr>
            <td><h5>Phone No. </td><td style='width:25px'>: </td>
<td>$phone</h5></td>
            </tr>
            <tr>
            <td><h5>Address </td><td style='width:25px'>: </td>
<td>$address</h5></td>
            </tr>
            <tr>
            <td><h5>Order Date </td><td style='width:25px'>: </td>
<td>$date</h5></td>
            </tr>
            </table>
            <button>Print & Save</button><a
href='index.php'><button>Home Page</button>";
            echo("<script>alert('Order successfully');</script>");
            $_SESSION["shopping_cart"] = "";
        }
   

    }

?>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-
scale=1.0">
    <link rel="stylesheet" href="./css/checkout.css">
    <script src="./js/checkout.js"></script>
    <title>Order Details</title>
</head>
<body>
    <div id="reciept">
    <?php echo isset($reciept) ? $reciept : ''; ?>
    <?php if (isset($reciept)){ die(); } ?>

    </div>
    <div class="order_form">
   
        <h4>Order Details</h4>
        <hr>
        <form name="details-form" id="details-form" action=""
method="POST" onsubmit="return validateForm();"
enctype="multipart/form-data">
            <label for="name">Name : <span
id="error1"></span></label>
            <input type="text" name="name">
            <label for="phone">Phone No. :<span
id="error2"></span></label>
            <input type="number" name="phone" >
             <label for="address">Delivert Address :<span
id="error3"></span></label>
            <input type="text" name="address">
            <label for="mode">Payment Mode :<span
id="error4"></span></label>
            <select name="mode" id="mode">
                <option value=""></option>
                <option value="Debit Card">Debit Card</option>
                <option value="Cash On Delivery">Cash On
Delivery</option>
            </select>
            <h4>Debit Card Details</h4>
            <hr>
            <label for="card-no">Card Number. :<span
id="error5"></span></label>
            <input type="number" name="card-no">
            <label for="security-code">Security Code. :<span
id="error6"></span></label>
            <input type="text" name="security-code">
            <label for="card-name">Name on card. :<span
id="error7"></span></label>
            <input type="text" name="card-name">
           

            <input class="button submit" type="submit" name="order"


value="Order">
        </form>
        <a href="index.php"><button class="button
cancel">Cancel</button></a>
    </div>
   
</body>
</html>

14. displaybook.php

<?php
    include_once('config.php');
?>

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-
scale=1.0">
    <link rel="stylesheet" href="./css/index.css">
    <link rel="stylesheet" href="./css/displaybook.css">
    <title>My Online Book Store</title>
    <script src="./js/jquery.js"></script>  
    <script src="./js/ajex.js"></script>

</head>
<body>
    <!-- Navbar -->
    <?php
        include_once('navbar.php');
    ?>
    <!-- Navbar -->

    <!-- Start Main -->

    <div class="body-container">
    <div class="book-sidebar">
        <div class="price-filter">
            <input id="search-value" type="text" placeholder="Book
Name">
            <button id="search-btn"
onclick="searchButton()">Search</button>
            <h3>Price Filter</h3>  
            <label for="">Minimum price: Rs <span
id='minimum'>1</span></label>
            <input type="range" min="1" max="9999" value="1"
class="slider" id="myRange">
            <label for="">Maximum price: Rs <span
id='maximum'>9999</span></label>
            <input type="range" min="1" max="9999" value="9999"
class="slider" id="myRange2">
           
        </div>
       
                <label id='category-label' for="category-
filter">Filter by Category</label>
                <select name="category-filter" id="category-filter"
onChange="categoryFilter()">
                    <option value=""></option>
                    <option value="Action and Adventure">Action and
Adventure</option>
                    <option value="Classics">Classics</option>
                    <option value="Comic Book or Graphic
Novel">Comic Book or Graphic Novel</option>
                    <option value="Detective and Mystery">Detective
and Mystery</option>
                    <option value="Fantasy">Fantasy</option>
                    <option value="Historical Fiction">Historical
Fiction</option>
                    <option value="Horror">Horror</option>
                    <option value="Literary Fiction">Literary
Fiction</option>
                    <option value="Romance">Romance</option>
                    <option value="Science Fiction (Sci-Fi)">Science
Fiction (Sci-Fi)</option>
                    <option value="Short Stories">Short
Stories</option>
                   
                    </select>
                    <button id="apply"
onclick="categoryFilter()">Apply</button>
    </div>
        <div class="book-container">
            <h2 id="category-title">All Types Books</h2>
            <hr id='line-title'>
            <div class="book-container2">  
        <?php
            $uresult = $con->query("SELECT * FROM book LIMIT 30");
            if ($uresult) {
                while ($row = $uresult->fetch(PDO::FETCH_ASSOC)) {
                    $quantity = $row['book_quantity'];
                    echo "<div class='product_wrapper'
id='product_wrapper'>
                        <form method='GET' action='bookdetails.php'>
                        <input type='hidden' name='book-code'
value=".$row['book_code']." />
                        <div class='image'><a
href='./bookdetails.php?book-code=".$row['book_code']."'><img
src='uploads/".$row['book_img']."' /></a></div>
                        <div class='book-name'>".
$row['book_name']."</div>
                        <div class='book-price'>Rs ".
$row['book_price']."</div>
                        <div class='book-
author'>Author:&nbsp;&nbsp;".$row['book_author']."</div>"
                        ;
                        if($quantity>0){
                        echo "<button type='submit' id='submit'
name='submit' class='buy'>Buy & View</button>
                        </form>
                        </div>";}else{
                            echo "<button  disabled name='submit'
class='unavailable'>Unavailable</button>
                            </form>
                            </div>";
                            }
                }
            }
        ?>
        </div>
     </div>
     </div>   <!-- End Main -->  
     
     <!-- Footer -->
    <?php
        include_once('footer.php');
    ?>
    <!-- Footer -->

    <script src="./js/categoryfilter.js"></script>
    <script src="./js/checklogin.js"></script>
   
</body>
</html>

15. trackorder.php

<?php
    include_once('config.php');

    session_start();
    if(isset($_POST['track'])){

    if(isset($_SESSION["customer_id"])){

        $customer_id = $_SESSION["customer_id"];
        $order_id = isset($_POST['order-id']) ? $_POST['order-id'] :
'';
        $query = $con->prepare('SELECT * FROM orders WHERE order_id
= :order_id and customer_id = :customer_id');
     

        if (!$query->execute(array(':order_id' => $order_id,


':customer_id' => $customer_id))) return false;
        $count= $query->rowCount();
        if ($count == 0){
            echo("<script>alert('ORDER NOT FOUND !');</script>");
       
   
        }else{

        $results = $query->fetchAll(\PDO::FETCH_ASSOC);
        if (empty($results)) return false;
       
        foreach ($results as $row){
            $status = $row['status'];
            $name = $row['name'];
            $address = $row['address'];
            $phone = $row['phone'];
            $mode = $row['mode'];
            $date = $row['date1'];
        }

    }

    }else{
        echo("<script>alert('Please First Login !');</script>");
    }

    }

?>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-
scale=1.0">
    <link rel="stylesheet" href="./css/index.css">
    <link rel="stylesheet" href="./css/track.css">
    <script src="./js/jquery.js"></script>
    <script src="./js/ajex.js"></script>
   

    <title>My Online Book Store</title>

</head>
<body>
    <!-- Navbar -->
    <?php
        include_once('navbar.php');
    ?>
    <!-- Navbar -->

    <!-- Start Main -->

    <div class="body-container">
        <div class="sidebar">
            <h2>Track Order :</h2>
            <hr>
            <form action="" method="post" enctype="multipart/form-
data">

                <input type="number" name="order-id"


placeholder="Order ID" required>
                <input type="submit" id="track" value="Track"
name="track">

            </form>
        </div>
        <div class="book-container">
            <div><h2>Order Status : <span id="tk"><?php echo
isset($status) ? $status : ''; ?></span></h2>
            <h2>Customer Name : <span><?php echo isset($name) ?
$name : ''; ?></span></h2>
            <h2>Delivery Address : <span><?php echo
isset($address) ? $address : ''; ?></span></h2>
            <h2>Phone No. : <span><?php echo isset($phone) ?
$phone : ''; ?></span></h2>
            <h2>Payment Mode : <span><?php echo isset($mode) ? $mode
: ''; ?></span></h2>
            <h2>Order Date : <span><?php echo isset($date) ? $date :
''; ?></span></h2>
            </div>
            <div>
               

            <table id="myTable">
            <tr>
            <th style="text-align:left;">Book Name</th>
            <th style="text-align:center;">Price</th>
            <th style="text-align:center;">Quantity</th>
            <th style="text-align:center;">Item Total</th>
        </tr>
        <?php
            $sub_total = 0;
            if(isset($order_id) && isset($customer_id)){
                $query = $con->prepare('SELECT * FROM cart WHERE
order_id = :order_id and customer_id = :customer_id');
     

                if (!$query->execute(array(':order_id' => $order_id,


':customer_id' => $customer_id))) return false;
                $results = $query->fetchAll(\PDO::FETCH_ASSOC);
                $count2= $query->rowCount();
                if($count2 != 0){
                if (empty($results)) return false;
                foreach ($results as $res){
                 echo "<tr>";
                 echo "<td style='text-align:left;' id='code'>".
$res['book_name']."</td>";
                 echo "<td style='text-align:center;' id='name'>".
$res['price']."</td>";

                 echo "<td style='text-align:center;' id='price'>".


$res['quantity']."</td>";
                 $sub_total +=$res['price']*$res['quantity'];
                 echo "<td style='text-align:center;'
id='quantity'>".$res['price']*$res['quantity']."</td>";
             
                echo "</tr>";
            }
        }
         }
        ?>
    </table>

    <h1>Total Amount : Rs. <span><?php echo isset($sub_total) ?


$sub_total : ''; ?></span></h1>            
               
               
            </div>
        </div>
    </div>

    <!-- End Main -->

    <!-- Footer -->


    <?php
        include_once('footer.php');
    ?>
    <!-- Footer -->

   
    <script src="./js/checklogin.js"></script>

</body>
</html>

16. addtocart.php
<?php
    session_start();
 
    $name = isset($_POST['name']) ? $_POST['name'] : '';
    $code = isset($_POST['code']) ? $_POST['code'] : '';
    $qnt = isset($_POST['qnt']) ? $_POST['qnt'] : '';
    $qnt2 = isset($_POST['qnt2']) ? $_POST['qnt2'] : '';
    $price = isset($_POST['price']) ? $_POST['price'] : '';
    $img = isset($_POST['img']) ? $_POST['img'] : '';
    $total = isset($_POST['total']) ? $_POST['total'] : '';

    //echo $name.$code.$qnt.$price.$img.$total;

    $cartArray = array(
     $code=>array(
     'name'=>$name,
     'code'=>$code,
     'price'=>$price,
     'qnt'=>$qnt,
     'qnt2'=>$qnt2,
     'img'=>$img,
     'total'=>$total)
    );
     
    if(empty($_SESSION["shopping_cart"])) {
        $_SESSION["shopping_cart"] = $cartArray;
        echo "Book is added to your cart!";

    }else{
        $array_keys = array_keys($_SESSION["shopping_cart"]);
        if(in_array($code,$array_keys)) {
     echo "Book is already added to your cart!";
        } else {
        $_SESSION["shopping_cart"] = array_merge(
        $_SESSION["shopping_cart"],
        $cartArray
        );
     
       echo "Book is added to your cart!";
     }
     
     }
    ?>
17. bookcode.php

<?php
    include_once 'config.php';

    $bookCode=$_POST['bookCode'];
       
   
    $query = "select * from `book` where `book_code`=:book_code";
    $stmt = $con->prepare($query);
    $stmt->bindParam('book_code', $bookCode, PDO::PARAM_STR);
    $stmt->execute();
    $count= $stmt->rowCount();
    $row = $stmt->fetch(PDO::FETCH_ASSOC);
    if($count == 1 && !empty($row)){
        echo ('201')a;
    }
   
?>

18. deletebook.php

<?php
include_once("config.php");
$id=$_REQUEST['id'];
$sql = "DELETE FROM `book` WHERE book_code = ?";        
$q = $con->prepare($sql);
$response = $q->execute(array($id));
header("Location: booktable.php");

?>

19. bookdetails.php

<?php
    session_start();
    include_once("config.php");
    if(isset($_GET["book-code"]))
    {
       
$id = $_GET['book-code'];
$query = $con->prepare('SELECT * FROM book WHERE book_code = :id');
if (!$query) return false;
if (!$query->execute(array(':id' => $id))) return false;
$results = $query->fetchAll(\PDO::FETCH_ASSOC);
if (empty($results)) return false;
foreach ($results as $row){
$code2 = $row['book_code'];
$name2 = $row['book_name'];
$price2 = $row['book_price'];
$quantity2 = $row['book_quantity'];
$author2 = $row['book_author'];
$publisher2 = $row['book_publisher'];
$category2 = $row['book_category'];
$img = $img2 = $row['book_img'];
$isbn2 = $row['book_isbn'];
$edition2 = $row['book_edition'];
$description2 = $row['book_description'];
}

       
       
    }
   
?>

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-
scale=1.0">
    <link rel="stylesheet" href="./css/index.css">
 
    <link rel="stylesheet" href="./css/displaybook.css">
    <link rel="stylesheet" href="./css/bookdetails.css">
    <script src="./js/jquery.js"></script>
    <script src="./js/ajex.js"></script>
    <script src="./js/bookdetails.js"></script>
   
   
    <title>My Online Book Store</title>

</head>
<body>
    <!-- Start Main Navbar -->
    <nav class='nav-container'>
        <div class="logo">
            <a href="index.php"> <img src="./icons/logo.png" alt="">
</a>
        </div>  
        <div class="menu1">
          <ul>
          <a href="index.php"><li>Home</li></a>
              <a href="displaybook.php"><li>Books</li></a>
              <a href="trackorder.php"><li>Track Order</li></a>
              <a href="about.php"><li>About & Help</li></a>
             
          </ul>

        </div>
        <div class="cart">
            <div id="login-div"> </div>
            <a href="cart.php">
           <div class="cart_div">
           <img src="./icons/cart_icon.png" />
            </div></a>
        </div>
    </nav>
    <!-- End Main Navbar -->

    <!-- Start Main -->

    <div class="body-container">
       
        <div class="book-container">
            <div class="details-container">
                <div class="container1">
                    <div class="img">
                        <img id ="img" src="./uploads/<?php echo
isset($img2) ? $img2 : ''; ?>" alt="">
                    </div>
                    <div class="details">
                        <label for="">Name : <span id="span_Id"><?
php echo isset($name2) ? $name2 : ''; ?></span></label>
                        <label for="">Pricer : <span>Rs <?php echo
isset($price2) ? $price2 : ''; ?></span></label>
                        <label for="">Author : <span><?php echo
isset($author2) ? $author2 : ''; ?></span></label>
                        <label for="">Publisher : <span><?php echo
isset($publisher2) ? $publisher2 : ''; ?></span></label>
                        <label for="">ISBN No. : <span><?php echo
isset($isbn2) ? $isbn2 : ''; ?></span></label>
                        <label for="">Edition : <span><?php echo
isset($edition2) ? $edition2 : ''; ?></span></label>
                       
                        <label id="qntl"for="qnt">Quantity : <span
id="qntspan"></span></label>
                        <input id ="qnt" name="qnt" type="number"
value=1  placeholder="Quantity">
                        <input id ="qnt2" name="qnt2" type="hidden"
value=<?php echo isset($quantity2) ? $quantity2 : ''; ?>>
                        <input id ="code" name="code" type="hidden"
value=<?php echo isset($code2) ? $code2 : ''; ?>>
                        <input id ="price" name="price"
type="hidden" value=<?php echo isset($price2) ? $price2 : ''; ?>>
                        <input id ="img5" name="img5" type="hidden"
value=<?php echo isset($img2) ? $img2 : ''; ?>>
                        <button id="add-cart"
onclick="checkQnt()">Add To Cart</button>
                    </div>
                </div>
                <div class="container2">
                    <h3>More About book :</h3>
                    <p><?php echo isset($description2) ?
$description2 : ''; ?></p>
                </div>
            </div>
       
        <h1>Related Books</h1>
        <hr>
        <?php

        $query = $con->prepare('SELECT * FROM book WHERE


book_category = :id');
        if (!$query) return false;
        if (!$query->execute(array(':id' => $category2))) return
false;
        $results = $query->fetchAll(\PDO::FETCH_ASSOC);
        if (empty($results)){
            echo '<img id="notfoundimg" width= "200px"
src="./icons/notfound.jpg" alt="">
            <h2 id="notfoundheading">Book not found on this price
range. Thank you!</h2>';
        }
        if (empty($results)) return false;
        foreach ($results as $row){
         
            $quantity = $row['book_quantity'];
                    echo "<div class='product_wrapper'
id='product_wrapper'>
                        <form method='GET' action='bookdetails.php'>
                        <input type='hidden' name='book-code'
value=".$row['book_code']." />
                        <div class='image'><a
href='./bookdetails.php?book-code=".$row['book_code']."'><img
src='uploads/".$row['book_img']."' /></a></div>
                        <div class='book-name'>".
$row['book_name']."</div>
                        <div class='book-price'>Rs ".
$row['book_price']."</div>
                        <div class='book-
author'>Author:&nbsp;&nbsp;".$row['book_author']."</div>"
                        ;
                        if($quantity>0){
                        echo "<button type='submit' id='submit'
name='submit' class='buy'>Buy & View</button>
                        </form>
                        </div>";}else{
                            echo "<button  disabled name='submit'
class='unavailable'>Unavailable</button>
                            </form>
                            </div>";
                        }
                           
                   
            }
        ?>

        </div>
        <div class="sidebar">
            <img src="./icons/banner2.jpg" alt="" class="banner2">
        </div>
       
    </div>

    <!-- End Main -->

     <!-- Start Footer -->


    <?php
             include_once ('footer.php');
            ?>
   
 <!-- End Footer -->
 <script src="./js/checklogin.js"></script>
</body>
</html>

20. checksession.php

<?php
    session_start();
    if(isset($_SESSION['customer_id'])){
        echo $_SESSION['customer_id'];
    }else{ echo "201";}
?>

21. deletecustomer.php

<?php
include_once("config.php");
$id=$_GET['id'];
$sql = "DELETE FROM `customer` WHERE customer_id = ?";        
$q = $con->prepare($sql);
$response = $q->execute(array($id));
header("Location: customertable.php");
?>
22. login.php

<?php
    include_once("config.php");
    if(isset($_POST['register'])){
        $name = isset($_POST['name2']) ? $_POST['name2'] : '';
        $email = isset($_POST['email-id2']) ? $_POST['email-id2'] :
'';
        $password = isset($_POST['password2']) ? $_POST['password2']
: '';

        $query = "select * from `customer` where `email`=:email";


        $stmt = $con->prepare($query);
        $stmt->bindParam('email', $email, PDO::PARAM_STR);
        $stmt->execute();
        $count= $stmt->rowCount();
        $row = $stmt->fetch(PDO::FETCH_ASSOC);
        if($count == 1){
            echo("<script>alert('Sorry email id already
exist');</script>");
       
        }else{
        $sql = "INSERT INTO customer (name, email, password) VALUES
(?,?,?)";
        $stmt= $con->prepare($sql);
        $stmt->execute([$name, $email , $password]);
        echo("<script>alert('Registration
successfully');</script>");
        }      
    }

    //****login****//

    if (isset($_POST['login'])){

        $email = isset($_POST['email-id']) ? $_POST['email-id'] :


'';
        $password = isset($_POST['password']) ? $_POST['password'] :
'';
        $query = "select * from `customer` where `email`=:email and
`password` = :password";
        $stmt = $con->prepare($query);
        $stmt->bindParam('email', $email, PDO::PARAM_STR);
        $stmt->bindParam('password', $password, PDO::PARAM_STR);
        $stmt->execute();
        $count= $stmt->rowCount();
        $row = $stmt->fetch(PDO::FETCH_ASSOC);
   
        if($count==1){
            session_start();
            $_SESSION['customer_id'] = $row['customer_id'];
            $_SESSION['customer_name'] = $row['name'];
            echo "<script>alert('Login_succeed');</script>";
            header("Location: displaybook.php");
        }else{
            echo "<script>alert('Incorrect email id or
password');</script>";
        }
    }    

?>

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-
scale=1.0">
    <link rel="stylesheet" href="./css/index.css">
    <link rel="stylesheet" href="./css/login.css">
    <script src="./js/jquery.js"></script>
    <script src="./js/ajex.js"></script>
    <script src="./js/register.js"></script>

   
   
   
    <title>Book Store</title>

</head>
<body>
    <!-- Navbar -->
    <?php
        include_once('navbar.php');
    ?>
    <!-- Navbar -->

    <!-- Start Main -->

    <div class="body-container">
       
        <div class="book-container">
        <div class="book-container3">
            <div class="login-div">
                <h3>Login</h3>
                <form action="" method="POST"
enctype="multipart/form-data">
                    <input type="text" name="email-id"
placeholder="Email ID" required>
                    <input type="password" name="password"
placeholder="Password" required>
                    <input type="submit" class="button"
name="login"value="Login">
                </form>

            </div>
            <div class="register-div">
            <h3>Register</h3>
            <form name="details-form" id="details-form" action=""
method="POST" onsubmit="return validation();"
enctype="multipart/form-data">

                    <input type="text" name="name2"


placeholder="Full Name" ><span id="error2"></span>
                    <input type="email" name="email-id2" id="email-
id" placeholder="Email ID" ><span id="error"></span>
                    <input type="password" name="password2"
placeholder="New Password" ><span id="error3" ></span>
                    <input class="button" type="submit"
name="register"value="Register">
                </form>
            </div>
     
            </div>
        </div>
        <div class="sidebar">
            <img src="./icons/banner2.jpg" alt="" class="banner2">
       
        </div>
    </div>

    <!-- End Main -->

    <!-- Footer -->


    <?php
        include_once('footer.php');
    ?>
    <!-- Footer -->

    <script src="./js/checklogin.js"></script>
   
</body>
</html>

23. booktable.php

<?php
include_once('config.php');
session_start();;
if(isset($_SESSION['admin'])){
   
}else{
    header("Location: adminlogin.php");
    die();
}

?>

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-
scale=1.0">
    <title>Admin</title>
    <link rel="stylesheet" href="./css/adminindex.css">
    <link rel="stylesheet" href="./css/booktable.css">
    <script src="./js/jquery.js"></script>
    <script src="./js/ajex.js"></script>
   
</head>
<body>
    <div class="container">
        <div class="side-menus">
            <img src="./icons/logo.png" alt="">
            <ul class="menus">
            <a href="adminhome.php"><li>Home</li></a>
                <a href="adminindex.php"><li>Add Book</li></a>
                <a href="booktable.php"><li>Book Table</li></a>
                <a href="orderstable.php"><li>Orders</li></a>
                <a href="customertable.php"><li>Customer</li></a>
                <a href="adminlogout.php"><li>Log Out</li></a>
           
            </ul>
        </div>
        <div class="main">
            <div class="title">
                <h1>3</h1>
                <h2>Book Table</h2>
            </div>

            <div class="main-content">
            <div class="search-box">
            <input type="text" id="myInput" onkeyup="myFunction()"
placeholder="Code..">
            <input type="text" id="myInput2" onkeyup="myFunction2()"
placeholder="Search by names..">
            <input type="text" id="myInput3" onkeyup="myFunction3()"
placeholder="Search by category..">
            </div>

        <table id="myTable">
        <tr>
            <th>Book Code</th>
            <th>Book Name</th>
            <th>Image</th>
            <th>Price</th>
      <th>Quantity</th>
      <th>Category</th>
            <th>Edit & Delete</th>
        </tr>
        <?php
       $stmt = $con->query("SELECT * FROM book ");
       while ($res = $stmt->fetch()) {    
            echo "<tr>";
            echo "<td id='code'>".$res['book_code']."</td>";
            echo "<td id='name'>".$res['book_name']."</td>";
            echo "<td><img src='uploads/".
$res['book_img']."'></td>";
            echo "<td id='price'>".$res['book_price']."</td>";
      echo "<td id='quantity'>".$res['book_quantity']."</td>";
            echo "<td id='category'>".$res['book_category']."</td>";
            echo "<td><a  href=\"editbook.php?
id=$res[book_code]\"><div class='edit'>Edit</div></a> <a
href=\"deletebook.php?id=$res[book_code]\" onClick=\"return
confirm('Are you sure you want to delete?')\"><div
class='delete'>Delete</div></a></td>";
      echo "</tr>";
        }
        ?>
    </table>

            </div>

        </div>
    </div>

     <!-- Search Script -->


     
     <script>
function myFunction() {
  // Declare variables
  var input, filter, table, tr, td, i, txtValue;
  input = document.getElementById("myInput");
  filter = input.value.toUpperCase();
  table = document.getElementById("myTable");
  tr = table.getElementsByTagName("tr");

  // Loop through all table rows, and hide those who don't match the
search query
  for (i = 0; i < tr.length; i++) {
    td = tr[i].getElementsByTagName("td")[0];
    if (td) {
      txtValue = td.textContent || td.innerText;
      if (txtValue.toUpperCase().indexOf(filter) > -1) {
        tr[i].style.display = "";
      } else {
        tr[i].style.display = "none";
      }
    }
  }
}

function myFunction2() {
  // Declare variables
  var input, filter, table, tr, td, i, txtValue;
  input = document.getElementById("myInput2");
  filter = input.value.toUpperCase();
  table = document.getElementById("myTable");
  tr = table.getElementsByTagName("tr");

  // Loop through all table rows, and hide those who don't match the
search query
  for (i = 0; i < tr.length; i++) {
    td = tr[i].getElementsByTagName("td")[1];
    if (td) {
      txtValue = td.textContent || td.innerText;
      if (txtValue.toUpperCase().indexOf(filter) > -1) {
        tr[i].style.display = "";
      } else {
        tr[i].style.display = "none";
      }
    }
  }
}

function myFunction3() {
  // Declare variables
  var input, filter, table, tr, td, i, txtValue;
  input = document.getElementById("myInput3");
  filter = input.value.toUpperCase();
  table = document.getElementById("myTable");
  tr = table.getElementsByTagName("tr");

  // Loop through all table rows, and hide those who don't match the
search query
  for (i = 0; i < tr.length; i++) {
    td = tr[i].getElementsByTagName("td")[5];
    if (td) {
      txtValue = td.textContent || td.innerText;
      if (txtValue.toUpperCase().indexOf(filter) > -1) {
        tr[i].style.display = "";
      } else {
        tr[i].style.display = "none";
      }
    }
  }
}

</script>

</body>

</html>

24. config.php

<?php
    define("HOST","mysql:host=localhost;dbname=book_store");
    define("USERNAME","root");
    define("PASSWORD","");
   
    //Define PDO Connection
    try{
    $con = new PDO(HOST,USERNAME,PASSWORD);
    }
    catch(PDOException $ex){
        echo "Connection failed".$ex->getMessage();
    }
?>

25. deleteorder.php

<?php
include_once("config.php");
$value =explode("-",$_GET['id']);
$customer_id = $value[1];
$order_id = $value[0];

$sql = "DELETE FROM `cart` WHERE order_id = ? and customer_id = ?";


$q = $con->prepare($sql);
$response = $q->execute(array($order_id,$customer_id));

$sql2 = "DELETE FROM `orders` WHERE order_id = ? and customer_id


= ?";        
$q2 = $con->prepare($sql2);
$response = $q2->execute(array($order_id,$customer_id));

header("Location: orderstable.php");

?>

26. fetchbook.php

<?php
include('config.php'); //Database Connection
 
    $h =0;
    $h2 =0;
    $h3 =0;
    $h4 =0;
    $category = isset($_POST['category']) ? $_POST['category'] : '';
    $mini = isset($_POST['mini']) ? $_POST['mini'] : '';
    $maxi = isset($_POST['maxi']) ? $_POST['maxi'] : '';
    $notfound = 0;
    if (isset($_POST["category"]) && $category !=="") {
   
        $query = $con->prepare('SELECT * FROM book WHERE
book_category = :id');
        if (!$query) return false;
        if (!$query->execute(array(':id' => $category))) return
false;
        $results = $query->fetchAll(\PDO::FETCH_ASSOC);
        if (empty($results)){
            echo '<img id="notfoundimg" width= "200px"
src="./icons/notfound.jpg" alt="">
            <h2 id="notfoundheading">Book not found on this price
range. Thank you!</h2>';
        }
        if (empty($results)) return false;
        foreach ($results as $row){
            if($mini <= $row['book_price'] && $maxi >=
$row['book_price'] ){
            $quantity = $row['book_quantity'];
                    echo "<div class='product_wrapper'
id='product_wrapper'>
                        <form method='GET' action='bookdetails.php'>
                        <input type='hidden' name='book-code'
value=".$row['book_code']." />
                        <div class='image'><a
href='./bookdetails.php?book-code=".$row['book_code']."'><img
src='uploads/".$row['book_img']."' /></a></div>
                        <div class='book-name'>".
$row['book_name']."</div>
                        <div class='book-price'>Rs ".
$row['book_price']."</div>
                        <div class='book-
author'>Author:&nbsp;&nbsp;".$row['book_author']."</div>"
                        ;
                        if($quantity>0){
                        echo "<button type='submit' id='submit'
name='submit' class='buy'>Buy & View</button>
                        </form>
                        </div>";}else{
                            echo "<button  disabled name='submit'
class='unavailable'>Unavailable</button>
                            </form>
                            </div>";
                        }
                        $h++;    
                }  else {
                        $h2++;}
                   
            }
            if($h == 0 && $h2 != 0){
                echo '<img id="notfoundimg" width= "200px"
src="./icons/notfound.jpg" alt="">
                <h2 id="notfoundheading">Book not found on this
price range. Thank you!</h2>';
           
            }
           

    }else{   $query = $con->prepare('SELECT * FROM book limit 30');


        if (!$query) return false;
        if(!$query->execute())return false;
        $results = $query->fetchAll(\PDO::FETCH_ASSOC);
        if (empty($results)) return false;
        foreach ($results as $row){
            if($mini <= $row['book_price'] && $maxi >=
$row['book_price'] ){
            $quantity = $row['book_quantity'];
                    echo "<div class='product_wrapper'
id='product_wrapper'>
                        <form method='GET' action='bookdetails.php'>
                        <input type='hidden' name='book-code'
value=".$row['book_code']." />
                        <div class='image'><a
href='./bookdetails.php?book-code=".$row['book_code']."'><img
src='uploads/".$row['book_img']."' /></a></div>
                        <div class='book-name'>".
$row['book_name']."</div>
                        <div class='book-price'>Rs ".
$row['book_price']."</div>
                        <div class='book-
author'>Author:&nbsp;&nbsp;".$row['book_author']."</div>"
                        ;
                        if($quantity>0){
                        echo "<button type='submit' id='submit'
name='submit' class='buy'>Buy & View</button>
                        </form>
                        </div>";}else{
                            echo "<button  disabled name='submit'
class='unavailable'>Unavailable</button>
                            </form>
                            </div>";
                        }
                        $h3++;    
                    }  else {
                            $h4++;}
            }

            if($h3 == 0 && $h4 != 0){


                echo '<img id="notfoundimg" width= "200px"
src="./icons/notfound.jpg" alt="">
                <h2 id="notfoundheading">Book not found on this
price range. Thank you!</h2>';
           
            }
    }
   
?>

27. logout.php

<?php
session_start();
session_destroy();
header("location: index.php");
?>

28. packedorders.php

<?php
include_once('config.php');
session_start();;
if(isset($_SESSION['admin'])){
   
}else{
    header("Location: adminlogin.php");
    die();
}

?>

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-
scale=1.0">
    <title>Admin</title>
    <link rel="stylesheet" href="./css/adminindex.css">
    <link rel="stylesheet" href="./css/orderstable.css">
    <script src="./js/jquery.js"></script>
    <script src="./js/ajex.js"></script>
   
</head>
<body>
    <div class="container">
        <div class="side-menus">
            <img src="./icons/logo.png" alt="">
            <ul class="menus">
            <a href="adminhome.php"><li>Home</li></a>
                <a href="adminindex.php"><li>Add Book</li></a>
                <a href="booktable.php"><li>Book Table</li></a>
                <a href="orderstable.php"><li>Orders</li></a>
                <a href="customertable.php"><li>Customer</li></a>
                <a href="adminlogout.php"><li>Log Out</li></a>
           
            </ul>

        </div>
        <div class="main">
            <div class="title">
                <h1>7</h1>
                <h2>Packed Orders</h2>
            </div>

            <div class="main-content">
            <div class="search-box">
            <input type="text" id="myInput" onkeyup="myFunction()"
placeholder="Order ID">
            <input type="text" id="myInput2" onkeyup="myFunction2()"
placeholder="Customer ID">
            <input type="text" id="myInput3" onkeyup="myFunction3()"
placeholder="Name">
            </div>

        <table id="myTable">
        <tr>
            <th>Order ID</th>
            <th>Customer ID</th>
            <th>Name</th>
      <th>Status</th>
            <th>Order Date</th>
            <th>FullView</th>
        </tr>
        <?php
       $stmt = $con->query("SELECT * FROM orders where status=
'packed' ");
       while ($res = $stmt->fetch()) {    
            echo "<tr>";
            echo "<td >".$res['order_id']."</td>";
            echo "<td >".$res['customer_id']."</td>";
            echo "<td >".$res['name']."</td>";
      echo "<td >".$res['status']."</td>";
            echo "<td >".$res['date1']."</td>";
            echo "<td id='fv'><a  href=\"orderlist.php?
id=$res[order_id]-$res[customer_id]\"><div
class='edit'>View/Edit</div></a> <a href=\"deleteorder.php?
id=$res[order_id]-$res[customer_id]\" onClick=\"return confirm('Are
you sure you want to delete?')\"><div
class='delete'>Delete</div></a></td>";
      echo "</tr>";
        }
        ?>
    </table>

            </div>

        </div>
    </div>

     <!-- Search Script -->


     
     <script>
function myFunction() {
  // Declare variables
  var input, filter, table, tr, td, i, txtValue;
  input = document.getElementById("myInput");
  filter = input.value.toUpperCase();
  table = document.getElementById("myTable");
  tr = table.getElementsByTagName("tr");

  // Loop through all table rows, and hide those who don't match the
search query
  for (i = 0; i < tr.length; i++) {
    td = tr[i].getElementsByTagName("td")[0];
    if (td) {
      txtValue = td.textContent || td.innerText;
      if (txtValue.toUpperCase().indexOf(filter) > -1) {
        tr[i].style.display = "";
      } else {
        tr[i].style.display = "none";
      }
    }
  }
}

function myFunction2() {
  // Declare variables
  var input, filter, table, tr, td, i, txtValue;
  input = document.getElementById("myInput2");
  filter = input.value.toUpperCase();
  table = document.getElementById("myTable");
  tr = table.getElementsByTagName("tr");

  // Loop through all table rows, and hide those who don't match the
search query
  for (i = 0; i < tr.length; i++) {
    td = tr[i].getElementsByTagName("td")[1];
    if (td) {
      txtValue = td.textContent || td.innerText;
      if (txtValue.toUpperCase().indexOf(filter) > -1) {
        tr[i].style.display = "";
      } else {
        tr[i].style.display = "none";
      }
    }
  }
}

function myFunction3() {
  // Declare variables
  var input, filter, table, tr, td, i, txtValue;
  input = document.getElementById("myInput3");
  filter = input.value.toUpperCase();
  table = document.getElementById("myTable");
  tr = table.getElementsByTagName("tr");

  // Loop through all table rows, and hide those who don't match the
search query
  for (i = 0; i < tr.length; i++) {
    td = tr[i].getElementsByTagName("td")[2];
    if (td) {
      txtValue = td.textContent || td.innerText;
      if (txtValue.toUpperCase().indexOf(filter) > -1) {
        tr[i].style.display = "";
      } else {
        tr[i].style.display = "none";
      }
    }
  }
}

</script>

</body>
</html>

29. deliveredorders.php

<?php
include_once('config.php');
session_start();;
if(isset($_SESSION['admin'])){
   
}else{
    header("Location: adminlogin.php");
    die();
}

?>

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-
scale=1.0">
    <title>Admin</title>
    <link rel="stylesheet" href="./css/adminindex.css">
    <link rel="stylesheet" href="./css/orderstable.css">
    <script src="./js/jquery.js"></script>
    <script src="./js/ajex.js"></script>
   
</head>
<body>
    <div class="container">
        <div class="side-menus">
            <img src="./icons/logo.png" alt="">
            <ul class="menus">
            <a href="adminhome.php"><li>Home</li></a>
                <a href="adminindex.php"><li>Add Book</li></a>
                <a href="booktable.php"><li>Book Table</li></a>
                <a href="orderstable.php"><li>Orders</li></a>
                <a href="customertable.php"><li>Customer</li></a>
                <a href="adminlogout.php"><li>Log Out</li></a>
           
            </ul>

        </div>
        <div class="main">
            <div class="title">
                <h1>8</h1>
                <h2>Delivered Orders</h2>
            </div>

            <div class="main-content">
            <div class="search-box">
            <input type="text" id="myInput" onkeyup="myFunction()"
placeholder="Order ID">
            <input type="text" id="myInput2" onkeyup="myFunction2()"
placeholder="Customer ID">
            <input type="text" id="myInput3" onkeyup="myFunction3()"
placeholder="Name">
            </div>

        <table id="myTable">
        <tr>
            <th>Order ID</th>
            <th>Customer ID</th>
            <th>Name</th>
      <th>Status</th>
            <th>Order Date</th>
            <th>FullView</th>
        </tr>
        <?php
       $stmt = $con->query("SELECT * FROM orders where status=
'delivered' ");
       while ($res = $stmt->fetch()) {    
            echo "<tr>";
            echo "<td >".$res['order_id']."</td>";
            echo "<td >".$res['customer_id']."</td>";
            echo "<td >".$res['name']."</td>";
      echo "<td >".$res['status']."</td>";
            echo "<td >".$res['date1']."</td>";
            echo "<td id='fv'><a  href=\"orderlist.php?
id=$res[order_id]-$res[customer_id]\"><div
class='edit'>View/Edit</div></a> <a href=\"deleteorder.php?
id=$res[order_id]-$res[customer_id]\" onClick=\"return confirm('Are
you sure you want to delete?')\"><div
class='delete'>Delete</div></a></td>";
      echo "</tr>";
        }
        ?>
    </table>

            </div>

        </div>
    </div>

     <!-- Search Script -->


     
     <script>
function myFunction() {
  // Declare variables
  var input, filter, table, tr, td, i, txtValue;
  input = document.getElementById("myInput");
  filter = input.value.toUpperCase();
  table = document.getElementById("myTable");
  tr = table.getElementsByTagName("tr");

  // Loop through all table rows, and hide those who don't match the
search query
  for (i = 0; i < tr.length; i++) {
    td = tr[i].getElementsByTagName("td")[0];
    if (td) {
      txtValue = td.textContent || td.innerText;
      if (txtValue.toUpperCase().indexOf(filter) > -1) {
        tr[i].style.display = "";
      } else {
        tr[i].style.display = "none";
      }
    }
  }
}

function myFunction2() {
  // Declare variables
  var input, filter, table, tr, td, i, txtValue;
  input = document.getElementById("myInput2");
  filter = input.value.toUpperCase();
  table = document.getElementById("myTable");
  tr = table.getElementsByTagName("tr");

  // Loop through all table rows, and hide those who don't match the
search query
  for (i = 0; i < tr.length; i++) {
    td = tr[i].getElementsByTagName("td")[1];
    if (td) {
      txtValue = td.textContent || td.innerText;
      if (txtValue.toUpperCase().indexOf(filter) > -1) {
        tr[i].style.display = "";
      } else {
        tr[i].style.display = "none";
      }
    }
  }
}

function myFunction3() {
  // Declare variables
  var input, filter, table, tr, td, i, txtValue;
  input = document.getElementById("myInput3");
  filter = input.value.toUpperCase();
  table = document.getElementById("myTable");
  tr = table.getElementsByTagName("tr");

  // Loop through all table rows, and hide those who don't match the
search query
  for (i = 0; i < tr.length; i++) {
    td = tr[i].getElementsByTagName("td")[2];
    if (td) {
      txtValue = td.textContent || td.innerText;
      if (txtValue.toUpperCase().indexOf(filter) > -1) {
        tr[i].style.display = "";
      } else {
        tr[i].style.display = "none";
      }
    }
  }
}

</script>

</body>
</html>

30. fetchbook2.php

<?php
include('config.php'); //Database Connection
 
   
    $h5 =0;
    $h6 =0;

    $name = isset($_POST['searchValue']) ? $_POST['searchValue'] :


'';
     
        $uresult = $con->query("SELECT * FROM book");
 if ($uresult) {
    if($name !== ''){

            while ($row = $uresult->fetch(PDO::FETCH_ASSOC)) {


                    if(strpos(strtoupper($row["book_name"]),
strtoupper($name)) !== false){
                   
                     $quantity = $row['book_quantity'];
                    echo "<div class='product_wrapper'
id='product_wrapper'>
                    <form method='GET' action='bookdetails.php'>
                    <input type='hidden' name='book-code' value=".
$row['book_code']." />
                    <div class='image'><a href='./bookdetails.php?
book-code=".$row['book_code']."'><img src='uploads/".
$row['book_img']."' /></a></div>
                    <div class='book-name'>".
$row['book_name']."</div>
                    <div class='book-price'>Rs ".
$row['book_price']."</div>
                    <div class='book-author'>Author:&nbsp;&nbsp;".
$row['book_author']."</div>"
                    ;
                    if($quantity>0){
                    echo "<button type='submit' id='submit'
name='submit' class='buy'>Buy & View</button>
                    </form>
                    </div>";}else{
                        echo "<button  disabled name='submit'
class='unavailable'>Unavailable</button>
                        </form>
                        </div>";
                        }
                        $h5++;    
                    }  else {
                            $h6++;}
             }  
             if($h5 == 0 && $h6 != 0){
                echo '<img id="notfoundimg" width= "200px"
src="./icons/notfound.jpg" alt="">
                <h2 id="notfoundheading">Book not found. Thank you!
</h2>';
           
            }  
             
     } else{ $uresult = $con->query("SELECT * FROM book limit 30");
        while ($row = $uresult->fetch(PDO::FETCH_ASSOC)) {
           
             $quantity = $row['book_quantity'];
            echo "<div class='product_wrapper' id='product_wrapper'>
            <form method='GET' action='bookdetails.php'>
            <input type='hidden' name='book-code' value=".
$row['book_code']." />
            <div class='image'><a href='./bookdetails.php?book-
code=".$row['book_code']."'><img src='uploads/".
$row['book_img']."' /></a></div>
            <div class='book-name'>".$row['book_name']."</div>
            <div class='book-price'>Rs ".$row['book_price']."</div>
            <div class='book-author'>Author:&nbsp;&nbsp;".
$row['book_author']."</div>"
            ;
            if($quantity>0){
            echo "<button type='submit' id='submit' name='submit'
class='buy'>Buy & View</button>
            </form>
            </div>";}else{
                echo "<button  disabled name='submit'
class='unavailable'>Unavailable</button>
                </form>
                </div>";
                }
       
     }    

     }      

 }
?>
31. neworders.php

<?php
include_once('config.php');
session_start();;
if(isset($_SESSION['admin'])){
   
}else{
    header("Location: adminlogin.php");
    die();
}

?>

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-
scale=1.0">
    <title>Admin</title>
    <link rel="stylesheet" href="./css/adminindex.css">
    <link rel="stylesheet" href="./css/orderstable.css">
    <script src="./js/jquery.js"></script>
    <script src="./js/ajex.js"></script>
   
</head>
<body>
    <div class="container">
        <div class="side-menus">
            <img src="./icons/logo.png" alt="">
            <ul class="menus">
            <a href="adminhome.php"><li>Home</li></a>
                <a href="adminindex.php"><li>Add Book</li></a>
                <a href="booktable.php"><li>Book Table</li></a>
                <a href="orderstable.php"><li>Orders</li></a>
                <a href="customertable.php"><li>Customer</li></a>
                <a href="adminlogout.php"><li>Log Out</li></a>
           
            </ul>

        </div>
        <div class="main">
            <div class="title">
                <h1>5</h1>
                <h2>New Orders</h2>
            </div>

            <div class="main-content">
            <div class="search-box">
            <input type="text" id="myInput" onkeyup="myFunction()"
placeholder="Order ID">
            <input type="text" id="myInput2" onkeyup="myFunction2()"
placeholder="Customer ID">
            <input type="text" id="myInput3" onkeyup="myFunction3()"
placeholder="Name">
            </div>

        <table id="myTable">
        <tr>
            <th>Order ID</th>
            <th>Customer ID</th>
            <th>Name</th>
      <th>Status</th>
            <th>Order Date</th>
            <th>FullView</th>
        </tr>
        <?php
       $stmt = $con->query("SELECT * FROM orders where status=
'order' ");
       while ($res = $stmt->fetch()) {    
            echo "<tr>";
            echo "<td >".$res['order_id']."</td>";
            echo "<td >".$res['customer_id']."</td>";
            echo "<td >".$res['name']."</td>";
      echo "<td >".$res['status']."</td>";
            echo "<td >".$res['date1']."</td>";
            echo "<td id='fv'><a  href=\"orderlist.php?
id=$res[order_id]-$res[customer_id]\"><div
class='edit'>View/Edit</div></a> <a href=\"deleteorder.php?
id=$res[order_id]-$res[customer_id]\" onClick=\"return confirm('Are
you sure you want to delete?')\"><div
class='delete'>Delete</div></a></td>";
      echo "</tr>";
        }
        ?>
    </table>

            </div>

        </div>
    </div>

     <!-- Search Script -->


     
     <script>
function myFunction() {
  // Declare variables
  var input, filter, table, tr, td, i, txtValue;
  input = document.getElementById("myInput");
  filter = input.value.toUpperCase();
  table = document.getElementById("myTable");
  tr = table.getElementsByTagName("tr");

  // Loop through all table rows, and hide those who don't match the
search query
  for (i = 0; i < tr.length; i++) {
    td = tr[i].getElementsByTagName("td")[0];
    if (td) {
      txtValue = td.textContent || td.innerText;
      if (txtValue.toUpperCase().indexOf(filter) > -1) {
        tr[i].style.display = "";
      } else {
        tr[i].style.display = "none";
      }
    }
  }
}

function myFunction2() {
  // Declare variables
  var input, filter, table, tr, td, i, txtValue;
  input = document.getElementById("myInput2");
  filter = input.value.toUpperCase();
  table = document.getElementById("myTable");
  tr = table.getElementsByTagName("tr");

  // Loop through all table rows, and hide those who don't match the
search query
  for (i = 0; i < tr.length; i++) {
    td = tr[i].getElementsByTagName("td")[1];
    if (td) {
      txtValue = td.textContent || td.innerText;
      if (txtValue.toUpperCase().indexOf(filter) > -1) {
        tr[i].style.display = "";
      } else {
        tr[i].style.display = "none";
      }
    }
  }
}

function myFunction3() {
  // Declare variables
  var input, filter, table, tr, td, i, txtValue;
  input = document.getElementById("myInput3");
  filter = input.value.toUpperCase();
  table = document.getElementById("myTable");
  tr = table.getElementsByTagName("tr");

  // Loop through all table rows, and hide those who don't match the
search query
  for (i = 0; i < tr.length; i++) {
    td = tr[i].getElementsByTagName("td")[2];
    if (td) {
      txtValue = td.textContent || td.innerText;
      if (txtValue.toUpperCase().indexOf(filter) > -1) {
        tr[i].style.display = "";
      } else {
        tr[i].style.display = "none";
      }
    }
  }
}

</script>

</body>
</html>

32. recievedorders.php

<?php
include_once('config.php');
session_start();;
if(isset($_SESSION['admin'])){
   
}else{
    header("Location: adminlogin.php");
    die();
}

?>

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-
scale=1.0">
    <title>Admin</title>
    <link rel="stylesheet" href="./css/adminindex.css">
    <link rel="stylesheet" href="./css/orderstable.css">
    <script src="./js/jquery.js"></script>
    <script src="./js/ajex.js"></script>
   
</head>
<body>
    <div class="container">
        <div class="side-menus">
            <img src="./icons/logo.png" alt="">
            <ul class="menus">
            <a href="adminhome.php"><li>Home</li></a>
                <a href="adminindex.php"><li>Add Book</li></a>
                <a href="booktable.php"><li>Book Table</li></a>
                <a href="orderstable.php"><li>Orders</li></a>
                <a href="customertable.php"><li>Customer</li></a>
                <a href="adminlogout.php"><li>Log Out</li></a>
           
            </ul>

        </div>
        <div class="main">
            <div class="title">
                <h1>6</h1>
                <h2>Recieved Orders</h2>
            </div>

            <div class="main-content">
            <div class="search-box">
            <input type="text" id="myInput" onkeyup="myFunction()"
placeholder="Order ID">
            <input type="text" id="myInput2" onkeyup="myFunction2()"
placeholder="Customer ID">
            <input type="text" id="myInput3" onkeyup="myFunction3()"
placeholder="Name">
            </div>

        <table id="myTable">
        <tr>
            <th>Order ID</th>
            <th>Customer ID</th>
            <th>Name</th>
      <th>Status</th>
            <th>Order Date</th>
            <th>FullView</th>
        </tr>
        <?php
       $stmt = $con->query("SELECT * FROM orders where status=
'received' ");
       while ($res = $stmt->fetch()) {    
            echo "<tr>";
            echo "<td >".$res['order_id']."</td>";
            echo "<td >".$res['customer_id']."</td>";
            echo "<td >".$res['name']."</td>";
      echo "<td >".$res['status']."</td>";
            echo "<td >".$res['date1']."</td>";
            echo "<td id='fv'><a  href=\"orderlist.php?
id=$res[order_id]-$res[customer_id]\"><div
class='edit'>View/Edit</div></a> <a href=\"deleteorder.php?
id=$res[order_id]-$res[customer_id]\" onClick=\"return confirm('Are
you sure you want to delete?')\"><div
class='delete'>Delete</div></a></td>";
      echo "</tr>";
        }
        ?>
    </table>

            </div>

        </div>
    </div>

     <!-- Search Script -->


     
     <script>
function myFunction() {
  // Declare variables
  var input, filter, table, tr, td, i, txtValue;
  input = document.getElementById("myInput");
  filter = input.value.toUpperCase();
  table = document.getElementById("myTable");
  tr = table.getElementsByTagName("tr");

  // Loop through all table rows, and hide those who don't match the
search query
  for (i = 0; i < tr.length; i++) {
    td = tr[i].getElementsByTagName("td")[0];
    if (td) {
      txtValue = td.textContent || td.innerText;
      if (txtValue.toUpperCase().indexOf(filter) > -1) {
        tr[i].style.display = "";
      } else {
        tr[i].style.display = "none";
      }
    }
  }
}

function myFunction2() {
  // Declare variables
  var input, filter, table, tr, td, i, txtValue;
  input = document.getElementById("myInput2");
  filter = input.value.toUpperCase();
  table = document.getElementById("myTable");
  tr = table.getElementsByTagName("tr");

  // Loop through all table rows, and hide those who don't match the
search query
  for (i = 0; i < tr.length; i++) {
    td = tr[i].getElementsByTagName("td")[1];
    if (td) {
      txtValue = td.textContent || td.innerText;
      if (txtValue.toUpperCase().indexOf(filter) > -1) {
        tr[i].style.display = "";
      } else {
        tr[i].style.display = "none";
      }
    }
  }
}

function myFunction3() {
  // Declare variables
  var input, filter, table, tr, td, i, txtValue;
  input = document.getElementById("myInput3");
  filter = input.value.toUpperCase();
  table = document.getElementById("myTable");
  tr = table.getElementsByTagName("tr");

  // Loop through all table rows, and hide those who don't match the
search query
  for (i = 0; i < tr.length; i++) {
    td = tr[i].getElementsByTagName("td")[2];
    if (td) {
      txtValue = td.textContent || td.innerText;
      if (txtValue.toUpperCase().indexOf(filter) > -1) {
        tr[i].style.display = "";
      } else {
        tr[i].style.display = "none";
      }
    }
  }
}

</script>

</body>
</html>

33. footer.php

<!DOCTYPE html>
<html lang="en">
<head>
</head>
<body>
    <!-- Footer -->
    <section class="ezpz">
        <div>
        <img class="l" src="./icons/logo.png" alt="">
        <p>© Made by Rodiex Services LPP. </p>
        </div>    
    </section>
    <!-- Footer -->
</body>
</html>

34. about.css

h2 {
  margin: 20px;
  color: #a760ff;
}
hr {
  margin: 20px;
  color: #a760ff;
}
h4 {
  margin: 20px;
  color: gray;
}

.book-container img {
  width: -webkit-fill-available;
  height: 350px;
}
a {
  color: #a760ff;
}
a:hover {
  color: #ca82ff;
  cursor: grab;
}

35. adminindex.css

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: Arial, Helvetica, sans-serif;
}
body {
  width: 100%;
  background-color: #a760ff;
}

.container {
  width: 100%;
  display: flex;
  background-color: #a760ff;
}

.container .side-menus {
  width: 30%;
  height: 700px;
  padding: 20px;
  background-color: #a760ff;
}
.container .side-menus img {
  width: 100%;
  height: 170px;
}

#main1 {
  width: 70%;
  padding-left: 91px;
  padding-top: 272px;
  margin: -16px;
}

.container .main {
  width: 70%;
  padding: 20px;
}

.container .main .title {


  display: flex;
  width: 100%;
  height: 100px;
  padding: 10px 0px 0px 10px;
  background-color: #ca82ff;
}

.container .main .title h1 {


  padding: 20px;
  width: 80px;
  height: 80px;
  color: #a760ff;
  background-color: white;
  border-radius: 50%;
  text-align: center;
}

.container .main .title h2 {


  text-transform: uppercase;
  margin: 20px 20px 0 20px;
  color: white;
}

.container .main .main-content {


  width: 100%;
  padding: 20px;
  background-color: white;
}

.container .main .main-content h4,


hr {
  color: #a760ff;
}

.container .side-menus ul {
  text-decoration: none;
}
.container .side-menus a {
  text-decoration: none;
}
.container .side-menus .menus li {
  width: 100%;
  display: block;
  padding-left: 20px;
  padding-top: 5px;
  margin-top: 10px;
  height: 30px;
  color: white;
  font-weight: bold;
  background-color: #ca82ff;
}

.container .side-menus .menus li:hover {


  background-color: white;
  color: #ca82ff;
}

.container .main .main-content #details-form {


  margin-top: 20px;
}

.container .main .main-content #details-form label,


input {
  display: block;
  font-size: 20px;
  color: black;
}

.container .main .main-content #details-form label span {


  font-size: 15px;
  color: #a760ff;
}

.container .main .main-content #details-form input,


#category {
  margin-top: 5px;
  margin-bottom: 10px;
  width: 100%;
  color: black;
  font-size: 18px;
  height: 40px;
}

.container .main .main-content #details-form #submit {


  margin-top: 20px;
  width: 100%;
  color: white;
  font-size: 18px;
  font-weight: bold;
  height: 40px;
  background-color: #ca82ff;
  border: 0;
}

.container .main .main-content #details-form #submit:hover {


  color: white;
  background-color: #a760ff;
  cursor: grab;
}

.container .main .main-content #details-form #reset {


  margin-top: 20px;
  width: 100%;
  color: white;
  font-size: 18px;
  font-weight: bold;
  height: 40px;
  background-color: rgb(255, 70, 70);
  border: 0;
}
.container .main .main-content #details-form #reset:hover {
  color: white;
  background-color: rgb(255, 19, 19);
}
36. bookdetails.css

.body-container {
  width: 90%;
}
.book-container {
  width: 100%;
}
.sidbar {
  background-color: white;
}
.book-container .details-container {
  width: 100%;
  border-right: 2px solid #a760ff;

  padding: 20px;
}

.book-container .details-container .container1 {


  display: flex;
}
.book-container .details-container #img {
  width: 200px;
  height: 300px;
}
.book-container h1 {
  margin-bottom: 20px;
  margin-top: 40px;
  color: #a760ff;
}
.book-container hr {
  margin-bottom: 20px;
  margin-top: 20px;
  color: #a760ff;
  border: 2px solid #a760ff;
}

.book-container .details-container .details {


  padding: 20px;
}
.book-container .details-container #qntl {
  margin-top: 40px;
}

.book-container .details-container #qnt,


#add-cart {
  margin: 10px;
  width: 130px;
  height: 40px;
}
.book-container .details-container #add-cart {
  font-weight: bold;
  border: 0px solid #a760ff;
  background-color: #a760ff;
  color: white;
}
.book-container .details-container #add-cart:hover {
  background-color: #ca82ff;
  color: white;
}
.book-container .details-container .details #qntspan {
  color: red;
  font-size: 18px;
}
.book-container .details-container .details label {
  display: block;
  color: #a760ff;
  margin: 20px;
  font-size: 20px;
}
.book-container .details-container .details label span {
  color: black;
  font-size: 18px;
}

.book-container .details-container .container2 h3 {


  color: #a760ff;
  margin-top: 20px;
}

.book-container .details-container .container2 p {


  color: gray; 
margin-top: 20px;
}

37. booktable.css

.main-content .search-box {
  display: flex;
  box-sizing: border-box;
}

#myInput,
#myInput2,
#myInput3 {
  background-image: url("../icons/search.png");
  box-sizing: border-box;
  background-position: 7px 7px;
  background-repeat: no-repeat;
  width: 300px;
  font-size: 16px;
  padding: 12px 20px 12px 40px;
  color: gray;
  border: 1px solid #ddd;
  margin-bottom: 12px;
  margin-right: 20px;
}
#myInput {
  width: 150px;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 15px;
  text-align: left;
  border-bottom: 1px solid #ddd;
}

th {
  height: 50px;
  text-align: left;
  background-color: #a760ff;
  color: white;
}

td {
  height: 50px;
  vertical-align: bottom;
}
tr:hover {
  background-color: #f5f5f5;
}

tr:nth-child(even) {
  background-color: #f2f2f2;
}
td,
img {
  width: 100px;
  height: 150px;
}

table #code {
  width: 130px;
}

table #name {
  width: 300px;
}

table #price {
  width: 40px;
}

table #quantity {
  width: 40px;
}
table #category {
  width: 300px;
}

table a {
  text-decoration: none;
}

table .edit {
  text-align: center;
  margin-bottom: 20px;
  padding: 10px;
  width: 70px;
  color: white;
  border: 1px solid #ca82ff;
  background-color: #ca82ff;
}

table .edit:hover {
  color: white;
  background-color: #a760ff;
}
table .delete {
  text-align: center;
  margin-bottom: 10px;
  width: 70px;
  padding: 10px;
  color: white;
  border: 1px solid rgb(255, 70, 70);
  background-color: rgb(255, 70, 70);
}
table .delete:hover {
  background-color: rgb(255, 19, 19);
  color: white;
}

38. cart.css

* {
  padding: 0;
  margin: 0;
  box-sizing: border-box;
}
body {
  width: 100%;
  height: 100%;
}
body h2 {
  width: 70%;
  padding: 10px;
  font-family: Arial, Helvetica, sans-serif;
  margin: 20px auto;
  background-color: #a760ff;
  color: white;
}

.cart {
  width: 70%;
  margin: 20px auto;
  text-align: right;
}

.product_wrapper {
  float: left;
  padding: 10px;
  text-align: center;
}
.product_wrapper:hover {
  box-shadow: 0 0 0 2px #e5e5e5;
  cursor: pointer;
}
.product_wrapper .name {
  font-weight: bold;
}
.table {
  width: 100%;
}
.table #heading_tr {
  font-weight: bold;
  text-align: right;
  color: #a760ff;
}
.table #hname {
  text-align: left;
}
.table #name_td {
  text-align: left;
}
.table td {
  border-bottom: #f0f0f0 1px solid;
  padding: 10px;
}

.cart .remove {
  background: none;
  border: none;
  color: #0067ab;
  cursor: pointer;
  padding: 0px;
  text-align: center;
}

.del {
  height: 40px;
  width: 40px;
}

.div_button {
  width: 70%;
  margin: 0 auto;
  text-align: right;
}

.div_button .button {
  padding: 10px;
  border: 0px solid #a760ff;

  font-weight: bold;
}

.div_button .cint {
  background-color: #ff4949;
  border: 0px solid #ff4949;
  color: white;
}

.div_button .cint:hover {
  background-color: #ff8d29;
  color: white;
}

.div_button .check {
  background-color: #a760ff;
  border: 0 solid #a760ff;
  margin-left: 40px;
  color: white;
}

.div_button .check:hover {
  background-color: #ca82ff;
  color: white;
}

39. checkout.css

* {
  padding: 0;
  margin: 0;
  box-sizing: border-box;
}
body {
  width: 100%;
}

.order_form {
  width: 30%;
  padding: 10px;
  border: 2px solid #a760ff;
  margin: 20px auto;
}
.order_form h4 {
  margin: 10px;
  font-family: Arial, Helvetica, sans-serif;
  color: #a760ff;
}
.order_form hr {
  margin-bottom: 10px;
  color: #a760ff;
  border: 1px solid #a760ff;
}
span {
  color: red;
  font-size: 15px;
}

label {
  display: block;
  color: rgb(97, 95, 95);
}
input,
select {
  display: block;
  margin-bottom: 10px;
  margin-top: 5px;
  width: 100%;
  height: 25px;
}
.button {
  width: 100%;
  height: 30px;

  font-size: 15px;
  text-transform: uppercase;
}

.cancel {
  background-color: #ff4949;
  color: white;
  border: 0px solid #ff4949;
}

.cancel:hover {
  background-color: #ff8d29;
  color: white;
}

.submit {
  background-color: #a760ff;
  color: white;
  border: 0px solid #a760ff;
}

.submit:hover {
  background-color: #ca82f;
  color: white;
}
#reciept {
  width: 30%;
  margin: 20px auto;
  text-align: center;
}
#reciept h1 {
  color: #a760ff;
  font-family: Arial, Helvetica, sans-serif;
  margin: 10px;
}
#reciept h5 {
  font-family: Arial, Helvetica, sans-serif;
  margin: 20px;
}

#reciept button {
  width: 150px;
  height: 30px;
  margin: 10px;
  background-color: #a760ff;
  color: white;
  border: 0px solid #a760ff;
}
.rtab {
  margin: auto auto;
  text-align: center;
}
#reciept button:hover {
  background-color: #ca82ff;
  color: white;
  border: 0px solid #ca82ff;
  cursor: grab;
}

40. displaybook.css

.body-container .book-sidebar {
  width: 25%;
  margin-top: 20px;
  text-align: center;
  padding: 0px 20px;
}
.body-container .book-container2 {
  width: 100%;
}

.body-container .book-sidebar #category-filter {


  width: 100%;
  color: black;
  font-size: 18px;
  height: 40px;
}

.body-container .book-sidebar #category-label {


  float: left;
  margin: 10px;
  color: black;
  font-size: 18px;
  font-weight: bold;
}

.book-container #category-title {
  color: #a760ff;
  display: block;
  margin-bottom: 10px;
}
.book-container #line-title {
  color: #a760ff;
  border: 2px solid #a760ff;
  margin-bottom: 10px;
}
.product_wrapper {
  width: 198px;
  display: inline-block;
  background-color: white;
  margin: 10px;

  border: 2px solid rgb(196, 194, 194);

  padding: 8px;
  text-align: center;
}
.product_wrapper:hover {
  box-shadow: 0 0 0 2px #e5e5e5;
  cursor: pointer;
}

.product_wrapper .image img {


  box-sizing: border-box;
  width: 100%;
  height: 200px;
}
.product_wrapper .book-name {
  font-weight: bold;
  font-size: 15px;
  color: black;
  margin-top: 10px;
}
.product_wrapper .book-price {
  font-weight: bold;
  font-size: 15px;
  margin: 5px;
  color: crimson;
}
.product_wrapper .buy {
  text-transform: uppercase;
  background: #a760ff;
  border: 0 solid #a760ff;

  cursor: pointer;
  color: #fff;
  padding: 5px 20px;
  margin-top: 10px;
}

.product_wrapper .unavailable {
  text-transform: uppercase;
  background: red;
  border: 1px solid red;

  color: white;
  font-weight: bold;
  padding: 5px 20px;
  margin-top: 10px;
}
.product_wrapper .buy:hover {
  background: #ca82ff;
  border-color: #ca82ff;
}
.price-filter h3 {
  float: left;
  display: block;
  margin-bottom: 20px;
  margin-right: 60px;
}
.price-filter label {
  float: left;
  display: block;
  margin: 10px;
}
.price-filter input {
  float: left;
  width: 100%;
}

.price-filter #minimum,
#maximum {
  color: orangered;
}
.book-sidebar #apply {
  display: block;
  background-color: #a760ff;
  width: 90px;
  height: 35px;
  color: white;
  font-weight: bold;

  margin-top: 20px;
  border: 0px solid #a760ff;
}
.book-sidebar #apply:hover {
  background-color: #ca82ff;
  color: white;
}

.book-sidebar #search-btn {
  box-sizing: border-box;
  background-position: 10px 12px;
  background-repeat: no-repeat;
  width: 100%;
  font-size: 16px;
  padding: 12px 18px 12px 18px;
  color: white;
  border: 1px solid #ddd;
  margin-bottom: 40px;
  background-color: #a760ff;
}
.book-sidebar #search-value {
  width: 100%;
  height: 40px;
  font-size: 18px;
  margin-bottom: 20px;
}

#search-btn:hover {
  cursor: grab;
  background-color: #ca82ff;
  color: white;
}

41. home.css

.main .box0 {
  display: inline-block;
}
.main #img2 {
  margin-top: 20px;
}

.main #img2 img {


  width: 100%;
  border-radius: 30px;
}

.main a {
  text-decoration: none;
  font-weight: bold;
  display: inline;
  font-family: Arial, Helvetica, sans-serif;
  background-color: white;
  height: 0px;
}

.main .box {
  width: 200px;
  background-color: #ca82ff;

  color: white;
  text-align: center;
  padding: 10px;

  margin: 10px;
}
.main .box:hover {
  background-color: white;
  color: #ca82ff;
}

42. index.css

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: Arial, Helvetica, sans-serif;
}
body {
  width: 100%;
}
.nav-container {
  width: 100%;
  height: 70px;

  display: flex;
  background-color: #a760ff;
}
.nav-container .logo {
  width: 20%;
}

.nav-container .logo img {


  float: right;
  width: 150px;
  height: 70px;
}
.nav-container .menu1 {
  width: 60%;
  height: 100%;
  text-align: center;
}

.nav-container .menu1 ul {
  margin-top: 25px;
  font-size: 15px;
  font-weight: bold;
  text-transform: uppercase;
  text-decoration: none;
}

.nav-container .menu1 ul a {
  text-transform: uppercase;
  text-decoration: none;
}
.nav-container .menu1 ul li {
  display: inline;
  color: white;
  padding: 22px 10px 22px 10px;
  margin-left: 5px;
}

.nav-container .menu1 ul li:hover {


  background-color: #ca82ff;
  color: white;
}
.nav-container .cart {
  padding: 0 20px 6px 20px;
  margin-left: -130px;
  display: flex;
  text-align: center;
}
.nav-container .cart button {
  margin-left: 10px;
  background-color: #a760ff;
  padding: 24px 10px 22px 10px;
  color: white;
  text-decoration: none;
}
.nav-container .cart button:hover {
  background-color: #ca82ff;
  color: white;
}
.nav-container .cart .cart_div {
  background-color: #a760ff;
  width: 60px;
  height: 63px;
  margin-top: 2px;
  margin-left: 30px;
}

.nav-container .cart .cart_div:hover {


  background-color: #ca82ff;
}
.nav-container .cart .cart_div img {
  margin-top: 15px;
  margin-left: -3px;
  filter: brightness(0) invert();
  width: 50%;
}

/* Main Container*/

.body-container {
  margin: 30px auto 72px;
  display: flex;
  width: 90%;
}

.body-container .sidebar {
  width: 25%;
}
.body-container .sidebar .banner2 {
  width: 100%;
  height: auto;
  padding: 20px;
}
h1,
hr {
  color: #a760ff;
  margin-top: 20px;
}
hr {
  border: 2px solid #a760ff;
}
.body-container .book-container {
  width: 75%;
  padding: 20px;
}

.body-container .book-container .slider {


  width: 100%;
  margin: 0 auto;
  height: 300px;
  box-sizing: border-box;
}
.body-container .book-container .slider img {
  width: 100%;
  height: 300px;
  animation: simg 1s linear;
}

@keyframes simg {
  0% {
    transform: scale(0.8);
  }
  0% {
    transform: scale(1);
  }
  0% {
    transform: scale(1);
  }
}

.ezpz {
  width: 100%;
  margin: 20px auto 0px;
  padding: 20px;
  text-align: center;
  align-items: center;
  background-color: #a760ff;
}

.l {
  width: 200px;
}

.ezpz p {
  margin-bottom: 10px;
  color: white;
}

43. login.css

.book-container3 {
  display: flex;
}
.book-container .login-div {
  width: 50%;
  padding: 20px;
  border: 2px solid white;
}
.book-container .register-div {
  width: 50%;
  padding: 20px;
  margin-left: 30px;
  border: 2px solid white;

  display: inline-block;
}
.book-container .login-div input,
.register-div input {
  display: block;
  width: 100%;
  margin-top: 20px;
  height: 40px;
}

.book-container3 .button {
  background-color: #a760ff;
  font-weight: bold;
  border: 0px solid #a760ff;
  color: white;
}

.book-container3 .button:hover {
  background-color: #ca82ff;
  color: white;
}
.book-container3 span {
  color: red;
  font-size: 15;
}
h3 {
  color: #a760ff;
  font-size: 1.5rem;
}

44. orderlist.css

#print {
  width: 200px;
  margin: 20px;
  height: 45px;
  font-size: 20px;
  background-color: #a760ff;
  color: white;
  border: 0;
  margin-left: 785px;
}

#print:hover {
  cursor: grab;
  background-color: #ca82ff;
  color: white;
}

#status {
  width: 90%;
  margin-left: 17px;
  height: 40px;
  margin-bottom: 20px;
}

#back {
  width: 90%;
  background-color: rgb(255, 70, 70);
  margin: 17px;
  height: 40px;
  color: white;
  border: 0;
}

#back:hover {
  background-color: rgb(255, 19, 19);
  color: white;
  border: 0;
}
45. orderstable.css

.main-content .search-box {
  display: flex;
  box-sizing: border-box;
}

#myInput,
#myInput2,
#myInput3 {
  background-image: url("../icons/search.png");
  box-sizing: border-box;
  background-position: 7px 7px;
  background-repeat: no-repeat;
  width: 220px;
  font-size: 16px;
  padding: 12px 20px 12px 40px;
  color: gray;
  border: 1px solid #ddd;
  margin-bottom: 12px;
  margin-right: 20px;
}
#myInput {
  width: 176px;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 15px;
  text-align: left;
  border-bottom: 1px solid #ddd;
}

th {
  height: 50px;
  text-align: left;
  background-color: #ca82ff;
  color: white;
}

td {
  vertical-align: bottom;
}
tr:hover {
  background-color: #f5f5f5;
}

tr:nth-child(even) {
  background-color: #f2f2f2;
}
table #fv {
  width: 200px;
}

table a {
  text-decoration: none;
}

table .edit {
  display: inline;
  text-align: center;
  margin-bottom: 20px;
  padding: 10px;
  color: white;
  border: 1px solid #ca82ff;
  background-color: #ca82ff;
}

table .edit:hover {
  color: white;
  background-color: #a760ff;
}
table .delete {
  display: inline;
  text-align: center;
  padding: 10px;
  color: white;

  background-color: rgb(255, 70, 70);


}
table .delete:hover {
  background-color: rgb(255, 19, 19);
  color: white;
}
46. track.css

.sidebar hr,
h2 {
  margin: 20px;
}
.sidebar input {
  width: 90%;
  height: 40px;
  display: block;
  margin: auto auto 19px;
}

.sidebar #track {
  border: 1px solid #a760ff;
  background-color: #a760ff;
  color: white;
  font-weight: bold;
}

.sidebar #track:hover {
  background-color: #ca82ff;
  color: white;
}

h2 {
  color: #a760ff;
  font-size: 15px;
}

.book-container h2 span {
  font-size: 15px;
  color: black;
  text-transform: capitalize;
}

.book-container h2 #tk {
  font-size: 15px;
  text-transform: capitalize;
}
table {
  width: 100%;
  margin-top: 20px;
  border-collapse: collapse;
}

th,
td {
  padding: 15px;
  text-align: left;
  border-bottom: 1px solid #ddd;
}

th {
  height: 50px;
  text-align: left;
  background-color: #a760ff;
  color: white;
}

td {
  height: 50px;
  vertical-align: bottom;
}
tr:hover {
  background-color: #f5f5f5;
}

tr:nth-child(even) {
  background-color: #f2f2f2;
}

14. Testing

Software testing is a process of executing it (software and program) again and


again with the purpose of finding error on it. In general test means checking
something for fault, dysfunction, and error. Similarly, software testing simply
means the process of checking software for any error in it.

WHITE BOX TESTING - White-box testing (also known as clear box testing, glass
box testing, transparent box testing, and structural testing) is a method of
testing software that tests internal structures or workings of an application, as
opposed to its functionality (i.e., black-box testing). In white box testing an
internal perspective of the system, as well as programming skills, are used to
design test cases. The tester chooses inputs to exercise paths through the code
and determine the appropriate outputs. This is analogous to testing nodes in a
circuit, e.g., in-circuit testing (ICT).

BLACK BOX TESTING - Black Box Testing, also known as Behavioural Testing, is a
software testing method in which the internal structure/ design/
implementation of the item being tested is not known to the tester. These tests
can be functional or non-functional, though usually functional. This method is
named so because the software program, in the eyes of the tester, is like a black
box; inside which one cannot see. This method attempts to find errors in the
following categories:

1. Interface errors

2. Errors in data structures or external database access

3. Behaviour or performance errors

4. Initialization and termination errors

15. Scope of Future Application


Future scope of this web application is to make online Books shopping more
easy, effective, and reliable to every shopper. Online sales will continue to rise.
Every webpage designed to sell a product or market a service should understand
the future of online shopping. There are several major variables that make
online sales attractive to the worldwide market. These variables include:

1. Value of Products/Services offered

2. Dependability and Reputation of the Seller

3. Ease and Security of payment

You might also like