-
Notifications
You must be signed in to change notification settings - Fork 0
/
list_my_communities.php
48 lines (38 loc) · 1.03 KB
/
list_my_communities.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
<?php include('header.php');
if(!$loggedin){
$_SESSION['AlertRed'] = "You have to be logged in to do that.";
header("location:index.php");
}
?>
<div class="container">
<h2>My Communities</h2>
<p>Click the community name you want to further investigate.</p>
<table class="table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Description</th>
<th>Privacy</th>
</tr>
</thead>
<tbody>
<?php
/*Bring all communities logged in user is a member of*/
$query = "SELECT
C.CommName name,
C.ShortDesc description,
C.Privacy privacy,
C.CommID cid
FROM Comms C, UsersInComms UC
WHERE UC.UserID=".$userid." AND UC.CommID=C.CommID
ORDER BY C.CreatedOn DESC;";
foreach($db->query($query) as $row){
echo"<tr>
<td><a href='./show_community.php?comm_id=".$row['cid']."'>".$row['name']."</a></td>
<td>".$row['description']."</td>
<td>".$row['privacy']."</td>
</tr>";
}
?>
</tbody></table></div>
<?php include('footer.php');?>