-
Notifications
You must be signed in to change notification settings - Fork 0
/
menu.php
78 lines (76 loc) · 1.67 KB
/
menu.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
<?php
session_start();
$_POST=$_SESSION;
if($_POST["menu"]!=1)
{
die("Access Denied");
}
else
{
$_SESSION["menu"]=0;
session_write_close();
}
?>
<html>
<head><title>SISMEC</title>
<link rel="stylesheet" type="text/css" href="menu.css">
</head>
<body background ="bg.jpg">
<div id ="Wrapper">
<div id="header">
<h1>SISMEC</h1>
</div>
<?php
if($_GET ){
require_once 'dbconnect.php';
session_start();
$_SESSION["view"]=1;
$_SESSION["edit"]=1;
$_SESSION["delete"]=1;
session_write_close();
$class=$_GET["clss"];
// Create connection
$conn = new mysqli($servername, $username, $password, $dbname);
// Check connection
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
$sql = "SELECT * FROM admissions WHERE class='$class'";
$result = $conn->query($sql);
$slno=0;
if ($result->num_rows > 0) {
session_start();
$SESSION["view"]=1;
$SESSION["edit"]=1;
$SESSION["delete"]=1;
echo "<table id=\"datatables\" class=\"display\">
<tr>
<th>SL.NO</th>
<th>Roll Number</th>
<th>Name</th>
<th></th>
<th>Option</th>
<th></th>
</tr>";
// output data of each row
while($row = $result->fetch_assoc()) {
$slno++;
echo "<tr>
<td id=\"slno\">".$slno."</td>
<td>".$row["rollno"]."</td>
<td>".$row["name"]."</td>
<td><a href=\"view.php?sroll=".$row["rollno"]."\">View</a> </td>
<td><a href=\"edit.php?sroll=".$row["rollno"]."\">Edit</a> </td>
<td><a href=\"deletion.php?sroll=".$row["rollno"]."\">Delete</a> </td>
</tr>";
}
echo "</table>";
}
else {
echo("0 Records");
}
}
?>
</div>
</body>
</html>