You are on page 1of 48

SCHOOL OF SCIENCE AND ENGINEERING

INDIVIDUAL ASSIGNMENT
Clinic management system

Programme: Bachelor of Computer Science


Subject: Server Side Programming
Subject Code: ECB 4233

Name: Dinesh Arriel

ID: 1106154003

Lecturer: Ms Aparna Vyakaranam

Submission Date: 21/05/2018


Abstract

My project Patient Management system includes registration of patients and storing their
details into the system. The system allows for registration for new patients, viewing of patient records
and also editing patient records. User can log in using user name and password to enter the system. 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.

Aim & Objective

With this project is aimed to develop to maintain the day-to-day state of admission of patients
for the clininc. It is designed to achive the following objectives:

i. To computerize all details regarding patient details.


ii. To access details of patients with ease.
iii. To provide a user friendly system.
iv. The information of the patients should be kept up to date.
Software Development Lifecycle

The waterfall model is used to represent the SDLC of this project. Stages will be completed before
it is moved to the next phase. The model is shown as follows:

Requirements Gathering:

i. Getting required knowledge

ii. Doing Research

Analysis & Design:

i. Sketch Design

ii. Listing the table

Coding:

Building the system

Testing:

i.System testing

ii.Performance testing

Acceptance:

Deliver to the customer


Project Details

The entire project is done by using SQL, HTML, CSS and PHP. First, rough planning was drawn out in
rough paper before the project commenced. Then Database is first formed before the production of the
actual web page.

1. Database:

Figure 1.1 (Database)

Figure 1.2(Table for last entry)

Figure 1.4 (table for Admin username


Figure 1.3 (table for display id) & password)
Figure 1.5 (table for patient)
2.CSS & Style

Code:

<style type="text/css">

body

background-color:ffffff;background-image:url(images/background/hr.jpg);background-repeat:repeat;background-
position:center center;background-attachment:fixed;

</style>

<title>

Admin

</title>

<SCRIPT LANGUAGE="JavaScript">

///////////////////////////////////

function clickIE() {if (document.all) {alert(message);return false;}}

function clickNS(e) {if

(document.layers||(document.getElementById&&!document.all)) {

if (e.which==2||e.which==3) {alert(message);return false;}}}

if (document.layers)

{document.captureEvents(Event.MOUSEDOWN);document.onmousedown=clickNS;}

else{document.onmouseup=clickNS;document.oncontextmenu=clickIE;}

document.oncontextmenu=new Function("return false")

// -->

</script>
3. SQL

i. Connection:

<?

$conn=mysqli_connect("localhost","root","","u761479816_bdata");?>

ii. Log in page

default.php

<?php

include("bg.php");

include("config.php");

session_start();

ob_start();

?>
<center><img draggable='false' width='100' height='100' src=images/background/logo.png>

<center>

<h2>CLINIC NILAI<h2>

<?//<h2><font color='black'>(patient listing)</font><h2>?>

<h3>Clinic Management System</h3>

<table border="20" height="100" cellpadding="10" bordercolor='#21DBD9' bgcolor='#E5F4F4'>

<form action="default.php" method="POST" autocomplete="off">

<TR>

<TD><b>User-Id</b></TD>

<TD>

<input type="email" name="uid" autofocus placeholder="xxxx@yahoo.com"


style="width:180px;height:20px" required>

</TD>

</TR>

<TR>

<TD><b>Password</b></TD>

<TD>

<input type="password" name="pwd" style="width:180px;height:20px" required>

</TD>

</TR>

<TR>

<TD><b></b></TD>

<TD>

&nbsp;&nbsp;&nbsp;&nbsp;

<input type="submit" value="Log-In" name="loger" style="height:30px;width:80px">

</form>

</table>

<?php
if(isset($_POST['loger']))

$uid = mysqli_real_escape_string($conn,$_POST['uid']);

$pwd = mysqli_real_escape_string($conn,$_POST['pwd']);

$result = mysqli_query($conn,"SELECT * FROM user WHERE eid='$uid' AND pwd='$pwd'");

if($row = mysqli_fetch_array($result))

$_SESSION['stduid2']=$row['eid'];//stores userid session

$_SESSION['stdpwd2']=$row['pwd'];//stores password session

