-
Notifications
You must be signed in to change notification settings - Fork 6
/
i_index.php
executable file
·108 lines (75 loc) · 2.15 KB
/
i_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
<?php
session_start();
require("inc/config.php");
require("inc/fungsi.php");
require("inc/koneksi.php");
$filenyax = "i_index.php";
//PROSES ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//jika simpan
if ((isset($_GET['aksi']) && $_GET['aksi'] == 'simpan'))
{
//ambil nilai
$c_nis = trim(cegah($_GET['c_nis']));
$c_nisn = trim(cegah($_GET['c_nisn']));
$c_tgl_lahir = trim(cegah($_GET['c_tgl_lahir']));
$c_tgl_lahir2 = balikin($_GET['c_tgl_lahir']);
//empty
if ((empty($c_nis)) OR (empty($c_nisn)) OR (empty($c_tgl_lahir)))
{
echo '<font color="red">
<h3>INPUT TIDAK LENGKAP</h3>
</font>';
}
else
{
//cek ////////////////////////////////////////////////////////////////////////////////////////////
$qcc = mysqli_query($koneksi, "SELECT * FROM siswa ".
"WHERE nis = '$c_nis' ".
"AND nisn = '$c_nisn' ".
"AND lahir_tgl = '$c_tgl_lahir'");
$rcc = mysqli_fetch_assoc($qcc);
$tcc = mysqli_num_rows($qcc);
$cc_aktif = balikin($rcc['aktif']);
$cc_kd = nosql($rcc['kd']);
$cc_nama = balikin($rcc['nama']);
$cc_kelas = balikin($rcc['kelas']);
$cc_lahir_tmp = balikin($rcc['lahir_tmp']);
//jika null
if (empty($tcc))
{
//re-direct
echo '<font color="red">
<h3>Verifikasi Tidak Cocok. Harap Diperhatikan...!!</h3>
</font>';
exit();
}
else
{
//pass
$passku = substr($x,0,5);
$passkux = md5($passku);
//jika belum aktif
if ($cc_aktif == "false")
{
//bikin user
mysqli_query($koneksi, "UPDATE siswa SET usernamex = '$c_nis', ".
"passwordx = '$passkux', ".
"passwordx2 = '$passku', ".
"aktif = 'true', ".
"aktif_postdate = '$today' ".
"WHERE kd = '$cc_kd'");
}
//cocok
echo '<font color="green">
<h3>VERIFIKASI BERHASIL</h3>
</font>
<p>
[NIS : '.$c_nis.']. [NISN : '.$c_nisn.']. [Nama : '.$cc_nama.']. [Kelas : '.$cc_kelas.'].
</p>
<a href="siswa_prt.php?ckd='.$cc_kd.'" target="_blank" class="btn btn-danger"> UNDUH KARTU UJIAN </a>';
}
}
exit();
}
exit();
?>