<section class='content'>
    <div class='row'>
        <div class='col-xs-12'>
            <div class='pull-right'>
                <button type="button" class="btn btn-danger btn-sm tombol-hapus-all" id="tombol_hapus_all" style="display: none;"><i class="fa fa-trash"></i> <span class="d-none d-sm-inline"> Hapus Data Terpilih</span></button>
                <!-- <a href="#modal-add" class="btn btn-sm btn-success" data-toggle="modal"><i class="fa fa-upload"></i> <span class="d-none d-sm-inline">Import Data Excel</span></a> -->
                <?= anchor('jabatan/create/', '<i class="fa fa-plus"></i> <span class="d-none d-sm-inline">Tambah Data</span>', array('class' => 'btn btn-info btn-sm')); ?>
            </div>
        </div>
    </div>
    <br>
    <div class='row'>
        <div class='col-lg-12'>
            <div class='panel <?= $web_box_color ?>'>
                <div class='panel-heading'>
                    <h3 class='panel-title bold'>List Jabatan</h3>
                    <div class="pull-right">
                        Total Data : <?php echo $total_rows ?>
                    </div>
                </div>
                <div class='panel-body'>
                    <div class="row" style="margin-bottom: 10px">
                        <div class="col-md-3"></div>
                        <div class="col-md-3"></div>
                        <div class="col-md-3"></div>
                        <div class="col-md-3 pull-right">
                            <form action="<?php echo site_url('jabatan/index'); ?>" method="get">
                                <div class="input-group">
                                    <input type="text" class="form-control" name="q" value="<?php echo $q; ?>" placeholder="Nama Jabatan">
                                    <span class="input-group-append">
                                        <?php
                                        if ($q <> '') {
                                        ?>
                                            <a href="<?php echo site_url('jabatan'); ?>" class="btn btn-default"><i class="fa fa-eraser"></i></a>
                                        <?php
                                        }
                                        ?>
                                        <button class="btn btn-primary dropdown-toggle no-caret" type="submit"><i class="fa fa-search"></i></button>
                                    </span>
                                </div>
                            </form>
                        </div>
                    </div>
                    <div class="table-responsive">
                        <form action="<?= base_url('jabatan/delete_list'); ?>" method="post" id="form_ceklist">
                            <table class="table table-striped" style="margin-bottom: 10px">
                                <tr>
                                    <th style="width: 10px;">No</th>
                                    <th style="width: 10px;"><input type="checkbox" id="select_all" name="checkAll"></th>
                                    <th class="text-center">Nama Jabatan</th>
                                    <!-- <th class="text-center">Atasan Jabatan</th> -->
                                    <th class="text-center"><span><i class="fa fa-cogs"></i></span></th>
                                </tr>
                                <?php
                                foreach ($jabatan_data as $jabatan) {
                                ?>
                                    <tr>
                                        <td width="10px"><?php echo ++$start ?></td>
                                        <td width="10px" class="text-center"><input type="checkbox" class="checkbox" id="pilih_check" name="pilih[]" value="<?= $jabatan->id_jabatan; ?>"></td>
                                        <td><?= $jabatan->nama_jabatan ?></td>
                                        <!-- <td><?= $jabatan->atasan_jabatan ?></td> -->
                                        <td style="text-align:center" width="160px">
                                            <?php
                                            //    echo anchor(site_url('jabatan/read/'.encrypt_url($jabatan->id_jabatan)),'<i class="fa fa-search"></i>',array('class'=>'btn btn-success btn-icon btn-circle','data-toggle'=>'tooltip','data-placement'=>'left','title'=>'Detail')); 
                                            echo '  ';
                                            echo anchor(site_url('jabatan/update/' . encrypt_url($jabatan->id_jabatan)), '<i class="fa fa-pencil-alt"></i>', array('class' => 'btn btn-primary btn-icon btn-circle', 'data-toggle' => 'tooltip', 'data-placement' => 'left', 'title' => 'Edit'));
                                            echo '  ';
                                            echo anchor(site_url('jabatan/delete/' . encrypt_url($jabatan->id_jabatan)), '<i class="fa fa-trash-alt"></i>', 'class="btn btn-danger btn-icon btn-circle tombol-hapus" data-toggle="tooltip" data-placement="left" title="Hapus"');
                                            ?>
                                        </td>
                                    </tr>
                                <?php
                                }
                                ?>
                            </table>
                        </form>
                    </div>
                </div>
                <div class="panel-footer clearfix">
                    <div class="row">
                        <div class="col-md-3 m-b-5">
                            Total Data : <?= $total_rows ?>
                        </div>
                        <div class="col-lg-9" style="overflow: auto;">
                            <table style="width: 100%">
                                <tr>
                                    <td>
                                        <?= $pagination ?>
                                    </td>
                                </tr>
                            </table>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</section>
<div class="modal fade" id="modal-add">
    <div class="modal-dialog">
        <form action="<?= base_url('jabatan/import_data'); ?>" method="post" enctype="multipart/form-data">
            <div class="modal-content">
                <div class="modal-header">
                    <h4 class="modal-title">Import Data</h4>
                    <button type="button" class="btn btn-danger btn-sm btn-icon btn-circle" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button></button>
                </div>
                <div class="modal-body">
                    <div class='form-group'>
                        <label for='file'>Upload File : </label>
                        <div class="input-group mb-3">
                            <div class="input-group-prepend">
                                <span class="input-group-text" id="inputGroupFileAddon01"><i class="fa fa-file-alt"></i></span>
                            </div>
                            <div class="custom-file">
                                <input type="file" name="file" class="custom-file-input" id="inputGroupFile01" aria-describedby="inputGroupFileAddon01" onchange="previewImage();">
                                <label class="custom-file-label" for="inputGroupFile01" id="teks-gambar">Choose file</label>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="modal-footer">
                    <a href="<?= base_url('public/data/master/jabatan.xlsx'); ?>" class="btn btn-warning"><i class="fa fa-download"></i> Download Sampel</a>
                    <button type="submit" class="btn btn-success" id="btnSubmitImport"><i class="fa fa-play-circle"></i> Start Import</button>
                </div>
            </div>
        </form>
    </div>
</div>