<?php require_once(ROOT . "/views/" . LANG . "/layouts/_header_c.php"); ?>

<div class="page-content-wrapper ">
  <div class="container">
    <div class="row">

    <?php foreach ($paysystems as $paysystem) : ?>

      <?php if ($paysystem['active_insert'] == 0) continue; ?>

      <div class="col-sm-6 col-lg-3">
        <div class="panel text-center insert_box">
          <div class="panel-body p-t-20">
            <img class="balancei_psimg m-b-5" src="assets/ps/<?=$paysystem['name']; ?>.png"style="
    box-shadow: 0 0 0 2px white;
    background-color: white;
">
            <form class="balancei_form" method="POST" action="">
              <input type="hidden" name="_tocken" value="<?=Session::$tocken; ?>">
              <input type="hidden" name="ps" value="<?=$paysystem['name']; ?>">
              <div class="form-group">
                <input name="amount" type="text" class="form-control balancei_input insert_new_input" maxlength="9" placeholder="Введите сумму пополнения... (руб.)" required>
              </div>
              <div class="form-group m-b-0">
                <button type="submit" class="btn waves-light btn-block balancei_btngo insert_new_btn"> Перейти к оплате </button>
              </div>
            </form>
          </div>
        </div>
      </div>

    <?php endforeach; ?>

    </div><!-- end row -->

  <?php if (count($last_inserts) > 0) : ?>

    <div class="row">
      <div class="col-lg-10 col-lg-offset-1">
        <div class="panel panel-default">
          <div class="panel-heading">
            <h3 class="panel-title racetabletitle"><i class="fa fa-list-ul"></i> Ваши последние пополнения</h3>
          </div>
          <div class="panel-body">
            <div class="row">
              <div class="col-xs-12">
                <div class="table-responsive">
                  <table class="table">
                    <thead>
                      <tr>
                        <th class="text-center">Дата пополнения</th>
                        <th class="text-center">Сумма пополнения</th>
                        <th class="text-center">Платежная система</th>
                        <th class="text-center">Статус</th>
                      </tr>
                    </thead>
                    <tbody>

                    <?php foreach ($last_inserts as $insert) : ?>

                      <tr class="text-center">
                        <td><?=date("d/m/Y в H:i", $insert['date_add']); ?></td>
                        <td><?=sprintf("%.2f", $insert['sum']); ?> руб.</td>
                        <td><?=$insert['payment_system']; ?></td>
                        <td><?=$insert['status']; ?></td>    
                      </tr> 

                    <?php endforeach; ?>

                    </tbody>
                  </table>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
    </div><!-- end row -->

  <?php endif; ?>

  </div><!-- container -->
</div> <!-- Page content Wrapper -->

<?php require_once(ROOT . "/views/" . LANG . "/layouts/_footer_c.php"); ?>
