-
Notifications
You must be signed in to change notification settings - Fork 0
/
managestudents.php
126 lines (99 loc) · 4.25 KB
/
managestudents.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
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>College Admin</title>
<!-- CSS -->
<link href="style/css/transdmin.css" rel="stylesheet" type="text/css" media="screen" />
<!--[if IE 6]><link rel="stylesheet" type="text/css" media="screen" href="style/css/ie6.css" /><![endif]-->
<!--[if IE 7]><link rel="stylesheet" type="text/css" media="screen" href="style/css/ie7.css" /><![endif]-->
<!-- JavaScripts-->
<script type="text/javascript" src="style/js/jquery.js"></script>
<script type="text/javascript" src="style/js/jNice.js"></script>
</head>
<?php
session_start(); //starts the session
if($_SESSION['user']){ //checks if user is logged in
}
else{
header("location:index.php"); // redirects if user is not logged in
}
$user = $_SESSION['user']; //assigns user value
?>
<body>
<div id="wrapper">
<!-- h1 tag stays for the logo, you can use the a tag for linking the index page -->
<h1>Student Attendance Management System</h1>
<!-- You can name the links with lowercase, they will be transformed to uppercase by CSS, we prefered to name them with uppercase to have the same effect with disabled stylesheet -->
<ul id="mainNav">
<li><a href="facultysection.php">Faculty Users</a></li>
<li><a href="addteachers.php">Teacher Section</a></li>
<li><a href="studentsection.php">Student Section</a></li>
<li><a href="manageAttendance.php">Attendance Section</a></li>
<li class="logout"><a href="logout.php">LOGOUT</a></li>
</ul>
<!-- // #end mainNav -->
<div id="containerHolder">
<div id="container">
<div id="sidebar">
<ul class="sideNav">
<li><a href="studentsection.php" >Add Students</a></li>
<li><a href="managestudents.php" class="active" >Manage Students</a></li>
</ul>
<!-- // .sideNav -->
</div>
<!-- // #sidebar -->
<!-- h2 stays for breadcrumbs -->
<h3 align="center">Student Section: Add Student</h3>
<div id="main">
</br>
<div class="panel-body">
<div class="table-responsive">
<table class="table1" border="1px" width="100%">
<tr>
<th align="center">Id</th>
<th align="center">Student Name</th>
<th align="center">Student Id</th>
<th align="center">Student Faculty</th>
<th align="center">Student Semester</th>
<th align="center">Student Roll No</th>
<th align="center">Delete</th>
</tr>
</br>
<?php
mysql_connect("localhost", "root","") or die(mysql_error()); //Connect to server
mysql_select_db("student_attendence_management_system") or die("Cannot connect to database"); //connect to database
$query = mysql_query("Select * from students_info"); // SQL Query
while($row = mysql_fetch_array($query))
{
Print "<tr>";
Print '<td align="center">'. $row['id'] . "</td>";
Print '<td align="center">'. $row['student_name'] . "</td>";
Print '<td align="center">'. $row['student_id'] . "</td>";
Print '<td align="center">'. $row['student_faculty_name'] . "</td>";
Print '<td align="center">'. $row['student_semester'] . "</td>";
Print '<td align="center">'. $row['student_roll_number'] . "</td>";
Print '<td align="center"><a href="#" onclick="myAddSubCatFunction('.$row['id'].')">Delete</a> </td>';
Print "</tr>";
}
?>
</table>
</div>
</div>
</div>
<!-- // #main -->
<div class="clear"></div>
</div>
<!-- // #container -->
</div>
<!-- // #containerHolder -->
</div>
<!-- // #wrapper -->
<script>
function myAddSubCatFunction(id)
{
window.location.assign("delete_student.php?id=" + id);
}
</script>
</body>
</html>