Postingan lainnya
Cetak data berdasarkan tgl yang di tentukan dengan mpdf
<form action="" method="POST">
<?php $date= ('Y-m-d'); ?>
<h5 style="font-weight: bold;">
Tentukan Tanggal Bulan Dan Tahun!
</h5>
<div class="input-group m-t-10" style="width: 15%; margin:10px;">
<input type="date" name="start" class="form-control" value="<?= $date=('Y-m-d'); ?>">
<span class="input-group-btn">
<button type="submit" value="Tampilkan" class="btn waves-effect waves-light btn-info" name="submit" >Tampilkan</button>
</span>
</div>
</form>
<hr>
<a href="print/cetak1.php" class="btn btn-block btn-primary btn-rounded" target="_blank" style="width: 10%;margin-bottom:10px;"> <i class="glyphicon glyphicon-print"></i> Cetak</a>
<!-- <?='<a href="print/cetak1.php?tanggal='.$_POST["tanggal"].'" class="btn btn-block btn-primary btn-rounded" target="_blank" style="width: 10%;margin-bottom:10px;"><i class="glyphicon glyphicon-print"></i> Cetak </a>';
?> -->
<br>
<div class="table-responsive">
<table id="myTable" class="table table-striped">
<thead>
<tr>
<th style="text-align: center;">No</th>
<th>Tanggal</th>
<th>Nama</th>
<th>Status</th>
<th>Jam Datang</th>
<th>Jam Pulang</th>
</tr>
</thead>
<tbody>
<?php
$no = 1;
if (isset($_POST['submit'])) {
$date = $_POST['start'];
$hadir = $koneksi->query("SELECT * FROM tb_pegawai AS a LEFT JOIN tb_absensi AS b ON
a.nip=b.nip WHERE tgl_absensi='$date'");
}else{
$hadir = $koneksi->query("SELECT * FROM tb_pegawai AS a LEFT JOIN tb_absensi AS b ON a.nip=b.nip");
}
while ($r = $hadir->fetch_array()) {
$hari = format_hari_tanggal($r['tgl_absensi']);
?>
<tr>
<td><?= $no;?></td>
<td><?= $hari;?></td>
<td>
<span class="font-medium"><?= $r['nama'];?></span>
<span class="text-muted"><?= $r['nip'];?></span>
</td>
<td>
<?php
if (empty($r['jam_pulang'])) {
echo '<span class="font-medium label label-info label-rouded">Hadir<span>';
}else{
echo '<span class="font-medium label label-warning label-rouded">Pulang<span>';
}
?>
</td>
<td><?= $r['jam_masuk'];?></td>
<td><?= $r['jam_pulang'];?></td>
</tr>
<?php
$no++;
} ?>
0
Tanggapan
biasakan menulis deksripsi ya dipertanyaan kamu, jangan cuma paste kode aja. Jelaskna kode kamu, jelaskan masalah sekarang apa
Belum ada Jawaban. Jadi yang pertama Jawaban
Login untuk ikut Jawaban