-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathviewsubjects.php
72 lines (67 loc) · 1.84 KB
/
viewsubjects.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
<?php
include("header.php");
if(isset($_GET[delid]))
{
$sqldel ="DELETE FROM subjects where subjectcode=$_GET[delid]";
$seldelresult = mysqli_query($con,$sqldel);
if(mysqli_affected_rows($con) == 1)
{
$delresult = "<font color=green><strong>Record deleted successfully..</strong></font>";
}
}
$selsubjects = "select subjects.*,course.coursename from subjects INNER JOIN course ON subjects.courseid=course.courseid ";
$selresult = mysqli_query($con,$selsubjects);
?>
<div class="slider_top2">
<h2>View subjects</h2>
</div>
<div class="clr"></div>
<div class="body_resize">
<div class="body">
<div class="full">
<p>
<?php
echo $delresult;
echo "<table class=tftable width=200 border=1>
<tr>
<th scope=col> Course</th>
<th scope=col> Subject code</th>
<th scope=col> Subject name</th>
<th scope=col> Rules</th>
<th scope=col> Total marks</th>
<th scope=col> Pass marks</th>
<th scope=col> Status</th>
<th scope=col> Action</th>
</tr>";
while($rs = mysqli_fetch_array($selresult))
{
echo "
<tr>
<td> $rs[coursename]</td>
<td> $rs[subjectcode]</td>
<td> $rs[subjectname]</td>
<td> $rs[rules]</td>
<td> $rs[totalmarks]</td>
<td> $rs[passmarks]</td>
<td> $rs[status]</td>
<td> <a href=subjects.php?subjectcode=$rs[subjectcode]>Edit</a> |
<a href=viewsubjects.php?delid=$rs[subjectcode]>Delete</a></td>
</tr>
";
}
?>
</table> </p>
<p> </p>
<p> </p>
</div>
<div class="right">
<?php
include("usersidebar.php");
?>
</div>
<div class="clr"></div>
</div>
</div>
<?php
include("footer.php");
?>