header('location:dashboard.php');

else

echo '<script type="text/javascript">alert("Invalid Username or Password!");</script>';

}?></center>
iii. Mainpage

<?php

session_start();

if((!isset($_SESSION['stduid2']))&&(!isset($_SESSION['stdpwd2'])))

header('Location: default.php') ;

include_once("bg.php");

ob_start();

?>

<html>

<head>

<h1><center> WELCOME DOCTOR </center></h1>

<br>
<center><h3> <b> Logged in as: </b><br><? echo $_SESSION['stduid2']; ?>

</h3></center>

</head>

<title></title>

<body><center>

<table border="20" height="100" width="100" cellspacing="10" cellpadding="10"


bordercolor='#21DBD9' bgcolor='#E5F4F4'>

<TR>

<TD>

<center><input type="button" style="height:50px;width:200px" value="Enroll New Patient"


onclick="window.location ='enroll.php'">

</TD>

<TD>

<center><input type="button" style="height:50px;width:200px" value="Edit Patient Details"


onclick="window.location ='edit_adm_prof.php'">

</TD>

</TR>

<TR>

<TD>

<center><input type="button" style="height:50px;width:200px" value="View Patient Details"


onclick="window.location ='view_adm_prof.php'">

</TD>

<TD>

<center><input type="button" style="height:50px;width:200px" value="Delete Patient Details"


onclick="window.location ='deladmin.php'">

</TD></TR></table><br>

<center><? echo '<input type="button" style="width:150px;height:30px" value="Click here to


Logout" onclick="window.location =\'logout.php\'" />'; ?> </center>

</center></body><?phpob_end_flush();?><?phpunset($_SESSION['maspwd2']);?>
iv. Enroll new patient

<?php

include("bg.php");

include("config.php");

ob_start();

session_start();

if((!isset($_SESSION['stduid2']))&&(!isset($_SESSION['stdpwd2'])))

header('Location: default.php') ;

?>

<html>

<head></head>

<title></title>
<body>

<?php

$sql="SELECT * FROM last_entry WHERE id='1'";

$result=mysqli_query($conn,$sql);

if($row=mysqli_fetch_array($result))

echo '<b>Last Entry for Admission ';

echo "</br>";

echo "&nbsp";

echo $row['adm_no'];

else

echo "Last Entry not Found";

?>

<br><br><br><br>

<center>

<input type="button" style="height:40px;width:200px" value="Go to Home"


onclick="window.location ='dashboard.php'">

<br><br>

<table border="20" height="100" cellspacing="10" cellpadding="10" bordercolor='#21DBD9'


bgcolor='#E5F4F4'>

<form method="POST" action="enrollpro.php">

<TR>

<TD>

<b>ADMISSION NO.</b>
</TD>

<TD>

<input type="text" name="admno" style="width:150px;height:20px" required autofocus>

</TD>

</TR>

<TR>

<TD>

<b>PATIENT NAME</b>

</TD>

<TD>

<input type="text" name="name" style="width:150px;height:20px" required>

</TD>

</TR>

<TR>

<TD></TD>

<TD>

&nbsp;

<input type="submit" name="enroll" value="Register" style="height:30px; width:90px">

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

<input type="reset" value="Clear" style="height:30px;width:90px">

</form>

</table>

</center>

</body>
v. Successful enrol

<?php

include("config.php");

include("bg.php");

ob_start();

session_start();

if((!isset($_SESSION['stduid2']))&&(!isset($_SESSION['stdpwd2'])))

header('Location: default.php') ;

if(isset($_POST['enroll']))

$admno=mysqli_real_escape_string($conn,$_POST['admno']);
$name=mysqli_real_escape_string($conn,$_POST['name']);

$sql1="INSERT INTO stud_id(adm_no) VALUES('$admno')";

$result1 = mysqli_query($conn,$sql1);

if($result1)

//Admission entry

$sql2="INSERT INTO stud_adm(adm_no,name)

VALUES('$admno','$name')";

$result2 = mysqli_query($conn,$sql2);

//Last Entry

$sql5="UPDATE last_entry SET adm_no='$admno',name='$name' WHERE id='1'";

$result5 = mysqli_query($conn,$sql5);

//extra1 entry

$sql6="INSERT INTO extra1(adm_no,name)

