<?php //print_r($usertype);exit; ?>
    <section class="content-header">
      <h1>
        Shop Articles
      </h1>
      <ol class="breadcrumb">
        <li><a href="<?php echo base_url().'admin';?>"><i class="fa fa-dashboard"></i> Home</a></li>
        <li class="active">List</li>
      </ol>
    </section>

    <section class="content">
      <div class="row">
        <?php echo $this->utility->showMsg();?>
        <div class="col-xs-12">
          <div class="box">
            <div class="box-header">
              <h3 class="box-title">Management</h3>
              <?php if(chkWritePermission('Manage_Shop_Articles',$this->session->userdata('admin_id'))!=0 || $this->session->userdata('admin_id')=='19624' ){ ?>
              <!-- <a class="btn btn-primary margin-right pull-right" href="<?php echo base_url()?>admin/order/shop_article_add">Add</a> -->
              <?php } ?>
              </div>
               
              <div></div>
            <!-- /.box-header -->
            <div class="box-body">
              <table id="example1" class="table table-bordered table-striped">
                <thead>
                <tr>
                  <th>#</th>
                  <th>Name</th>
                  <th>Base Price(&euro;)</th>
                  <th>Reoccuring</th>
                  <th>Status</th>
                  <?php if(chkWritePermission('Manage_Shop_Articles',$this->session->userdata('admin_id'))!=0 || $this->session->userdata('admin_id')=='19624' ){ ?>
                  <th>Action</th>
                  <?php } ?>
                </tr>
                </thead>
                 <?php if(count($shop_articles)>0)
                {?>
                <tbody>
               <?php
                $i=1;
                foreach ($shop_articles as $data) 
                {
                ?>
                <tr>
                    <td><?php if($i==1){ echo 2; } else { echo 4; } ?></td>
                    <td><?php if($data['id'] < 3) { echo ucfirst($data['alias']).' ( 6 Months )'; } else { echo ucfirst($data['alias']).' ( 12 Months )'; } ?></td>
                    <td><?php echo number_format($data['base_price']/100,2,',','.'); ?></td>
                    <td><?php echo $data['reoccuring']; ?></td>
                    <td><?php echo $data['userstatus'];  ?></td>
                    <?php if(chkWritePermission('Manage_Shop_Articles',$this->session->userdata('admin_id'))!=0 || $this->session->userdata('admin_id')=='19624' ){ ?>
                    <td>
                      <a href="<?php echo base_url();?>admin/order/shop_article_edit/<?php echo base64_encode($data['id']);?>" title="edit"><span class="fa fa-pencil-square"></span></a>
                      <!-- <a href="<?php echo base_url();?>admin/order/shop_article_delete/<?php echo base64_encode($data['id']);?>" title="Delete" onclick="return confirm('Are you sure to delete ?');"><span class="fa fa-ban"></span></a> -->
                    </td>
                    <?php } ?> 
                </tr>

               <?php $i++; } ?>


               <?php
                $j=1;
                foreach ($shop_new_articles as $data) 
                {
                ?>
                <tr>
                    <td><?php if($j==1){ echo 1; } else { echo 3; } ?></td>
                    <td><?php if($data['id'] < 3) { echo ucfirst($data['alias']).' ( 6 Months )'; } else { echo ucfirst($data['alias']).' ( 12 Months )'; } ?></td>
                    <td><?php echo number_format($data['base_price']/100,2,',','.'); ?></td>
                    <td>182</td>
                    <td><?php echo $data['alias']; ?></td>
                    <?php if(chkWritePermission('Manage_Shop_Articles',$this->session->userdata('admin_id'))!=0 || $this->session->userdata('admin_id')=='19624' ){ ?>
                    <td>
                      <a href="<?php echo base_url();?>admin/order/shop_article_edit/<?php echo base64_encode($data['id']);?>" title="edit"><span class="fa fa-pencil-square"></span></a>
                      <!-- <a href="<?php echo base_url();?>admin/order/shop_article_delete/<?php echo base64_encode($data['id']);?>" title="Delete" onclick="return confirm('Are you sure to delete ?');"><span class="fa fa-ban"></span></a> -->
                    </td>
                    <?php } ?> 
                </tr>

               <?php $j++; } ?>

                </tbody>
                <?php } ?>
                <tfoot>
               
                </tfoot>
              </table>
            </div>
            <!-- /.box-body -->
          </div>
          <!-- /.box -->
        </div>
        <!-- /.col -->
      </div>
      <!-- /.row -->
    </section>
    

    
<script>
  $(function () {
    $("#example1").DataTable();
  });
</script>