-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathindex.php
More file actions
144 lines (117 loc) · 3.88 KB
/
index.php
File metadata and controls
144 lines (117 loc) · 3.88 KB
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
<?php
if(session_status()!=PHP_SESSION_ACTIVE)
session_start();
if (!isset($_SESSION['user']) or $_SESSION['user']==""){
session_unset();
session_destroy();
echo "<script>location.replace('login.php');</script>";
}
?>
<!DOCTYPE html>
<html>
<head>
<title>HOME | <?php echo $_SESSION['user']['name']?></title>
<link rel="stylesheet" type="text/css" href="style/main.css">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- IMPORT FONTS -->
<link href="https://fonts.googleapis.com/css?family=Open+Sans+Condensed:300|Lato&display=swap" rel="stylesheet">
<!-- ICONS !-->
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<link rel='stylesheet' href='https://use.fontawesome.com/releases/v5.7.0/css/all.css'>
<!-- JQuery -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.0/jquery.min.js"></script>
<!-- Menu -->
<script type="text/javascript">
function ToggleNav(){
$('ul.nav').slideToggle("slow");
}
</script>
<style type="text/css">
@media screen and (min-width: 750px){
table{
min-width: 50%;
}
}
th,td>a{
display: block;
text-decoration: none;
font-family: "Open Sans Condensed";
font-size: 1.2em;
}
</style>
</head>
<body>
<script type="text/javascript">
$(function(){
$('.banner').slideDown("slow");
})
</script>
<header>
<div id="toggle"><a onclick="$('ul.nav').slideToggle('slow');"><i class="material-icons" style="font-size:1.5em;color:#fff">menu</i></a></div>
<div class="profile">
<img src="prof-pic/<?php echo $_SESSION['user']['username'];?>.png" onerror="this.src='prof-pic/default.png';" class="prof-pic">
<div class="prof-name"><?php echo $_SESSION['user']['name']; ?></div>
</div>
<ul class="nav">
<li><a href="index.php" class="selected">Home</a></li>
<li><a href="assg.php">Assignments</a></li>
<li><a href="message.php">Messages</a></li>
<li><a href="news.php">Announcements</a></li>
<li><a href="search.php">Find user</a></li>
<li><a href="profile.php">Profile</a></li>
<li><a href="logout.php">Logout</a></li>
</ul>
</header>
<div class="banner">
<i class="fas fa-exclamation-circle" style="color: #888"></i> An update to this page will be available in the next release
<span class="banner-close" onclick="$('.banner').slideUp();">×</span>
</div>
<div class="container">
<?php include "db_connect.php";
$con=Connect();
if ($_SESSION['user']['role']=='faculty'){ ?>
<table style="max-width: 50%">
<thead>
<tr>
<th>YOUR BATCHES</th>
</tr>
</thead>
<tbody>
<?php $rol=mysqli_query($con,"SELECT role from rolefac where faculty='".$_SESSION['user']['username']."'");
while ($r=mysqli_fetch_array($rol,MYSQLI_NUM)){?>
<tr>
<td><a href="search.php?id=s<?php echo $r[0]?>&by=username">> <?php echo $r[0]?></a></td>
</tr>
<?php } ?>
</tbody>
</table>
<?php }
if ($_SESSION['user']['role']=="admin") { ?>
<style>
tr{
border-bottom: none;
}
</style>
<table>
<thead>
<tr>
<th>ADMIN PANEL</th>
</tr>
</thead>
<tbody>
<tr><td><a href="admin/add.php">Add user</a></div></td></tr>
<tr><td><a href="admin/role.php">Batches Management</a></td></tr>
<tr><td><a href="admin/facrole.php">Faculty-in-Batches Management</a></td></tr>
<tr><td><a href="admin/rem.php">Remove user</a></td></tr>
<tr><td><a href="admin/chgpass.php">Reset password for user</a></td></tr>
</tbody>
</table>
<?php } ?>
</div>
<footer>
<div class="copy">© All Rights Reserved</div>
<div class="last-login"><?php echo "Last Logout: ".$_SESSION['user']['active'];?></div>
</footer>
</body>
</html>