-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathclass.php
More file actions
258 lines (203 loc) · 13.7 KB
/
class.php
File metadata and controls
258 lines (203 loc) · 13.7 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
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
<?php
$get_id = $_GET['id'];
include('header.php');
include ('session.php');
$user_query = mysql_query("select * from teacher where teacher_id='$session_id'") or die(mysql_error());
$user_row = mysql_fetch_array($user_query);
$course_query = mysql_query("select * from class where teacher_id='$session_id' and class_id='$get_id'") or die(mysql_error());
$course_row = mysql_fetch_array($course_query);
$course_id = $course_row['course_id'];
?>
<?php
$query_class = mysql_query("select * from class where teacher_id='$session_id' and class_id='$get_id'") or die(mysql_error());
$row_class = mysql_fetch_array($query_class);
$id_class = $row_class['class_id'];
?>
<body>
<?php include('navhead_user.php'); ?>
<div class="container">
<div class="row-fluid">
<div class="span3">
<div class="hero-unit-3">
<div class="alert-index alert-success">
<i class="icon-calendar icon-large"></i>
<?php
$Today = date('y:m:d');
$new = date('l, F d, Y', strtotime($Today));
echo $new;
?>
</div>
</div>
<div class="hero-unit-1">
<ul class="nav nav-pills nav-stacked">
<li class="nav-header">Links</li>
<li>
<a href="teacher_home.php"><i class="icon-home icon-large"></i> Home
<div class="pull-right">
<i class="icon-double-angle-right icon-large"></i>
</div>
</a>
</li>
<li class="active">
<a href="teacher_class.php"><i class="icon-group icon-large"></i> Class
<div class="pull-right">
<i class="icon-double-angle-right icon-large"></i>
</div>
</a></li>
<li><a href="teacher_subject.php"><i class="icon-file-alt icon-large"></i> Subjects
<div class="pull-right">
<i class="icon-double-angle-right icon-large"></i>
</div>
</a></li>
<li><a href="students.php"><i class="icon-group icon-large"></i> Students
<div class="pull-right">
<i class="icon-double-angle-right icon-large"></i>
</div>
</a></li>
</ul>
</div>
</div>
<div class="span9">
<a href="" class="btn btn-success"><i class="icon-group icon-large"></i> <?php echo $course_row['course_id']; ?></a>
<br><br>
<div class="alert alert-success">
<strong>Subject: <?php echo $course_row['subject_id']; ?></strong>
</div>
<div class="hero-unit-3">
<div class="alert alert-info">
<button type="button" class="close" data-dismiss="alert">×</button>
<strong><i class="icon-user icon-large"></i> Students</strong>
</div>
<div class="row-fluid">
<div class="span7">
<table cellpadding="0" cellspacing="0" border="0" class="table table-striped table-bordered" id="example">
<a href="add_student.php<?php echo '?id=' . $id_class; ?>" class="btn btn-info"><i class="icon-plus-sign-alt icon-large"></i> Add Student</a>
<br><br>
<thead>
<tr>
<th>Photo</th>
<th>Name</th>
<th>Action</th>
</tr>
</thead>
<tbody>
<?php
$query = mysql_query("select * from sws where cys = '$course_id' and class_id='$get_id'") or die(mysql_error());
while ($row = mysql_fetch_array($query)) {
$id = $row['sws_id'];
$student_id = $row['student_id'];
$student_query = mysql_query("select * from student where student_id='$student_id'") or die(mysql_error());
$student_row = mysql_fetch_array($student_query);
?>
<tr class="odd gradeX">
<!-- script -->
<script type="text/javascript">
$(document).ready(function(){
$('#e<?php echo $student_id; ?>').tooltip('show')
$('#e<?php echo $student_id; ?>').tooltip('hide')
});
</script>
<script type="text/javascript">
$(document).ready(function(){
$('#d<?php echo $student_id; ?>').tooltip('show')
$('#d<?php echo $student_id; ?>').tooltip('hide')
});
</script>
<!-- end script -->
<td width="50"><img class="img-rounded" src="<?php echo $student_row['location']; ?>" height="50" width="50"></td>
<td><a href=""> <i class="icon-user icon-large"></i> <?php echo $student_row['firstname'] . " " . $student_row['lastname']; ?></a></td>
<td width="50">
<a rel="tooltip" title="Delete Student" id="d<?php echo $student_id; ?>" href="#delete<?php echo $student_id; ?>" role="button" data-toggle="modal" class="btn btn-danger"><i class="icon-trash icon-large"></i></a>
</td>
<!-- user delete modal -->
<!-- delete file modal -->
<div id="delete<?php echo $student_id; ?>" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-header">
</div>
<div class="modal-body">
<div class="alert alert-danger">Are you Sure you Want to <strong>Delete</strong> This Student?</div>
</div>
<div class="modal-footer">
<form method="post" action="delete_student1.php">
<input type="hidden" name="id" value="<?php echo $id; ?>">
<input type="hidden" name="class_id" value="<?php echo $id_class; ?>">
<button class="btn" data-dismiss="modal" aria-hidden="true"><i class="icon-remove icon-large"></i> Close</button>
<button class="btn btn-danger"><i class="icon-trash icon-large"></i> Delete</button>
</form>
</div>
</div>
<!-- end delete modal -->
<!-- end delete modal -->
</tr>
<?php } ?>
</tbody>
</table>
</div>
<div class="span5">
<a href="upload.php<?php echo '?id=' . $id_class; ?>" class="btn"><i class="icon-upload"></i> Upload A File</a>
<br><br>
<div class="alert alert-info"><i class="icon-file icon-large"></i> Uploaded Files</div>
<table class="table table-bordered">
<thead>
<tr>
<th>Name</th>
<th>Action</th>
</tr>
</thead>
<tbody>
<?php
$file_query = mysql_query("select * from files where class_id='$id_class'") or die(mysql_error());
while ($file_row = mysql_fetch_array($file_query)) {
$file_id = $file_row['file_id'];
?>
<script type="text/javascript">
$(document).ready(function(){
$('#d<?php echo $file_id; ?>').tooltip('show')
$('#d<?php echo $file_id; ?>').tooltip('hide')
});
</script>
<script type="text/javascript">
$(document).ready(function(){
$('#de<?php echo $file_id; ?>').tooltip('show')
$('#de<?php echo $file_id; ?>').tooltip('hide')
});
</script>
<tr>
<td><?php echo $file_row['fname']; ?> <i class="icon-file"></i></td>
<td width="90">
<a rel="tooltip" title="Delete File" id="d<?php echo $file_id; ?>" href="#delete<?php echo $file_id; ?>" role="button" data-toggle="modal"class="btn btn-danger"><i class="icon-trash icon-large"></i></a>
<a rel="tooltip" title="Download File" id="de<?php echo $file_id; ?>" href="<?php echo $file_row['floc']; ?>" role="button" data-toggle="modal"class="btn btn-info"><i class="icon-trash icon-upload-alt"></i></a>
</td>
</tr>
<!-- delete file modal -->
<div id="delete<?php echo $file_id; ?>" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-header">
</div>
<div class="modal-body">
<div class="alert alert-danger">Are you Sure you Want to <strong>Delete</strong> This File?</div>
</div>
<div class="modal-footer">
<form method="post" action="delete_file.php">
<input type="hidden" name="file_id" value="<?php echo $file_id; ?>">
<input type="hidden" name="class_id" value="<?php echo $id_class; ?>">
<button class="btn" data-dismiss="modal" aria-hidden="true"><i class="icon-remove icon-large"></i> Close</button>
<button class="btn btn-danger"><i class="icon-trash icon-large"></i> Delete</button>
</form>
</div>
</div>
<!-- end delete modal -->
<?php } ?>
</tbody>
</table>
</div>
</div>
<!-- end slider -->
</div>
</div>
</div>
<?php include('footer.php'); ?>
</div>
</div>
</div>
</body>
</html>