-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
126 lines (111 loc) · 3.45 KB
/
index.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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
<?php
session_start();
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="web spp">
<meta name="author" content="MuhammAd_Fariz">
<link rel="shortcut icon" type="image/png" href="Assets\logo\invoice.png"/>
<title>WEB PEMBAYARAN SPP</title>
<!-- Bootstrap core CSS -->
<link href="Assets\css\bootstrap.min.css" rel="stylesheet">
<style type="text/css">
body {
padding-top: 40px;
padding-bottom: 40px;
background-color: #eee;
background-image: url();
}
.form-signin {
max-width: 330px;
padding: 15px;
margin: 100px auto;
color: #006666;
}
.form-signin .form-signin-heading,
.form-signin .checkbox {
margin-bottom: 10px;
text-align: center;
}
.form-signin .checkbox {
font-weight: normal;
}
.form-signin .form-control {
position: relative;
height: auto;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
padding: 10px;
font-size: 16px;
}
.form-signin .form-control:focus {
z-index: 2;
}
.form-signin input[type="text"] {
margin-bottom: -1px;
border-bottom-right-radius: 0;
border-bottom-left-radius: 0;
}
.form-signin input[type="password"] {
margin-bottom: 10px;
border-top-left-radius: 0;
border-top-right-radius: 0;
}
</style>
</head>
<body>
<div class="container">
<?php
include "./koneksi.php";
if( isset( $_REQUEST['submit'] ) ){
$username = $_REQUEST['username'];
$password = $_REQUEST['password'];
$sql = mysqli_query($konek, "SELECT * FROM user WHERE username='$username' AND password=md5('$password');");
if( mysqli_num_rows($sql) > 0 ){
list($iduser,$username,$password,$admin,$fullname) = mysqli_fetch_array($sql);
//session_start();
$_SESSION['iduser'] = $iduser;
$_SESSION['username'] = $username;
$_SESSION['admin'] = $admin;
$_SESSION['fullname'] = $fullname;
header("Location: ./admin.php");
die();
} else {
//$err = '<strong>ERROR!</strong> Username dan Password tidak ditemukan.';
//header('Location: ./?err='.urlencode($err));
$_SESSION['err'] = '<strong>ERROR!</strong> Username dan Password tidak ditemukan.';
header('Location: ./');
die();
}
} else {
?>
<form class="form-signin" method="post" action="" role="form" autocomplete="off">
<?php
if(isset($_SESSION['err'])){
$err = $_SESSION['err'];
echo '<div class="alert alert-warning alert-message">'.$err.'</div>';
}
?>
<h2 class="form-signin-heading"><strong>APLIKASI PEMBAYARAN SPP</strong></h2>
<input type="text" name="username" class="form-control" placeholder="Username" required autofocus>
<input type="password" name="password" class="form-control" placeholder="Password" required>
<button class="btn btn-lg btn-primary btn-block" type="submit" name="submit">Login</button>
<p> </p>
</form>
<?php
}
?>
</div> <!-- /container -->
<!-- Bootstrap core JavaScript, Placed at the end of the document so the pages load faster -->
<script src="js/jquery.min.js"></script>
<script src="js/bootstrap.min.js"></script>
<script type="text/javascript">
$(".alert-message").alert().delay(3000).slideUp('slow');
</script>
</body>
</html>