





<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('multiorders') ?></span>
                </div>
              </div>
            </div>
        <div class="row">
     <div class="col-md-12">
      <?php if(get_ap('bill_add',$this->operator_id)==1){ ?>
       
<div  style="float:right"><div  style="margin-left:10px"><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>
            
    </div>
    <div class="">
    <!-- Main content -->
   
      <div class="row">
        <div class="col-md-12">
          <div class="box">
            <div class="box-header ">
              <h3 class="box-title"><?php echo $this->lang->line('invoices') ?> </h3>
            </div>
            <!-- /.box-header -->
            <div class="box-body">
              <table class="table table-bordered">
                  <tr>
                    <th><?php echo $this->lang->line('sno') ?></th>
                    <th><?php echo $this->lang->line('date-added') ?></th>
                         <th><?php echo $this->lang->line('number') ?></th>
                        <th><?php echo $this->lang->line('the-name') ?></th>
                        <th ><?php echo $this->lang->line('the-product') ?></th>
                         <th ><?php echo $this->lang->line('the-beginning') ?></th>
                         <th ><?php echo $this->lang->line('end') ?></th>
                              <th > <?php echo $this->lang->line('fees') ?></th>
                         <th ><?php echo $this->lang->line('payment') ?></th>
                            <th ><?php echo $this->lang->line('status') ?></th>
                             <th style="width: 40px"></th>
                                  
                    </tr>
                    
                       <?php $count=1; foreach($all_groups as $row):?>
                  <tr>
                     <td><?php echo $count++; ?></td>
                      <td><?= $row['date_now']; ?></td>
                          <td><?= $row['id']; ?></td>
                          
                          <td>  <a  class="update btn btn-sm " href="<?= base_url('user/show/'.$row['id_user'])?>"><?= $row['name']; ?></a></td>
                   
                        <td><?= $row['name_order']; ?> </td>
                            <td><?= $row['start_date']; ?> </td>
                                <td><?= $row['expiry_date']; ?> </td>
                                    <td><?php if(empty($row['discount_remainder'])){
                  echo $row['payment'];
                  }else{
                  echo $row['discount_remainder'];
                  }?> </td>
                                  
                 <td><?php if($row['paid']=='0')echo '<span class="label label-danger">'.$this->lang->line("not-paid").'</span>'; 
                 
                 
                 if($row['paid']=='1')echo '<span class="label label-success">'.$this->lang->line("payment-is-made").'</span>';
               
                       if($row['paid']=='3')echo '<span class="label label-warning">'.$this->lang->line("is-free").'</span>';
                               if($row['paid']=='4')echo '<span class="label label-primary">'.$this->lang->line('retriever').'</span>';
               
                 ?></td>
               
                 <td><?php  if($row['active']!='0')echo '<span class="label label-danger">'.$this->lang->line('not-active').'</span>'; 
               
               
                 if($row['active']=='0')echo '<span class="label label-success">'.$this->lang->line('active').'</span>';
                 
                   
                 
                 ?></td>
                 
                 
                 <td>     <a  class="update btn btn-sm btn-block pull-right"  target="_block" href="<?= base_url(''.$this->thispage.'/printorder/'.$row['id'])?>"><i class="material-icons"><?php echo $this->lang->line('print') ?></i></a>
                      </td>
                    
                    <td>     <a  class="update btn btn-sm btn-warning pull-right" onclick="alert_box(<?php echo $row['id'] ?>)"><i class="material-icons"><?php echo $this->lang->line('delete') ?></i></a>
                    </td>
                  </tr>
                
                    <?php endforeach; ?>
                
              </table>
            </div>
            <!-- /.box-body -->
                       <?php if($all_count>1): ?>
                <div class="box-footer clearfix">
                        <ul class="pagination pagination-sm no-margin pull-right">
                            
                  <?php for($count=1;$count<$all_count;$count++):?>
                          <li><a href="<?= base_url(''.$this->thispage.'/all/'.$count.'/'.$id_producer.'/'.$active); ?>"><?=$count?></a></li>
                    
                    <?php endfor; ?>
                        </ul>
                </div>
                <?php endif; ?>   
          </div>
          <!-- /.box -->

          
          <!-- /.box -->
        </div>
     </div>
      </div>
      <!-- /.row -->
  
 <script>function alert_box(id) { 
  var result= confirm("Are You Confirm!")
  if(result){
    window.location.href = "<?= base_url(''.$this->thispage.'/del/')?>" + id;

  }
  
}</script>