Skip to content

Commit

Permalink
Initial Commit
Browse files Browse the repository at this point in the history
  • Loading branch information
kishan0725 committed Mar 11, 2020
1 parent 33cae02 commit 644a75c
Show file tree
Hide file tree
Showing 11 changed files with 305 additions and 45 deletions.
92 changes: 87 additions & 5 deletions admin-panel.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
<!DOCTYPE html>
<?php
include('func.php');
include('newfunc.php');
$con=mysqli_connect("localhost","root","","myhmsdb");
$pid = $_SESSION['pid'];
$username = $_SESSION['username'];
$email = $_SESSION['email'];
$fname = $_SESSION['fname'];
Expand All @@ -11,6 +13,7 @@

if(isset($_POST['app-submit']))
{
$pid = $_SESSION['pid'];
$username = $_SESSION['username'];
$email = $_SESSION['email'];
$fname = $_SESSION['fname'];
Expand All @@ -26,11 +29,15 @@
$apptime=$_POST['apptime'];


$query=mysqli_query($con,"insert into appointmenttb(fname,lname,gender,email,contact,doctor,docFees,appdate,apptime,userStatus,doctorStatus) values('$fname','$lname','$gender','$email','$contact','$doctor','$docFees','$appdate','$apptime','1','1')");
$query=mysqli_query($con,"insert into appointmenttb(pid,fname,lname,gender,email,contact,doctor,docFees,appdate,apptime,userStatus,doctorStatus) values($pid,'$fname','$lname','$gender','$email','$contact','$doctor','$docFees','$appdate','$apptime','1','1')");

if($query)
{
echo "<script>alert('Your appointment successfully booked');</script>";
}
else{
echo "<script>alert('Unable to process your request. Please try again!');</script>";
}
}

if(isset($_GET['cancel']))
Expand Down Expand Up @@ -129,13 +136,15 @@
</style>
<body style="padding-top:50px;">
<div class="container-fluid" style="margin-top:50px;">
<h3 style = "margin-left: 40%; padding-bottom: 20px; font-family: 'IBM Plex Sans', sans-serif;"> Welcome &nbsp<?php echo $username ?> </h3>
<h3 style = "margin-left: 40%; padding-bottom: 20px; font-family: 'IBM Plex Sans', sans-serif;"> Welcome &nbsp<?php echo $username ?>
</h3>
<div class="row">
<div class="col-md-4" style="max-width:25%; margin-top: 3%">
<div class="list-group" id="list-tab" role="tablist">
<a class="list-group-item list-group-item-action active" id="list-dash-list" data-toggle="list" href="#list-dash" role="tab" aria-controls="home">Dashboard</a>
<a class="list-group-item list-group-item-action" id="list-home-list" data-toggle="list" href="#list-home" role="tab" aria-controls="home">Book Appointment</a>
<a class="list-group-item list-group-item-action" href="#app-hist" id="list-pat-list" role="tab" data-toggle="list" aria-controls="home">Appointment History</a>
<a class="list-group-item list-group-item-action" href="#list-pres" id="list-pres-list" role="tab" data-toggle="list" aria-controls="home">Prescriptions</a>

