Você está na página 1de 84

Web applications and Software Development

Industrial Application based

Health Care Solutions


(Pharmacy Module)

Submitted to

Maharshi Dayanand University, Rohtak


An institutional project submitted in the partial fulfillment of requirement
For the award of degree of
B.Tech. (ECE) 8th semester

Submitted By:

Supervision By

Mridul Kukreja

Mr. Ravi Mishra

Bhushan
Roll No: 4938832

(Sr.

PHP

Developer)

Electronics and Communication Engineering Department,


Gurgaon College of Engineering for Women,
1

Bilaspur Tauru Road, V. Po Bilaspur, Gurgaon (Hr) 122413 India.


ABSTRACT

The pharmacy management system is an application, which involves administrative functions,


related to various details like stock maintenance, sales list, purchase list, billing list etc. Realizing
the need for quick retrieval and easy management of data, the system was studied in depth,
analyzed and computerized. Owing to the number of drawbacks evident in the existing system,
an automated solution is proposed. The Proposed System aims to remove most of the drawbacks
found extensively in the existing system. The PS is aimed to simplify the complex and redundant
process. The proposed system being developed as a replacement for the existing system is a
graphical user interface with good interactions with the database. It has the following modules:

Billing
Inventory
Adding and Removing products
Suppliers

ACKNOWLEDGEMENTS

I take this opportunity to thank all those who extended their enthusiastic support in helping me to
complete this endeavour.
I am pleased to extend a vote of thanks to Dr. B.L Raina, our Director Sir for his encouragement
and help throughout the course.
I am deeply indebted to Mr. A.K Saxena, Head of the department for his valuable suggestions
and guidance in completing this project.
I wholeheartedly wish to thank Mr.Prem Hawal, Ms. Neerja and Mrs. Sheetal Godara, my
Faculty Supervisors for their immense help and valuable guidance in completing this project.
I also extend my heartiest thanks to CITY INNOVATES PVT. LTD. for giving me the
opportunity to undertake this project. My special thanks to Mr. Ravi Mishra Bhushan, our Project
Leader at the Company, for his valuable guidance and great moral support throughout the
project period.
Finally I express my deepest gratitude and note of thanks to all my friends and respondents who
played a vital role in helping me complete this project.

GURGAON COLLEGE OF ENGINEERING FOR WOMEN


Bilaspur-Tauru Road, Delhi-Jaipur Highway, NH-8, Gurgaon,
Haryana
Approved by AICTE and Directorate of Technical Education, Govt. of Haryana
affiliated to Maharishi Dayanand University (Rohtak)

Certificate
This is to certify that Ms. Mridul Kukreja is a bonafide student of Gurgaon
College of Engineering for Women, Bilaspur, Gurgaon in B.Tech ECE(8th
Semester), Session 2009 -2013.
The entitled project HealthCare Solutions-Pharmacy Module is done by the
student in City Innovates Pvt. Ltd. for the fulfillment of the requirement for the
B.Tech -ECE (8th Semester).
We wish all the very best for the future endeavors.

(NeerjaYadav)
Assistant Professor ECE,
GCEW, Bilaspur, Gurgaon.

CONTENTS

1.
2.
3.
4.
5.

Abstract..2
Acknowledgements3
Certificate by Company
Bonafide Certificate by College...4
Company Profile
About the Company6
Quality Policy..6
6. Chapter 1- Introduction
Project Overview.8
Objective..8
Scope.8
7. Chapter 2- Design Objectives...9
8. Chapter3- Implementation of the System.10
Admin Login..10
Billing.12
Generating and printing Invoice.26
View Inventory..38
Add Product in Inventory41
Remove Product48
View Suppliers...54
View Drugs by Supplier58
View Drugs by Expiry date..64
View Drugs by Minimal Stock Level...69
Change Password..74
Logout78
Database Tables80
9. Conclusion of the project and Scope in Future83
10. Bibliography...84

CITY INNOVATES PVT. LTD.

Company Profile
City Innovates has been inspiring people from different verticals since 2010. As a widely known
group in India its interests include Education, IT, Management and E-Commerce. In today's
vibrant environment that is being transformed by rapid globalization, changing technologies and
shifting work conditions; City Innovates support its clients to attain an early success in their
respective domains by one to one client engagement model.
Organized by vertical industry as well as service line requirements, City Innovates recognizes
your field of interest/business and delivers solutions with the precision you require. We believe
that the only exceptional capital an organization posses is the knowledge and ability of its
people. However, the productivity of that capital depends on how effectively people share their
competence with those who can use it and that's why we've an open discussion platform culture
that makes it easy for the knowledge to be shared and gained.

Quality Policy
City Innovates was established to provide quality services in the domains of Education, IT,
Management, E-Commerce and Travel & Tourism. Our core quality control and executive
philosophy is modeled on short-term continuous improvement and long-term organizational
learning.

Understand

Select the best change or solution.


Develop an implementation plan: what needs to be done, who should be involved, and

when the plan should be accomplished


Standardize the solution, for example, by writing new standard operating procedures.
Establish a process to monitor and control process performance.

Analyze

Define the process: its start, end, and what it does.


Describe the process: list the key tasks performed and sequence of steps, people involved,
equipment used, environmental conditions, work methods, and materials used.
6

Describe the players: external and internal customers and suppliers, and process

operators. Define customer expectations: what the customer wants, when, and where, for
both external and internal customers.
Determine what historical data are available on process performance, or what data need

to be collected to better understand the process.


Describe the perceived problems associated with the process; for instance, failure to meet

customer expectations, excessive variation, long cycle times, and so on.


Identify the primary causes of the problems and their impacts on process performance.
Develop potential changes or solutions to the process, and evaluate how these changes or

solutions will address the primary causes.


Select the most promising solution(s).

Verify

Examine the results of the pilot study or experiment.


Determine whether process performance has improved.
Identify further experimentation that may be necessary.

Implement

Conduct a pilot study or experiment to test the impact of the potential solution(s).
Identify measures to understand how any changes or solutions are successful in
addressing the perceived problems.

CHAPTER 1
7

