<?php echo $header; ?>
<?php echo $column_left; ?>
<div id="content">
  <div class="page-header">
    <div class="container-fluid">
      <div class="pull-right">
        <button type="submit" form="form-301redirect" data-toggle="tooltip" title="<?php echo $button_save; ?>" class="btn btn-primary"><i class="fa fa-save"></i></button>
        <?php if ($module_301redirect_status){ ?>
        <a href="<?php echo $add; ?>" data-toggle="tooltip" title="<?php echo $button_add; ?>" class="btn btn-primary"><i class="fa fa-plus"></i></a>
        <button type="button" data-toggle="tooltip" title="<?php echo $button_delete; ?>" class="btn btn-danger" onclick="confirm('<?php echo $text_confirm; ?>') ? $('#form-blog').submit() : false;"><i class="fa fa-trash-o"></i></button>
        <?php } ?>
      </div>
      <h1><?php echo $heading_title; ?></h1>
      <ul class="breadcrumb">
        <?php foreach($breadcrumbs as $breadcrumb){ ?>
        <li><a href="<?php echo $breadcrumb['href']; ?>"</a></li>
        <?php } ?>
      </ul>
    </div>
  </div>
  <div class="container-fluid">
    <?php if ($error_warning){ ?>
    <div class="alert alert-danger alert-dismissible"><i class="fa fa-exclamation-circle"></i><?php echo $error_warning; ?>
      <button type="button" class="close" data-dismiss="alert">&times;</button>
    </div>
    <?php } ?>
    <?php if ($success) { ?>  
    <div class="alert alert-success alert-dismissible"><i class="fa fa-check-circle"></i><?php echo $success; ?>
      <button type="button" class="close" data-dismiss="alert">&times;</button>
    </div>
    <?php } ?>

    <div class="panel panel-default">
        <div class="panel-heading">
          <h3 class="panel-title"><i class="fa fa-pencil"></i><?php if($text_config){ ?></h3>
        </div>
        <div class="panel-body">
            <form action=<?php $action ?>" method="post" enctype="multipart/form-data" id="form-301redirect" class="form-horizontal">
                <div class="form-group">
                    <label class="col-sm-2 control-label" for="input-status"><?php $entry_status; ?></label>
                    <div class="col-sm-10">
                        <select name="module_301redirect_status" id="input-status" class="form-control">
                            <?php if ($module_301redirect_status){ ?>
                            <option value="1" selected="selected"><?php echo text_enabled; ?></option>
                            <option value="0"><?php echo $text_disabled; ?></option>
                            <?php }else{ ?>
                            <option value="1"><?php echo $text_enabled; ?></option>
                            <option value="0" selected="selected"><?php echo $text_disabled; ?></option>
                            <?php } ?>
                        </select>
                    </div>
                  </div>
            </form>
        </div>
    </div>

    <div class="panel panel-default">
      <div class="panel-heading">
        <h3 class="panel-title"><i class="fa fa-list"></i> <?php $text_list; ?></h3>
      </div>
      <div class="panel-body">
       <?php if  (isset($module_301redirect_status)) { ?>
       <div class="alert alert-info">
          <i class="fa fa-check-circle"></i> 
          <?php echo $text_module_disabled; ?>
        </div>
       <?php } ?>
        <form action="<?php $delete; ?>" method="post" enctype="multipart/form-data" id="form-blog">
          <div class="table-responsive">
            <table class="table table-bordered table-hover">
              <thead>
                <tr>
                  <td style="width: 1px;" class="text-center"><input type="checkbox" onclick="" /></td>

                  <td class="text-left">
                    <?php if ($sort == "url_from"){ ?>
                        <a href="<?php echo $sort_url_from; ?>" class="<?= $order; ?>"><?php echo $column_url_from; ?></a>
                      <?php }else{ ?>
                    <a href="<?php echo $sort_url_from; ?>"><?php echo $column_url_from; ?></a>
                      <?php } ?>
                  </td>

                  <td class="text-left">
                    <?php if ($sort == "url_to") { ?>
                    <a href="<?php echo $sort_url_to ?>" class="<?= $order; ?>"><?php echo $column_url_to; ?></a>
                    <?php }else{ ?> 
                    <a href="<?php echo $sort_url_to ?>"><?php echo $column_url_to ?></a> <?php } ?>
                  </td>
                  <td class="text-right"><?php echo $column_action; ?></td>
                </tr>
              </thead>

              <tbody>
              <?php if ($redirects){ ?>
              <?php foreach ($redirects as $redirect){  ?>
                <tr>
                  <td class="text-center">
                    <input type="checkbox" name="selected[]" value="<?= $redirect[redirect_id]; ?>" />
                  </td>
                  
                  <td class="text-left"><?php echo $redirect[url_from]; ?></td>
                  <td class="text-left"><?php echo $redirect[url_to]; ?></td>
                  
                  <td class="text-right"><a href="<?php echo $redirect[edit] ?>" data-toggle="tooltip" title="<?php echo $button_edit ?>" class="btn btn-primary"><i class="fa fa-pencil"></i></a></td>
                </tr>
                <?php } ?>
                <?php }else { ?>
                <tr>
                  <td class="text-center" colspan="9"><?php echo $text_no_results; ?></td>
                </tr>
                <?php } ?>
              </tbody>
            </table>
          </div>
        </form>
        <div class="row">
          <div class="col-sm-6 text-left"><?php echo $pagination; ?></div>
          <div class="col-sm-6 text-right"><?php echo $results; ?></div>
        </div>
      </div>
    </div>

  </div>
</div>