VALUES('$admno','$name')";

$result6 = mysqli_query($conn,$sql6);

//extra2 entry

$sql7="INSERT INTO extra2(adm_no,name)

VALUES('$admno','$name')";

$result7 = mysqli_query($conn,$sql7);

//extra3 entry

$sql8="INSERT INTO extra3(adm_no,name)


VALUES('$admno','$name')";

$result8 = mysqli_query($conn,$sql8);

echo "</br></br></br></br></br></br></br></br>";

echo "<center><h3>"."Enrolled Successfully"."</h3></center>";

echo '<center><input type="button" style="height:30px" value="Go Home" onclick="window.location


=\'dashboard.php\'" />';

else

echo "</br></br></br></br></br></br></br></br>";

echo "<center><h3>"."Admission Number already Exists/ Invalid details"."</h3></center>";

echo '<p><center><input type="button" style="height:70px/;width:150px" value="Retry"


onclick="window.location =\'enroll.php\'" /></p>';

echo '<p><center><input type="button" style="height:70px/;width:150px" value="Goto Home"


onclick="window.location =\'dashboard.php\'" /></p>';

else

echo "</br></br></br></br></br></br></br></br>";

echo "<center><h3>"."Unauthorized Entry"."</h3></center>";

echo '<p><center><input type="button" style="height:30px/;width:200px" value="Goto Main Page"


onclick="window.location =\'dashboard.php\'" /></p>';

ob_end_flush();

?>
vi. Search Patient to edit

<?php

include("bg.php");

include("config.php");

ob_start();

session_start();

if((!isset($_SESSION['stduid2']))&&(!isset($_SESSION['stdpwd2'])))

header('Location: default.php') ;

?>

<html>
<head></head>

<title></title>

<body>

<center>

<input type="button" style="height:40px;width:200px" value="Go to Home"


onclick="window.location ='dashboard.php'">

<h3>Edit by Admission number</h3>

<table border="10" height="100" cellspacing="10" cellpadding="10" bordercolor='#21DBD9'


bgcolor='#E5F4F4'>

<form method="GET" action="edit_adm_prof_pro.php">

<TR>

<TD>

<b>ADMISSION NO.</b>

</TD>

<TD>

<input type="text" name="admno" style="width:150px;height:20px" required autofocus>

</TD>

<TD>

<input type="submit" name="edit" value="Search" style="height:30px;width:90px">

</form>

</table>

<h3>Edit by Patient Name</h3>

<table border="10" height="100" cellspacing="10" cellpadding="10" bordercolor='#21DBD9'


bgcolor='#E5F4F4'>

<form method="GET" action="edit_adm_prof.php">

<TR>

<TD>

<b>PATIENT NAME:</b>
</TD>

<TD>

<input type="text" name="name" style="width:180px;height:20px" required>

</TD>

<TD>

<input type="submit" name="editbyname" value="Search" style="height:30px;width:90px">

</form>

</table>

<br>

<?php

if(isset($_GET['editbyname']))

$name=mysqli_real_escape_string($conn,$_GET['name']);

$sql = mysqli_query($conn,"SELECT * FROM stud_adm WHERE name LIKE '%$name%'");

echo mysqli_num_rows($sql);

echo "<b>"." result found";

echo "<center>";

echo "<table border='20' height='100' width='900' cellspacing='3' cellpadding='3'


bordercolor='#21DBD9'>

<tr>

<th>Photo</th>

<th>Admission No.</th>

<th>Name</th>

<th>More Details</th></tr>";

//And we display the results

while($row = mysqli_fetch_assoc($sql))

echo "<tr bgcolor='#E5C4F4'>";


$admno=$row['adm_no'];

echo "<td width='3%'>"."<center><img width='120' height='120'


src=images/student/".$row['img'].">";

echo "<td width='3%'>"."<center>".$row['adm_no']."</td>";

echo "<td width='3%'>"."<center>".$row['name']."</td>";

echo "<td width='3%'>";

echo "<center><a href='edit_adm_prof_pro.php?admno=$admno&edit=Search'>Edit details</a>";

echo "</td>";

echo "</tr>";

echo "</table></center>";

?>

</center>

</body>
vi. Edit Patient Details

<?php

include("bg.php");

