php
@session_start();
include "../config/database.php";
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>© © 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' );
};