-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfullview (1).php
139 lines (121 loc) · 3.54 KB
/
fullview (1).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
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
<?php
session_start();
include_once 'initials.php';
if(!isset($_SESSION['facultyloggedIN'])){
header('Location: index.php');
exit();
}
$connection= new mysqli($dbhost,$dbuser,$dbpass,$dbname);
$faculty_department = $_SESSION['faculty_department'];
?>
<!DOCTYPE html>
<html>
<head>
<!--Import Google Icon Font-->
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<!--Import materialize.css-->
<link type="text/css" rel="stylesheet" href="css/materialize.min.css" media="screen,projection"/>
<!--Let browser know website is optimized for mobile-->
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
</head>
<body>
<nav>
<div class="nav-wrapper pink">
<ul id="nav-mobile" class="left hide-on-med-and-down">
<li><a href="faculty_logout.php">Logout</a></li>
<li><a href="faculty_main.php">Faculty Home</a></li>
</ul>
</div>
</nav>
<div class="container">
<div class="row ">
<div class="col s12 m6 l12 ">
<div class="card white darken-1 z-depth-4">
<div class="card-image">
<img src="saraswati.png">
</div>
<div class="card-content black-text">
<span class="card-title center"><h4>Student Satisfactory Survey Report</h4></span>
<?php
$data = $connection->query("SELECT feedback.student_id,GROUP_CONCAT(answer SEPARATOR ' ') AS Answer from feedback GROUP BY student_id");
$average = $connection->query("SELECT ROUND(AVG(answer),2) AS average FROM feedback ");
while($row = $average->fetch_assoc()){
$average_all = $row['average'];
}
if ($result->num_rows >= 0) {
echo "<table class='striped'>";
echo "<thead>";
echo "<tr class='padd'>";
echo "<th>Sr No</th>";
echo "<th>Q 1</th>";
echo "<th>Q 2</th>";
echo "<th>Q 3</th> ";
echo "<th>Q 4</th> ";
echo "<th>Q 5</th> ";
echo "<th>Q 6</th> ";
echo "<th>Q 7</th> ";
echo "<th>Q 8</th> ";
echo "<th>Q 9</th> ";
echo "<th>Q 10</th>";
echo "</tr> ";
echo "</thead>";
echo " </table>";
$i = 0;
while($row = $data->fetch_assoc()){
$i++;
$answer = $row['Answer'];
$finanswer = explode(" ",$answer,11);
echo "<table>";
echo "<tbody>";
echo "<tr>";
echo '<td style=padding-left:10px> '.$i .'</td>';
echo "<td> $finanswer[0] </td>";
echo "<td> $finanswer[1] </td>";
echo "<td> $finanswer[2] </td>";
echo "<td> $finanswer[3] </td>";
echo "<td> $finanswer[4] </td>";
echo "<td> $finanswer[5] </td>";
echo "<td> $finanswer[6] </td>";
echo "<td> $finanswer[7] </td>";
echo "<td> $finanswer[8] </td>";
echo "<td> $finanswer[9] </td>";
echo "</tr>";
echo "</tbody>";
echo "</table>";
}
} else {
echo "0 results";
}
?>
<script type="text/javascript" src="js/materialize.min.js"></script>
<div class="card-action mycard1">
<span class="card-title">Student Satisfactory Survey Average</span>
<div style="margin-left:45% "><?php echo $average_all;?>
</div>
</div>
<div> <input type="button" class="btn" link media="print" href="/css/materialize.css"
value="Print this page" onClick="window.print()"></div>
</div>
</div>
</div>
</div>
</body>
<style>
.mycard1{
display: flex;
flex-direction:row;
}
td{
max-width: 10px;
}
.padd{
padding-right: 5px;
}
.container{
margin-top: 2.5%;
}
.card{
padding: 25px;
}
</style>
</html>