-
Notifications
You must be signed in to change notification settings - Fork 0
/
management.php
285 lines (284 loc) · 15.5 KB
/
management.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
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
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
<?php
require_once('panel.php');
?>
<div class="main">
<div class="main-inner">
<div class="container">
<div class="row">
<div class="span6">
<div class="widget widget-nopad">
<div class="widget-header"> <i class="icon-list-alt"></i>
<h3> สมาชิก</h3>
</div>
<div class="widget-content">
<div class="widget big-stats-container">
<div class="widget-content">
<h6>
<br>
<i class="icon-user-md"></i> รายวิชา
<i class="icon-group"></i> สมาชิก
</h6>
<div id="big_stats" class="cf">
<div class="stat"> <i class="icon-user-md"></i><h3><span>
<?php
$ch = new subjects();
echo $ch->count_all();
?></span></h3> </div>
<div class="stat"> <i class="icon-group"></i><h3><span>
<?php
$ou = new regit();
echo $ou->count_all();
?></span></h3> </div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="span6">
<div class="widget">
<div class="widget-header"> <i class="icon-bookmark"></i>
<h3>เมนูลัด</h3>
</div>
<div class="widget-content">
<br>
<div class="shortcuts">
<a href="change.php" class="shortcut">
<i class="shortcut-icon icon-list-alt"></i>
<span class="shortcut-label">เปลี่ยนรหัส</span> </a>
<a href="process/logout.php" class="shortcut">
<i class="shortcut-icon icon-list-alt"></i>
<span class="shortcut-label">ออกจากระบบ</span> </a>
<br>
</div>
</div>
</div>
</div>
<div class="span12">
<div class="widget widget-table action-table">
<div class="widget-header"> <i class="icon-th-list"></i>
<?php
if (empty($_GET['id'])) {
?>
<h3>รายวิชาของฉัน </h3>
<a href="#myModal" role="button" class="btn btn-info" data-toggle="modal">เพิ่มรายวิชา</a>
</div>
<div class="widget-content">
<table class="table table-striped table-bordered">
<thead>
<tr>
<th class="td-photos"></th>
<th><center> ชื่อวิชา </center> </th>
<th class="td-actions"> </th>
<th class="td-actions"> </th>
</tr>
</thead>
<tbody>
<?php foreach($subjectss as $subjects):?>
<tr>
<?php $id = $subjects["s_id"]; ?>
<td>
<div class="from_user left">
<img src="<?php if(empty($regit["photo"]))
{
echo "img/message_avatar0.png";
}
?>"/>
</div>
</td>
<td> <center> <?php echo escape($subjects["s_number"]); ?>
<?php echo escape($subjects["s_name"]); ?> </center></td>
<td class="td-actions">
<a href="qrcode.php?id=<?php echo escape($id); ?>" class="btn btn-small btn-invert"><i class="btn-icon-only icon-group"> เช็คชื่อ</i></a>
</td>
<td class="td-actions">
<a href="management.php?id=<?php echo escape($id); ?>" class="btn btn-small btn-invert"><i class="btn-icon-only icon-group"> รายชื่อสมาชิก</i></a>
<a href="#deletesubjects<?php echo $id; ?>" role="button" data-toggle="modal" class="btn btn-danger btn-small"><i class="btn-icon-only icon-remove"> </i></a>
<div id="deletesubjects<?php echo $id; ?>" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h3 id="myModalLabel">คุณแน่ใจหรือไม่ว่าต้องการลบผู้นำคนนี้?</h3>
</div>
<form action="process/delete.php" method="post">
<div class="modal-body pull-left">
<input type="hidden" name="idsubjects" value='<?php echo escape($id); ?>'>
<button class="btn btn-danger">ลบ</button>
<button class="btn" data-dismiss="modal" aria-hidden="true">ยกเลิก</button>
</div>
</form>
</div>
</td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
</div>
<br />
<div id="myModal" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h3 id="myModalLabel">การเพิ่มรายวิชาใหม่</h3>
</div>
<form action="process/add.php" method="post" enctype="multipart/form-data">
<div class="modal-body">
<div class="form-group">
<input name="s_number" type="text" class="form-control" required placeholder="รหัสวิชา">
</div>
<div class="form-group">
<input name="s_name" type="text" class="form-control" required placeholder="ชื่อวิชา">
</div>
</div>
<div class="modal-footer">
<button class="btn btn-primary">เพิ่ม</button>
<button class="btn" data-dismiss="modal" aria-hidden="true">ยกเลิก</button>
</div>
</form>
</div>
<?php
} else {
$regit=regit::liste_regit_subjects($_GET['id']);
?>
<h3>รายชื่อสมาชิก</h3>
<a href="#myModal" role="button" class="btn btn-info" data-toggle="modal">เพิ่มสมาชิก</a>
</div>
<div class="widget-content">
<table class="table table-striped table-bordered">
<thead>
<tr>
<th class="td-photos"></th>
<th> เลขประจำตัว </th>
<th> คำนำหน้า </th>
<th> ชื่อ </th>
<th> นามสกุล </th>
<th class="td-actions"> </th>
</tr>
</thead>
<tbody>
<?php foreach($regit as $regit):?>
<tr>
<?php $oid = $regit["o_id"]; ?>
<td>
<div class="from_user left">
<img src="<?php if(empty($regit["photo"]))
{
echo "img/message_avatar.png";
}else
{
echo escape($regit["photo"]);
}
?>"/>
</div>
</td>
<td><?php echo escape($regit["id_student"]); ?></td>
<td><?php echo escape($regit["titlename"]); ?></td>
<td><?php echo escape($regit["s_firstname"]); ?></td>
<td><?php echo escape($regit["s_lastname"]); ?></td>
<td class="td-actions"><a href="reports.php?id=<?php echo escape($oid); ?>" class="btn btn-small btn-invert"><i class="btn-icon-only icon-time"> ข้อมูล</i></a>
<a href="#deleteregit<?php echo $oid; ?>"role="button" data-toggle="modal" class="btn btn-danger btn-small"><i class="btn-icon-only icon-remove"> </i></a></td>
<div id="deleteregit<?php echo $oid; ?>" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h3 id="myModalLabel">คุณแน่ใจหรือไม่ว่าต้องการลบสมาชิกคนนี้?</h3>
</div>
<form action="process/delete.php" method="post">
<div class="modal-body pull-left">
<input type="hidden" name="o_id" value="<?php echo escape($oid); ?>">
<input type="hidden" name="subjectsid" value="<?php echo escape($_GET['id']); ?>">
<input type="hidden" name="idregit" value="<?php echo escape($oid); ?>">
<button class="btn btn-danger">ลบ</button>
<button class="btn" data-dismiss="modal" aria-hidden="true">ยกเลิก</button>
</div>
</form>
</div>
</tr>
<?php endforeach; ?>
</tbody>
</table>
</div>
<br />
<div id="myModal" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h3 id="myModalLabel">การเพิ่มสมาชิก</h3>
</div>
<form method="post" action="process/add.php" enctype="multipart/form-data">
<div class="modal-body">
<?php $Student=Student::get_list_student(); ?>
<div class="widget-content">
<table class="table table-striped table-bordered">
<thead>
<tr>
<th class="td-photos"></th>
<th> เลขประจำตัว </th>
<th> คำนำหน้า </th>
<th> ชื่อ </th>
<th> นามสกุล </th>
<th class="td-actions"> </th>
</tr>
</thead>
<tbody>
<?php foreach($Student as $Student):?>
<tr>
<?php $id_stu = $Student["id_stu"]; ?>
<td>
<div class="from_user left">
<img src="<?php if(empty($Student["photo"]))
{
echo "img/message_avatar.png";
}else
{
echo escape($Student["photo"]);
}
?>"/>
</div>
</td>
<td><?php echo escape($Student["id_student"]); ?></td>
<td><?php echo escape($Student["titlename"]); ?></td>
<td><?php echo escape($Student["s_firstname"]); ?></td>
<td><?php echo escape($Student["s_lastname"]); ?></td>
<td class="td-actions">
<form action="process/add.php" method="post" enctype="multipart/form-data">
<input name="sid" type="hidden" value=<?php echo escape($id_stu); ?> class="form-control">
<input name="id" type="hidden" value=<?php echo escape($_GET['id']); ?> class="form-control">
<button class="button btn btn-primary btn-large">เพิ่มเข้ารายวิชา</button>
</form>
</td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
</div>
</div>
</div>
</form>
</div>
<?php } ?>
</div>
</div>
</div>
</div>
<div class="extra">
<div class="extra-inner">
<div class="container">
<div class="row">
</div>
</div>
</div>
</div>
<div class="footer">
<div class="footer-inner">
<div class="container">
<div class="row">
<div class="span12"> จัดทำโดย :: <a href="https://www.facebook.com/OneVRM">นายสิทธิชัย สิริฤทธิกุลชัย </a> :: 2017
</div>
</div>
</div>
</div>
</div>
<script src="js/jquery-1.7.2.min.js"></script>
<script src="js/excanvas.min.js"></script>
<script src="js/bootstrap.js"></script>
<script src="js/base.js"></script>
</body>
</html>