-
Notifications
You must be signed in to change notification settings - Fork 0
/
getdr.php
85 lines (67 loc) · 2.75 KB
/
getdr.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 'connection.php';
$c9to10=0;
$c8to9=0;
$c7to8=0;
$cblow7=0;
$ayear=$_GET['ayear'];
$degree=$_GET['degree'];
$dept=$_GET['dept'];
$sql = "select fname,sum((rfeed+ifeed+pfeed+afeed+sfeed+crfeed+bfeed+ffeed+cofeed+vfeed)/10)/count(fname) from feedback where ayear='".$ayear."' and degree='".$degree."' and dept='".$dept."' group by fname";
//$sql = "select fname,((sum((rfeed+ifeed+pfeed+afeed+sfeed+crfeed+bfeed+ffeed+cofeed+vfeed)/10))/count(fname)) from feedback where ayear='2018' and degree='BE' and dept='ECE' group by fname";
$result1 = mysqli_query($con, $sql);
while($row1 = mysqli_fetch_array($result1)) {
$sql2="select fname,((sum((rfeed+ifeed+pfeed+afeed+sfeed+crfeed+bfeed+ffeed+cofeed+vfeed)/10))/count(fname)) from feedback1 where ayear='".$ayear."' and degree='".$degree."' and dept='".$dept."' and fname='".$row1[0]."'";
$result2 = mysqli_query($con, $sql2);
if(mysqli_num_rows($result2) > 0){
if($row2 = mysqli_fetch_array($result2)){
if($row2[1]>0&&$row1[1]>0)
{
$tot=($row1[1]+$row2[1])/2;
}else if($row1[1]>0){
$tot=$row1[1];
}else{
$tot=$row2[1];
}
// echo $row1[0]." ".$tot;
if($tot>=9)
{
$c9to10++;
}else if($tot>8&&$tot<9)
{
$c8to9++;
}
else if($tot>7&&$tot<8)
{
$c7to8++;
}else{
$cblow7++;
}
}
}
$result2=null;
}
$sql22="select fname,((sum((rfeed+ifeed+pfeed+afeed+sfeed+crfeed+bfeed+ffeed+cofeed+vfeed)/10))/count(fname)) from feedback1 where ayear='".$ayear."' and degree='".$degree."' and dept='".$dept."' and fname not in (select fname from feedback where ayear='".$ayear."' and degree='".$degree."' and dept='".$dept."' group by fname) group by fname;";
$result22 = mysqli_query($con, $sql22);
while($row22 = mysqli_fetch_array($result22)){
$tot=$row22[1];
// echo $row1[0]." ".$tot;
if($tot>=9)
{
$c9to10++;
}else if($tot>8&&$tot<9)
{
$c8to9++;
}
else if($tot>7&&$tot<8)
{
$c7to8++;
}else{
$cblow7++;
}
}
// echo $c9to10."<br>";
// echo $c8to9."<br>";
// echo $c7to8."<br>";
// echo $cblow7."<br>";
echo "{\"c9to10\":".$c9to10.",\"c8to9\":".$c8to9.",\"c7to8\":".$c7to8.",\"cblow7\":".$cblow7."}";