<?php defined('BASEPATH') or exit('No direct script access allowed'); ?>
<!DOCTYPE html>
<html>
  <head>
    <title>Deposit #<?php echo $trx->de_id;?></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><a href="<?php echo site_url('admin/riwayat-deposit');?>">Riwayat Deposit</a></li>
        <li class="active"><span>Deposit #<?php echo $trx->de_id;?></span></li>
      </ul>
      <div class="row">
        <div class="col-sm-8">
          <div class="panel panel-default">
            <div class="panel-heading">
              <h3><i class="fa fa-list-alt"></i> Deposit #<?php echo $trx->de_id;?></h3>
            </div>
            <div class="table-responsive">
              <table class="table table-hover">
                <tbody>
                  <tr><td>ID</td><td><?php echo $trx->de_id;?></td></tr>
                  <tr><td>Tanggal</td><td><?php echo format_tanggal($trx->de_tanggal);?></td></tr>
                  <tr><td>Jumlah</td><td><?php echo format_uang2($trx->de_amount, $trx->de_rate, $this->payment->{$trx->de_payment}->template, $this->payment->{$trx->de_payment}->round);?></td></tr>
                  <tr><td>Pembayaran</td><td><?php echo html_escape($this->payment->{$trx->de_payment}->nama);?></td></tr>
                  <tr><td>Status</td><td><?php echo ucfirst(str_replace('_',' ',$trx->de_status));?></td></tr>
                </tbody>
              </table>
            </div>
            <div class="panel-footer">
              <a class="btn btn-danger pull-right" data-toggle="modal" data-target="#myModal" href="<?php echo site_url('admin/riwayat-deposit/hapus/'.$trx->de_id);?>"><i class="fa fa-remove"></i> Hapus</a>
              <a class="btn btn-default" href="<?php echo site_url('admin/riwayat-deposit/edit/'.$trx->de_id);?>" data-toggle="modal" data-target="#myModal"><i class="fa fa-edit"></i> Edit</a>
            </div>
          </div>
        </div>
        <div class="col-sm-4 hidden-print">
          <div class="panel panel-default">
            <div class="panel-heading">
              <h3><i class="fa fa-user"></i> User</h3>
            </div>
            <div class="table-responsive">
              <table class="table table-hover">
                <tbody>
                  <tr><td>Nama Lengkap</td><td><a href="<?php echo site_url('admin/users/profil/'.$trx->us_id);?>"><?php echo ($trx->us_verified ? '<span class="text-success"><i class="fa fa-check-circle"></i></span> ' : '') . html_escape($trx->us_name);?></a></td></tr>
                  <tr><td>Saldo</td><td><?php echo format_uang2($trx->us_balance, 0);?></td></tr>
                  <tr><td>Total Transaksi</td><td><?php echo $trx->us_total_order;?> sukses</td></tr>
                  <tr><td>Masuk Terakhir</td><td><?php echo format_tanggal($trx->us_lastdate);?></td></tr>
                </tbody>
              </table>
            </div>
          </div>
          <div class="panel panel-default">
            <div class="panel-heading" style="white-space: nowrap; overflow: hidden;">
              <h3><i class="fa fa-money"></i> Bayar Dengan <?php echo html_escape($this->payment->{$trx->de_payment}->nama);?></h3>
            </div>
            <div class="panel-body">
              <?php if ($trx->de_status == 'pending' && $trx->de_tanggal < $exp_time):?>
              <div class="alert alert-danger">
                <h3>Tidak Berlaku</h3>Pembayaran belum diselesaikan dan pesanan sudah tidak berlaku lagi.
              </div>
              <?php elseif ($trx->de_status == 'pending' && $trx->de_tanggal > $exp_time):?>
              <div class="alert alert-info">
                <h3>Pending</h3>Pembayaran belum diselesainkan dan masih berlaku sampai <?php echo format_tanggal($trx->de_tanggal + (3600 * $deposit->time));?>.
              </div>
              <?php elseif ($trx->de_status == 'refund'):?>
              <div class="alert alert-danger">
                <h3>Refund</h3>Pembayaran dikembalikan / refund.
              </div>
              <?php elseif ($trx->de_status == 'sukses'):?>
              <div class="alert alert-success">
                <h3>Sukses</h3>Pembayaran sudah diselesaikan dan saldo sudah ditambahkan ke akun user.
              </div>
              <?php elseif ($trx->de_status == 'dalam_proses'):?>
              <div class="alert alert-warning">
                <h3>Dalam Proses</h3>Pembayaran sudah diselesaikan dan sedang menunggu konfirmasi Administartor.
              </div>
              <?php endif;?>
              <?php if ($trx->keterangan): ?>
              <div class="table-responsive">
                <table class="table table-striped">
                  <tbody>
                    <tr><td>Tanggal</td><td><?php echo format_tanggal($trx->tanggal);?></td></tr>
                    <tr><td>Keterangan</td><td><?php echo nl2br(html_escape($trx->keterangan));?></td></tr>
                    <tr><td>Kredit</td><td><?php echo $trx->kredit;?></td></tr>
                  </tbody>
                </table>
              </div>
              <?php endif;?>
              <?php if ($trx->de_status == 'dalam_proses'):?>
              <div class="row">
                <div class="col-xs-6">
                  <a class="btn btn-primary btn-block" data-toggle="modal" data-target="#myModal" href="<?php echo site_url('admin/payments/'.$trx->de_payment.'/confirm_deposit/'.$trx->de_id);?>"><i class="fa fa-check"></i> Confirm</a>
                </div>
                <div class="col-xs-6">
                  <a class="btn btn-danger btn-block" data-toggle="modal" data-target="#myModal" href="<?php echo site_url('admin/payments/'.$trx->de_payment.'/reject_deposit/'.$trx->de_id);?>"><i class="fa fa-remove"></i> Reject</a>
                </div>
              </div>
              <?php endif;?>
            </div>
          </div>
        </div>
      </div>
    </div>
    <?php include_once(VIEWPATH.'includes/foot.php'); ?>
  </body>

</html>