-
Notifications
You must be signed in to change notification settings - Fork 7
/
student_index.php
291 lines (282 loc) · 7.06 KB
/
student_index.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
286
287
288
289
290
291
<?php
include('config_dropoff.php');
include('check_student_auth.php');
include('dropoff_classes.php');
include('dropoff_control.php');
include('display_courses.php');
include('display_submissions.php');
if ( $task != 'update_dropoff_user' || $user_updated == true ) {
$u = DOUser::getDOUser($user_id);
}
?>
<html>
<head>
<title>Drop Off Project Submission System</title>
<link rel="stylesheet" type="text/css" href="dropoff.css" />
<script src="jquery-1.11.0.min.js"></script>
<script type="text/javascript">
<!--
function checkApply(sel,rid) {
if (sel.options[sel.selectedIndex].value) {
// alert(rid);
document.status_form["change_list["+rid+"]"].checked = true;
}
}
function show_reqs() {
var str = document.submission.project_id.value;
var parts = str.split(',');
if ( parts[1] == 'true' ) {
// show text req
$("#text_req").show();
}
else {
$("#text_req").hide();
}
if ( parts[2] == 'true' ) {
// show url req
$("#url_req").show();
}
else {
$("#url_req").hide();
}
if ( parts[3] == 'true' ) {
// show file req
$("#file_req").show();
}
else {
$("#file_req").hide();
}
}
-->
</script>
<style>
#text_req {
display: none;
}
#url_req {
display: none;
}
#file_req {
display: none;
}
</style>
</head>
<body>
<h1>DropOff Student Dashboard</h1>
<?php
$logout_link = $_SESSION['PHP_SELF']."?task=logout";
?>
<a href="<?php echo $logout_link; ?>">Logout</a><br />
<p>
<?php
echo "<span style=\"color:red\">$message</span>";
?>
</p>
<!-- start enrollment form -->
<div id="leftcol">
<h3>Enroll in a Class</h3>
<form name="insert_dropoff_enrollment" method="post" action="<?php $_SERVER['PHP_SELF']; ?>">
<input type="hidden" name="task" value="insert_dropoff_enrollment" />
<table bgcolor="#aaaaaa" cellspacing="1" cellpadding="3">
<tr bgcolor="#ffffff">
<td>Student:</td>
<td>
<?php echo $_SESSION['dropoff_fn'].' '.$_SESSION['dropoff_ln']; ?>
<input type="hidden" name="user_id" value="<?php echo $user_id; ?>" />
</td>
</tr>
<tr bgcolor="#ffffff">
<td>Course to Enroll:</td>
<td>
<select name="course_id">
<?php
while( $row = mysql_fetch_array($doac) ) {
echo('<option value="'.$row['cid'].'">'.$row['course_title'].'</option>');
}
mysql_data_seek($doc,0);
?>
</select>
</td>
</tr>
<tr bgcolor="#ffffff">
<td height="27">Session of Enrollment:</td>
<input type="hidden" name="session_id" value="1" />
<td>
1</td>
</tr>
<tr bgcolor="#ffffff">
<td height="27">Enrollment Status:</td>
<td>
<select name="status">
<option value="active">Active</option>
<option value="disabled">Disabled</option>
</select>
</td>
</tr>
<tr bgcolor="#ffffff">
<td colspan="2">
<input name="submit" value="Submit" type="submit" /></td>
</tr>
</table>
</form>
</div>
<!-- end of enrollment form -->
<!-- start submission form -->
<div id="rightcol">
<h3>Submit Project</h3>
<form name="submission" method="post" action="<?php $_SERVER['PHP_SELF']; ?>" enctype="multipart/form-data">
<input type="hidden" name="task" value="insert_dropoff_submission" />
<table bgcolor="#aaaaaa" cellspacing="1" cellpadding="3">
<tr bgcolor="#ffffff">
<td>Student:</td>
<td>
<?php echo $_SESSION['dropoff_fn'].' '.$_SESSION['dropoff_ln']; ?>
<input type="hidden" name="user_id" value="<?php echo $user_id; ?>" />
</td>
</tr>
<tr bgcolor="#ffffff">
<td>Project to submit:</td>
<td>
<select name="project_id" onchange="show_reqs()">
<option value="">--Choose Project--</option>
<?php
while( list($k,$v) = each($project_options) ) {
echo( $v[0] );
}
?>
</select>
</td>
</tr>
<tr bgcolor="#ffffff">
<td height="27">Session of Enrollment:</td>
<input type="hidden" name="session_id" value="1" />
<td>
1</td>
</tr>
<tr bgcolor="#ffffff" id="text_req">
<td height="27">Submit Text:</td>
<td>
<textarea name="project_text"></textarea>
</td>
</tr>
<tr bgcolor="#ffffff" id="url_req">
<td height="27">Submit URL:</td>
<td>
<input type="text" placeholder="http://" name="project_url" />
</td>
</tr>
<tr bgcolor="#ffffff" id="file_req">
<td height="27">Submit File:</td>
<td>
<input type="file" name="project_file" />
</td>
</tr>
<tr bgcolor="#ffffff">
<td colspan="2">
<input name="submit" value="Submit" type="submit" /></td>
</tr>
</table>
</form>
</div>
<!-- end of submission form -->
<table border="1">
<tr>
<th>Project Title</th><th>Description</th><th>Submission Text</th><th>Submission Url</th><th>Submission File</th><th>Feedback</th><th>Grade</th><th>Points Earned</th><th>Submit Date</th>
</tr>
<?php echo $sub_tr; ?>
</table>
<p> </p>
<table>
<tr>
<th>Course Title</th><th>Author</th><th>Session Title</th><th>Description</th><th>Syllabus</th><th>Prerequisites</th><th>Start Date</th><th>End Date</th><th>Status</th>
</tr>
<?php echo $course_tr; ?>
</table>
<h3>Update Your Profile</h3>
<form name="insert_dropoff_user" method="post" action="<?php $_SERVER['PHP_SELF']; ?>">
<input type="hidden" name="task" value="update_dropoff_user" />
<input type="hidden" name="uid" value="<?php echo $user_id; ?>" />
<input type="hidden" name="username" value="<?php echo $u->username; ?>" />
<input type="hidden" name="status" value="<?php echo $u->status; ?>" />
<table bgcolor="#aaaaaa" cellspacing="1" cellpadding="3">
<tr bgcolor="#ffffff">
<td>Username:</td>
<td><?php echo $u->username; ?></td>
</tr>
<tr bgcolor="#ffffff">
<td>Password:</td>
<td>
<input name="password" type="password" value="" /></td>
</tr>
<tr bgcolor="#ffffff">
<td height="27">First Name:</td>
<td>
<input name="first_name" type="text" value="<?php echo $u->first_name; ?>" /></td>
</tr>
<tr bgcolor="#ffffff">
<td height="27">Last Name:</td>
<td>
<input name="last_name" type="text" value="<?php echo $u->last_name; ?>" /></td>
</tr>
<tr bgcolor="#ffffff">
<td height="27">Email Address:</td>
<td>
<input name="email_address" type="text" value="<?php echo $u->email_address; ?>" /></td>
</tr>
<tr bgcolor="#ffffff">
<td height="27">Address:</td>
<td>
<input name="address" type="text" value="<?php echo $u->address; ?>" /></td>
</tr>
<tr bgcolor="#ffffff">
<td height="27">City:</td>
<td>
<input name="city" type="text" value="<?php echo $u->city; ?>" /></td>
</tr>
<tr bgcolor="#ffffff">
<td height="27">State:</td>
<td>
<input name="state" type="text" value="<?php echo $u->state; ?>" /></td>
</tr>
<tr bgcolor="#ffffff">
<td height="27">Postal:</td>
<td>
<input name="postal_code" type="text" value="<?php echo $u->postal_code; ?>" /></td>
</tr>
<tr bgcolor="#ffffff">
<td height="27">Country:</td>
<td>
<input name="country" type="text" value="<?php echo $u->country; ?>" /></td>
</tr>
<tr bgcolor="#ffffff">
<td height="27">Notify:</td>
<td>
<?php
$nvalue[$u->notify] = ' checked="true"';
?>
Yes <input name="notify" type="radio" value="Yes"<?php echo $nvalue['Yes']; ?> />
No <input name="notify" type="radio" value="No"<?php echo $nvalue['No']; ?> />
</td>
</tr>
<tr bgcolor="#ffffff">
<td>Date of Birth:</td>
<td>
<input name="dob" type="text" value="<?php echo $u->dob; ?>" /></td>
</tr>
<tr bgcolor="#ffffff">
<td>User Type:</td>
<td>
<?php
echo $u->user_type;
?>
</td>
</tr>
<tr bgcolor="#ffffff">
<td colspan="2">
<input name="submit" value="Submit" type="submit" /></td>
</tr>
</table>
</form><!-- close dropoff_users form-->
</body>
</html>