-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathTabMenu.php
More file actions
93 lines (93 loc) · 4.26 KB
/
Copy pathTabMenu.php
File metadata and controls
93 lines (93 loc) · 4.26 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
<div id="accordion">
<div class="container bg-white px-0" style="line-height: 0.5 !important;" `>
<ul class="nav nav-tabs" role="tablist">
<li class="nav-item bg-light">
<a class="nav-link active font-weight-bold text-info" data-toggle="collapse" href="#active_tab">Popular</a>
</li>
<li class="nav-item bg-light">
<a class="nav-link font-weight-bold text-info" data-toggle="collapse" href="#new_tab">New</a>
</li>
<li class="nav-item bg-light">
<a class="nav-link font-weight-bold text-success" data-toggle="collapse" href="#unanswered_tab">Unanswered</a>
</li>
</ul>
<div class="tab-content">
<div id="active_tab" class="container collapse" data-parent="#accordion"><br>
<div class="container">
<div >
<?php $liked=MySQLrequests::getPopularPost();
foreach ($liked as $post) {
$post_creator=MySQLrequests::getPostCreatorByPostID($post["post_creator"]);
?>
<div class="row border-bottom border-gray">
<div class="col">
<h5 class="row">
<form name="title" action="index.php" method="post">
<input type="hidden" name="post_id" value="<?=$post["post_id"]?>">
<button type="submit" class="notButton"><?=$post["post_title"]?></button>
</form>
</h5>
<div class="my-1 text-muted small row">
<p class="m-0">
<strong class="text-gray-dark"> From: <?=$post_creator["user_name"]?><span style="color: green;"> Answers: <?=$post["post_nb_answers"]?> </span><span style="color: blue;">Likes: <?=$post["post_nb_likes"]?></span> Posted: <?=$post["post_creation_time"]?></strong>
</p>
</div>
</div>
</div>
<?php
} ?>
</div>
</div>
</div>
<div id="new_tab" class="container collapse" data-parent="#accordion"><br>
<div class="container">
<div>
<?php $newest=MySQLrequests::getNewestPost();
foreach ($newest as $post) {
$post_creator=MySQLrequests::getPostCreatorByPostID($post["post_creator"]);
?>
<div class="row border-bottom border-gray">
<div class="col">
<h5 class="row">
<form name="title" action="index.php" method="post">
<input type="hidden" name="post_id" value="<?=$post["post_id"]?>">
<button type="submit" class="notButton"><?=$post["post_title"]?></button>
</form>
</h5>
<div class="my-1 text-muted row">
<p class="small m-0">
<strong class="d-block text-gray-dark"> From: <?=$post_creator["user_name"]?><span style="color: green;"> Answers: <?=$post["post_nb_answers"]?> </span><span style="color: blue;">Likes: <?=$post["post_nb_likes"]?></span> Posted:<?=$post["post_creation_time"]?></strong>
</p>
</div></div>
</div>
<?php } ?>
</div>
</div>
</div>
<div id="unanswered_tab" class="container collapse" data-parent="#accordion"><br>
<div class="container">
<div>
<?php $unpopular=MySQLrequests::getUnpopularPost();
foreach ($unpopular as $post) {
$post_creator=MySQLrequests::getPostCreatorByPostID($post["post_creator"]);
?>
<div class="row border-bottom border-gray"><div class="col">
<h5 class="row">
<form name="title" action="index.php" method="post">
<input type="hidden" name="post_id" value="<?=$post["post_id"]?>">
<button type="submit" class="notButton"><?=$post["post_title"]?></button>
</form>
</h5>
<div class="my-1 text-muted row">
<p class="small m-0">
<strong class="d-block text-gray-dark"> From: <?=$post_creator["user_name"]?><span style="color: green;"> Answers: <?=$post["post_nb_answers"]?> </span><span style="color: blue;">Likes: <?=$post["post_nb_likes"]?></span> Posted: <?=$post["post_creation_time"]?></strong>
</p>
</div></div>
</div>
<?php } ?>
</div>
</div>
</div>
</div>
</div>
</div>