include("config.php");

ob_start();

session_start();

if((!isset($_SESSION['stduid2']))&&(!isset($_SESSION['stdpwd2'])))

header('Location: default.php') ;

?>
<?

if(isset($_GET['edit']))

$admno=mysqli_real_escape_string($conn,$_GET['admno']);

$result =mysqli_query($conn,"SELECT * FROM stud_adm WHERE adm_no='$admno'");

$row = mysqli_fetch_array($result);

?>

<body>

<?php

echo "<center><img style='border:8px solid grey' width='120' height='120'


src=images/student/".$row['img'].">";

echo "</a>";

?>

<form action="ph_upload.php" method="POST" enctype="multipart/form-data">

Add/Change Photo<input type="file" name="image" required style="width:180px">

<input type="text" name="adm_no" value="<?php echo $row['adm_no'];?>" hidden>

<input type="submit" value="Click to Update" name="phupd" style="height:30px;width:100px">

</form>

<form action="edit_adm_prof_pro1.php" method="POST">

<input type="text" name="adm_no" value="<?php echo $row['adm_no'];?>" hidden>

<b>ADMISSION NO.</b>

<b><font color="red"><?php echo $row['adm_no'];?></font></b>

<table border="20" width="700" height="100" cellspacing="3" cellpadding="1"


bordercolor='#21DBD9' bgcolor='#E5F4F4'>

<TR bgcolor='#E5F4F4'>

<TD><b><font color="blue">1.NAME OF PATIENT</b></TD>

<TD><center><?php echo $row['name'];?></TD>


</TR>

<TR bgcolor='#E5F4F4'>

<center>

<TD>

<b><font color="blue">2.ADMSSION DATE</font></b>

</TD>

<TD><center>

<input type=date name="year" value="<?php echo $row['year'];?>"><?php echo $row['year'];?>

</TD>

</TR>

<TD>

<b><font color='blue'>3.CITIZENSHIP</b>

</TD>

<TD><center>

<select name="tc_issue" required>

<option value="<?php echo $row['tc_issue'];?>"><?php echo $row['tc_issue'];?></option>

<option>----------</option>

<option>LOCAL</option>

<option>FOREIGNER</option>

</select>

</TD>

</TR>

<TR>

<TD bgcolor='#E5F4F4'><b><font color='blue'>4.PHONE NUMBER</b></TD>

<TD><center><input type="text" name="twnvill" value="<?php echo $row['twnvill'];?>" required


maxlength="30"></TD>

</TR>
<TD><b><font color='blue'>5.DATE OF BIRTH</b></TD>

<TD><center><input type="date" name="dob" value="<?php echo $row['dob'];?>" required></TD>

</TR>

<TR bgcolor='#E5F4F4'>

<TD><b><font color='blue'>6.GENDER</b></TD>

<TD><center>

<select name="gen" required>

<option value="<?php echo $row['gen'];?>"><?php echo $row['gen'];?></option>

<option>----------</option>

<option>Male</option>

<option>Female</option>

<option></option>

</select>

</TD>

</TR>

<TR bgcolor='#E5F4F4'>

<TD><b><font color='blue'>7.RELIGION</b></TD>

<TD><center><input type="text" name="religion" value="<?php echo $row['religion'];?>" required


maxlength="15"></TD>

</TR>

<TR bgcolor='#E5F4F4'>

<TD><b><font color='blue'>8.RACE</b></TD>

<TD><center><input type="text" name="caste" value="<?php echo $row['caste'];?>" required


maxlength="40"></TD>

</TR>

<TR bgcolor='#E5F4F4'>

<TD><b><font color='blue'>9.MARTIAL STATUS</b></TD>

<TD><center>
<select name="comunit" required>

<option value="<?php echo $row['comunit'];?>"><?php echo $row['comunit'];?></option>

<option>----------</option>

<option>SINGLE</option>

<option>MARRIED</option>

<option>DIVORCED</option>

<option>WIDOWED</option>

<option>OTHER</option>

</select>

</TD>

</TR>

</table>

<br>

<table border="20" width="700" height="100" cellspacing="3" cellpadding="1"


bordercolor='#21DBD9' bgcolor='#E5F4F4'>

<center><b>10.PARENTS/GUARDIAN INFORMATION</center>

