<?php defined('BASEPATH') or exit('No direct script access allowed'); ?>
<!DOCTYPE html>
<html>
  <head>
    <title>Admin &gt; Sistem</title>
    <?php include_once(VIEWPATH.'includes/head.php'); ?>
  </head>
  <body>
    <?php include_once(VIEWPATH. '/admin/_navbar.php'); ?>
    <div class="container">
      <ul class="breadcrumb">
        <li><a href="<?php echo site_url();?>"><i class="fa fa-home"></i></a></li>
        <li><a href="<?php echo site_url('admin');?>">Admin Panel</a></li>
        <li class="active"><span>Sistem</span></li>
      </ul>
      <div class="row">
        <div class="col-sm-4 col-md-3">
        <?php include(dirname(__FILE__).'/_sidebar.php');?>
        </div>
        <div class="col-sm-8 col-md-9">
          <div class="panel panel-default">
            <div class="panel-heading">
              <h3><i class="fa fa-rotate-left"></i> Restore</h3>
            </div>
            <?php if (!$files):?>
              <div class="alert alert-warning">Tidak ada file yang dibackup.</div>
              <?php else:?>
              <div class="table-responsive">
                <table class="table table-bordered" style="margin-bottom: 0;">
                  <thead>
                    <tr>
                      <th>File</th>
                      <th>Ukuran</th>
                      <th>Tanggal Diperbarui</th>
                      <th style="width: 100px;" class="text-center">Tidakan</th>
                    </tr>
                  </thead>
                  <tbody>
                    <?php foreach ($files as $file):?>
                    <tr>
                      <td style="vertical-align: middle;"><a href="<?php echo site_url('admin/sistem/restore/download/'.$file['name']);?>" target="_blank"><i class="fa fa-file-archive-o"></i> <?php echo $file['name'];?></a></td>
                      <td style="vertical-align: middle;"><?php echo format_size($file['size']);?></td>
                      <td style="vertical-align: middle;"><?php echo format_tanggal($file['time']);?></td>
                      <td class="text-center" style="width: 100px;">
                        <a href="<?php echo site_url('admin/sistem/restore/file/'.$file['name']);?>" data-toggle="modal" data-target="#myModal" class="btn btn-default btn-xs <?php echo $file['version'] == $old_version->versi ? '' : 'disabled';?>"><i class="fa fa-rotate-left"></i></a>
                        &nbsp;
                        <a href="<?php echo site_url('admin/sistem/restore/delete/'.$file['name']);?>" data-toggle="modal" data-target="#myModal" class="btn btn-danger btn-xs"><i class="fa fa-remove"></i></a>
                      </td>
                    </tr>
                    <?php endforeach;?>
                  </tbody>
                </table>
              </div>
            <?php endif;?>
          </div>
        </div>
      </div>
    </div>
    <?php include_once(VIEWPATH.'includes/foot.php'); ?>
  </body>
</html>