-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathteacher_subject.php
More file actions
152 lines (125 loc) · 7.04 KB
/
teacher_subject.php
File metadata and controls
152 lines (125 loc) · 7.04 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
<?php
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);
?>
<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>
<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 class="active"><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="teacher_add_subject.php" class="btn btn-success"><i class="icon-plus-sign icon-large"></i> Add Subject</a>
<br>
<br>
<div class="hero-unit-3">
<table cellpadding="0" cellspacing="0" border="0" class="table table-striped table-bordered" id="example">
<div class="alert alert-info">
<button type="button" class="close" data-dismiss="alert">×</button>
<strong><i class="icon-user icon-large"></i> Subject Table</strong>
</div>
<thead>
<tr>
<th>Course Code</th>
<th>Course Description</th>
<th>Action</th>
</tr>
</thead>
<tbody>
<?php
$teacher_subject_query = mysql_query("select * from teacher_suject where teacher_id='$session_id'") or die(mysql_error());
$teacher_row = mysql_fetch_array($teacher_subject_query);
$subject_id = $teacher_row['subject_id'];
$query = mysql_query("select * from subject where subject_id = '$subject_id'") or die(mysql_error());
while ($row = mysql_fetch_array($query)) {
$id = $row['subject_id'];
?>
<!-- script -->
<script type="text/javascript">
$(document).ready(function(){
$('#d<?php echo $subject_id; ?>').tooltip('show')
$('#d<?php echo $subject_id; ?>').tooltip('hide')
});
</script>
<!-- end script -->
<!-- script -->
<script type="text/javascript">
$(document).ready(function(){
$('#e<?php echo $subject_id; ?>').tooltip('show')
$('#e<?php echo $subject_id; ?>').tooltip('hide')
});
</script>
<!-- end script -->
<tr class="odd gradeX">
<td><?php echo $row['subject_code']; ?></td>
<td><?php echo $row['subject_title']; ?></td>
<td width="50">
<a rel="tooltip" title="Delete Subject" id="d<?php echo $subject_id; ?>" href="#id<?php echo $id; ?>" role="button" data-toggle="modal" class="btn btn-danger"><i class="icon-trash icon-large"></i> </a>
</td>
<!-- user delete modal -->
<div id="id<?php echo $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 Subject?</div>
</div>
<div class="modal-footer">
<button class="btn" data-dismiss="modal" aria-hidden="true"><i class="icon-remove icon-large"></i> Close</button>
<a href="delete_teacher_course.php<?php echo '?id=' . $course_id; ?>" class="btn btn-danger"><i class="icon-trash icon-large"></i> Delete</a>
</div>
</div>
<!-- end delete modal -->
</tr>
<?php } ?>
</tbody>
</table>
<!-- end slider -->
</div>
</div>
</div>
<?php include('footer.php'); ?>
</div>
</div>
</div>
</body>
</html>