<TR bgcolor='#E5F4F4'>

<TD><i><font color='blue'>(a)Name of the father/Guardian</i></TD>

<TD><center><input type="text" name="fname" value="<?php echo $row['fname'];?>" required


maxlength="50"></TD>

</TR>

<TR bgcolor='#E5F4F4'>

<TD><i><font color='blue'>(b)Father/Guardian's Occupation</i></TD>

<TD><center><textarea name="f_ed_qua" rows="1" cols="26" required maxlength="100"><?php


echo $row['f_ed_qua'];?></textarea></TD>

</TR>

<TR bgcolor='#E5F4F4'>

<TD><i><font color='blue'>(c)Full Address with Pin Code</i></TD>


<TD><center><textarea name="f_add_pin" rows="4" cols="26" required></textarea></TD>

</TR>

<TR bgcolor='#E5F4F4'>

<TD><i><font color='blue'>(d)Contact No.</i></TD>

<TD><center><input type="text" name="ph_no" value="" required maxlength="18">

</TD>

</TR>

</TABLE>

<br>

<center><b>MEDICAL QUERIES</b></center>

<table border="20" height="100" cellspacing="3" cellpadding="1" bordercolor='#21DBD9'


bgcolor='#E5F4F4'>

<TR bgcolor='#E5F4F4'>

<TD><b><font color='blue'>11.BLOOD TYPE</b></TD>

<TD><center>

<select name="cls_adm" required>

<option value="<?php echo $row['cls_adm'];?>"><?php echo $row['cls_adm'];?></option>

<option>----------</option>

<option>A</option>

<option>B</option>

<option>O</option>

<option>AB</option>

</select>

<select name="cls_sec" required>

<option value="<?php echo $row['cls_sec'];?>"><?php echo $row['cls_sec'];?></option>

<option>----------</option>

<option>POSITIVE</option>

<option>NEGATIVE</option>
</select>

</TD>

<TD><b><font color='blue'>12.MEDICAL INSURANCE</b></TD>

<TD><center>

<select name="med_adm" required>

<option value="<?php echo $row['med_adm'];?>"><?php echo $row['med_adm'];?></option>

<option>----------</option>

<option>YES</option>

<option>NO</option>

</select>

</TD>

<TD><b><font color='blue'>13.ADDICTIONS</b></TD>

<TD><center><input type="text" name="grop_adm" value="<?php echo


$row['grop_adm'];?>"><?php echo $row['grop_adm'];?>

</TD>

</TR>

<TR bgcolor='#E5F4F4'>

<TD><b><font color='blue'>14.DATE OF SICKNESS</b></TD>

<TD><center><input type="date" name="dat_adm" value="<?php echo $row['dat_adm'];?>"


required></TD>

<TD><b><font color='blue'>15.NOTES</b></TD>

<TD><center><input type="text" name="emis_no" value="<?php echo $row['emis_no'];?>"></TD>

</TR>

</table>
<hr class="vertical"/>

<STYLE>

hr.vertical

width: 0px;

height: 5%;

</STYLE>

<table height="50" cellspacing="3" cellpadding="8" bordercolor='#21DBD9' bgcolor='#E5F4F4'>

<TR bgcolor='#E5F4F4'>

<TD><center><input type="submit" value="Conform & Update" name="upd"


style="height:30px;width:130px"></TD>

<TD><center><input type="button" value="Cancel" style="width:120px; height:30px"


onclick="window.location ='dashboard.php'"></TD>

</TR>

</table>

</form>

<?php

ob_end_flush();

?>
vii. Success enrol patient

<?php

include("bg.php");

include("config.php");

ob_start();

session_start();

if((!isset($_SESSION['stduid2']))&&(!isset($_SESSION['stdpwd2'])))

header('Location: default.php') ;

?>

<?php

if(isset($_POST['upd']))

$adm_no=mysqli_real_escape_string($conn,$_POST['adm_no']);

$tc_issue=mysqli_real_escape_string($conn,$_POST['tc_issue']);
$year=mysqli_real_escape_string($conn,$_POST['year']);

$twnvill=mysqli_real_escape_string($conn,$_POST['twnvill']);

$dob=mysqli_real_escape_string($conn,$_POST['dob']);

