0% found this document useful (0 votes)
5 views22 pages

PHP

Uploaded by

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

PHP

Uploaded by

dahaleatharva3
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 22

ABSTRACT

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 collection of patient’s information,
diagnosis details, etc. Traditionally, it was done manually. The main function of the system is
register and store patient details and doctor details and retrieve these details as and when
required, and also to manipulate these details meaningfully System input contains patient
details, diagnosis details, while system output is to get these details on to the screen. 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 data are well protected for personal use and makes the data
processing very fast

1
INTRODUCTION

What is PHP?
PHP started out as a small open source project that evolved as more and more people found
out how useful it was. Rasmus Lerdorf unleashed the first version of PHP way back in 1994.
 PHP is a recursive acronym for "PHP: Hypertext Preprocessor".
 PHP is a server-side scripting language that is embedded in HTML. It is used to manage
dynamic content, databases, session tracking, even build entire e-commerce sites.
 It is integrated with a number of popular databases, including MySQL, PostgreSQL,
Oracle, Sybase, Informix, and Microsoft SQL Server.
 PHP is pleasingly zippy in its execution, especially when compiled as an Apache
module on the Unix side. The MySQL server, once started, executes even very complex
queries with huge result sets in record-setting time.
 PHP supports a large number of major protocols such as POP3, IMAP, and LDAP.
PHP4 added support for Java and distributed object architectures (COM and CORBA),
making n-tier development a possibility for the first time.
 PHP is a widely-used, free, and efficient alternative to competitors such as Microsoft's
ASP.
 PHP 7 is the latest stable release.
What is a PHP File?
 PHP files can contain text, HTML, CSS, JavaScript, and PHP code.
 PHP code is executed on the server, and the result is returned to the browser as plain
HTML.
 PHP files have extension ".php".

What Can PHP Do?


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

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

Why PHP?
 PHP runs on various platforms (Windows, Linux, Unix, Mac OS X, etc.).
 PHP is compatible with almost all servers used today (Apache, IIS, etc.).
 PHP supports a wide range of databases.

2
 PHP is free. Download it from the official PHP resource: www.php.net.
 PHP is easy to learn and runs efficiently on the server side

PHP Installation

 Find a web host with PHP and MySQL support Localhosts.


 XAMPP, WAMP, LAMP, MAMP.
 Install a web server on your own PC, and then install PHP and MySQL.

Use a Web Host with PHP Support

 If your server has activated support for PHP you do not need to do anything.

 Just create some. php files, place them in your web directory, and the server will
automatically parse them for you.

 You do not need to compile anything or install any extra tools.

 Because PHP is free, most web hosts offer PHP support.

Characteristics of PHP
Five important characteristics make PHP's practical nature possible −

 Simplicity
 Efficiency
 Security
 Flexibility
 Familiarity
Some basic PHP statements include:
 Echo: Output one or more strings.
SYNTAX: echo(String);
 Print: Also output one or more strings.
SYNTAX: Print (string/ array -value);
 The assignment statement: Assigns a value to a variable.
 include: Include and evaluate the specified file.
 require: Same as include except it produces a fatal error on failure instead of a warning.

PHP syntax

 All the php code in a php script should be enclosed within <?php and ?>, it will not be
considered as php code. Adding php code inside the php is known as Escaping to php.
 <?php… .......................................?>
 Apart from the standard <?php and ?>, you can also the short open tags:
 <? ………………………………….. ?>

3
 Use the html script tags,like we do for adding javascript code in html document:
o <script language=”PHP”> ...................................................... </script>

Variables

 A variable is declared using a $ sign, followed by the variable name.


 Syntax:

<?php

$variable_name=value;

?>

 Example:

1.$a=10;

2. $b=”abc”;

 The $var(single dollar) is normal variable with the name var that stores any value like
string, integer, float, etc.
 The $$var(Double dollar) is a reference variable that stores the value of the $variable
inside it.

