Escolar Documentos
Profissional Documentos
Cultura Documentos
Submitted to
Submitted By:
Supervision By
Mridul Kukreja
Bhushan
Roll No: 4938832
(Sr.
PHP
Developer)
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.
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
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
Analyze
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
Verify
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.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
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
10
echo '
echo '
echo '
11
?>
<!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 </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
20
while($row = mysql_fetch_array($result))
{
echo
'<option
value="'.strtoupper($row['drug_name']).'"
selected="selected">'.strtoupper($row['drug_name']).'</option>';
}
?>
</select>
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>
$('.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) {
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>
.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;
}
30
#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;
}
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 </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>
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
1.0
Transitional//EN"
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
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
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
background-color:green;
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>
<!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
56
?>
</body>
</html>
$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
$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;
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>
<?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 (Eg. 2012)</label></td>
<td><input id='id' type="text" size="10" name="id"/></td>
65
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>
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>
Password</label></td><td><input
name="conf_pwd"
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
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