<?php
ob_start();
    session_start();
    echo isset($_SESSION["login"]);
    if(isset($_SESSION["login"])) {
      header("LOCATION:home.php"); die();
    }
?>
<!DOCTYPE html>
<html>
   <head>
   <link rel="shortcut icon" href="images/favicon.ico" type="image/x-icon" />
   <style>

body {	
    font-size: 10px;
    color: #333;
    font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;
    text-rendering: optimizeLegibility;
	background: url('images/latar.jpg') no-repeat fixed;
	-webkit-background-size: 100% 100%;
	-moz-background-size: 100% 100%;
	-o-background-size: 100% 100%;
	background-size: 100% 100%;
}
	
form {
	width: 310px;
	color:#444;
    padding: 5px 20px;
	margin: 0 auto;	
	border: 1px solid #f1f1f1;
	height: 190px;

input[type=text], input[type=password] {
   	width: auto;
    padding: 10px 20px;
    margin: 8px 0;
    display: inline-block;
    border: 1px solid #ccc;
    box-sizing: border-box;
}

.button {
    background-color: #4CAF50;
    color: whitesmoke;
    padding: 12px 20px;
    margin: 8px 0;
    border: none;
    cursor: pointer;
    width: auto;
}

button:hover {
    opacity: 0.8;
}

.cancelbtn {
    width: auto;
    padding: 10px 18px;
    background-color: #f44336;
}

.imgcontainer {
    text-align: center;
    margin: 24px 0 12px 0;
}

img.avatar {
    width: 40%;
    border-radius: 50%;
}

.container {
    padding: 100px;
    text-align: center;
}

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

.login-box-msg {
    margin: 0;
    padding: 0 20px 20px 20px;
	
/* Change styles for span and cancel button on extra small screens */
@media screen and (max-width: 300px) {
    span.psw {
       display: block;
       float: none;
    }
    .cancelbtn {
       width: 100%;
    }
}

</style>
     <meta http-equiv='content-type' content='text/html;charset=utf-8' />
     <title>Simerak</title>
     <meta charset="utf-8">
     <meta name="viewport" content="width=auto, initial-scale=1">
     <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
   </head>
<body>
  <div class="container">
    <h3 class="text-center"><br><br><br><br><br><br><b>Simerak</b></h3>
    <?php
      if(isset($_POST['submit'])){
        $username = $_POST['username']; $password = $_POST['password'];
        if($username === 'pa-cilegon' && $password === 'pa652076'){
          $_SESSION['login'] = true; header('LOCATION:home.php'); die();
        } {
          echo "<div class='alert alert-danger'>salah user/passwordnya</div>";
        }

      }
    ?>
    <form action="" method="post">
      <div class="form-group">
        <p class="login-box-msg"><center>Sign in to start your session</center></p>
        <input type="text" class="form-control" id="username" placeholder="User" name="username" required>
      </div>
      <div class="form-group">
        
        <input type="password" class="form-control" id="pwd" placeholder="Password" name="password" required>
      </div>
	  
      <button type="submit" name="submit" class="button" style="float:right;width:75px;height:25px">Sign in</button>
    </form>
  </div>
</body>
</html>