-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgroup.php
More file actions
132 lines (131 loc) · 4.76 KB
/
group.php
File metadata and controls
132 lines (131 loc) · 4.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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
<!DOCTYPE HTML>
<?php
require_once 'session.php';
require_once 'account_name.php';
?>
<html lang = "eng">
<head>
<meta charset = "UTF-8">
<link rel = "stylesheet" type = "text/css" href = "css/bootstrap.css" />
<link rel = "stylesheet" type = "text/css" href = "css/jquery.dataTables.css" />
<link rel = "stylesheet" type = "text/css" href = "css/chosen.css" />
<meta name = "viewport" content = "width=device-width, initial-scale=1" />
<title>Membership System</title>
</head>
<body class = "alert-warning">
<nav class = "navbar navbar-inverse">
<div class = "container-fluid">
<div class = "navbar-header">
<a class = "navbar-brand">Membership System</a>
</div>
<ul class="nav navbar-nav navbar-right">
<li><a><span class = "glyphicon glyphicon-user"></span> <?php echo $acc_name?></a></li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">Settings <span class="caret"></span></a>
<ul class="dropdown-menu">
<li><a href="logout.php">Logout</a></li>
</ul>
</li>
</ul>
</div>
</nav>
<div class = "container-fluid">
<ul class="nav nav-pills">
<li><a href="home.php">Home</a></li>
<li><a href="account.php">Account</a></li>
<?php
if($isDev){
?>
<li><a href="member.php">Member</a></li>
<li class="active"><a href="club.php">Groups</a></li>
<?php }?>
<li><a href="token.php">Token</a></li>
<li><a href="memberpc.php">Member PC</a></li>
</ul>
<br />
<div class = "col-md-12 well">
<button type = "button" class = "btn btn-success" data-toggle="modal" data-target="#myModal"><span class = "glyphicon glyphicon-plus"></span> Add member</button>
<a class = "btn btn-success" href = "club.php"><span class = "glyphicon glyphicon-hand-right"></span> Back</a>
<br/>
<br/>
<div class = "alert alert-info">
<?php
$c_query = $conn->query("SELECT * FROM `club` WHERE `club_id` = '$_REQUEST[club_id]'") or die(mysqli_error());
$c_fetch = $c_query->fetch_array();
$club = $c_fetch['club_id'];
?>
<div class = "alert alert-success"><?php echo $c_fetch['club_name']?> / Member List</div>
<table id = "table" class = "table-bordered">
<thead>
<tr>
<th>Firstname</th>
<th>Lastname</th>
<th>Action</th>
</tr>
</thead>
<tbody>
<?php
$query = $conn->query("SELECT * FROM `group` NATURAL JOIN `member` NATURAL JOIN `club` WHERE `club_id` = '$c_fetch[club_id]'") or die(mysqli_error());
while($f_query = $query->fetch_array()){
?>
<tr>
<td><?php echo $f_query['firstname']?></td>
<td><?php echo $f_query['lastname']?></td>
<td><center><a href = "delete_group.php?group_id=<?php echo $f_query['group_id']?>&club_id=<?php echo $f_query['club_id']?>" class = "btn btn-danger"><span class = "glyphicon glyphicon-trash"></span> Remove</a></center></td>
</tr>
<?php
}
?>
</tbody>
</table>
</div>
</div>
</div>
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
<h4 class="modal-title" id="myModalLabel">Club Registration</h4>
</div>
<div class="modal-body">
<form method = "POST" enctype = "multipart/form-data">
<div class = "form-group">
<label>Member</label>
<select id = "member" class = "chosen-select">
<option value = "">Select a member</option>
<?php
$g_query = $conn->query('SELECT * FROM `member`') or die(mysqli_error());
while($g_fetch = $g_query->fetch_array()){
echo '<option value = "'.$g_fetch['mem_id'].'">'.$g_fetch['firstname'].' '.$g_fetch['lastname'].'</option>';
}
?>
</select>
<input type = "hidden" id = "club" value = "<?php echo $c_fetch['club_id']?>" />
</div>
<div id = "loading">
</div>
</div>
<div class="modal-footer">
<button type="button" id= "save_group" class="btn btn-primary"><span class = "glyphicon glyphicon-save"></span> Save</button>
</div>
</form>
</div>
</div>
</div>
<?php require_once 'group/footer.php' ?>
</body>
<script src = "js/jquery-3.1.1.js"></script>
<script src = "js/bootstrap.js"></script>
<script src = "js/chosen.jquery.js"></script>
<script src = "js/script.js"></script>
<script src = "js/jquery.dataTables.min.js"></script>
<script type = "text/javascript">
$(document).ready(function(){
$('#table').DataTable();
})
</script>
<script type = "text/javascript">
$('.chosen-select').chosen({width: "100%"});
</script>
</html>