You are on page 1of 50

HOSPITAL MANAGEMENT SYSTEM, MAMCET, 2008IT

1

M.A.M. COLLEGE OF ENGINEERING AND TECHNOLOGY
TRICHY -621105

DEPARTMENT OF INFORMATION TECHNOLOGY

ANNA UNIVERSITY PRACTICAL EXAMINATIONS, OCT2011




RECORD NOTE BOOK











CS1403 - SOFTWARE DEVELOPMENT LABORATORY


Student Name :
Register Number :
Class & Semester : 2008-2012, B.Tech., IT, VII - Semester
Month & Year : OCT - 2011
HOSPITAL MANAGEMENT SYSTEM, MAMCET, 2008IT
2













HOSPITAL MANAGEMENT SYSTEM, MAMCET, 2008IT
3


M.A.M. COLLEGE OF ENGINEERING AND TECHNOLOGY

TRICHY -621105

DEPARTMENT OF INFORMATION TECHNOLOGY

ANNA UNIVERSITY PRACTICAL EXAMINATIONS, OCT2011


BONAFIDE CERTIFICATE


This is to certify that this practical work titled CS1403 Software Development
Laboratory is the bonafide work of ________________________________
Register Number ______________________ during the academic year 2011-2012.



Faculty Incharge Head of the Department

Submitted for Anna University of Technology, Tiruchirappalli practical
examination held on ____/___/___ at M.A.M. College of Engineering and
Technology, Trichy 621105.


Internal Examiner External Examiner
HOSPITAL MANAGEMENT SYSTEM, MAMCET, 2008IT
4


ABSTRACT

Our project Hospital Management system includes registration of patients,
storing their details into the system, and also computerized billing in the pharmacy,
and labs. Our software has the facility to give a unique id for every patient and
stores the details of every patient and the staff automatically. It includes a search
facility to know the current status of each room. User can search availability of a
doctor and the details of a patient using the id.
The Hospital Management System can be entered using a username and
password. It is accessible either by an administrator or receptionist. Only they can
add data into the database. The data can be retrieved easily. The interface is very
user-friendly. The data are well protected for personal use and makes the data
processing very fast.

HOSPITAL MANAGEMENT SYSTEM, MAMCET, 2008IT
5



TABLE OF CONTENT

Description Page No

BONAFIE CERTIFICATE 03
ABSTRACT 04
Chapter 1 INTRODUCTION 07
1.1 Problem Definition 08
1.2 Requirement of Proposed System 10
1.3 System Analysis 12
1.4 Proposed System 14

Chapter 2 PROCESS DESCRIPTION 16
2.1 Doctor Module 16
2.2 Patient Module 18
2.3 Appointment Module 20

Chapter 3 PROGRAM DESIGN 22
3.1 Doctor Module 22
HOSPITAL MANAGEMENT SYSTEM, MAMCET, 2008IT
6

3.2 Patient Module 27
3.3 Appointment Module 29

Chapter 4 DATABASE DESIGN 32
Chapter 5 CONCLUSION 35
REFERENCES 36
Appendix
1 SAMPLE SOURCE CODE 37

HOSPITAL MANAGEMENT SYSTEM, MAMCET, 2008IT
7

Chapter 1

INTRODUCTION


In most developing countries, provision of basic preventive, promotive and
curative services is a major concern of the Government. With growing population
and advancement in the medical technology and increasing expectation of the
people especially for quality curative care, it has now become imperative to
provide quality health care services through the established institutions. In public
Sector 15,393 allopathic hospitals (Health Information of India 2003) are
functioning. In the rural areas, the secondary level care is being provided through
3222 CHCs (Bulletin on Rural Health Statistics in India 2005) with 30 beds each
with specialist services of physicians, pediatricians, O & G specialists, and
surgeons being made available.
However, these services have not been successful in gaining the faith and
confidence of the people because of lack of specialists, facilities and
accountability, along with the paucity of resources and non-involvement of the
community. Hospital Management System is a simple yet effective management
structure. This system acts for the hospitals to manage the affairs of the hospital.
HOSPITAL MANAGEMENT SYSTEM, MAMCET, 2008IT
8

HMS is free to prescribe, generate and use the functioning and maintaining the
quality of services.

1.1 PROBLEM DEFINITION




This project is aimed to automate the hospital management system. This
project is developed mainly to administrate doctor's appointment with the patients.
The purpose of the project entitled as HOSPITAL MANAGEMENT SYSTEM is
to computerize the Front Office Management of Hospital to develop software
which is user friendly, simple, fast, and cost effective. It deals with the collection
of patients information, diagnosis details, etc. Traditionally, it was done manually.
The main function of the system is to register and store patient details and doctor
details and retrieve these details as and when required, and also to manipulate these
details meaningfully.
HOSPITAL MANAGEMENT SYSTEM, MAMCET, 2008IT
9


NEED
1. Efficiently maintains the details about the patient
2. Simultaneously updates changes made to any data, item in the entire data base.
3. It is faster than manual system