INTRODUCTION

1.1 Project Overview


Pharmacy management is the process of managing the medicine stock and selecting the suitable
medicine to the illness that mention by patient or customer. The core of pharmacist profession is
the maintenance of quality and the subsequent implication for patient care. The domain of this
project is Information Communication Technology in Healthcare. Within the growth of the
Information Communication Techology and Medical Technology, the system developer takes this
opportunity to help the pharmacist for managing their stock and select the medicine using
computer program. The organization that relate to this system is the pharmacy care center. PMS
is developed to select the medicine for minor illness and manage all of the medicine in
pharmacy. This system also does the selling process, selling and buying the medicine.

1.2 Objective
The objectives that need to be achieved from this Pharmacy Management System
application are:

To alert the pharmacist about the drugs reaching the minimal stock levels.
To provide an aid for the online automated billing and generation of invoice for the

products bought by the customer. This avoids calculation errors.


To provide a secure system application in terms of information retrieval
To help in decision making.
To provide a systematic medicine inventory.

1.3 Scope
This system would be very useful to the small pharmacy stores which are incorporated within the
hospitals. Moreover, as it provides an automated management of pharmacy, it proves to be very
useful to the individual, well established pharmacy stores.

CHAPTER 2
DESIGN OF THE SYSTEM
8

Design Objectives
The primary objective of the design of course, is to deliver the requirements as specified in the
feasibility reports. In general the following design objectives should be kept in mind.
Practicality
The system must be stable and can be operated by users with average.
Efficiency
This involves accuracy, timeliness and comprehensiveness to the system output.
Cost
It is desirable to aim for a system with a minimum cost subject to the condition that it must
satisfy all the requirements.
Flexibility
The system should be modifiable depending on the changing needs of the user. Such
modifications should not entail extensive reconstructing or recreation of software. It should also
be portable to different computer systems.
Security
This is very important aspect of the design and should cover areas of hardware reliability, fall
back procedures, physical security of data and provision for detection of fraud and abuse.

CHAPTER 3
9

Implementation of the System

3.1. ADMIN LOGIN


<html>
<head>
<LINK REL="SHORTCUT ICON"
HREF="image/animated_favicon1.gif" TYPE ='image/x-icon'>
<title>Aventis ePharmacy</title>
<link type="text/css" href="css/login_style.css" rel="stylesheet"/>
<link rel="stylesheet" type="text/css" href="css/login_structure.css">
</head>
<body>
<div id="container">
<div id="header">
<div id="heading"><h3>
An Aventis-Fortis&reg; Venture
</h3></div>
</div>
<div id="firm_logo">
</div>
<div id="login_panel">
<?php
echo '<form class="box login" name="loginform" action="main.php" method="post">';

10

echo ' <fieldset class="boxBody">';


echo '

<label class="box_id" style="text-align:left">Username</label>';

echo '

<input type="text" tabindex="1" name="userid" placeholder="admin" required>';

echo '

<label class="box_id" style="text-align:left">Password</label>';

echo '

<input type="password" tabindex="2" name= "password" required>';

echo ' </fieldset>';


echo ' <footer>';
echo '

<input type="submit" class="btnLogin" value="Login" tabindex="4">';

echo ' </footer>';


echo '</form>';
?>
</div>
</div>
</body>
</html>

11

3.2. BILLING OF THE PRODUCTS


<?php
$con= mysql_connect('localhost','root','');
if(!$con)
{
die('Could not connect: ' . mysql_error());
}
else
{
mysql_select_db('pharma', $con);
}
12

?>
<!DOCTYPE
html
PUBLIC
"-//W3C//DTD
XHTML
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

1.0

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Welcome</title>
</script>
<style type="text/css">

