<?php $this->load->view('site/layout'); ?>
<link href="<?php echo base_url() ?>public/css/style.bundle_front.css"
      rel="stylesheet" type="text/css" />

<?php $this->load->view('site/navbar'); ?>

<div class="kt-content  kt-grid__item kt-grid__item--fluid kt-grid kt-grid--hor" id="kt_content">
  
            <!-- begin:: Content Head -->
            <div class="kt-subheader  kt-grid__item" id="kt_subheader">
              <div class="kt-container  kt-container--fluid ">
                <div class="kt-subheader__main">
                  <h3 class="kt-subheader__title"><a href="<?php echo base_url() ?>Dashboard/"><?php echo $this->lang->line('dashboard'); ?></a></h3>
                  <span class="kt-subheader__separator kt-subheader__separator--v"></span>
                  <span class="kt-subheader__desc"><?php echo $this->lang->line('main') ?></span>
                </div>
              </div>
            </div>

</div>

<div class="row ml-10">

    <div class="col-md-10">
        <!-- Widget: user widget style 1 -->
        <div class="box box-widget widget-user">
            <!-- Add the bg color to the header using any of the bg-* classes -->

            <div class="box-footer">
                <div class="row">



                    <div class="col-sm-3 border-right">
                        <div class="description-block">
                            <h5 class="description-header"><?= $all_bill ?></h5>
                            <span class="description-text"> <?php echo $this->lang->line('available') ?></span>
                        </div>
                        <!-- /.description-block -->
                    </div>

                    <?php if ($this->session->userdata('group')): ?>
                        <div class="col-sm-3 border-right">
                            <div class="description-block">
                                <h5 class="description-header"><?= $all_bill1 ?></h5>
                                <a href="<?= base_url() ?><?= $this->thispage ?>/all/<?= $this->thismon ?>/1" class="btn btn-block btn-success w-full"  style="margin-bottom:5px">     <span class="description-text"> <?php echo $this->lang->line('revenue') ?></span></a> 
                            </div>
                            <!-- /.description-block -->
                        </div>

                        <div class="col-sm-3 border-right">
                            <div class="description-block">
                                <h5 class="description-header"><?= $all_bill2 ?></h5>
                                <a href="<?= base_url() ?><?= $this->thispage ?>/all/<?= $this->thismon ?>/2" class="btn btn-block btn-success w"  style="margin-bottom:5px">  <?php echo $this->lang->line('expenses') ?></a> 
                            </div>
                            <!-- /.description-block -->
                        </div>

                        <div class="col-sm-3 border-right">
                            <div class="description-block">
                                <h5 class="description-header"><?= $all_bill5 ?></h5>

                                <a href="<?= base_url() ?><?= $this->thispage ?>/all/<?= $this->thismon ?>/5" class="btn btn-block btn-success"  style="margin-bottom:5px">     <span class="description-text"> <?php echo $this->lang->line('export') ?></span></a> 
                            </div>
                            <!-- /.description-block -->
                        </div>

                    <?php endif; ?>
                    <!-- /.col -->
                </div>
                <!-- /.row -->
            </div>
        </div>
        <!-- /.widget-user -->
    </div>


    <!-- /.col -->
</div>



<div class="row ml-8">
    <?php  if(get_ap('account_add',$this->operator_id)==1){ ?>
    <div  style="float:right" class=" col-md-3"><div  ><a href="<?= base_url() ?><?= $this->thispage ?>/add/" class="btn btn-block btn-primary"  style="margin-bottom:5px"><i class="icon-pencil  icon-white"> </i><?php echo $this->lang->line('add-an-invoice') ?></a> 	</div>
    <?php } ?>
    </div>

    <div  style="float:right"  class=" col-md-3"><div  ><a href="<?= base_url() ?><?= $this->thispage ?>/endbill/<?= $this->booking->data_day(14) ?>" class="btn btn-block btn-primary"  style="margin-bottom:5px"><i class="icon-pencil  icon-white"> </i> <?php echo $this->lang->line('print-an-export-today') ?></a> 	</div>
    </div>    
    <div  style="float:right"  class=" col-md-2"><div  ><a href="<?= base_url() ?><?= $this->thispage ?>/stat/<?= $this->thismon ?>" class="btn btn-block btn-primary"  style="margin-bottom:5px"><i class="icon-pencil  icon-white"> </i><?php echo $this->lang->line('statistics') ?></a> 	</div>




    </div>  
    <div  style="float:right"  class=" col-md-3"><div  ><a href="<?= base_url() ?><?= $this->thispage ?>/updatebalc/" class="btn btn-block btn-primary"  style="margin-bottom:5px"><i class="icon-pencil  icon-white"> </i>  <?php echo $this->lang->line('balance-update') ?></a> 	</div>
</div>
</div>
<div class="row">
    <!-- Main content -->
    <div class="row">
        <div class="col-md-12">
            <div class="box">
                <div class="box-header with-border">
                    <h3 class="box-title"><?php echo $this->lang->line('invoices') ?></h3>
                </div>
                <!-- /.box-header -->
                <div class="box-body" style="overflow-x: auto;
                     white-space: nowrap;
                     direction: rtl;">
                    <table class="table table-bordered">
                        <tr>
                            <th style="width: 10px"><?php echo $this->lang->line('the-number') ?></th>
                            <th><?php echo $this->lang->line('the-balance') ?></th>     
                            <th><?php echo $this->lang->line('the-amount') ?></th>
                            <th><?php echo $this->lang->line('the-description') ?></th>
                            <th><?php echo $this->lang->line('type') ?></th>
                            <th><?php echo $this->lang->line('history') ?></th>
                            <th style="width: 40px"></th>
                        </tr>

                        <?php $count = 0;
                        foreach ($all_groups as $row): ?>
                            <tr>
                                <td><?= $row['id']; ?></td>
                                <td><?= $row['text5']; ?> </td>
                                <td><?= $row['text1']; ?> </td>
                                <td><?= $row['text2']; ?> </td>
                                <td><?= $row['gruop']; ?> </td>
                                <td><?= $row['dateadd']; ?> </td>  



                                <td> 
                                <?php  if(get_ap('account_list',$this->operator_id)==1){ ?>    <a title="Edit" class="update btn btn-sm btn-primary pull-right" href="<?= base_url('' . $this->thispage . '/show/' . $row['id']) ?>"><i class="material-icons"><?php echo $this->lang->line('the-details') ?></i></a>
                            <?php } ?>
                                </td>



                            </tr>

<?php endforeach; ?>

                    </table>
                </div>
                <!-- /.box-body -->
<?php if ($pages > 2): ?>
                    <div class="box-footer clearfix">
                        <ul class="pagination pagination-sm no-margin pull-right">

    <?php for ($count = 1; $count < $pages; $count++): ?>
                                <li><a href="<?= base_url('' . $this->thispage . '/all/' . $count); ?>"><?= $count ?></a></li>

    <?php endfor; ?>
                        </ul>
                    </div>
<?php endif; ?>   
            </div>
            <!-- /.box -->


            <!-- /.box -->
        </div>
    </div>
</div>
<!-- /.row -->

