<?php
$curPageName = substr($_SERVER["SCRIPT_NAME"],strrpos($_SERVER["SCRIPT_NAME"],"/")+1);  
?>
<?php
if($curPageName=='employee-admin-view.php' || 
$curPageName=='employee-salary-view.php' || 
$curPageName=='employee-attendace-view.php' || 
$curPageName=='designation.php' || 
$curPageName=='salary_category.php' || 
$curPageName=='department.php'){
if($role=='Admin' || $role=='HR' || $role=='Finance'){
}else{ ?>
<script type = "text/javascript">window.location = "not-authorized.php";</script>
<?php }} ?>

<?php
if($curPageName=='employee.php' || 
$curPageName=='feedback.php' || 
$curPageName=='notification.php' || 
$curPageName=='employee-salary-edit.php' || 
$curPageName=='mark-staff-attendance.php' || 
$curPageName=='add-employee.php' || 
$curPageName=='add-salary.php' || 
$curPageName=='complaint-suggestion.php' || 
$curPageName=='employee-edit.php' || 
$curPageName=='event-calendar.php' || 
$curPageName=='id-card.php' || 
$curPageName=='mark-salary.php' || 
$curPageName=='staff-attendance.php'){
if($role=='Admin' || $role=='HR'){}else{ ?>
<script type = "text/javascript">window.location = "not-authorized.php";</script>
<?php }} ?>

<?php
if($curPageName=='claims.php' ||  $curPageName=='expense.php' ||  $curPageName=='salary-paid.php'  ||  $curPageName=='credit.php'){
if($role=='Admin' || $role=='Finance'){
}else{ ?>
<script type = "text/javascript">window.location = "not-authorized.php";</script>
<?php }} ?>

<?php
if($curPageName=='visitor.php' ||  $curPageName=='visitor-report.php' ||  $curPageName=='student-visit.php'){ if($role=='Admin' || $role=='Receptionist'){}else{ ?>
<script type = "text/javascript">window.location = "not-authorized.php";</script>
<?php }} ?>