Case sensitivity

 In php, keyword (e.g. echo, if , else, while)functions, user-defined function, classes are
not case-sensitive.
 All variable names are case-sensitive.

Create MySQL Database at the Localhost

To connect to a MySQL Database:

1. Create Database

2. Create a Folder in htdocs

3. Create Database Connection File In PHP

4. Create new php file to check your database connection

5. Run the server

4
SOURCE CODE:

HOME.HTML

<!DOCTYPE html> <tr>

<html> <td><form action="nurse.php"


align="center">
<body>
<input type="submit" align="center"
<table width="1350" height="640" value="nurse">
border="1" >
</form></td>
<tr>
</tr>
<td colspan="2" style="background-
color:#FFF5EE;"> <tr>

<h1>HOSPITAL MANAGEMENT <td><form action="patient.php"


SYSTEM</h1> align="center">

<h3 align="center">ADMIN <input type="submit" align="center"


PANEL</h3> value=" patient ">

</td> </form></td>

</tr> </tr>

<tr> <tr>

<td style="background- <td><form action="pharmacist.php"


color:#00FFFF;width:50px;height:4 align="center">
00px;">
<input type="submit" align="center"
<table align="center"> value=" pharamacist ">

<tr><td><form action="doctor.php" </form></td></tr>


align="center">
<tr>
<input type="submit" align="center"
value=" doctor"> <td><form action="laboratorist.php"
align="center">
</form></td>
<input type="submit" align="center"
</tr> value=" laboratorist ">

5
</form></td><tr> </td>

<td><form action="accountant.php" </tr>


align="center">
<tr>
<input type="submit" align="center"
value=" accountant <td colspan="2" style="background-
"></form></td></tr></table></td> color:#9ACD32;text-align:center;">

<td style="background- <table align="right">

<th>

color:#eeeeee;height:200px;width:4 <tr>
00px;height:400px;"><h3align="cen
<form action="appointment.php"
ter">Advanced,
align="center">

<input type="submit" align="center"


powerfull, flexible complete value=" appointment ">
management software for hospital,
</form>
clinicand medical institutes.
</tr>

<tr>
Integrates and facilitates all user area
of a hospital: <form action="payment.php"
align="center">
</h3><h4>align="center">Administ
rator</h4> <input type="submit" align="center"
value=" payment ">
<h4 align="center">Doctor</h4>
</form>
<h4 align="center">Patient</h4>
</tr>
<h4 align="center">Nurse</h4>
<tr>
<h4
align="center">Pharmacist</h4> <form action="bloodbank.php"
align="center">
<h4
align="center">Laboratorist</h4> <input type="submit" align="center"
value=" bloodbank ">
<h4
align="center">Accountant</h4>

6
</form> <input type="submit" align="center"
value=" birthreport ">
</tr>
</form>
<tr>
</tr>
<form action="medicine.php"
align="center"> <tr><form action="deathreport.php"
align="center">
<input type="submit" align="center"
value=" medicine "> <input type="submit" align="center"
value=" deathreport ">
</form>
</form>
</tr>
</tr>
<tr>
<tr><form
<form action="operations.php" action="bedallotment.php"
align="center"> align="center">

<input type="submit" align="center" <input type="submit" align="center"


value=" operations "> value="bed allotment">

</form> </form></tr></th></table></td></tr
></table>
</tr>
</body>
<tr><form action="birthreport.php"
align="center"> </html>

7
DOCTOR.PHP

<!DOCTYPE html> </tr>

<html> <tr>

<body> <td><form action="patient.php"


align="center">
<table width="1350" height="640"
border="1" > <input type="submit" align="center"
value=" patient ">
<tr>
</form></td>
<td colspan="2" style="background-
color:#FFF5EE;"> </tr>

<h1>HOSPITAL MANAGEMENT <tr>


SYSTEM</h1>
<td><form action="pharmacist.php"
align="center">

<h3 align="center">ADMIN <input type="submit" align="center"