.items { clear: both; width: 70%; margin: 30px 0 0 0; border: 1px solid black; }
.items th { background: #eee; }
.items textarea { width: 80px; height: 50px; }
.items tr.item-row td { border: 0; vertical-align: top; }
.items td.description { width: 300px; }
.items td.item-name { width: 175px; }
.items td.description textarea, #items td.item-name textarea { width: 100%; }
.items td.total-line { border-right: 0; text-align: right; }
.items td.total-value { border-left: 0; padding: 10px; }
.items td.total-value textarea { height: 20px; background: none; }
.items td.balance { background: #eee; }
.items td.blank { border: 0; }
</style>
<script type="text/javascript">
13

Transitional//EN"

function fetch(i)
{
var temp="select"+i;
var temp1="desc"+i;
var temp2="unitcost"+i;
var temp3="price"+i;
var combo1 = document.getElementById(temp);
var val = combo1.options[combo1.selectedIndex].text;
var lval=val.toLowerCase();
var X=Array();
X="<?php
$query1='select * from drugs ';
$res=mysql_query($query1);
while($rowX=mysql_fetch_array($res))
{
echo $rowX['drug_name'];
echo '#';
echo $rowX['drug_desc'];
echo '#';
echo $rowX['drug_cost'];
echo ';';
}?>";
var ARR=X.split(';');

14

var i;
for(i=0;i<16;i++)
{
var temp;
temp=Array();
temp=ARR[i].split("#");
var j;

if(val.toLowerCase()==temp[0].toLowerCase())
{
document.getElementById(temp1).value=temp[1].toUpperCase();document.getElementById(te
mp2).value=temp[2].toUpperCase();
document.getElementById(temp3).value=parseInt(document.getElementById(temp2).value);
}
}

}
function recal(i)
{
var temp="select_"+i;
var temp2="price"+i;
var temp3="unitcost"+i;
var combo1 = document.getElementById(temp);
var val = combo1.options[combo1.selectedIndex].text;
15

document.getElementById(temp2).value=parseInt(document.getElementById(temp3).value)*par
seInt(val);
}
function expenses()
{
var tbl = document.getElementById('table');
var lastRow = tbl.rows.length;
var i=0;
var j=0;
for(j=0;j<15;j++)
{
temp="price"+(j+1);
var add=0;
if((document.getElementById(temp)) == null)
{
add=0;
}
else add=parseInt(document.getElementById(temp).value)
i+=add;
}
document.getElementById('total').value=i.toString();
document.getElementById('vat').value=(i*0.125).toString();
document.getElementById('gtotal').value=(i*0.125+i).toString();

16

}
function getval()
{
expenses();
if(document.getElementById("table").style.display=="table"){
document.getElementById("table").style.display="none";
}
var tbl = document.getElementById('table');
var lastRow = tbl.rows.length;
document.getElementById('hidden').value=lastRow;
var i=0;
var j=0;
for(j=0;j<15;j++)
{
temp="price"+(j+1);
temp1="select"+(j+1);
combo1=document.getElementById(temp1);
temp1=combo1.options[combo1.selectedIndex].text;
if((document.getElementById(tempX)) == null)
{
continue;
}
else add=parseInt(document.getElementById(temp).value)

17

i+=add;
}
document.getElementById('total').value=i.toString();
document.getElementById('vat').value=(i*0.125).toString();
document.getElementById('gtotal').value=(i*0.125+i).toString();
}
</script>
</head>
<body >
<div id="container">
<h3 style="display:block; height:40px; width:80px; padding-top:14px;
color:#AC72A1; color:white; text-align:center">INVOICE</h3>
<form action="checkout.php" method="get" >
<table>
<tr><td><label>Customer's Name</label></td>
<td><input name='cname' type="text" size="40"/> </td></tr>
<tr><td><label>Phone Number</label></td>
<td><input name='pnum' type="text" size="40"/></td></tr>
</table>
<table class="items" id="table" style="display:table" >

<tr>
<th>Item</th>
<th>Description&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</th>
18

background-

<th>Unit Cost</th>
<th>Quantity</th>
<th>Price</th>
</tr>

<TR>
<TD><select name='select1' id="select1" style="padding-left:20px" onchange="fetch(1)">
<?php session_start();
$temp=$_SESSION['valid_user'];
$query='select drug_name from drugs';
$result=mysql_query($query,$con);
$rows=mysql_num_rows($result);
while($row = mysql_fetch_array($result))
{
echo
'<option
value="'.strtoupper($row['drug_name']).'"
selected="selected">'.strtoupper($row['drug_name']).'</option>';
}

?>
</select>
<TD> <INPUT name='desc1' id="desc1" type="text" size="40" />
<TD> <INPUT name='unitcost1' id="unitcost1" type="text" /> </TD>
<TD>
19

<select name='select_1' id="select_1" style="padding-left:20px" onchange="recal(1)" >


<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
<option value="6">6</option>
<option value="7">7</option>
<option value="8">8</option>
<option value="9">9</option>
<option value="10">10</option>
</select>
</TD>
<TD> <INPUT name='price1' id="price1" type="text" /> </TD>
<td><input type="button" class='del' value='Delete' /></td>
</TR>
<TR>
<TD><select name='select2' id="select2" style="padding-left:20px" onchange="fetch(2)">
<?php
$temp=$_SESSION['valid_user'];
$query='select drug_name from drugs';
$result=mysql_query($query,$con);
$rows=mysql_num_rows($result);

20

while($row = mysql_fetch_array($result))
{
echo
'<option
value="'.strtoupper($row['drug_name']).'"
selected="selected">'.strtoupper($row['drug_name']).'</option>';
}

?>
</select>

<TD> <INPUT name='desc2' id="desc2"type="text" size="40" />


<TD> <INPUT name='unitcost2' id="unitcost2" type="text" /> </TD>
<TD> <select name='select_2' id="select_2" style="padding-left:20px" onchange="recal(2)">
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
<option value="6">6</option>
<option value="7">7</option>
<option value="8">8</option>
<option value="9">9</option>
<option value="10">10</option>
</select>
</TD>
<TD> <INPUT name='price2' id="price2" type="text" /> </TD>
21

<td><input type="button" class="add" value="Add More" /></td>


</TR>
</table>
<table>
<tr>
<td><?php
for($i=0;$i<154;$i++)echo '&nbsp';
?></td>
<td><label>Total=</label></td>
<TD> <INPUT name='total' type="text" id="total"/> </TD>
<td><input type="button" value="Calculate" onclick="expenses()"/></td>
</tr>
<tr>
<td><?php
for($i=0;$i<154;$i++)echo '&nbsp';
?></td>
<td><label>Vat(12.5%)=</label></td>
<TD> <INPUT name='vat' type="text" id="vat"/> </TD>
<td></td>
</tr>
<tr>
<td><?php
for($i=0;$i<154;$i++)echo '&nbsp';

22

?></td>
<td><label>Grand Total=</label></td>
<TD> <INPUT name='gtotal' type="text" id="gtotal"/> </TD>
<td><input type="submit" value="Checkout" name="checkout" onclick="getval()" /></td>
</tr>

</table>
<input id="hidden" name="hidden" type="hidden" value="" />
</form>
</div>

<script type="text/javascript" src="javascript/jquery-1.7.min.js"></script>


<script type="text/javascript">
jQuery(document).ready(function($) {
$(document).ready(function(){
$.noConflict();
$('.del').live('click',function(){
$(this).parent().parent().remove();
expenses();
});

$('.add').live('click',function(){
$(this).val('Delete');

23

$(this).attr('class','del');
var tbl = document.getElementById('table');
var lastRow = tbl.rows.length;
var temp="select"+lastRow;
var temp1="desc"+lastRow;
var temp2="unitcost"+lastRow;
var temp3="select_"+lastRow;
var temp4="price"+lastRow;
var newfield='searchField';
jQuery .getJSON("http://127.0.0.1/conn-mysql.php", function (jsonData) {

$("#"+temp).html("");//clear old options


jsonData= eval(jsonData);//get json array
for (i = 0; i < jsonData.length; i++)//iterate over all options
{
for ( key in jsonData[i] )//get key => value
{
$("#"+temp).get(0).add(new Option(jsonData[i][key],[key]), document.all ? i : null);
}
}
});
var tempH="<?php
$query='select drug_name from drugs';

24

$result=mysql_query($query,$con);
$rows=mysql_num_rows($result);
while($row = mysql_fetch_array($result))
{
echo'<optionvalue=\''.strtoupper($row['drug_name']).'\'.selected=\'selected\'>'.strtoupper($row['dr
ug_name']).'</option>';
}
?>";
var appendedText="<TR><TD><select name=\'"+temp+"\' id=\'"+temp+"\' style='paddingleft:20px' onchange=\'fetch(" + lastRow + ")\'>"
+tempH+
"</select> <td><INPUT name=\'"+temp1+"\' id=\'"+temp1+"\' type='text' size='40' /><TD>
<INPUT
name=\'"+temp2+"\'
id=\'"+temp2+"\'type='text'
/></TD><TD>
<select
name=\'"+temp3+"\' id=\'"+temp3+"\' style='padding-left:20px' onchange=\'recal(" + lastRow +
")\'><option
value='1'>1</option><option
value='2'>2</option><option
value='3'>3</option><option
value='4'>4</option><option
value='5'>5</option><option
value='6'>6</option><option
value='7'>7</option><option
value='8'>8</option><option
value='9'>9</option><option
value='10'>10</option></select></TD><TD><INPUT
name=\'"+temp4+"\' id=\'"+temp4+"\' type='text' /></TD><td><input type='button' class='add'
value='Add More' /></td></tr>";
$("#table tr:last").after(appendedText);
});
});
});
</script>
<?php
$var
25

?>
</body>
</html>

3.3. GENERATING AND PRINTING THE INVOICE


<html>
<head>
<LINK REL="SHORTCUT ICON"
HREF="image/animated_favicon1.gif">
<title>Welcome</title>
26

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


<style type="text/css">

.items { clear: both; width: 70%; margin: 30px 0 0 0; border: 1px solid black; }
.items th { background: #eee; }
.items textarea { width: 80px; height: 50px; }
.items tr.item-row td { border: 0; vertical-align: top; }
.items td.description { width: 300px; }
.items td.item-name { width: 175px; }
.items td.description textarea, #items td.item-name textarea { width: 100%; }
.items td.total-line { border-right: 0; text-align: right; }
.items td.total-value { border-left: 0; padding: 10px; }
.items td.total-value textarea { height: 20px; background: none; }
.items td.balance { background: #eee; }
.items td.blank { border: 0; }
body {
font-family: verdana, sans-serif;
font-size: 11px;
margin: 0;
padding: 0;
background: #fff;
}

27

h1 {
font-size: 130%;
}

h1 span, h1 a {
color: #999;
}

h1 a:hover {
color: #666;
}

h4 {
font-size: 100%;
color: #999;
margin: 0;
}

.note {
color: #999;
}

#logo {

28

padding: 14px;
background: #eee;
border-bottom: 2px solid #ccc;
}

#content {
padding: 20px;
}

#footer {
clear: left;
margin-top: 30px;
padding-top: 6px;
color: #999;
border-top: 2px solid #ddd;
}
h3 {
font-size: 130%;
}

.container {
padding: 30px;
margin: 20px 0 5px 0;

29

background: #fff;
}

#minitabs {
margin: 0;
padding: 0 0 20px 10px;
width:1255px;
border-bottom: 1px solid #000;

#minitabs li {
margin: 0;
padding: 0;
display: inline;
list-style-type: none;
}

#minitabs a:link, #minitabs a:visited {


float: left;
font-size: 10px;
line-height: 14px;
font-weight: bold;

30

margin: 0 10px 4px 10px;


padding-bottom: 2px;
text-decoration: none;
color: #AC72A1;
}

#minitabs a.active:link, #minitabs a.active:visited, #minitabs a:hover {


border-bottom: 4px solid #AC72A1;
padding-bottom: 2px;
background: #fff;
color: #10090F;
}

