<head>
    <script src="https://cdn.jsdelivr.net/npm/html2canvas@1.4.1/dist/html2canvas.min.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/jspdf@2.5.1/dist/jspdf.umd.min.js"></script>
</head>


<div id="layoutSidenav_content">
    <main>
        <div class="container-fluid px-4">
            <h1 class="mt-4" id="judulPasien">Dashboard Pasien IGD</h1>
            <ol class="breadcrumb mb-4">
                <li class="breadcrumb-item"><a href="index.html">Dashboard</a></li>
                <li class="breadcrumb-item active">Tampil Data Pasien IGD</li>
            </ol>
            <!-- Filter Tanggal -->
            <div class="card mb-4">
                <div class="card-body">
                    <form action="<?= base_url('menuigdkeuangan/filter_dataigdkeu') ?>" method="POST" name="form-input-data">
                        <div class="row">
                            <div class="col-md-4">
                                <div class="form-group">
                                    <label for="tgl_awal">Tanggal Awal</label>
                                    <input type="date" id="tanggal_awal" name="tanggal_awal" class="form-control" value="<?= $tgl_awal ?>" required />
                                </div>
                            </div>
                            <div class="col-md-4">
                                <div class="form-group">
                                    <label for="tgl_akhir">Tanggal Akhir</label>
                                    <input type="date" id="tanggal_akhir" name="tanggal_akhir" class="form-control" value="<?= $tgl_akhir ?>" required />
                                </div>
                            </div>
                        </div>
                        <div class="col-12">
                            <button style="margin-top: 20px;" type="submit" class="btn btn-primary btn-block">Submit</button>
                        </div>
                        <!-- <button style="margin-top: 20px;" id="export-btn">Export to JPG</button> -->
                    </form>
                </div>
            </div>

            <!-- TAMPIL TABEL RAWAT JALAN  -->
            <h2 style="margin-top: 30px;">Tampil Dashboard Pasien IGD</h2>
            <div style="margin-top: 10px;" class="row">
                <div class="card">
                    <div class="card-header">
                        <h3 style="text-align: center;" class="card-title">Data Pasien IGD</h3>
                    </div>
                    <div class="card-body">
                        <table id="example2" class="table table-bordered table-hover">
                            <thead>
                                <tr>
                                    <th>Jenis Pasien</th>
                                    <th style="text-align: center;">Dilayani</th>
                                    <th style="text-align: center;">Batal</th>
                                    <th style="text-align: center;">Total</th>
                                </tr>
                            </thead>
                            <tbody>
                                <?php
                                $no = 1;
                                if (isset($tampilrekapigdpasien->response)) {
                                    foreach ($tampilrekapigdpasien->response as $a) {
                                ?>
                                        <tr>
                                            <td><?= $a->nm_jenis_pasien ?></td>
                                            <td style="text-align: center;"><?= $a->dilayani ?></td>
                                            <td style="text-align: center;"><?= $a->batal ?></td>
                                            <td style="text-align: center;"><?= $a->total ?></td>

                                        </tr>
                                    <?php
                                    }
                                } else {
                                    ?>
                                    <tr>
                                        <td colspan="2" style="text-align: center;">Data tidak ditemukan</td>
                                    <tr>
                                    <?php
                                }
                                    ?>
                            </tbody>
                        </table>
                    </div>
                </div>

                <!--END OF TAMPIL DATA TABEL DEMOGRAFI  -->
            </div>
            </footer>
        </div>
</div>

<script src="https://code.jquery.com/jquery-3.5.1.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@4.5.2/dist/js/bootstrap.bundle.min.js"></script>

<!-- Jquery -->
<script src="https://code.jquery.com/jquery-3.5.1.min.js"></script>
<!-- DataTables JS -->
<script src="https://cdn.datatables.net/1.13.4/js/jquery.dataTables.min.js"></script>
<link href="https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.13/css/select2.min.css" rel="stylesheet" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.13/js/select2.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.2.3/dist/js/bootstrap.bundle.min.js" crossorigin="anonymous"></script>
<script src="<?php echo base_url('assets_/js/scripts.js'); ?>"></script>
<script src="https://cdn.jsdelivr.net/npm/simple-datatables@7.1.2/dist/umd/simple-datatables.min.js" crossorigin="anonymous"></script>
<script src="<?php echo base_url('assets_/js/datatables-simple-demo.js'); ?>"></script>
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>

</body>

</html>