<?php 
    ob_start();
    session_start(); 
?>

<?php
    if (isset($_SESSION['login_ok'])) {
        header("Location:/");
        exit();
    }
?>

<!DOCTYPE html>
<html lang="en">

  <head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>MPDL</title>
    <script src="jquery.min.js"></script>
  </head>

  <style>
    * {
      margin: 0;
      padding: 0;
    }

    html {
      min-height: 100%;
      position: relative;
    }

    body {
      height: 100%;
      font-family: sans-serif;
    }

    span.psw {
      float: right;
      padding-top: 16px;
    }

    .modal-login {
      display: block; /* Hidden by default */
      position: fixed; /* Stay in place */
      z-index: 1; /* Sit on top */
      left: 0;
      top: 0;
      width: 100%; /* Full width */
      height: 100%; /* Full height */
      overflow: auto; /* Enable scroll if needed */
      background-color: rgb(0,0,0); /* Fallback color */
      background-color: rgba(0,0,0,0.4); /* Black w/ opacity */
      padding-top: 60px;
    }
    
    .modal-content-login {
      background-color: #fefefe;
      margin: 5% auto 15% auto; /* 5% from the top, 15% from the bottom and centered */
      border: 1px solid #888;
      width: 80%; /* Could be more or less, depending on screen size */
    }

    .container-login {
      padding: 16px;
    }

        /* Full-width input fields */
    .input-login {
      width: 100%;
      padding: 12px 20px;
      margin: 8px 0;
      display: inline-block;
      border: 1px solid #ccc;
      box-sizing: border-box;
    }

    /* Set a style for all buttons */
    .button-login {
      background-color: #5C6BC0;
      color: white;
      padding: 14px 20px;
      margin: 8px 0;
      border: none;
      cursor: pointer;
      width: 100%;
    }

    .button-login:hover {
      opacity: 0.8;
    }

  </style>


  <body>

    <div id="id01" class="modal-login">
        <form class="modal-content-login" action="/login-check.php" method="post">
        <div class="container-login">
          <label for="uname"><b>Kullanıcı</b></label>
          <input class="input-login" type="text" placeholder="Kullanıcı adını giriniz" name="uname" required>

          <label for="psw"><b>Parola</b></label>
          <input class="input-login" type="password" placeholder="Parolayı giriniz" name="psw" required>
            
          <button class="button-login" type="submit">Giriş</button>
        </div>

      </form>
    </div>

  </body>

</html>
