Skip to content

Commit 8ce8a48

Browse files
committed
first commit
0 parents  commit 8ce8a48

17 files changed

+450
-0
lines changed

addpatient.php

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<?php
2+
session_start()
3+
?>
4+
5+
<?php
6+
$id=$_POST['id'];
7+
$name=$_POST['name'];
8+
$age=$_POST['age'];
9+
$gender=$_POST['gender'];
10+
$occupation=$_POST['occupation'];
11+
$mobile=$_POST['mobile'];
12+
$address=$_POST['address'];
13+
$con=@mysql_connect("localhost","root","ikenna") or die(mysql_error());
14+
$db=@mysql_select_db("hms",$con)or die(mysql_error());
15+
$str="insert into patients values('$id','$name','$age','$gender','$occupation','$mobile','$address')";
16+
$res=@mysql_query($str)or die(mysql_error());
17+
if($res>=0)
18+
{
19+
echo'<br><br><b>Patient added !!<br>';
20+
}
21+
22+
?>
23+
<html>
24+
<body style="background-image:url(background4.jpg)">
25+
<br>
26+
<a href="home.html"><b>Click here to return to the home page</b></a>
27+
</body></html>

background4.jpg

50 KB
Loading

donorPage.html

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
<body style="background-image: url(images/background4.jpg);">
2+
<br>
3+
<br>
4+
<form method="post" action="addpatient.php" ><big><big>Patient
5+
Info :<br>
6+
<br>
7+
</big></big>
8+
<table width:="50%">
9+
<tbody>
10+
<tr>
11+
<td>Patient ID : <br>
12+
</td>
13+
<td><input name="id" type="text"><br>
14+
</td>
15+
</tr>
16+
<tr>
17+
<td>Full Name : <br>
18+
</td>
19+
<td><input name="name" type="text"><br>
20+
</td>
21+
</tr>
22+
<tr>
23+
<td>Age : <br>
24+
</td>
25+
<td><input name="age" type="text"><br>
26+
</td>
27+
</tr>
28+
<tr>
29+
<td>Gender : <br>
30+
</td>
31+
<td><input name="gender" type="text"><br>
32+
</td>
33+
</tr>
34+
<tr>
35+
<td>Occupation : <br>
36+
</td>
37+
<td><input name="occupation" type="text"><br>
38+
</td>
39+
</tr>
40+
<tr>
41+
<td>Contact Number<br>
42+
</td>
43+
<td><input name="mobile" type="text"><br>
44+
</td>
45+
</tr>
46+
<tr>
47+
<td>Organ Needed/Looking for : <br>
48+
</td>
49+
<td><input name="occupation" type="text"><br>
50+
</td>
51+
</tr>
52+
<tr>
53+
<td>Address<br>
54+
</td>
55+
<td><textarea cols="30" rows="3" name="address"></textarea> </td>
56+
</tr>
57+
</tbody>
58+
</table>
59+
<br>
60+
<br>
61+
<input name="submit" value="ADD" type="submit">&nbsp; &nbsp; <input name="reset" value="RESET" type="reset"> <big><big><br>
62+
</big></big></form>

generateprescription.php

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
<?php
2+
session_start();
3+
?>
4+
5+
6+
<?php
7+
if(!$_SESSION[user]=$username){
8+
header("location:index.html");
9+
exit;
10+
}
11+
$dbhost = 'localhost';
12+
$dbuser = 'root';
13+
$dbpass = 'ikenna';
14+
$conn = mysql_connect($dbhost, $dbuser, $dbpass);
15+
$id=$_POST['id'];
16+
$medicine=$_POST['medicine'];
17+
$diagnosis=$_POST['diagnosis'];
18+
$instructions=$_POST['instructions'];
19+
$doc_name=$_POST['doc_name'];
20+
21+
mysql_select_db('hms');
22+
$str="insert into prescription values('$id','$medicine','$diagnosis','$instructions','$doc_name')";
23+
$res=@mysql_query($str)or die(mysql_error());
24+
if(! $conn )
25+
{
26+
die('Could not connect: ' . mysql_error());
27+
}
28+
$id = $_POST['id'];
29+
$sql="SELECT * FROM patients WHERE id='$id'";
30+
31+
32+
$retval = mysql_query( $sql, $conn );
33+
if(! $retval )
34+
{
35+
die('Could not get data: ' . mysql_error());
36+
}
37+
while($row = mysql_fetch_array($retval, MYSQL_ASSOC))
38+
{
39+
echo "<big><b>PRESCRIPTION : </b></big><br><br><br>";
40+
echo "DOCTOR NAME : $doc_name<br>";
41+
echo "<b>Patient Details : </b><br>";
42+
echo "PATIENT ID : {$row['id']} <br><br> ".
43+
"NAME : {$row['name']} <br><br> ".
44+
"AGE : {$row['age']} <br><br> ".
45+
"GENDER : {$row['gender']} <br><br> ".
46+
"MOBILE : {$row['mobile']} <br><br> ".
47+
48+
"--------------------------------<br>";
49+
}
50+
echo "MEDICINE : $medicine <br><br>".
51+
"DIAGNOSIS : $diagnosis <br><br>".
52+
"ADDITIONAL INSTRUCTIONS : $instructions <br><br>".
53+
"--------------------------------<br>";
54+
mysql_close($conn);
55+
?>
56+
<html>
57+
<input type="button" onClick="window.print();" value="Print Prescription"/><br><br>
58+
<a href="home.html"><b>HOME</b></a>
59+
</html>

