100% found this document useful (3 votes)
5K views107 pages

Final REPORT PHARMACY MANAGEMENT SYSTEM

Pharmacy management system report

Uploaded by

Punith Thirtha
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (3 votes)
5K views107 pages

Final REPORT PHARMACY MANAGEMENT SYSTEM

Pharmacy management system report

Uploaded by

Punith Thirtha
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

THE OXFORD COLLEGE OF SCIENCE

DEPARTMENT OF COMPUTER SCIENCE & APPLICATIONS

(AFFLIATED TO BANGALORE UNIVERSITY)


No.32, 17th B Main, Sector-IV, HSR Layout, Bangalore-560102

PROJECT REPORT
ON
PHARMACY MANAGEMENT SYSTEM

Submitted by

PUNITH G THIRTHA(18RNSB7144)
RAKESH.R(18RNSB7150)

Under The Guidance Of

MISS DIVYA GUPTA

Project report submitted in partial fulfillment of the requirements of Semester Fifth

BCA, Bangalore University

January -2021
THE OXFORD COLLEGE OF SCIENCE

DEPARTMENT OF COMPUTER SCIENCE & APPLICATION

(
(AFFILIATED TO BANGLORE UNIVERSITY)
th
No.32, 17 B Main, Sector-IV, HSR Layout, Bangalore-560102

CERTIFICATE

This is to certify that the report titled Pharmacy Management System is a bona fide record of work
Done by PUNITH G THIRTHA(18RNSB7144) and RAKESH .R (18RNSB7150) of
The Oxford college of science,Bangalore,in partial fulfillment of the requirements of
Fifth semester of BCA during the year 2021

Head of the Deparment Project Guide


Valued By

1. Name : PUNITH G THIRTHA

Register Number :18RNSB7144

Name: RAKESH . R

Register Number : 18RNSB7150


2.
Examination center :THE OXFORD
COLLEGE OF SCIENCE

Date of exam:
ACKNOWLEDGEMENT

We are thankful to [Link] Shree principal of The Oxford College of Science,


who provided us all the required facilities to accomplish the project in time.

We endure our Humble and sincere gratitude to Dr. Susil Kumar Sahoo,
department of computer application(HOD) for his great encouragement and
valuable support.

we offer our sincere to our guide [Link] Gupta who has always given us a
constant source of inspiration and encouragement during course of our project.

We would also like to mention the greatfullness of our parents blessings of which we
are able to acess and enjoy such opportunities.

Last but not the least we thank our management and lab coordinator for providing us
the support to complete the project. We would like thank each and everybody who
supported us throughout the long and attention consuming project.
ABSTRACT
PHARMACY MANAGEMENT SYSTEM is a software. This software is designed
to attend all the needs of the retailer owning the enterprise where the retailer needs to
keep an account of the suppliers, stocks, employee details, raw materials and all the
accounts required.

Here we are providing the opportunity for the retailer to order all the necessary raw
materials from the supplier which he can choose, the retailer can check the stock
available, employee details and the retailer can add the supplier he likes and order the
stock as per the requirements. This takes out the long and tedious process of calling
and enquiring each and every supplier.

Retail shop owners would benefit from this software. This acts as an interface
between the supplier and the retailer.
CONTENT

1. INTRODUCTION………………………………………………………1

1.1 Project Decscription………………………………..................... 3

1.2 Types of modules………………………………………………... 3

[Link] REQUIREMENTS………………………………….4

2.1 Existing System and Proposed system………………………………… 5

2.1.1 Tools and Techonologies used………………………………................6

2.2 Hardware and software Requirements………………………………... 12

[Link] SPECIFICATION…………………………………….13

3.1 Software Requirments……………………………………………………15

3.1.1 Functional Requirments……………………………………….. 15

3.1.2 Non-Functional Requirments…..………………………………16

3.1.3 Modular Design………...………………………………………..17


3.2 System Design…………………………………………………………….18

3.2.1 Data Flow Daigram….…………………………………………..19

3.2.2 E-R Diagram……………………………………………………..20

4. IMPLEMENTATION DETAILS……………………………......21

4.1 Coding……………………………………………………………………. 22

4.2 Screenshots………………………………………………………………...94

5. TESTING………………………………………………………....98

5. Software testing……………………………………………………………..98

6. CONCLUSION…………………………………………………..100

[Link]……………………………………………………..101
PHARMACY MANAGEMENT SYSTEM

INTRODUCTION

Department of Computer Science and Applications Page |1


PHARMACY MANAGEMENT SYSTEM

[Link]
Today’s the technology is grown very vast speed therefore the work for the pharmacy
to is becoming very much so to do the work in an accurate way and to improve the
accuracy of the work and to make it more secure and safety pharmacy management
system was developed which manages the work flow of the pharmacy. This pharmacy
is still doing their work manually. Therefore the pharmacy needs many workers to
monitor all the process and to check the presence of each drug in the pharmacy.

So when any new drugs are new batches arrive in the pharmacy the manual entry is
done in the register. And this is fallowed when the drug is given to any patients. When
the month is completed the workers in the pharmacy have to generate the list or report
Manually of the drugs in the pharmacy shop .This work is done to maintain the
required stock in the pharmacy .This kind of work may lead to the mistakes by
workers and lead to a major problem.

Therefore to solve this problem the urgent need is to develop the pharmacy
management system that will prove beneficial for the pharmacy ,by using this
software we can generate bill, maintain the stock very well ,we can also do cost
saving and inventory control.

There are two main requirements of the software that is to manage the stock of the
pharmacy and another is that it must produce the separate report of purchase ,sales
and the stock, this work will be done in five phases they are two design database,
design of all algorithm that are necessary implementation and testing of all the system
is done and the blast one is to produce the software in the market

 Provide an effective and an efficient performance.

 The user view of the system will be a number of interactive windows


Forms implemented in visual basic.

 It is critical that data validation and error trapping is comprehensive.

 Ensure that the input is acceptable to and understood by the staff.

Assume you are an individual to develop this system, which leads you to perform
as a project manager, system analyst , programmer, etc.....

Department of Computer Science and Applications Page |2


PHARMACY MANAGEMENT SYSTEM

1.1 PROJECT DISCRIPTION


The present the innovation is developing at an extremely high speed in this manner
the work of the pharmacy is ending up so especially so to take the necessary steps in
the exact route and to enhance the exactness of the work and to make it more secure
and well being pharmacy administration.

Framework was produced which deals with the work stream of the pharmacy. This
pharmacy is as yet doing their entire work physically. In this way the pharmacy needs
numerous labourers to screen all the procedure and to check the nearness of the
medication in pharmacy.

So when the new medications or new clumps of the medication land in the pharmacy
the manual section is done in the enlist. What’s more, this likewise took after when
the medication is given to the patients. at the point when the month is finished the
labourers in the pharmacy need to create the rundown or report physically of the
medication in the pharmacy. This sort work may prompt oversight by specialist and
prompt a noteworthy issue.

A long these lines to tackle this sort of issue the dire need is to build up a pharmacy
administration framework that will demonstrate advantageous for the pharmacy .by
utilizing this product we can create change, keep up the stock exceptionally well, we
can do cost sparing and keep up stock control.

There are two primary prerequisite of the product that is must deal with the load of the
pharmacy and another is that it must create the different report of procurement, deals
and the stock. This work will be done in five stages they are to outline database, plan
of all algorithm that are important ,usage and after testing of all the framework is done
and last one is to deliver the product in the market.

1.2 Types of modules in the project:

 Inventory management
 Dealer management
 Stock management
 Costumer management
 Sell/purchase management
 Billing payment management
 Reports
 Charts

Department of Computer Science and Applications Page |3


PHARMACY MANAGEMENT SYSTEM

SYSTEM REQUIRMENTS

Department of Computer Science and Applications Page |4


PHARMACY MANAGEMENT SYSTEM

2. SYSTEM REQUIRMENTS

2.1 EXISTING AND PROPOSED SYSTEM


Existing system

An existing system refers to the system that the being followed by now, the pharmacy
is working manually. The current system is time consuming and also it is very costly,
because it all involves a lot of paperwork. To manually handle the system was very
difficult task. but now a day’s computerizing made easy to work.

The following all the reasons why the current system should be computerized:

 To increase efficiency with reduced cost


 To reduce the burden of paper work
 To save time management for recording details of each and every member and
employee
 To generate required reports easily

Proposed system
The online pharmacy management system is user friendly application. This automated
system makes all functionality easier for both owners and costumers. It is very simple
in design and to implement. The system requirements are very low. System resources
and the system will work in all the configurations.

Enhancements:
The main objective of the pharmacy management system is to enhance and upgrade
the existing system by increasing the efficiency and effectiveness. The software
improves the working methods by replacing manual system with the computer based
system.

Automation:
The smart the pharmacy management system automates each and every activity of the
manual system and increases its throughput. Thus the response time of the system is
very less and it works very fast.

Accuracy:
The smart management system provides the uses the quick response with very
accurate information regarding the users etc, any details or system in an accurate
manner, as when required.

Department of Computer Science and Applications Page |5


PHARMACY MANAGEMENT SYSTEM

User friendly:
The software smart pharmacy management system has very friendly interface.
Thus the users will feel very easy to work on it. The software provides the accuracy
along with the pleasant interface. Make the present manual system more interactive,
speedy and user friendly.

Availability:
The transaction reports of the system can be retried as and when required.
Thus, there is no delay in the availability of any information, whatever needed,can be
captured very quickly and easily.

2.1.1 TOOLS AND TECHNOLOGY USED

 PHP

What is PHP?
 PHP is an acronym for "PHP: Hypertext Preprocessor"
 PHP is a widely-used, open source scripting language
 PHP scripts are executed on the server
 PHP is free to download and use

What is a PHP File?


 PHP files can contain text, HTML, CSS, JavaScript, and PHP code
 PHP code are executed on the server, and the result is returned to the browser as plain
HTML
 PHP files have extension ".php"

What Can PHP Do?


 PHP can generate dynamic page content
 PHP can create, open, read, write, delete, and close files on the server
 PHP can collect form data
 PHP can send and receive cookies
 PHP can add, delete, modify data in your database
 PHP can be used to control user-access
 PHP can encrypt data

With PHP you are not limited to output HTML. You can output images, PDF files, and
even Flash movies. You can also output any text, such as XHTML and XML.

Department of Computer Science and Applications Page |6


PHARMACY MANAGEMENT SYSTEM

Why PHP?
 PHP runs on various platforms (Windows, Linux, Unix, Mac OS X, etc.)

PHP started out as a small open source project that evolved as more and more people
found out how useful it was. Rasmus Lerdorf unleashed the first version of PHP way
back in 1994.

 PHP is a recursive acronym for "PHP: Hypertext Preprocessor".

 PHP is a server side scripting language that is embedded in HTML. It is used to manage
dynamic content, databases, session tracking, even build entire e-commerce sites.

 It is integrated with a number of popular databases, including MySQL, PostgreSQL,


Oracle, Sybase, Informix, and Microsoft SQL Server.

 PHP is pleasingly zippy in its execution, especially when compiled as an Apache module
on the Unix side. The MySQL server, once started, executes even very complex queries
with huge result sets in record-setting time.

 PHP supports a large number of major protocols such as POP3, IMAP, and LDAP.
PHP4 added support for Java and distributed object architectures (COM and CORBA),
making n-tier development a possibility for the first time.

 PHP is forgiving: PHP language tries to be as forgiving as possible.

 PHP Syntax is C-Like.

Common uses of PHP


 PHP performs system functions, i.e. from files on a system it can create, open, read,
write, and close them.

 PHP can handle forms, i.e. gather data from files, save data to a file, through email you
can send data, return data to the user.

 You add, delete, modify elements within your database through PHP.

 Access cookies variables and set cookies.

 Using PHP, you can restrict users to access some pages of your website.

 It can encrypt data.

Department of Computer Science and Applications Page |7


PHARMACY MANAGEMENT SYSTEM

Characteristics of PHP

Five important characteristics make PHP's practical nature possible −

 Simplicity

 Efficiency

 Security

 Flexibility

 Familiarity

 PHP is compatible with almost all servers used today (Apache, IIS, etc.)
 PHP supports a wide range of databases
 PHP is free. Download it from the official PHP resource: [Link]
 PHP is easy to learn and runs efficiently on the server side

 CSS

Cascading Style Sheets, fondly referred to as CSS, is a simple design language


intended to simplify the process of making web pages presentable.

CSS handles the look and feel part of a web page. Using CSS, you can control the
color of the text, the style of fonts, the spacing between paragraphs, how columns are
sized and laid out, what background images or colors are used, layout
designs,variations in display for different devices and screen sizes as well as a
variety of other effects.

CSS is easy to learn and understand but it provides powerful control over the
presentation of an HTML document. Most commonly, CSS is combined with the
markup languages HTML or XHTML.

Advantages of CSS
 CSS saves time − You can write CSS once and then reuse same sheet in multiple HTML
pages. You can define a style for each HTML element and apply it to as many Web
pages as you want.

 Pages load faster − If you are using CSS, you do not need to write HTML tag attributes
every time. Just write one CSS rule of a tag and apply it to all the occurrences of that
tag. So less code means faster download times.

 Easy maintenance − To make a global change, simply change the style, and all elements
in all the web pages will be updated automatically.

Department of Computer Science and Applications Page |8


PHARMACY MANAGEMENT SYSTEM

 Superior styles to HTML − CSS has a much wider array of attributes than HTML, so
you can give a far better look to your HTML page in comparison to HTML attributes.

 Multiple Device Compatibility − Style sheets allow content to be optimized for more
than one type of device. By using the same HTML document, different versions of a
website can be presented for handheld devices such as PDAs and cell phones or for
printing.

 Global web standards − Now HTML attributes are being deprecated and it is being
recommended to use CSS. So its a good idea to start using CSS in all the HTML pages
to make them compatible to future browsers.

Who Creates and Maintains CSS?


CSS is created and maintained through a group of people within the W3C called the
CSS Working Group. The CSS Working Group creates documents called
specifications. When a specification has been discussed and officially ratified by the
W3C members, it becomes a recommendation.

These ratified specifications are called recommendations because the W3C has no
control over the actual implementation of the language. Independent companies and
organizations create that software.

CSS Versions
Cascading Style Sheets level 1 (CSS1) came out of W3C as a recommendation in
December 1996. This version describes the CSS language as well as a simple visual
formatting model for all the HTML tags.

CSS2 became a W3C recommendation in May 1998 and builds on CSS1. This
version adds support for media-specific style sheets e.g. printers and aural devices,
downloadable fonts, element positioning and tables.

 JAVA SCRIPT

What is JavaScript ?
Javascript is a dynamic computer programming language. It is lightweight and most
commonly used as a part of web pages, whose implementations allow client-side
script to interact with the user and make dynamic pages. It is an interpreted
programming language with object-oriented capabilities.

JavaScript was first known as LiveScript, but Netscape changed its name to
JavaScript, possibly because of the excitement being generated by Java. JavaScript

Department of Computer Science and Applications Page |9


PHARMACY MANAGEMENT SYSTEM

made its first appearance in Netscape 2.0 in 1995 with the name LiveScript. The
general-purpose core of the language has been embedded in Netscape, Internet
Explorer, and other web browsers.

The ECMA-262 Specification defined a standard version of the core JavaScript


language.

 JavaScript is a lightweight, interpreted programming language.

 Designed for creating network-centric applications.

 Complementary to and integrated with Java.

 Complementary to and integrated with HTML.

 Open and cross-platform

Client-side JavaScript
Client-side JavaScript is the most common form of the language. The script should
be included in or referenced by an HTML document for the code to be interpreted by
the browser.

It means that a web page need not be a static HTML, but can include programs that
interact with the user, control the browser, and dynamically create HTML content.

The JavaScript client-side mechanism provides many advantages over traditional


CGI server-side scripts. For example, you might use JavaScript to check if the user
has entered a valid e-mail address in a form field.

The JavaScript code is executed when the user submits the form, and only if all the
entries are valid, they would be submitted to the Web Server.

JavaScript can be used to trap user-initiated events such as button clicks, link
navigation, and other actions that the user initiates explicitly or implicitly.

Advantages of JavaScript
The merits of using JavaScript are −

 Less server interaction − You can validate user input before sending the page off to the
server. This saves server traffic, which means less load on your server.

 Immediate feedback to the visitors − They don't have to wait for a page reload to see if
they have forgotten to enter something.

 Increased interactivity − You can create interfaces that react when the user hovers over
them with a mouse or activates them via the keyboard.

Department of Computer Science and Applications P a g e | 10


PHARMACY MANAGEMENT SYSTEM

 Richer interfaces − You can use JavaScript to include such items as drag-and-drop
components and sliders to give a Rich Interface to your site visitors.

 JQUERY
JQuery
If you’ve spent any time at all trying to add dynamic functionality to your pages (as well

as figure out browser differences), you’ve found that you’re constantly following a
pattern of selecting an element or group of elements and operating upon those elements
in some fashion.

You could be hiding or revealing the elements, adding a CSS class to them,animating
them, or modifying their attributes.

Using raw JavaScript can result in dozens of lines of code for each of these tasks. The
creators of jQuery specifically created the library to make common tasks trivial.

Jquery is one of the most popular JavaScript libraries around and was created by John
Resig during his college days at the Rochester Institute of Technology.

The core features of Jquery

• Gives developers a common set of functions for all browsers.


• Uses selectors which is an expression for identifying target elements on a page that
allows us to easily identify and grab the elements we need
• Gives access to page elements without having to wait for all images to load in place of
using the browser’s onload event, which delays anything you do until the page is fully
loaded.
• Contains enhancements to basic JavaScript constructs such as iteration and array
manipulation.

 MY SQL

MySQL Database
MySQL is a fast, easy-to-use RDBMS being used for many small and big businesses.
MySQL is developed, marketed and supported by MySQL AB, which is a Swedish
company. MySQL is becoming so popular because of many good reasons −

 MySQL is released under an open-source license. So you have nothing to pay to use it.

 MySQL is a very powerful program in its own right. It handles a large subset of the
functionality of the most expensive and powerful database packages.

Department of Computer Science and Applications P a g e | 11


PHARMACY MANAGEMENT SYSTEM

 MySQL uses a standard form of the well-known SQL data language.

 MySQL works on many operating systems and with many languages including PHP,
PERL, C, C++, JAVA, etc.

 MySQL works very quickly and works well even with large data sets.

 MySQL is very friendly to PHP, the most appreciated language for web development.

 MySQL supports large databases, up to 50 million rows or more in a table. The default
file size limit for a table is 4GB, but you can increase this (if your operating system can
handle it) to a theoretical limit of 8 million terabytes (TB).

 MySQL is customizable. The open-source GPL license allows programmers to modify


the MySQL software to fit their own specific environments.

2.1.2 HARDWARE AND SOFTWARE REQUIRMENTS


 HARDWARE REQUIRMENTS:
Processor : Duel Core 2.2 Ghz.

Hard disk : 160 Gigabytes

RAM : 1 Gigabyte

Device : Android smart Phone/Tablet

 SOFTWARE REQUIRMENTS:
Language used : PHP

Other Technology : HTML, CSS, JavaScript, JQuery, Bootstrap

Operating system : PHPMyAdmin, XAMPP

Backend : MySQL

Department of Computer Science and Applications P a g e | 12


PHARMACY MANAGEMENT SYSTEM

DESIGN SPECIFICATION

Department of Computer Science and Applications P a g e | 13


PHARMACY MANAGEMENT SYSTEM

[Link] SPECIFICATION

The section of the software requirements is proposed to fill in as a guide that clarifies
the centrality of producing compact prerequisites for a versatile application and in
addition, depicts the procedure of necessary definition. The target group of this report
is anybody with pre deals and additionally delivery oriented business including the
individuals who are in charge of characterizing necessities.

Software requirements specification records and portrays all the key features of an
application and clarifies that the objective application ought to have the capcity to
perform the significance of having an appropriate necessity detail cant be exaggerated
numerous applications come up short on the grounds.

A particular is an archive that gives an entire portrayal of the usefulness of the


specialized arrangement the detailed answers the accompanying inquiries: how does
the application work? How does the costumer/shopper is should be tended to in the
application? The most critical goal of the necessary detail practice is to unmistakably
characterize the costumer/shopper issue so that the UI plan and advance group can
begin application outline and fabricate exercises.

The principle input expected to make a prerequisite detail is a mode information


separated from shopper/costumer : the costumers present needs, issues that require
arrangements, purchase patterns and forth since the detail is such a basic component
in the application creation is utilized by the people engaged with the undertaking .
the implementation team, user experience interface designers, the advertising group
and the testing group to give some example assistants.

Users

According to the application profile, this is management software, which covers


inventory , various login shells , billing etc.

Department of Computer Science and Applications P a g e | 14


PHARMACY MANAGEMENT SYSTEM

3.1 SOFTWARE REQUIRMENTS

3.1.1 FUNCTIONAL REQUIRMENTS:

Functional requirements has been described in this project based on the highlights and
functionalities of the application. It is, for the most part, a smart thought to begin with
the generally unique state useful prerequisite that can be separated into a few lower-
level necessities.

Operational prerequisites portray how the system, will interact with the operations
personnel. Recognize inclinations from necessities. Prerequisites depend on the
business needs provided by the clients. Especially based on the eblast.

Inclinations are most certainly not in the event that, for instance, the client
communicates a want for the sub second reaction yet does not have the email
marketing related explanation behind requiring it, that requirement is an inclination.

FUNCTIONAL REQUIRMENTS ID 3.1.1

Name the functional requirement : report authorization


Description It is the procedure of checking the substantial
access.
Assumptions User name will be existing
Valid username and password.
Impact Must enter the proper username and password

Primary actor Enrolled user

Input Username and password

Action Define the expected input that the system must


be able to process.

Output Successful logins

Expectations User access approval

Dependencies Sign up new users


Sign in existing users
Access under information

Department of Computer Science and Applications P a g e | 15


PHARMACY MANAGEMENT SYSTEM

FUNCTIONAL REQUIRMENTS ID 3.1.1

Name the functional requirement : report retrieval


Description Notify regarding the status and the service.

Assumptions Displaying of new requests for the service.

Impact Notify about the complete service are retrieved.

Primary actor Enrolled personal assistant.

Input Logged in.

Action Retrieving the report.

Output Reference number date and time are sent as


notifications.

Expectations Delivery of notification on time.

Dependencies Push notifications.

3.1.2 NON FUNCTIONAL REQUIRMENTS:

Non functional requirements presents an efficient and down to the business way to
deal with building quality into programming systems. System must display
programming quality properties
.
None the less such non functional requirements are hard address in numerous
undertakings, despite the fact that there are numerous strategies to meet useful
prerequisites with a specific end goal to give wanted usefulness.

This is especially valid since the non functional requirements for every system
associate with each other, broadly affect the system and might be subjective.
To empower designers to deliberately manage a systems different non functional
requirements, this section displays the non functional requirement system.

Department of Computer Science and Applications P a g e | 16


PHARMACY MANAGEMENT SYSTEM

Performance:
 Portray the prerequisites for the accompanying:
 Response time for the inquiries and updates
 Throughput
 The expected rate of client action (for instance, number of exchanges every hour,
day ,or month )

Adaption to non critical failure:

Adaption to non critical failure is the capacity to remain mostly operational amid a
disappointment, portray the following in this area:
 Which capacities don’t should be accessible consistently?
 If a segment comes up short, what (assuming any) capacities should the
application keeps on pro.

3.1.3 MODULAR DESIGN

Department of Computer Science and Applications P a g e | 17


PHARMACY MANAGEMENT SYSTEM

3.2 SYSTEM DESIGN

SYSTEM PRESCRIPTIVE
In accordance to the system prescriptive, software development as a rule, continues in
one of the two ways: either the software engineer works alone in outlining, actualizing
and testing a product system, or he is the individual from the gathering of from three
up to a few hundred, cooperating on a vast programming system. In spite of the fact
that product designing grasps both methodologies, here we are integrated basically in
substantial scale programme advancement. It is the basic connection among outline
and necessities building as it is distinguishes the fundamental basic parts in a system
and connection between them.

3.2.1 ARCHITECTURE DIAGRAM


Architecture diagram is all about seeing how a system ought to be sorted out and
outlining the general structure of the system. In the model of the product improvement
process as appeared building process it is the basic connection amongst plan and
necessities designing as it recognizes the basic fundamental segments in a system and
connection between the them.

In lithe process it is by and large acknowledged that at the beginning time of the
improvement procedure ought to be worried about setting up a general system design.
Incremental advancement of structures isn’t generally effective . while restoring
segments in light of changes is typically moderately simple, refactoring a system
engineering is probably going to be costly.

By and by there is a critical cover between the procedure and prerequisites building
and compositional plan. In a perfect world a system determination ought to be exclude
any outline data .this is impossible side from ought little systems.

Department of Computer Science and Applications P a g e | 18


PHARMACY MANAGEMENT SYSTEM

3.2.2 Data flow diagram:

Data flow diagram, (DFD) maps out the stream of data to any procedure or
framework. It utilizes characterized images rectangles circle and arrows, plus short
text labels to show input , output , storage point and the route between the each
destination to demonstrate the information input , yields, stockpiling focuses and the
course between every goal information flowchart can go from basic , even hand
drawn process and diagrams to inside out , multi level DFD’s that delve dynamically
more into how the information is dealt with they can be utilized to break the current
system model another one like all the best outlines and diagrams, a DFD can
outwardly say things that would be difficult to clarify in words and they work in both
specialized and non technical crowds from designer to CEO.

Department of Computer Science and Applications P a g e | 19


PHARMACY MANAGEMENT SYSTEM

3.2.3 ER DIAGRAM

Department of Computer Science and Applications P a g e | 20


PHARMACY MANAGEMENT SYSTEM

IMPLEMENTATION DETAILS

Department of Computer Science and Applications P a g e | 21


PHARMACY MANAGEMENT SYSTEM

4. IMPLEMENTATION DETAILS

4.1 CODING

[Link]:

<?php
//Start session
session_start();

//Unset the variables stored in session


unset($_SESSION['SESS_MEMBER_ID']);
unset($_SESSION['SESS_FIRST_NAME']);
unset($_SESSION['SESS_LAST_NAME']);
?>
<html>
<head>
<title>
POS
</title>
<link rel="shortcut icon" href="main/images/[Link]">

<link href="main/css/[Link]" rel="stylesheet">

<link rel="stylesheet" type="text/css" href="main/css/DT_bootstrap.css">

<link rel="stylesheet" href="main/css/[Link]">


<style type="text/css">
body {
padding-top: 60px;
padding-bottom: 40px;
}
.sidebar-nav {
padding: 9px 0;
}
</style>
<link href="main/css/[Link]" rel="stylesheet">

<link href="[Link]" media="screen" rel="stylesheet" type="text/css" />


</head>
<body>
<div class="container-fluid">
<div class="row-fluid">
<div class="span4">
</div>

</div>

Department of Computer Science and Applications P a g e | 22


PHARMACY MANAGEMENT SYSTEM

<div id="login">
<?php
if( isset($_SESSION['ERRMSG_ARR']) &&
is_array($_SESSION['ERRMSG_ARR']) && count($_SESSION['ERRMSG_ARR'])
>0 ) {
foreach($_SESSION['ERRMSG_ARR'] as $msg) {
echo '<div style="color: red; text-align: center;">',$msg,'</div><br>';
}
unset($_SESSION['ERRMSG_ARR']);
}
?>
<form action="[Link]" method="post">

<font style=" font:bold Italic 45px 'Impact'; text-shadow:6px


0px 0px #03a9f4; color:#252425;"><center>Caps lock Pharmacy</center></font>
<br>
<div class="input-prepend">
<span style="height:30px; width:25px;" class="add-on"><i
class="icon-user icon-2x"></i></span><input style="height:40px;" type="text"
name="username" Placeholder="Username" required/><br>
</div>
<div class="input-prepend">
<span style="height:30px; width:25px;" class="add-on"><i class="icon-lock
icon-2x"></i></span><input type="password" style="height:40px;"
name="password" Placeholder="Password" required/><br>
</div>
<div class="qwe">
<button class="btn btn-large btn-primary btn-block pull-right"
href="[Link]" type="submit"><i class="icon-signin icon-large"></i>
Login</button>
</div>
</form>
</div>
</div>
</div>
</div>
</body>
</html>

Department of Computer Science and Applications P a g e | 23


PHARMACY MANAGEMENT SYSTEM

[Link]:

<?php
//Start session
session_start();

//Array to store validation errors


$errmsg_arr = array();

//Validation error flag


$errflag = false;

//Connect to mysql server


$link = mysqli_connect('localhost','root','');
if(!$link) {
die('Failed to connect to server: ' . mysqli_error());
}

//Select database
$db = mysqli_select_db($link, 'sales');
if(!$db) {
die("Unable to select database");
}

//Function to sanitize values received from the form. Prevents SQL injection
$login = $_POST['username'] = filter_var($_POST['username'],
FILTER_SANITIZE_EMAIL);
$password = $_POST['password'] = filter_var($_POST['password'],
FILTER_SANITIZE_STRING);
//Sanitize the POST values

//Input Validations
if($login == '') {
$errmsg_arr[] = 'Username missing';
$errflag = true;
}
if($password == '') {
$errmsg_arr[] = 'Password missing';
$errflag = true;
}

//If there are input validations, redirect back to the login form
if($errflag) {
$_SESSION['ERRMSG_ARR'] = $errmsg_arr;
session_write_close();
header("location: [Link]");
exit();

Department of Computer Science and Applications P a g e | 24


PHARMACY MANAGEMENT SYSTEM

//Create query
$qry="SELECT * FROM user WHERE username='$login' AND
password='$password'";
$result=mysqli_query($link,$qry);

//Check whether the query was successful or not


if($result) {
if(mysqli_num_rows($result) > 0) {
//Login Successful
session_regenerate_id();
$member = mysqli_fetch_assoc($result);
$_SESSION['SESS_MEMBER_ID'] = $member['id'];
$_SESSION['SESS_FIRST_NAME'] = $member['name'];
$_SESSION['SESS_LAST_NAME'] = $member['position'];
//$_SESSION['SESS_PRO_PIC'] = $member['profImage'];
session_write_close();
header("location: main/[Link]");
exit();
}else {
//Login failed
header("location: [Link]");
exit();
}
}else {
die("Query failed");
}
?>

[Link]:

<?php
/* Database config */
$db_host = 'localhost';
$db_user = 'root';
$db_pass = '';
$db_database = 'sales';

/* End config */

$db = new PDO('mysql:host='.$db_host.';dbname='.$db_database, $db_user,


$db_pass);
$db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);

?>

Department of Computer Science and Applications P a g e | 25


PHARMACY MANAGEMENT SYSTEM

[Link]:

<!DOCTYPE html>
<html>
<head>
<title>
POS
</title>
<link href="css/[Link]" rel="stylesheet">

<link rel="stylesheet" type="text/css" href="css/DT_bootstrap.css">

<link rel="stylesheet" href="css/[Link]">


<style type="text/css">

.sidebar-nav {
padding: 9px 0;
}
</style>
<link href="css/[Link]" rel="stylesheet">
<link href="../[Link]" media="screen" rel="stylesheet" type="text/css" />
<link href="src/[Link]" media="screen" rel="stylesheet" type="text/css" />
<script src="lib/[Link]" type="text/javascript"></script>
<script src="src/[Link]" type="text/javascript"></script>
<script type="text/javascript">
jQuery(document).ready(function($) {
$('a[rel*=facebox]').facebox({
loadingImage : 'src/[Link]',
closeImage : 'src/[Link]'
})
})
</script>
<?php
require_once('[Link]');
?>
<?php
function createRandomPassword() {
$chars = "003232303232023232023456789";
srand((double)microtime()*1000000);
$i = 0;
$pass = '' ;
while ($i <= 7) {

$num = rand() % 33;

$tmp = substr($chars, $num, 1);

$pass = $pass . $tmp;

Department of Computer Science and Applications P a g e | 26


PHARMACY MANAGEMENT SYSTEM

$i++;

}
return $pass;
}
$finalcode='RS-'.createRandomPassword();
?>

<script language="javascript" type="text/javascript">


/* Visit [Link] for full source code
and get more free JavaScript, CSS and DHTML scripts! */
<!-- Begin
var timerID = null;
var timerRunning = false;
function stopclock (){
if(timerRunning)
clearTimeout(timerID);
timerRunning = false;
}
function showtime () {
var now = new Date();
var hours = [Link]();
var minutes = [Link]();
var seconds = [Link]()
var timeValue = "" + ((hours >12) ? hours -12 :hours)
if (timeValue == "0") timeValue = 12;
timeValue += ((minutes < 10) ? ":0" : ":") + minutes
timeValue += ((seconds < 10) ? ":0" : ":") + seconds
timeValue += (hours >= 12) ? " P.M." : " A.M."
[Link] = timeValue;
timerID = setTimeout("showtime()",1000);
timerRunning = true;
}
function startclock() {
stopclock();
showtime();
}
[Link]=startclock;
// End -->
</SCRIPT>
</head>
<body>
<?php include('[Link]');?>
<?php
$position=$_SESSION['SESS_LAST_NAME'];
if($position=='cashier') {
?>

<a href="../[Link]">Logout</a>

Department of Computer Science and Applications P a g e | 27


PHARMACY MANAGEMENT SYSTEM

<?php
}
if($position=='admin') {
?>

<div class="container-fluid">
<div class="row-fluid">
<div class="span2">
<div class="well sidebar-nav">
<ul class="nav nav-list">
<li class="active"><a href="#"><i class="icon-dashboard icon-2x"></i>
Dashboard </a></li>
<li><a href="[Link]?id=cash&invoice=<?php echo
$finalcode ?>"><i class="icon-shopping-cart icon-2x"></i> Sales</a> </li>
<li><a href="[Link]"><i class="icon-list-alt icon-
2x"></i> Products</a> </li>
<li><a href="[Link]"><i class="icon-group icon-
2x"></i> Customers</a> </li>
<li><a href="[Link]"><i class="icon-group icon-
2x"></i> Suppliers</a> </li>
<li><a href="[Link]?d1=0&d2=0"><i class="icon-bar-
chart icon-2x"></i> Sales Report</a> </li>
<br><br><br><br><br><br>
<li>
<div class="hero-unit-clock">

<form name="clock">
<font color="white">Time: <br></font>&nbsp;<input
style="width:150px;" type="submit" class="trans" name="face" value="">
</form>
</div>
</li>
</ul>
</div><!--/.well -->
</div><!--/span-->
<div class="span10">
<div class="contentheader">
<i class="icon-dashboard"></i> Dashboard
</div>
<ul class="breadcrumb">
<li class="active">Dashboard</li>
</ul>
<font style=" font:bold Italic 44px 'Impact'; text-shadow:6px
0px 0px #03a9f4; color:#252425;"><center>Caps lock Pharmacy</center></font>
<div id="mainmain">

<a href="[Link]?id=cash&invoice=<?php echo $finalcode ?>"><i class="icon-


shopping-cart icon-2x"></i><br> Sales</a>

Department of Computer Science and Applications P a g e | 28


PHARMACY MANAGEMENT SYSTEM

<a href="[Link]"><i class="icon-list-alt icon-2x"></i><br> Products</a>


<a href="[Link]"><i class="icon-group icon-2x"></i><br> Customers</a>
<a href="[Link]"><i class="icon-group icon-2x"></i><br> Suppliers</a>
<a href="[Link]?d1=0&d2=0"><i class="icon-bar-chart icon-2x"></i><br>
Sales Report</a>
<a href="../[Link]"><font color="red"><i class="icon-off icon-
2x"></i></font><br> Logout</a>
<?php
}
?>
<div class="clearfix"></div>
</div>
</div>
</div>
</div>
</body>
<?php include('[Link]'); ?>
</html>

[Link]:

<!DOCTYPE html>
<html>
<head>
<!-- js -->
<link href="src/[Link]" media="screen" rel="stylesheet" type="text/css" />
<script src="lib/[Link]" type="text/javascript"></script>
<script src="src/[Link]" type="text/javascript"></script>
<script type="text/javascript">
jQuery(document).ready(function($) {
$('a[rel*=facebox]').facebox({
loadingImage : 'src/[Link]',
closeImage : 'src/[Link]'
})
})
</script>
<title>
POS
</title>
<?php
require_once('[Link]');
?>

<link href="vendors/[Link]" rel="stylesheet"


media="screen">
<link href="css/[Link]" rel="stylesheet">

<link rel="stylesheet" type="text/css" href="css/DT_bootstrap.css">

Department of Computer Science and Applications P a g e | 29


PHARMACY MANAGEMENT SYSTEM

<link rel="stylesheet" href="css/[Link]">


<style type="text/css">
body {
padding-top: 60px;
padding-bottom: 40px;
}
.sidebar-nav {
padding: 9px 0;
}
</style>
<link href="css/[Link]" rel="stylesheet">

<!-- combosearch box-->

<script src="vendors/[Link]"></script>
<script src="vendors/[Link]"></script>

<link href="../[Link]" media="screen" rel="stylesheet" type="text/css" />


<!--sa poip up-->

<script language="javascript" type="text/javascript">


/* Visit [Link] for full source code
and get more free JavaScript, CSS and DHTML scripts! */
<!-- Begin
var timerID = null;
var timerRunning = false;
function stopclock (){
if(timerRunning)
clearTimeout(timerID);
timerRunning = false;
}
function showtime () {
var now = new Date();
var hours = [Link]();
var minutes = [Link]();
var seconds = [Link]()
var timeValue = "" + ((hours >12) ? hours -12 :hours)
if (timeValue == "0") timeValue = 12;
timeValue += ((minutes < 10) ? ":0" : ":") + minutes
timeValue += ((seconds < 10) ? ":0" : ":") + seconds
timeValue += (hours >= 12) ? " P.M." : " A.M."
[Link] = timeValue;
timerID = setTimeout("showtime()",1000);
timerRunning = true;

Department of Computer Science and Applications P a g e | 30


PHARMACY MANAGEMENT SYSTEM

}
function startclock() {
stopclock();
showtime();
}
[Link]=startclock;
// End -->
</SCRIPT>

</head>
<?php
function createRandomPassword() {
$chars = "003232303232023232023456789";
srand((double)microtime()*1000000);
$i = 0;
$pass = '' ;
while ($i <= 7) {

$num = rand() % 33;

$tmp = substr($chars, $num, 1);

$pass = $pass . $tmp;

$i++;

}
return $pass;
}
$finalcode='RS-'.createRandomPassword();
?>
<body>
<?php include('[Link]');?>
<?php
$position=$_SESSION['SESS_LAST_NAME'];
if($position=='cashier') {
?>
<a href="[Link]?id=cash&invoice=<?php echo $finalcode ?>">Cash</a>

<a href="../[Link]">Logout</a>
<?php
}
if($position=='admin') {
?>

<div class="container-fluid">
<div class="row-fluid">
<div class="span2">
<div class="well sidebar-nav">
<ul class="nav nav-list">

Department of Computer Science and Applications P a g e | 31


PHARMACY MANAGEMENT SYSTEM

<li><a href="[Link]"><i class="icon-dashboard icon-2x"></i>


Dashboard </a></li>
<li class="active"><a href="[Link]?id=cash&invoice=<?php
echo $finalcode ?>"><i class="icon-shopping-cart icon-2x"></i> Sales</a> </li>
<li><a href="[Link]"><i class="icon-list-alt icon-
2x"></i> Products</a> </li>
<li><a href="[Link]"><i class="icon-group icon-
2x"></i> Customers</a> </li>
<li><a href="[Link]"><i class="icon-group icon-
2x"></i> Suppliers</a> </li>
<li><a href="[Link]?d1=0&d2=0"><i class="icon-bar-
chart icon-2x"></i> Sales Report</a> </li>
<br><br><br><br><br><br>
<li>
<div class="hero-unit-clock">

<form name="clock">
<font color="white">Time: <br></font>&nbsp;<input
style="width:150px;" type="text" class="trans" name="face" value="" disabled>
</form>
</div>
</li>

</ul>
<?php } ?>
</div><!--/.well -->
</div><!--/span-->
<div class="span10">
<div class="contentheader">
<i class="icon-money"></i> Sales
</div>
<ul class="breadcrumb">
<a href="[Link]"><li>Dashboard</li></a> /
<li class="active">Sales</li>
</ul>
<div style="margin-top: -19px; margin-bottom: 21px;">
<a href="[Link]"><button class="btn btn-default btn-large" style="float:
none;"><i class="icon icon-circle-arrow-left icon-large"></i> Back</button></a>
</div>

<form action="[Link]" method="post" >

<input type="hidden" name="pt" value="<?php echo $_GET['id']; ?>" />


<input type="hidden" name="invoice" value="<?php echo $_GET['invoice']; ?>" />
<select name="product" style="width:650px; "class="chzn-select" required>
<option></option>
<?php
include('../[Link]');
$result = $db->prepare("SELECT * FROM products");

Department of Computer Science and Applications P a g e | 32


PHARMACY MANAGEMENT SYSTEM

$result->bindParam(':userid', $res);
$result->execute();
for($i=0; $row = $result->fetch(); $i++){
?>
<option value="<?php echo $row['product_id'];?>"><?php echo
$row['product_code']; ?> - <?php echo $row['gen_name']; ?> - <?php echo
$row['product_name']; ?> | Expires at: <?php echo $row['expiry_date']; ?></option>
<?php
}
?>
</select>
<input type="number" name="qty" value="1" min="1" placeholder="Qty"
autocomplete="off" style="width: 68px; height:30px; padding-top:6px; padding-
bottom: 4px; margin-right: 4px; font-size:15px;" / required>
<input type="hidden" name="discount" value="" autocomplete="off" style="width:
68px; height:30px; padding-top:6px; padding-bottom: 4px; margin-right: 4px; font-
size:15px;" />
<input type="hidden" name="date" value="<?php echo date("m/d/y"); ?>" />
<Button type="submit" class="btn btn-info" style="width: 123px; height:35px;
margin-top:-5px;" /><i class="icon-plus-sign icon-large"></i> Add</button>
</form>
<table class="table table-bordered" id="resultTable" data-responsive="table">
<thead>
<tr>
<th> Product Name </th>
<th> Generic Name </th>
<th> Category / Description </th>
<th> Price </th>
<th> Qty </th>
<th> Amount </th>
<th> Profit </th>
<th> Action </th>
</tr>
</thead>
<tbody>

<?php
$id=$_GET['invoice'];
include('../[Link]');
$result = $db->prepare("SELECT * FROM sales_order
WHERE invoice= :userid");
$result->bindParam(':userid', $id);
$result->execute();
for($i=1; $row = $result->fetch(); $i++){
?>
<tr class="record">
<td hidden><?php echo $row['product']; ?></td>
<td><?php echo $row['product_code']; ?></td>
<td><?php echo $row['gen_name']; ?></td>
<td><?php echo $row['name']; ?></td>

Department of Computer Science and Applications P a g e | 33


PHARMACY MANAGEMENT SYSTEM

<td>
<?php
$ppp=$row['price'];
echo formatMoney($ppp, true);
?>
</td>
<td><?php echo $row['qty']; ?></td>
<td>
<?php
$dfdf=$row['amount'];
echo formatMoney($dfdf, true);
?>
</td>
<td>
<?php
$profit=$row['profit'];
echo formatMoney($profit, true);
?>
</td>
<td width="90"><a href="[Link]?id=<?php echo
$row['transaction_id']; ?>&invoice=<?php echo $_GET['invoice']; ?>&dle=<?php
echo $_GET['id']; ?>&qty=<?php echo $row['qty'];?>&code=<?php echo
$row['product'];?>"><button class="btn btn-mini btn-warning"><i class="icon icon-
remove"></i> Cancel </button></a></td>
</tr>
<?php
}
?>
<tr>
<th> </th>
<th> </th>
<th> </th>
<th> </th>
<th> </th>
<td> Total Amount: </td>
<td> Total Profit: </td>
<th> </th>
</tr>
<tr>
<th colspan="5"><strong style="font-size: 12px; color:
#222222;">Total:</strong></th>
<td colspan="1"><strong style="font-size: 12px; color:
#222222;">
<?php
function formatMoney($number, $fractional=false) {
if ($fractional) {
$number = sprintf('%.2f', $number);
}
while (true) {

Department of Computer Science and Applications P a g e | 34


PHARMACY MANAGEMENT SYSTEM

$replaced = preg_replace('/(-
?\d+)(\d\d\d)/', '$1,$2', $number);
if ($replaced != $number) {
$number = $replaced;
} else {
break;
}
}
return $number;
}
$sdsd=$_GET['invoice'];
$resultas = $db->prepare("SELECT sum(amount)
FROM sales_order WHERE invoice= :a");
$resultas->bindParam(':a', $sdsd);
$resultas->execute();
for($i=0; $rowas = $resultas->fetch(); $i++){
$fgfg=$rowas['sum(amount)'];
echo formatMoney($fgfg, true);
}
?>
</strong></td>
<td colspan="1"><strong style="font-size: 12px; color:
#222222;">
<?php
$resulta = $db->prepare("SELECT sum(profit) FROM
sales_order WHERE invoice= :b");
$resulta->bindParam(':b', $sdsd);
$resulta->execute();
for($i=0; $qwe = $resulta->fetch(); $i++){
$asd=$qwe['sum(profit)'];
echo formatMoney($asd, true);
}
?>

</td>
<th></th>
</tr>

</tbody>
</table><br>
<a rel="facebox" href="[Link]?pt=<?php echo $_GET['id']?>&invoice=<?php
echo $_GET['invoice']?>&total=<?php echo $fgfg ?>&totalprof=<?php echo $asd
?>&cashier=<?php echo $_SESSION['SESS_FIRST_NAME']?>"><button
class="btn btn-success btn-large btn-block"><i class="icon icon-save icon-
large"></i> SAVE</button></a>
<div class="clearfix"></div>
</div>
</div>
</div>
</body>

Department of Computer Science and Applications P a g e | 35


PHARMACY MANAGEMENT SYSTEM

<?php include('[Link]');?>
</html>

[Link]:

<html>
<head>
<title>
POS
</title>

<?php
require_once('[Link]');
?>
<link href="css/[Link]" rel="stylesheet">

<link rel="stylesheet" type="text/css" href="css/DT_bootstrap.css">

<link rel="stylesheet" href="css/[Link]">


<style type="text/css">
body {
padding-top: 60px;
padding-bottom: 40px;
}
.sidebar-nav {
padding: 9px 0;
}
</style>
<link href="css/[Link]" rel="stylesheet">

<link href="../[Link]" media="screen" rel="stylesheet" type="text/css" />


<!--sa poip up-->
<script src="[Link]" type="text/javascript" charset="utf-8"></script>
<script src="js/[Link]" type="text/javascript" charset="utf-8"></script>
<link href="src/[Link]" media="screen" rel="stylesheet" type="text/css" />
<script src="lib/[Link]" type="text/javascript"></script>
<script src="src/[Link]" type="text/javascript"></script>
<script type="text/javascript">
jQuery(document).ready(function($) {
$('a[rel*=facebox]').facebox({
loadingImage : 'src/[Link]',
closeImage : 'src/[Link]'
})
})
</script>
</head>
<?php
function createRandomPassword() {

Department of Computer Science and Applications P a g e | 36


PHARMACY MANAGEMENT SYSTEM

$chars = "003232303232023232023456789";
srand((double)microtime()*1000000);
$i = 0;
$pass = '' ;
while ($i <= 7) {

$num = rand() % 33;

$tmp = substr($chars, $num, 1);

$pass = $pass . $tmp;

$i++;

}
return $pass;
}
$finalcode='RS-'.createRandomPassword();
?>

<script>
function sum() {
var txtFirstNumberValue = [Link]('txt1').value;
var txtSecondNumberValue = [Link]('txt2').value;
var result = parseInt(txtFirstNumberValue) -
parseInt(txtSecondNumberValue);
if (!isNaN(result)) {
[Link]('txt3').value = result;

var txtFirstNumberValue =
[Link]('txt11').value;
var result = parseInt(txtFirstNumberValue);
if (!isNaN(result)) {
[Link]('txt22').value = result;
}

var txtFirstNumberValue =
[Link]('txt11').value;
var txtSecondNumberValue = [Link]('txt33').value;
var result = parseInt(txtFirstNumberValue) +
parseInt(txtSecondNumberValue);
if (!isNaN(result)) {
[Link]('txt55').value = result;

var txtFirstNumberValue =
[Link]('txt4').value;

Department of Computer Science and Applications P a g e | 37


PHARMACY MANAGEMENT SYSTEM

var result = parseInt(txtFirstNumberValue);


if (!isNaN(result)) {
[Link]('txt5').value = result;
}

}
</script>

<script language="javascript" type="text/javascript">


/* Visit [Link] for full source code
and get more free JavaScript, CSS and DHTML scripts! */
<!-- Begin
var timerID = null;
var timerRunning = false;
function stopclock (){
if(timerRunning)
clearTimeout(timerID);
timerRunning = false;
}
function showtime () {
var now = new Date();
var hours = [Link]();
var minutes = [Link]();
var seconds = [Link]()
var timeValue = "" + ((hours >12) ? hours -12 :hours)
if (timeValue == "0") timeValue = 12;
timeValue += ((minutes < 10) ? ":0" : ":") + minutes
timeValue += ((seconds < 10) ? ":0" : ":") + seconds
timeValue += (hours >= 12) ? " P.M." : " A.M."
[Link] = timeValue;
timerID = setTimeout("showtime()",1000);
timerRunning = true;
}
function startclock() {
stopclock();
showtime();
}
[Link]=startclock;
// End -->
</SCRIPT>

<body>
<?php include('[Link]');?>
<div class="container-fluid">
<div class="row-fluid">
<div class="span2">
<div class="well sidebar-nav">
<ul class="nav nav-list">

Department of Computer Science and Applications P a g e | 38


PHARMACY MANAGEMENT SYSTEM

<li><a href="[Link]"><i class="icon-dashboard icon-2x"></i>


Dashboard </a></li>
<li><a href="[Link]?id=cash&invoice=<?php echo
$finalcode ?>"><i class="icon-shopping-cart icon-2x"></i> Sales</a> </li>
<li class="active"><a href="[Link]"><i class="icon-list-
alt icon-2x"></i> Products</a> </li>
<li><a href="[Link]"><i class="icon-group icon-
2x"></i> Customers</a> </li>
<li><a href="[Link]"><i class="icon-group icon-
2x"></i> Suppliers</a> </li>
<li><a href="[Link]?d1=0&d2=0"><i class="icon-bar-
chart icon-2x"></i> Sales Report</a> </li>

<br><br><br><br><br><br>
<li>
<div class="hero-unit-clock">

<form name="clock">
<font color="white">Time: <br></font>&nbsp;<input
style="width:150px;" type="submit" class="trans" name="face" value="">
</form>
</div>
</li>

</ul>
</div><!--/.well -->
</div><!--/span-->
<div class="span10">
<div class="contentheader">
<i class="icon-table"></i> Products
</div>
<ul class="breadcrumb">
<li><a href="[Link]">Dashboard</a></li> /
<li class="active">Products</li>
</ul>

<div style="margin-top: -19px; margin-bottom: 21px;">


<a href="[Link]"><button class="btn btn-default btn-large" style="float: left;"><i
class="icon icon-circle-arrow-left icon-large"></i> Back</button></a>
<?php
include('../[Link]');
$result = $db->prepare("SELECT * FROM products
ORDER BY qty_sold DESC");
$result->execute();
$rowcount = $result->rowcount();
?>

<?php

Department of Computer Science and Applications P a g e | 39


PHARMACY MANAGEMENT SYSTEM

include('../[Link]');
$result = $db->prepare("SELECT * FROM products
where qty < 10 ORDER BY product_id DESC");
$result->execute();
$rowcount123 = $result->rowcount();

?>
<div style="text-align:center;">
Total Number of Products: <font color="green"
style="font:bold 22px 'Aleo';">[<?php echo $rowcount;?>]</font>
</div>

<div style="text-align:center;">
<font style="color:rgb(255, 95, 66);; font:bold 22px
'Aleo';">[<?php echo $rowcount123;?>]</font> Products are below QTY of 10
</div>
</div>

<input type="text" style="padding:15px;" name="filter" value="" id="filter"


placeholder="Search Product..." autocomplete="off" />
<a rel="facebox" href="[Link]"><Button type="submit" class="btn btn-info"
style="float:right; width:230px; height:35px;" /><i class="icon-plus-sign icon-
large"></i> Add Product</button></a><br><br>
<table class="hoverTable" id="resultTable" data-responsive="table" style="text-
align: left;">
<thead>
<tr>
<th width="12%"> Brand Name </th>
<th width="14%"> Generic Name </th>
<th width="13%"> Category / Description </th>
<th width="7%"> Supplier </th>
<th width="9%"> Date Received </th>
<th width="10%"> Expiry Date </th>
<th width="6%"> Original Price </th>
<th width="6%"> Selling Price </th>
<th width="6%"> QTY </th>
<th width="5%"> Qty Left </th>
<th width="8%"> Total </th>
<th width="8%"> Action </th>
</tr>
</thead>
<tbody>

<?php
function formatMoney($number, $fractional=false) {
if ($fractional) {
$number = sprintf('%.2f', $number);
}
while (true) {

Department of Computer Science and Applications P a g e | 40


PHARMACY MANAGEMENT SYSTEM

$replaced = preg_replace('/(-
?\d+)(\d\d\d)/', '$1,$2', $number);
if ($replaced != $number) {
$number = $replaced;
} else {
break;
}
}
return $number;
}
include('../[Link]');
$result = $db->prepare("SELECT *, price * qty as total
FROM products ORDER BY product_id DESC");
$result->execute();
for($i=0; $row = $result->fetch(); $i++){
$total=$row['total'];
$availableqty=$row['qty'];
if ($availableqty < 10) {
echo '<tr class="alert alert-warning record"
style="color: #fff; background:rgb(255, 95, 66);">';
}
else {
echo '<tr class="record">';
}
?>

<td><?php echo $row['product_code']; ?></td>


<td><?php echo $row['gen_name']; ?></td>
<td><?php echo $row['product_name']; ?></td>
<td><?php echo $row['supplier']; ?></td>
<td><?php echo $row['date_arrival']; ?></td>
<td><?php echo $row['expiry_date']; ?></td>
<td><?php
$oprice=$row['o_price'];
echo formatMoney($oprice, true);
?></td>
<td><?php
$pprice=$row['price'];
echo formatMoney($pprice, true);
?></td>
<td><?php echo $row['qty_sold']; ?></td>
<td><?php echo $row['qty']; ?></td>
<td>
<?php
$total=$row['total'];
echo formatMoney($total, true);
?>

Department of Computer Science and Applications P a g e | 41


PHARMACY MANAGEMENT SYSTEM

</td> <td><a rel="facebox" title="Click to edit


the product" href="[Link]?id=<?php echo $row['product_id']; ?>"><button
class="btn btn-warning"><i class="icon-edit"></i> </button> </a>
<a href="#" id="<?php echo $row['product_id']; ?>"
class="delbutton" title="Click to Delete the product"><button class="btn btn-
danger"><i class="icon-trash"></i></button></a></td>
</tr>
<?php
}
?>

</tbody>
</table>
<div class="clearfix"></div>
</div>
</div>
</div>

<script src="js/[Link]"></script>
<script type="text/javascript">
$(function() {

$(".delbutton").click(function(){

//Save the link in a variable called element


var element = $(this);

//Find the id of the link that was clicked


var del_id = [Link]("id");

//Built a url to send


var info = 'id=' + del_id;
if(confirm("Sure you want to delete this Product? There is NO undo!"))
{

$.ajax({
type: "GET",
url: "[Link]",
data: info,
success: function(){

}
});
$(this).parents(".record").animate({ backgroundColor: "#fbc7c7" }, "fast")
.animate({ opacity: "hide" }, "slow");

Department of Computer Science and Applications P a g e | 42


PHARMACY MANAGEMENT SYSTEM

return false;

});

});
</script>
</body>
<?php include('[Link]');?>

</html>

[Link]:

<html>
<head>
<title>
POS
</title>
<?php
require_once('[Link]');
?>
<link href="css/[Link]" rel="stylesheet">

<link rel="stylesheet" type="text/css" href="css/DT_bootstrap.css">

<link rel="stylesheet" href="css/[Link]">


<style type="text/css">
body {
padding-top: 60px;
padding-bottom: 40px;
}
.sidebar-nav {
padding: 9px 0;
}
</style>
<link href="css/[Link]" rel="stylesheet">

<link href="../[Link]" media="screen" rel="stylesheet" type="text/css" />


<!--sa poip up-->
<script src="[Link]" type="text/javascript" charset="utf-8"></script>
<script src="js/[Link]" type="text/javascript" charset="utf-8"></script>
<link href="src/[Link]" media="screen" rel="stylesheet" type="text/css" />
<script src="lib/[Link]" type="text/javascript"></script>
<script src="src/[Link]" type="text/javascript"></script>
<script type="text/javascript">

Department of Computer Science and Applications P a g e | 43


PHARMACY MANAGEMENT SYSTEM

jQuery(document).ready(function($) {
$('a[rel*=facebox]').facebox({
loadingImage : 'src/[Link]',
closeImage : 'src/[Link]'
})
})
</script>

<script language="javascript" type="text/javascript">


/* Visit [Link] for full source code
and get more free JavaScript, CSS and DHTML scripts! */
<!-- Begin
var timerID = null;
var timerRunning = false;
function stopclock (){
if(timerRunning)
clearTimeout(timerID);
timerRunning = false;
}
function showtime () {
var now = new Date();
var hours = [Link]();
var minutes = [Link]();
var seconds = [Link]()
var timeValue = "" + ((hours >12) ? hours -12 :hours)
if (timeValue == "0") timeValue = 12;
timeValue += ((minutes < 10) ? ":0" : ":") + minutes
timeValue += ((seconds < 10) ? ":0" : ":") + seconds
timeValue += (hours >= 12) ? " P.M." : " A.M."
[Link] = timeValue;
timerID = setTimeout("showtime()",1000);
timerRunning = true;
}
function startclock() {
stopclock();
showtime();
}
[Link]=startclock;
// End -->
</SCRIPT>

</head>
<?php
function createRandomPassword() {
$chars = "003232303232023232023456789";
srand((double)microtime()*1000000);
$i = 0;

Department of Computer Science and Applications P a g e | 44


PHARMACY MANAGEMENT SYSTEM

$pass = '' ;
while ($i <= 7) {

$num = rand() % 33;

$tmp = substr($chars, $num, 1);

$pass = $pass . $tmp;

$i++;

}
return $pass;
}
$finalcode='RS-'.createRandomPassword();
?>
<body>
<?php include('[Link]');?>
<div class="container-fluid">
<div class="row-fluid">
<div class="span2">
<div class="well sidebar-nav">
<ul class="nav nav-list">
<li><a href="[Link]"><i class="icon-dashboard icon-2x"></i>
Dashboard </a></li>
<li><a href="[Link]?id=cash&invoice=<?php echo
$finalcode ?>"><i class="icon-shopping-cart icon-2x"></i> Sales </a> </li>
<li><a href="[Link]"><i class="icon-list-alt icon-
2x"></i> Products</a> </li>
<li class="active"><a href="[Link]"><i class="icon-
group icon-2x"></i> Customers </a> </li>
<li><a href="[Link]"><i class="icon-group icon-
2x"></i> Suppliers</a> </li>
<li><a href="[Link]?d1=0&d2=0"><i class="icon-bar-
chart icon-2x"></i> Sales Report</a> </li>
<br><br><br><br><br><br>
<li>
<div class="hero-unit-clock">

<form name="clock">
<font color="white">Time: <br></font>&nbsp;<input
style="width:150px;" type="submit" class="trans" name="face" value="">
</form>
</div>
</li>

</ul>
</div><!--/.well -->
</div><!--/span-->

Department of Computer Science and Applications P a g e | 45


PHARMACY MANAGEMENT SYSTEM

<div class="span10">
<div class="contentheader">
<i class="icon-group"></i> Customers
</div>
<ul class="breadcrumb">
<li><a href="[Link]">Dashboard</a></li> /
<li class="active">Customers</li>
</ul>

<div style="margin-top: -19px; margin-bottom: 21px;">


<a href="[Link]"><button class="btn btn-default btn-large" style="float: left;"><i
class="icon icon-circle-arrow-left icon-large"></i> Back</button></a>
<?php
include('../[Link]');
$result = $db->prepare("SELECT * FROM customer
ORDER BY customer_id DESC");
$result->execute();
$rowcount = $result->rowcount();
?>
<div style="text-align:center;">
Total Number of Customers: <font color="green"
style="font:bold 22px 'Aleo';"><?php echo $rowcount;?></font>
</div>
</div>
<input type="text" name="filter" style="padding:15px;" id="filter"
placeholder="Search Customer..." autocomplete="off" />
<a rel="facebox" href="[Link]"><Button type="submit" class="btn btn-
info" style="float:right; width:230px; height:35px;" /><i class="icon-plus-sign icon-
large"></i> Add Customer</button></a><br><br>

<table class="table table-bordered" id="resultTable" data-responsive="table"


style="text-align: left;">
<thead>
<tr>
<th width="17%"> Full Name </th>
<th width="10%"> Address </th>
<th width="10%"> Contact Number</th>
<th width="23%"> Product Name</th>
<th width="9%"> Total </th>
<th width="17%"> Note </th>
<th width="9%"> Due Date </th>
<th width="14%"> Action </th>
</tr>
</thead>
<tbody>

<?php
include('../[Link]');
$result = $db->prepare("SELECT * FROM customer
ORDER BY customer_id DESC");

Department of Computer Science and Applications P a g e | 46


PHARMACY MANAGEMENT SYSTEM

$result->execute();
for($i=0; $row = $result->fetch(); $i++){
?>
<tr class="record">
<td><?php echo $row['customer_name']; ?></td>
<td><?php echo $row['address']; ?></td>
<td><?php echo $row['contact']; ?></td>
<td><?php echo $row['prod_name']; ?></td>
<td>P <?php echo $row['membership_number']; ?>.00</td>
<td><?php echo $row['note']; ?></td>
<td><?php echo $row['expected_date']; ?></td>

<td><a title="Click To Edit Customer" rel="facebox"


href="[Link]?id=<?php echo $row['customer_id']; ?>"><button class="btn
btn-warning btn-mini"><i class="icon-edit"></i> Edit </button></a>
<a href="#" id="<?php echo $row['customer_id']; ?>"
class="delbutton" title="Click To Delete"><button class="btn btn-danger btn-
mini"><i class="icon-trash"></i> Delete</button></a></td>
</tr>
<?php
}
?>

</tbody>
</table>
<div class="clearfix"></div>

</div>
</div>
</div>
<script src="js/[Link]"></script>
<script type="text/javascript">
$(function() {

$(".delbutton").click(function(){

//Save the link in a variable called element


var element = $(this);

//Find the id of the link that was clicked


var del_id = [Link]("id");

//Built a url to send


var info = 'id=' + del_id;
if(confirm("Are you sure want to delete? There is NO undo!"))
{

$.ajax({
type: "GET",

Department of Computer Science and Applications P a g e | 47


PHARMACY MANAGEMENT SYSTEM

url: "[Link]",
data: info,
success: function(){

}
});
$(this).parents(".record").animate({ backgroundColor: "#fbc7c7" }, "fast")
.animate({ opacity: "hide" }, "slow");

return false;

});

});
</script>
</body>
<?php include('[Link]');?>

</html>

[Link]:

<html>
<head>
<title>
POS
</title>
<?php
require_once('[Link]');
?>
<link href="css/[Link]" rel="stylesheet">

<link rel="stylesheet" type="text/css" href="css/DT_bootstrap.css">

<link rel="stylesheet" href="css/[Link]">


<style type="text/css">
body {
padding-top: 60px;
padding-bottom: 40px;
}
.sidebar-nav {
padding: 9px 0;
}
</style>
<link href="css/[Link]" rel="stylesheet">

Department of Computer Science and Applications P a g e | 48


PHARMACY MANAGEMENT SYSTEM

<link href="../[Link]" media="screen" rel="stylesheet" type="text/css" />


<!--sa poip up-->
<script src="[Link]" type="text/javascript" charset="utf-8"></script>
<script src="js/[Link]" type="text/javascript" charset="utf-8"></script>
<link href="src/[Link]" media="screen" rel="stylesheet" type="text/css" />
<script src="lib/[Link]" type="text/javascript"></script>
<script src="src/[Link]" type="text/javascript"></script>
<script type="text/javascript">
jQuery(document).ready(function($) {
$('a[rel*=facebox]').facebox({
loadingImage : 'src/[Link]',
closeImage : 'src/[Link]'
})
})
</script>
</head>
<?php
function createRandomPassword() {
$chars = "003232303232023232023456789";
srand((double)microtime()*1000000);
$i = 0;
$pass = '' ;
while ($i <= 7) {

$num = rand() % 33;

$tmp = substr($chars, $num, 1);

$pass = $pass . $tmp;

$i++;

}
return $pass;
}
$finalcode='RS-'.createRandomPassword();
?>
<script language="javascript" type="text/javascript">
/* Visit [Link] for full source code
and get more free JavaScript, CSS and DHTML scripts! */
<!-- Begin
var timerID = null;
var timerRunning = false;
function stopclock (){
if(timerRunning)
clearTimeout(timerID);
timerRunning = false;
}
function showtime () {

Department of Computer Science and Applications P a g e | 49


PHARMACY MANAGEMENT SYSTEM

var now = new Date();


var hours = [Link]();
var minutes = [Link]();
var seconds = [Link]()
var timeValue = "" + ((hours >12) ? hours -12 :hours)
if (timeValue == "0") timeValue = 12;
timeValue += ((minutes < 10) ? ":0" : ":") + minutes
timeValue += ((seconds < 10) ? ":0" : ":") + seconds
timeValue += (hours >= 12) ? " P.M." : " A.M."
[Link] = timeValue;
timerID = setTimeout("showtime()",1000);
timerRunning = true;
}
function startclock() {
stopclock();
showtime();
}
[Link]=startclock;
// End -->
</SCRIPT>
<body>
<?php include('[Link]');?>
<div class="container-fluid">
<div class="row-fluid">
<div class="span2">
<div class="well sidebar-nav">
<ul class="nav nav-list">
<li><a href="[Link]"><i class="icon-dashboard icon-2x"></i>
Dashboard </a></li>
<li><a href="[Link]?id=cash&invoice=<?php echo
$finalcode ?>"><i class="icon-shopping-cart icon-2x"></i> Sales</a> </li>
<li><a href="[Link]"><i class="icon-list-alt icon-
2x"></i> Products</a> </li>
<li><a href="[Link]"><i class="icon-group icon-
2x"></i> Customers</a> </li>
<li class="active"><a href="[Link]"><i class="icon-
group icon-2x"></i> Suppliers</a> </li>
<li><a href="[Link]?d1=0&d2=0"><i class="icon-bar-
chart icon-2x"></i> Sales Report</a> </li>

<br><br><br><br><br><br>
<li>
<div class="hero-unit-clock">

<form name="clock">
<font color="white">Time: <br></font>&nbsp;<input
style="width:150px;" type="submit" class="trans" name="face" value="">
</form>
</div>
</li>

Department of Computer Science and Applications P a g e | 50


PHARMACY MANAGEMENT SYSTEM

</ul>
</div><!--/.well -->
</div><!--/span-->
<div class="span10">
<div class="contentheader">
<i class="icon-group"></i> Suppliers
</div>
<ul class="breadcrumb">
<li><a href="[Link]">Dashboard</a></li> /
<li class="active">Suppliers</li>
</ul>
<div style="margin-top: -19px; margin-bottom: 21px;">
<a href="[Link]"><button class="btn btn-default btn-large" style="float: left;"><i
class="icon icon-circle-arrow-left icon-large"></i> Back</button></a>
<?php
include('../[Link]');
$result = $db->prepare("SELECT * FROM supliers
ORDER BY suplier_id DESC");
$result->execute();
$rowcount = $result->rowcount();
?>
<div style="text-align:center;">
Total Number of Suppliers: <font color="green"
style="font:bold 22px 'Aleo';"><?php echo $rowcount;?></font>
</div>
</div>
<input type="text" name="filter" style="height:35px; margin-top: -1px;" value=""
id="filter" placeholder="Search Supplier..." autocomplete="off" />
<a rel="facebox" href="[Link]"><Button type="submit" class="btn btn-
info" style="float:right; width:230px; height:35px;" /><i class="icon-plus-sign icon-
large"></i> Add Supplier</button></a><br><br>

<table class="table table-bordered" id="resultTable" data-responsive="table"


style="text-align: left;">
<thead>
<tr>
<th> Supplier </th>
<th> Contact Person </th>
<th> Address </th>
<th> Contact No.</th>
<th> Note</th>
<th width="120"> Action </th>
</tr>
</thead>
<tbody>

<?php
include('../[Link]');

Department of Computer Science and Applications P a g e | 51


PHARMACY MANAGEMENT SYSTEM

$result = $db->prepare("SELECT * FROM supliers


ORDER BY suplier_id DESC");
$result->execute();
for($i=0; $row = $result->fetch(); $i++){
?>
<tr class="record">
<td><?php echo $row['suplier_name']; ?></td>
<td><?php echo $row['contact_person']; ?></td>
<td><?php echo $row['suplier_address']; ?></td>
<td><?php echo $row['suplier_contact']; ?></td>
<td><?php echo $row['note']; ?></td>
<td><a rel="facebox" href="[Link]?id=<?php echo
$row['suplier_id']; ?>"><button class="btn btn-warning btn-mini"><i class="icon-
edit"></i> Edit </button></a>
<a href="#" id="<?php echo $row['suplier_id']; ?>"
class="delbutton" title="Click To Delete"><button class="btn btn-danger btn-
mini"><i class="icon-trash"></i> Delete</button></a></td>
</tr>
<?php
}
?>

</tbody>
</table>
<div class="clearfix"></div>
</div>
</div>
</div>

<script src="js/[Link]"></script>
<script type="text/javascript">
$(function() {

$(".delbutton").click(function(){

//Save the link in a variable called element


var element = $(this);

//Find the id of the link that was clicked


var del_id = [Link]("id");

//Built a url to send


var info = 'id=' + del_id;
if(confirm("Are you sure want to delete? There is NO undo!"))
{

$.ajax({
type: "GET",
url: "[Link]",

Department of Computer Science and Applications P a g e | 52


PHARMACY MANAGEMENT SYSTEM

data: info,
success: function(){

}
});
$(this).parents(".record").animate({ backgroundColor: "#fbc7c7" }, "fast")
.animate({ opacity: "hide" }, "slow");

return false;

});

});
</script>
</body>
<?php include('[Link]');?>
</html>

[Link]:
<html>
<?php
require_once('[Link]');
?>
<head>
<title>
POS
</title>
<link href="css/[Link]" rel="stylesheet">

<link rel="stylesheet" type="text/css" href="css/DT_bootstrap.css">

<link rel="stylesheet" href="css/[Link]">


<style type="text/css">
body {
padding-top: 60px;
padding-bottom: 40px;
}
.sidebar-nav {
padding: 9px 0;
}
</style>
<link href="css/[Link]" rel="stylesheet">

<link href="../[Link]" media="screen" rel="stylesheet" type="text/css" />


<link rel="stylesheet" type="text/css" href="[Link]" />
<script type="text/javascript" src="[Link]"></script>

Department of Computer Science and Applications P a g e | 53


PHARMACY MANAGEMENT SYSTEM

<script language="javascript">
function Clickheretoprint()
{
var disp_setting="toolbar=yes,location=no,directories=yes,menubar=yes,";
disp_setting+="scrollbars=yes,width=700, height=400, left=100, top=25";
var content_vlue = [Link]("content").innerHTML;

var docprint=[Link]("","",disp_setting);
[Link]();
[Link]('</head><body onLoad="[Link]()" style="width: 700px;
font-size:11px; font-family:arial; font-weight:normal;">');
[Link](content_vlue);
[Link]();
[Link]();
}
</script>

<script language="javascript" type="text/javascript">


/* Visit [Link] for full source code
and get more free JavaScript, CSS and DHTML scripts! */
<!-- Begin
var timerID = null;
var timerRunning = false;
function stopclock (){
if(timerRunning)
clearTimeout(timerID);
timerRunning = false;
}
function showtime () {
var now = new Date();
var hours = [Link]();
var minutes = [Link]();
var seconds = [Link]()
var timeValue = "" + ((hours >12) ? hours -12 :hours)
if (timeValue == "0") timeValue = 12;
timeValue += ((minutes < 10) ? ":0" : ":") + minutes
timeValue += ((seconds < 10) ? ":0" : ":") + seconds
timeValue += (hours >= 12) ? " P.M." : " A.M."
[Link] = timeValue;
timerID = setTimeout("showtime()",1000);
timerRunning = true;
}
function startclock() {
stopclock();
showtime();
}
[Link]=startclock;
// End -->
</SCRIPT>

Department of Computer Science and Applications P a g e | 54


PHARMACY MANAGEMENT SYSTEM

</head>
<?php
function createRandomPassword() {
$chars = "003232303232023232023456789";
srand((double)microtime()*1000000);
$i = 0;
$pass = '' ;
while ($i <= 7) {

$num = rand() % 33;

$tmp = substr($chars, $num, 1);

$pass = $pass . $tmp;

$i++;

}
return $pass;
}
$finalcode='RS-'.createRandomPassword();
?>
<body>
<?php include('[Link]');?>
<div class="container-fluid">
<div class="row-fluid">
<div class="span2">
<div class="well sidebar-nav">
<ul class="nav nav-list">
<li><a href="[Link]"><i class="icon-dashboard icon-2x"></i>
Dashboard </a></li>
<li><a href="[Link]?id=cash&invoice=<?php echo
$finalcode ?>"><i class="icon-shopping-cart icon-2x"></i> Sales</a> </li>
<li><a href="[Link]"><i class="icon-list-alt icon-
2x"></i> Products</a> </li>
<li><a href="[Link]"><i class="icon-group icon-
2x"></i> Customers</a> </li>
<li><a href="[Link]"><i class="icon-group icon-
2x"></i> Suppliers</a> </li>
<li class="active"><a href="[Link]?d1=0&d2=0"><i
class="icon-bar-chart icon-2x"></i> Sales Report</a> </li>

<br><br><br><br><br><br>
<li>
<div class="hero-unit-clock">

<form name="clock">
<font color="white">Time: <br></font>&nbsp;<input
style="width:150px;" type="submit" class="trans" name="face" value="">
</form>

Department of Computer Science and Applications P a g e | 55


PHARMACY MANAGEMENT SYSTEM

</div>
</li>

</ul>
</div><!--/.well -->
</div><!--/span-->
<div class="span10">
<div class="contentheader">
<i class="icon-bar-chart"></i> Sales Report
</div>
<ul class="breadcrumb">
<li><a href="[Link]">Dashboard</a></li> /
<li class="active">Sales Report</li>
</ul>

<div style="margin-top: -19px; margin-bottom: 21px;">


<a href="[Link]"><button class="btn btn-default btn-large" style="float:
none;"><i class="icon icon-circle-arrow-left icon-large"></i> Back</button></a>
<button style="float:right;" class="btn btn-success btn-mini"><a
href="javascript:Clickheretoprint()"> Print</button></a>

</div>
<form action="[Link]" method="get">
<center><strong>From : <input type="text" style="width: 223px; padding:14px;"
name="d1" class="tcal" value="" /> To: <input type="text" style="width: 223px;
padding:14px;" name="d2" class="tcal" value="" />
<button class="btn btn-info" style="width: 123px; height:35px; margin-top:-
8px;margin-left:8px;" type="submit"><i class="icon icon-search icon-large"></i>
Search</button>
</strong></center>
</form>
<div class="content" id="content">
<div style="font-weight:bold; text-align:center;font-size:14px;margin-bottom:
15px;">
Sales Report from&nbsp;<?php echo $_GET['d1'] ?>&nbsp;to&nbsp;<?php echo
$_GET['d2'] ?>
</div>
<table class="table table-bordered" id="resultTable" data-responsive="table"
style="text-align: left;">
<thead>
<tr>
<th width="13%"> Transaction ID </th>
<th width="13%"> Transaction Date </th>
<th width="20%"> Customer Name </th>
<th width="16%"> Invoice Number </th>
<th width="18%"> Amount </th>
<th width="13%"> Profit </th>
</tr>
</thead>
<tbody>

Department of Computer Science and Applications P a g e | 56


PHARMACY MANAGEMENT SYSTEM

<?php
include('../[Link]');
$d1=$_GET['d1'];
$d2=$_GET['d2'];
$result = $db->prepare("SELECT * FROM sales
WHERE date BETWEEN :a AND :b ORDER by transaction_id DESC ");
$result->bindParam(':a', $d1);
$result->bindParam(':b', $d2);
$result->execute();
for($i=0; $row = $result->fetch(); $i++){
?>
<tr class="record">
<td>STI-00<?php echo $row['transaction_id']; ?></td>
<td><?php echo $row['date']; ?></td>
<td><?php echo $row['name']; ?></td>
<td><?php echo $row['invoice_number']; ?></td>
<td><?php
$dsdsd=$row['amount'];
echo formatMoney($dsdsd, true);
?></td>
<td><?php
$zxc=$row['profit'];
echo formatMoney($zxc, true);
?></td>
</tr>
<?php
}
?>

</tbody>
<thead>
<tr>
<th colspan="4" style="border-top:1px solid #999999"> Total:
</th>
<th colspan="1" style="border-top:1px solid #999999">
<?php
function formatMoney($number, $fractional=false) {
if ($fractional) {
$number = sprintf('%.2f', $number);
}
while (true) {
$replaced = preg_replace('/(-
?\d+)(\d\d\d)/', '$1,$2', $number);
if ($replaced != $number) {
$number = $replaced;
} else {
break;
}
}

Department of Computer Science and Applications P a g e | 57


PHARMACY MANAGEMENT SYSTEM

return $number;
}
$d1=$_GET['d1'];
$d2=$_GET['d2'];
$results = $db->prepare("SELECT sum(amount)
FROM sales WHERE date BETWEEN :a AND :b");
$results->bindParam(':a', $d1);
$results->bindParam(':b', $d2);
$results->execute();
for($i=0; $rows = $results->fetch(); $i++){
$dsdsd=$rows['sum(amount)'];
echo formatMoney($dsdsd, true);
}
?>
</th>
<th colspan="1" style="border-top:1px solid #999999">
<?php
$resultia = $db->prepare("SELECT sum(profit) FROM
sales WHERE date BETWEEN :c AND :d");
$resultia->bindParam(':c', $d1);
$resultia->bindParam(':d', $d2);
$resultia->execute();
for($i=0; $cxz = $resultia->fetch(); $i++){
$zxc=$cxz['sum(profit)'];
echo formatMoney($zxc, true);
}
?>

</th>
</tr>
</thead>
</table>
</div>
<div class="clearfix"></div>
</div>
</div>
</div>

</body>
<script src="js/[Link]"></script>
<script type="text/javascript">
$(function() {

$(".delbutton").click(function(){

//Save the link in a variable called element


var element = $(this);

//Find the id of the link that was clicked

Department of Computer Science and Applications P a g e | 58


PHARMACY MANAGEMENT SYSTEM

var del_id = [Link]("id");

//Built a url to send


var info = 'id=' + del_id;
if(confirm("Sure you want to delete this update? There is NO undo!"))
{

$.ajax({
type: "GET",
url: "[Link]",
data: info,
success: function(){

}
});
$(this).parents(".record").animate({ backgroundColor: "#fbc7c7" }, "fast")
.animate({ opacity: "hide" }, "slow");

return false;

});

});
</script>
<?php include('[Link]');?>
</html>

[Link]:
-- phpMyAdmin SQL Dump
-- version 3.4.5
-- [Link]
--
-- Host: localhost
-- Generation Time: Jan 10, 2015 at 05:39 AM
-- Server version: 5.5.16
-- PHP Version: 5.3.8

SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";

/*!40101 SET
@OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET
@OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;

Department of Computer Science and Applications P a g e | 59


PHARMACY MANAGEMENT SYSTEM

/*!40101 SET
@OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;

--
-- Database: `sales`
--

-- --------------------------------------------------------

--
-- Table structure for table `collection`
--

CREATE TABLE IF NOT EXISTS `collection` (


`transaction_id` int(11) NOT NULL AUTO_INCREMENT,
`date` varchar(100) NOT NULL,
`name` varchar(100) NOT NULL,
`invoice` varchar(100) NOT NULL,
`amount` varchar(100) NOT NULL,
`remarks` varchar(100) NOT NULL,
`balance` int(11) NOT NULL,
PRIMARY KEY (`transaction_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=18 ;

-- --------------------------------------------------------

--
-- Table structure for table `customer`
--

CREATE TABLE IF NOT EXISTS `customer` (


`customer_id` int(11) NOT NULL AUTO_INCREMENT,
`customer_name` varchar(100) NOT NULL,
`address` varchar(100) NOT NULL,
`contact` varchar(100) NOT NULL,
`membership_number` varchar(100) NOT NULL,
`prod_name` varchar(550) NOT NULL,
`expected_date` varchar(500) NOT NULL,
`note` varchar(500) NOT NULL,
PRIMARY KEY (`customer_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=15 ;

-- --------------------------------------------------------

--
-- Table structure for table `products`
--

CREATE TABLE IF NOT EXISTS `products` (

Department of Computer Science and Applications P a g e | 60


PHARMACY MANAGEMENT SYSTEM

`product_id` int(11) NOT NULL AUTO_INCREMENT,


`product_code` varchar(200) NOT NULL,
`gen_name` varchar(200) NOT NULL,
`product_name` varchar(200) NOT NULL,
`cost` varchar(100) NOT NULL,
`o_price` varchar(100) NOT NULL,
`price` varchar(100) NOT NULL,
`profit` varchar(100) NOT NULL,
`supplier` varchar(100) NOT NULL,
`onhand_qty` int(10) NOT NULL,
`qty` int(10) NOT NULL,
`qty_sold` int(10) NOT NULL,
`expiry_date` varchar(500) NOT NULL,
`date_arrival` varchar(500) NOT NULL,
PRIMARY KEY (`product_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=58 ;

-- --------------------------------------------------------

--
-- Table structure for table `purchases`
--

CREATE TABLE IF NOT EXISTS `purchases` (


`transaction_id` int(11) NOT NULL AUTO_INCREMENT,
`invoice_number` varchar(100) NOT NULL,
`date` varchar(100) NOT NULL,
`suplier` varchar(100) NOT NULL,
`remarks` varchar(100) NOT NULL,
PRIMARY KEY (`transaction_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=14 ;

-- --------------------------------------------------------

--
-- Table structure for table `purchases_item`
--

CREATE TABLE IF NOT EXISTS `purchases_item` (


`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(100) NOT NULL,
`qty` int(11) NOT NULL,
`cost` varchar(100) NOT NULL,
`invoice` varchar(100) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=12 ;

-- --------------------------------------------------------

--

Department of Computer Science and Applications P a g e | 61


PHARMACY MANAGEMENT SYSTEM

-- Table structure for table `sales`


--

CREATE TABLE IF NOT EXISTS `sales` (


`transaction_id` int(11) NOT NULL AUTO_INCREMENT,
`invoice_number` varchar(100) NOT NULL,
`cashier` varchar(100) NOT NULL,
`date` varchar(100) NOT NULL,
`type` varchar(100) NOT NULL,
`amount` varchar(100) NOT NULL,
`profit` varchar(100) NOT NULL,
`due_date` varchar(100) NOT NULL,
`name` varchar(100) NOT NULL,
`balance` varchar(100) NOT NULL,
PRIMARY KEY (`transaction_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=142 ;

-- --------------------------------------------------------

--
-- Table structure for table `sales_order`
--

CREATE TABLE IF NOT EXISTS `sales_order` (


`transaction_id` int(11) NOT NULL AUTO_INCREMENT,
`invoice` varchar(100) NOT NULL,
`product` varchar(100) NOT NULL,
`qty` varchar(100) NOT NULL,
`amount` varchar(100) NOT NULL,
`profit` varchar(100) NOT NULL,
`product_code` varchar(150) NOT NULL,
`gen_name` varchar(200) NOT NULL,
`name` varchar(200) NOT NULL,
`price` varchar(100) NOT NULL,
`discount` varchar(100) NOT NULL,
`date` varchar(500) NOT NULL,
PRIMARY KEY (`transaction_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=315 ;

-- --------------------------------------------------------

--
-- Table structure for table `supliers`
--

CREATE TABLE IF NOT EXISTS `supliers` (


`suplier_id` int(11) NOT NULL AUTO_INCREMENT,
`suplier_name` varchar(100) NOT NULL,
`suplier_address` varchar(100) NOT NULL,
`suplier_contact` varchar(100) NOT NULL,

Department of Computer Science and Applications P a g e | 62


PHARMACY MANAGEMENT SYSTEM

`contact_person` varchar(100) NOT NULL,


`note` varchar(500) NOT NULL,
PRIMARY KEY (`suplier_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=5 ;

-- --------------------------------------------------------

--
-- Table structure for table `user`
--

CREATE TABLE IF NOT EXISTS `user` (


`id` int(11) NOT NULL AUTO_INCREMENT,
`username` varchar(100) NOT NULL,
`password` varchar(100) NOT NULL,
`name` varchar(100) NOT NULL,
`position` varchar(100) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=4 ;

--
-- Dumping data for table `user`
--

INSERT INTO `user` (`id`, `username`, `password`, `name`, `position`) VALUES


(1, 'admin', 'admin', 'Admin', 'admin'),
(2, 'cashier', 'cashier', 'Cashier Pharmacy', 'Cashier'),
(3, 'admin', 'admin123', 'Administrator', 'admin');

/*!40101 SET
CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET
CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET
COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;

[Link]:

<link href="../[Link]" media="screen" rel="stylesheet" type="text/css" />


<form action="[Link]" method="post">
<center><h4><i class="icon-plus-sign icon-large"></i> Add
Customer</h4></center>
<hr>
<div id="ac">
<span>Full Name : </span><input type="text" style="width:265px; height:30px;"
name="name" placeholder="Full Name" Required/><br>
<span>Address : </span><input type="text" style="width:265px; height:30px;"
name="address" placeholder="Address"/><br>

Department of Computer Science and Applications P a g e | 63


PHARMACY MANAGEMENT SYSTEM

<span>Contact : </span><input type="text" style="width:265px; height:30px;"


name="contact" placeholder="Contact"/><br>
<span>Product Name : </span><textarea style="height:70px; width:265px;"
name="prod_name"></textarea><br>
<span>Total: </span><input type="text" style="width:265px; height:30px;"
name="memno" placeholder="Total"/><br>
<span>Note : </span><textarea style="height:60px; width:265px;"
name="note"></textarea><br>
<span>Expected Date: </span><input type="date" style="width:265px; height:30px;"
name="date" placeholder="Date"/><br>
<div style="float:right; margin-right:10px;">
<button class="btn btn-success btn-block btn-large" style="width:267px;"><i
class="icon icon-save icon-large"></i> Save</button>
</div>
</div>
</form>

[Link]
<?php
function createRandomPassword() {
$chars = "003232303232023232023456789";
srand((double)microtime()*1000000);
$i = 0;
$pass = '' ;
while ($i <= 7) {

$num = rand() % 33;

$tmp = substr($chars, $num, 1);

$pass = $pass . $tmp;

$i++;

}
return $pass;
}
$finalcode='IN-'.createRandomPassword();
?>
<link href="../[Link]" media="screen" rel="stylesheet" type="text/css" />
<form action="[Link]" method="post">
<input type="hidden" name="name" value="<?php echo $_GET['invoice']; ?>" />
<input type="hidden" name="invoice" value="<?php echo $finalcode; ?>" />
<input type="hidden" name="tot" value="<?php echo $_GET['amount']; ?>" />
<div id="ac">
<span>Amount : </span><input type="text" style="width:265px; height:30px;"
name="amount" /><br>

Department of Computer Science and Applications P a g e | 64


PHARMACY MANAGEMENT SYSTEM

<span>Remarks : </span><input type="text" style="width:265px; height:30px;"


name="remarks" /><br>
<span>&nbsp;</span><input id="btn" type="submit" value="save" />
</div>
</form>

[Link]:

<link href="../[Link]" media="screen" rel="stylesheet" type="text/css" />


<form action="[Link]" method="post">
<center><h4><i class="icon-plus-sign icon-large"></i> Add Product</h4></center>
<hr>
<div id="ac">
<span>Brand Name : </span><input type="text" style="width:265px; height:30px;"
name="code" ><br>
<span>Generic Name : </span><input type="text" style="width:265px; height:30px;"
name="gen" Required/><br>
<span>Category / Description : </span><textarea style="width:265px; height:50px;"
name="name"> </textarea><br>
<span>Date Arrival: </span><input type="date" style="width:265px; height:30px;"
name="date_arrival" /><br>
<span>Expiry Date : </span><input type="date" value="<?php echo date ('M-d-Y');
?>" style="width:265px; height:30px;" name="exdate" /><br>
<span>Selling Price : </span><input type="text" id="txt1" style="width:265px;
height:30px;" name="price" onkeyup="sum();" Required><br>
<span>Original Price : </span><input type="text" id="txt2" style="width:265px;
height:30px;" name="o_price" onkeyup="sum();" Required><br>
<span>Profit : </span><input type="text" id="txt3" style="width:265px;
height:30px;" name="profit" readonly><br>
<span>Supplier : </span>
<select name="supplier" style="width:265px; height:30px; margin-left:-5px;" >
<option></option>
<?php
include('../[Link]');
$result = $db->prepare("SELECT * FROM supliers");
$result->bindParam(':userid', $res);
$result->execute();
for($i=0; $row = $result->fetch(); $i++){
?>
<option><?php echo $row['suplier_name']; ?></option>
<?php
}
?>
</select><br>
<span>Quantity : </span><input type="number" style="width:265px; height:30px;"
min="0" id="txt11" onkeyup="sum();" name="qty" Required ><br>
<span></span><input type="hidden" style="width:265px; height:30px;" id="txt22"
name="qty_sold" Required ><br>
<div style="float:right; margin-right:10px;">

Department of Computer Science and Applications P a g e | 65


PHARMACY MANAGEMENT SYSTEM

<button class="btn btn-success btn-block btn-large" style="width:267px;"><i


class="icon icon-save icon-large"></i> Save</button>
</div>
</div>
</form>

[Link]:

<link href="../[Link]" media="screen" rel="stylesheet" type="text/css" />


<form action="[Link]" method="post">
<center><h4><i class="icon-plus-sign icon-large"></i> Add Supplier</h4></center>
<hr>
<div id="ac">
<span>Supplier Name : </span><input type="text" style="width:265px;
height:30px;" name="name" required/><br>
<span>Address : </span><input type="text" style="width:265px; height:30px;"
name="address" /><br>
<span>Contact Person : </span><input type="text" style="width:265px;
height:30px;" name="contact" /><br>
<span>Contact No. : </span><input type="text" style="width:265px; height:30px;"
name="cperson" /><br>
<span>Note : </span><textarea style="width:265px; height:80px;" name="note"
/></textarea><br>
<div style="float:right; margin-right:10px;">
<button class="btn btn-success btn-block btn-large" style="width:267px;"><i
class="icon icon-save icon-large"></i> Save</button>
</div>
</div>
</form>

[Link]:
<?php
//Start session
session_start();

//Check whether the session variable SESS_MEMBER_ID is present or not


if(!isset($_SESSION['SESS_MEMBER_ID']) ||
(trim($_SESSION['SESS_MEMBER_ID']) == '')) {
header("location: ../[Link]");
exit();
}
?>

Department of Computer Science and Applications P a g e | 66


PHARMACY MANAGEMENT SYSTEM

[Link]:
<?php
include("function/[Link]");
include("db/[Link]");
?>
<!DOCTYPE html>
<html>
<head>
<title>AlphaWare</title>
<link rel="icon" href="img/[Link]" />
<link rel = "stylesheet" type = "text/css" href="css/[Link]" media="all">
<link rel="stylesheet" type="text/css" href="css/[Link]">
<script src="js/[Link]"></script>
<script src="js/[Link]"></script>
<script src="js/[Link]"></script>
<script src="js/[Link]"></script>
<script src="js/[Link]"></script>
<script src="js/[Link]"></script>
<script src="js/[Link]"></script>
<script src="js/[Link]"></script>
<script src="js/[Link]"></script>
<script src="js/[Link]"></script>
<script src="js/[Link]"></script>
<script src="js/[Link]"></script>
<script src="js/[Link]"></script>
<script src="js/[Link]"></script>
</head>
<body>
<div id="header">
<img src="img/[Link]">
<label>alphaware</label>

<?php
$id = (int) $_SESSION['id'];

$query = mysql_query ("SELECT * FROM


customer WHERE customerid = '$id' ") or die (mysql_error());
$fetch = mysql_fetch_array ($query);
?>

<ul>
<li><a href="function/[Link]"><i class="icon-off
icon-white"></i>logout</a></li>
<li>Welcome:&nbsp;&nbsp;&nbsp;<a href="#profile"
data-toggle="modal"><i class="icon-user icon-white"></i><?php echo
$fetch['firstname']; ?>&nbsp;<?php echo $fetch['lastname'];?></a></li>
</ul>
</div>

Department of Computer Science and Applications P a g e | 67


PHARMACY MANAGEMENT SYSTEM

<div id="profile" class="modal hide fade" tabindex="-1" role="dialog" aria-


labelledby="myModalLabel" aria-hidden="true" style="width:700px;">
<div class="modal-header">
<button type="button" class="close" data-
dismiss="modal" aria-hidden="true">x</button>
<h3 id="myModalLabel">My Account</h3>
</div>
<div class="modal-body">
<?php
$id = (int) $_SESSION['id'];

$query = mysql_query
("SELECT * FROM customer WHERE customerid = '$id' ") or die (mysql_error());
$fetch =
mysql_fetch_array ($query);
?>
<center>
<form method="post">
<center>
<table>
<tr>
<td
class="profile">Name:</td><td class="profile"><?php echo
$fetch['firstname'];?>&nbsp;<?php echo $fetch['mi'];?>&nbsp;<?php echo
$fetch['lastname'];?></td>
</tr>
<tr>
<td
class="profile">Address:</td><td class="profile"><?php echo
$fetch['address'];?></td>
</tr>
<tr>
<td
class="profile">Country:</td><td class="profile"><?php echo
$fetch['country'];?></td>
</tr>
<tr>
<td
class="profile">ZIP Code:</td><td class="profile"><?php echo
$fetch['zipcode'];?></td>
</tr>
<tr>
<td
class="profile">Mobile Number:</td><td class="profile"><?php echo
$fetch['mobile'];?></td>
</tr>
<tr>
<td
class="profile">Telephone Number:</td><td class="profile"><?php echo
$fetch['telephone'];?></td>

Department of Computer Science and Applications P a g e | 68


PHARMACY MANAGEMENT SYSTEM

</tr>
<tr>
<td
class="profile">Email:</td><td class="profile"><?php echo $fetch['email'];?></td>
</tr>
</table>
</center>
</div>
<div class="modal-footer">
<a href="[Link]?id=<?php echo
$fetch['customerid']; ?>"><input type="button" class="btn btn-success" name="edit"
value="Edit Account"></a>
<button class="btn btn-danger" data-
dismiss="modal" aria-hidden="true">Close</button>
</div>
</form>
</div>

<br>
<div id="container">
<div class="nav">
<ul>
<li><a href="[Link]"> <i class="icon-
home"></i>Home</a></li>
<li><a href="[Link]"> <i
class="icon-th-list"></i>Product</a></li>
<li><a href="[Link]"> <i class="icon-
bookmark"></i>About Us</a></li>
</ul>
</div>

<form method="post" class="well" style="background-color:#fff;">


<table class="table">
<label style="font-size:25px;">My Cart</label>
<tr>
<th><h3>Image</h3></td>
<th><h3>Product Name</h3></th>
<th><h3>Size</h3></th>
<th><h3>Quantity</h3></th>
<th><h3>Price</h3></th>
<th><h3>Add</h3></th>
<th><h3>Remove</h3></th>
<th><h3>Subtotal</h3></th>
</tr>

<?php

Department of Computer Science and Applications P a g e | 69


PHARMACY MANAGEMENT SYSTEM

if (isset($_GET['id']))
$id=$_GET['id'];
else
$id=1;
if (isset($_GET['action']))
$action=$_GET['action'];
else
$action="empty";

switch($action)
{

case "view":
if (isset($_SESSION['cart'][$id]))
$_SESSION['cart'][$id];
break;
case "add":
if (isset($_SESSION['cart'][$id]))
$_SESSION['cart'][$id]++;
else
$_SESSION['cart'][$id]=1;
break;
case "remove":
if (isset($_SESSION['cart'][$id]))
{
$_SESSION['cart'][$id]--;
if ($_SESSION['cart'][$id]==0)
unset($_SESSION['cart'][$id]);
}
break;
case "empty":
unset($_SESSION['cart']);
break;
}
if (isset($_SESSION['cart']))
{

$total=0;
foreach($_SESSION['cart'] as $id => $x)
{
$result=mysql_query("Select * from product where product_id=$id");
$myrow=mysql_fetch_array($result);
$name=$myrow['product_name'];
$name=substr($name,0,40);
$price=$myrow['product_price'];
$image=$myrow['product_image'];
$product_size=$myrow['product_size'];
$line_cost=$price*$x;
$total=$total+$line_cost;

Department of Computer Science and Applications P a g e | 70


PHARMACY MANAGEMENT SYSTEM

echo "<tr class='table'>";


echo "<td><h4><img height='70px' width='70px'
src='photo/".$image."'></h4></td>";
echo "<td><h4><input type='hidden' required value='".$id."'
name='pid[]'> ".$name."</h4></td>";
echo "<td><h4>".$product_size."</h4></td>";
echo "<td><h4><input type='hidden' required value='".$x."'
name='qty[]'> ".$x."</h4></td>";
echo "<td><h4>".$price."</h4></td>";
echo "<td><h4><a href='[Link]?id=".$id."&action=add'><i
class='icon-plus-sign'></i></a></td>";
echo "<td><h4><a href='[Link]?id=".$id."&action=remove'><i
class='icon-minus-sign'></i></a></td>";
echo "<td><strong><h3>P ".$line_cost."</h3></strong>";
echo "</tr>";
}

echo"<tr>";
echo "<td></td>";
echo "<td></td>";
echo "<td></td>";
echo "<td></td>";
echo "<td><h2>TOTAL:</h2></td>";
echo "<td><strong><input type='hidden' value='".$total."' required
name='total'><h2 class='text-danger'>P ".$total."</h2></strong></td>";
echo "<td></td>";
echo "<td><a class='btn btn-danger btn-sm pull-right'
href='[Link]?id=".$id."&action=empty'><i class='fa fa-trash-o'></i> Empty
cart</a></td>";
echo "</tr>";
}
else
echo "<font color='#111' class='alert alert-error' style='float:right'>Cart
is empty</font>";

?>
</table>

<div class='pull-right'>
<a href='[Link]' class='btn btn-inverse btn-lg'>Continue Shopping</a>
<?php echo "<button name='pay_now' type='submit' class='btn btn-inverse
btn-lg' >Purchase</button>";
include ("function/[Link]");
?>
</form>
</div>

Department of Computer Science and Applications P a g e | 71


PHARMACY MANAGEMENT SYSTEM

<div id="purchase" class="modal hide fade" tabindex="-1"


role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"
style="width:400px;">
<div class="modal-header">
<button type="button" class="close" data-
dismiss="modal" aria-hidden="true">x</button>
<h3 id="myModalLabel">Mode Of Payment</h3>
</div>
<div class="modal-body">
<form method="post">
<center>
<input type="image"
src="images/[Link]" border="0" name="submit" alt="Make payments with
PayPal - it's fast, free and secure!" />
<br/>
<br/>
<button class="btn btn-lg"
>Cash</button>
</center>
</div>
<div class="modal-footer">
<button class="btn btn-danger" data-dismiss="modal"
aria-hidden="true">Close</button>
</form>
</div>
</div>

<br />
<br />
</div>
<br />
<div id="footer">
<div class="foot">
<label style="font-size:17px;"> Copyright &copy; </label>
<p style="font-size:25px;">Alphaware Inc. 2015</p>
</div>

<div id="foot">
<h4>Links</h4>
<ul>
<a
href="[Link]
<a
href="[Link]
<a
href="[Link]
<a
href="[Link]
</ul>

Department of Computer Science and Applications P a g e | 72


PHARMACY MANAGEMENT SYSTEM

</div>

<div id="develop">
<h4>Developed By:</h4>
<ul>
<a href="#"><li>Allen Joshua
Nicor</li><a>
<a href="#"><li>Ryan Carl
Biaquis</li><a>
</ul>
</div>
</div>
</body>
</html>

[Link]:
<html>
<head>
<title>Checkout</title>
<script type="text/javascript"
src="[Link]
<script>
function suggest(inputString){
if([Link] == 0) {
$('#suggestions').fadeOut();
} else {
$('#country').addClass('load');
$.post("[Link]", {queryString:
""+inputString+""}, function(data){
if([Link] >0) {
$('#suggestions').fadeIn();
$('#suggestionsList').html(data);
$('#country').removeClass('load');
}
});
}
}

function fill(thisValue) {
$('#country').val(thisValue);
setTimeout("$('#suggestions').fadeOut();", 600);
}

</script>

<style>
#result {
height:20px;

Department of Computer Science and Applications P a g e | 73


PHARMACY MANAGEMENT SYSTEM

font-size:16px;
font-family:Arial, Helvetica, sans-serif;
color:#333;
padding:5px;
margin-bottom:10px;
background-color:#FFFF99;
}
#country{
border: 1px solid #999;
background: #EEEEEE;
padding: 5px 10px;
box-shadow:0 1px 2px #ddd;
-moz-box-shadow:0 1px 2px #ddd;
-webkit-box-shadow:0 1px 2px #ddd;
}
.suggestionsBox {
position: absolute;
left: 10px;
margin: 0;
width: 268px;
top: 40px;
padding:0px;
background-color: #000;
color: #fff;
}
.suggestionList {
margin: 0px;
padding: 0px;
}
.suggestionList ul li {
list-style:none;
margin: 0px;
padding: 6px;
border-bottom:1px dotted #666;
cursor: pointer;
}
.suggestionList ul li:hover {
background-color: #FC3;
color:#000;
}
ul {
font-family:Arial, Helvetica, sans-serif;
font-size:11px;
color:#FFF;
padding:0;
margin:0;
}

.load{
background-image:url([Link]);

Department of Computer Science and Applications P a g e | 74


PHARMACY MANAGEMENT SYSTEM

background-position:right;
background-repeat:no-repeat;
}

#suggest {
position:relative;
}
.combopopup{
padding:3px;
width:268px;
border:1px #CCC solid;
}

</style>
</head>
<body onLoad="[Link]('country').focus();">
<form action="[Link]" method="post">
<div id="ac">
<center><h4><i class="icon icon-money icon-large"></i> Cash</h4></center><hr>
<input type="hidden" name="date" value="<?php echo date("m/d/y"); ?>" />
<input type="hidden" name="invoice" value="<?php echo $_GET['invoice']; ?>" />
<input type="hidden" name="amount" value="<?php echo $_GET['total']; ?>" />
<input type="hidden" name="ptype" value="<?php echo $_GET['pt']; ?>" />
<input type="hidden" name="cashier" value="<?php echo $_GET['cashier']; ?>" />
<input type="hidden" name="profit" value="<?php echo $_GET['totalprof']; ?>" />
<center>
<input type="text" size="25" value="" name="cname" id="country"
onkeyup="suggest([Link]);" onblur="fill();" class="" autocomplete="off"
placeholder="Enter Customer Name" style="width: 268px; height:30px;" />

<div class="suggestionsBox" id="suggestions" style="display: none;">


<div class="suggestionList" id="suggestionsList"> &nbsp; </div>
</div>
<?php
$asas=$_GET['pt'];
if($asas=='credit') {
?>Due Date: <input type="date" name="due" placeholder="Due Date" style="width:
268px; height:30px; margin-bottom: 15px;" /><br>
<?php
}
if($asas=='cash') {
?>

<input type="number" name="cash" placeholder="Cash" style="width: 268px;


height:30px; margin-bottom: 15px;" required/><br>
<?php
}
?><button class="btn btn-success btn-block btn-large" style="width:267px;"><i
class="icon icon-save icon-large"></i> Save</button>
</center>

Department of Computer Science and Applications P a g e | 75


PHARMACY MANAGEMENT SYSTEM

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

[Link]:
<html>
<head>
<?php
require_once('[Link]');
?>
<title>
POS
</title>
<link href="css/[Link]" rel="stylesheet">

<link rel="stylesheet" type="text/css" href="css/DT_bootstrap.css">

<link rel="stylesheet" href="css/[Link]">


<style type="text/css">
body {
padding-top: 60px;
padding-bottom: 40px;
}
.sidebar-nav {
padding: 9px 0;
}
</style>
<link href="css/[Link]" rel="stylesheet">

<link href="../[Link]" media="screen" rel="stylesheet" type="text/css" />


<link rel="stylesheet" type="text/css" href="[Link]" />
<script type="text/javascript" src="[Link]"></script>
<script language="javascript">
function Clickheretoprint()
{
var disp_setting="toolbar=yes,location=no,directories=yes,menubar=yes,";
disp_setting+="scrollbars=yes,width=700, height=400, left=100, top=25";
var content_vlue = [Link]("content").innerHTML;

var docprint=[Link]("","",disp_setting);
[Link]();
[Link]('</head><body onLoad="[Link]()" style="width: 700px;
font-size:11px; font-family:arial; font-weight:normal;">');
[Link](content_vlue);
[Link]();
[Link]();
}

Department of Computer Science and Applications P a g e | 76


PHARMACY MANAGEMENT SYSTEM

</script>
</head>
<body>
<?php
include('[Link]');
?>

<div class="container-fluid">
<div class="row-fluid">
<div class="span2">
<div class="well sidebar-nav">
<ul class="nav nav-list">
<li><a href="#"><i class="icon-dashboard icon-2x"></i> Dashboard
</a></li>
<li><a href="[Link]?d1=0&d2=0"><i
class="icon-bar-chart icon-2x"></i> Sales Report</a>
</li>
<li class="active"><a
href="[Link]?d1=0&d2=0"><i class="icon-bar-chart icon-2x"></i>
Collection Report</a> </li>
<li><a href="[Link]?d1=0&d2=0"><i
class="icon-bar-chart icon-2x"></i> Accounts Receivable Report</a> </li>
<li><a rel="facebox" href="select_customer.php"><i
class="icon-user icon-2x"></i> Customer Ledger</a> </li>
<li><a href="[Link]"><i class="icon-table icon-
2x"></i> Products</a> </li>
<li><a href="[Link]"><i class="icon-group
icon-2x"></i> Customers</a> </li>
<li><a href="[Link]"><i class="icon-group icon-
2x"></i> Suppliers</a> </li>
<li><a href="[Link]"><i class="icon-inbox
icon-2x"></i> Purchases</a></li>
</ul>
</div><!--/.well -->
</div><!--/span-->
<div class="span10">
<div class="contentheader">
<i class="icon-bar-chart"></i> Collection Report
</div>
<ul class="breadcrumb">
<li><a href="[Link]">Dashboard</a></li> /
<li class="active">Collection Report</li>
</ul>

<div id="maintable"><div style="margin-top: -19px; margin-bottom: 21px;">


<a href="[Link]"><button class="btn btn-default btn-large" style="float:
none;"><i class="icon icon-circle-arrow-left icon-large"></i> Back</button></a>
</div>
<form action="[Link]" method="get">

Department of Computer Science and Applications P a g e | 77


PHARMACY MANAGEMENT SYSTEM

From : <input type="text" name="d1" style="width: 223px; padding:14px;"


class="tcal" value="" /> To: <input type="text" style="width: 223px; padding:14px;"
name="d2" class="tcal" value="" />
<button class="btn btn-info" style="width: 123px; height:35px; margin-top:-8px;"
type="submit"><i class="icon icon-search icon-large"></i> Search</button>
<button style="width: 123px; height:35px; margin-top:-2px; float:right;" class="btn
btn-success btn-large"><a href="javascript:Clickheretoprint()"><i class="icon icon-
print icon-large"></i> Print</a></button>
</form>
<div class="content" id="content">
<div style="font-weight:bold; text-align:center;font-size:14px;margin-bottom:
15px;">
Collection Report from&nbsp;<?php echo $_GET['d1'] ?>&nbsp;to&nbsp;<?php
echo $_GET['d2'] ?>
</div>
<table class="table table-bordered" id="resultTable" data-responsive="table"
style="text-align: left;">
<thead>
<tr>
<th width="17%"> Transaction ID </th>
<th width="8%"> Date </th>
<th width="25%"> Customer Name </th>
<th width="25%"> Invoice Number </th>
<th width="15%"> Amount </th>
<th width="10%"> Remarks </th>
</tr>
</thead>
<tbody>

<?php
include('../[Link]');
$d1=$_GET['d1'];
$d2=$_GET['d2'];
$result = $db->prepare("SELECT * FROM collection
WHERE date BETWEEN :a AND :b");
$result->bindParam(':a', $d1);
$result->bindParam(':b', $d2);
$result->execute();
for($i=0; $row = $result->fetch(); $i++){
?>
<tr class="record">
<td>CTI-000<?php echo $row['transaction_id']; ?></td>
<td><?php echo $row['date']; ?></td>
<td><?php echo $row['name']; ?></td>
<td><?php echo $row['invoice']; ?></td>
<td><?php
$dsdsd=$row['amount'];
echo formatMoney($dsdsd, true);
?></td>
<td><?php echo $row['remarks']; ?></td>

Department of Computer Science and Applications P a g e | 78


PHARMACY MANAGEMENT SYSTEM

</tr>
<?php
}
?>

</tbody>
<thead>
<tr>
<th colspan="4" style="border-top:1px solid #999999"> Total
</th>
<th colspan="2" style="border-top:1px solid #999999">
<?php
function formatMoney($number, $fractional=false) {
if ($fractional) {
$number = sprintf('%.2f', $number);
}
while (true) {
$replaced = preg_replace('/(-
?\d+)(\d\d\d)/', '$1,$2', $number);
if ($replaced != $number) {
$number = $replaced;
} else {
break;
}
}
return $number;
}
$d1=$_GET['d1'];
$d2=$_GET['d2'];
$results = $db->prepare("SELECT sum(amount)
FROM collection WHERE date BETWEEN :a AND :b");
$results->bindParam(':a', $d1);
$results->bindParam(':b', $d2);
$results->execute();
for($i=0; $rows = $results->fetch(); $i++){
$dsdsd=$rows['sum(amount)'];
echo formatMoney($dsdsd, true);
}
?>
</th>
</tr>
</thead>
</table>
</div>
<div class="clearfix"></div>
</div>
</body>
<?php include('[Link]');?>

</html>

Department of Computer Science and Applications P a g e | 79


PHARMACY MANAGEMENT SYSTEM

[Link]:

<html>
<head>

<?php
require_once('[Link]');
?>
<title>
POS
</title>
</title>
<link href="css/[Link]" rel="stylesheet">

<link rel="stylesheet" type="text/css" href="css/DT_bootstrap.css">

<link rel="stylesheet" href="css/[Link]">


<style type="text/css">
body {
padding-top: 60px;
padding-bottom: 40px;
}
.sidebar-nav {
padding: 9px 0;
}
</style>
<link href="css/[Link]" rel="stylesheet">

<link href="../[Link]" media="screen" rel="stylesheet" type="text/css" />


<!--sa poip up-->
<script src="[Link]" type="text/javascript" charset="utf-8"></script>
<script src="js/[Link]" type="text/javascript" charset="utf-8"></script>
<link href="src/[Link]" media="screen" rel="stylesheet" type="text/css" />
<script src="lib/[Link]" type="text/javascript"></script>
<script src="src/[Link]" type="text/javascript"></script>
<script type="text/javascript">
jQuery(document).ready(function($) {
$('a[rel*=facebox]').facebox({
loadingImage : 'src/[Link]',
closeImage : 'src/[Link]'
})
})
</script>
</head>
<body>

<?php include('[Link]');?>

Department of Computer Science and Applications P a g e | 80


PHARMACY MANAGEMENT SYSTEM

<div class="container-fluid">
<div class="row-fluid">
<div class="span2">
<div class="well sidebar-nav">
<ul class="nav nav-list">
<li class="active"><a href="#"><i class="icon-dashboard icon-large"></i>
Dashboard <div class="pull-right"><i class="icon-circle-arrow-right icon-
large"></i></div></a></li>
<li><a href="#"><i class="icon-group icon-large"></i> Customers <div
class="pull-right"><i class="icon-circle-arrow-right icon-large"></i></div></a></li>
<li><a href="#"><i class="icon-table icon-large"></i> Products <div
class="pull-right"><i class="icon-circle-arrow-right icon-large"></i></div></a></li>
<li><a href="#"><i class="icon-group icon-large"></i> Suppliers <div
class="pull-right"><i class="icon-circle-arrow-right icon-large"></i></div></a></li>
<li><a href="[Link]"><i class="icon-bar-chart icon-large"></i> Sales
Report <div class="pull-right"><i class="icon-circle-arrow-right icon-
large"></i></div></a></li>
<li><a href="[Link]"><i class="icon-inbox icon-large"></i> Cash <div
class="pull-right"><i class="icon-circle-arrow-right icon-large"></i></div></a></li>
<li><a href="[Link]"><i class="icon-user icon-large"></i>
Users <div class="pull-right"><i class="icon-circle-arrow-right icon-
large"></i></div></a></li>
</ul>
</div><!--/.well -->
</div><!--/span-->
<div class="span10">
<div class="contentheader">
<i class="icon-list"></i> Customer Legder
</div>
<ul class="breadcrumb">
<li><a href="[Link]">Dashboard</a></li> /
<li class="active">Customer Legder</li>
</ul>

<div id="maintable">
<div style="margin-top: -19px; margin-bottom: 21px;">
<a href="[Link]"><button class="btn btn-default btn-large" style="float:
none;"><i class="icon icon-circle-arrow-left icon-large"></i> Back</button></a>
</div>
<?php
include('../[Link]');
$tftft=$_GET['cname'];
$resulta = $db->prepare("SELECT * FROM sales WHERE invoice_number= :a");
$resulta->bindParam(':a', $tftft);
$resulta->execute();
for($i=0; $rowa = $resulta->fetch(); $i++){
$name=$rowa['name'];
$amount=$rowa['amount'];

Department of Computer Science and Applications P a g e | 81


PHARMACY MANAGEMENT SYSTEM

}
$resultas = $db->prepare("SELECT * FROM customer WHERE customer_name=
:b");
$resultas->bindParam(':b', $name);
$resultas->execute();
for($i=0; $rowas = $resultas->fetch(); $i++){
echo 'Name : '.$rowas['customer_name'].'<br>';
echo 'Address : '.$rowas['address'].'<br>';
echo 'Contact : '.$rowas['contact'].'<br>';
}
?>
<table class="table table-bordered" id="resultTable" data-responsive="table"
style="text-align: left;">
<thead>
<tr>
<th> Transaction ID </th>
<th> Date </th>
<th> Invoice Number </th>
<th> Payment </th>
<th> Total Ammount Due </th>
<th> Balance </th>
</tr>
</thead>
<tbody>
<tr class="record">
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td><strong><?php echo $rowa['amount']; ?></strong></td>
<td>&nbsp;</td>
</tr>
<?php
$tftft=$_GET['cname'];
$result = $db->prepare("SELECT * FROM collection
WHERE name= :userid ORDER BY transaction_id ASC");
$result->bindParam(':userid', $tftft);
$result->execute();
for($i=0; $row = $result->fetch(); $i++){
?>
<tr class="record">
<td>TR-000<?php echo $row['transaction_id']; ?></td>
<td><?php echo $row['date']; ?></td>
<td><?php echo $row['invoice']; ?></td>
<td><?php echo $row['amount']; ?></td>
<td>&nbsp;</td>
<td><?php echo $row['balance']; ?></td>
</tr>
<?php
}

Department of Computer Science and Applications P a g e | 82


PHARMACY MANAGEMENT SYSTEM

?>

</tbody>
</table>
<a rel="facebox" href="[Link]?invoice=<?php echo $_GET['cname'];
?>&amount=<?php echo $rowa['amount']; ?>" style="margin-top: 10px;"><button
class="btn btn-success"><i class="icon-plus-sign icon-large"></i> Add
Payment</button></a><br><br>
<div class="clearfix"></div>
</div>
</body>
<?php include('[Link]');?>
</html>

[Link]:

<?php
include('../[Link]');
$id=$_GET['id'];
$c=$_GET['invoice'];
$sdsd=$_GET['dle'];
$qty=$_GET['qty'];
$wapak=$_GET['code'];
//edit qty
$sql = "UPDATE products
SET qty=qty+?
WHERE product_id=?";
$q = $db->prepare($sql);
$q->execute(array($qty,$wapak));

$result = $db->prepare("DELETE FROM sales_order WHERE


transaction_id= :memid");
$result->bindParam(':memid', $id);
$result->execute();
header("location: [Link]?id=$sdsd&invoice=$c");
?>

[Link]:

<?php
include('../[Link]');
$id=$_GET['id'];
$result = $db->prepare("DELETE FROM customer WHERE customer_id=
:memid");
$result->bindParam(':memid', $id);
$result->execute();
?>

Department of Computer Science and Applications P a g e | 83


PHARMACY MANAGEMENT SYSTEM

[Link]:

<?php
include('../[Link]');
$id=$_GET['id'];
$result = $db->prepare("DELETE FROM products WHERE product_id=
:memid");
$result->bindParam(':memid', $id);
$result->execute();
?>

[Link]:

<?php
include('../[Link]');
$id=$_GET['id'];
$result = $db->prepare("SELECT * FROM products WHERE product_id=
:userid");
$result->bindParam(':userid', $id);
$result->execute();
for($i=0; $row = $result->fetch(); $i++){
?>
<link href="../[Link]" media="screen" rel="stylesheet" type="text/css" />
<form action="[Link]" method="post">
<center><h4><i class="icon-edit icon-large"></i> Edit Product</h4></center>
<hr>
<div id="ac">
<input type="hidden" name="memi" value="<?php echo $id; ?>" />
<span>Brand Name : </span><input type="text" style="width:265px; height:30px;"
name="code" value="<?php echo $row['product_code']; ?>" Required/><br>
<span>Generic Name : </span><input type="text" style="width:265px; height:30px;"
name="gen" value="<?php echo $row['gen_name']; ?>" /><br>
<span>Category / Description : </span><textarea style="width:265px; height:50px;"
name="name" ><?php echo $row['product_name']; ?> </textarea><br>
<span>Date Arrival: </span><input type ="date" style="width:265px;
height:30px;" name="date_arrival" value="<?php echo $row['date_arrival']; ?>"
/><br>
<span>Expiry Date : </span><input type ="date" style="width:265px;
height:30px;" name="exdate" value="<?php echo $row['expiry_date']; ?>" /><br>
<span>Selling Price : </span><input type="text" style="width:265px; height:30px;"
id="txt1" name="price" value="<?php echo $row['price']; ?>" onkeyup="sum();"
Required/><br>
<span>Original Price : </span><input type="text" style="width:265px; height:30px;"
id="txt2" name="o_price" value="<?php echo $row['o_price']; ?>"
onkeyup="sum();" Required/><br>

Department of Computer Science and Applications P a g e | 84


PHARMACY MANAGEMENT SYSTEM

<span>Profit : </span><input type="text" style="width:265px; height:30px;"


id="txt3" name="profit" value="<?php echo $row['profit']; ?>" readonly><br>
<span>Supplier : </span>
<select name="supplier" style="width:265px; height:30px; margin-left:-5px;" >
<option><?php echo $row['supplier']; ?></option>
<?php
$results = $db->prepare("SELECT * FROM supliers");
$results->bindParam(':userid', $res);
$results->execute();
for($i=0; $rows = $results->fetch(); $i++){
?>
<option><?php echo $rows['suplier_name']; ?></option>
<?php
}
?>
</select><br>
<span>QTY Left: </span><input type="number" style="width:265px; height:30px;"
min="0" name="qty" value="<?php echo $row['qty']; ?>" /><br>
<span>Quantity: </span><input type="number" style="width:265px; height:30px;"
min="0" name="sold" value="<?php echo $row['qty_sold']; ?>" /><br>

<div style="float:right; margin-right:10px;">

<button class="btn btn-success btn-block btn-large" style="width:267px;"><i


class="icon icon-save icon-large"></i> Save Changes</button>
</div>
</div>
</form>
<?php
}
?>

[Link]:

<?php
include('../[Link]');
$id=$_GET['id'];
$result = $db->prepare("SELECT * FROM supliers WHERE suplier_id=
:userid");
$result->bindParam(':userid', $id);
$result->execute();
for($i=0; $row = $result->fetch(); $i++){
?>
<link href="../[Link]" media="screen" rel="stylesheet" type="text/css" />
<form action="[Link]" method="post">
<center><h4><i class="icon-edit icon-large"></i> Edit Supplier</h4></center><hr>
<div id="ac">

Department of Computer Science and Applications P a g e | 85


PHARMACY MANAGEMENT SYSTEM

<input type="hidden" name="memi" value="<?php echo $id; ?>" />


<span>Supplier Name : </span><input type="text" style="width:265px;
height:30px;" name="name" value="<?php echo $row['suplier_name']; ?>" /><br>
<span>Address : </span><input type="text" style="width:265px; height:30px;"
name="address" value="<?php echo $row['suplier_address']; ?>" /><br>
<span>Contact Person : </span><input type="text" style="width:265px;
height:30px;" name="cperson" value="<?php echo $row['contact_person']; ?>"
/><br>
<span>Contact No.: </span><input type="text" style="width:265px; height:30px;"
name="contact" value="<?php echo $row['suplier_contact']; ?>" /><br>
<span>Note : </span><textarea style="width:265px; height:80px;"
name="note"><?php echo $row['note']; ?></textarea><br>
<div style="float:right; margin-right:10px;">

<button class="btn btn-success btn-block btn-large" style="width:267px;"><i


class="icon icon-save icon-large"></i> Save Changes</button>
</div>
</div>
</form>
<?php
}
?>

[Link]:

<!DOCTYPE html>
<html>
<head>
<?php require_once ('[Link]');?>
<title>
POS
</title>
<link href="css/[Link]" rel="stylesheet">

<link rel="stylesheet" type="text/css" href="css/DT_bootstrap.css">

<link rel="stylesheet" href="css/[Link]">


<style type="text/css">

.sidebar-nav {
padding: 9px 0;
}
</style>
<link href="css/[Link]" rel="stylesheet">
<link href="../[Link]" media="screen" rel="stylesheet" type="text/css" />
<link href="src/[Link]" media="screen" rel="stylesheet" type="text/css" />

Department of Computer Science and Applications P a g e | 86


PHARMACY MANAGEMENT SYSTEM

<script src="lib/[Link]" type="text/javascript"></script>


<script src="src/[Link]" type="text/javascript"></script>
<script language="javascript">
function Clickheretoprint()
{
var disp_setting="toolbar=yes,location=no,directories=yes,menubar=yes,";
disp_setting+="scrollbars=yes,width=800, height=400, left=100, top=25";
var content_vlue = [Link]("content").innerHTML;

var docprint=[Link]("","",disp_setting);
[Link]();
[Link]('</head><body onLoad="[Link]()" style="width:
800px; font-size: 13px; font-family: arial;">');
[Link](content_vlue);
[Link]();
[Link]();
}
</script>
<?php
$invoice=$_GET['invoice'];
include('../[Link]');
$result = $db->prepare("SELECT * FROM sales WHERE invoice_number=
:userid");
$result->bindParam(':userid', $invoice);
$result->execute();
for($i=0; $row = $result->fetch(); $i++){
$cname=$row['name'];
$invoice=$row['invoice_number'];
$date=$row['date'];
$cash=$row['due_date'];
$cashier=$row['cashier'];

$pt=$row['type'];
$am=$row['amount'];
if($pt=='cash'){
$cash=$row['due_date'];
$amount=$cash-$am;
}
}
?>
<?php
function createRandomPassword() {
$chars = "003232303232023232023456789";
srand((double)microtime()*1000000);
$i = 0;
$pass = '' ;
while ($i <= 7) {

$num = rand() % 33;

Department of Computer Science and Applications P a g e | 87


PHARMACY MANAGEMENT SYSTEM

$tmp = substr($chars, $num, 1);

$pass = $pass . $tmp;

$i++;

}
return $pass;
}
$finalcode='RS-'.createRandomPassword();
?>

<script language="javascript" type="text/javascript">


/* Visit [Link] for full source code
and get more free JavaScript, CSS and DHTML scripts! */
<!-- Begin
var timerID = null;
var timerRunning = false;
function stopclock (){
if(timerRunning)
clearTimeout(timerID);
timerRunning = false;
}
function showtime () {
var now = new Date();
var hours = [Link]();
var minutes = [Link]();
var seconds = [Link]()
var timeValue = "" + ((hours >12) ? hours -12 :hours)
if (timeValue == "0") timeValue = 12;
timeValue += ((minutes < 10) ? ":0" : ":") + minutes
timeValue += ((seconds < 10) ? ":0" : ":") + seconds
timeValue += (hours >= 12) ? " P.M." : " A.M."
[Link] = timeValue;
timerID = setTimeout("showtime()",1000);
timerRunning = true;
}
function startclock() {
stopclock();
showtime();
}
[Link]=startclock;
// End -->
</SCRIPT>
<body>

<?php include('[Link]');?>

Department of Computer Science and Applications P a g e | 88


PHARMACY MANAGEMENT SYSTEM

<div class="container-fluid">
<div class="row-fluid">
<div class="span2">
<div class="well sidebar-nav">
<ul class="nav nav-list">
<li><a href="[Link]"><i class="icon-dashboard icon-2x"></i>
Dashboard </a></li>
<li class="active"><a href="[Link]?id=cash&invoice"><i
class="icon-shopping-cart icon-2x"></i> Sales</a> </li>
<li><a href="[Link]"><i class="icon-list-alt icon-
2x"></i> Products</a> </li>
<li><a href="[Link]"><i class="icon-group icon-
2x"></i> Customers</a> </li>
<li><a href="[Link]"><i class="icon-group icon-
2x"></i> Suppliers</a> </li>
<li><a href="[Link]?d1=0&d2=0"><i class="icon-
bar-chart icon-2x"></i> Sales Report</a> </li>
<li><a href="sales_inventory.php"><i class="icon-table icon-
2x"></i> Product Inventory</a> </li>
<br><br><br><br><br><br>
<li>
<div class="hero-unit-clock">

<form name="clock">
<font color="white">Time: <br></font>&nbsp;<input
style="width:150px;" type="submit" class="trans" name="face" value="">
</form>
</div>
</li>

</ul>
</div><!--/.well -->
</div><!--/span-->

<div class="span10">
<a href="[Link]?id=cash&invoice=<?php echo $finalcode ?>"><button
class="btn btn-default"><i class="icon-arrow-left"></i> Back to Sales</button></a>

<div class="content" id="content">


<div style="margin: 0 auto; padding: 20px; width: 900px; font-weight: normal;">
<div style="width: 100%; height: 190px;" >
<div style="width: 900px; float: left;">
<center><div style="font:bold 25px 'Aleo';">Sales Receipt</div>
Caps lock Pharmacy <br>
HSR layout Banglore, India <br> <br>
</center>
<div>
<?php
$resulta = $db->prepare("SELECT * FROM customer WHERE
customer_name= :a");

Department of Computer Science and Applications P a g e | 89


PHARMACY MANAGEMENT SYSTEM

$resulta->bindParam(':a', $cname);
$resulta->execute();
for($i=0; $rowa = $resulta->fetch(); $i++){
$address=$rowa['address'];
$contact=$rowa['contact'];
}
?>
</div>
</div>
<div style="width: 136px; float: left; height: 70px;">
<table cellpadding="3" cellspacing="0" style="font-family: arial; font-size:
12px;text-align:left;width : 100%;">

<tr>
<td>OR No. :</td>
<td><?php echo $invoice ?></td>
</tr>
<tr>
<td>Date :</td>
<td><?php echo $date ?></td>
</tr>
</table>

</div>
<div class="clearfix"></div>
</div>
<div style="width: 100%; margin-top:-70px;">
<table border="1" cellpadding="4" cellspacing="0" style="font-family: arial;
font-size: 12px; text-align:left;" width="100%">
<thead>
<tr>
<th width="90"> Product Code </th>
<th> Product Name </th>
<th> Qty </th>
<th> Price </th>
<th> Discount </th>
<th> Amount </th>
</tr>
</thead>
<tbody>

<?php
$id=$_GET['invoice'];
$result = $db->prepare("SELECT * FROM
sales_order WHERE invoice= :userid");
$result->bindParam(':userid', $id);
$result->execute();
for($i=0; $row = $result->fetch(); $i++){
?>
<tr class="record">

Department of Computer Science and Applications P a g e | 90


PHARMACY MANAGEMENT SYSTEM

<td><?php echo $row['product_code']; ?></td>


<td><?php echo $row['name']; ?></td>
<td><?php echo $row['qty']; ?></td>
<td>
<?php
$ppp=$row['price'];
echo formatMoney($ppp, true);
?>
</td>
<td>
<?php
$ddd=$row['discount'];
echo formatMoney($ddd, true);
?>
</td>
<td>
<?php
$dfdf=$row['amount'];
echo formatMoney($dfdf, true);
?>
</td>
</tr>
<?php
}
?>

<tr>
<td colspan="5" style=" text-
align:right;"><strong style="font-size: 12px;">Total: &nbsp;</strong></td>
<td colspan="2"><strong style="font-size:
12px;">
<?php
$sdsd=$_GET['invoice'];
$resultas = $db->prepare("SELECT
sum(amount) FROM sales_order WHERE invoice= :a");
$resultas->bindParam(':a', $sdsd);
$resultas->execute();
for($i=0; $rowas = $resultas->fetch(); $i++){
$fgfg=$rowas['sum(amount)'];
echo formatMoney($fgfg, true);
}
?>
</strong></td>
</tr>
<?php if($pt=='cash'){
?>
<tr>
<td colspan="5"style=" text-
align:right;"><strong style="font-size: 12px; color: #222222;">Cash
Tendered:&nbsp;</strong></td>

Department of Computer Science and Applications P a g e | 91


PHARMACY MANAGEMENT SYSTEM

<td colspan="2"><strong style="font-size:


12px; color: #222222;">
<?php
echo formatMoney($cash, true);
?>
</strong></td>
</tr>
<?php
}
?>
<tr>
<td colspan="5" style=" text-
align:right;"><strong style="font-size: 12px; color: #222222;">
<font style="font-size:20px;">
<?php
if($pt=='cash'){
echo 'Change:';
}
if($pt=='credit'){
echo 'Due Date:';
}
?>&nbsp;
</strong></td>
<td colspan="2"><strong style="font-size:
15px; color: #222222;">
<?php
function formatMoney($number,
$fractional=false) {
if ($fractional) {
$number = sprintf('%.2f',
$number);
}
while (true) {
$replaced = preg_replace('/(-
?\d+)(\d\d\d)/', '$1,$2', $number);
if ($replaced != $number) {
$number = $replaced;
} else {
break;
}
}
return $number;
}
if($pt=='credit'){
echo $cash;
}
if($pt=='cash'){
echo formatMoney($amount, true);
}
?>

Department of Computer Science and Applications P a g e | 92


PHARMACY MANAGEMENT SYSTEM

</strong></td>
</tr>

</tbody>
</table>

</div>
</div>
</div>
</div>
<div class="pull-right" style="margin-right:100px;">
<a href="javascript:Clickheretoprint()" style="font-
size:20px;"><button class="btn btn-success btn-large"><i class="icon-print"></i>
Print</button></a>
</div>
</div>
</div>

[Link]:

<?php
include('../[Link]');
$id=$_GET['id'];
$qty=$_GET['qty'];

$result = $db->prepare("SELECT * FROM products WHERE product_code=


:userid");
$result->bindParam(':userid', $b);
$result->execute();
for($i=0; $row = $result->fetch(); $i++){
$qty=$row['qty'];
}

$sql = "UPDATE products


SET qty=qty+?
WHERE product_id=?";

$result = $db->prepare("DELETE FROM sales_order WHERE


transaction_id= :id");
$result->bindParam(':id', $id);
$result->execute();
header("location: sales_inventory.php");
?>

Department of Computer Science and Applications P a g e | 93


PHARMACY MANAGEMENT SYSTEM

4.1 IMPLEMENTATION DETAILS :

SCREENSHOTS

[DASHBOARD]

[PRODUCT ADDITION]

Department of Computer Science and Applications P a g e | 94


PHARMACY MANAGEMENT SYSTEM

[ADD CUSTOMER]

[SALES]

Department of Computer Science and Applications P a g e | 95


PHARMACY MANAGEMENT SYSTEM

[SALES RECEIPT]

[SALES REPORT]

Department of Computer Science and Applications P a g e | 96


PHARMACY MANAGEMENT SYSTEM

[SUPPLIERS]

Department of Computer Science and Applications P a g e | 97


PHARMACY MANAGEMENT SYSTEM

TESTING

5. SOFTWARE TESTING:
Software testing is described as the way toward accessing the system or its
components with the purpose to find that weather it fulfills the predefined necessities
or not this moment brings us the real, expected and the contrast between their
outcomes . in straightforward words testing is executing in the system the end goal to
distinguish any gaps errors or missing requirements in spite of the genuine desire or
prerequisites.

User side testing

WORKING TASK RESULT


ADMIN FINE

DASHBOARD

ATTENDANCE

MEAL

COST

STUDENT

EMPLOYEE

VENDOR
0 BILL
1 NOTICE BOARD
2 SETTING

STUDENT FINE
LOGIN
ATTENDANCE
CALANDER

Department of Computer Science and Applications P a g e | 98


PHARMACY MANAGEMENT SYSTEM

Validation testing for the project

TEST ID INPUT INPUT VALUE VALID EXPECTED ACTUAL


FEILD TYPE RESULT OUTPUT
VTI MOBILE 4676GDFGH INVALID 10 DIGIT AS
NUMBER NUMERIC EXPECTED
VALUES
ONLY
91+4569875433 INVALID 10 DIGIT AS
VALUES EXPECTED
ONLY
5689097644 VALID FURTHER AS
PROCESSING EXPECTED
SCREEN
VT2 EMAIL ID EXAMPLE@GMA VALID FURTHER AS
[Link] PROCESSING EXPECTED
SCREEN

PAVAN K INVALID FORMAT AS


SHOULD BE EXPECTED
FOLLOWED
VT3 PASSWORD ****** INVALID PASSWORD AS
SHOULD BE EXPECTED
8
CHARACTER
S LONG

Department of Computer Science and Applications P a g e | 99


PHARMACY MANAGEMENT SYSTEM

CONCLUSION

This System is designed in the favour of Pharmacy Management which helps them to
save the records of Medicines and the Prescription.
It helps them from the manual work which is very difficult to find the record of the
medicines and the [Link] information about the medicinal data.

FUTURE ENHANCEMENTS
 Payment Gateway
 More Information about the Medicine
 Home Delivery of the Medicine
 Strong Medicinal Database

Department of Computer Science and Applications P a g e | 100


PHARMACY MANAGEMENT SYSTEM

REFRENCES
1.[Link]
2.[Link]
[Link]:/[Link]

TEXT BOOK REFRENCES


1. Julie c meloni, “sam’s teach yourself PHP, MySQL and apache all in one” fourth
edition ,pearson education.
2. Bear Bibeault, yehuda katz, “JQuery in Action” 2nd edition, manning publications.

Department of Computer Science and Applications P a g e | 101

You might also like