forked from ponaravindb/Hospital-Management-System
-
Notifications
You must be signed in to change notification settings - Fork 0
/
func2.php
executable file
·227 lines (208 loc) · 10.3 KB
/
func2.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
<?php
session_start();
$con=mysqli_connect("localhost","root","","hmsdb");
if(isset($_POST['patsub1'])){
$fname=$_POST['fname'];
$lname=$_POST['lname'];
$gender=$_POST['gender'];
$email=$_POST['email'];
$contact=$_POST['contact'];
$password=$_POST['password'];
$cpassword=$_POST['cpassword'];
if($password==$cpassword){
$query="insert into patreg(fname,lname,gender,email,contact,password,cpassword) values ('$fname','$lname','$gender','$email','$contact','$password','$cpassword');";
$result=mysqli_query($con,$query);
if($result){
$_SESSION['username'] = $_POST['fname']." ".$_POST['lname'];
$_SESSION['fname'] = $_POST['fname'];
$_SESSION['lname'] = $_POST['lname'];
$_SESSION['gender'] = $_POST['gender'];
$_SESSION['contact'] = $_POST['contact'];
$_SESSION['email'] = $_POST['email'];
header("Location:patient_dashboard.php");
}
$query1 = "select * from patreg;";
$result1 = mysqli_query($con,$query1);
if($result1){
$_SESSION['pid'] = $row['pid'];
}
}
else{
header("Location:error1.php");
}
}
if(isset($_POST['update_data']))
{
$contact=$_POST['contact'];
$status=$_POST['status'];
$query="update appointmenttb set payment='$status' where contact='$contact';";
$result=mysqli_query($con,$query);
if($result)
header("Location:updated.php");
}
// function display_docs()
// {
// global $con;
// $query="select * from doctb";
// $result=mysqli_query($con,$query);
// while($row=mysqli_fetch_array($result))
// {
// $name=$row['name'];
// # echo'<option value="" disabled selected>Select Doctor</option>';
// echo '<option value="'.$name.'">'.$name.'</option>';
// }
// }
if(isset($_POST['doc_sub']))
{
$name=$_POST['name'];
$query="insert into doctb(name)values('$name')";
$result=mysqli_query($con,$query);
if($result)
header("Location:adddoc.php");
}
function display_admin_panel(){
echo '<!DOCTYPE html>
<html lang="en">
<head>
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<link rel="stylesheet" type="text/css" href="font-awesome-4.7.0/css/font-awesome.min.css">
<link rel="stylesheet" href="style.css">
<!-- Bootstrap CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta/css/bootstrap.min.css" integrity="sha384-/Y6pD6FV/Vv2HJnA6t+vslU6fwYXjCFtcEpHbNJ0lyAFsXTsjBbfaDjzALeQsN6M" crossorigin="anonymous">
<nav class="navbar navbar-expand-lg navbar-dark bg-primary fixed-top">
<a class="navbar-brand" href="#"><svg xmlns="http://www.w3.org/2000/svg" width="19" height="19" fill="currentColor" class="bi bi-heart-pulse-fill" viewBox="0 0 16 16">
<path fill-rule="evenodd" d="M1.475 9C2.702 10.84 4.779 12.871 8 15c3.221-2.129 5.298-4.16 6.525-6H12a.5.5 0 0 1-.464-.314l-1.457-3.642-1.598 5.593a.5.5 0 0 1-.945.049L5.889 6.568l-1.473 2.21A.5.5 0 0 1 4 9H1.475ZM.879 8C-2.426 1.68 4.41-2 7.824 1.143c.06.055.119.112.176.171a3.12 3.12 0 0 1 .176-.17C11.59-2 18.426 1.68 15.12 8h-2.783l-1.874-4.686a.5.5 0 0 0-.945.049L7.921 8.956 6.464 5.314a.5.5 0 0 0-.88-.091L3.732 8H.88Z"/>
</svg> G3 Healthcare</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="navbar-nav mr-auto">
<li class="nav-item">
<a class="nav-link" href="logout.php"><i class="fa fa-sign-out" aria-hidden="true"></i>Logout</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#"></a>
</li>
</ul>
<form class="form-inline my-2 my-lg-0" method="post" action="search.php">
<input class="form-control mr-sm-2" type="text" placeholder="enter contact number" aria-label="Search" name="contact">
<input type="submit" class="btn btn-outline-light my-2 my-sm-0 btn btn-outline-light" id="inputbtn" name="search_submit" value="Search">
</form>
</div>
</nav>
</head>
<style type="text/css">
button:hover{cursor:pointer;}
#inputbtn:hover{cursor:pointer;}
</style>
<body style="padding-top:50px;">
<div class="jumbotron" id="ab1"></div>
<div class="container-fluid" style="margin-top:50px;">
<div class="row">
<div class="col-md-4">
<div class="list-group" id="list-tab" role="tablist">
<a class="list-group-item list-group-item-action active" id="list-home-list" data-toggle="list" href="#list-home" role="tab" aria-controls="home">Appointment</a>
<a class="list-group-item list-group-item-action" href="patientdetails.php" role="tab" aria-controls="home">Patient List</a>
<a class="list-group-item list-group-item-action" id="list-profile-list" data-toggle="list" href="#list-profile" role="tab" aria-controls="profile">Payment Status</a>
<a class="list-group-item list-group-item-action" id="list-messages-list" data-toggle="list" href="#list-messages" role="tab" aria-controls="messages">Prescription</a>
<a class="list-group-item list-group-item-action" id="list-settings-list" data-toggle="list" href="#list-settings" role="tab" aria-controls="settings">Doctors Section</a>
<a class="list-group-item list-group-item-action" id="list-attend-list" data-toggle="list" href="#list-attend" role="tab" aria-controls="settings">Attendance</a>
</div><br>
</div>
<div class="col-md-8">
<div class="tab-content" id="nav-tabContent">
<div class="tab-pane fade show active" id="list-home" role="tabpanel" aria-labelledby="list-home-list">
<div class="container-fluid">
<div class="card">
<div class="card-body">
<center><h4>Create an appointment</h4></center><br>
<form class="form-group" method="post" action="appointment.php">
<div class="row">
<div class="col-md-4"><label>First Name:</label></div>
<div class="col-md-8"><input type="text" class="form-control" name="fname"></div><br><br>
<div class="col-md-4"><label>Last Name:</label></div>
<div class="col-md-8"><input type="text" class="form-control" name="lname"></div><br><br>
<div class="col-md-4"><label>Email id:</label></div>
<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>Doctor:</label></div>
<div class="col-md-8">
<select name="doctor" class="form-control" >
<!-- <option value="" disabled selected>Select Doctor</option>
<option value="Dr. Punam Shaw">Dr. Punam Shaw</option>
<option value="Dr. Ashok Goyal">Dr. Ashok Goyal</option> -->
<?php display_docs();?>
</select>
</div><br><br>
<div class="col-md-4"><label>Payment:</label></div>
<div class="col-md-8">
<select name="payment" class="form-control" >
<option value="" disabled selected>Select Payment Status</option>
<option value="Paid">Paid</option>
<option value="Pay later">Pay later</option>
</select>
</div><br><br><br>
<div class="col-md-4">
<input type="submit" name="entry_submit" value="Create new entry" class="btn btn-primary" id="inputbtn">
</div>
<div class="col-md-8"></div>
</div>
</form>
</div>
</div>
</div><br>
</div>
<div class="tab-pane fade" id="list-profile" role="tabpanel" aria-labelledby="list-profile-list">
<div class="card">
<div class="card-body">
<form class="form-group" method="post" action="func.php">
<input type="text" name="contact" class="form-control" placeholder="enter contact"><br>
<select name="status" class="form-control">
<option value="" disabled selected>Select Payment Status to update</option>
<option value="paid">paid</option>
<option value="pay later">pay later</option>
</select><br><hr>
<input type="submit" value="update" name="update_data" class="btn btn-primary">
</form>
</div>
</div><br><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">
<form class="form-group" method="post" action="func.php">
<label>Doctors name: </label>
<input type="text" name="name" placeholder="enter doctors name" class="form-control">
<br>
<input type="submit" name="doc_sub" value="Add Doctor" class="btn btn-primary">
</form>
</div>
<div class="tab-pane fade" id="list-attend" role="tabpanel" aria-labelledby="list-attend-list">...</div>
</div>
</div>
</div>
</div>
<!-- Optional JavaScript -->
<!-- jQuery first, then Popper.js, then Bootstrap JS -->
<script src="node_modules/jquery/dist/jquery.slim.min.js"></script>
<script src="node_modules/popper.js/dist/umd/popper.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta/js/bootstrap.min.js" integrity="sha384-h0AbiXch4ZDo7tp9hKZ4TsHbi047NrKGLO3SEJAg45jXxnGIfYzk4Si90RDIqNm1" crossorigin="anonymous"></script>
<!--Sweet alert js-->
<script src="https://cdnjs.cloudflare.com/ajax/libs/limonte-sweetalert2/7.33.1/sweetalert2.all.js"></script>
<script type="text/javascript">
$(document).ready(function(){
swal({
title: "Welcome!",
text: "Have a nice day!",
imageUrl: "images/sweet.jpg",
imageWidth: 400,
imageHeight: 200,
imageAlt: "Custom image",
animation: false
})</script>
</body>
</html>';
}