-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnavigator.php
44 lines (34 loc) · 1.05 KB
/
navigator.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
<?php
include 'dumbphp/DBconnectPS.php';
session_start();
if (!isset($_SESSION['staffid'])) {
header("Location:index.php");
}
//echo $_SESSION['role'] . "<br>";
$f = $_SESSION['departmentid'];
$cc = "select * from departments where id='$f'";
$d = mysql_query($cc);
$w = mysql_fetch_array($d);
$deptname = $w['departmentname'];
echo $deptname;
$_SESSION['department'] = $deptname;
$jobdetail = $_SESSION['jobdetailid'];
$q = mysql_query("select jobtitle from jobdetail where sn='$jobdetail'");
$as = mysql_fetch_array($q);
$jobdetail = $as['jobtitle'];
$_SESSION['jobdetail'] = $jobdetail;
if ($deptname === "Procurement") {
if ($_SESSION['role'] === "Team lead") {
header("Location:procurement.php");
} else {
header("Location:http://");
}
} elseif ($deptname === "Pharmacy") {
header("Location:SIC.php");
} elseif ($deptname === "Business-Development") {
if ($jobdetail === "Call Centre") {
header("Location:callcentre.php");
}
} elseif($deptname === "Administrative"){
header("Location:administrator.php");
}