/* relative font-size version */

#miniflex {
width: 100%;
float: left;
font-size: small; /* could be specified at a higher level */
margin: 0;
padding: 0 10px 0 10px;

31

#miniflex li {
float: left;
margin: 0;
padding: 0;
display: inline;
list-style: none;
}

#miniflex a:link, #miniflex a:visited {


float: left;
font-size: 85%;
line-height: 30px;
font-weight: bold;
margin: 0 10px 0 10px;
text-decoration: none;
color: #999;
}

#miniflex a.active:link, #miniflex a.active:visited, #miniflex a:hover {

padding-bottom: 2px;
color: #333;

32

}
</style>
<script type="text/javascript" language="javascript">
function checkShortcut()
{
//
if(document.getElementById('student_editable').hasAttribute('readonly')||
document.getElementById('student_editable1').hasAttribute('readonly')||
document.getElementById('student_editable2').hasAttribute('readonly'))
//{
if(event.keyCode==8 || event.keyCode==13)
return false;
//}
//else
/* {
if((event.keyCode==8
event.keyCode==13)&&((document.getElementById('student_editable').focus()==true)||
(document.getElementById('student_editable1').focus()==true)||
(document.getElementById('student_editable2').focus()==true)))
return true;
}*/
}
function dothis()
{
e=document.getElementById("home");
e.click();
33

||

document.getElementById("home").click();
}
</script>
</head>
<body onLoad="$('#home').trigger('click');">
<div class="container">
<?php
if(isset($_GET['checkout']))
{

$n=trim($_GET['cname']);
$p=trim($_GET['pnum']);
$tot=trim($_GET['total']);
$vat=trim($_GET['vat']);
$gtotal=trim($_GET['gtotal']);
if(!isset($n)|| empty($n) ||!isset($tot) || empty($tot))
{
echo
"<span
style='color:white;
background-color:red;
size:14px;'>INVALID INPUT. Try again.</span><br/><br/>";
}
else
{

?>
34

font-weight:bold;

font-

<h3 style="font-weight:bolder">INVOICE</h3>
<table class="items" id="table" style="display:table">
<tr>
<td><?php echo $n;?></td>
</tr>
<tr>
<td><?php echo $p;?></td>
<td></td>
<td>Invoice No.</td>
<td style="text-align:left"><?php
echo rand(1000,9999);
?></td>
</tr>
<tr>
<th>Item</th>
<th>Description&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</th>
<th>Unit Cost</th>
<th>Quantity</th>
<th>Price</th>
</tr>
<?php
for($i=1;$i<16;$i++)
{

35

$temp="select".$i;
$a=(!empty($_GET[$temp]))?$_GET[$temp]:0;
$tempA="desc".$i;
$b=(!empty($_GET[$tempA]))?$_GET[$tempA]:0;
$tempB="unitcost".$i;
$c=(!empty($_GET[$tempB]))?$_GET[$tempB]:0;
$tempC="select_".$i;
$d=(!empty($_GET[$tempC]))?$_GET[$tempC]:0;
$tempD="price".$i;
$e=(!empty($_GET[$tempD]))?$_GET[$tempD]:0;
if(is_string($a)&&is_string($b)&&is_string($c)&&is_string($d)&&is_string($e))
{
echo "<tr>
<td>".$a."</td>
<td>".$b."</td>
<td>".$c."</td>
<td>".$d."</td>
<td>".$e."</td>
</tr>";
}
}
echo "<tr><td></td><td></td><td></td><td>Total = Rs.</td><td>".$tot."</td></tr>
<tr><td></td><td></td><td></td><td>VAT(12.5%)= Rs.</td><td>".$vat."</td></tr>

36

<tr><td></td><td></td><td></td><td>GrandTotal=Rs.</td><td>".$gtotal."</td></tr></table>";
echo'<br><input
style="margin-left:800px"
onClick="javascript:window.print()" />';

size="30"

}}
?>
</div>
</body>
</html>

