-
Notifications
You must be signed in to change notification settings - Fork 0
/
perstudent1.php
167 lines (131 loc) · 5 KB
/
perstudent1.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
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
<?php
session_start();
if(isset($_SESSION['admin'])==false) {
$_SESSION['Login.Error']= "Admin login required";
header('Location: admin_log.php');
}
$con=mysqli_connect("localhost", "root", "","Elogbook")or die("cannot connect");
if (mysqli_connect_errno())
{
echo "Failed to connect to MySQL: " . mysqli_connect_error();
} ?>
<!DOCTYPE html>
<html>
<head>
<!-- Standard Meta -->
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
<!-- Site Properities -->
<title> Reports </title>
<link href='http://fonts.googleapis.com/css?family=Source+Sans+Pro:400,700|Open+Sans:300italic,400,300,700' rel='stylesheet' type='text/css'>
<link rel="stylesheet" type="text/css" href="../packaged/css/semantic.css">
<script src="jquery.js"></script>
<script src="jquery_address.js"></script>
<script src="../packaged/javascript/semantic.js"></script>
<script src="homepage.js"></script>
<link rel="stylesheet" type="text/css" href="feed.css">
<link rel="stylesheet" type="text/css" href="homepage.css">
<script src="feed.js"></script>
<script src="report.js"></script>
</head>
<body >
<div class="ui inverted page grid masthead segment" style="padding-top:30px;background-image:url(images/4.jpg)">
<div class="column">
<div class="inverted secondary pointing ui menu">
<div class="header item">RV College of Engineering</div>
<div class="right menu">
<a class="item" href="admin_menu.php">Home</a>
<div class="ui dropdown link item">
Menu
<i class="dropdown icon"></i>
<div class="menu">
<a class="item">Messages </a>
<a class="item">Timetable</a>
<a class="item">Profile</a>
<a class="item">Biotechnology</a>
<a class="item">Mechanical</a>
<a class="item">Civil</a>
</div>
</div>
<a class="item" href="admin_info.html">Information</a>
<a class="item" href="stats.html">Stats</a>
<a class="item" href="logout.php">Logout</a>
</div>
</div>
<img src="images/RV_logo.png" class="ui medium image" style="margin-bottom:6em; width:250px;font-size:1rem" >
<div class="ui hidden transition information">
<h1 class="ui inverted header">
Host a Session
</h1>
<p>Host a session for a particular lab session for the students to register for that subject.</p>
<div class="large basic inverted animated fade ui button">
<div class="visible content"> Lab session </div>
<div class="hidden content">
<a href="host_session.php">Host Now</a>
</div>
</div>
</div>
</div>
</div>
<div class="ui basic modal" id="each_student">
<div class="header">
STUDENT
</div>
<div class=" content">
<div class="left">
<i class="user icon"></i>
</div>
<div class="right">
<?php
$usn=$_POST['USN'];
$sub=$_POST['subject'];
$qry= "SELECT * FROM logbook_final where usn='$usn' and sub_name='$sub'";
$result=mysqli_query($con,$qry);
if($result) {
if(mysqli_num_rows($result) <= 0) {
echo "<p> No student details found. Please contact your admin.</p>";
}
else {
echo " <table class='ui left aligned inverted five column celled table segment'><thead><tr><th>USN</th><th>Subject</th><th>Sid</th><th>Log in</th><th>System_no</th></tr></thead><tbody>";
while ($row=mysqli_fetch_array($result))
{ echo "<tr><td>";
echo $row['USN'];
echo "</td><td>";
echo $row['sub_name'];
echo "</td><td>";
echo $row['sid'];
echo "</td><td>";
echo $row['log_in'];
echo "</td><td>";
echo $row['system_no'];
echo "</td></tr>";
}
echo "</tbody></table>";
$q="SELECT count(*) as total FROM logbook_final where usn='$usn' and sub_name='$sub'";
$result=mysqli_query($con,$q);
$data=mysqli_fetch_assoc($result);
echo "Total number of classes attended: ";
echo $data['total'];
echo "<br />";
$q="SELECT count(*) as total FROM logbook_final where sub_name='$sub'";
$result=mysqli_query($con,$q);
$data=mysqli_fetch_assoc($result);
echo "Total number of classes held: ";
echo $data['total'];
}
}
?>
<div class="actions">
<div class="two circular ui buttons">
<a href="admin_report.php">
<div class="ui positive right labeled icon button" id="gotoeach">
Close
<i class="checkmark icon"></i>
</div>
</a>
</div>
</div>
</div>
</div>
</div>