-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
156 lines (143 loc) · 6 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
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
<?php
require_once 'dbconfig.php';
// jika user sudah login redirect ke home
if($user->is_loggedin()!="")
{
$user->redirect('panel/');
}
// cek hak aksess user
if(isset($_POST['btn-login']))
{
var_dump($_GET);
$uname = $_POST['txt_uname_email'];
$upass = $_POST['txt_password'];
if($user->login($uname,$upass))
{
if(isset($_SESSION['status'])){
if($_SESSION['status'] == 'user'){
$user->redirect('panel/home.php?page=pasien');
}elseif($_SESSION['status'] == 'admin'){
$user->redirect('panel/home.php?page=dashboard');
}
}
}
else
{
$error = $_SESSION['error'];
}
}
?>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Bunda Mulya - Login</title>
<meta name="description" content="Elisyam is a Web App and Admin Dashboard Template built with Bootstrap 4">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<!-- Google Fonts -->
<script src="https://ajax.googleapis.com/ajax/libs/webfont/1.6.26/webfont.js"></script>
<!-- Favicon -->
<link rel="apple-touch-icon" sizes="180x180" href="main/assets/img/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="main/assets/img/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="main/assets/img/favicon-16x16.png">
<!-- Stylesheet -->
<link rel="stylesheet" href="main/assets/vendors/css/base/bootstrap.min.css">
<link rel="stylesheet" href="main/assets/vendors/css/base/elisyam-1.5.min.css">
<!-- mystyle -->
<link rel="stylesheet" href="main/assets/vendors/css/base/style.css">
<style>
.alertku{
background-color: #f8d7da !important;
border-color: #f5c6cb !important;
color: #721c24 !important;
/*opacity: .7 !important;*/
}
</style>
</head>
<body>
<body class="bg-white">
<!-- Begin Container -->
<div class="container-fluid no-padding h-100">
<div class="row flex-row h-100 bg-white">
<!-- Begin Left Content -->
<div class="col-xl-8 col-lg-6 col-md-5 no-padding">
<div class="elisyam-bg" style="background: url(main/ini.jpg) no-repeat center center ;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;">
</div>
</div>
<!-- End Left Content -->
<!-- Begin Right Content -->
<div class="col-xl-4 col-lg-6 col-md-7 my-auto no-padding " >
<!-- Begin Form -->
<div class="authentication-form mx-auto boxlog">
<div class="logo-centered">
<!-- db-default.html -->
<a href="#">
<img src="main/assets/img/logo.png" alt="logo">
</a>
</div>
<h3>Masuk Aplikasi</h3>
<?php
if(isset($error))
: ?>
<div class="alert alert-danger alert-dismissible fade show boxlogin text-center alertku has-info" >
<i class=""></i> <?php echo $error; ?>
</div>
<?php
endif; ?>
<form method="post" onsubmit="return Confirm();">
<div class="group material-input">
<input type="text" class="error" id="usr" required name="txt_uname_email" autocomplete="OFF">
<span class="highlight"></span>
<span class="bar"></span>
<label>Username</label>
</div>
<div class="group material-input">
<input type="password" id="pass" class="error" required name="txt_password" autocomplete="OFF">
<span class="highlight"></span>
<span class="bar"></span>
<label>Password</label>
</div>
<div class="sign-btn text-center">
<button type="submit" name="btn-login" class="btn btn-primary btn-block">Masuk<i class="icon-circle-right2 position-right"></i></button>
</div>
</form>
</div>
<!-- End Form -->
</div>
<!-- End Right Content -->
</div>
<!-- End Row -->
</div>
<!-- End Container -->
<!-- Begin Vendor Js -->
<!-- <script src="assets/vendors/js/base/jquery.min.js"></script>
<script src="assets/vendors/js/base/core.min.js"></script> -->
<script src="main/assets/vendors/js/base/jquery.min.js"></script>
<!-- <script src="../main/assets/vendors/js/base/sweetalert2.all.min.js"></script> -->
<script>
$(document).ready(function() {
$('.error').click(function() {
$('.alert').fadeOut('slow/400/fast');
});
});
document.addEventListener("DOMContentLoaded", function() {
var elment = document.getElementsByTagName('INPUT');
for (var i = 0; i < elment.length; i++) {
elment[i].oninvalid = function(e) {
e.target.setCustomValidity("");
if(!e.target.validity.valid){
e.target.setCustomValidity("Bagian ini harus diisi.");
}
};
elment[i].oninput = function(e){
e.target.setCustomValidity("");
};
}
})
</script>
</body>
</html>