-
Notifications
You must be signed in to change notification settings - Fork 1
/
login.php
81 lines (80 loc) · 3.24 KB
/
login.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
<?php
require('connection.inc.php');
require('functions.inc.php');
$msg='';
if(isset($_POST['submit'])){
$username=get_safe_value($con,$_POST['username']);
$password=get_safe_value($con,$_POST['password']);
$sql="select * from admin_users where username='$username' and password='$password'";
$res=mysqli_query($con,$sql);
$count=mysqli_num_rows($res);
if($count>0){
$row=mysqli_fetch_assoc($res);
if($row['status']=='0'){
$msg="Account deactivated";
}else{
$_SESSION['ADMIN_LOGIN']='yes';
$_SESSION['ADMIN_ID']=$row['id'];
$_SESSION['ADMIN_USERNAME']=$username;
$_SESSION['ADMIN_ROLE']=$row['role'];
header('location:index.php');
die();
}
}else{
$msg="Tolong masukan informasi dengan benar";
}
}
?>
<!doctype html>
<html class="no-js" lang="">
<meta http-equiv="content-type" content="text/html;charset=UTF-8" />
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>LOGIN PAGE</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="assets/css/normalize.css">
<link rel="stylesheet" href="assets/css/bootstrap.min.css">
<link rel="stylesheet" href="assets/css/font-awesome.min.css">
<link rel="stylesheet" href="assets/css/themify-icons.css">
<link rel="stylesheet" href="assets/css/pe-icon-7-filled.css">
<link rel="stylesheet" href="assets/css/flag-icon.min.css">
<link rel="stylesheet" href="assets/css/cs-skin-elastic.css">
<link rel="stylesheet" href="assets/css/style.css">
<link href='https://fonts.googleapis.com/css?family=Open+Sans:400,600,700,800' rel='stylesheet' type='text/css'>
</head>
<style>
body{
background-image:url('images/background.jpg');
background-repeat:no-repeat;
background-attachment:fixed;
background-size:100% 100%;
}
</style>
<body class="bg-dark">
<div class="sufee-login d-flex align-content-center flex-wrap">
<div class="container">
<div class="login-content">
<div class="login-form mt-150">
<form method="post">
<div class="form-group">
<label><b>USERNAME</b></label>
<input type="text" name="username" class="form-control" placeholder="Username" required>
</div>
<div class="form-group">
<label><b>PASSWORD</b></label>
<input type="password" name="password" class="form-control" placeholder="Password" required>
</div>
<button type="submit" name="submit" class="btn btn-success btn-flat m-b-30 m-t-30">SIGN IN</button>
</form>
<div class="field_error"><?php echo $msg?></div>
</div>
</div>
</div>
</div>
<script src="assets/js/vendor/jquery-2.1.4.min.js" type="text/javascript"></script>
<script src="assets/js/popper.min.js" type="text/javascript"></script>
<script src="assets/js/plugins.js" type="text/javascript"></script>
<script src="assets/js/main.js" type="text/javascript"></script>
</body>
</html>