-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgroup.php
155 lines (105 loc) · 3.66 KB
/
group.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
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
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
<?php
require_once 'inc/header.php';
include_once 'inc/nav.php';
active_group();
?>
<?php
if ($_SESSION['name']=='涂正刚') {
?>
<div class="row">
<div class="col-12 col-md-6 col-lg-6">
<div class="card">
<form method="POST" novalidate="novalidate" enctype="multipart/form-data">
<?php
save_group();
?>
<?php
display_message();
?>
<div class="card-header">
<h4>Add Group</h4>
</div>
<div class="card-body">
<div class="form-group">
<label>Name</label>
<input type="text" name="group_name" class="form-control">
</div>
<div class="card-footer text-right">
<button class="btn btn-primary mr-1" name="group_btn" type="submit">Submit</button>
</div>
</form>
</div>
</div>
</div>
<div class="col-12">
<div class="card">
<div class="card-header">
<h4>Group Table</h4>
</div>
<div class="card-body">
<div class="table-responsive">
<table class="table table-striped" id="table-1">
<thead>
<tr>
<th class="text-center">
#
</th>
<th>Name</th>
<th>Status</th>
<th>Action</th>
</tr>
</thead>
<tbody>
<?php $sql=mysqli_query($con, "select * from groups order by group_id desc ");
while ($row = mysqli_fetch_assoc($sql)) {
?>
<tr>
<td>
1
</td>
<td><?php echo $row['group_name']; ?>
</td>
<td>
<?php
if ($row['state']==1) {
echo " <div class='badge badge-success badge-shadow'>Active</div>";
} else {
echo " <div class='badge badge-warning badge-shadow'>Deactive</div>";
}
?>
</td>
<td>
<?php
if ($row['state']==1) {
echo "<a href='group.php?opr=deactive&id=".$row['group_id']."'class='btn btn-outline-success' >Active</a>";
} else {
echo " <a href='group.php?opr=active&id=".$row['group_id']."'class='btn btn-outline-warning' >Deactive</a>";
}
?>
<a href="del_group.php?id=<?php echo $row['group_id'] ?>"
class="btn btn-outline-danger">Delete</a>
</td>
</tr>
<?php
}
?>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
<?php
} else {
?>
<div class="page-inner">
<h1>404</h1>
<div class="page-description">
The page you were looking for could not be found.
</div>
</div>
<?php
}
?>
<?php include_once 'inc/footer.php';