-
Notifications
You must be signed in to change notification settings - Fork 0
/
yash1.php
152 lines (108 loc) · 3.55 KB
/
yash1.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
<?php
$servername = "localhost";
$username = "root";
$password = "";
$dbname = "corona";
// Create connection
$conn = new mysqli($servername, $username, $password, $dbname);
?>
<!DOCTYPE>
<html>
<head>
<link rel="stylesheet" href="w3.css">
<title>testing going on</title>
</head>
<body>
<style type="text/css">
.margin-top{
margin-top: 100px;
}
</style>
<div id ="check"> </div>
<form class="margin-top">
<! state choice be carefull -->
<div >
SELECT STATE:
<select class ="w3-select w3-blue" id="state" name="state" onchange="myfun()">
<option value = "" selected> None </option>
<?php
$q = "SELECT DISTINCT(state) from center_data c,patientsform p where c.email_address = p.hospitalemailid ;";
$result = mysqli_query($conn,$q);
while($rows = mysqli_fetch_array($result))
{
echo "<option value=".$rows["state"] .">".$rows["state"]."</option>";
}
mysqli_free_result($result);
mysqli_close($conn)
?>
</select>
<! age show -->
<div > AGE :
<div id ="age_shower"> </div>
<input type="number" min="1" max="100" value="50" class="slider" id="age" onchange="myfun();showage(this.value)">
</div>
<div>
<script type="text/javascript">
function showage(str){
document.getElementById("age_shower").innerHTML = str
}
</script>
</div>
<!-- status -->
<div>
STATUS OF PATIENT
<select id="status" name ="status" onchange="myfun()">
<option value = "" selected> None </option>
<option value = "quarantine">quarantine </option>
<option value = "stage1">stage1 </option>
<option value = "stage2"> stage2 </option>
<option value = "crtical">critical </option>
<option value = "dead"> dead </option>
<option value = "free"> free </option>
</select>
</div>
<!-- pre disease -->
<div>
IF ANY PREDISEASE
<select id="predisease" name ="predisease" onchange="myfun()">
<option value = "" selected> No </option>
<option value ="yes">Yes </option>
</div>
<!-- date of admission -->
<div>
<br>
ADMISSION DATE
Enter date of admission <input type="date" id="admission" name="admissiondate" onchange="myfun()">
</div>
<! text where table shows it's data -->
<div id ="txthint" class ="w3-table w3-bordered w3-striped w3-centered">
</div>
<script type="text/javascript">
function myfun(){
var state = document.getElementById("state").value
var age = document.getElementById("age").value
var ele = document.getElementById("status").value
var disease = document.getElementById("predisease").value
var date1 = document.getElementById("admission").value
var str = "state="+ state +"&age="+age +"&status="+ele+"&predisease="+disease+"&admissiondate="+date1
if (str == "") {
document.getElementById("txthint").innerHTML = "";
return;
}
var xhttp = new XMLHttpRequest();
xhttp.open("GET", "showtables.php?"+str,true);
xhttp.send();
xhttp.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
document.getElementById("txthint").innerHTML = this.responseText;
};
};
}
</script>
</form>
<button class =" w3-button w3-green w3-margin-top " type="button"><a href="addpatient.html">add more patient's</button>
<br>
<button class =" w3-button w3-red w3-margin-top" type="button"><a href="view.php">view my patient's</button> <br>
<button class =" w3-button w3-blue w3-margin-top" type="button"><a href="update.php">update</a></button>
</body>
</html>