-
Notifications
You must be signed in to change notification settings - Fork 1
/
Welcome2.php
509 lines (508 loc) · 26 KB
/
Welcome2.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
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
<?php
require('connect.php');
session_start();
if(!isset($_SESSION['user'])){
header("location:Sign in_up.php");
}
/*--- Function to calculate date on $i emequery_id from emequery table ---*/
function emequestion($i){
require('connect.php');
if(!isset($_SESSION['user'])){
header("location:Sign in_up.php");
}
$emeres7 = mysqli_query($link, "select * from emequery where emequery_id ='".$i."'");
$emedata = mysqli_fetch_assoc($emeres7);
global $author9;
global $ques9;
global $date9;
$author9 = $emedata['author'];
$ques9 = $emedata['content'];
$date9 = $emedata['date_posted'];
}
/*--- Function to calculate date on $i emereply_id from emereplies table ---*/
function emereplies($i){
require('connect.php');
if(!isset($_SESSION['user'])){
header("location:Sign in_up.php");
}
$emeresult7 = mysqli_query($link, "select * from emereplies where emequery_id ='".$i."'");
global $emereplyauthor;
global $emereplycontent;
global $emereplydislikes;
global $emereplylikes;
global $emereplydateposted;
global $emereplyid;
$emereplycontent = array();
$emereplyauthor = array();
$emereplydateposted = array();
$emereplyid = array();
for (;$emereplyrow9 = mysqli_fetch_assoc($emeresult7);){
$emereplyid[] = $emereplyrow9['emereply_id'];
$emereplycontent[] = $emereplyrow9['comment'];
$emereplyauthor[] = $emereplyrow9['author'];
$emereplydateposted[] = $emereplyrow9['date_posted'];
}
}
/*--- Function to calculate date on $i query_id from query table ---*/
function question($i){
require('connect.php');
if(!isset($_SESSION['user'])){
header("location:Sign in_up.php");
}
$sql1 = "select * from query where query_id ='".$i."'";
$result1 = mysqli_query($link, $sql1);
$data1 = mysqli_fetch_assoc($result1);
global $ques1;
$ques1 = $data1['content'];
global $author1;
$author1= $data1['author'];
global $date1;
$date1 = $data1['date_posted'];
$views1 = $data1['views'];
$cat1_id = $data1['cat_id'];
$subcat1_id = $data1['subcat_id'];
$catsql1 = "select * from categories where cat_id ='".$cat1_id."'";
$catresult1 = mysqli_query($link, $catsql1);
$catdata1 = mysqli_fetch_assoc($catresult1);
$cat1 = $catdata1['category_name'];
$subcatsql1 = "select * from subcategories where Subcat_id ='".$subcat1_id."'";
$subcatresult1 = mysqli_query($link, $subcatsql1);
$subcatdata1 = mysqli_fetch_assoc($subcatresult1);
global $subcat1;
$subcat1 = $subcatdata1['subcat_name'];
}
/*--- Function to calculate date on $i reply_id from replies table ---*/
function replies($i) {
require('connect.php');
if(!isset($_SESSION['user'])){
header("location:Sign in_up.php");
}
$sql2 = "select * from replies where query_id ='".$i."'";
$result2 = mysqli_query($link, $sql2);
global $replyauthor;
global $replycontent;
global $replydislikes;
global $replylikes;
global $replydateposted;
global $replyid;
$replycontent = array();
$replyauthor = array();
$replydateposted = array();
$replylikes = array();
$replydislikes = array();
$replyid = array();
for (;$replyrow = mysqli_fetch_assoc($result2);){
$replyid[] = $replyrow['reply_id'];
$replycontent[] = $replyrow['comment'];
$replyauthor[] = $replyrow['author'];
$replydateposted[] = $replyrow['date_posted'];
$replylikes[] = $replyrow['Likes'];
$replydislikes[] = $replyrow['Dislikes'];
}
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Home</title>
<link rel="stylesheet" href="./css/styles2.css">
<script src="https://kit.fontawesome.com/a076d05399.js"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
</head>
<body>
<!-- Top Navigation Tab -->
<nav>
<div class="navbar">
<div class="tabsnavbar">
<div class="logonavbar"><b>Synergy</b></div>
<?php
if(empty($_GET)){
echo '<div class="navlinkhome" style="border-bottom: 2px solid rgb(187, 2, 2);">
<a href="Welcome2.php" style="color: rgb(187, 2, 2);">
<i class="fas fa-home" style="font-size: 20px;color: rgb(187, 2, 2);"></i>
<b>Home</b></a></div>';
}
else{
echo '<div class="navlinkhome" style="border-bottom: 2px solid white;">
<a href="Welcome2.php" style="color: rgb(140, 140, 140);">
<i class="fas fa-home" style="font-size: 20px;color: rgb(140, 140, 140);"></i>
<b>Home</b></a></div>';
}
if(@$_GET['Cat']==true){
echo '<div class="navlinkcategories" onmouseover="showCategory()" onmouseout="fadeCategory()" style="border-bottom: 2px solid rgb(187, 2, 2); color: rgb(187, 2, 2);">
<i id="redtwo" class="far fa-list-alt" style="font-size: 20px;color: rgb(187, 2, 2);"></i>
<b>Categories</b>
</div>';
}
else {
echo '<div class="navlinkcategories" onmouseover="showCategory()" onmouseout="fadeCategory()">
<i id="redtwo" class="far fa-list-alt" style="font-size: 20px;color: rgb(140, 140, 140);"></i>
<b>Categories</b>
</div>';
}
?>
<?php
if(@$_GET['answer']==true){
echo '<div class="navlinkanswers" style="border-bottom: 2px solid rgb(187, 2, 2); color: rgb(187, 2, 2);">
<a href="Welcome2.php?answer=showpage" style="color:rgb(187, 2, 2);"><i class="fas fa-edit" style="font-size: 20px;color: rgb(187, 2, 2);"></i>
<b>Answer</b></a>
</div>';
}
else{
echo '<div class="navlinkanswers">
<a href="Welcome2.php?answer=showpage" style="color:rgb(140, 140, 140);"><i class="fas fa-edit" style="font-size: 20px;color: rgb(140, 140, 140);"></i>
<b>Answer</b></a>
</div>';
}
if(@$_GET['notification']==true){
echo '<div class="navlinksnotification" style="border-bottom: 2px solid rgb(187, 2, 2); color: rgb(187, 2, 2);">
<a href="Welcome2.php?notification=showpage" style="color: rgb(187, 2, 2);"><i class="fas fa-bell" style="font-size: 20px;color: rgb(187, 2, 2);"></i>
<b>Notification</b></a>
</div>';
}
else{
echo '<div class="navlinksnotification">
<a href="Welcome2.php?notification=showpage" style="color:rgb(140, 140, 140);"><i class="fas fa-bell" style="font-size: 20px;color: rgb(140, 140, 140);"></i>
<b>Notification</b></a>
</div>';
}
?>
<div class="navlinksearch">
<input type="text" class="searchbox" placeholder="Search" name="search">
<div class="icon"><i class="fas fa-search" style="font-size: 20px;color: rgb(140, 140, 140);"></i></div>
</div>
<div class="navlinkusercontrol">
<i class="fas fa-user-tie" style="font-size: 20px;color: rgb(140, 140, 140);"></i>
<div class="phpusername" style="font-size: 15px;padding-left: 8px;"><?php echo $_SESSION["user"]; ?></div>
</div>
<div class="navlinklogout">
<a href="logout.php?logout" style="color: red;"><i class="fas fa-sign-out-alt" style="font-size: 20px;"></i>
<b>Logout</b></a>
</div>
</div>
</div>
</nav>
<div class="main" style="overflow:hidden; height:10000px">
<!-- Side Navigation Bar -->
<div class="sidenav">
<div class="sidenavtabs">
<a href="Welcome2.php"><div class="activesidenav">
<i class="fas fa-comments" style="font-size: 20px;color: rgb(187, 2, 2);"></i>
<b>News</b>
</div>
<a href="Welcome2.php?Cat=15"><div class="passivesidenav1">
<i class="fas fa-laptop-code" style="font-size: 20px; color: rgb(187, 2, 2);"></i>
<b style="color: rgb(187, 2, 2);">Computer Club</b>
</div></a>
<a href="Welcome2.php?Cat=1"><div class="passivesidenav2">
<i class="fas fa-futbol" style="font-size: 20px; color: rgb(187, 2, 2);"></i>
<b style="color: rgb(187, 2, 2);">Football</b>
</div></a>
<a href="Welcome2.php?Cat=18"><div class="passivesidenav3">
<i class="fas fa-desktop" style="font-size: 20px; color: rgb(187, 2, 2);"></i>
<b style="color: rgb(187, 2, 2);">Computer Science</b>
</div></a>
<a href="Welcome2.php?Cat=9"><div class="passivesidenav4">
<i class="fas fa-archway" style="font-size: 20px; color: rgb(187, 2, 2);"></i>
<b style="color: rgb(187, 2, 2);">Dramatics</b>
</div><a>
<a href="Welcome2.php?Cat=20"><div class="passivesidenav5">
<i class="fas fa-tools" style="font-size: 20px; color: rgb(187, 2, 2);"></i>
<b style="color: rgb(187, 2, 2);">Mechanical</b>
</div></a>
<a href="Welcome2.php?Cat=16"><div class="passivesidenav6">
<i class="fas fa-robot" style="font-size: 20px; color: rgb(187, 2, 2);"></i>
<b style="color: rgb(187, 2, 2);">Robotics</b>
</div></a>
<a href="Welcome2.php?Cat=14"><div class="passivesidenav7">
<i class="fas fa-music" style="font-size: 20px; color: rgb(187, 2, 2);"></i>
<b style="color: rgb(187, 2, 2);">Music</b>
</div></a>
<a href="Welcome2.php?Cat=2"><div class="passivesidenav8">
<i class="fas fa-bowling-ball" style="font-size: 20px; color: rgb(187, 2, 2);"></i>
<b style="color: rgb(187, 2, 2);">Cricket</b>
</div></a>
<a href="Welcome2.php?Cat=5"><div class="passivesidenav9">
<i class="fas fa-running" style="font-size: 20px; color: rgb(187, 2, 2);"></i>
<b style="color: rgb(187, 2, 2);">Athletics</b>
</div></a>
</div>
</div>
<div class="content">
<div class="askquescontent">
<form action="submitques.php" method="POST">
<div class="askqueslogo">
<i class="fas fa-user-tie" style="font-size: 20px;color: rgb(187, 2, 2); margin-left: 20px; margin-top: 20px;"></i>
<b><?php echo $_SESSION["name"]; ?></b>
<select id="catagoryselect" name="Category">
<option value="Computer Club">Computer Club</option>
<option value="FootBall">FootBall</option>
<option value="CSE">CSE</option>
<option value="Dramatics">Dramatics</option>
<option value="Mechanical">Mechanical</option>
<option value="Robotics">Robotics</option>
<option value="Music">Music</option>
<option value="Cricket">Cricket</option>
<option value="Athletics">Athletics</option>
<option value="BasketBall">BasketBall</option>
<option value="Hockey">Hockey</option>
<option value="VolleyBall">VolleyBall</option>
<option value="Skating">Skating</option>
<option value="Gym">Gym</option>
<option value="Garbha Dance">Garbha Dance</option>
<option value="Western Dance">Western Dance</option>
<option value="Arts">Arts</option>
<option value="Bhangda">Bhangda</option>
<option value="Aero Club">Aero Club</option>
<option value="IT">IT</option>
<option value="Electrical">Electrical</option>
<option value="Biotechnlogy">Biotechnlogy</option>
<option value="Civil">Civil</option>
</select>
</div>
<input type="text" name="questab" placeholder="Ask Your Question" class="questab">
<input type="submit" name="createques" value="Submit" class="createques" style="color:white;">
<input type="submit" name="redbtn" class="createques" value="Emergency" style="background-color:red; color:white;"><br>
</form>
</div><br>
<?php
if(@$_GET['Cat']==true){
$quesres = mysqli_query($link, "select * from query where subcat_id ='".$_GET['Cat']."'");
for ($quesset = array (); $quesrow = mysqli_fetch_assoc($quesres); $quesset[] = $quesrow['query_id']);
if(count($quesset)==0){
echo '<div class="questions" style="text-align: center"><b>NO QUESTIONS TO DISPLAY</b>
</div><br>';
}
else{
for($m=count($quesset)-1;$m>=0;$m=$m-1){
$j = $quesset[$m];
question($j);
replies($j);
$number_replies = count($replyid);
echo '<div class="questions" style="display: -webkit-box;>
<i class="fas fa-user-tie" style="font-size: 20px;color: rgb(187, 2, 2); margin-top: 20px;"></i>
<b style="color: rgb(187, 2, 2);">'.$author1.'</b>
<i class="fas fa-tag" style="font-size: 20px;color: rgb(187, 2, 2); margin-left:350px; margin-top: 5px;"></i>
<b style="color: rgb(187, 2, 2); font-size: 13px;">'.$subcat1.'</b><br><br>
<i class="fas fa-clock"></i>
<b style="color: rgb(140, 140, 140);; font-size: 13px; margin-left:10px; margin-top:15px;">'.$date1.'</b><br><br>
<b>'.$ques1.'</b><br><br>';
}
if($number_replies>0){
echo '<b style="color: green;">Answered By :</b><br><br>';
for($k=0;$k<$number_replies;$k++){
echo '<b><i class="fas fa-user-tie" style="font-size: 20px;color: rgb(187, 2, 2); margin-top: 20px;margin-left:20px;"></i>
<b style="color: rgb(187, 2, 2);">'.$replyauthor[$k].'</b>
<i class="fas fa-clock" style="margin-left:50px"></i>
<b style="color: rgb(140, 140, 140); font-size: 13px; margin-left:10px; margin-top:15px;">'.$replydateposted[$k].'</b><br><br>
<b>'.$replycontent[$k].'</b><br><br>';
echo '<a href="likedis.php?like='.$replyid[$k].'" style="color:blue;"><i class="fas fa-thumbs-up" style="font-size:22px;"></i></a>
<b>'.$replylikes[$k].'</b>
<a href="likedis.php?dislike='.$replyid[$k].'" style="color:red;"><i class="fas fa-thumbs-down" style="font-size:22px;"></i></a>
<b>'.$replydislikes[$k].'</b><br><br><br>';
}
}
else{
echo '<b style="color:red; text-align:center;">No Answers Yet....</b><br><br><br>';
}
echo '<b style="color: Blue">Put Your Answer :</b><br><br>
<form action="submitans.php?id='.$j.'" method="POST">
<i class="fas fa-user-tie" style="font-size: 20px;color: rgb(187, 2, 2); margin-left: 20px; margin-top: 20px;"></i>
<b style="color: rgb(187, 2, 2);">'.$_SESSION["name"].'</b><br><br>
<input type="text" name="answer" placeholder="Answer" style="width:500px; height:35px; font-size:18px padding-left:20px; padding-top:10px; cursor:text;"><br>
<input type="submit" name="postanswer" value="POST" style="background-color:green; color:white; width:50px; height:25px; cursor:pointer;">
</form>';
echo '</b></div><br>';
}
}
else if(@$_GET['answer']==true){
$sqlquery9 = "select * from query where author='".$_SESSION['name']."'";
$ownres9 = mysqli_query($link, $sqlquery9);
$ownquery_id = array();
$ownsubcat_id = array();
$owncontent = array();
$owndate_posted = array();
for(;$ownrow= mysqli_fetch_assoc($ownres9);){
$ownquery_id[] = $ownrow['query_id'];
$ownsubcat_id[] = $ownrow['subcat_id'];
$owncontent[] = $ownrow['content'];
$owndate_posted[] = $ownrow['date_posted'];
}
if(count($ownquery_id)>0){
for($own=count($ownquery_id)-1;$own>=0;$own--){
$sqlquery8 = "select * from subcategories where Subcat_id='".$ownsubcat_id[$own]."'";
$ownres8 = mysqli_query($link, $sqlquery8);
$ownrow5= mysqli_fetch_assoc($ownres8);
$ownsubcat = $ownrow5['subcat_name'];
echo '<div class="questions" style="display: -webkit-box;">
<i class="fas fa-user-tie" style="font-size: 20px;color: rgb(187, 2, 2); margin-top: 20px;"></i>
<b style="color: rgb(187, 2, 2);">'.$_SESSION['name'].'</b>
<i class="fas fa-tag" style="font-size: 20px;color: rgb(187, 2, 2); margin-left:300px; margin-top: 5px;"></i>
<b style="color: rgb(187, 2, 2); font-size: 13px;">'.$ownsubcat.'</b>
<a href="deletques.php?id='.$ownquery_id[$own].'"><i class="fas fa-trash-alt" style="font-size: 20px;color: red; margin-left:70px; cursor:pointer;"></i></a>
<br><br>
<i class="fas fa-clock"></i>
<b style="color: rgb(140, 140, 140);; font-size: 13px; margin-left:10px; margin-top:15px;">'.$owndate_posted[$own].'</b><br><br>
<b>'.$owncontent[$own].'</b><br><br>';
replies($ownquery_id[$own]);
$number_replies = count($replyid);
if($number_replies>0){
echo '<b style="color: green;">Answered By :</b><br><br>';
for($k=0;$k<$number_replies;$k++){
echo '<b><i class="fas fa-user-tie" style="font-size: 20px;color: rgb(187, 2, 2); margin-top: 20px;margin-left:20px;"></i>
<b style="color: rgb(187, 2, 2);">'.$replyauthor[$k].'</b>
<i class="fas fa-clock" style="margin-left:50px"></i>
<b style="color: rgb(140, 140, 140); font-size: 13px; margin-left:10px; margin-top:15px;">'.$replydateposted[$k].'</b><br><br>'.$replycontent[$k].'<br><br><br>';
echo '<a href="likedis.php?like='.$replyid[$k].'" style="color:blue;"><i class="fas fa-thumbs-up" style="font-size:22px;"></i></a>
<b>'.$replylikes[$k].'</b>
<a href="likedis.php?dislike='.$replyid[$k].'" style="color:red;"><i class="fas fa-thumbs-down" style="font-size:22px;"></i></a>
<b>'.$replydislikes[$k].'</b><br><br><br>';
}
}
else{
echo '<b style="color:red; text-align:center;">No Answers Yet....</b><br><br><br>';
}
echo '</b></div><br>';
}}
else {
echo '<div class="questions" style="display: -webkit-box;"><b>You Have not ask any question yet.</b></div>';
}
}
else if(@$_GET['notification']==true){
$sqlquery4 = "select * from query where author='".$_SESSION['name']."'";
$notres4 = mysqli_query($link, $sqlquery4);
for($notquery_id = array();$notrow1= mysqli_fetch_assoc($notres4);$notquery_id[] = $notrow1['query_id']);
if(count($notquery_id)>0){
for($n=count($notquery_id)-1;$n>=0;$n--){
$notres5 = mysqli_query($link, "select * from replies where query_id = '".$notquery_id[$n]."'");
for($notauthors1 = array();$notrow5= mysqli_fetch_assoc($notres5);$notauthors1[] = $notrow5['author']);
for($h=count($notauthors1)-1;$h>=0;$h--){
echo '<div class="questions" style="display: -webkit-box;"><b>'.$notauthors1[$h].' replied to your Query </b></div><br>';
}
echo '<div class="questions" style="display: -webkit-box;"><b>You added a new query</b></div><br>';
}
}
else{
echo '<div class="questions" style="display: -webkit-box;">No Notifications</div>';
}
}
else{
$quesres = mysqli_query($link, "select * from query");
for ($quesset = array (); $quesrow = mysqli_fetch_assoc($quesres); $quesset[] = $quesrow['query_id']);
for($m=count($quesset)-1;$m>=0;$m=$m-1){
$p = $quesset[$m];
question($p);
replies($p);
$number_replies = count($replyid);
echo '<div class="questions" style="display: -webkit-box;">
<i class="fas fa-user-tie" style="font-size: 20px;color: rgb(187, 2, 2); margin-top: 20px;"></i>
<b style="color: rgb(187, 2, 2);">'.$author1.'</b>
<i class="fas fa-tag" style="font-size: 20px;color: rgb(187, 2, 2); margin-left:350px; margin-top: 5px;"></i>
<b style="color: rgb(187, 2, 2); font-size: 13px;">'.$subcat1.'</b><br><br>
<i class="fas fa-clock"></i>
<b style="color: rgb(140, 140, 140);; font-size: 13px; margin-left:10px; margin-top:15px;">'.$date1.'</b><br><br>
<b>'.$ques1.'</b><br><br>';
if($number_replies>0){
echo '<b style="color: green;">Answered By :</b><br><br>';
for($k=0;$k<$number_replies;$k++){
echo '<b><i class="fas fa-user-tie" style="font-size: 20px;color: rgb(187, 2, 2); margin-top: 20px;"></i>
<b style="color: rgb(187, 2, 2);">'.$replyauthor[$k].'</b>
<i class="fas fa-clock" style="margin-left:50px"></i><b style="color: rgb(140, 140, 140); font-size: 13px; margin-left:10px; margin-top:15px;">'.$replydateposted[$k];
if($_SESSION["name"]==$replyauthor[$k]){
echo '<a href="deletreply.php?id='.$replyid[$k].'"><i class="fas fa-trash-alt" style="font-size: 20px;color: red; margin-left:70px; cursor:pointer;"></i></a>';
}
echo '</b><br><br>'.$replycontent[$k].'<br><br><br>';
echo '<a href="likedis.php?like='.$replyid[$k].'" style="color:blue;"><i class="fas fa-thumbs-up" style="font-size:22px;"></i></a>
<b>'.$replylikes[$k].'</b>
<a href="likedis.php?dislike='.$replyid[$k].'" style="color:red;"><i class="fas fa-thumbs-down" style="font-size:22px;"></i></a>
<b>'.$replydislikes[$k].'</b><br><br><br>';
}
}
else{
echo '<b style="color:red; text-align:center;">No Answers Yet....</b><br><br><br>';
}
/*echo '<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>';*/
echo '<b style="color: Blue">Put Your Answer :</b><br><br>
<form action="submitans.php?id='.$p.'" method="POST">
<i class="fas fa-user-tie" style="font-size: 20px;color: rgb(187, 2, 2); margin-left: 20px; margin-top: 20px;"></i>
<b style="color: rgb(187, 2, 2);">'.$_SESSION["name"].'</b><br><br>
<input type="text" name="answer" placeholder="Answer" style="width:500px; height:35px; font-size:18px; padding-left:20px; padding-top:10px; cursor:text;"><br>
<input type="submit" name="postanswer" value="POST" style="background-color:green; color:white; width:50px; height:25px; cursor:pointer;">
</form>';
echo '</div><br><br>';
}
}
?>
</div>
<div class="emebox">
<div class="emequestions"><b style="color: red;">Emergency</b></div><br>
<?php
$emequesres1 = mysqli_query($link, "select * from emequery");
for ($emequesset1 = array (); $emequesrow1 = mysqli_fetch_assoc($emequesres1); $emequesset1[] = $emequesrow1['emequery_id']);
for($m=count($emequesset1)-1;$m>=0;$m=$m-1){
$p = $emequesset1[$m];
emequestion($p);
emereplies($p);
$emenumber_replies = count($emereplyid);
echo '<div class="emequestions" style="display: -webkit-box;">
<i class="fas fa-user-tie" style="font-size: 20px;color: rgb(187, 2, 2); margin-top: 20px;"></i>
<b style="color: rgb(187, 2, 2);">'.$author9.'</b><br><br>
<i class="fas fa-clock"></i>
<b style="color: rgb(140, 140, 140);; font-size: 13px; margin-left:10px; margin-top:15px;">'.$date9.'</b><br><br>
<b>'.$ques9.'</b><br><br>';
if($emenumber_replies>0){
echo '<b style="color: green;">Answered By :</b><br><br>';
for($k=0;$k<$emenumber_replies;$k++){
echo '<b><i class="fas fa-user-tie" style="font-size: 20px;color: rgb(187, 2, 2); margin-top: 20px;margin-left:20px;"></i>
<b style="color: rgb(187, 2, 2);">'.$emereplyauthor[$k].'</b>
<i class="fas fa-clock" style="margin-left:50px"></i>
<b style="color: rgb(140, 140, 140); font-size: 13px; margin-left:10px; margin-top:15px;">'.$emereplydateposted[$k].'</b><br><br>'.$emereplycontent[$k].'<br><br><br>';
}
}
else{
echo '<b style="color:red; text-align:center;">No Answers Yet....</b><br><br><br>';
}
echo '<b style="color: Blue">Put Your Answer :</b><br><br>
<form action="emergency_reply.php?id='.$p.'" method="POST">
<i class="fas fa-user-tie" style="font-size: 20px;color: rgb(187, 2, 2); margin-top: 20px;"></i>
<b style="color: rgb(187, 2, 2);">'.$_SESSION["name"].'</b><br><br>
<input type="text" name="emereply" placeholder="Answer" style="width:250px; height:35px; font-size:18px; padding-left: 20px; padding-top:10px; cursor:text;"><br>
<input type="submit" name="postemereply" value="POST" style="background-color:green; color:white; width:50px; height:25px; cursor:pointer;">
</form>';
echo '</b></div><br>';
}
?>
</div>
<div id="categorylist" onmouseover="showCategory()" onmouseout="fadeCategory()">
<ul class="catagoryul">
<a href="Welcome2.php?Cat=1"><li><b>FootBall</b></li></a>
<a href="Welcome2.php?Cat=2"><li><b>Cricket</b></li></a>
<a href="Welcome2.php?Cat=3"><li><b>BasketBall</b></li></a>
<a href="Welcome2.php?Cat=4"><li><b>Hockey</b></li></a>
<a href="Welcome2.php?Cat=5"><li><b>Athletics</b></li></a>
<a href="Welcome2.php?Cat=6"><li><b>VolleyBall</b></li></a>
<a href="Welcome2.php?Cat=7"><li><b>Skating</b></li></a>
<a href="Welcome2.php?Cat=8"><li><b>Gym</b></li></a>
<a href="Welcome2.php?Cat=9"><li><b>Dramatics</b></li></a>
<a href="Welcome2.php?Cat=10"><li><b>Garbha Dance</b></li></a>
<a href="Welcome2.php?Cat=11"><li><b>Western Dance</b></li></a>
<a href="Welcome2.php?Cat=12"><li><b>Arts</b></li></a>
<a href="Welcome2.php?Cat=13"><li><b>Bhangda</b></li></a>
<a href="Welcome2.php?Cat=14"><li><b>Music</b></li></a>
<a href="Welcome2.php?Cat=15"><li><b>Computer Club</b></li></a>
<a href="Welcome2.php?Cat=16"><li><b>Robotics</b></li></a>
<a href="Welcome2.php?Cat=17"><li><b>Aero Club</b></li></a>
<a href="Welcome2.php?Cat=18"><li><b>CSE</b></li></a>
<a href="Welcome2.php?Cat=19"><li><b>IT</b></li></a>
<a href="Welcome2.php?Cat=20"><li><b>Mechanical</b></li></a>
<a href="Welcome2.php?Cat=21"><li><b>Electrical</b></li></a>
<a href="Welcome2.php?Cat=22"><li><b>Biotechnlogy</b></li></a>
<a href="Welcome2.php?Cat=23"><li><b>Civil</b></li></a>
</ul>
</div>
</div>
</body>
<script src="./js/functions.js"></script>
</html>