forked from ponaravindb/Hospital-Management-System
-
Notifications
You must be signed in to change notification settings - Fork 0
/
func3.php
executable file
·52 lines (47 loc) · 1.29 KB
/
func3.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
<?php
session_start();
$con=mysqli_connect("localhost","root","","hmsdb");
if(isset($_POST['adsub'])){
$username=$_POST['username1'];
$password=$_POST['password2'];
$query="select * from admintb where username='$username' and password='$password';";
$result=mysqli_query($con,$query);
if(mysqli_num_rows($result)==1)
{
$_SESSION['username']=$username;
header("Location:admin_dashboard.php");
}
else
// header("Location:error2.php");
echo("<script>alert('Invalid Username or Password. Try Again!');
window.location.href = 'index.php';</script>");
}
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");
}