-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbed.php
More file actions
126 lines (76 loc) · 2.03 KB
/
Copy pathbed.php
File metadata and controls
126 lines (76 loc) · 2.03 KB
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
<!DOCTYPE html>
<html>
<head>
<title>Cure All</title>
<meta charset="utf-8">
<link href="layout.css" rel="stylesheet" type="text/css" media="all">
</head>
<body id="top">
<div class="wrapper row1">
<header id="header" class="clear">
<div id="logo" class="fl_left">
<h1><a href="index.html">Cure all</a></h1>
</div>
</header>
</div>
<div class="wrapper row2">
<nav id="mainav" class="clear">
<ul class="clear">
<li class="button"><a href="index.html">Home</a></li>
<li class ="button"><a href="Emed.php">E-Medicine</a></li>
<li class ="button"><a href="Doctors.php">Doctors</a></li>
<li class ="active"><a href="LOGIN.php"> LOGIN</a></li>
</ul>
</nav>
</div>
<div class="wrapper row3">
<main class="container clear">
<h1>Bed allotment</h1>
<form action="" method="post">
<p>
Username or id:<input type="text" name="user"></p>
Bed:<input type="number" name="select" max="15" min="1"></p>
</select>
<input type="submit" value="register" name="submit"><br/>
</form
<?php
if(isset($_POST["submit"]))
{
$bed = $_POST['select'];
$user = $_POST['user'];
//DB Connection
$conn= mysqli_connect('localhost','root','123456','cureall');
$query = mysqli_query($conn, "SELECT * FROM bed WHERE bed_no='".$bed."'");
$numrows = mysqli_num_rows($query);
if($numrows == 0)
{
$sql = "INSERT INTO bed(id,bed_no) VALUES('$user','$bed')";
$res= mysqli_query($conn, $sql);
if($res){
echo "Aloted";
}
else
{
echo "not available";
}
}
else
{
echo "select other ";
}
}
?>
</div>
</div>
<div class="wrapper row4">
<footer id="footer" class="clear">
<div class="row">
</footer>
</div>
</div>
<div class="wrapper row5">
<div id="copyright" class="clear">
<p class="fl_left">©Reserved by Avan avi</p>
</div>
</div>
</html>