-
Notifications
You must be signed in to change notification settings - Fork 1
/
students.php
90 lines (80 loc) · 2.81 KB
/
students.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
<?php
session_start();
if(!isset($_SESSION['login']))
{
header("location:session-expired.php");
}
else
if(!(($_SESSION['login']=="teacher") || ($_SESSION['login']=="admin")))
{
header("location:session-expired.php");
}
else{
?>
<html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Students</title>
<link rel="stylesheet" href="home-style.css">
<link rel="stylesheet" href="student-list.css">
<script src="https://kit.fontawesome.com/eabac940d1.js" crossorigin="anonymous"></script>
</head>
<body>
<!-----------------------------navbar--------------------------->
<div class="nav-container">
<nav class="nav-bar">
<span class="logo" > SVHSS</span>
<div class="links">
<a href="index.php" class="link-text">Home</a>
<a href="logout.php" class="link-text">logout</a>
<a href="index.php#contact" class="link-text">contact</a>
</div>
</nav>
</div>
<!-- ------------------main section---------------- -->
<main id="main-container">
<div class="student-container">
<h1>STUDENTS</h1>
<p class="add-btn-container">
<a href="student-registration.php">
<button class="add-btn"><i class="fa-sharp fa-solid fa-plus"></i>  Add Student</button>
</a>
</p>
<div class="student-grid-container">
<?php
$con=mysqli_connect("localhost","root","","result_db");
if(!$con)
{
echo "could not connect";
}
$result=mysqli_query($con,"select * from student_login");
while($row=mysqli_fetch_array($result))
{
?>
<div class="student-info">
<a href="student-delete.php?r=<?php echo $row['sname'];?>" class="delete-icon">
<i class="fa-solid fa-trash-can"></i></a>
<a href="edit-result.php?s=sem_1&r=<?php echo $row['sname'];?>"> <img src="images/student-icon.png" alt="student" class="student-img"></a>
<p class="student-name"><?php echo $row['sname'];?></p>
</div>
<?php
}
?>
<div class="student-info">
<a href="student-registration.php" >
<div class="add-student">
<p>
<i class="fa-sharp fa-solid fa-plus"></i> <br> Add <br> New student
</p>
</div> </a></div>
</div>
</div>
<?php
}
?>
</main>
</body>
</html>