Postingan lainnya
Cara buat sweet alert di kode ini?
<!-- lockscreen credentials (contains the form) -->
<form class="lockscreen-credentials" action="" method="POST" autocomplete="off" >
<div class="input-group">
<input type="input1" name="id" class="form-control" placeholder="Masukkan ID PPS" autofocus="" required>
<div class="input-group-append">
<button type="submit" name="submit" class="btn"><i class="fas fa-arrow-right text-muted"></i></button>
</div>
</div>
</form>
<!-- /.lockscreen credentials -->
</div>
<!-- proses absen PHP -->
<?php
if (null !== @$_POST['submit']) {
$id_pps = @$_POST['id'];
$query = "SELECT * FROM absen where id_pps='$id_pps' AND tanggal = '$tgl' AND bulan='$bln' AND tahun='$thn'";
$result=mysqli_query($koneksi,$query);
$data = mysqli_num_rows($result);
if($data == 1){
$tampil = '<center><h5>Anda dengan ID <font color="red">'.$id_pps.'</font> telah mengisi Presensi</h5></center>';
}elseif($data == 0){
$qry = "SELECT * FROM anggota where id_pps = '$id_pps' AND status_ngaji = '1'";
$cek = mysqli_query($koneksi,$qry);
$cari = mysqli_num_rows($cek);
if($cari == 0){
$tampil = '<center><h5>Anda Dengan ID <font color="red">'.$id_pps.'</font> tidak terdaftar sebagai anggota</h5></center>';
}elseif($cari == 1){
mysqli_query($koneksi, "INSERT INTO absen VALUES ('','$id_pps','$tgl','$bln','$thn','1')");
$sambil = "SELECT a.id, a.id_pps, COUNT(a.id_pps) AS hadir, a.tanggal, b.nama, b.domisili, b.kategori, b.majlis,
(SELECT COUNT(id_pps) AS alpa FROM alpa WHERE id_pps = '$id_pps' AND bulan='$bln' AND tahun='$thn') AS alpa FROM absen a, pembina b, anggota c WHERE a.id_pps = b.id_pps AND a.id_pps = c.id_pps
AND a.id_pps = '$idpps' AND a.bulan='$bln' AND a.tahun='$thn' ORDER BY id DESC LIMIT 1";
$ambil = mysqli_query($koneksi, $sambil);
while ($data = mysqli_fetch_assoc($ambil)):
$filename = "../dist/images/".$data['id_pps'].".jpg";
if (file_exists($filename)) {
$file="../dist/images/".$data['id_pps'].".jpg";
} else {
$file="../dist/nophoto.jpg";
}
$bulan = date('M');
endwhile;
}
}
}
echo $tampil;
?>
<!-- akhir proses -->
Tanggapan
bertnaya dengan baik ya. Kamu harus menjelaskan apa yang kamu buat, kamu mau menyelipkannya saat apa. Bukan cuma copy paste kode
Belum ada Jawaban. Jadi yang pertama Jawaban
Login untuk ikut Jawaban