-
Notifications
You must be signed in to change notification settings - Fork 3
/
member_view.php
executable file
·82 lines (80 loc) · 3.53 KB
/
member_view.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
<?php
include_once ('include_fns.php');
session_start();
$classid = -1;
if (!isset($_SESSION['email'])) {
middlepage("index.php", "请先登录");
}
if (isset($_SESSION['classid'])) {
$classid = $_SESSION['classid'];
}
if (isset($_GET['classid'])) {
$classid = safeGet('classid');
$_SESSION['classid'] = $classid;
}
if ($classid == -1) {
middlepage("classes.php", "请选择班级");
}
$email = $_SESSION['email'];
$admin = get_authority($classid, $email);
if ($admin == -1) {
middlepage("classes.php", "你不在本班级中");
}
$is_class_manager = $admin <= 1;
$members = get_members($classid);
?>
<div class="bs-callout bs-callout-info" style="vertical-align: middle">
<h4 style="display:inline-block">班级成员</h4>
</div>
<br>
<?php if ($is_class_manager) {
$notices = get_newmembernotice($classid);
foreach ($notices as $notice) {
?>
<p style="font-size:18px;display:inline-block;text-indent:1em; color:red;"><?php echo $notice['realname']."申请加入班级"?></p>
<br/>
<p style="font-size:18px;display:inline-block;text-indent:1em; color:red;"><?php echo "附言:".$notice['reason']?></p>
<br/>
<a style="text-decoration:none;" href=<?php echo "member_access.php?action=accept&¬iceid=".$notice['noticeid']?> ><button type="button" class="btn btn-danger" style="display:inline-block;float:right;width:70px">同意</button></a>
<a style="text-decoration:none;" href=<?php echo "member_access.php?noticeid=".$notice['noticeid']?>><button type="button" class="btn btn-primary" style="display:inline-block;float:right;position: relative;right:10px">拒绝</button></a>
<br/>
<hr/>
<?php
}
}
?>
<?php foreach ($members as $member) {
if ($member['useremail'] == $email) {
?>
<div style="vertical-align: middle">
<p style ="font-size:18px;display:inline-block;text-indent: 1em"><?php echo $member['realname'];
?></p>
<button type="button" class="btn btn-primary disabled" style="display:inline-block;float:right;position: relative;right:10px">自己</button>
</div>
<hr>
<?php
} else {
?>
<div style="vertical-align: middle">
<p style ="font-size:18px;display:inline-block;text-indent: 1em"><?php echo $member['realname'];
?></p>
<?php if ($admin == 0) {?>
<a style="text-decoration:none;" href=<?php echo "member_remove.php?email=".$member['useremail']?>><button type="button" class="btn btn-danger" style="display:inline-block;float:right;width:70px">踢出</button></a>
<?php if ($member['admin'] == 1) {?>
<a style="text-decoration:none;" href=<?php echo "member_manage.php?action=0&&email=".$member['useremail']?>><button type="button" class="btn btn-primary" style="display:inline-block;float:right;position: relative;right:10px">取消管理员</button></a>
<?php } else {?>
<a style="text-decoration:none;" href=<?php echo "member_manage.php?action=1&&email=".$member['useremail']?>><button type="button" class="btn btn-primary" style="display:inline-block;float:right;position: relative;right:10px">设置为管理员</button></a>
<?php }?>
<?php } else if ($admin == 1) {?>
<?php if ($member['admin'] == 2) {?>
<a style="text-decoration:none;" href=<?php echo "member_remove.php?email=".$member['useremail']?>><button type="button" class="btn btn-primary" style="display:inline-block;float:right;position: relative;right:10px">踢出</button></a>
<?php } else {?>
<button type="button" class="btn btn-primary disabled" style="display:inline-block;float:right;position: relative;right:10px">已是管理员</button>
<?php }?>
<?php }?>
</div>
<hr>
<?php
}
}
?>