<?php $this->load->view('includes/header'); ?>  
<div class="page-title">
  <h2><span><?php echo $heading_title; ?></span></h2>
  <div class="buttons"><?php echo anchor("sitepanel/meta/addredirection", "<span>Add 301 Redirect URL</span>", 'class="btn btn-primary pull-right" '); ?></div>
</div>
<div class="page-content-wrap"> 
  <div class="fix"></div>
  <div class="row">
    <div class="col-md-12">
      <?php
      error_message();
      ?>
      <!-- START DEFAULT DATATABLE -->
      <div class="panel panel-default">
        <div class="panel-body">
          <div class="table-responsive">
            <?php
            if (is_array($pagelist) && !empty($pagelist)) {
              echo form_open("sitepanel/meta/redirection", 'id="myform"');
              ?>
              <table class="table table-condensed table-striped table-bordered datatable" id="my_data">
                <thead>
                  <tr>
                    <th>Old URL</th>
                    <th>New Url</th>
                    <th>Action</th>
                  </tr>
                </thead>
                <tbody>
                  <?php
                  foreach ($pagelist as $catKey => $pageVal) {
                    ?> 
                    <tr>
                      <td><?php echo $pageVal['old_url']; ?></td>
                      <td><?php echo $pageVal['new_url']; ?></td>      
                      <td><?php echo anchor("sitepanel/meta/editredirection/" . $pageVal['redirection_id'] . "/" . query_string(), '<span>Edit</span>', 'class="btn btn-info"'); ?></td>
                    </tr>
                    <?php
                  }
                  ?>
                </tbody>
              </table>
              <?php
              echo form_close();
            } else {
              echo "<center><strong> No record(s) found !</strong></center>";
            }
            ?>
          </div>
        </div>
      </div>
    </div>
  </div>
</div>
<?php $this->load->view('includes/footer'); ?>