-
Notifications
You must be signed in to change notification settings - Fork 0
/
SearchUser.php
347 lines (250 loc) · 7.92 KB
/
SearchUser.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
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" href="css/ideacss.css" />
<link rel="stylesheet" href="css/bootstrap.min.css"></link>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js"></script>
<script type="text/javascript" src="js/bootstrap.min.js"></script>
<link rel="stylesheet" href="themes_panel.css">
<link rel="stylesheet" href="http://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.4.0/css/font-awesome.min.css">
<title>ideapool Admin Page</title>
<!-- body style/ table margin -->
<style>
.tablecontent
{
margin-left:20em;
margin-left:20em;
margin-top:7em;
margin-bottom:10em;
}
body {
background-image:url(images/body.jpg);
}
.border
{
width: 125px;
height: 100px;
border : 3px solid rgb(229, 255, 255);
}
.userprf {
font-family: 'Roboto', Arial, sans-serif;
float: left;
overflow: hidden;
margin: 10px 1%;
min-width: 230px;
max-width: 300px;
min-height: 335.2px;
width: 100%;
color: #ffffff;
text-align: left;
line-height: 1.4em;
background-color: #141414;
}
.userprf * {
-webkit-box-sizing: border-box;
box-sizing: border-box;
-webkit-transition: all 0.20s ease;
transition: all 0.25s ease;
}
.userprf img {
max-width: 100%;
vertical-align: top;
opacity: 0.85;
}
.userprf figcaption {
width: 100%;
background-color: #141414;
padding: 20px;
}
.userprf figcaption:before {
content: '';
bottom: 100%;
left: 0;
width: 0;
height: 0;
border-style: solid;
border-width: 50px 0 0 390px;
border-color: transparent transparent transparent #141414;
}
.userprf figcaption a {
padding: 5px;
border: 1px solid #ffffff;
color: #ffffff;
font-size: 0.7em;
text-transform: uppercase;
margin: 10px 0;
display: inline-block;
opacity: 0.65;
width: 47%;
text-align: center;
text-decoration: none;
font-weight: 600;
letter-spacing: 1px;
}
.userprf figcaption a:hover {
opacity: 1;
}
.userprf .profile {
border-radius: 50%;
bottom: 100%;
left: 25px;
z-index: 1;
max-width: 90px;
opacity: 1;
box-shadow: 0 0 15px rgba(0, 0, 0, 0.3);
}
.userprf h2 {
margin: 0 0 5px;
font-weight: 300;
width: 800px;
}
.userprf .info {
margin: 0 0 5px;
font-weight: 300;
width: 250px;
}
.userprf h2 span {
display: block;
font-size: 0.5em;
color: #66CC00;
}
.userprf p {
margin: 0 0 10px;
font-size: 0.8em;
letter-spacing: 1px;
opacity: 0.8;
}
input[type=text] {
width: 130px;
box-sizing: border-box;
border: 2px solid #ccc;
border-radius: 4px;
font-size: 16px;
background-color: white;
background-position: 10px 10px;
background-repeat: no-repeat;
padding: 5px 20px 12px 40px;
-webkit-transition: width 0.4s ease-in-out;
transition: width 0.4s ease-in-out;
}
input[type=text]:focus {
width: 50%;
}
</style>
<!-- end of the body style -->
</head>
<body>
<!-- header-->
<?php
include('header.php');
?>
<!--start of navigation bar -->
<nav class = "navbar navbar-inverse" role = "navigation">
<div class = "navbar-header" style="font-size:20px">
<a class = "navbar-brand" href = "#">Admin Page</a>
</div>
<div style="font-size:20px">
<div class="nav">
<ul class = "nav navbar-nav pull-right">
<li class = "active"><a href = "SearchUser.php">Users</a></li>
<li class = "active"><a href = "editSubmissionCompu.php">Submission</a></li>
<li class = "active"><a href = "newusers.php">New Users</a></li>
<li class = "active"><a href = "allusers.php">Current User</a></li>
</ul>
</div>
</div>
</nav>
<!-- Search key-->
<div id ="tablecontent" style="padding-bottom:200px">
<div class="container">
<div class="row">
<div class="row searchgroup" style="padding-left:680px">
<form method="post">
<div class="row search_col">
<input type="text" class="search_text" placeholder="Search" name="searchkey3"/>
<select name="category" style="height:40px;border: 2px solid #ccc" >
<option value="searchval">Select the search category</option>
<option value="fname">Name</option>
<option value="universityID">University ID</option>
<option value="emil">Email</option>
<option value="category">Category</option>
</select>
<button class="search_btn" name="searchkey4" style="height:39px;width:45px"><img name="edit" src="images/srch.png" width="25" height="25"/></button>
</div>
</form>
</div>
</div>
<?php
if(isset($_POST["searchkey4"]))
{
$search= $_POST["searchkey3"];
$cat=$_POST["category"];
$where= $cat." like '%$search%'";
if($cat=="searchval" && $search==NULL){
echo "<script type='text/javascript'>alert('Enter the search key & select the search category')</script>";
}else{
if($cat=="searchval"){
echo "<script type='text/javascript'>alert('Select the search category')</script>";
}elseif($search==NULL){
echo "<script type='text/javascript'>alert('Enter the search key')</script>";
}else{
if($cat=="fname"){
$where="fname like '%$search%' OR lname like '%$search%'";
}
$sql="select * from register where category!='Operator' and ".$where;
include("database_connect.php"); //provide database connection
$result=mysqli_query($con,$sql);
if (mysqli_num_rows($result)==0)
{
echo "No user Found";
}
while($row = mysqli_fetch_array($result))//retrieve data one by one
{
?>
<figure class="userprf">
<figcaption>
<img src="<?php echo $row['Image']; ?>" alt="profile-sample5" class="profile" />
<h2><?php echo $row['fname']; ?><span><?php echo $row['lname']; ?></span></h2>
<h5><?php echo $row['universityID']; ?> </h5>
<h5><?php echo $row['category']; ?> </h5>
<h5><?php echo $row['emil']; ?> </h5>
<a href="userProfile.php?id=<?=$row["id"]?>" class="info">More Info</a>
</figcaption>
</figure>
<?php }}} }?>
</div>
</div>
<footer>
<div class="container-fluid footer">
<div class="container">
<div class="col-md-4" align="center">
<img src="images/logo.png" class="img img-responsive footerimg" />
</div>
<div class="col-md-4" align="center">
<h6> CONTACT CURTIN </h6>
<br />
<p>
<b>General enquiries</b> <br />
Telephone: +61 8 9266 9266 <br />
Fax: +61 8 9266 3131 <br />
<br /><br/>
<b>Address</b> <br />
Kent Street, <br /> Bentley, <br /> Perth <br />
Western Australia 6102
</p>
</div>
<div class="col-md-4" align="center">
<p><b>LOCATIONS</b> <br /> <br />
Bentley (main campus) <br />
Other WA campuses <br />
Curtin University Sydney <br />
Curtin Sarawak <br />
Curtin Singapore <br />
</p>
</div>
</div>
</div>
</footer>
</body>
</html>