<?php 
session_start();
ob_start();
include('include/config.php');
$date = new DateTime("now", new DateTimeZone('Africa/Nairobi') );
$timenow=$date->format('Y-m-d H:i:s');
$timenow2=$date->format('Y-m-d');
$month=$date->format('M');

$user=addslashes($_GET["us"]);
$pass=$_SESSION['passi'];


$sqlll=mysqli_query($con,"SELECT * FROM users WHERE Email='$user' AND Aces='Yes'");     
while($row=mysqli_fetch_array($sqlll))
{
$_SESSION['HU_mana']=$row["Manage"];
$_SESSION['HU_ac']=$row["Accounts"];
$_SESSION['HU_hr']=$row["Hr"];
$_SESSION['HU_le']=$row["Level"];
$_SESSION['usertype']=$row["Level"];
$uza=$row["Level"];
$id=$row["userid"];
}



 $sqll=mysqli_query($con,"SELECT * FROM Staffs WHERE id='$id'");   
 while($row=mysqli_fetch_array($sqll))
 {
  $fn=$row["Name"];
 }
    

    
$_SESSION['user_idd']=$id;
$_SESSION['name'] = $fn;
$_SESSION['betapos']='HHD/CJ2588E';

$sql3=mysqli_query($con,"INSERT INTO activity(user,Action,Tim,Dat,shortmsg,Month)values('$id','logged in','$timenow','$timenow2','login','$month')");
//if($sql3)
//{ }
?>
<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <title>BKEC | Management System</title>
   <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,400i,700&display=fallback">
  <!-- Font Awesome -->
  <link rel="stylesheet" href="plugins/tempusdominus-bootstrap-4/css/tempusdominus-bootstrap-4.min.css">
  <link rel="stylesheet" href="plugins/fontawesome-free/css/all.min.css">
  <!-- SweetAlert2 -->
  <link rel="stylesheet" href="plugins/sweetalert2-theme-bootstrap-4/bootstrap-4.min.css">
  <link rel="stylesheet" href="plugins/datatables-bs4/css/dataTables.bootstrap4.min.css">
  <link rel="stylesheet" href="plugins/datatables-responsive/css/responsive.bootstrap4.min.css">
  <link rel="stylesheet" href="plugins/datatables-buttons/css/buttons.bootstrap4.min.css">
  <!-- Toastr -->
  <link rel="stylesheet" href="plugins/toastr/toastr.min.css">
  <!-- Theme style -->
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
  
  <link rel="stylesheet" href="dist/css/adminlte.min.css">
    <link rel="stylesheet" href="plugins/icheck-bootstrap/icheck-bootstrap.min.css">
  <link rel="stylesheet" href="plugins/overlayScrollbars/css/OverlayScrollbars.min.css">
  <link rel="stylesheet" href="plugins/daterangepicker/daterangepicker.css">
  <link href="https://cdn.jsdelivr.net/npm/select2@4.1.0-rc.0/dist/css/select2.min.css" rel="stylesheet" />
  <link rel="shortcut icon" href="images/logo.ico">
 
  <style>
     body{
         font-family:;
         background-image:url('images/wood.jpg');
          background-repeat:no-repeat;
         background-position: center;
         background-size: cover;
     }
     
     #predash
     {
       background-color:#FFFFFF;  
     }
     .table-responsive{
         overflow-x:scroll;
     }
    </style>
</head>
<body>
   <section class="content">
      <div class="container-fluid">
         <div class="row">
             <div class="col-md-2 col-sm-2 col-12"> 
             </div>
             
    <div class="col-md-8 col-sm-8 col-12" id="predash"> 
   <center><h2>Pre-dashboard</h2></center>
   <div class="table-responsive">
     <table class="table" style="">
   	  <tbody>
   	      <tr><td>Logged in as:</td> <td><strong><?php echo  $fn; ?></strong></td></tr>
   	  
   	  	  <?php
   	  	  if($uza=='Data Editor')
   	  	  {
          ?>
          <tr>
          <td colspan="">Go to ... </td>
          <td><a class="btn btn-success btn-block" href="data/index.php?page=dashboard">Dashboard</a></td>
          <td></td><td></td><td></td><td></td>
          </tr>
          <?php
   	  	  }else if($uza=='Admin' || $uza=='Accountant')
   	  	  {
   	       ?>
   	       <tr>
          <td colspan="4">Go to ... </td>
          </tr>
   	       
   	  	  <tr>
   	  	      <td><a class="btn btn-success" href="data/index.php?page=dashboard">Dashboard</a></td>
   	  	      <td><a class="btn btn-info" href="data/Pupils.php?page=Manage_Fee">Fees Payment</a></td>
   	  	      <td><a class="btn btn-warning" href="data/Pupils.php?page=Fee">Fees Setting</a></td>
   	  	      <td><a class="btn btn-primary" href="data/Pupils.php?page=Manage">Learners' Data</a></td>
   	  	      <td><a class="btn btn-danger" href="data/Exams.php?page=Home">Exams Management</a></td>
   	  	  </tr>
   	  	  <?php
   	  	  
   	  	   }else
   	  	   {
   	  	       
   	  	   }
   	  	  ?>
   	  </tbody>
   </table>
  </div>
   
   
    <footer class="footer" style="margin-top:100px;position:relative;margin-bottom:20px">
    <strong><small>Copyright &copy; 2024 <a href="https://bishopkairoeducationcentre.sc.ke/" target="_blank">Bishop Kairo Education Centre</a>.</small></strong> All rights reserved.
  </footer>
    </div>
      </div>
      
  
      </div>
      </section>
   

</body>

<script src="https://cdnjs.cloudflare.com/ajax/libs/jqueryui/1.12.1/jquery-ui.min.js"></script>
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>

<script>
    setInterval(function () 
    {                                     
    //window.location.href='data/index.php?page=dashboard';
    }, 1500);
</script>
</html>




