-
Notifications
You must be signed in to change notification settings - Fork 14
/
index.php
executable file
·202 lines (130 loc) · 3.17 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
201
202
<?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 Surat - Menyurat";
$s = nosql($_REQUEST['s']);
$judulku = $judul;
//PROSES ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
if ($_POST['btnOK'])
{
//ambil nilai
$username = nosql($_POST["usernamex"]);
$password = md5(nosql($_POST["passwordx"]));
//cek null
if ((empty($username)) OR (empty($password)))
{
//re-direct
$pesan = "Input Tidak Lengkap. Harap Diulangi...!!";
pekem($pesan,$filenya);
exit();
}
else
{
//query
$q = mysqli_query($koneksi, "SELECT * FROM adminx ".
"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['kd11_session'] = nosql($row['kd']);
$_SESSION['username11_session'] = $username;
$_SESSION['pass11_session'] = $password;
$_SESSION['surat_session'] = "Petugas Pengarsip Surat";
$_SESSION['hajirobe_session'] = $hajirobe;
//diskonek
xfree($q);
xclose($koneksi);
//re-direct
$ke = "adm/index.php";
xloc($ke);
exit();
}
else
{
//diskonek
xfree($q);
xclose($koneksi);
//re-direct
$pesan = "Password Salah. Harap Diulangi...!!";
pekem($pesan, $filenya);
exit();
}
}
}
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//isi *START
ob_start();
//view //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
echo '<form action="'.$filenya.'" method="post" name="formx">
<table width="100%" border="0" cellspacing="3" cellpadding="0">
<tr valign="top" align="center">
<td width="100%">';
echo '<table bgcolor="gray" width="100%" border="0" cellspacing="3" cellpadding="0">
<tr valign="top">
<td>
<div id="d_utama">
<table bgcolor="#7b1f53" width="100%" border="0" cellspacing="3" cellpadding="0">
<tr valign="top">
<td>
<h2>
SISFOSURAT
</h2>
</td>
</tr>
</table>
<p>
Username :
<br>
<input name="usernamex" type="text" size="15" required>
</p>
<p>
Password :
<br>
<input name="passwordx" type="password" size="15" required>
</p>
<p>
<input name="btnOK" type="submit" value="OK >>>" class="btn btn-danger">
</p>
<hr>
Contoh akses :
<br>
user/pass : admin
<hr>
</td>
</tr>
</table>
</div>';
echo '<table bgcolor="#d7a2bd" width="100%" border="0" cellspacing="3" cellpadding="0">
<tr valign="top" align="right">
<td>
(c) 2021. '.$versi.'
</td>
</tr>
</table>
</td>
</tr>
</table>
</form>';
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//isi
$isi = ob_get_contents();
ob_end_clean();
require("inc/niltpl.php");
//diskonek
xclose($koneksi);
exit();
?>