-
Notifications
You must be signed in to change notification settings - Fork 0
/
patientdelete.php
190 lines (175 loc) · 4.8 KB
/
patientdelete.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
<?php
if(isset($_POST['search']))
{
$valueToSearch = $_POST['valueToSearch'];
// search in all table columns
// using concat mysql function
$query = "SELECT * FROM `pattable` WHERE CONCAT( `fullname`, `userid`, `email`, `phoneno`, `password`, `gender`) LIKE '%".$valueToSearch."%'";
$search_result = filterTable($query);
}
else {
$query = "SELECT * FROM `pattable` ";
$search_result = filterTable($query);
}
// function to connect and execute the query
function filterTable($query)
{
$connect = mysqli_connect("localhost", "root", "", "hms");
$filter_Result = mysqli_query($connect, $query);
return $filter_Result;
}
?>
<html>
<head>
<title>Patient Delete</title>
<link rel="stylesheet" type="text/css" href="home.css">
<link rel="shortcut icon" type="image/x-icon" href="images/em.jpg" />
<link rel="stylesheet" href="loader.css">
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.7.0/css/all.css" integrity="sha384-lZN37f5QGtY3VHgisS14W3ExzMWZxybE1SJSEsQp9S+oqd12jhcu+A56Ebc1zFSJ" crossorigin="anonymous">
<style>
body{
width:500px;
height:1000px;
background:white;
}
.content-table{
border-collapse:collapse;
margin:25px 0;
font-size:0.9em;
min-width:900px;
border-radius:5px 5px 0px 0px;
overflow:hidden;
box-shadow: 0 0 20px rgba(0,0,0,0.25);
text-align:center;
}
.content-table thead tr {
background-color:#009879;
color:white;
text-align:center;
font-weight:bold;
}
.content-table th,content-table tr{
padding:20px 30px;
}
.content-table tbody tr{
border-bottom:1px solid #dddddd;
}
.content-table tbody tr:nth-of-type(even){
background-color:#f3f3f3;
}
.content-table tbody tr:last-of-type{
border-bottom:2px solid #009879;
}
.link{
background-color:#009879;
width:1260px;
height:40px;
}
.search-box{
position:absolute;
top:70px;
left:400px;
transfrom:translate(-50%,-50%);
background:#009879;
height:40px;
border-radius:40px;
}
.search-box:hover > .search-btn{
background:#009879;
}
.search-btn{
color:white;
float:right;
width:70px;
height:40px;
border:none;
border-radius:40px;
background:#009879;
display:flex;
justify-content:center;
align-items:center;
transition:0.4s;
}
.search-box:hover > .search-txt{
width:200px;
padding:0 6px;
}
.search-txt{
border:none;
background:none;
outline:none;
float:left;
padding:0;
color:white;
font-size:20px;
font-family:sans-serif;
transition:0.4s;
line-height:40px;
width:0px;
}
.btn{
background-color:#ffcccb;
font-family:sofia;
color:red;
width:70px;
height:30px;
border-radius:30%;
box-shadow:0 0 10px #ffcccb;
}
.btn:hover{
background-color:red;
color:white;
}
</style>
</head>
<body>
<div class="loader">
<img src="gif/loader.gif" alt="Loading...." />
</div>
<script src="load.js">
</script>
<div class="link">
<a class="float-right" href="adminsignin.html" style="font-size:20px;color:white;text-decoration:none;font-family:sofia;"><h4><i class="fa fa-backward" aria-hidden="true"> Back</i> </h4></a>
</div>
<h1 style="color:#009879;">DELETE PATIENTS</h1><br>
<form action="" method="POST" autocomplete="off">
<div class="search-box">
<input class="search-txt" type="text" name="valueToSearch" placeholder="Value To Search">
<input class="search-btn" type="submit" name="search" value="SEARCH">
</div>
</form>
<table class="content-table">
<thead>
<tr>
<th>FULLNAME</th>
<th>USERID</th>
<th>EMAIL</th>
<th>PHONENUMBER</th>
<th>PASSWORD</th>
<th>GENDER</th>
<th>ACTION</th>
</tr>
</thead>
<!-- populate table from mysql database -->
<?php while($row = mysqli_fetch_array($search_result)):?>
<tr>
<td><?php echo $row['fullname'] ?></td>
<td><?php echo $row['userid'] ?></td>
<td><?php echo $row['email'] ?></td>
<td><?php echo $row['phoneno'] ?></td>
<td><?php echo $row['password'] ?></td>
<td><?php echo $row['gender'] ?></td>
<form action="patdeleted.php" method="POST" role="form">
<td><input type='hidden' name='userid' value='<?php echo $row['userid']?>' />
<input type='submit' class='btn' style="outline:none;" name='submit' onclick='return checkdelete()' value='DELETE' /></td>
</form>
</tr>
<?php endwhile;?>
</table>
<script>
function checkdelete(){
return confirm('Are You Sure You Want Delete This Patient');
}
</script>
</body>
</html>