-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathparser.php
More file actions
31 lines (25 loc) · 757 Bytes
/
Copy pathparser.php
File metadata and controls
31 lines (25 loc) · 757 Bytes
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
<?php
include_once 'dbconfig.php';
session_start();
$current_user_id = $_SESSION['u_id'];
$current_user_name = $_SESSION['u_name'];
echo $current_user_name;
//Get user category and re-direct
$sql = " SELECT user_id , idno , user_level FROM users WHERE user_id = '$current_user_id' AND idno = '$current_user_name' LIMIT 1 ";
$query = mysqli_query($conn,$sql);
if (mysqli_num_rows($query) > 0) {
foreach ($query as $user) {
$user_cat = $user['user_level'];
}
// Assign dashboard
if ($user_cat == 'teacher') {//Teacher is logged in
header('location:teacher.php');
}elseif ($user_cat == 'parent') {
header('location:parent.php');
}else{
header('location:login.php');
}
}else{
header('location:login.php');
}
?>