-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdaftar.php
More file actions
115 lines (106 loc) · 3.56 KB
/
daftar.php
File metadata and controls
115 lines (106 loc) · 3.56 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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
<?php
include "koneksi.php";
session_start();
?>
<!DOCTYPE html>
<html>
<head>
<title>Form Daftar</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- Skrip CSS -->
<link rel="stylesheet" href="w3.css">
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Raleway">
<style>
body,
h1,
h2,
h3,
h4,
h5 {
font-family: "Raleway", sans-serif
}
</style>
</head>
<body class="w3-indigo" background="yoi.jpg" width="100%">
<?php
$username = $_POST['uname'];
$password = $_POST['pw'];
if (isset($_POST['login'])) {
$query = mysql_query("SELECT * FROM login WHERE username = '$username' AND password = '$password'") or die(mysql_error());
$hasil = mysql_fetch_array($query);
$login = mysql_num_rows($query);
if ($login >= 1) {
$_SESSION['login'] = true;
if ($hasil['level'] == "admin") {
echo "<meta http-equiv='refresh' content='0 url=index.php'>";
} elseif ($hasil['level'] == "user") {
echo "<meta http-equiv ='refresh' content='0 url=kalender.php'>";
} elseif ($hasil['level'] == "pimpinan") {
echo "<meta http-equiv ='refresh' content='0 url=tes.php'>";
}
} else {
echo "<script>alert('Username/Password Anda Salah')</script>";
}
}
?>
<div class="w3-content" style="max-width:1400px">
<!-- Header -->
<header class="w3-container w3-center w3-padding-32">
<!-- <style type="text/css">
img{
position: relative;
z-index: 1;
top: 0px;
}
h1{
position: absolute;
top: 50px;
right: 50px;
left: 50px;
z-index: 2;
color: black;
text-align: center;
}
</style> -->
<img src="logo2.png" width="15%" height="15%">
<hr />
</header>
<!-- Grid -->
<div class="w3-row">
<!-- <center>
<h2><b>FORM LOGIN PERPUSTAKAAN UNIVERSITAS BINA INSAN</b></h2>
<p><b>Login Anggota</b></p>
<hr/>
</center> -->
<table align="center" width="30%" border="0" class="w3-card">
<tr>
<td>
<div class="w3-light-blue">
<div class="w3-main">
<form action="login.php" method="post" class="w3-container">
<h4 align="center"><b><u>Daftar</u></b></h4>
<label class="w3-text-black" for="uname"><b>Username</b></label>
<input id="uname" name="uname" placeholder="Masukkan Username Anda" type="text" class="w3-input w3-border w3-light-grey"><br>
<label class="w3-text-black" for="pw"><b>Password</b></label>
<input id="pw" name="pw" placeholder="Masukkan Password Anda" type="password" class="w3-input w3-border w3-light-grey"><br>
<!-- <label class="w3-text-black"><b>Password</b></label>
<input id="password" name="password" placeholder="**********" type="password" class="w3-input w3-border w3-light-grey"><br> -->
<!-- <label class="w3-text-black"><b>NIM</b></label>
<input id="name" name="nama" placeholder="Masukkan nomor hape/NIK jika anda bukan mahasiswa" type="text" class="w3-input w3-border w3-light-grey"><br>
<label class="w3-text-black"><b>Jenis</b></label>
<select name="jenis" class="w3-input w3-border w3-light-grey">
<option value="mhsw">Mahasiswa</option>
<option value="pljr">Pelajar</option>
<option value="pkrj">Pekerja</option>
</select><br> -->
<center><input type="submit" name="login" id="login" value="Daftar" class="w3-button w3-blue-grey"></center>
<div class="w3-padding w3-display-bottomright"> Anda Pengunjung? <a href="login_pengunjung.php">Login Disini</a></div>
</form>
</div>
</div>
</td>
</tr>
</table>
</body>
</html>