HOSPITAL MANAGEMENT SYSTEM, MAMCET, 2008IT
10

The goal of any system development is to develop and implement the system
cost effectively; user-friendly and most suited to the users analysis is the heart of
the process.

This function of Hospital Management Information System deals with
registering the new Patient either for OPD or IPD and giving unique Identification
Number to the Patient. This number is unique throughout the System for
identifying the patient.

Analysis is the study of the various operations performed by the system and
their relationship within and outside of the system. During analysis, data collected
on the files, decision points and transactions handled by the present system.
Different kinds of tools are used in analysis of which interview is a common one.

The patient can be registered at Reception. Patient identification number is
also created for each separate visit of the patient. This is also a part of registering
patient. ID is used for tracking of medical records of the patient for that particular
OPD visit or IPD admission. All the medical record of the patient are identified by
combination of numbers i.e. Patient ID. The numbers gives flexible search in terms
of finding patient's History Record.

1.2 REQUIREMENT OF PROPOSED SYSTEM

The first step in system development life cycle is the identification of need
of change to improve or enhance an existing system. An initial investigation on
existing system was carried out. The present system of hospital is completely
HOSPITAL MANAGEMENT SYSTEM, MAMCET, 2008IT
11

manual. Many problems were identified during the initial study of the existing
system. To develop this software detailed study is made at local hospital. Based on
the information collected it is decided to maintain the basic information about
doctors and patients.

PATIENT REGISTRATION



SLOT DETAILS

The working time for doctors is scheduled as follows.

HOSPITAL MANAGEMENT SYSTEM, MAMCET, 2008IT
12

Each patient will consult the doctor based on the appointment. If the doctor is free
on his/her duty time, the outpatient can consult the doctor after the spot
appointments are made.

APPOINTMENT

Appointments for patients may be made at the reception. New patients are
informed to fill the registration form and pay registration fees. Then the patient id
is generated and issued to the patient for further use.

The appointment may be fixed by verifying doctor's and their free slots available,
then the appointment will be confirmed. Otherwise the dates or slots may be asked
to change for the patients.

1.3 SYSEM ANALYSIS

System analysis is a detailed study of the various operations performed by a
system and their relationships within and outside of the system. Here the key
question is What all problems exist in the present system? What must be done to
solve the problem? Analysis begins when a user or manager begins a study of the
program using existing system. During analysis, data collected on the various files,
decision points and transactions handled by the present system.

The commonly used tools in the system are Data Flow Diagram, interviews,
etc. training, experience and common sense are required for collection of relevant
information needed to develop the system. The success of the system depends
HOSPITAL MANAGEMENT SYSTEM, MAMCET, 2008IT
13

largely on how clearly the problem is defined, thoroughly investigated and
properly carried out through the choice of solution.



A good analysis model should provide not only the mechanisms of problem
understanding but also the framework of the solution. Then the proposed system
should be analyzed thoroughly in accordance with the needs.

HOSPITAL MANAGEMENT SYSTEM, MAMCET, 2008IT
14

System analysis can be categorized into four parts.
System planning and initial investigation
Information gathering
Applying analysis tools for structured analysis
Feasibility study
Cost/benefit analysis

The doctor's appointment with various slots for patient is created and
maintained by system. The appointments can be altered at any time before an hour
of the actual appointment schedule. The doctors and patients details must be
registered to create the appointments.

1.4 PROPOSED SYSTEM

HOSPITAL MANAGEMENT SYSTEM, MAMCET, 2008IT
15


The drawback of the existing system is that it is very difficult to retrieve data
from case files. It is difficult to handle the whole system manually and it is less
accurate and to keep the data in case files for future reference because it may get
destroyed. Moreover it is very difficult to retrieve data. Redundancy of data may
occur and this may lead to the inconsistency. The manual system is so time-
consuming.

HOSPITAL MANAGEMENT SYSTEM, MAMCET, 2008IT
16


The proposed system is very easy to operate. Speed and accuracy are the
main advantages of proposed system. There is no redundancy of data. The data are
stored in the computers secondary memories like hard disk, etc. it can be easily
receive and used at any time. The proposed system will easily handle all the data
and the work done by the existing systems. The proposed systems eliminate the
drawbacks of the existing system to a great extent and it provides tight security to
data.

HOSPITAL MANAGEMENT SYSTEM, MAMCET, 2008IT
17


Chapter 2

PROCESS DESCRIPTION


2.1 DOCTOR MODULE

Process Name : Doctor list
Process Number : 1.1
Input : Doctor Number Select from List
Output : Status Message
Error Condition : Records Not Found if no records in database



Process Name : Add Doctor
Process Number : 1.2
Input : Name
: Specialization
Output : Status Message
: Doctor Number (ID)
Error Condition : Name Cant be Empty
: Specialization Cant be Empty

HOSPITAL MANAGEMENT SYSTEM, MAMCET, 2008IT
18



