-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathgroupProf.php
More file actions
102 lines (71 loc) · 2.76 KB
/
groupProf.php
File metadata and controls
102 lines (71 loc) · 2.76 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
94
95
96
97
98
99
100
101
102
<?php include('db_connect.php'); ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<LINK href="stylesheet.css" rel="stylesheet" type="text/css">
</head>
<body>
<div class="header">
<img src="logo.jpg"/>
</div>
<div class="body">
<table padding-left="5px" cellspacing="0">
<tr><td class="blank"></td>
<td class="tab4"><a href="home.php">home</a></td>
<td class="tab2"><a href="profile.php">profile</a></td>
<td class="tab3"><a href="calendar.php">calendar</a></td>
<td class="tab1">groups</td>
<td class="login"><font color="#ffffff">welcome! | </font><a href="logout.php"> logout</a></td>
</tr></table>
<table cellspacing="0"><tr>
<td class="content">
view groups | <a href="editgroup.php">edit groups</a> | <a href="creategroup.php">create a group</a> | <a href="joingroup.php">join/unjoin a group</a>
<h4>
<table>
<?php
$name = $_SESSION['username'];
$g = $_GET['group'];
$grp = (string)$g;
echo("<tr><td><h2>Group: $grp</h2>");
$query = "select groupdescription from groups WHERE groupName = '$grp'";
$result = mysqli_query($db, $query);
while($row = mysqli_fetch_array($result)){
$content = $row['groupdescription'];
echo("<h4>Description: </h4><h5>$content</h5>");
}
$query = "select name from events WHERE group_id = '$grp' AND event_date>= curdate()";
//echo($query);
$result = mysqli_query($db, $query);
while($row = mysqli_fetch_array($result)){
$content = $row['name'];
echo("<h4>Next Event: </h4><h5><a href='events.php'>$content</a></h5>");
}
$query = "select groupadmin from groups WHERE groupName = '$grp'";
$result = mysqli_query($db, $query);
while($row = mysqli_fetch_array($result)){
$content = $row['groupadmin'];
echo("<h4>Admin: </h4><h5><a href='userProf.php?user=$content'>$content</a></h5>");
}
echo("<h2>$grp's Members:</h2>");
$name = $_SESSION['username'];
$query = "SELECT u.userName, g.groupName FROM users u inner join groups
g INNER JOIN memberJunction m ON u.userName = m.userName
AND g.groupName = m.groupName WHERE m.groupName = '$grp'";
$result = mysqli_query($db, $query);
echo '<table><h5>';
while($row = mysqli_fetch_array($result)){
$content = $row['userName'];
echo("<tr><td><a href='userProf.php?user=$content'>$content</a></td>");
}
echo "</h5></table>";
echo('<br><form method="post" action="groups.php">
<input type="submit" value="Back to groups" name="Back to groups" />
</form>');
?>
</td></tr>
</h4></td></tr>
</table
</div>
</br>
</body>
</html>