3.4. VIEW INVENTORY


37

type="button"

value="Print"

<?php
$con= mysql_connect('localhost','root','');
if(!$con)
{
die('Could not connect: ' . mysql_error());
}
else
{
mysql_select_db('pharma', $con);
}

?>
<html>
<head>
<title>
Add product
</title>
<style>
.fixd
{
width:990px;
}
.header
{
38

background-color:#AC72A1;
color:white;
text-align:center;
}
</style>
</head>
<body >
<div class="fixd">
<table border="1">
<tr class="header">
<th>DRUG ID</th>
<th>DRUG NAME</th>
<th>DRUG DETAILS</th>
<th>DRUG COST</th>
<th>DRUG STOCK</th>
<th>DRUG BRAND</th>
<th>DRUG MAN. YEAR</th>
<th>DRUG EXP. YEAR</th>
<th>DRUG SUPPLIER</th>
</tr>
<?php
$query="select * from drugs, supplier where drug_supplier=supplier_id order by drug_id";
$result=mysql_query($query,$con);

39

while($row=mysql_fetch_array($result))
{
echo "<tr>
<td class='header'>".$row['drug_id']."</td>
<td>".$row['drug_name']."</td>
<td>".$row['drug_desc']."</td>
<td>".$row['drug_cost']."</td>
<td>".$row['drug_stock']."</td>
<td>".$row['drug_manufacturer']."</td>
<td>".$row['drug_man_year']."</td>
<td>".$row['drug_exp_year']."</td>
<td>".$row['supplier_name']."</td>
</tr>";
}
?>
</table>
</div>
</body>

40

3.5. ADD PRODUCT IN INVENTORY


<!DOCTYPE
html
PUBLIC
"-//W3C//DTD
XHTML
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Add Product</p></title>
</head>
<style>
body {
41

1.0

Transitional//EN"

font-family: verdana, sans-serif;


margin: 0;
padding: 0;
background: #fff;
}
.header
{
display:block;
background-color:#AC72A1;
color:white;
}
.labels
{
display:block;
width:5cm;
border:thin;
border-color:#AC72A1;
}
</style>
<body>
<?php
$con= mysql_connect('localhost','root','');
if(!$con)

42

{
die('Could not connect: ' . mysql_error());
}
else
{
mysql_select_db('pharma', $con);
}

?>
<span class="header"><h3>Add New Product</h3></span>
<form action="add_product.php" method="get">
<table>
<tr><td><input type="hidden" /></td></tr>
<tr ><td class="labels"><label>Drug Id</label></td>
<td><input type="text" size="25" readonly="readonly" value=
<?php
$query="select max(drug_id) as no_o_drugs from drugs";
$result=mysql_query($query);
$no_o_rows=mysql_fetch_array($result);
echo $no_o_rows['no_o_drugs']+1;
?> name="id"/></td>
</tr>
<tr>

43

<td class="labels"><label>Drug Name</label></td>


<td><input type="text" size="25" name="name"/></td>
</tr>
<tr>
<td class="labels"><label>Drug Description</label></td>
<td><textarea rows="3" cols="20" name="desc"></textarea></td>
</tr>
<tr>
<td class="labels"><label>Drug Cost</label></td>
<td><input type="text" size="25" name="cost" /></td>
</tr>
<tr>
<td class="labels"><label>Drug Stock</label></td>
<td><input type="text" size="25" name="stock" /></td>
</tr>
<tr>
<td class="labels"><label>Drug Manufacturer</label></td>
<td><input type="text" size="25" name="manf" /></td>
</tr>
<tr>
<td class="labels"><label>Drug Manufacture Year</label></td>
<td><input type="text" size="25" name="man_y" /></td>
</tr>

44

<tr>
<td class="labels"><label>Drug Expire Year</label></td>
<td><input type="text" size="25" name="exp_y" /></td>
</tr>
<tr>
<td class="labels"><label>Drug Supplier Id</label></td>
<td><input type="text" size="25" name="sup" /></td>
</tr>
<tr>
<td></td>
<td><input type="submit" size="25" value="Add" name="submit" /></td>
</tr>
</table>
</form>
<?php
if(isset($_GET['submit']))
{

$a=trim($_GET['id']);
$b=trim($_GET['name']);
$c=trim($_GET['desc']);
$d=trim($_GET['cost']);
$e=trim($_GET['stock']);

45

$f=trim($_GET['manf']);
$g=trim($_GET['man_y']);
$h=trim($_GET['exp_y']);
$i=trim($_GET['sup']);
$_d=intval($d);
$_e=intval($e);
if(!empty($a) && !empty($b) && !empty($c)&& !empty($d)
&& !empty($e)&& !empty($f)&& !empty($g)&& !empty($h)&& !empty($i))
{
$query1="insert into drugs values($a,'$b','$c',$_d,$_e,'$f','$g','$h','$i')";
$result1=mysql_query( $query1);
echo "<span style='color:white; background-color:green; font-weight:bold'>Drug added to
inventory.</span>";
}
else
{
echo "<span
again.</span>";

style='color:white;

background-color:red;

}
}
?>
</body>
</html>