Process Name : Delete Doctor
Process Number : 1.3
Input : Doctor Number (ID)
Output : Status Message
Error Condition : None


Process Name : Modify Doctor
Process Number : 1.4
Input : Doctor Number (ID)
: Name
: Specialization
Output : Status Message
Error Condition : Name Cant be Empty
: Specialization Cant be Empty


Process Name : Undelete Doctor
Process Number : 1.5
Input : Doctor Number (ID)
Output : Status Message
Error Condition : None

HOSPITAL MANAGEMENT SYSTEM, MAMCET, 2008IT
19


HOSPITAL MANAGEMENT SYSTEM, MAMCET, 2008IT
20


2.2 PATIENT MODULE

Process Name : Patient list
Process Number : 2.1
Input : Patient Number Select from List
Output : Status Message
Error Condition : Records Not Found if no records in database



Process Name : Add Patient
Process Number : 2.2
Input : Name
: Sex
: Address
Output : Status Message
: Patient Number (ID)
Error Condition : Name Cant be Empty
: Address Cant be Empty

HOSPITAL MANAGEMENT SYSTEM, MAMCET, 2008IT
21



Process Name : Delete Patient
Process Number : 2.3
Input : Patient Number (ID)
Output : Status Message
Error Condition : None


Process Name : Modify Patient
Process Number : 2.4
Input : Patient Number (ID)
: Name
: Sex
: Address
Output : Status Message
Error Condition : Name Cant be Empty
: Address Cant be Empty


Process Name : Undelete Patient
Process Number : 1.5
Input : Patient Number (ID)
Output : Status Message
Error Condition : None
HOSPITAL MANAGEMENT SYSTEM, MAMCET, 2008IT
22



2.3 APPOINTMENT MODULE


Process Name : Appointment List
Process Number : 3.1
Input : Doctor Number
Output : Appointment with Patient Details
Error Condition : Records Not Found if no records in database



Process Name : Add Appointment
Process Number : 3.2
Input : Doctor Number
: Patient Number
: Slot Schedule
Output : Status Message
: Appointment Number (ID)
Error Condition : None

HOSPITAL MANAGEMENT SYSTEM, MAMCET, 2008IT
23



Process Name : Delete Appointment
Process Number : 3.3
Input : Appointment Number (ID)
Output : Status Message
Error Condition : None


Process Name : Modify Appointment
Process Number : 2.4
Input : Appointment Number (ID)
: Doctor Select from List
: Patient Select from List
: Slot Select from List
Output : Status Message
Error Condition : None


Process Name : Undelete Patient
Process Number : 3.5
Input : Appointment Number (ID)
Output : Status Message
Error Condition : None

HOSPITAL MANAGEMENT SYSTEM, MAMCET, 2008IT
24


Chapter 3

PROGRAM DESIGN


3.1 DOCTOR MODULE

LIST OF DOCTOR RECORDS



HOSPITAL MANAGEMENT SYSTEM, MAMCET, 2008IT
25

INSERTION OF NEW DOCTOR RECORD

RECORD CREATION


STATUS MESSAGE



HOSPITAL MANAGEMENT SYSTEM, MAMCET, 2008IT
26

UPDATED LIST AFTER INSERTION OF NEW RECORD



MODIFICATION OF EXISTING RECORDS


HOSPITAL MANAGEMENT SYSTEM, MAMCET, 2008IT
27

STATUS MESSAGE


UPDATED LIST AFTER MODIFICATION




HOSPITAL MANAGEMENT SYSTEM, MAMCET, 2008IT
28


DELETE SELECTED DOCTOR

UPDAED LIST AFTER DELETION



HOSPITAL MANAGEMENT SYSTEM, MAMCET, 2008IT
29

3.2 PATIENT MODULE

REGISTERED PATIENTS


NEW PATIENT DETAILS

HOSPITAL MANAGEMENT SYSTEM, MAMCET, 2008IT
30

MODIFICATION OF EXISTING PATIENT RECORD






DELETION OF EXISTING PATIENT RECORD



HOSPITAL MANAGEMENT SYSTEM, MAMCET, 2008IT
31

3.3 APPOINTMENT MODULE

APPOINTMENT DETAILS


CREATE NEW APPOINTMENT


HOSPITAL MANAGEMENT SYSTEM, MAMCET, 2008IT
32


STATUS MESSAGE



MODIFICATION OF APPOINTMENT


STATUS MESSAGE


HOSPITAL MANAGEMENT SYSTEM, MAMCET, 2008IT
33


CANCEL THE APPOINTMENT



HOSPITAL MANAGEMENT SYSTEM, MAMCET, 2008IT
34

Chapter 4

DATABASE DESIGN


DATABASE: HOSPITAL


TABLE: APPOINTMENT (APPT)

HOSPITAL MANAGEMENT SYSTEM, MAMCET, 2008IT
35


TABLE: DOCTOR (DOCT)





TABLE: PATIENT



HOSPITAL MANAGEMENT SYSTEM, MAMCET, 2008IT
36


