-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.php
More file actions
99 lines (95 loc) · 3.34 KB
/
index.php
File metadata and controls
99 lines (95 loc) · 3.34 KB
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Absensi | Administrator</title>
<!-- Google Font: Source Sans Pro -->
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,400i,700&display=fallback">
<!-- Font Awesome -->
<link rel="stylesheet" href="AdminLTE/plugins/fontawesome-free/css/all.min.css">
<!-- icheck bootstrap -->
<link rel="stylesheet" href="AdminLTE/plugins/icheck-bootstrap/icheck-bootstrap.min.css">
<!-- Theme style -->
<link rel="stylesheet" href="AdminLTE/dist/css/adminlte.min.css">
</head>
<body class="hold-transition login-page">
<div class="login-box">
<div class="login-logo">
<a href="" class="text-white"><b>Absensi</b> WEB</a>
</div>
<!-- /.login-logo -->
<div class="card border border-info">
<div class="card-body login-card-body">
<p class="text-white login-box-msg">Login Administrator</p>
<form action="" method="post">
<?php
session_start();
require 'modules/databases.php';
if(isset($_POST['username']) && isset($_POST['password'])){
try {
$admin = new Administrator($_POST['username'], $_POST['password']);
$admin->Masuk();
$_SESSION['username'] = $_POST['username'];
$_SESSION['password'] = $_POST['password'];
header('location: dashboard.php');
}catch(Exception $e){
echo '<div class="alert alert-danger" role="alert">
'.$e->getMessage().'
</div>';
}
}else if(isset($_POST['username']) && isset($_POST['password'])){
$admin = (new Administrator($_SESSION['username'], $_SESSION['password']))->Masuk();
header('location: dashboard.php');
}
?>
<div class="input-group mb-3">
<input type="text" name="username" class="form-control" placeholder="Username">
<div class="input-group-append">
<div class="input-group-text">
<span class="fas fa-address-card"></span>
</div>
</div>
</div>
<div class="input-group mb-3">
<input type="password" name="password" class="form-control" placeholder="Password">
<div class="input-group-append">
<div class="input-group-text">
<span class="fas fa-lock"></span>
</div>
</div>
</div>
<div class="row">
<!-- /.col -->
<div class="col-12">
<button type="submit" class="btn btn-primary btn-block">Masuk</button>
</div>
<!-- /.col -->
</div>
</form>
<!-- /.social-auth-links -->
</div>
<!-- /.login-card-body -->
</div>
</div>
<!-- /.login-box -->
<!-- jQuery -->
<script src="AdminLTE/plugins/jquery/jquery.min.js"></script>
<!-- Bootstrap 4 -->
<script src="AdminLTE/plugins/bootstrap/js/bootstrap.bundle.min.js"></script>
<!-- AdminLTE App -->
<script src="AdminLTE/dist/js/adminlte.min.js"></script>
<style>
body {
background-image: url('img/bg.gif');
background-repeat: no-repeat;
background-size: cover;
background-position: center;
}
.card, .card-body {
background-color: rgba(255, 255, 255, 0.1);
backdrop-filter: blur(10px);
}
</style>
</body>
</html>