</div><br>
</div>
Expand All @@ -146,7 +155,7 @@
<div class="tab-pane fade show active" id="list-dash" role="tabpanel" aria-labelledby="list-dash-list">
<div class="container-fluid container-fullw bg-white" >
<div class="row">
<div class="col-sm-4" style="left: 10%">
<div class="col-sm-4" style="left: 5%">
<div class="panel panel-white no-radius text-center">
<div class="panel-body">
<span class="fa-stack fa-2x"> <i class="fa fa-square fa-stack-2x text-primary"></i> <i class="fa fa-terminal fa-stack-1x fa-inverse"></i> </span>
Expand All @@ -165,7 +174,7 @@ function clickDiv(id) {
</div>
</div>

<div class="col-sm-4" style="left: 15%">
<div class="col-sm-4" style="left: 10%">
<div class="panel panel-white no-radius text-center">
<div class="panel-body" >
<span class="fa-stack fa-2x"> <i class="fa fa-square fa-stack-2x text-primary"></i> <i class="fa fa-paperclip fa-stack-1x fa-inverse"></i> </span>
Expand All @@ -179,8 +188,24 @@ function clickDiv(id) {
</div>
</div>
</div>
</div>

<div class="col-sm-4" style="left: 20%;margin-top:5%">
<div class="panel panel-white no-radius text-center">
<div class="panel-body" >
<span class="fa-stack fa-2x"> <i class="fa fa-square fa-stack-2x text-primary"></i> <i class="fa fa-list-ul fa-stack-1x fa-inverse"></i> </span>
<h4 class="StepTitle" style="margin-top: 5%;">Prescriptions</h2>

<p class="cl-effect-1">
<a href="#list-pres" onclick="clickDiv('#list-pres-list')">
View Prescription List
</a>
</p>
</div>
</div>
</div>

</div>

</div>
</div>

Expand All @@ -203,6 +228,20 @@ function clickDiv(id) {
<div class="col-md-8"><input type="text" class="form-control" name="email"></div><br><br>
<div class="col-md-4"><label>Contact Number:</label></div>
<div class="col-md-8"><input type="text" class="form-control" name="contact"></div><br><br> -->

<div class="col-md-4"><label for="spec">Specialization:</label></div>
<div class="col-md-8">
<select name="spec" class="form-control" id="spec">
<option value="" disabled selected>Select Specialization</option>
<?php display_specs();?>
</select>
<script>
document.getElementById('spec').onchange = function updateFees(e) {
document.getElementById('doctor').value = document.querySelector(`[value=${this.value}]`).getAttribute('data-value');
};
</script>
</div><br><br>

<div class="col-md-4"><label for="doctor">Doctors:</label></div>
<div class="col-md-8">
<select name="doctor" class="form-control" id="doctor" required="required">
Expand Down Expand Up @@ -318,6 +357,49 @@ function clickDiv(id) {



<div class="tab-pane fade" id="list-pres" role="tabpanel" aria-labelledby="list-pres-list">

<table class="table table-hover">
<thead>
<tr>

<th scope="col">Doctor Name</th>
<th scope="col">Appointment ID</th>
<th scope="col">Appointment Date</th>
<th scope="col">Appointment Time</th>
<th scope="col">Diseases</th>
<th scope="col">Allergies</th>
<th scope="col">Prescriptions</th>
</tr>
</thead>
<tbody>
<?php

$con=mysqli_connect("localhost","root","","myhmsdb");
global $con;

$query = "select doctor,ID,appdate,apptime,disease,allergy,prescription from prestb where fname ='$fname' and lname='$lname' and pid='$pid';";
$result = mysqli_query($con,$query);
while ($row = mysqli_fetch_array($result)){
?>
<tr>
<td><?php echo $row['doctor'];?></td>
<td><?php echo $row['ID'];?></td>
<td><?php echo $row['appdate'];?></td>
<td><?php echo $row['apptime'];?></td>
<td><?php echo $row['disease'];?></td>
<td><?php echo $row['allergy'];?></td>
<td><?php echo $row['prescription'];?></td>

</tr>
<?php } ?>
</tbody>
</table>
<br>
</div>




<div class="tab-pane fade" id="list-messages" role="tabpanel" aria-labelledby="list-messages-list">...</div>
<div class="tab-pane fade" id="list-settings" role="tabpanel" aria-labelledby="list-settings-list">
Expand Down
7 changes: 4 additions & 3 deletions admin-panel1.php
Original file line number Diff line number Diff line change
Expand Up @@ -412,9 +412,10 @@ function clickDiv(id) {
<div class="col-md-8">
<select name="special" class="form-control" id="special" required="required">
<option value="head" name="spec" disabled selected>Select Specialization</option>
<option value="heart" name="spec" selected>Heart</option>
<option value="homeo" name="spec" selected>Homeopathy</option>
<option value="accu" name="spec" selected>Accupuncture</option>
<option value="heart" name="spec">General</option>
<option value="homeo" name="spec">Cardiologist</option>
<option value="accu" name="spec">Neurologist</option>
<option value="accu" name="spec">Pediatrician</option>
</select>
</div><br><br>
<div class="col-md-4"><label>Email ID:</label></div>
Expand Down
93 changes: 88 additions & 5 deletions doctor-panel.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,25 @@
}
}

if(isset($_GET['prescribe'])){
$doctor = $_SESSION['dname'];
$pid = $_GET['pid'];
$ID = $_GET['ID'];
$appdate = $_GET['appdate'];
$apptime = $_GET['apptime'];
$disease = $_GET['disease'];
$allergy = $_GET['allergy'];
$prescription = $_GET['prescription'];
$query=mysqli_query($con,"insert into prestb(doctor,pid,ID,appdate,apptime,disease,allergy,prescription) values ('$dname',$pid,$ID,'$appdate','$apptime','$disease','$allergy','$prescription');");
if($query)
{
echo "<script>alert('Prescribed successfully!');</script>";
}
else{
echo "<script>alert('Unable to process your request. Try again!');</script>";
}
}


?>
<html lang="en">
Expand Down Expand Up @@ -83,10 +102,11 @@
<div class="container-fluid" style="margin-top:50px;">
<h3 style = "margin-left: 40%; padding-bottom: 20px;font-family:'IBM Plex Sans', sans-serif;"> Welcome &nbsp<?php echo $_SESSION['dname'] ?> </h3>
<div class="row">
<div class="col-md-4" style="max-width:25%;margin-top: 3%;">
<div class="col-md-4" style="max-width:18%;margin-top: 3%;">
<div class="list-group" id="list-tab" role="tablist">
<a class="list-group-item list-group-item-action active" href="#list-dash" role="tab" aria-controls="home" data-toggle="list">Dashboard</a>
<a class="list-group-item list-group-item-action active" href="#list-dash" role="tab" aria-controls="home" data-toggle="list">Dashboard</a>
<a class="list-group-item list-group-item-action" href="#list-app" id="list-app-list" role="tab" data-toggle="list" aria-controls="home">Appointments</a>
<a class="list-group-item list-group-item-action" href="#list-pres" id="list-pres-list" role="tab" data-toggle="list" aria-controls="home"> Prescribe</a>

</div><br>
</div>
Expand All @@ -96,7 +116,8 @@

<div class="container-fluid container-fullw bg-white" >
<div class="row">
<div class="col-sm-4" style="left: 30%">

<div class="col-sm-4" style="left: 10%">
<div class="panel panel-white no-radius text-center">
<div class="panel-body">
<span class="fa-stack fa-2x"> <i class="fa fa-square fa-stack-2x text-primary"></i> <i class="fa fa-list fa-stack-1x fa-inverse"></i> </span>
Expand All @@ -114,6 +135,22 @@ function clickDiv(id) {
</div>
</div>
</div>

<div class="col-sm-4" style="left: 15%">
<div class="panel panel-white no-radius text-center">
<div class="panel-body">
<span class="fa-stack fa-2x"> <i class="fa fa-square fa-stack-2x text-primary"></i> <i class="fa fa-list-ul fa-stack-1x fa-inverse"></i> </span>
<h4 class="StepTitle" style="margin-top: 5%;"> Prescriptions</h4>

<p class="links cl-effect-1">
<a href="#list-pres" onclick="clickDiv('#list-pres-list')">
Prescription List
</a>
</p>
</div>
</div>
</div>

</div>
</div>
</div>
Expand All @@ -124,6 +161,8 @@ function clickDiv(id) {
<table class="table table-hover">
<thead>
<tr>
<th scope="col">Patient ID</th>
<th scope="col">Appointment ID</th>
<th scope="col">First Name</th>
<th scope="col">Last Name</th>
<th scope="col">Gender</th>
Expand All @@ -133,6 +172,7 @@ function clickDiv(id) {
<th scope="col">Appointment Time</th>
<th scope="col">Current Status</th>
<th scope="col">Action</th>
<th scope="col">Prescribe</th>

</tr>
</thead>
Expand All @@ -141,11 +181,13 @@ function clickDiv(id) {
$con=mysqli_connect("localhost","root","","myhmsdb");
global $con;
$dname = $_SESSION['dname'];
$query = "select ID,fname,lname,gender,email,contact,appdate,apptime,userStatus,doctorStatus from appointmenttb where doctor='$dname';";
$query = "select pid,ID,fname,lname,gender,email,contact,appdate,apptime,userStatus,doctorStatus from appointmenttb where doctor='$dname';";
$result = mysqli_query($con,$query);
while ($row = mysqli_fetch_array($result)){
?>
<tr>
<td><?php echo $row['pid'];?></td>
<td><?php echo $row['ID'];?></td>
<td><?php echo $row['fname'];?></td>
<td><?php echo $row['lname'];?></td>
<td><?php echo $row['gender'];?></td>
Expand Down Expand Up @@ -183,13 +225,54 @@ function clickDiv(id) {
} ?>

</td>
</tr>

<td>

<?php if(($row['userStatus']==1) && ($row['doctorStatus']==1))
{ ?>

<a href="doctor-panel.php#list-pres?pid=<?php echo $row['pid']?>&ID=<?php echo $row['ID']?>&appdate=<?php echo $row['appdate']?>&apptime=<?php echo $row['apptime']?>"
onclick="clickDiv('#list-pres-list')" title="prescribe">
<button class="btn btn-success">Prescibe</button></a>
<?php } else {

echo "-";
} ?>

</td>


</tr></a>
<?php } ?>
</tbody>
</table>
<br>
</div>

<div class="tab-pane fade" id="list-pres" role="tabpanel" aria-labelledby="list-pres-list">
<form class="form-group" name="prescribeform" method="get" action="doctor-panel.php">
<div class="row">
<div class="col-md-4"><label>Disease:</label></div>
<div class="col-md-8">
<!-- <input type="text" class="form-control" name="disease" required> -->
<textarea id="disease" cols="86" rows ="5" name="disease" required></textarea>
</div><br><br>

<div class="col-md-4"><label>Allergies:</label></div>
<div class="col-md-8">
<!-- <input type="text" class="form-control" name="allergy" required> -->
<textarea id="allergy" cols="86" rows ="5" name="allergy" required></textarea>
</div><br><br>
<div class="col-md-4"><label>Prescription:</label></div>
<div class="col-md-8">
<!-- <input type="text" class="form-control" name="prescription" required> -->
<textarea id="prescription" cols="86" rows ="10" name="prescription" required></textarea>
</div><br><br>

<input type="submit" name="prescribe" value="Prescribe" class="btn btn-primary">
</form>
</div>




Expand Down
25 changes: 13 additions & 12 deletions func.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
if(mysqli_num_rows($result)==1)
{
while($row=mysqli_fetch_array($result,MYSQLI_ASSOC)){
$_SESSION['pid'] = $row['pid'];
$_SESSION['username'] = $row['fname']." ".$row['lname'];
$_SESSION['fname'] = $row['fname'];
$_SESSION['lname'] = $row['lname'];
Expand Down Expand Up @@ -38,18 +39,18 @@



function display_docs()
{
global $con;
$query="select * from doctb";
$result=mysqli_query($con,$query);
while($row=mysqli_fetch_array($result))
{
$name=$row['name'];
$cost=$row['docFees'];
echo '<option value="'.$name.'" data-price="' .$cost. '" >'.$name.'</option>';
}
}
// function display_docs()
// {
// global $con;
// $query="select * from doctb";
// $result=mysqli_query($con,$query);
// while($row=mysqli_fetch_array($result))
// {
// $name=$row['name'];
// $cost=$row['docFees'];
// echo '<option value="'.$name.'" data-price="' .$cost. '" >'.$name.'</option>';
// }
// }

if(isset($_POST['doc_sub']))
{
Expand Down
7 changes: 7 additions & 0 deletions func2.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,13 @@
$_SESSION['email'] = $_POST['email'];
header("Location:admin-panel.php");
}

$query1 = "select * from patreg;";
$result1 = mysqli_query($con,$query);
if($result1){
$_SESSION['pid'] = $row['pid'];
}

}
else{
header("Location:error1.php");
Expand Down
Loading

0 comments on commit 644a75c

Please sign in to comment.