Sie sind auf Seite 1von 4

<?

php
@session_start();
include "../config/database.php";

if(@$_SESSION['admin'] || @$_SESSION['operator'] || @$_SESSION['user']){


header("location: ../index.php");
}else {
?>
<!DOCTYPE HTML>
<html>
<head>
<title>Novus Admin Panel an Admin Panel Category Flat Bootstrap Responsive
Website Template | Login Page :: w3layouts</title>
<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="Novus Admin Panel Responsive web template,
Bootstrap Web Templates, Flat Web Templates, Android Compatible web template,
SmartPhone Compatible web template, free WebDesigns for Nokia, Samsung, LG,
SonyEricsson, Motorola web design" />
<script type="application/x-javascript"> addEventListener("load", function() {
setTimeout(hideURLbar, 0); }, false); function hideURLbar()
{ window.scrollTo(0,1); } </script>
<!-- Bootstrap Core CSS -->
<link href="../asset/css/bootstrap.css" rel='stylesheet' type='text/css' />
<!-- Custom CSS -->
<link href="../asset/css/style.css" rel='stylesheet' type='text/css' />
<!-- font CSS -->
<!-- font-awesome icons -->
<link href="../asset/css/font-awesome.css" rel="stylesheet">
<!-- //font-awesome icons -->
<!-- js-->
<script src="../asset/js/jquery-1.11.1.min.js"></script>
<script src="../asset/js/modernizr.custom.js"></script>
<!--webfonts-->
<link href='//fonts.googleapis.com/css?
family=Roboto+Condensed:400,300,300italic,400italic,700,700italic'
rel='stylesheet' type='text/css'>
<!--//webfonts-->
<!--animate-->
<link href="../asset/css/animate.css" rel="stylesheet" type="text/css"
media="all">
<script src="../asset/js/wow.min.js"></script>
<script>
new WOW().init();
</script>
<!--//end-animate-->
<!-- Metis Menu -->
<script src="../asset/js/metisMenu.min.js"></script>
<script src="../asset/js/custom.js"></script>
<link href="../asset/css/custom.css" rel="stylesheet">
<!--//Metis Menu -->
</head>
<body >
<div class="main-content">
<!-- main content start-->
<div id="page-wrapper">
<div class="main-page login-page ">
<h3 class="title1">Login EM-Santri</h3>
<div class="widget-shadow">
<div class="login-top">
<h4>Selamat Datang Di EM-Santri Ponpes Miftahul Ulum
Pandean</h4>
</div>
<div class="login-body">
<form action="" method="POST">
<input type="text" class="user" name="a"
placeholder="Masukkan Username" required="">
<input type="password" name="b" class="lock"
placeholder="password">
<input type="submit" name="masuk" value="Sign In">
<div class="forgot-grid">
<label class="checkbox"><input type="checkbox"
name="checkbox" checked=""><i></i>Remember me</label>
<!-- <div class="forgot">
<a href="#">forgot password?</a>
</div> -->
<div class="clearfix"> </div>
</div>
</form>
</div>
</div>
<?php
$user = @$_POST['a'];
$pass = @$_POST['b'];
$login = @$_POST['masuk'];

if ($login) {
if ($user == "" || $pass == "") {
?> <script type="text/javascript">alert("Username dan
Pasword Tidak Boleh Kosong");</script> <?php
} else{
$sql = mysqli_query($connect, "select * from tb_user
where username = '$user' and pass = sha1('$pass')") or die (mysqli_error());
$dtlogin = mysqli_fetch_array($sql);
$cek = mysqli_num_rows($sql);
if ($cek >= 1) {
if ($dtlogin['tinggat'] == "operator") {
$_SESSION['operator'] = $dtlogin['id_user'];
header("location: ../index.php");
} else if ($dtlogin['tinggat'] == "pengasuh") {
$_SESSION['pengasuh'] = $dtlogin['id_user'];
header("location: ../index.php");
}else if ($dtlogin['tinggat'] == "umana") {
$_SESSION['user'] = $dtlogin['id_user'];
header("location: ../index.php");
}else if ($dtlogin['tinggat'] == "santri") {
$_SESSION['user'] = $dtlogin['id_user'];
header("location: ../index.php");
}
} else {
echo "Login Gagal Mohon untuk memasukan data
dengan Benar";
}
}
}
?>
<!--
<div class="login-page-bottom">
<h5> - OR -</h5>
<div class="social-btn"><a href="#"><i class="fa fa-
facebook"></i><i>Sign In with Facebook</i></a></div>
<div class="social-btn sb-two"><a href="#"><i class="fa
fa-twitter"></i><i>Sign In with Twitter</i></a></div>
</div> -->
</div>
</div>
<!--footer-->
<div class="footer">
<p>&copy; &copy; TA 2018 Rizal Rohman. All Rights Reserved</p>
</div>
<!--//footer-->
</div>
<!-- Classie -->
<script src="../asset/js/classie.js"></script>
<script>
var menuLeft = document.getElementById( 'cbp-spmenu-s1' ),
showLeftPush = document.getElementById( 'showLeftPush' ),
body = document.body;

showLeftPush.onclick = function() {
classie.toggle( this, 'active' );
classie.toggle( body, 'cbp-spmenu-push-toright' );
classie.toggle( menuLeft, 'cbp-spmenu-open' );
disableOther( 'showLeftPush' );
};

function disableOther( button ) {


if( button !== 'showLeftPush' ) {
classie.toggle( showLeftPush, 'disabled' );
}
}
</script>
<!--scrolling js-->
<script src="../asset/js/jquery.nicescroll.js"></script>
<script src="../asset/js/scripts.js"></script>
<!--//scrolling js-->
<!-- Bootstrap Core JavaScript -->
<script src="../asset/js/bootstrap.js"> </script>
</body>
</html>
<?php
}
?>