-
Notifications
You must be signed in to change notification settings - Fork 18
/
student_details.php
113 lines (103 loc) · 3.38 KB
/
student_details.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
<?php
include 'config.php';
session_name("staff");
session_start();
// Check if the user is logged in, otherwise redirect to login page
if(!isset($_SESSION["loggedin"]) || $_SESSION["loggedin"] !== true){
header("location: staff_login.php");
exit;
}
$backlog=$_POST['backlogs'];
$cgpa=$_POST['cgpa'];
$company=$_POST['company'];
$sql = "select * from marks where cgpa >= '$cgpa' and backlogs <='$backlog'";
$query = "INSERT into company(companyname) values('$company')";
$_SESSION["cgpa"] = $cgpa;
$_SESSION["backlog"] = $backlog;
$_SESSION["company"]=$company;
$result = ($conn->query($sql));
$query2="select * from company where companyname='$company'";
$result2 = ($conn->query($query2));
$count=0;
if($result2->num_rows >0){
$count+=1;
}
else{
$result3=($conn->query($query));
}
//declare array to store the data of database
$row = [];
if ($result->num_rows > 0)
{
// fetch all data from db into array
$row = $result->fetch_all(MYSQLI_ASSOC);
}
?>
<!DOCTYPE html>
<html>
<head>
<link type="text/css" rel="stylesheet" href="stylesheet.css">
<style>
td,th {
border: 1px solid black;
padding: 10px;
margin: 5px;
text-align: center;
}
</style>
</head>
<body style="background: color #959595;">
<p style="text-align:right;">
<a href="staff_logout.php" class="button" align='right'><img src="signout.jpg" alt="signout" width="20" height="20"></a>
</p>
<table border='3' cellspacing="0" align="center" style="background: color #757575;">
<thead>
<tr>
<th>Company</th>
<th>Regdno</th>
<th>Name</th>
<th>Contact</th>
<th>Email</th>
<th>D.O.B</th>
<th>backlogs</th>
<th>cgpa</th>
</tr>
</thead>
<tbody>
<?php
if(!empty($row))
foreach($row as $rows)
{
?>
<tr>
<td><?php echo $company; ?></td>
<td><?php echo $rows['regdno'];
$n=$rows['regdno'];
$sql1="select * from student where regdno='$n'";
$result1 = ($conn->query($sql1));
$row1 = [];
if ($result->num_rows > 0)
{
// fetch all data from db into array
$row1 = $result->fetch_all(MYSQLI_ASSOC);
}
while($rows1=$result1->fetch_assoc())
{
?></td>
<td><?php echo $rows1['name']; ?></td>
<td><?php echo $rows1['contact'] ?></td>
<td><?php echo $rows1['email'] ?></td>
<td><?php echo $rows1['dob'] ?></td>
<?php } ?>
<td><?php echo $rows['backlogs']; ?></td>
<td><?php echo $rows['cgpa']; ?></td>
</tr>
<?php } ?>
</tbody>
</table>
<p style="text-align:center;"><a href="generatefile.php" class="button"><img src="download.jpg" alt="download" width="200" height="200"></a></p>
</body>
</html>
<?php
mysqli_close($conn);
?>