-
Notifications
You must be signed in to change notification settings - Fork 3
/
index.php
executable file
·200 lines (132 loc) · 3.15 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
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
<?php
session_start();
//ambil nilai
require("inc/config.php");
require("inc/fungsi.php");
require("inc/koneksi.php");
require("inc/class/paging.php");
$tpl = LoadTpl("template/login.html");
nocache;
//nilai
$filenya = "index.php";
$filenya_ke = $sumber;
$judul = "Sistem Informasi Jadwal Mata Pelajaran";
$judulku = $judul;
//PROSES ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//jika batal
if ($_POST['btnBTL'])
{
//re-direct
xloc($filenya);
exit();
}
if ($_POST['btnOK'])
{
//ambil nilai
$username = nosql($_POST["usernamex"]);
$password = md5(nosql($_POST["passwordx"]));
//cek null
if ((empty($username)) OR (empty($password)))
{
//diskonek
xclose($koneksi);
//re-direct
$pesan = "Input Tidak Lengkap. Harap Diulangi...!!";
pekem($pesan,$filenya);
exit();
}
else
{
//query
$q = mysqli_query($koneksi, "SELECT * FROM member ".
"WHERE usernamex = '$username' ".
"AND passwordx = '$password'");
$row = mysqli_fetch_assoc($q);
$total = mysqli_num_rows($q);
//cek login
if ($total != 0)
{
session_start();
//bikin session
$_SESSION['kd9_session'] = nosql($row['kd']);
$_SESSION['username9_session'] = $username;
$_SESSION['pass9_session'] = $password;
$_SESSION['member_session'] = "MEMBER";
$_SESSION['hajirobe_session'] = $hajirobe;
//diskonek
xfree($q);
xclose($koneksi);
//re-direct
$ke = "member/index.php";
xloc($ke);
exit();
}
else
{
//diskonek
xfree($q);
xclose($koneksi);
//re-direct
pekem($pesan, $filenya);
exit();
}
}
}
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//isi *START
ob_start();
//view //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//isi *START
ob_start();
require("inc/menu/adm.php");
//isi
$isi_banner = ob_get_contents();
ob_end_clean();
echo '<form action="'.$filenya.'" method="post" name="formx">
<font color="green">
<h4>
'.$judul.'
</h4>
</font>
<table bgcolor="white" width="100%" border="1" cellspacing="0" cellpadding="5">
<tr>
<td>
<p>
<img src="'.$sumber.'/img/support.png" width="24" height="24" border="0">
<br>
Username :
<br>
<input name="usernamex" type="text" size="15" onKeyDown="var keyCode = event.keyCode;
if (keyCode == 13)
{
document.formx.btnOK.focus();
document.formx.btnOK.submit();
}">
<br>
Password :
<br>
<input name="passwordx" type="password" size="15" onKeyDown="var keyCode = event.keyCode;
if (keyCode == 13)
{
document.formx.btnOK.focus();
document.formx.btnOK.submit();
}">
<br>
<input name="btnBTL" type="submit" value="BATAL">
<input name="btnOK" type="submit" value="OK >>>">
</p>
</td>
</tr>
</table>
</form>
<hr>
<br>';
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//isi
$isi = ob_get_contents();
ob_end_clean();
require("inc/niltpl.php");
//diskonek
xclose($koneksi);
exit();
?>