-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathfaculty.php
53 lines (46 loc) · 1.83 KB
/
faculty.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
<link type="text/css" rel="stylesheet" href="css/home.css" />
<?php
include_once 'includes/header.php';
include_once 'includes/footer.php';
?>
<head>
<title>
User Profile
</title>
</head>
<div id="container">
<?php
if(loggedin() && isset($_SESSION['t_id'])){
$query = "SELECT * FROM `teacher` WHERE `t_id`='".mysql_real_escape_string($_SESSION['t_id'])."'";
if($query_run = mysql_query($query))
{
$user_row = mysql_fetch_assoc($query_run);
$t_id = $user_row['t_id'];
$t_name = $user_row['t_name'];
$branch = $user_row['t_branch'];
$c_id1 = $user_row['c_id1'];
$c_id2 = $user_row['c_id2'];
$c_id3 = $user_row['c_id3'];
echo '<br /><center>Teacher id: '.$t_id.'<br />
Name: '.$t_name.'<br />
Department: '.$branch.'<br />
</center>';
$query = "SELECT * FROM report WHERE `t_id`='".$t_id."' AND (`c_id`='".$c_id1."' OR `c_id`='".$c_id2."' OR `c_id`='".$c_id3."')";
$query_run = mysql_query($query);
while($user_row = mysql_fetch_assoc($query_run)){
$q1 = $user_row['q1'];
$q2 = $user_row['q2'];
$q3 = $user_row['q3'];
$q4 = $user_row['q4'];
$q5 = $user_row['q5'];
$c_id = $user_row['c_id'];
$count = $user_row['count'];
$c_av = ($q1 + $q2 + $q3 + $q4 + $q5) / 5;
echo '<center>'.$c_id.' = '.$c_av.' points No of students filled :'.$count.'</center>';
}
}
}
else{
header('Location: index.php');
}
?>