home.html

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<html>
2+
3+
<body style="background-image:url(background4.jpg)">
4+
<center>
5+
<br><br><br>
6+
<br>
7+
<br>
8+
<big><big>ORGAN SUPPLY CHAIN <br><a href="logout.php">logout</a>
9+
<br>
10+
WELCOME !!</big></big><br>
11+
<br>
12+
<br>
13+
<form method="post" action="donorPage.html" name="addnewpatient">
14+
<input name="addnewpatient" value="ADD NEW DONOR" type="submit">
15+
</form>
16+
<br>
17+
<br>
18+
<form method="post" action="reciever.html" name="prescription">
19+
<input name="prescription" value="ADD RECIEVER" type="submit">
20+
</form>
21+
<br>
22+
<br>
23+
<form method="get" action="viewpatients.php" name="viewpatients">
24+
<input name="viewpatients" value="VIEW DONORS DATABASE" type="submit">
25+
</form>
26+
27+
</center>
28+
</body>
29+
30+
</html>

images.jpeg

3.54 KB
Loading

images_2.jpeg

2.9 KB
Loading

index.html

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
<html>
2+
3+
<head>
4+
<meta id="_moz_html_fragment">
5+
</head>
6+
7+
<body style="background-image:url(background4.jpg)">
8+
<div style="text-align: center;"><br>
9+
<br>
10+
<br>
11+
<br>
12+
<big><big>ORGAN&nbsp; SUPPLY CHAIN <br>
13+
<br>
14+
<br>
15+
</big></big>
16+
<form method="post" action="login.php">
17+
<center>
18+
<table width="30%">
19+
<tbody>
20+
<tr>
21+
<td style="text-align: left;">USERNAME<br>
22+
</td>
23+
<td><input name="username" type="text"><br>
24+
</td>
25+
</tr>
26+
<tr>
27+
<td style="text-align: left;">PASSWORD<br>
28+
</td>
29+
<td><input name="password" type="password"><br>
30+
</td>
31+
</tr>
32+
</tbody>
33+
</table>
34+
<br>
35+
<br>
36+
<input value="LOGIN" name="submit" type="submit"><br>
37+
</form>
38+
<br>
39+
<form method="post" action="register.html">
40+
<input value="New User ?" name="newuser" type="submit"><br>
41+
</center>
42+
</form>
43+
<big><big><br>
44+
</big></big>
45+
</div>
46+
</body>
47+
48+
</html>

login.php

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<?php
2+
3+
session_start();
4+
?>
5+
6+
7+
8+
<?php
9+
$username=$_POST['username'];
10+
$password=$_POST['password'];
11+
$con=@mysql_connect("localhost","root","ikenna") or die(mysql_error());
12+
$db=@mysql_select_db("hms",$con)or die(mysql_error());
13+
14+
$sql="SELECT * FROM users WHERE username='$username' and password='$password'";
15+
16+
$result=mysql_query($sql);
17+
18+
$count=mysql_num_rows($result);
19+
20+
if($count<1){echo "Wrong Username or Password";}
21+
else
22+
{
23+
$_SESSION[user]=$username;
24+
header("location:home.html");
25+
}
26+
27+
ob_end_flush();
28+
?>

login_success.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<?php
2+
session_start();
3+
if(!session_is_registered(myusername)){
4+
header("location:home.html");
5+
}
6+
?>
7+
8+
<html>
9+
<body>
10+
Login Successful
11+
</body>
12+
</html>

0 commit comments

Comments
 (0)