<div class="m-portlet m-portlet--mobile">
    <div class="m-portlet__head">
        <div class="m-portlet__head-caption">
            <div class="m-portlet__head-title">
                <h3 class="m-portlet__head-text">
                    Daftar Tagihan
                </h3>
            </div>
        </div>
        
    </div>
    <div class="m-portlet__body">
        <?php
            if ($this->session->userdata('alert_error') != NULL) {
                $alert_error = $this->session->userdata('alert_error');
                $alert_error_type = $this->session->userdata('alert_error_type');

                echo '
                    <div class="m-alert m-alert--icon m-alert--air m-alert--square alert '.$alert_error_type.' alert-dismissible fade show" role="alert" >
                        <div class="m-alert__icon">
                            <i class="la la-warning"></i>
                        </div>
                        <div class="m-alert__text">
                            '.$alert_error.'
                        </div>
                        <div class="m-alert__close">
                            <button type="button" class="close" data-dismiss="alert" aria-label="Close">
                            </button>
                        </div>
                    </div>
                ';

                $this->session->unset_userdata('alert_error');
                $this->session->unset_userdata('alert_error_type');
            }
        ?>    

       
        <!--begin: Datatable -->
        <?php echo form_open('superuser/tagihan_hapus'); ?>
        <div class="table-responsive">
        <table class="table table-striped table-bordered table-hover table-checkable m-datatable--brand" id="m_table_1" style="width:99.9%;">
            <thead class="btn-brand">
                <tr>
                    <th class="text-center" width="60px">#</th>
                    <th class="text-left">Nama Tagihan</th>
                    <th class="text-right" width="140px">Nominal</th>
                    <th class="text-left" width="100px">Tipe</th>
                    <th class="text-left" width="120px">Tahun Masuk</th>
                    <th class="text-center" width="100px">Status Akun</th>
                    <th class="text-center" width="75px">Aksi</th>
                    
                </tr>
            </thead>
            <tbody>
            <?php
                if (count($query) > 0) {
                    $no=$nomor+1;
                    foreach ($query as $row) {
                        echo"
                            <tr>
                                <td align='center'>".$no."</td>
                                <td align='left'>".$row["nama_tagihan"]."</td>
                                <td align='right'>".rupiah($row["nominal"])."</td>
                                <td align='left'>".$row["tipe_tagihan"]."</td>
                                <td align='left'>".$row["nama_tahun_masuk"]."</td>
                                <td align='center'>".getActive($row["aktif_tagihan"])."</td>
                                <td align='center'>
                                    ".anchor('superuser/generate_tagihan/'.$row['tagihan_id'],'<i class="la la-download"></i> Generate Tagihan')." 
                                </td>
                               
                            </tr>
                        ";
                        $no++;
                    }
                    $nomor_baru = $nomor+1;
                }else{
                    echo "<td align='center' colspan='9'>Data tidak ditemukan.</td>";
                    $nomor_baru = 0;
                }
            ?>
            </tbody>
        </table>
        
        <div class="paginate pull-left">
            <?php
                echo $this->pagination->create_links();
            ?>
        </div>

        <span class="pull-right">Menampilkan <?php echo $nomor_baru;?>&nbsp;-&nbsp;<?php echo count($query)+$nomor;?> dari <?php echo $total;?> hasil.</span>
        </div>

        <div class="form-group m-form__group row " >
            <div class="col-lg-10">
                &nbsp;
            </div>

            <div class="col-lg-2">
                <input name="filter_delete" type="submit" class="btn btn-default btm-sm" value="Hapus" onclick="return confirm('[WARNING] Data centang yang dipilih akan dihapus permanen. Segala data (transaksi pembayaran) yang berhubungan juga akan ikut terhapus permanen dan menyebabkan laporan atau rekapitulasi keuangan mengalami perubahan, pastikan keputusan anda benar, lanjutkan?');" id="deleted_checkbox" style="display: none;border: 1px solid #DDD;margin-top: 10px;float: right;">
            </div>
        </div>
        
        <?php echo form_close(); ?>
    </div>
</div>
<!-- END EXAMPLE TABLE PORTLET-->
