Online Pet Shop Management System
Online Pet Shop Management System
INTRODUCTION
The aim of this project entitled “ONLINE PET SHOP MANAGEMENT SYSTEM” is
an online platform that will be used in order for the management provide updates and
information through the use of this website. Through this project we are planning to
digitalize this process by online marketing. Thus the individuals can also rely on other
persons across the district in order to buy variety breeds of pets. People could also be able to
come to know about the different price ranges for the same breed offered by different
persons. Thus our app provides a platform where the users could buy or sell pets by
providing the contact details of the buyers/sellers..
The current setup is being done manually; records management, appointment scheduling
and other transactions are based on pen, paper and folder methods, in line with those problems,
efficiency of outputs are also affected. With the citation of the problems encountered in the
manual setup of business, the researchers and developers decided to create an information system
that will replace the manual method of records management.
. The entire project has been developed using PHP as front end and MYSQL Server as
the back end.
1
1.1 ORGANIZATION PROFILE
also do Web Designing/ Development/Presentation and also provide SEO (Search Engine
Optimization) to our clients. Among the very few, we are those who provide value based
solutions with decreased IT support cost wherein delivering increased transaction volume with
efficient, productive and lower defects. Being a product and services company, FSL has varied
software products in its forte, which includes ERP Solutions, CRM Solutions, and Financial
Domain Solutions, HR and Payroll etc. FSL Software Technologies has always treated its
customers as king, and have always had strong client retention capabilities.
2
1.2 SYSTEM SPECIFICATION
Processor : Hi 5
Hard disk : 1 TB
Mouse : Logitech.
RAM : 4GB (minimum)
Keyboard : 110 keys enhanced.
3
1.2.2.1 ABOUT THE SOFTWARE
FRONT END-PHP
PHP is a server-side scripting language designed for web development but also used as a
general-purpose programming language. As of January 2013, PHP was installed on more than
240 million websites is now produced by The PHP Group. While PHP originally stood for
Personal Home Page, it now stands for PHP Hypertext Preprocessor, which is a recursive
backronym.
PHP code can be simply mixed with HTML code, or it can be used in combination with
various tinplating engines and web frameworks. PHP code is usually processed by a PHP
interpreter, which is usually implemented as a web server's native module or a Common
Gateway Interface (CGI) executable. After the PHP code is interpreted and executed, the web
server sends resulting output to its client, usually in form of a part of the generated web page for
example, PHP code can generate a web page's HTML code, an image, or some other data. PHP
has also evolved to include a command-line interface (CLI) capability and can be used in
standalone graphical applications.
The canonical PHP interpreter, powered by the Zend Engine, is free software released
under the PHP License.
Despite its popularity, no written specification or standard existed for the PHP language
until 2014, leaving the canonical PHP interpreter as a de facto standard. Since 2014, there is
ongoing work on creating a formal PHP
The PHP interpreter only executes PHP code within its delimiters. Anything outside its
delimiters is not processed by PHP (although non-PHP text is still subject to control structures
described in PHP code.
The first form of delimiters, <?php and ?>, in XHTML and other XML documents,
creates correctly formed XML processing instructions. This means that the resulting mixture of
PHP code and other markup in the server-side file is itself well-formed XML
4
Unlike function and class names, variable names are case sensitive. Both double-quoted
and heredoc strings provide the ability to interpolate a variable's value into the string. PHP treats
newlines as whitespace in the manner of a free-form language, and statements are terminated by
a semicolon. PHP has three types of comment syntax: /* */ marks block and inline comments as
well as # are used for one-line comments. The echo statement is one of several facilities PHP
provides to output text to a web browser.
In terms of keywords and language syntax, PHP is similar to most high level
languages that follow the C style syntax. if conditions, for and while loops, and function returns
are similar in syntax to languages such as C, C++, C#, Java and Perl.
Data types
PHP stores whole numbers in a platform-dependent range, either a 64-bit or 32-bit
signedinteger equivalent to the C-language long type. Unsigned integers are converted to signed
values in certain situations this behavior is different from other programming languages. Integer
variables can be assigned using decimal (positive and negative), octal, hexadecimal, and binary
notations.
Floating point numbers are also stored in a platform-specific range. They can be
specified using floating point notation, or two forms of scientific notation. PHP has a native
Boolean type that is similar to the native Boolean types in Java and C++. Using the Boolean type
conversion rules, non-zero values are interpreted as true and zero as false, as in Perl and C++.
The null data type represents a variable that has no value. NULL is the only allowed value
for this data type.
Variables of the resource type represent references to resources from external sources.
These are typically created by functions from a particular extension, and can only be processed
by functions from the same extension examples include file, image, and database resources.
5
BACKEND MySQL:
Structure Query Language is a database query language used for storing and managing data
in Relational DBMS. SQL was the first commercial language introduced for E.F Codd's
Relational model of database. Today almost all RDBMS use SQL as the standard database
query language. SQL is used to perform all types of data operations in RDBMS.
SQL stands for Structured Query Language. It is used for storing and managing data
in relational database management system (RDMS).
It is a standard language for Relational Database System. It enables a user to create,
read, update and delete relational databases and tables.
All the RDBMS like MySQL, Informix, Oracle, MS Access and SQL Server use SQL
as their standard database language.
SQL allows users to query the database in a number of ways, using English-like
statements
Features of MySQL:
6
MySQL gives developers higher productivity by using views, Triggers and Stored
procedures
MySQL is simple and easy to use. You can build and interact with MySQL with only the
basic knowledge of MySQL and a few simple SQL statements.
MySQL has a client-server architecture. There can be any number of clients or
application programs which communicate with the database server (MySQL) to query
data, save changes, etc.
MySQL is scalable and capable of handling more than 50 million rows. This is enough to
handle almost any amount of data. Although the default file size limit is 4GB but it can
be increased to 8TB.
MySQL allows transactions to be rolled back.
MySQL is very flexible as it supports a large number of embedded applications.
RDBMS:
RDBMS is the collection of programs and capabilities that enables the user to interact with a
relational database. A relational database management system (RDBMS) is a type of DBMS
with a row-based table structure. Most commercial RDBMSes use SQL. The most basic
RDBMS functions are related to create, read, update and delete operations, collectively
known as the CRUD cycle.
Features of RDBMS:
7
2. SYSTEM STUDY
System analysis aims at establishing requests for the system to be acquired, developed
and installed. It involves studying and analyzing the ways of an organization currently
processing the data to produce information. Analyzing the problem thoroughly forms the vital
part of the system study.
8
2.2. PROPOSED SYSTEM
9
3.SYSTEM DESIGN AND DEVELOPMENT
INPUT FORMS
Home page
This technic can be used to find the available of pets and other contacts.
Admin page
10
Customer registration form
OUTPUT FORM
View customers
This form is used to view the customers details.
View products
This form is used to view the products details.
View order details
This form is used to view the order detail
11
3.4 DATABASE DESIGN
Databases are structures that hold data. The software that enables the flow of data
through these structures is called database management system or DBMS. The most
widely used system of DBMS is something called RDBMS or Relational DBMS. This
simply means that the data is stored in tables, moreover. Whatever relationships that exist
within the data are stored Within tables. To put it simply, there are three parts that make a
database:
Tables
We all know what tables are - a matrix of rows and columns. In databases, it’s the same.
Each row is a record, or a unit of data. A record (row) can have several columns or fields.
Each field is like an attribute of that record.
Queries
Query is a question posed to the database, to retrieve a specific set of records, based on
conditions supplied in the query.
Views
These are virtua1 tables, or (a set of) stored queries. At a physical level, the data is stored
in data files specific to the DBMS. Examples of modern-day RDBMSs that are wide1y
used include Oracle, MySQL, etc. Oracle is the largest commercially available RDBMS
and MySQL) is a free and open source RDBMS that is very Well-known.
There are five types of SQL commands: DDL, DML, DCL, TCL, and DQL
12
Data Definition Language (DDL)
DDL changes the structure of the table like creating a table, deleting a table, altering a
table, etc.
All the command of DDL are auto-committed that means it permanently save all the
changes in the database.
DML commands are used to modify the database. It is responsible for all form of changes
in the database.
The command of DML is not auto-committed that means it can't permanently save all the
changes in the database. They can be rollback.
DCL commands are used to grant and take back authority from any database user.Here are
some commands that come under DCL:
Grant
Revoke
TCL commands can only use with DML commands like INSERT, DELETE and UPDATE
only.
13
These operations are automatically committed in the database that's why they cannot be used
while creating tables or dropping them.DQL is used to fetch the data from the database.
SELECT
Customer Registration
This table is used to store the customer registration details.
Product
This table is used to store the product(pets) details.
Order details
This table is used to store the pets order details.
Pets add details
This table is used to store the new pets details.
14
3.5 SYSTEM DEVELOPMENT
A system development project encompasses all the activites undertaken from the time at
which a potential requirement is identified until the resulting system is fully implemented and
accepted by the user.The process can involve many stages over a long period. The following
section highlights some fundamentals issues to be considered, outlines the main stages in
development and procuring new system, and indicates when and how the auditor should be
involved.
An information system acquired today must not only satisfy present business needs it
must also be flexible and capable of being enhanced to meet changing circumstances well into
the future.Thus a pre-requisite to the introduction of a new system is for management to identify
and understand their organization’s mission and its related information needs. Writing this down
helps to ensure common understanding and direction, and provides a yardstick against which
achievements can be measured.
The first step in which the analyst must undertake is to understand the current system by
gathering all information about it. The required data are collected by several method like.
Study of the current manuals
Observation of the functioning
Sampling and Research
15
3.5.2 DESCRIPTION OF MODULES
Admin
In this module the Administrator has the privileges to add all the customer details, pet
details, payment and prize details. He can search all the info about the Order and
Customer.User without username and password enter into the login is only the authenticated
user then can enter to login.
Authentication contains all the information about the authentication user. User without
user name and password cannot enter into the login if is only the authentication user then
enters to login.
Customer Registration
The customer registration module contains the details customer such as customer name,
contact no ,amount, and status.
Product Categories
The products are arranged and can be viewed in categories. This Module contain
product name, description, prize and add cart.
Add to cart
Users can add pets and birds products to cart. This module contain prize and pets
quantity details
Reports
This module contains all the information about the reports generated by the admin
based on the particular user, particular customer, and all pets all request by user.
16
4. TESTING AND IMPLEMENTATION
Software Testing is a critical element of software quality assurance and represents the
ultimate review of specification, design and code generation. System testing is the stage of
implementation, which is aimed at ensuring that the system works accurately and efficiently
before live operation commences. Testing not only has to uncover errors introduced during
coding, but also locates errors committed during the previous phase. Thus the aim of testing is
to uncover requirements, design or coding errors in the program.
TESTING STRATEGIES
Unit Testing
This is also known as ‘module’ testing. The modules of the system are testing separately.
This testing is carried out during programming stage itself. In this testing step each module is
found to be validation checks for verifying the data input given the user which both the formal
and validity of the entered.
Integration Testing
Data can be lost across an interface; one module can have an adverse effort on the other
sub functions, when combined may not produces the desired major functions. Integrated testing
is the systematic testing for constructing the uncover errors within the interface. This testing was
done with sample data. The developed system has run successful for this sample data. The need
for integrated test is to find the overall system performance.
17
User Acceptance Testing
Acceptance testing is a key factor to the success of any system. The system, under the
consideration was treated for user acceptance by constantly keeping in touch with the
prospective system user at the time of developing and making changes where ever & when ever
required.
Data Validation is the process of testing the accuracy of data; a set of rules you can apply
to a control to specify the type and range of data that users can enter .It can be used to display
error alerts when users enter incorrect values into a form. Rather than checking for errors after a
form is completed, data validation verifies values as the form is being filled out.
A software testing strategy should be flexible enough to promote a customized testing
approach. it must be rigid enough to promote reasonable planning and management tracking as
the project progresses The general characteristics of software testing strategies are:
White box testing strategy deals with the internal logic and structure of the code. White
box testing is also called as glass, structural, open box or clear box testing. The tests written
based on the white box testing strategy incorporate coverage of the code written, branches, paths,
statements and internal logic of the code etc.
18
Black box Testing
Black Box Testing is not a type of testing; it instead is a testing strategy, which does not
need any knowledge of internal design or code etc. As the name "black box" suggests, no
knowledge of internal logic or code structure is required. The base of the Black box testing
strategy lies in the selection of appropriate data as per functionality and testing it against the
functional specifications in order to check for normal and abnormal behavior of the system. Now
a days, it is becoming common to route the Testing work to a third party as the developer of the
system knows too much of the internal logic and coding of the system, which makes it unfit to
test the application by the developer.
Testing Objectives
There are several rules that can serve as testing objectives. They are:
Testing is the process of executing a program with the intent of finding an error.
A good test case is one that has high probability of finding an undiscovered error
A successful test is one that uncovers an undiscovered error.
SYSTEM IMPLEMENTATION
Implementation is the process of having the system personnel check out and put new
equipment to use, train the users to use the new system and construct any file that are needed to
see it. The final and impartment phases in the system life cycle are the implementation of the
new system. System implementation refers to the steps necessary to install a new system to put
into operation.
19
The implementation has different meaning, ranging from the conversion of a basic
activities that take place to convert from old system to new one. The new system may be totally
existing system.
The methods of implementation and time scale adopted are found out initially. Proper
Successful implementations may not guarantee improvement in the organization using the new
system, but it will prevent improper installation. The implementation involves the following
things:
Careful planning
20
5. CONCLUSION AND FUTURE ENHANCEMENTS
Conclusion As part of the project detailed study has been made about the designing and
development aspects of the project “ONLINE PETSHOP MANAGEMENT SYSTEM”
which is an opening to the component world of computerization. The project has to meet all
the requirements that were collected during analysis and designing phase. In this project,
designing a simple platform for buying and selling pets... The project is developed in such a
way that it is able to undergo future enhancement in reliable, secure manner. The successful
completion of this project has expanded my boundaries of imagination, invoked confidence,
raised my creativity and has provided with knowledge and experience.
Future Scope
Following features can be upadated in Future ˆ
To include all varieties of breeds. ˆ
Home delivery of pet accessories. ˆ
An in-app chat option between the seller and buyer..
21
BIBLIOGRAPHY
REFERRED BOOK
Brain Ward “Wicked Cool PHP “ 2005 Edition.
David Sklar and Adam “PHP Cookbook “ Second Edition
.Elise M.Award ”System Analysis And Design “Secont Edition
Luke Weeeling,LauraThmson “PHP and My_SQL Web Development”3rd
Edition Mario Luring ”PHP Reference Beginner to Intermediate PHP” 3rd
Edition
W.J.GilmoreBeginning “PHP and My_SQL “3rd Edition
REFERRED WEBSITE
www.teamtreehouse.com
www.pluralsight.com/courses/build-dynamic
www.codeconquest.com
www.freewebmasterhelp.com
www.w3schools.com
22
APPENDICES
LEVEL 1
s
(Fig No:1)
23
LEVEL 2
View
customers Customer
Details
View Order
order Details
Administrator Login
Update
product Product
Details
Edit
product Details
(Fig No:2)
24
B.TABLE STRUCTURE
TABLE NO :1
TABLE NAME : ADMIN
PRIMARY KEY : id
PURPOSE : This table is used to store the admin login details.
id Varchar 20 Adminid
25
TABLE NO :2
TABLE NAME : customer
PRIMARY KEY : cusid
PURPOSE : This table is used to store the customer registration details.
26
TABLE NO :3
TABLE NAME : Prodcuts
PRIMARY KEY : poid
PURPOSE : This table is used to store the product details.
27
TABLE NO :4
TABLE NAME : order
PRIMARY KEY : orid
PURPOSE : This table is used to store the order details.
28
C.SAMPLE CODING
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="">
<meta name="author" content="">
<link href="../images/foods/logo.png" rel="shortcut icon">
<title>ADMIN | Petshop Online Website</title>
30
<li class="dropdown"><a class="dropdown-toggle wow fadeInDown"
data-toggle="dropdown" href="#"><span class="glyphicon glyphicon-th"></span>
Product <span class="caret"></span></a>
<ul class="dropdown-menu">
<li><a href="addcnp.php"> Add Product </a></li>
<li><a href="update_cnp.php"> Update Product </a></li>
</ul>
</li>
<li id="reservation" class=" active wow fadeInDown"><a
href="index.php"><span class="glyphicon glyphicon-calendar"></span>
Orders</a></li>
<li id="admin" class="wow fadeInDown"><a
href="adminacc.php"><span class="glyphicon glyphicon-user"></span> Admin
Account</a></li>
<li id="logout" class="wow fadeInDown"><a id="logoutbtn" href='<?php
echo "logout_process.php?logout=1"?>'><span class="glyphicon glyphicon-
share"></span> Logout</a></li>
</ul>
</div>
</div><!--/.container-->
</nav><!--/nav-->
<br>
<div class="container">
<form id="formFilter" name="formFilter" action="admin_reservefilter.php"
method="POST" class="pull-left col-md-7 hidden-print">
31
<select name="filter" id="filter" class="form-control">
<option value="New">New</option>
<option value="cancel">Cancel</option>
<option value="completed">Completed</option>
</select>
</div>
</div>
</form>
32
tags"></span> Address </th>
<th style="text-align:center;"><span class="glyphicon glyphicon-
phone"></span> Contact </th>
<th style="text-align:center;"><span class="glyphicon glyphicon-
time"></span> Time </th>
</tr>
</thead>
<tbody id="tablebody">
<?php include('includes/dbconn.php');
$stat = 'new';
$total = 0;
$sql = ("SELECT tblcnp.*,tblorders.*
FROM tblorders LEFT JOIN
tblcnp ON tblorders.cnpoid = tblcnp.id WHERE
tblorders.ostatus = 'New' order by tblorders.id LIMIT 0,30 ") or die (mysqli_error());
$result=mysqli_query($con, $sql);
if(mysqli_num_rows($result)>0){
while($row = mysqli_fetch_assoc($result)){
$total = $row['prize'] * $row['oqty'];?>
<tr class="success" style="cursor:pointer;">
<td style="text-align:center;"><a href="#viewModal<?php echo $row['id']?>"
data-toggle="modal" data-target="#viewModal<?php echo $row['id']?>" class="btn btn-
default"><i class="glyphicon glyphicon-search"></i> View</a></td>
<td style="text-align:center;"><?php echo $row['cname'];?></td>
<td style="text-align:center;"><?php echo $row['name'];?></td>
<td style="text-align:center;"><?php echo $row['address'];?></td>
<td style="text-align:center;"><?php echo $row['contact'];?></td>
33
<td style="text-align:center;"><?php echo $row['timestamp'];?></td>
</tr>
?>
<!-- Modal -->
<div class="modal fade" id="viewModal<?php echo $row['id']?>" tabindex="-1"
role="dialog" aria-labelledby="myModalLabel">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-
label="Close"><span aria-hidden="true">×</span></button>
<h4 class="modal-title" id="myModalLabel"><i class="glyphicon glyphicon-
exclamation-sign"></i> ORDER INFORMATION</h4>
</div>
<form method="post" action="">
<div class="modal-body" id="div1">
<input type="hidden" name="fdid" value="<?php echo $row['id']?>">
<dt>Cake Ordered:</dt>
<dd><?php echo $row['name'].' ';?><img src="<?php echo $row['image']?>"
width="90px;" class="img-responsive img-rounded"></dd>
<dt>Description:</dt> <dd><?php echo $row['description'];?></dd>
<dt>Price:</dt> <dd><?php echo 'Shs. '.$row['prize'];?></dd>
<dt>Quantity:</dt> <dd><?php echo $row['oqty'];?></dd>
<dt>Total:</dt> <dd><?php echo 'Shs. '.number_format($total,2,'.',',');?></dd>
<hr style="border-top: 1px dashed #8c8b8b;
border-bottom: 1px dashed #fff;">
34
<h4 ><b>CUSTOMER DETAILS</b></h4>
<dt>Ordered by:</dt> <dd><?php echo $row['cname'].' ';?></dd>
<dt>Ordered Type:</dt> <dd><?php echo $row['otype'].' ';?></dd>
<dt>Date Pick-up:</dt> <dd><?php echo $row['datepickup'].' ';?></dd>
<dt>Date Order:</dt> <dd><?php echo $row['timestamp'];?></dd>
<dt>Address:</dt> <dd><?php echo $row['address'];?></dd>
<dt>Contact:</dt> <dd><?php echo $row['contact'];?></dd>
</div>
<em style="font-size:12px;color:red; margin-left:20px;">Note: Updated Order status
here</em>
<div class="modal-footer">
<a href="index.php" class="btn btn-default wow fadeInDown">Close</a>
<button type="button" onClick="printContent('div1');" class="btn btn-info wow
fadeInDown"><i class="glyphicon glyphicon-print"></i> Download Receipt</button>
<button type="submit" class="btn btn-danger wow fadeInDown" name="cancel"><i
class="glyphicon glyphicon-ban-circle"></i> Cancel</button>
<button type="submit" class="btn btn-success wow fadeInDown"
name="deliver"><i class="glyphicon glyphicon-send"></i> Delivered</button>
</div>
</form>
</div>
</div>
</div>
<?php }}?>
</tbody>
</table>
35
</div>
</div>
$result=mysqli_query($con, $sql);
if($result==true){
header("location:index.php");}
}
else if(isset($_POST['cancel'])){
$id = $_POST['fdid'];
$sql = ("UPDATE tblorders set ostatus = 'Cancel' WHERE id = '$id'") or die
(mysqli_error());
$result=mysqli_query($con, $sql);
if($result== true){
header("location:index.php");}
}
?>
<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>
<!--*************************************************** FOOTERS
**********************************************-->
36
<div class="container">
<div class="row">
<div class="col-sm-12">
<center>© 2019 <a target="_blank" href="#" title="#">Petshop Online
Website</a>. All Rights Reserved.</center>
</div>
</div>
</div>
</footer><!--/#footer-->
<script type="text/javascript">
$('#filter').change(function() {
$.post( $("#formFilter").attr("action"),
$("#formFilter :input").serializeArray(),
function(filter) {
//alert (filter);
$("#tablebody").empty();
$("#tablebody").html(filter);
});
$("#formFilter").change( function() {
return false;
});
});
</script>
</body>
</html>
Dbconnection.php
37
<?php
/* Database config */
$db_host = 'localhost';
$db_user = 'root';
$db_pass = '';
$db_database = 'dbcnb';
/* End config */
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="">
<meta name="author" content="">
<link href="images/foods/logo.png" rel="shortcut icon">
<title> Online Petshop Management System</title>
38
<link href="css/responsive.css" rel="stylesheet">
</head><!--/head-->
<body>
<nav class="navbar navbar-inverse" role="banner">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-
target=".navbar-collapse">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
</div>
<a href="index.php"><h5 class="wow fadeInDown" style="margin-top:20px;
color:#FFF;"><img src="images/logo.jpg" width="15% "/> Sweet and healthy
cakes</h5></a>
<div class="collapse navbar-collapse navbar-right wow fadeInDown">
<ul class="nav navbar-nav">
<li><a href="available.php">Availables</a></li>
<li><a href="contacts.php">Contacts</a></li>
<li>
<a data-toggle="modal" data-target=".bs-example-modal-sm"
style="cursor:pointer;">Admin</a>
39
</li>
D.SAMPLE INPUT
40
Fig 2:Admin Login
41
Fig 3:Customer Registration
42
Fig 4: Add Products
43
Fig 5:Update Products
44
E .SAMPLE OUTPUT
45
Fig 7: Add card details
46
Fig 8:ViewOrder details
47
Fig 9:View Admin Account details
48
Fig 10:ViewOrder Complete status
49