$gen=mysqli_real_escape_string($conn,$_POST['gen']);

$religion=mysqli_real_escape_string($conn,$_POST['religion']);

$caste=mysqli_real_escape_string($conn,$_POST['caste']);

$comunit=mysqli_real_escape_string($conn,$_POST['comunit']);

$fname=mysqli_real_escape_string($conn,$_POST['fname']);

$f_ed_qua=mysqli_real_escape_string($conn,$_POST['f_ed_qua']);

$f_add_pin=mysqli_real_escape_string($conn,$_POST['f_add_pin']);

$ph_no=mysqli_real_escape_string($conn,$_POST['ph_no']);

$cls_adm=mysqli_real_escape_string($conn,$_POST['cls_adm']);

$cls_sec=mysqli_real_escape_string($conn,$_POST['cls_sec']);

$grop_adm=mysqli_real_escape_string($conn,$_POST['grop_adm']);

$med_adm=mysqli_real_escape_string($conn,$_POST['med_adm']);

$dat_adm=mysqli_real_escape_string($conn,$_POST['dat_adm']);

$emis_no=mysqli_real_escape_string($conn,$_POST['emis_no']);

$sql="UPDATE stud_adm SET


tc_issue='$tc_issue',year='$year',twnvill='$twnvill',dob='$dob',gen='$gen',religion='$religion',caste='$
caste',comunit='$comunit',fname='$fname',f_ed_qua='$f_ed_qua',

f_add_pin_phno='$f_add_pin',cls_adm='$cls_adm',cls_sec='$cls_sec',grop_adm='$grop_adm',med_a
dm='$med_adm',dat_adm='$dat_adm',emis_no='$emis_no' WHERE adm_no='$adm_no'";

//echo $sql;

$result= mysqli_query($conn,$sql);

if($result)

