<style type="text/css">
    #editabledatatable_wrapper{
        width: 98%;
    }
    .DTTT ,#simpledatatable_length,.DTTTFooter,#searchable_length {
        display: none;
    }
    .table-toolbar{
        float:left;
    }
</style>
<div class="page-content">
    <!-- Page Breadcrumb -->
    <div class="page-breadcrumbs">
        <ul class="breadcrumb">
            <li>
                <i class="fa fa-home"></i>
                <a href="#"><?php echo $this->lang->line("FINANCE"); ?></a>
            </li>
            <li class="active"><?php echo $this->lang->line("PAYMENTHEAD"); ?></li>
        </ul>
    </div>
    <!-- /Page Breadcrumb -->
    <!-- Page Header -->
    <div class="page-header position-relative">
        <div class="header-title">
            <h1>
                <?php echo $this->lang->line("PAYMENTHEAD"); ?>
            </h1>
        </div>
        <!--Header Buttons-->
        <div class="header-buttons">
            <a class="sidebar-toggler" href="#">
                <i class="fa fa-arrows-h"></i>
            </a>
            <a class="refresh" id="refresh-toggler" href="">
                <i class="glyphicon glyphicon-refresh"></i>
            </a>
            <a class="fullscreen" id="fullscreen-toggler" href="#">
                <i class="glyphicon glyphicon-fullscreen"></i>
            </a>
        </div>
        <!--Header Buttons End-->
    </div>
    <!-- /Page Header -->
    <!-- Page Body -->
    <!-- End Page Body -->
    <div class="page-body">
        <div class="row">
            <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
                <div class="row">
                    <div class="col-xs-12 col-md-12">
                        <div class="widget">
                                <?php
                                if ($this->session->flashdata('success_msg')) {
                                    ?>
                                    <div class="alert alert-success">
                                        <a href="#" class="close" data-dismiss="alert">&times;</a>
                                        <?php echo $this->session->flashdata('success_msg'); $this->session->unset_userdata('success_msg');?>
                                    </div>
                                    <?php
                                }
                                ?>
                            <div>
                                <div class="table-toolbar">
                                    <div class="form-group" style="margin-left:12px;margin-bottom: 4px;">
                                        <a id="add_account" href="<?php echo site_url('finance/paymentshead/add_paymenthead')?>"
                                           class="btn btn-success shiny">
                                            <span class="fa fa-plus"></span>
                                        </a>
                                    </div>
                                </div>
                                <div class="widget-body">
<table class="table table-bordered table-hover table-striped" id="searchable">
                                        <thead>
                                            <tr role="row">
                                                <th>
                                                    <?php echo $this->lang->line("PAYMENTHEAD"); ?>
                                                </th>
                                                <th>
                                                    <?php echo $this->lang->line("TAXCATEGORY"); ?>
                                                </th>
                                                <th>
                                                    <?php echo $this->lang->line("ACTION"); ?>
                                                </th>
                                            </tr>
                                        </thead>
                                        <tbody>
                                            <?php
                                            if($paymentheadslist){
                                                $slno=1;
                                                foreach($paymentheadslist as $paymentheadsrec){
//                                                    if($paymentheadsrec->ID!='INVOICE' && $paymentheadsrec->ID!='DEPOSIT'){
                                            ?>
                                                <tr>
                                                    <td>
                                                        <?php echo $paymentheadsrec->PAYMENTHEAD; ?>
                                                    </td>
                                                    <td>
                                                        <?php echo $paymentheadsrec->NAME; ?>
                                                    </td>
                                                    <td>
                                                        <a class="btn btn-small btn-info btn-xs shiny fa fa-pencil-square-o" href="<?php echo site_url('finance/paymentshead/edit_Paymenthead')?>/<?php echo $paymentheadsrec->ID; ?>" /></a> &nbsp;
<a class="btn btn-small btn-danger btn-xs shiny fa fa-trash-o" data-toggle="modal" data-target="#confirmmodal" onclick="return confirmFunction('<?php echo $paymentheadsrec->ID; ?>')"></a>
                                                    </td>
                                                </tr>
                                            <?php
//                                                    }
                                                $slno++;
                                                }
                                            }
                                            ?>
                                        </tbody>
                                    </table>
                                    <!-- </div> -->
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<!-- End Page Content -->
<div id="confirmmodal" class="modal fade" role="dialog">
  <div class="modal-dialog">

    <!-- Modal content-->
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal">&times;</button>
        <h4 class="modal-title"><?php echo $this->lang->line("AREYOUSURETODELETE"); ?></h4>
      </div>
      <div class="modal-footer">
        <input type="hidden" id="okid" value="">
        <button type="button" class="btn btn-success" onclick="return deleteFunction()"><?php echo $this->lang->line("OK"); ?></button>
        <button type="button" class="btn btn-danger" data-dismiss="modal"><?php echo $this->lang->line("CLOSE"); ?></button>
      </div>
    </div>
</div>
</div>
<script type="text/javascript">
    function confirmFunction(id) {
        $("#okid").val(id);
    }
    function deleteFunction() {
        id = $("#okid").val();
        window.location.href = "<?php echo site_url('finance/paymentshead/delete_paymenthead')?>/"+id;
    }
</script>