PANEL</h3> value=" pharamacist">

</td> </form></td>

</tr> </tr>

<tr> <tr>

<td style="background- <td><form action="laboratorist.php"


color:#00FFFF;width:50px;height:4 align="center">
00px;">
<input type="submit" align="center"
<table align="center"> value=" laboratorist ">

<tr> </form></td>

<td><form action="nurse.php" <tr>


align="center">
<td><form action="accountant.php"
<input type="submit" align="center" align="center">
value=" nurse ">
<input type="submit" align="center"
</form></td> value=" accountant">

8
</form></td>
><th>speciality</th><th>age</th></
</tr> tr>";

</table> while($row =
mysql_fetch_array($result))
</td>
{
<td style="background-
color:#eeeeee;height:200px;width:4 echo "<tr>";
00px;height:400px;">
echo "<td>" .
<?php $row['qualification'] . "</td>";

$host='localhost'; echo "<td>" . $row['speciality']


$username='root'; . "</td>";

$password=''; echo "<td>" . $row['age'] .


"</td>";
$dbname='hospital';
echo "</tr>";

$con=mysql_connect($host,$userna }
me,$password);
echo
mysql_select_db($dbname); "</table>";mysql_close($con);

$result = ?>
mysql_query("SELECT * FROM
doctor"); <br><br>

echo "<h4 align='center'> <table align="right">


doctors list </h4>";
<th>
echo"<tableborder=1
<tr>

align=center><tr><th>s.no</th><th <form action="adddoctor.php"


>name</th><th>d_id</th><th>quali align="center">
fication</th
<input type="submit"
align="center" value=" add new
doctor ">

</form></tr><tr>

9
<form <input type="submit"
action="deletedoctor.php" align="center" value=" appointment
align="center"> ">

<input type="submit" </form></tr><tr>


align="center" value=" delete doctor
"> <form action="payment.php"
align="center">
</form>
<input type="submit"
</tr><tr> align="center" value=" payment ">

<form </form></tr><tr>
action="viewcompletedoctor.php"
align="center"> <form action="bloodbank.php"
align="center">
<input type="submit"
align="center" value=" <input type="submit"
viewcomplete "> align="center" value=" bloodbank ">

</form></tr><tr> </form></tr><tr>

<form action="admin.html" <form action="medicine.php"


align="center"> align="center">

<input type="submit" <input type="submit"


align="center" value=" home"> align="center" value=" medicine ">

</form></tr><tr>
</form></tr></table></td></tr>
<form action="operations.php"
<tr><td colspan="2" align="center">
style="background-
<input type="submit"
color:#9ACD32;text-align:center;">
align="center" value=" operations ">
<table align="right">
</form></tr><tr>
<th>
<form action="birthreport.php"
<tr><form align="center">
action="appointment.php"
<input type="submit"
align="center">
align="center" value=" birthreport ">

</form></tr><tr>

10
<form action="deathreport.php" <input type="submit"
align="center"> align="center" value=" bedallotment
">
<input type="submit"
align="center" value=" deathreport </form></tr></th>
">
</table></td></tr></table>
</form></tr><tr>
</body>
<form
action="bedallotment.php" </html>
align="center">

11
APPOINTMENT.PHP
<!DOCTYPE html> <tr> <td> <form
action="docoperation.php"
<html> align="center">

<body> <input type="submit" align="center"


value=" Operation ">
<table width="1350" height="640"
border="1" ><tr> </form> </td></tr>

<td colspan="2" style="background- <tr> <td><form


color:#FFF5EE;"> action="docmedicines.php.php"
align="center">
<h1>HOSPITAL MANAGEMENT
SYSTEM</h1> <input type="submit" align="center"
value=" Add Medicines ">
<h3 align="center">DOCTOR
PANEL</h3> </form></td></tr>

</td> <tr> <td> <form action="doctests.php"


align="center">
</tr>
<input type="submit" align="center"
<tr> value=" Add Tests ">

<td style="background- </form></td>


color:#00FFFF;width:50px;height:400px;"
> </table>

<table align="center"> </td>

<tr> <td><form <td style="background-


action="docappointment.php" color:#eeeeee;height:200px;width:400px;h
align="center"> eight:400px;">

<input type="submit" align="center"


value=" Appointment ">
<h2 align="center"> Appointments </h2>
</form> </td></tr>
<?php
<tr> <td><form
action="docperscription.php" $host='localhost';$username='root';
align="center"> $password='';

<input type="submit" align="center" $dbname='hospital';


value=" perscription ">

</form> </td> </tr> $con=mysql_connect($host,$username,$p


assword);

12
mysql_select_db($dbname); </form>

$result = mysql_query("SELECT * <?php echo "<td>";


FROM appointment WHERE d_id='$a'");
echo "</tr>";
echo "<table border=1 align=center> <tr>
<th>s.no</th> <th>pid</th> }
<th>name</th><th>problem</th>
echo "</table>";

mysql_close($con);
<th>date</th> <th>time</th>
<th>status</th> <th> update</th> </tr>"; ?>

<br><br>

while($row = mysql_fetch_array($result)) <table align="center">

{ <tr>

echo "<tr>"; <td><form action="allappointment.php"


align="center">
echo "<td>" . $row['s_no'] . "</td>";
<input type="submit" align="center"
echo "<td>" . $row['p_id'] . "</td>"; value=" all Appointment ">

echo "<td>" . $row['name'] . "</td>"; </form> </td>

echo "<td>" . $row['problem'] . "</td>"; <td><form


action="pendingappointment.php"
echo "<td>" . $row['date_of_app'] . align="center">
"</td>";
<input type="submit" align="center"
echo "<td>" . $row['time_of_app'] . value=" pending Appointment ">
"</td>";
</form> </td>
echo "<td>" . $row['status'] . "</td>";
<td> <form
echo "<td>" ;?> <form action="upcomingappointment.php"
action="updateappointment.php"align="ce align="center">
nter"method="POST">
<input type="submit" align="center"
<input type="hidden" name="sno" value=" upcoming appointment ">
value=" <?php echo $row['s_no']; ?> ">
</form> </td>
<input type="hidden" name="pid"
value=' <?php echo $row['p_id']; ?> '> <td><form
action="completedappointment.php"
<input type="submit" align="center">
align="center" value=" update ">

13
<input type="submit" align="center" <table align="center"> <tr> <td> Doctor
value=" completedAppointment"> name </td> <td> </td>

</form></td></table></td></tr> <td> Doctor id </td> <td></td> </tr>


</table></td></tr></table>
<tr><td colspan="2" style="background-
color:#9ACD32;text-align:center;"> </body>

</html>

OUTPUT:

ADMIN PANEL:

ADDING NEW EMPLOYEE DETAILS:

14
DOCTOR MODULE:

OPERATION DETAILS:

15
CREATE OPERATION DETAILS:

ADD EMPLOYEE DETAILS:

16
BED ALLOTMENT:

PATIENT REGISTRATION FORM:

17
BLOOD STATUS:

APPOINTMENT:

18
PAYMENT DETAILS:

BIRTH REPORT:

19
DEATH REPORT:

20
CONCLUSION

The Hospital Management System is a great improvement over the manual system using case
fields and paper. The computerization f the system has speed 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.

Since the Hospital Management System is essential for maintaining detail about the Doctor,
Patient, Hospital staff etc. It is understood that on the introduction of the hospital Management
Project into play, the work at the hospitals would be seamless and efficient. Transferring the
patient data would take only seconds compare to the traditional way of sending the file
manually. Usually boring and mundane accounts work will also be automated and simplified.

21
REFERENCE

 https://www.academia.edu/8323992/02_HOSPITAL_MANAGEMENT_SYSTEM_U
SING_PHP
 https://www.nptelvideos.com
 https://www.tutorialspoint.com

22

You might also like