TABLE: SLOT





HOSPITAL MANAGEMENT SYSTEM, MAMCET, 2008IT
37

Chapter 5

CONCLUSION

The HOSPITAL MANAGEMENT SYSTEM is a great improvement over
the manual system using case fields and paper. The computerization of the system
has sped up the process. In the current system, the front office managing is very
slow. The hospital managing system was thoroughly checked and tested with
dummy data and thus is found to be very reliable.

ADVANTAGES
It is fast, efficient and reliable
Avoids data redundancy and inconsistency
Web-based
Number of personnel required is considerably less
Provides more security and integrity to data

FUTURE ENHANCEMENTS
The proposed system is Hospital Management System. We can enhance this
system by including more facilities like billing system, inpatient room allotment
for the admitted patients and the stock details of medicines in the pharmacy.
Providing such features enable the users to include more comments into the
system.


HOSPITAL MANAGEMENT SYSTEM, MAMCET, 2008IT
38


REFERENCES


1. PHP MySQL Website Programming: Problem - Design Solution byChris
Lea, Mike Buzzard, Dilip Thomas , J essey White-Cinis
2. Beginning PHP5, Apache, and MySQL Web Development (Programmer to
Programmer) by Elizabeth Naramore
3. MySQL/PHP Database Applications, 2nd Edition by Brad Bulger
4. How to Do Everything with PHP and MySQL by Vikram Vaswani
HOSPITAL MANAGEMENT SYSTEM, MAMCET, 2008IT
39

Appendix 1

SAMPLE SOURCE CODE

DADD.PHP
<ht ml >
<head>
<met a name=" spm" cont ent =" Hosi t a Management Syst em" >
<t i t l e>Add New Doct or </ t i t l e>
</ head>
<body>
<t abl e al i gn=cent er wi dt h=750 cel l spaci ng=0 cel l paddi ng=5>
<t r bgcol or =bl ue><t d al i gn=cent er ><f ont SI ZE=6 col or =whi t e>HOSPI TAL
MANAGEMENT SYSTEM</ f ont ></ t d></ t r >
<t r ><t d><t abl e al i gn=cent er wi dt h=750 cel l spaci ng=0 cel l paddi ng=5>
<t r ><t d al i gn=cent er ><a hr ef =dl i st . php>Doct or s</ t d><t d al i gn=cent er ><a
hr ef =pl i st . php>Pat i ent s</ t d><t d al i gn=cent er ><a
hr ef =app. php>Appoi nt ment s</ t d>
</ t abl e></ t d></ t r >
<t r bgcol or =r ed><t d ><f ont si ze=4 col or =whi t e>New
Doct or </ f ont ></ t d></ t r >
<f or mname=f dadd met hod=post act i on=dsave. php>
<t r ><t d><t abl e wi dt h=750 cel l spaci ng=0 cel l paddi ng=5>
<t r ><t d>Doct or Name</ t d><t d><i nput t ype=t ext name=name si ze=30
maxl engt h=30></ t d></ t r >
<t r ><t d>Speci l i zat i on</ t d><t d><i nput t ype=t ext name=spec si ze=30
maxl engt h=30></ t d></ t r >
</ t abl e></ t d></ t r >
<t r ><t d al i gn=cent er ><i nput t ype=submi t val ue=Submi t ></ t d></ t r >
</ f or m>
</ t abl e>
</ body>
HOSPITAL MANAGEMENT SYSTEM, MAMCET, 2008IT
40

</ ht ml >