46

font-weight:bold'>Please

try

47

3.6. REMOVE PRODUCT


<!DOCTYPE
html
PUBLIC
"-//W3C//DTD
XHTML
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Remove Product</title>
<style>
body {
font-family: verdana, sans-serif;
margin: 0;
padding: 0;
background: #fff;
}
.header1
{
display:block;
background-color:#AC72A1;
color:white;
}
.header
{
background-color:#AC72A1;

48

1.0

Transitional//EN"

color:white;
text-align:center;
}
.labels
{
display:block;
width:5cm;
border:thin;
border-color:#AC72A1;
}
</style>
</head>
<body>
<?php

$con= mysql_connect('localhost','root','');
if(!$con)
{
die('Could not connect: ' . mysql_error());
}
else
{
mysql_select_db('pharma', $con);

49

?>
<span class="header1"><h3>Remove Product</h3></span>
<form action="delete_product.php" method="get">
<table>
<tr>
<td class="labels"><label>Enter the Drug ID</label></td>
<td><input type="text" size="10" name="id"/></td>
<td><input type="submit" size="10" name="submit" value="Check" /></td>
</tr>
</table>
</form>
<form action="delete_product.php" method="get">
<table>
<?php
session_start();
if(isset($_GET['submit']))
{
$a=trim($_GET['id']);
if(!empty($a))
{
$temp=intval($a);

50

$query="select * from drugs where drug_id=$temp";


$_SESSION['id']=$temp;
$result=mysql_query($query);
if(mysql_num_rows($result)==1)
{
echo "<span style='color:white;
result</span><br/><br/>";

background-color:green;

echo "<tr class='header'>


<th>DRUG ID</th>
<th>DRUG NAME</th>
<th>DRUG DETAILS</th>
<th>DRUG COST</th>
<th>DRUG STOCK</th>
<th>DRUG BRAND</th>
<th>DRUG MAN. YEAR</th>
<th>DRUG EXP. YEAR</th>
<th>DRUG SUPPLIER</th>
</tr>";
while($row=mysql_fetch_array($result))
{
echo "<tr>
<td class='header'>".$row['drug_id']."</td>
<td>".$row['drug_name']."</td>
<td>".$row['drug_desc']."</td>
51

font-weight:bold'>Found

<td>".$row['drug_cost']."</td>
<td>".$row['drug_stock']."</td>
<td>".$row['drug_manufacturer']."</td>
<td>".$row['drug_man_year']."</td>
<td>".$row['drug_exp_year']."</td>
<td>".$row['drug_supplier']."</td>
</tr>
<tr>
<td></td>
<td><input type='submit' name='delete' value='Delete ?'/></td>
</tr>";
}
}
else
{
echo "<span style='color:white; background-color:red; font-weight:bold'>This Drug ID doesn't
exist. Try again.</span>";
}
}
}
?>
</table>
</form>
<?php
52

if(isset($_GET['delete']))
{
$tempX=$_SESSION['id'];
$query1="delete from drugs where drug_id=$tempX";
if(mysql_query($query1))
{
echo "<span style='color:white; background-color:green; font-weight:bold'>Product deleted
successfully.</span>";
}
}
?>
</body>
</html>

3.7. VIEW SUPPLIERS


53

<!DOCTYPE
html
PUBLIC
"-//W3C//DTD
XHTML
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Suppliers</title>
<style type="text/css">
body {
font-family: verdana, sans-serif;
background: #fff;
}
.container
{
border:2px solid #AC72A1;
padding:10px 40px;
width:93%;
height:125px;
}
.name
{
color:white;
background-color:#AC72A1;
padding-left:7px;
margin-top:2px;
54

1.0

Transitional//EN"

margin-left:2px;
margin-right:2px;
width:100%;
height:18px;
}
.label
{
padding-top:5px;
width:70px;
text-decoration:underline;

}
</style>
</head>
<body>
<?php
$con= mysql_connect('localhost','root','');
if(!$con)
{
die('Could not connect: ' . mysql_error());
}
else
{

55

mysql_select_db('pharma', $con);
}
?>
<?php

$query="select * from supplier";


$result=mysql_query($query);
while($row=mysql_fetch_array($result))
{
echo "<div class='container'>";
echo "<div class='name'>";
echo $row['supplier_name'];
echo "</div>";
echo "<table>";
echo "<tr ><td class='label'>Address</td><td>";
echo $row['supplier_address']."</td></tr>";
echo "<tr ><td class='label'>Contact</td><td>";
echo $row['supplier_contact']."</td></tr>";
echo "<tr ><td class='label'>E-mail</td><td>";
echo $row['supplier_email']."</td></tr>";
echo "</table>";
echo "</div>";
}

56

?>
</body>
</html>

3.8. VIEW DRUGS BY SUPPLIER


<?php

$con= mysql_connect('localhost','root','');
if(!$con)
{
die('Could not connect: ' . mysql_error());
}

57

else
{
mysql_select_db('pharma', $con);
}
?>
<!DOCTYPE
html
PUBLIC
"-//W3C//DTD
XHTML
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Welcome</title>
<style>
body {
font-family: verdana, sans-serif;
margin: 0;
padding: 0;
background: #fff;
}
.header1
{
display:block;
background-color:#AC72A1;
color:white;
}
58

1.0

Transitional//EN"

.header
{
background-color:#AC72A1;
color:white;
text-align:center;
}
</style>
<script type="text/javascript">
function getval()
{
var val=document.getElementById('id').value;
var temp="<?php

$query1='select supplier_id, supplier_name from supplier';

$result1=mysql_query($query1);
while($row1=mysql_fetch_array($result1))
{
echo $row1['supplier_id'];
echo "#";
echo $row1['supplier_name'];
echo ";";
}
?>";
var arr=temp.split(';');
var i;

59

for(i=0;i<3;i++)
{
var temp=arr[i].split('#');
if(parseInt(val)==parseInt(temp[0]))
{
document.getElementById('hidden').value=temp[1];
}
}

}
</script>
</head>
<body>
<span class="header1"><h3>Search Product(s) by Supplier</h3></span>
<form action="drugs_by_supplier.php" method="get">
<table>
<tr>
<td class="labels"><label>Enter the Supplier ID</label></td>
<td><input id='id' type="text" size="10" name="id" onchange="javascipt:getval()"/></td>
<td><input type="submit" size="10" name="submit" value="Check" /></td>
<td><input type="text" size="20" readonly="readonly" id="hidden" style="border:none" /></td>
</tr>
</table>

60

</form>

<table>
<?php
session_start();
if(isset($_GET['submit']))
{
$a=trim($_GET['id']);
if(!empty($a))
{
$temp=intval($a);
$query="select
*
from
supplier_id=drug_supplier";

drugs,

supplier

where

drug_supplier=$temp

and

$_SESSION['id']=$temp;
$result=mysql_query($query);
if(mysql_num_rows($result))
{
echo
"<span
style='color:white;
result(s)</span><br/><br/>";

background-color:green;

echo "<tr class='header'>


<th>DRUG ID</th>
<th>DRUG NAME</th>
<th>DRUG DETAILS</th>
<th>DRUG COST</th>
61

font-weight:bold'>Found

<th>DRUG STOCK</th>
<th>DRUG BRAND</th>
<th>DRUG MAN. YEAR</th>
<th>DRUG EXP. YEAR</th>
<th>DRUG SUPPLIER</th>
</tr>";
while($row=mysql_fetch_array($result))
{
echo "<tr>
<td class='header'>".$row['drug_id']."</td>
<td>".$row['drug_name']."</td>
<td>".$row['drug_desc']."</td>
<td>".$row['drug_cost']."</td>
<td>".$row['drug_stock']."</td>
<td>".$row['drug_manufacturer']."</td>
<td>".$row['drug_man_year']."</td>
<td>".$row['drug_exp_year']."</td>
<td>".$row['supplier_name']."</td>
</tr>
";
}
}
else

62

{
echo "<span style='color:white; background-color:red; font-weight:bold'>This Supplier ID
doesn't exist. Try again.</span>";
}
}
}
?>
</table>
</body>
</html>

3.9. VIEW DRUGS BY EXPIRY DATE


63

<?php

$con= mysql_connect('localhost','root','');
if(!$con)
{
die('Could not connect: ' . mysql_error());
}
else
{
mysql_select_db('pharma', $con);
}
?>
<!DOCTYPE
html
PUBLIC
"-//W3C//DTD
XHTML
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Welcome</title>
<style>
body {
font-family: verdana, sans-serif;
margin: 0;
padding: 0;
64

1.0

Transitional//EN"

background: #fff;
}
.header1
{
display:block;
background-color:#AC72A1;
color:white;
}
.header
{
background-color:#AC72A1;
color:white;
text-align:center;
}
</style>
</head>
<body>
<span class="header1"><h3>Search Year of Expiry</h3></span>
<form action="drug_by_exp.php" method="get">
<table>
<tr>
<td class="labels"><label>Enter Year&nbsp;&nbsp;(Eg. 2012)</label></td>
<td><input id='id' type="text" size="10" name="id"/></td>

65

<td><input type="submit" size="10" name="submit" value="Check" /></td>


</tr>
</table>
</form>
<table>
<?php
session_start();
if(isset($_GET['submit']))
{
$a=trim($_GET['id']);
if(!empty($a))
{
$query="select * from drugs,
supplier_id=drug_supplier";

supplier

where

drug_exp_year

like

'%$a%'

and

$result=mysql_query($query);
if(mysql_num_rows($result))
{
echo "<span style='color:white; background-color:green; font-weight:bold'>Drugs getting
expired in $a</span><br/><br/>";
echo "<tr class='header'>
<th>DRUG ID</th>
<th>DRUG NAME</th>
<th>DRUG DETAILS</th>
<th>DRUG COST</th>
66

<th>DRUG STOCK</th>
<th>DRUG BRAND</th>
<th>DRUG MAN. YEAR</th>
<th>DRUG EXP. YEAR</th>
<th>DRUG SUPPLIER</th>
</tr>";
while($row=mysql_fetch_array($result))
{
echo "<tr>
<td class='header'>".$row['drug_id']."</td>
<td>".$row['drug_name']."</td>
<td>".$row['drug_desc']."</td>
<td>".$row['drug_cost']."</td>
<td>".$row['drug_stock']."</td>
<td>".$row['drug_manufacturer']."</td>
<td>".$row['drug_man_year']."</td>
<td>".$row['drug_exp_year']."</td>
<td>".$row['supplier_name']."</td>
</tr>
";
}
}
else

67

{
echo "<span style='color:white; background-color:red; font-weight:bold'>This value was invalid.
Try again.</span>";
}
}
}
?>
</table>
</body>
</html>

3.10. VIEW BY MINIMAL DRUG STOCK


<?php

68

$con= mysql_connect('localhost','root','');
if(!$con)
{
die('Could not connect: ' . mysql_error());
}
else
{
mysql_select_db('pharma', $con);
}
?>
<!DOCTYPE
html
PUBLIC
"-//W3C//DTD
XHTML
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Welcome</title>
<style>
body {
font-family: verdana, sans-serif;
margin: 0;
padding: 0;
background: #fff;
}
.header1
69

1.0

Transitional//EN"

{
display:block;
background-color:#AC72A1;
color:white;
}
.header
{
background-color:#AC72A1;
color:white;
text-align:center;
}
</style>
</head>
<body>
<span class="header1"><h3>Search Drugs below certain Minimal Limit</h3></span>
<form action="drug_by_stock.php" method="get">
<table>
<tr>
<td class="labels"><label>Enter the Stock limit</label></td>
<td><input id='id' type="text" size="10" name="id"/></td>
<td><input type="submit" size="10" name="submit" value="Check" /></td>
</tr>
</table>

70

</form>

<table>
<?php
session_start();
if(isset($_GET['submit']))
{
$a=trim($_GET['id']);
if(!empty($a))
{
$temp=intval($a);
$query="select * from drugs, supplier where drug_stock < $temp and supplier_id=drug_supplier
order by drug_id";
$_SESSION['id']=$temp;
$result=mysql_query($query);
if(mysql_num_rows($result))
{
echo
"<span
style='color:white;
background-color:green;
weight:bold'><strong></strong>Drugs below stock level $a </span><br/><br/>";
echo "<tr class='header'>
<th>DRUG ID</th>
<th>DRUG NAME</th>
<th>DRUG DETAILS</th>
<th>DRUG COST</th>
71

font-

<th>DRUG STOCK</th>
<th>DRUG BRAND</th>
<th>DRUG MAN. YEAR</th>
<th>DRUG EXP. YEAR</th>
<th>DRUG SUPPLIER</th>
</tr>";
while($row=mysql_fetch_array($result))
{
echo "<tr>
<td class='header'>".$row['drug_id']."</td>
<td>".$row['drug_name']."</td>
<td>".$row['drug_desc']."</td>
<td>".$row['drug_cost']."</td>
<td>".$row['drug_stock']."</td>
<td>".$row['drug_manufacturer']."</td>
<td>".$row['drug_man_year']."</td>
<td>".$row['drug_exp_year']."</td>
<td>".$row['supplier_name']."</td>
</tr>
";
}
}
else

72

{
echo "<span style='color:white; background-color:green; font-weight:bold'>All drug stock is
surplus than Qty. $temp</span>";
}
}
}
?>
</table>
</body>
</html>

3.11. CHANGE PASSWORD


<form action="chg_pwd.php" method="post">
<table style="margin-top:40px; margin-left:30px;">
<tr><td><label style="color:#AC72A1">Change Password</label></td><td></td></tr>
73

<tr><td><input type="hidden" /></td><td></td></tr>


<tr><td><label>Current Password</label></td><td><input name="prev_pwd" type="password"
/></td></tr>
<tr><td><label>New Password</label></td><td><input name="new_pwd" type="password"
/></td></tr>
<tr><td><label>Confirm
type="password" /></td></tr>

Password</label></td><td><input

name="conf_pwd"

<tr><td></td><td><input name="subm" type="submit" value="Confirm"/></td></tr>


<tr><td colspan="2"><?php
function status(){ echo "<span style='color:red; margin-left:40px'>Wrong credentials. Try
again.</span>"; unset($_POST['prev_pwd']);
unset($_POST['new_pwd']);
unset($_POST['conf_pwd']);}
function mismatch(){ echo "<span style='color:red; margin-left:40px'>Password mismatch. Try
again.</span>"; unset($_POST['prev_pwd']);
unset($_POST['new_pwd']);
unset($_POST['conf_pwd']);}
function success(){ echo "<span style='color:green; margin-left:40px'>Password changed
successfully.</span>";unset($_POST['prev_pwd']);
unset($_POST['new_pwd']);
unset($_POST['conf_pwd']);} ?></td></tr>
</table>
</form>
<?php
$con= mysql_connect('localhost','root','');

74

if(!$con)
{
die('Could not connect: ' . mysql_error());
}
else
{
mysql_select_db('pharma', $con);
}
session_start();
$temp=$_SESSION['valid_user'];
?>
<?php
if(isset($_POST['subm']))
{
$curr_pwd=$_POST['prev_pwd'];
$new_pwd=$_POST['new_pwd'];
$conf_pwd=$_POST['conf_pwd'];
$query00="select admin_password from admin where admin_username='$temp'";
$result5=mysql_query($query00,$con);
$pwd=0;
if($row_prev=mysql_fetch_array($result5))
{
$pwd=$row_prev['admin_password'];

75

}
if(strtolower($pwd)!=$curr_pwd){ status();}
else
{
if(($curr_pwd==strtolower($pwd))&&($new_pwd==$conf_pwd))
{
$query01="update admin set admin_password='$new_pwd' where admin_username='$temp'";
if(mysql_query($query01,$con))
{
success();
}
}
else
{
mismatch();
}
}
}

?>

76

3.12. LOGOUT
<?php
session_start();
$old_user = $_SESSION['valid_user'];
unset($_SESSION['valid_user']);
session_destroy();
?>
<!DOCTYPE
html
PUBLIC
"-//W3C//DTD
XHTML
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Home</title>
</head>

77

1.0

Transitional//EN"

<body>
<?php
if(!empty($old_user))
{
header("Location: index.php");
}
else
{

header("Location: index.php");
echo 'Login first <br />';
}
?>
</body>
</html>

78

DATABASE TABLES
Admin

Cities

79

Drugs

80

Suppliers
81

CONCLUSION OF THE PROJECT


82

AND
ITS SCOPE IN FUTURE
Automated Pharmacy Management software consisted of all the basic and advanced
functionalities as required from an efficient pharmacist point of view.
Testing was done on various levels to ensure its effectiveness and efficient working. Its view the
drugs sorting on the basis of suppliers,expiry dates and minimum stock levels features instead
of manual sorting were concluded as out of the box features in the software . It was also tested in
terms of scalability on different platforms and surprisingly it was very smooth on all of the,
which makes it a platform-independent software.
Now it would be integrated into a Health Care Solutions ERP Software and will be released to
the client.
It was the most revolutionary change brought into a medical industry and hoping to make it more
advanced in the coming future.

BIBLIOGRAPHY
83

The following sources were referred for the completion of this project:
1. Notes by the Supervisor
2. Websites:
www.google.com
www.w3schools.com
www.yahoo.com
www.phpeveryday.com
www.stackoverflow.com
3. Wikipedia Encyclopedias

84

Você também pode gostar