
<?php
    include '../config/Config.php';
    $page = "Login";
    $config = new config();

if(empty($_SESSION['student_id'])) {    
?>
<!DOCTYPE html>
<html>
<head>
<title>MTsN 7 Bantul | Login</title>
<!-- For-Mobile-Apps -->
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="keywords" content="ARD Student Viewer)" />
<link rel="icon" type="image/png" href="../img/logo.png"/>
<script type="application/x-javascript"> addEventListener("load", function() { setTimeout(hideURLbar, 0); }, false); function hideURLbar(){ window.scrollTo(0,1); } </script>
<!-- //For-Mobile-Apps -->
<!-- Style --> <link rel="stylesheet" href="css/style.css" type="text/css" media="all" />
</head>
<body>
	<?php
			if(isset($_GET['ps'])){
				if($_GET['ps']=='gagal'){ echo
					 "<script>alert('Gagal! Username/Password salah.'); history.go(-1);</script>";

				}

			}
			 $d=$config->getdata("SELECT * FROM entity__school");
			 $dad=$config->getdatum("SELECT * FROM entity__school");
			 
		 ?>

<div class="container">
	
		
		
<h1 style="text-transform: uppercase;"><?php foreach($d as $da){?><?= $da['school_name'];?>&nbsp<?php }?></h1>



     <div class="contact-form">
	 <div class="profile-pic">
<!-- <img src="images/logo.png" alt="User Icon"/> -->
<img src="../img/mtsn2-100.png" alt="User Icon"/> 
	 </div>	 
	 <div class="signin">
     <form action="cek_login.php" method="post">
	      <input name="user" type="text" class="user" value="Masukkan NISN" onfocus="this.value = '';" onblur="if (this.value == '') {this.value = 'Masukkan NISN';}" />
		  <input name="pass" type="Password" class="pass" placeholder="" value="Password" onfocus="this.value = '';" onblur="if (this.value == '') {this.value = 'Password';}" />
		  <p style="margin-top: 5px; font-size: 14px;"><a href="#"></a></p>		  
     
	 </div>	 
	      <input type="submit" value="Login" name="login"/>
	 </div>
	 </form>
</div><!-- 
<div align="center" style="margin-top: 5px; font-size: 14px;"><font>STUVi By AnZ v. 20.1</font></div> -->
<div class="footer">
  <!--    <p>Copyright &copy; 2020 User Icon Login Form. All Rights Reserved | Design by <a href="http://w3layouts.com">W3layouts</a></p> -->
  <p>Aplikasi Rapot Digital Viewer</p> 
</div>
</body>
</html>
<?php
} else {
    header("Location: ../viewer/index.php");
}
?>