-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmasmin.php
160 lines (136 loc) · 5.67 KB
/
masmin.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
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
<!DOCTYPE html>
<html lang="en">
<head>
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<meta name="author" content="Revan">
<title>APPM</title>
<!--====== Favicon Icon ======-->
<link rel="shortcut icon" href="img/2.png" type="image/png">
<!-- Bootstrap CSS -->
<link rel="stylesheet" href="css/bootstrap.min.css">
<link rel="stylesheet" href="css/animate.css">
<link rel="stylesheet" href="css/LineIcons.css">
<link rel="stylesheet" href="css/owl.carousel.css">
<link rel="stylesheet" href="css/owl.theme.css">
<link rel="stylesheet" href="css/magnific-popup.css">
<link rel="stylesheet" href="css/nivo-lightbox.css">
<link rel="stylesheet" href="css/main.css">
<link rel="stylesheet" href="css/responsive.css">
</head>
<?php
require('db.php');
session_start();
// If form submitted, insert values into the database.
if (isset($_POST['username'])){
$username = stripslashes($_REQUEST['username']); // removes backslashes
$username = mysqli_real_escape_string($con,$username); //escapes special characters in a string
$password = stripslashes($_REQUEST['password']);
$password = mysqli_real_escape_string($con,$password);
//Checking is user existing in the database or not
$query = "SELECT * FROM `admin` WHERE username='$username' and password='".md5($password)."'";
$result = mysqli_query($con,$query) or die(mysql_error());
$rows = mysqli_num_rows($result);
if($rows==1){
$_SESSION['username'] = $username;
header("Location: dashmin.php"); // Redirect user to index.php
}else{
echo "<center><br><br><br><br><br><br><br><div class='form'><h2>Ups Nama Pengguna / Kata Sandi Anda Salah.</h2>
<br/>
<a href='masmin.php'>Klik Disini</a> Untuk Mencoba Kembali
</div>
</center>";
}
}else{
?>
<body>
<!-- Header Section Start -->
<header id="home" class="hero-area">
<div class="overlay">
<span></span>
<span></span>
</div>
<nav class="navbar navbar-expand-md bg-inverse fixed-top scrolling-navbar">
<div class="container">
<a href="index.html" class="navbar-brand"><h1 style="color: whitesmoke">APPM</h1></a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarCollapse" aria-controls="navbarCollapse" aria-expanded="false" aria-label="Toggle navigation">
<i class="lni-menu"></i>
</button>
<div class="collapse navbar-collapse" id="navbarCollapse">
<ul class="navbar-nav mr-auto w-100 justify-content-end">
<li class="nav-item">
<a class="nav-link page-scroll" href="index.html">Beranda</a>
</li>
<li class="nav-item">
<a class="nav-link page-scroll" href="tatacara.html">Tata Cara Pelaporan</a>
</li>
<li class="nav-item">
<a class="nav-link page-scroll" href="regmin.php">Buat Akun Baru</a>
</li>
</ul>
</div>
</div>
</nav>
<div class="container">
<div class="row space-100">
<div class="col-lg-6 col-md-12 col-xs-12">
<div class="contents">
<h2 class="head-title">Silahkan Masuk</h2>
<br>
<div class="row">
<div class="form">
<form action="" method="post" name="login">
<div class="col-md-12">
<div class="form-group">
<input type="text" placeholder="Nama Pengguna Pengguna" id="username" class="form-control" name="username" required data-error="Silahkan Masukan Nama Pengguna Anda">
<div class="help-block with-errors"></div>
</div>
</div>
<div class="col-md-12">
<div class="form-group">
<input type="password" class="form-control" id="password" name="password" placeholder="Kata Sandi Anda" required data-error="Silahkan Masukan Kata Sandi Anda">
<div class="help-block with-errors"></div>
</div>
</div>
<div class="col-md-12">
<div class="submit-button">
<button class="btn btn-common" id="submit" type="submit">Masuk</button>
<div id="msgSubmit" class="h3 hidden"></div>
<div class="clearfix"></div>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
<div class="col-lg-6 col-md-12 col-xs-12 p-0">
<div class="intro-img">
<img src="img/holla.png" alt="">
</div>
</div>
</div>
</div>
</header>
<!-- Header Section End -->
<!-- Preloader -->
<div id="preloader">
<div class="loader" id="loader-1"></div>
</div>
<!-- End Preloader -->
<!-- jQuery first, then Tether, then Bootstrap JS. -->
<script src="js/jquery-min.js"></script>
<script src="js/popper.min.js"></script>
<script src="js/bootstrap.min.js"></script>
<script src="js/owl.carousel.js"></script>
<script src="js/jquery.nav.js"></script>
<script src="js/scrolling-nav.js"></script>
<script src="js/jquery.easing.min.js"></script>
<script src="js/nivo-lightbox.js"></script>
<script src="js/jquery.magnific-popup.min.js"></script>
<script src="js/main.js"></script>
<?php } ?>
</body>
</html>