<div class="content-wrapper">
    <!-- Content Header (Page header) -->
    <section class="content-header">
        <h1>
            Top 10 ICD <label style="font-weight: normal; font-size:15px" id="timer"></label>
        </h1>
        <ol class="breadcrumb">
            <li><a href="#"><i class="fa fa-dashboard"></i> Sis-RS</a></li>
            <li class="active">ICD</li>
        </ol>
    </section>

    <!-- Main content -->
    <section class="content">
        <div class="row" style="margin-bottom: 10px;">
            <div class="col-md-8">
                <i class="fa fa-fw fa-calendar"></i> Daftar Pasien <b>TOP 10 ICD</b>


            </div>
            <div class="col-md-4" align="right">
                <form action="<?= base_url('DashboardLaporan/cariicd'); ?>" method="get">
                    <table>
                        <tr>
                            <td><input type="date" class="form-control" name="tgl1" id="tgl1" value="<?= date('Y-m-d'); ?>"></td>
                            <td><input type="date" class="form-control" name="tgl2" id="tgl2" value="<?= date('Y-m-d'); ?>"></td>
                            <td><button style="border-radius: 0px;" type="submit" class="btn btn-sm btn-primary">Cari</button></td>
                        </tr>
                    </table>
                </form>
            </div>
        </div>
        <div class="box">
            <div class="box-body">
                <?= $this->session->flashdata('message'); ?>
                <form action="<?= base_url('DashboardLaporan/exportICD'); ?>" method="get">
                <input type="hidden" name="tglpertama" id="out1">
                <input type="hidden" name="tglkedua" id="out2">
                <button style="border-radius: 0px;" type="submit" class="btn btn-sm btn-primary">Exprt Top 10 ICD</button><br><br>
                </form>
                <table id="example1" class="table table-bordered table-striped">
                    <thead>
                        <tr>
                            <th>ICD CODE</th>
                            <th>DESCRIPTION</th>
                            <th>JUMLAH</th>
                        </tr>
                    </thead>
                    <tbody>
                        <?php foreach($icd as $d) : ?>
                        <tr>
                            <td><?= $d['diagnosa_primer']; ?></td>
                            <td><?= $d['DESCRPTION']; ?></td>
                            <td><?= $d['total']; ?></td>
                        </tr>
                        <?php endforeach; ?>
                    </tbody>
                </table>
            </div>
        </div>
    </section>
</div>
<script src="https://code.jquery.com/jquery-3.3.1.js"></script>
<script src="https://cdn.datatables.net/1.10.20/js/jquery.dataTables.min.js"></script>
<script type="text/javascript">
  $(document).ready(function() {
    $('#tgl1').change(function() {
      $('#out1').val($(this).val());
      $('#myDIVTag').html('<b>' + $(this).val() + '</b>');
    });
  });
</script>

<script type="text/javascript">
  $(document).ready(function() {
    $('#tgl2').change(function() {
      $('#out2').val($(this).val());
      $('#myDIVTag').html('<b>' + $(this).val() + '</b>');
    });
  });
</script>