DSAVE. PHP
<ht ml >
<head>
<met a name=" spm" cont ent =" Hosi t al Management Syst em">
<t i t l e>Save Doct or </ t i t l e>
</ head>
<body>
<t abl e al i gn=cent er wi dt h=750 cel l spaci ng=0 cel l paddi ng=5>
<t r bgcol or =bl ue><t d al i gn=cent er ><f ont SI ZE=6 col or =whi t e>HOSPI TAL
MANAGEMENT SYSTEM</ f ont ></ t d></ t r >
<t r ><t d><t abl e al i gn=cent er wi dt h=750 cel l spaci ng=0 cel l paddi ng=5>
<t r ><t d al i gn=cent er ><a hr ef =dl i st . php>Doct or s</ t d><t d al i gn=cent er ><a
hr ef =pl i st . php>Pat i ent s</ t d><t d al i gn=cent er ><a
hr ef =app. php>Appoi nt ment s</ t d>
</ t abl e></ t d></ t r >
<t r bgcol or =r ed><t d ><f ont si ze=4 col or =whi t e>Save
Doct or </ f ont ></ t d></ t r >
<?php
$name=t r i m( $_POST[ "name" ] ) ;
$spec=t r i m( $_POST[ "spec" ] ) ;
$er r or =0;
i f ( $name==" ") { $er r or =1; echo "<t r ><t d><f ont col or =r ed si ze=4>Name
can' t empt y</ f ont ></ t d></ t r >"; }
i f ( $spec==" ") { $er r or =1; echo "<t r ><t d><f ont col or =r ed
si ze=4>Speci l i zat i on can' t empt y</ f ont ></ t d></ t r >"; }
i f ( $er r or ==0) {
i f ( ! mysql _connect ( "l ocal host ", "r oot " , " " ) )
{
echo " <t r ><t d><f ont col or =r ed si ze=4>Connect i on
Er r or </ f ont ></ t d></ t r >";
HOSPITAL MANAGEMENT SYSTEM, MAMCET, 2008IT
41

di e( ) ;
}
mysql _sel ect _db( "hospi t al " ) ;
mysql _quer y( "i nser t i nt o doct ( dname, dspec, dshow)
val ues( ' ". $name. "' , ' ". $spec. "' , ' Y' ) " ) ;
echo " <t r ><t d al i gn=cent er ><f ont si ze=4 col or =gr een>Successf ul l y
Recor ds I nser t ed</ f ont ></ t d></ t r >" ;
}
el se {
echo " <f or mname=f dadd met hod=post act i on=dsave. php>" ;
echo " <t r ><t d><t abl e wi dt h=750 cel l spaci ng=0 cel l paddi ng=5>";
echo " <t r ><t d>Doct or Name</ t d><t d><i nput t ype=t ext name=name
si ze=30 maxl engt h=30 val ue=' ". $name. "' ></ t d></ t r >";
echo " <t r ><t d>Speci l i zat i on</ t d><t d><i nput t ype=t ext name=spec
si ze=30 maxl engt h=30 val ue=' ". $spec. "' ></ t d></ t r >";
echo " </ t abl e></ t d></ t r >";
echo " <t r ><t d al i gn=cent er ><i nput t ype=submi t
val ue=Submi t ></ t d></ t r >" ;
echo " </ f or m>" ;
}
echo " <t r ><t d al i gn=cent er ><a
hr ef =dl i st . php>Cont i nue. . . </ a></ t d></ t r >" ;
echo " </ t abl e>";
echo " </ body></ ht ml >";



DLIST.PHP
<ht ml >
<head>
<met a name=" spm" cont ent =" Hosi t al Management Syst em">
<t i t l e></ t i t l e>
</ head>
HOSPITAL MANAGEMENT SYSTEM, MAMCET, 2008IT
42

<body>
<t abl e al i gn=cent er wi dt h=750 cel l spaci ng=0 cel l paddi ng=5>
<t r bgcol or =bl ue><t d al i gn=cent er ><f ont SI ZE=6 col or =whi t e>HOSPI TAL
MANAGEMENT SYSTEM</ f ont ></ t d></ t r >
<t r ><t d><t abl e al i gn=cent er wi dt h=750 cel l spaci ng=0 cel l paddi ng=5>
<t r ><t d al i gn=cent er ><a hr ef =dl i st . php>Doct or s</ t d><t d al i gn=cent er ><a
hr ef =pl i st . php>Pat i ent s</ t d><t d al i gn=cent er ><a
hr ef =app. php>Appoi nt ment s</ t d>
</ t abl e></ t d></ t r >
<t r bgcol or =r ed><t d ><f ont si ze=4 col or =whi t e>Doct or s
Li st </ f ont ></ t d></ t r >
<t r ><t d><a hr ef =dadd. php>Add New Recor d</ a></ t d></ t r >
<t r ><t d><t abl e wi dt h=750 cel l spaci ng=0 cel l paddi ng=5>
<t r bgcol or =#ccccc><t d al i gn=cent er >S No</ t d><t d al i gn=cent er >Doct or
Name</ t d><t d al i gn=cent er >Speci al i zat i on</ t d><t d
al i gn=cent er >Opt i ons</ t d></ t r >
<?php
i f ( ! mysql _connect ( "l ocal host ", "r oot " , " " ) )
{
echo " <t r ><t d><f ont col or =r ed si ze=4>Connect i on
Er r or </ f ont ></ t d></ t r >";
di e( ) ;
}
mysql _sel ect _db( "hospi t al " ) ;
$r s1=mysql _quer y( " SELECT * f r omdoct wher e dshow=' Y' or der by
dname; ") ;
$sno=1;
whi l e( $r ow=mysql _f et ch_ar r ay( $r s1) ) {
echo " <t r ><t d>$sno</ t d><t d>$r ow[ 1] </ t d><t d>$r ow[ 2] </ t d><t d><a
hr ef =dmod. php?r no=". $r ow[ 0] . ">Modi f y</ a> | <a
hr ef =ddel . php?r no=". $r ow[ 0] . ">Del et e</ a></ t d></ t r >" ;
$sno++;
}
HOSPITAL MANAGEMENT SYSTEM, MAMCET, 2008IT
43

i f ( $sno==1) echo "<t r ><t d al i gn=cent er ><f ont si ze=4 col or =r ed>Recor ds
Not Found</ f ont ></ t d></ t r >";
?>
</ t abl e></ t d></ t r >
<t r ><t d al i gn=cent er ><hr ></ t d></ t r >
<t r bgcol or =r ed><t d><f ont si ze=4 col or =whi t e>Del et ed
Recor ds</ f ont ></ t d></ t r >
<t r ><t d><t abl e wi dt h=750 cel l spaci ng=0 cel l paddi ng=5>
<t r bgcol or =#ccccc><t d al i gn=cent er >S No</ t d><t d al i gn=cent er >Doct or
Name</ t d><t d al i gn=cent er >Speci al i zat i on</ t d><t d
al i gn=cent er >Opt i ons</ t d></ t r >
<?php
$r s2=mysql _quer y( " SELECT * f r omdoct wher e dshow=' N' or der by
dname; ") ;
$sno=1;
whi l e( $r ow=mysql _f et ch_ar r ay( $r s2) ) {
echo " <t r ><t d>$sno</ t d><t d>$r ow[ 1] </ t d><t d>$r ow[ 2] </ t d><t d><a
hr ef =dundel . php?r no=". $r ow[ 0] . ">Undel et e</ a></ t d></ t r >" ;
$sno++;
}
i f ( $sno==1) echo "<t r ><t d al i gn=cent er ><f ont si ze=4 col or =r ed>Recor ds
Not Found</ f ont ></ t d></ t r >";
?>
</ t abl e></ t d></ t r >
</ t abl e>
</ body>
</ ht ml >


DMOD.PHP
<ht ml >
<head>
<met a name=" spm" cont ent =" Hosi t al Management Syst em">
HOSPITAL MANAGEMENT SYSTEM, MAMCET, 2008IT
44

<t i t l e>Modi f y Doct or Pr of i l e</ t i t l e>
</ head>
<body>
<t abl e al i gn=cent er wi dt h=750 cel l spaci ng=0 cel l paddi ng=5>
<t r bgcol or =bl ue><t d al i gn=cent er ><f ont SI ZE=6 col or =whi t e>HOSPI TAL
MANAGEMENT SYSTEM</ f ont ></ t d></ t r >
<t r ><t d><t abl e al i gn=cent er wi dt h=750 cel l spaci ng=0 cel l paddi ng=5>
<t r ><t d al i gn=cent er ><a hr ef =dl i st . php>Doct or s</ t d><t d al i gn=cent er ><a
hr ef =pl i st . php>Pat i ent s</ t d><t d al i gn=cent er ><a
hr ef =app. php>Appoi nt ment s</ t d>
</ t abl e></ t d></ t r >
<?php
$r no=t r i m( $_GET[ "r no"] ) ;
i f ( ! mysql _connect ( "l ocal host ", "r oot " , " " ) )
{
echo " <t r ><t d><f ont col or =r ed si ze=4>Connect i on
Er r or </ f ont ></ t d></ t r >";
di e( ) ;
}
mysql _sel ect _db( "hospi t al " ) ;
$r s1=mysql _quer y( " SELECT * f r omdoct wher e dno=' " . $r no. "' ") ;
$sno=1;
whi l e( $r ow=mysql _f et ch_ar r ay( $r s1) ) {
echo " <t r bgcol or =r ed><t d ><f ont si ze=4 col or =whi t e>Edi t Doct or
Det ai l s</ f ont ></ t d></ t r >";
echo " <f or mname=f dmod met hod=post act i on=dupdat e. php>" ;
echo " <t r ><t d><t abl e wi dt h=750 cel l spaci ng=0 cel l paddi ng=5>";
echo " <t r ><t d>Doct or Name</ t d><t d><i nput t ype=t ext name=name
si ze=30 maxl engt h=30 val ue=' ". $r ow[ 1] . " ' ></ t d></ t r >";
echo " <t r ><t d>Speci l i zat i on</ t d><t d><i nput t ype=t ext name=spec
si ze=30 maxl engt h=30 val ue=' " . $r ow[ 2] . "' ></ t d></ t r >" ;
echo " </ t abl e></ t d></ t r >";
echo " <t r ><t d col span=2 al i gn=cent er ><i nput t ype=hi dden name=r no
HOSPITAL MANAGEMENT SYSTEM, MAMCET, 2008IT
45

val ue=". $r no. " ><i nput t ype=submi t val ue=Submi t ></ t d></ t r >";
echo " </ f or m>" ;
$sno++;
}
i f ( $sno==1) echo "<t r ><t d al i gn=cent er ><f ont si ze=4 col or =r ed>Recor ds
Not Found</ f ont ></ t d></ t r >";
?>
</ t abl e>
</ body>
</ ht ml >

DUPDATE.PHP
<ht ml >
<head>
<met a name=" spm" cont ent =" Hosi t al Management Syst em">
<t i t l e>Updat e Doct or </ t i t l e>
</ head>
<body>
<t abl e al i gn=cent er wi dt h=750 cel l spaci ng=0 cel l paddi ng=5>
<t r bgcol or =bl ue><t d al i gn=cent er ><f ont SI ZE=6 col or =whi t e>HOSPI TAL
MANAGEMENT SYSTEM</ f ont ></ t d></ t r >
<t r ><t d><t abl e al i gn=cent er wi dt h=750 cel l spaci ng=0 cel l paddi ng=5>
<t r ><t d al i gn=cent er ><a hr ef =dl i st . php>Doct or s</ t d><t d al i gn=cent er ><a
hr ef =pl i st . php>Pat i ent s</ t d><t d al i gn=cent er ><a
hr ef =app. php>Appoi nt ment s</ t d>
</ t abl e></ t d></ t r >
<t r bgcol or =r ed><t d ><f ont si ze=4 col or =whi t e>Updat e
Doct or </ f ont ></ t d></ t r >
<?php
$r no=t r i m( $_POST[ " r no" ] ) ;
$name=t r i m( $_POST[ "name" ] ) ;
$spec=t r i m( $_POST[ "spec" ] ) ;
$er r or =0;
HOSPITAL MANAGEMENT SYSTEM, MAMCET, 2008IT
46

i f ( $name==" ") { $er r or =1; echo "<t r ><t d><f ont col or =r ed si ze=4>Name
can' t empt y</ f ont ></ t d></ t r >"; }
i f ( $spec==" ") { $er r or =1; echo "<t r ><t d><f ont col or =r ed
si ze=4>Speci l i zat i on can' t empt y</ f ont ></ t d></ t r >"; }
i f ( $er r or ==0) {
i f ( ! mysql _connect ( "l ocal host ", "r oot " , " " ) )
{
echo " <t r ><t d><f ont col or =r ed si ze=4>Connect i on
Er r or </ f ont ></ t d></ t r >";
di e( ) ;
}
mysql _connect ( "l ocal host ", "r oot " , " ") ;
mysql _sel ect _db( "hospi t al " ) ;
mysql _quer y( "updat e doct set dname=' ". $name. " ' , dspec=' " . $spec. " '
wher e dno=' " . $r no. "' ") ;
echo " <t r ><t d al i gn=cent er ><f ont si ze=4 col or =gr een>Successf ul l y
Recor ds Updat ed</ f ont ></ t d></ t r >";
}
el se {
echo " <f or mname=f dadd met hod=post act i on=dupdat e. php>" ;
echo " <t r ><t d><t abl e wi dt h=750 cel l spaci ng=0 cel l paddi ng=5>";
echo " <t r ><t d>Doct or Name</ t d><t d><i nput t ype=t ext name=name
si ze=30 maxl engt h=30 val ue=' ". $name. "' ></ t d></ t r >";
echo " <t r ><t d>Speci l i zat i on</ t d><t d><i nput t ype=t ext name=spec
si ze=30 maxl engt h=30 val ue=' ". $spec. "' ></ t d></ t r >";
echo " </ t abl e></ t d></ t r >";
echo " <t r ><t d al i gn=cent er ><i nput t ype=hi dden name=r no
val ue=". $r no. " ><i nput t ype=submi t val ue=Submi t ></ t d></ t r >";
echo " </ f or m>" ;
}
echo " <t r ><t d al i gn=cent er ><a
hr ef =dl i st . php>Cont i nue. . . </ a></ t d></ t r >" ;
echo " </ t abl e>";
HOSPITAL MANAGEMENT SYSTEM, MAMCET, 2008IT
47

echo " </ body></ ht ml >";


DDEL.PHP
<ht ml >
<head>
<met a name=" spm" cont ent =" Hosi t al Management Syst em">
<t i t l e></ t i t l e>
</ head>
<body>
<t abl e al i gn=cent er wi dt h=750 cel l spaci ng=0 cel l paddi ng=5>
<t r bgcol or =bl ue><t d al i gn=cent er ><f ont SI ZE=6 col or =whi t e>HOSPI TAL
MANAGEMENT SYSTEM</ f ont ></ t d></ t r >
<t r ><t d><t abl e al i gn=cent er wi dt h=750 cel l spaci ng=0 cel l paddi ng=5>
<t r ><t d al i gn=cent er ><a hr ef =dl i st . php>Doct or s</ t d><t d al i gn=cent er ><a
hr ef =pl i st . php>Pat i ent s</ t d><t d al i gn=cent er ><a
hr ef =app. php>Appoi nt ment s</ t d>
</ t abl e></ t d></ t r >
<t r bgcol or =r ed><t d ><f ont si ze=4 col or =whi t e>Doct or s
Li st </ f ont ></ t d></ t r >
<t r ><t d><a hr ef =dadd. php>Add New Recor d</ a></ t d></ t r >
<t r ><t d><t abl e wi dt h=750 cel l spaci ng=0 cel l paddi ng=5>
<t r bgcol or =#ccccc><t d al i gn=cent er >S No</ t d><t d al i gn=cent er >Doct or
Name</ t d><t d al i gn=cent er >Speci al i zat i on</ t d><t d
al i gn=cent er >Opt i ons</ t d></ t r >
<?php
i f ( ! mysql _connect ( "l ocal host ", "r oot " , " " ) )
{
echo " <t r ><t d><f ont col or =r ed si ze=4>Connect i on
Er r or </ f ont ></ t d></ t r >";
di e( ) ;
}
mysql _sel ect _db( "hospi t al " ) ;
HOSPITAL MANAGEMENT SYSTEM, MAMCET, 2008IT
48

$r s1=mysql _quer y( " SELECT * f r omdoct wher e dshow=' Y' or der by
dname; ") ;
$sno=1;
whi l e( $r ow=mysql _f et ch_ar r ay( $r s1) ) {
echo " <t r ><t d>$sno</ t d><t d>$r ow[ 1] </ t d><t d>$r ow[ 2] </ t d><t d><a
hr ef =dmod. php?r no=". $r ow[ 0] . ">Modi f y</ a> | <a
hr ef =ddel . php?r no=". $r ow[ 0] . ">Del et e</ a></ t d></ t r >" ;
$sno++;
}
i f ( $sno==1) echo "<t r ><t d al i gn=cent er ><f ont si ze=4 col or =r ed>Recor ds
Not Found</ f ont ></ t d></ t r >";
?>
</ t abl e></ t d></ t r >
<t r ><t d al i gn=cent er ><hr ></ t d></ t r >
<t r bgcol or =r ed><t d><f ont si ze=4 col or =whi t e>Del et ed
Recor ds</ f ont ></ t d></ t r >
<t r ><t d><t abl e wi dt h=750 cel l spaci ng=0 cel l paddi ng=5>
<t r bgcol or =#ccccc><t d al i gn=cent er >S No</ t d><t d al i gn=cent er >Doct or
Name</ t d><t d al i gn=cent er >Speci al i zat i on</ t d><t d
al i gn=cent er >Opt i ons</ t d></ t r >
<?php
$r s2=mysql _quer y( " SELECT * f r omdoct wher e dshow=' N' or der by
dname; ") ;
$sno=1;
whi l e( $r ow=mysql _f et ch_ar r ay( $r s2) ) {
echo " <t r ><t d>$sno</ t d><t d>$r ow[ 1] </ t d><t d>$r ow[ 2] </ t d><t d><a
hr ef =dundel . php?r no=". $r ow[ 0] . ">Undel et e</ a></ t d></ t r >" ;
$sno++;
}
i f ( $sno==1) echo "<t r ><t d al i gn=cent er ><f ont si ze=4 col or =r ed>Recor ds
Not Found</ f ont ></ t d></ t r >";
?>
</ t abl e></ t d></ t r >
HOSPITAL MANAGEMENT SYSTEM, MAMCET, 2008IT
49

</ t abl e>
</ body>
</ ht ml >


DUNDEL.PHP
<ht ml >
<head>
<met a name=" spm" cont ent =" Hosi t al Management Syst em">
<t i t l e>Recover Doct or </ t i t l e>
</ head>
<body>
<t abl e al i gn=cent er wi dt h=750 cel l spaci ng=0 cel l paddi ng=5>
<t r bgcol or =bl ue><t d al i gn=cent er ><f ont SI ZE=6 col or =whi t e>HOSPI TAL
MANAGEMENT SYSTEM</ f ont ></ t d></ t r >
<t r ><t d><t abl e al i gn=cent er wi dt h=750 cel l spaci ng=0 cel l paddi ng=5>
<t r ><t d al i gn=cent er ><a hr ef =dl i st . php>Doct or s</ t d><t d al i gn=cent er ><a
hr ef =pl i st . php>Pat i ent s</ t d><t d al i gn=cent er ><a
hr ef =app. php>Appoi nt ment s</ t d>
</ t abl e></ t d></ t r >
<t r bgcol or =r ed><t d ><f ont si ze=4 col or =whi t e>Recover
Doct or </ f ont ></ t d></ t r >
<?php
$r no=$_GET[ " r no" ] ;
i f ( ! mysql _connect ( "l ocal host ", "r oot " , " " ) )
{
echo " <t r ><t d><f ont col or =r ed si ze=4>Connect i on
Er r or </ f ont ></ t d></ t r >";
di e( ) ;
}
mysql _sel ect _db( "hospi t al " ) ;
mysql _quer y( "updat e doct set dshow=' Y' wher e dno=' $r no' ") ;
echo " <t r ><t d al i gn=cent er ><f ont si ze=4 col or =gr een>Successf ul l y
HOSPITAL MANAGEMENT SYSTEM, MAMCET, 2008IT
50

Recor ds Recover ed</ f ont ></ t d></ t r >";
echo " <t r ><t d al i gn=cent er ><a
hr ef =dl i st . php>Cont i nue. . . </ a></ t d></ t r >" ;
echo " </ t abl e>";
echo " </ body></ ht ml >";

You might also like