-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathuser.php
More file actions
186 lines (135 loc) · 5.09 KB
/
user.php
File metadata and controls
186 lines (135 loc) · 5.09 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
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
<?php
require_once 'inc/header.php';
include_once 'inc/nav.php';
active_status();
$group = view_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_user();
?>
<?php
display_message();
?>
<div class="card-header">
<h4>Add Users</h4>
</div>
<div class="card-body">
<div class="form-group">
<label>Name</label>
<input type="text" name="user_name" class="form-control">
</div>
<div class="form-group">
<label>Select</label>
<select class="form-control" name="group_id">
<?php
while ($row =mysqli_fetch_assoc($group)) {
?>
<option
value="<?php echo $row['group_id'] ?>">
<?php echo $row['group_name'] ?>
</option>
<?php
}
?>
</select>
</div>
<div class="form-group">
<label>Profile Image</label>
<input type="file" name="img" class="form-control">
</div>
<div class="card-footer text-right">
<button class="btn btn-primary mr-1" name="user_btn" type="submit">Submit</button>
</div>
</form>
</div>
</div>
</div>
<div class="col-12">
<div class="card">
<div class="card-header">
<h4>Members 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>Image</th>
<th>Group</th>
<th>Status</th>
<th>Action</th>
</tr>
</thead>
<tbody>
<?php $sql=mysqli_query($con, "SELECT user.id , user.name, user.image , user.state, user.user_group , groups.group_id , groups.group_name from user INNER JOIN groups on user.user_group = groups.group_id order by user.id desc");
while ($row = mysqli_fetch_assoc($sql)) {
?>
<tr>
<td>
1
</td>
<td><?php echo $row['name']; ?>
</td>
<td>
<img alt="image"
src="img/<?php echo $row['image']; ?>"
width="35">
</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='user.php?opr=deactive&id=".$row['id']."'class='btn btn-outline-success' >Active</a>";
} else {
echo " <a href='user.php?opr=active&id=".$row['id']."'class='btn btn-outline-warning' >Deactive</a>";
}
?>
<a href="del_user.php?id=<?php echo $row['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';