Mini Kabibi Habibi

Current Path : C:/Users/ITO/Desktop/From USB/fts/
Upload File :
Current File : C:/Users/ITO/Desktop/From USB/fts/index.php

  <?php
  @include 'database.php';

  session_start();

  if (isset($_POST['login'])){
   $_SESSION['login_user'] =$_POST['username'];
   $_SESSION['office'] =$_POST['office'];
   $_SESSION['current_location'] =$_POST['current_location'];
    $username =mysqli_real_escape_string($conn,$_POST['username']);

      $role = $_POST['role'];
    $password = md5($_POST['password']);

    $select ="SELECT *FROM accounts where username = '$username' && password = '$password'";
    $result =mysqli_query($conn, $select);

    if (mysqli_num_rows($result) > 0) {
     
      $row = mysqli_fetch_array($result);

      if ($row['role'] == 'ADMIN') {
       $_SESSION['username'] =$row['username'];
       header('location:ADMIN/dashboard.php');
      }elseif ($row['role'] == 'SCHOOL PERSONNEL') {
     $_SESSION['username_school'] =$row['username']; 
       header('location:SCHOOL/my_docs.php');
    }elseif ($row['role'] == 'SDO PERSONNEL') {
     $_SESSION['username_sdo'] =$row['username'];
       header('location:SDO/document_recieved.php');
        }elseif ($row['role'] == 'SCHOOL HEAD') {
     $_SESSION['username_head'] =$row['username'];
       header('location:HEAD/head_index.php');
    }
  }else{
    $error[] = 'incorrect email or password';
  }
  };
  ?>

   
  <html lang="en">
  <head>
    <meta charset="UTF-8">
    <title>SDO Batangas City DTS</title>
    <link href='https://fonts.googleapis.com/css?family=Pacifico' rel='stylesheet' type='text/css'>
  <link href='https://fonts.googleapis.com/css?family=Arimo' rel='stylesheet' type='text/css'>
    <link rel="icon" href="images/logo.ico">
  <link href='https://fonts.googleapis.com/css?family=Hind:300' rel='stylesheet' type='text/css'>
  <link href='https://fonts.googleapis.com/css?family=Open+Sans+Condensed:300' rel='stylesheet' type='text/css'>
  <link rel="stylesheet" href="style2.css">

  </head>
  <body>
  <!-- partial:index.partial.html -->
  <img style="width:35%; padding: 35px;" src="images/bats.png">
  <div id="login-button">

    </img>
    <img src="https://dqcgrsy5v35b9.cloudfront.net/cruiseplanner/assets/img/icons/login-w-icon.png">
    </img>
  </div>
  <div id="container">
    <h1>DOCUMENT TRACKING SYSTEM</h1>
    <span class="close-btn">
      <img src="https://cdn4.iconfinder.com/data/icons/miu/22/circle_close_delete_-128.png"></img>
    </span>

    <form action="#" method="POST">
      <input type="text" name="username" placeholder="Username">
      <input type="password" name="password" placeholder="Password">
     	<input type="submit" value="Log In" name="login" class="btn_solid">
      <div id="remember-container">
      	
      
       
      </div>
  </form>
 
  </div>

    

  <!-- partial -->
    <script src='https://cdnjs.cloudflare.com/ajax/libs/gsap/1.16.1/TweenMax.min.js'></script>
  <script src='https://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js'></script><script  src="script.js"></script>

  </body>

  </html>