<?php
include "config/conn.php";
$db = isset($conn) ? $conn : $koneksi;
?>
<div class="row">
    <div class="col-lg-12">
        <h1 class="page-header">Filter Laporan Absensi</h1>
    </div>
</div>

<div class="panel panel-default">
    <div class="panel-heading">Pilih Tanggal dan Kelas</div>
    <div class="panel-body">
        <form action="laporan_absensi.php" method="GET" target="_blank">
            <div class="row">
                <div class="col-md-4">
                    <label>Dari Tanggal</label>
                    <input type="date" name="tgl_awal" class="form-control" value="<?php echo date('Y-m-d'); ?>" required>
                </div>
                <div class="col-md-4">
                    <label>Sampai Tanggal</label>
                    <input type="date" name="tgl_akhir" class="form-control" value="<?php echo date('Y-m-d'); ?>" required>
                </div>
                <div class="col-md-3">
                    <label>Kelas</label>
                    <select name="kelas" class="form-control" required>
                        <option value="all">Semua Kelas</option>
                        <?php
                        $query_k = mysqli_query($db, "SELECT * FROM kelas ORDER BY nama ASC");
                        while($k = mysqli_fetch_array($query_k)){
                            echo "<option value='$k[idk]'>$k[nama]</option>";
                        }
                        ?>
                    </select>
                </div>
                <div class="col-md-1">
                    <label>&nbsp;</label>
                    <button type="submit" class="btn btn-primary form-control">
                        <i class="fa fa-print"></i>
                    </button>
                </div>
            </div>
        </form>
    </div>
</div>