-
Notifications
You must be signed in to change notification settings - Fork 29
/
Copy pathedit_assigned.php
executable file
·85 lines (80 loc) · 2.56 KB
/
edit_assigned.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
<?php
require_once 'core/init.php';
if(!loggedIn()){
die();
}
if(!Input::exists('get') || Input::get('id')=='' || Input::get('cid')=='' || Input::get('did')=='' || Input::get('cs')==''){
die();
}
else{
$c = new Course();
$course = $c->getAppointedInfo(Input::get('id'), Input::get('cid'), Input::get('did'), Input::get('cs'));
?>
<script type="text/javascript" src="js/jquery.form.js"></script>
<script type="text/javascript" src="js/edit_assigned.js"></script>
<form id="edit_assigned" method="post">
<legend>Edit Details</legend>
<table class="table table-bordered table-striped">
<tbody>
<tr>
<th>Course Code</th>
<td><input type='hidden' name='course_code' value='<?php echo Input::get('cid'); ?>'><?php echo Input::get('cid'); ?></td>
</tr>
<tr>
<th>Course Name</th>
<td>
<?php
$cc = new Course();
$cc->getInfobyId($course->course_code);
echo $cc->getCourseName();
unset($cc);
?>
</td>
</tr>
<tr>
<th>Department</th>
<td>
<input type="hidden" name="id" value="<?php echo Input::get('id'); ?>">
<input type="hidden" name="department" value="<?php echo Input::get('did'); ?>">
<?php
$dd = new Department();
$dd->getInfo(Input::get('did'));
echo $dd->getDepName();
?>
</td>
</tr>
<tr>
<th>Semester</th>
<td><input type="hidden" name="semester" value="<?php echo Input::get('cs'); ?>"><?php echo Input::get('cs'); ?></td>
</tr>
<tr>
<th>Appointed Teacher</th>
<td>
<select name="teacher" class="box dept_input">
<option value="" selected>Teacher</option>
<?php
$t = new Teacher();
$tt = $t->getAllTeachers();
while($teacher = $tt->fetch_object()){
?>
<option value="<?php echo $teacher->teacher_id ?>" <?php echo (($course->teacher_id==$teacher->teacher_id)?'selected':''); ?>><?php echo $teacher->name; ?></option>
<?php
}
?>
</select>
</td>
</tr>
<tr>
<td>
<input type="submit" value=" Save " class="btn btn-success" name = "submit" />
</td>
<td>
<input type="button" class="btn btn-danger" value="Cancel" onClick="save_edit_a()"; />
</td>
</tr>
</tbody>
</table>
</form>
<?php
}
?>