-
Notifications
You must be signed in to change notification settings - Fork 0
/
club_edit_aboutus.php
88 lines (80 loc) · 2.75 KB
/
club_edit_aboutus.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
<?php session_start(); ?>
<?php
if(!isset($_SESSION['user']) && !isset($_GET['clubId'])) { //Need to be authenticated to get to this page
header("Location: index.php");
exit();
}
$clubId = $_GET['clubId'];
$username = $_SESSION['user'];
require 'scripts/SQLUtils.php';
require 'scripts/index_utils.php';
require 'scripts/club_utils.php';
$conn = getSQLConnectionFromConfig();
$isLeader = isHeadOfClub($username, $clubId, $conn) | isAdmin($conn);
if(!$isLeader) {
header("Location: index.php");
$conn->close();
exit();
}
$clubname = getClubName($clubId, $conn);
?>
<div class="text_line">
<form><b>Club Name:</b>
<input id="club_name_in" type="text" value="<?php echo $clubname; ?>">
</form>
</div>
<div id="leaders_text_line">
<form><b>Club Leaders:</b>
<?php
if(isAdmin($conn)) {
?>
<input id="add_leader_text" list="students" name="add_leader" type="text">
<datalist id="students">
<?php
$result = $conn->query("SELECT preferred_name, last_name
FROM sgstudents.seniors_data
WHERE role = 'Student'
ORDER BY last_name");
if($result->num_rows > 0) {
while($item = $result->fetch_assoc()) {
echo '<option value="' .
$item['preferred_name'] . ' ' .
$item['last_name'] . '">';
}
} else {
echo 'SQL ERR: 0 Results';
}
?>
</datalist>
<input id="add_button" name="add_button" type="button" value="Add Leader">
<?php } ?>
<ul>
<?php
$leaders = explode(",", getLeadersForClub($clubId, $conn));
foreach($leaders as $leader) {
?>
<li><?php echo $leader; ?><?php if(isAdmin($conn)) {?><input class="X_button" type="button" value="X"><?php }?></li>
<?
}
?>
</ul>
</form>
</div>
<div class="text_line">
<p><b>Faculty Advisor:</b> <?php echo getClubAdvisor($clubId, $conn); ?></p>
</div>
<div id="club_type_line" class="text_line">
<form><b>Club Category:</b>
<?php echo getCheckedClubCategoryHTML($clubId, $conn); ?>
</form>
</div>
<div id="mission_text_line" class="text_line">
<form><b>Mission Statement:</b>
<textarea id="mission_box"><?php echo getClubMissionStatement($clubId, $conn); ?></textarea>
</form>
</div>
<div id="file_upload" class="text_line">
Drag Club Image Here!
<!--<form action="./scripts/image_uploader.php" class="dropzone" id="image_uploader">
</form>-->
</div>