-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAttendenceReport.php
80 lines (71 loc) · 2.86 KB
/
AttendenceReport.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
<?php
$pagetitle="student Report";
include "includes/header.php"; ?>
<div class="container">
<div class="row">
<div class="templatemo-line-header" style="margin-top: 0px;" >
<div class="text-center">
<hr class="team_hr team_hr_left hr_gray"/><span class="span_blog txt_darkgrey txt_orange">Attendance Report</span>
<hr class="team_hr team_hr_right hr_gray" />
</div>
</div>
</div>
<?php
error_reporting(E_ALL ^ E_DEPRECATED);
$connect=mysql_connect("localhost","root","");
if(!$connect)
{
echo "Error".mysql_error();
}
$db=mysql_select_db("attendance_db");
if(!$db)
{
echo "Error".mysql_error();
}
?>
<div class="table-responsive">
<table class="ui celled table table table-hover">
<thead>
<tr>
<th>StudentRollNumber</th>
<th>StudentName</th>
<th>Subject</th>
<th>Program</th>
<th>Semester</th>
<th>Date</th>
<th>Percentage</th>
<th>Status</th>
</tr>
</thead>
<tbody>
<?php
$query=mysql_query("Select (Select count(*) from tbl_attendence Where Attendence='P')/ count(studentRollNumber) *100 as Percentage from tbl_attendence ");
$query3=mysql_query("Select * from tbl_attendence T inner join student_table st on st.`std roll no`=T.StudentRollNumber inner join subject_table S on T.SubjectId=S.`subject no` group by st.`std roll no` ");
while($row=mysql_fetch_array($query3))
{
echo"<tr>";
echo '<td>'. $row[1] . '</td>';
echo '<td>'. $row[6] . '</td>';
echo '<td>'. $row[16] . '</td>';
echo '<td>'. $row[13] . '</td>';
echo '<td>'. $row[14] . '</td>';
echo '<td>'. $row[4] . '</td>';
$query=mysql_query("select (select count(*) from tbl_attendence where Attendence='P' and StudentRollNumber='$row[1]' and subjectId='$row[2]')/(Select count(Attendence) from tbl_attendence where studentRollNumber='$row[1]' and subjectId='$row[2]')*100 as per from tbl_attendence where StudentRollNumber='$row[1]' and subjectId='$row[2]' group by per asc ");
while ($row2=mysql_fetch_array($query))
{
echo '<td>'. $row2[0] . '%</td>';
if($row2[0]<50)
{
echo "<td><span style='color:red;'>dropped</span></td>";
}
else
echo "<td><span style='color:green;'>Promoted</span></td>";
}
echo"</tr>";
}
?>
</tbody>
</table>
</div><!--table-responsive-->
</div><!--container-->
<?php include "includes/footer.php"; ?>