Project Report
Project Report
Mahamaya Polytechnic Of Information Technology
Amroha
Submitted to
For
POLYTECHNIC DIPLOMA
In
INFORMATION TECHNOLOGY
By ------------
PROJECT REPORT ON
Mr. ABHAY GUPTA, DHARMESH GIRI of Diploma final Year is bonafide Student of Mahamaya
Polytechnic Of Information Technology with Information Technology and has accomplished this report
efficiently under the guidance of Mr. Lalit Kumar Gupta.
(Lecturer)
DECLARATION OF ORIGINALITY
I hereby declare that this thesis contents original project work done by me, as part of masters of computer
science studies. All information in this document has been obtained and presented in accordance with the
academic rules and ethical conduct.
I also declare that, as required by these rules and conduct I have fully cited and referenced all the materials.
Abhay Gupta
Dharmesh Giri
Acknowledgement
This project is not only my worth effort but many people directly and indirectly helped me to prepare the
project. I want to thank specially Respect Lalit Kumar Gupta and other staff for so much gentle and kind
support. My freinds provided guideline to me to prepare the project. Then many of my friends helped me
to prepare this project.
Concept of this project (HTML, CSS, JAVASCRIPT and PHP with MySQL Database). I got from the
internet and then started it but was not sure to complete it but this was made possible by the help of my
teachers and my friends.
After this I will like to thank all my family member who are so helping and caring, I will like to thank all
my teaching staff who helped me so much as all concepts are interrelated.
Preface
This is project submitted by ABHAY GUPTA, DHARMESH GIRI. This project has been coded in
HTML, CSS, JAVASCRIPT and PHP with MySQL Database, it has been tried to made so as to be error
free but still some may be left so please avoid those mistakes. Project is in the form of programs which are
made in PHP language basically it is coded in swing.
I think reader of the project will ignore my small mistakes. He/she will allow me to put forward my
concepts and understanding of project in practical form.
I will feel great if any of person reading documents will be benefited a bit by my work.
Thanking you,
Teacher_______________
Table Of Contents
2. Purpose 9
3. Modules 11
4. Users 13
5. Hardware requirement 14
6. Software requirement 14
7. Advantages 15
8. Applications 15
9. Overall description 16
10. Administrator 18
22. Conclusion 47
23. Bibliography 50
Introduction
An online bookstore software projects that acts as a central database containing various books in stock
along with their title, author and cost. This project is a website that acts as a central book store. This web
project is developed using PHP as the front end and SQL as a back-end. The SQL database stores various
book related details. A user visiting the website can see a wide range of books arranged in respective
categories. The user may select desired book and view its price. The user may even search for specific
books on the website. Once the user selects a book, he then has to fill in a form and the book is booked
for the user. The software has the following three main components:-
The website will be implemented using PHP as the programming language. MySQL database will be used
to link database.
Purpose
For the project, we propose to build an online bookshop for People. The online bookshop will contain
stories, study material, any courses books like computer and be available to everyone. Many students find
textbooks too expensive to buy at school bookstores and many courses only use the required textbooks a
few days in a semester. This becomes very wasteful and frustrating for students & others people. This
online bookstore provides a solution to this. It will provide a service in which students can buy books
online without any treble. There will be free shipping. They do need to register with the site in order to
books. Payment information will be requested after adding any numbers of books in the cart.
• To gain expertise using Data Grid, Data Set, Data Table, Data Adapter
and Data Readers.
Modules
View product-Here the user can view different products and its details.
Search –The user can search product by name after which the system will evaluate prices of the same
product from different websites to give the user the best search result.
Hardware Requirements
• Processor – i3
• Hard Disk – 50 GB
• Memory – 1GB RAM
• Monitor
Software Requirements
• Windows 10 or higher
• XAMMP control panel
• Visual Studio Code
• MySQL
Advantages
• Customers can get their book delivered instead of actually going and buying the book. They can make
payment online itself.
• Managing of inventory in the shop for shopkeeper becomes easier as customers are not visiting and
ordering online.
• This system saves both time and travelling cost of customers. User can get to know different kinds of
books that they were unaware of by just searching in the system using keywords.
Overall Description
This project designs an online bookstore provides a web-based interface. It is the graphical user
interface. It have a form for user to input query information to search the database. The users interface
then pass the input to the control function, which implemented in PHP. The control function is designed
to process the input from the users interface, generate the searching query and then gets data from the
database and returns to the users interface. The control functions also have bridges to search some external
real online bookshops. It can generate the query based on the user input and pass them to the commercial
bookshop. The bridge can also handle the response from the commercial bookshop and parse the useful
information and display to the user in HTML forms.
For Administrators
Web development broadly refers to the tasks associated with developing websites for hosting via
intranet or internet. The web development process includes web design, web content development, client-
side/server-side scripting and network security configuration, among other tasks. Web development is also
known as website development.
PHP
PHP (recursive acronym for PHP: Hypertext Preprocessor) is a widely-used open source general-
purpose scripting language that is especially suited for web development and can be embedded into
HTML.
<html>
<head>
<title>PHP</title>
</head>
<body>
<?php
echo "Hi, I'm a PHP script!";
?>
</body>
</html>
HTML
HTML or Hyper Text Markup Language is the standard markup language used to create web pages.
HTML is written in the form of elements consisting of tags enclosed in angle brackets (like <html>).
HTML tags most commonly come in pairs like <h1> and </h1>, although some tags represent empty
elements and so are unpaired, for example <img>. The first tag in a pair is the start tag, and the second
tag is the end tag (they are also called opening tags and closing tags).
The purpose of a web browser is to read HTML documents and compose them into visible or audible web
pages. The browser does not display the HTML tags, but uses the tags to interpret the content of the page.
HTML describes the structure of a website semantically along with cues for presentation, making it a
markup language rather than a programming language.
HTML elements form the building blocks of all websites. HTML allows images and objects to be
embedded and can be used to create interactive forms.
<html>
<head>
<title>html</title>
</head>
<body>
<h1>This is HTML</h1>
</body>
</html>
CSS
CSS was first developed in 1997, as a way for Web developers to define the look and feel of their Web
pages. It was intended to allow developers to separate content from design so that HTML could perform
more of the function that it was originally based on the markup of content, without worry about the design
and layout.
CSS didn't gain in popularity until around 2000, when Web browsers began using more than the basic font
and color aspects of CSS.
Web Designers that don't use CSS for their design and development of Web sites are rapidly becoming a
thing of the past. And it is arguably as important to understand CSS as it is to know HTML - and some
would say it was more important to know CSS.
Style sheet refers to the document itself. Style sheets have been used for document design for years. They
are the technical specifications for a layout, whether print or online. Print designers use style sheets to
ensure that their designs are printed exactly to specifications. A style sheet for a Web page serves the same
purpose, but with the added functionality of also telling the viewing engine (the Web browser) how to
render the document being viewed.
MySQL
MySQL, the most popular Open Source SQL database management system, is developed,
distributed, and supported by Oracle Corporation.
The MySQL Web site (http://www.mysql.com/) provides the latest information about MySQL software.
A database is a structured collection of data. It may be anything from a simple shopping list to a picture
gallery or the vast amounts of information in a corporate network. To add, access, and process data stored
in a computer database, you need a database management system such as MySQL Server. Since computers
are very good at handling large amounts of data, database management systems play a central role in
computing, as standalone utilities, or as parts of other applications.
A relational database stores data in separate tables rather than putting all the data in one big storeroom.
The database structures are organized into physical files optimized for speed. The logical model, with
objects such as databases, tables, views, rows, and columns, offers a flexible programming environment.
You set up rules governing the relationships between different data fields, such as one-to-one, one-to-
many, unique, required or optional, and “pointers” between different tables. The database enforces these
rules, so that with a well-designed database, your application never sees inconsistent, duplicate, orphan,
out-of-date, or missing data.
The SQL part of “MySQL” stands for “Structured Query Language”. SQL is the most common
standardized language used to access databases. Depending on your programming environment, you might
enter SQL directly (for example, to generate reports), embed SQL statements into code written in another
language, or use a language-specific API that hides the SQL syntax.
SQL is defined by the ANSI/ISO SQL Standard. The SQL standard has been evolving since 1986 and
several versions exist. In this manual, “SQL-92” refers to the standard released in 1992, “SQL:1999”
refers to the standard released in 1999, and “SQL:2003” refers to the current version of the standard. We
use the phrase “the SQL standard” to mean the current version of the SQL Standard at any time.
Project Overview
There are many online book stores like Powell’s, Amazon which were designed using Html. I want to
develop a similar website using PHP, SQL Server.
BOOKLY is an online web application where the customer can purchase books online. Through a web
browser the customers can search for a book by its title or author, later can add to the shopping cart and
finally purchase using credit card transaction. The user can login using his account details or new
customers can set up an account very quickly. They should give the details of their name, contact number
and shipping address. The user can also give feedback to a book by giving ratings on a score of five. The
books are divided into many categories based on subject Like Software, Database, English, Architecture
etc.
2) Search :
A search by keyword option is provided to the user using a textbox .The keyword to be
entered should be the book title.
3) Advanced Search :
Advanced search helps the user to search for a book based on Title, Author,
Category and price range. All the books which match the particular search criteria and their total count
will be displayed. From here the user can select a book and add to the shopping cart.
4) Book Description :
If the user would like to know details about a book he can click on the title from
where he will be directed to a Book description page. It includes the notes on the book content and also a
link to Amazon.com to get the book review.
5) User Voting :
The user can give rating to a book based on his interest. He can rate it by giving a score of
five as Excellent, four for very good, three for good, two for regular and one for deficient. The final rating
of a book will depend on all the individual user rating.
6) Shopping Cart :
The user can manage a shopping cart which will include all the books he selected.
The user can edit, delete and update his shopping cart. A final shopping cart summary is displayed which
includes all the items the user selected and the final total cost.
8) Administration :
The Administrator will be provided with special functionalities like -
Online Book Store is a specific requirement of the client that integrates the buying and selling services
specifically to their customers.
Reports can be generated at any time within few seconds, so that manual labor is not required, and also
analysis can be performed much more frequently which helps in taking decision.
The details regarding all users, books can also be maintained as their information is very helpful and
sometimes becomes a critical requirement.
Allows user to get registered from their places and transact for the required product.
To overcome these problems we develop “BOOKLY”.
System requirements are expressed in a software requirement document. The Software requirement
specification (SRS) is the official statement of what is required of the system developers. This requirement
document includes the requirements definition and the requirement specification. The software
requirement document is not a design document. It should set out what the system should do without
specifying how it should be done. The requirement set out in this document is complete and consistent.
4. Non Functional Requirements :-
Flexible service based architecture will be highly desirable for future extension Non functional
requirements define system properties and constraints It arise through user needs, because of budget
constraints or organizational policies, or due to the external factors such as safety regulations, privacy
registration and so on.
1. Security
2. Reliability
3. Maintainability
4. Portability
5. Extensibility
6. Reusability
7. Application Affinity/Compatibility
8. Resource Utilization
Functional Decomposition Diagram
A decomposition diagram shows a top-down functional decomposition of a system and exposes the
system's structure. The objective of the Functional Decomposition is to break down a system step by step,
beginning with the main function of a system and continuing with the interim levels down to the level of
elementary functions. The diagram is the starting point for more detailed process diagrams, such as data
flow diagrams (DFD). shows the Functional Decomposition Diagram for this project.
DFDs show the flow of data from external entities into the system, showed how the data moved from
one process to another, as well as its logical storage. There are only four symbols:
All processes must have at least one data flow in and one data flow out.
All processes should modify the incoming data, producing new forms of outgoing data.
Each data store must be involved with at least one data flow.
Each external entity must be involved with at least one data flow.
A data flow must be attached to at least one process.
DFDs are nothing more than a network of related system functions and indicate from where information
is received and to where it is sent. It is the starting point in the system that decomposes the requirement
specifications down to the lowest level detail.
The four symbols in DFD, each of which has its meaning. They are given below:
External entities are outside to system but they either supply input data in the system or use the system
output. These are represented by square of rectangle. External entities that supply data into a system are
sometimes called Sources. External entities that use system data are sometimes called sinks.
Dataflow models that passages of data in the system and are represented by line by joining system
components. An arrow indicates the direction of the flow and the line is labeled by the name of the
dataflow.
Process show that the systems do. Each process has one or more data inputs and one or data outputs.
Circles in DFD represent them. Each high level process may be consisting of more than one lower level
processes. Process will be expanded in sequent level DFD. A circle or a bubble represents a process that
transforms incoming data flow into outgoing dataflow.
Receivable process.
Verifiable process.
Disposal process.
File or data store is a repository of data. They contain data that is retained in the system. Process can enter
data into data store or retrieved data from the data store. An open rectangle is a data store, data at rest.
0-Level DFD:
CONTEXT
Admin
Data
Status
1.0
Admin Process
Reviews
Store
Access process
Book Order
Product
View
Edit data
User Profile Updates
Update
3.0
order Details
Selected
Product
Add to Cart Cart
3.1
Place Order
Order
Simply stated the ER model is a conceptual data model that views the real world as entities and
relationships. A basic component of the model is the Entity-Relationship diagram which is used to visually
represent data objects. Since Chen wrote his paper the model has been extended and today it is commonly
used for database.
The ER model views the real world as a construct of entities and association between entities.
Entities :-
Entities are the principal data object about which information is to be collected. Entities are classified as
independent or dependent (in some methodologies, the terms used are strong and weak, respectively). An
independent entity is one that does not rely on another for identification. A dependent entity is one that
relies on another for identification.
Relationship :-
A Relationship represents an association between two or more entities. Relationships are classified in
terms of degree, connectivity, cardinality, and existence.
Attributes :-
Attributes describe the entity of which they are associated. A particular instance of an attribute
is a value. The domain of an attribute is the collection of all possible values an attribute can have. The
domain of Name is a character string.
Classifying Relationships :-
Relationships are classified by their degree, connectivity, cardinality, direction, type, and
The degree of a relationship is the number of entities associated with the relationship. The n-ary
relationship is the general form for degree n. Special cases are the binary, and ternary, where the degree is
2 and 3 respectively.
The connectivity of a relationship describes the mapping of associated entity instances in the
relationship. The values of connectivity are "one" or "many". The cardinality of a relationship is the actual
number of related occurrences for each of the two entities. The basic types of connectivity for relations are:
one-to-one, one-to-many, and many-to-many.
Direction :-
The direction of a relationship indicates the originating entity of a binary relationship. The entity
from which a relationship originates is the parent entity; the entity where the relationship terminates is the
child entity.
The direction of a relationship is determined by its connectivity type .An identifying relationship is one in
which one of the child entities is also a dependent entity. A non-identifying relationship is one in which
both entities are independent.
Existence :-
Existence denotes whether the existence of an entity instance is dependent upon the existence of
another, related, entity instance. The existence of an entity in a relationship is defined as either mandatory
or optional.
Generalization Hierarchies :-
A generalization hierarchy is a form of abstraction that specifies that two or more entities that
share common attributes can be generalized into a higher level entity type called a supertype or generic
entity. The lower-level of entities become the subtype, or categories, to the supertype. Subtypes are
dependent entities.
ER Notation :-
Entities are represented by labeled rectangles. The label is the name of the entity.
Relationships are represented by a solid line connecting two entities. The name of the relationship is written
above the line. Relationship names should be verbs.
Attributes, when included, are listed inside the entity rectangle. Attributes which are identifiers are
underlined. Attribute names should be singular nouns.
Cardinality of many is represented by a line ending in a crow's foot. If the crow's foot is omitted, the
cardinality is one.
ER Diagram
pin country
U_id
state
passwor
d city
name user
email
1 address
phone
Choo
se
B_nam usern
e B_subca
1 m Book_i
t d
b_id B_desc Cart_id
Bk_nam
e
M 1
Book Adds Cart
to
qty
B_publish
er
price amoun
Edition 1 t
1
page ISBN
Write
confir query
ms
M query
1
Cart_i
orderID d
email
contact
order
con_id usern
Order_
m
date
amoun
t
SYSTEM DESIGN
System design is the solution of a “how to approach to the creation of the new system. It is composed
of several steps. It facilitates the understanding and provides the procedural details necessary for
implementation of the system recommended in the feasibility study. Emphasis is given on translating the
performance requirements into design specification. Design goes through logical and physical stages of
development.
Logical design reviews the present physical system; prepares input and output specification; make editing;
security and control specification; details the implementation plan, and prepare logical design walk
through. The physical design maps out the details of the physical system; plans the system implementation
plan and specifies hardware and software. System design translates the system requirement into the ways
of the system as recommended in the feasibility study. Thus the system design is the translation from user-
oriented document to a programmer or a database personal oriented document. System design is a highly
creative process that can be greatly facilitated by the following:-
Modules Description :-
1. Registration: Customer can register their account here to continue shopping.
2. Admin: Admin can add books, check orders and make sure the orders are delivered on time and can
confirm payments by the customers.
3. Shopping Cart: Customers after login can browse through the different books and choose one or more
products and can add them to cart.
4. Payment: Cash on Delivery facility is available.
INPUT DESIGN :-
Very careful attention had to be given to input design, which is a major part of the overall system design.
In order to make the data entry as easy, logical and error free as possible, specific standards had been
followed. Validation checks, provided in the system prevented the user in entering incorrect, erroneous
data. This made sure that, only valid data had been available for data processing. If valid data was entered,
then meaningful error messages had been prompted to enter correct data. The interactive screen formats
facilitate the entry of valid data.
VALIDATIONS :-
Some fields are having only number, as an I/P. For this key ASCII is checked. If they entered characters,
it would display the message to enter number only. Exchange rates field will be validated for number and
dot symbols.
OUTPUT DESIGN :-
Output, as you probably know, generally refers to the results and information that are generated
by the system. For many end-users, output is the main reason for developing the system and the basis on
which they will evaluate the usefulness of the application. Most end users will not actually operate the
information system or enter data through workstations, but they will use the output from the system.
When designing output, systems analysts must accomplish the following.
Determine what information to present
Decide whether to display, print, or “speak” the information and select the output medium.
Arrange the presentation of information in an acceptable format.
Decide how to distribute the output to intended recipients.
That alignment of information on a display or printed document is termed as layout.
Accomplishing the general activities listed above will require specific decisions, such as whether to use
preprinted forms when preparing reports and documents, how many lines to plan on a printed page, or
whether to use graphics and color.
The output design is specified on layout performs, sheets that describe the location characteristics,
and format of the column headings and pagination. As we indicated at the beginning of this discussion,
these elements are analogous to an architect’s blue print that shows the location of the each component.
DATABASE DESIGN
The general theme behind a database is to handle information as an integrated whole. A database
is a collection of inter-related data stored with minimum redundancy to serve single users quickly and
efficiently. The general objective is to make information necessary, quick, inexpensive and flexible for
the user.
Database Tables
user Table
Category Table
Subcat Table
Book Table
Cart Table
Once the general requirements are gleaned from the client, an analysis of the scope of the development
should be determined and clearly stated. This is often called a scope document.
Certain functionality may be out of scope of the project as a function of cost or as a result of unclear
requirements at the start of development. If the development is done externally, this document can be
considered a legal document so that if there are ever disputes, any ambiguity of what was promised to the
client can be clarified.
IMPLEMENTATION AND TESTING
The Software Design Description Document has been used as input in the implementation
process. The actual implementation has been done using PHP. PHP has been used to interact with
the backend database. In this implementation, My SQL Server has been used as the backend RDBMS.
PHP processes the inputs or commands given by the user and translates them in the commands
understandable to the backend database. The output produced by the backend database is also handled
by PHP which then displayed on the Browser screen.
Deployment and maintenance
Deployment starts after the code is appropriately tested, is approved for release and sold or otherwise
distributed into a production environment.
Software Training and Support is important because a large percentage of software projects fail because
the developers fail to realize that it doesn't matter how much time and planning a development team
puts into creating software if nobody in an organization ends up using it. People are often resistant to
change and avoid venturing into an unfamiliar area, so as a part of the deployment phase, it is very
important to have training classes for new clients of your software.
Maintenance and enhancing software to cope with newly discovered problems or new requirements
can take far more time than the initial development of the software. It may be necessary to add code
that does not fit the original design to correct an unforeseen problem or it may be that a customer is
requesting more functionality and code can be added to accommodate their requests. It is during this
phase that customer calls come in and you see whether your testing was extensive enough to uncover
the problems before customers do. If the labor cost of the maintenance phase exceeds 25% of the prior-
phases' labor cost, then it is likely that the overall quality, of at least one prior phase, is poor.
Design
SYSTEM DESIGN :-
Designing of this software is done with high cohesiveness, i.e. there is a minimized interaction
between two different modules. There is no intra modular relationship between modules. Most of the
modules are selfindependent. At the same time modules are loosely coupled i.e. inter – modular relation
exists. Hence the Software is --
Designing part includes its Data Flow Diagrams, Database Tables, Process logic of each and every
module, Input design and Output design. Input design includes input screens such as user login screen,
entry of any master forms screen and password inquiry screen etc. and Output design includes output
screens such as Appraisal, pay slip screen and output Reports.
Structured design partitions a program into small, independent modules. It is an attempt to minimize
complexity and make a problem manageable by subdividing it into smaller segments, which are called
modules. The primary advantages of this design are as follows:
Early versions of the design, though incomplete, are useful enough to resemble the
real system.
In this, a module is tested separately and is often performed by the coder himself simultaneously
along with the coding of the module. The purpose is to exercise the different parts of the module code
to detect coding errors. After this, the modules are gradually integrated into subsystems, which are then
integrated to eventually form the entire system. During integration of modules, integration testing is
performed to detect design errors by focusing on testing the interconnection between the modules.
After the system is put together, system testing is performed. Here the system is tested against
the system requirements to see if all the requirements are met and if the system performs as specified
by the requirements. Finally, acceptance testing is performed to demonstrate to the client, on the real-
life data of the client, the operation of the system.
Testing is an extremely critical and time –consuming activity. It requires proper planning of the
overall testing process. Frequently the testing process starts with a test plan that identifies all the testing-
related activities that must be performed and specifies the schedule, allocates the resource, and specifies
guidelines for testing. The test plan specifies conditions that should be, different units to be tested, and
the manner in which the modules will be integrated together. Then for different test units, a test case
specification document is produced, which lists all the different test cases, together with the expected
outputs.
Test-Plan (TP)
To test my system I too adopted these testing processes. First of all unit testing is done. In it all the
programs are tested in their alone that whether they are properly performing their task or not. In this
phases all the forms are tested which are for budgetary proposal, sanctioned budget received fund, loan
application, recovery schedule, loan sanctioned, scheme wise loan distribution, loan ledger, beneficiary
detail, recovery district wise, employee wise, recovery by employee and district month wise, account
status of beneficiary, beneficiary card, one time settlement of loan, all master files etc. All these forms
are tested individually against all test cases and if their in any problem then it was removed. Thus unit
testing is performed.
The test-plan is basically a list of test cases that need to be run on the system. Some of the test cases
can be run independently for some components and some of the test cases require the whole system to
be ready for their execution. It is better to test each component as and when it is ready before integrating
the components. It is important to note that the test cases cover all the aspects of the system .
Unit Testing
Expected outcome : The user should not get register any record without filling all
necessary fields and some error message follow
The user should not get registered again with same patient
id
There are some limitations for the current system to which solutions can be provided as a future
development :-
1. The system is not configured for multi- users at this time. The concept of transaction can be used to achieve
this.
2. The Website is not accessible to everyone. It can be deployed on a web server so that everybody who is
connected to the Internet can use it.
3. Credit Card validation is not done. Third party proprietary software can be used for validation check.
1. The Administrator of the web site can be given more functionality, like looking at a specific customer’s
profile, the books that have to be reordered, etc.
include 'config.php';
session_start();
$user_id = $_SESSION['user_id'];
if(!isset($user_id)){
header('location:login.php');
}
if(isset($_POST['add_to_cart'])){
$product_name = $_POST['product_name'];
$product_price = $_POST['product_price'];
$product_image = $_POST['product_image'];
$product_quantity = $_POST['product_quantity'];
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>home</title>
</head>
<body>
<section class="home">
<div class="content">
<h3>Hand Picked Book to your door.</h3>
<p>“A book is a gift you can open again and again.Books are important
in various Unexpected ways, Books allow Readers to travel without using
their feet, Books give wings to our imagination, books are full of
knowledge, joy, happiness, wisdom and so much more into it...”</p>
</section>
<section class="products">
<div class="box-container">
<?php
$select_products = mysqli_query($conn, "SELECT * FROM `products`
LIMIT 6") or die('query failed');
if(mysqli_num_rows($select_products) > 0){
while($fetch_products = mysqli_fetch_assoc($select_products)){
?>
<form action="" method="post" class="box">
<img class="image" src="uploaded_img/<?php echo
$fetch_products['image']; ?>" alt="">
<div class="name"><?php echo $fetch_products['name']; ?></div>
<!-- <div class="price">$<?php echo $fetch_products['price']; ?>/-
</div> -->
<div class="price"><?php echo $fetch_products['price']; ?>/-</div>
<input type="number" min="1" name="product_quantity" value="1"
class="qty">
<input type="hidden" name="product_name" value="<?php echo
$fetch_products['name']; ?>">
<input type="hidden" name="product_price" value="<?php echo
$fetch_products['price']; ?>">
<input type="hidden" name="product_image" value="<?php echo
$fetch_products['image']; ?>">
<input type="submit" value="add to cart" name="add_to_cart"
class="btn">
</form>
<?php
}
}else{
echo '<p class="empty">no products added yet!</p>';
}
?>
</div>
</section>
<section class="about">
<div class="flex">
<div class="image">
<img src="images/images (1).jpg" alt="">
</div>
<div class="content">
<h3>about us</h3>
<p>Bookly is a book store website. Mr. Abhay Gupta is founder of
this website. User can buying books over an electronic network, primarily
the internet.We believe local bookstores are essential community hubs that
foster culture, curiosity, and a love of reading, and we're committed to
helping them thrive. Every purchase on the site financially supports
independent bookstores. Our platform gives independent bookstores tools to
compete online and financial support to help them maintain their presence
in local communities.</p>
<a href="about.php" class="btn">read more</a>
</div>
</div>
</section>
<section class="home-contact">
<div class="content">
<h3>have any questions?</h3>
<p>I would love to hear on how you like/dislike <b> Bookly.</b> Mail
me on [email protected] or call on 9129313151. Ideas and
suggestions are welcome.</p>
<a href="contact.php" class="white-btn">contact us</a>
</div>
</section>
</body>
</html>
<?php
include 'config.php';
session_start();
$admin_id = $_SESSION['admin_id'];
if(!isset($admin_id)){
header('location:login.php');
}
if(isset($_POST['update_order'])){
$order_update_id = $_POST['order_id'];
$update_payment = $_POST['update_payment'];
mysqli_query($conn, "UPDATE `orders` SET payment_status =
'$update_payment' WHERE id = '$order_update_id'") or die('query failed');
$message[] = 'payment status has been updated!';
if(isset($_GET['delete'])){
$delete_id = $_GET['delete'];
mysqli_query($conn, "DELETE FROM `orders` WHERE id = '$delete_id'") or
die('query failed');
header('location:admin_orders.php');
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>orders</title>
</head>
<body>
<section class="orders">
<div class="box-container">
<?php
$select_orders = mysqli_query($conn, "SELECT * FROM `orders`") or
die('query failed');
if(mysqli_num_rows($select_orders) > 0){
while($fetch_orders = mysqli_fetch_assoc($select_orders)){
?>
<div class="box">
<p> user id : <span><?php echo $fetch_orders['user_id']; ?></span>
</p>
<p> placed on : <span><?php echo $fetch_orders['placed_on'];
?></span> </p>
<p> name : <span><?php echo $fetch_orders['name']; ?></span> </p>
<p> number : <span><?php echo $fetch_orders['number']; ?></span>
</p>
<p> email : <span><?php echo $fetch_orders['email']; ?></span>
</p>
<p> address : <span><?php echo $fetch_orders['address']; ?></span>
</p>
<p> total products : <span><?php echo
$fetch_orders['total_products']; ?></span> </p>
<p> total price : <span>$<?php echo $fetch_orders['total_price'];
?>/-</span> </p>
<p> payment method : <span><?php echo $fetch_orders['method'];
?></span> </p>
<form action="" method="post">
<input type="hidden" name="order_id" value="<?php echo
$fetch_orders['id']; ?>">
<select name="update_payment">
<option value="" selected disabled><?php echo
$fetch_orders['payment_status']; ?></option>
<option value="pending">pending</option>
<option value="completed">completed</option>
</select>
<input type="submit" value="update" name="update_order"
class="option-btn">
<a href="admin_orders.php?delete=<?php echo
$fetch_orders['id']; ?>" onclick="return confirm('delete this order?');"
class="delete-btn">delete</a>
</form>
</div>
<?php
}
}else{
echo '<p class="empty">no orders placed yet!</p>';
}
?>
</div>
</section>
</body>
</html>
<section class="footer">
<div class="box-container">
<div class="box">
<h3>quick links</h3>
<a href="home.php">home</a>
<a href="about.php">about</a>
<a href="shop.php">shop</a>
<a href="contact.php">contact</a>
</div>
<div class="box">
<h3>extra links</h3>
<a href="login.php">login</a>
<a href="register.php">register</a>
<a href="cart.php">cart</a>
<a href="orders.php">orders</a>
</div>
<div class="box">
<h3>contact info</h3>
<p> <i class="fas fa-phone"></i> 9129313151 </p>
<p> <i class="fas fa-phone"></i> 8882948742 </p>
<p> <i class="fas fa-envelope"></i> [email protected]
</p>
<p> <i class="fas fa-map-marker-alt"></i> ayodhya, uttar pradesh,
india - 224123 </p>
</div>
<div class="box">
<h3>follow us</h3>
<a href="#"> <i class="fab fa-facebook-f"></i> facebook </a>
<a href="#"> <i class="fab fa-twitter"></i> twitter </a>
<a href="#"> <i class="fab fa-instagram"></i> instagram </a>
<a href="#"> <i class="fab fa-linkedin"></i> linkedin </a>
</div>
</div>
</section>
<?php
include 'config.php';
session_start();
$user_id = $_SESSION['user_id'];
if(!isset($user_id)){
header('location:login.php');
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>orders</title>
</head>
<body>
<div class="heading">
<h3>your orders</h3>
<p> <a href="home.php">home</a> / orders </p>
</div>
<section class="placed-orders">
<div class="box-container">
<?php
$order_query = mysqli_query($conn, "SELECT * FROM `orders` WHERE
user_id = '$user_id'") or die('query failed');
if(mysqli_num_rows($order_query) > 0){
while($fetch_orders = mysqli_fetch_assoc($order_query)){
?>
<div class="box">
<p> placed on : <span><?php echo $fetch_orders['placed_on'];
?></span> </p>
<p> name : <span><?php echo $fetch_orders['name']; ?></span> </p>
<p> number : <span><?php echo $fetch_orders['number']; ?></span>
</p>
<p> email : <span><?php echo $fetch_orders['email']; ?></span>
</p>
<p> address : <span><?php echo $fetch_orders['address']; ?></span>
</p>
<p> payment method : <span><?php echo $fetch_orders['method'];
?></span> </p>
<p> your orders : <span><?php echo
$fetch_orders['total_products']; ?></span> </p>
<p> total price : <span>$<?php echo $fetch_orders['total_price'];
?>/-</span> </p>
<p> payment status : <span style="color:<?php
if($fetch_orders['payment_status'] == 'pending'){ echo 'red'; }else{ echo
'green'; } ?>;"><?php echo $fetch_orders['payment_status']; ?></span> </p>
</div>
<?php
}
}else{
echo '<p class="empty">no orders placed yet!</p>';
}
?>
</div>
</section>
</body>
</html>
Conclusion
The Internet has become a major resource in modern business, thus electronic shopping has gained
significance not only from the entrepreneur’s but also from the customer’s point of view. For the
entrepreneur, electronic shopping generates new business opportunities and for the customer, it makes
comparative shopping possible. As per a survey, most consumers of online stores are impulsive and
usually make a decision to stay on a site within the first few seconds. “Website design is like a shop
interior. If the shop looks poor or like hundreds of other shops the customer is most likely to skip to the
other site”. Hence we have designed the project to provide the user with easy navigation, retrieval of data
and necessary feedback as much as possible. In this project, the user is provided with an ecommerce web
site that can be used to buy books online. To implement this as a web application we used PHP as the
Technology. PHP (XAMPP) has several advantages such as enhanced performance, scalability, built- in
security and simplicity. To build any web application using PHP we need a programming language such
as JAVA, HTML # and so on. JAVA SCRIPT was the language used to build this application. PHP uses
MySQL server to interact with the database as it provides in-memory caching that eliminates the need to
contact the database server frequently and it can easily deploy and maintain an PHP application. MySQL
was used as back-end database since it is one of the most popular open source databases, and it provides
fast data access, easy installation and simplicity.
A good shopping cart design must be accompanied with user-friendly shopping cart application logic. It
should be convenient for the customer to view the contents of their cart and to be able to remove or add
items to their cart. The shopping cart application described in this project provides a number of features
that are designed to make the customer more comfortable. This project helps in understanding the creation
of an interactive web page and the technologies used to implement it. The design of the project which
includes Data Model and Process Model illustrates how the database is built with different tables, how the
data is accessed and processed from the tables. The building of the project has given me a precise
knowledge about how PHP is used to develop a website, how it connects to the database to access the data
and how the data and web pages are modified to provide the user with a shopping cart application.
BIBLIOGRAPHY
5. Head First PHP & MySQL – Lynn Beighley & Michael Morrison