{
echo "<br><br><br><br><br><center><h3>Updated Successfully" ;

else

echo "Failed to Update";

?>

<br><br>

<center>

<input type="button" style="height:40px;width:200px" value="Go to Home"


onclick="window.location ='dashboard.php'">
viii. Find patient to view

<?php

include("bg.php");

include("config.php");

ob_start();

session_start();

if((!isset($_SESSION['stduid2']))&&(!isset($_SESSION['stdpwd2'])))

header('Location: default.php') ;

?>

<html>

<head></head>

<title></title>
<body>

<center>

<input type="button" style="height:40px;width:200px" value="Go to Home"


onclick="window.location ='dashboard.php'">

<h3>Search by Admission number</h3>

<table border="10" height="100" cellspacing="10" cellpadding="10" bordercolor='#21DBD9'


bgcolor='#E5F4F4'>

<form method="GET" action="view_adm_prof1.php">

<TR>

<TD>

<b>ADMISSION NO.</b>

</TD>

<TD>

<input type="text" name="admno" style="width:150px;height:20px" required autofocus>

</TD>

<TD>

<input type="submit" name="view" value="Search" style="height:30px;width:90px">

</form>

</table>

<h3>Search by Patient Name</h3>

<table border="10" height="100" cellspacing="10" cellpadding="10" bordercolor='#21DBD9'


bgcolor='#E5F4F4'>

<form method="GET" action="view_adm_prof.php">

<TR>

<TD>

<b>PATIENT NAME:</b>

</TD>

<TD>
<input type="text" name="name" style="width:180px;height:20px" required>

</TD>

<TD>

<input type="submit" name="view" value="Search" style="height:30px;width:90px">

</form>

</table>

<br>

<?php

if(isset($_GET['view']))

$name=mysqli_real_escape_string($conn,$_GET['name']);

//$cls_adm=mysqli_real_escape_string($conn,$_GET['cls_adm']);

$sql1="SELECT * FROM stud_adm WHERE name LIKE '%$name%'";

//echo $sql1;

$sql = mysqli_query($conn,$sql1);

echo mysqli_num_rows($sql);

echo "<b>"." result found";

echo "<center>";

echo "<table border='20' height='100' width='900' cellspacing='3' cellpadding='3'


bordercolor='#21DBD9'>

<tr>

<th>Photo</th>

<th>Admission No.</th>

<th>Name</th>

<th>More Details</th></tr>";

//And we display the results


while($row = mysqli_fetch_assoc($sql))

echo "<tr bgcolor='#E5F4F4'>";

$admno=$row['adm_no'];

echo "<td width='3%'>"."<center><img width='120' height='120'


src=images/student/".$row['img'].">";

echo "<td width='3%'>"."<center>".$row['adm_no']."</td>";

echo "<td width='3%'>"."<center>".$row['name']."</td>";

//echo "<td width='3%'>"."<center>".$row['cls_adm']."&nbsp'".$row['cls_sec']."'</td>";

echo "<td width='3%'>";

echo "<center><a href='view_adm_prof1.php?admno=$admno&view=view'>View More</a>";

echo "</td>";

echo "</tr>";

echo "</table></center>";

?>

</center>

</body>
ix. View Patient Details

<?php

include("bg.php");

include("config.php");

ob_start();

session_start();

if((!isset($_SESSION['stduid2']))&&(!isset($_SESSION['stdpwd2'])))

header('Location: default.php') ;

?>

<?php

if(isset($_POST['upd']))

$adm_no=mysqli_real_escape_string($conn,$_POST['adm_no']);
$tc_issue=mysqli_real_escape_string($conn,$_POST['tc_issue']);

$year=mysqli_real_escape_string($conn,$_POST['year']);

$twnvill=mysqli_real_escape_string($conn,$_POST['twnvill']);

$dob=mysqli_real_escape_string($conn,$_POST['dob']);

$gen=mysqli_real_escape_string($conn,$_POST['gen']);

$religion=mysqli_real_escape_string($conn,$_POST['religion']);

$caste=mysqli_real_escape_string($conn,$_POST['caste']);

$comunit=mysqli_real_escape_string($conn,$_POST['comunit']);

$fname=mysqli_real_escape_string($conn,$_POST['fname']);

$f_ed_qua=mysqli_real_escape_string($conn,$_POST['f_ed_qua']);

$f_add_pin=mysqli_real_escape_string($conn,$_POST['f_add_pin']);

$ph_no=mysqli_real_escape_string($conn,$_POST['ph_no']);

$cls_adm=mysqli_real_escape_string($conn,$_POST['cls_adm']);

$cls_sec=mysqli_real_escape_string($conn,$_POST['cls_sec']);

$grop_adm=mysqli_real_escape_string($conn,$_POST['grop_adm']);

$med_adm=mysqli_real_escape_string($conn,$_POST['med_adm']);

$dat_adm=mysqli_real_escape_string($conn,$_POST['dat_adm']);

$emis_no=mysqli_real_escape_string($conn,$_POST['emis_no']);

$sql="UPDATE stud_adm SET


tc_issue='$tc_issue',year='$year',twnvill='$twnvill',dob='$dob',gen='$gen',religion='$religion',caste='$
caste',comunit='$comunit',fname='$fname',f_ed_qua='$f_ed_qua',

f_add_pin_phno='$f_add_pin',cls_adm='$cls_adm',cls_sec='$cls_sec',grop_adm='$grop_adm',med_a
dm='$med_adm',dat_adm='$dat_adm',emis_no='$emis_no' WHERE adm_no='$adm_no'";

//echo $sql;

$result= mysqli_query($conn,$sql);

if($result)
{

echo "<br><br><br><br><br><center><h3>Updated Successfully" ;

else

echo "Failed to Update";

?>

<br><br>

<center>

<input type="button" style="height:40px;width:200px" value="Go to Home"


onclick="window.location ='dashboard.php'">
x. Delete Patient

Admin delete confirmation .php

<?php

include("bg.php");

include("config.php");

session_start();

ob_start();

?>

</br></br></br></br></br>

</br></br></br><center>

<table border="20" height="100" cellpadding="10" bordercolor='#21DBD9' bgcolor='#E5F4F4'>

<form action="deladmin.php" method="POST" autocomplete="off">

<TR>

<TD><b>Master-Password</b></TD>
<TD>

<input type="password" name="mpwd" style="width:180px;height:20px" required autofocus>

</TD>

</TR>

<TR>

<TD></TD>

<TD>

&nbsp;&nbsp;

<input type="submit" value="Continue" name="master" style="height:30px;width:80px">

&nbsp;

&nbsp;<input type="button" value="Cancel" style="height:30px;width:80px"


onclick="window.location ='dashboard.php'">

</form>

</table>

<?php

if(isset($_POST['master']))

$s=$_SESSION['stduid2'];

$mpwd = mysqli_real_escape_string($conn,$_POST['mpwd']);

$result = mysqli_query($conn,"SELECT * FROM user WHERE eid='$s' AND mpwd='$mpwd'");

if($row = mysqli_fetch_array($result))

$_SESSION['maspwd2']=$row['mpwd'];//stores password session

header('location:enroll_name_del.php');

else
{

echo '<script type="text/javascript">alert("Invalid Master-Password!");</script>';

?>

</center>

<?php

include("bg.php");

include("config.php");

ob_start();

session_start();

if((!isset($_SESSION['stduid2']))||(!isset($_SESSION['stdpwd2']))||(!isset($_SESSION['maspwd2'])))

header('Location: deladmin.php');
}

?>

<html>

<head></head>

<title></title>

<body>

<?php

$sql="SELECT * FROM last_entry WHERE id='1'";

$result=mysqli_query($conn,$sql);

if($row=mysqli_fetch_array($result))

echo '<b>Last Entry for Admission ';

echo "</br>";

echo "&nbsp";

echo $row['adm_no'];

else

echo "Last Entry not Found";

?>

<br><br><br><br>

<center>

<input type="button" style="height:40px;width:200px" value="Go to Home"


onclick="window.location ='dashboard.php'">

<br><br>
<table border="20" height="100" cellspacing="10" cellpadding="10" bordercolor='#21DBD9'
bgcolor='#E5F4F4'>

<form method="GET" action="enroll_name_del_pro.php">

<TR>

<TD>

<b>ADMISSION NO.</b>

</TD>

<TD>

<input type="text" name="admno" style="width:150px;height:20px" required autofocus>

</TD>

</TR>

<TR>

<TD></TD>

<TD>

&nbsp;

<input type="submit" name="delete" value="Submit" style="height:30px; width:120px">

&nbsp;&nbsp;

</form>

</table>

</center>

</body>
<?php

include("bg.php");

include("config.php");

ob_start();

session_start();

if((!isset($_SESSION['stduid2']))||(!isset($_SESSION['stdpwd2']))||(!isset($_SESSION['maspwd2'])))

header('Location:deladmin.php') ;

?>

<?php

if(isset($_GET['deleteconfirm']))

$admno=$_GET['admno'];

$sql1="DELETE FROM stud_id WHERE adm_no='$admno'";


$result1=mysqli_query($conn,$sql1);

if($result1)

//Admission delete

$sql2="DELETE FROM stud_adm WHERE adm_no='$admno'";

$result2=mysqli_query($conn,$sql2);

//extra1

$sql5="DELETE FROM extra1 WHERE adm_no='$admno'";

$result5=mysqli_query($conn,$sql5);

//extra2

$sql6="DELETE FROM extra2 WHERE adm_no='$admno'";

$result6=mysqli_query($conn,$sql6);

//extra3

$sql7="DELETE FROM extra3 WHERE adm_no='$admno'";

$result7=mysqli_query($conn,$sql7);

echo "</br></br></br></br></br></br></br></br>";

echo "<center><h3>"."Deleted Successfully"."</h3></center>";

echo '<center><input type="button" style="height:30px" value="Goto Home"


onclick="window.location =\'dashboard.php\'" />';

else

{
echo "<center><h3>"."Failed to Delete/ Adminssion Number not Exists"."</h3></center>";

echo '<p><center><input type="button" style="height:30px/;width:200px" value="Retry"


onclick="window.location =\'enroll_num_chang.php\'" /></p>';

echo '<p><center><input type="button" style="height:30px/;width:200px" value="Goto Home"


onclick="window.location =\'dashboard.php\'" /></p>';

else

echo "</br></br></br></br></br></br></br></br>";

echo "<center><h3>"."Unauthorized Entry"."</h3></center>";

echo '<p><center><input type="button" style="height:30px/;width:200px" value="Goto Main Page"


onclick="window.location =\'dashboard.php\'" /></p>';

ob_end_flush();

?>

<?php

unset($_SESSION['maspwd2']);

?>

You might also like