<?php $render('header', ['loggedUser'=>$loggedUser, 'title'=>$titlePage]); ?>
<?=$render('sidebar', [
  'loggedUser'=>$loggedUser, 
  'pageActive'=>$pageActive,
  'permissions'=>$permissions
]);?>

<!-- Content System -->
<div class="content-wrapper">
  <div class="pages">
    <h3>Tipo de Contas a Pagar</h3>
    <div class="permissions">
      <!-- Message -->

      <?php if(!empty($error)): ?>
        <div class="alert <?= $error['alertType'];?>" role="alert">
          <?= $error['msg']; ?>
        </div>
      <?php endif; ?>

      <div class="form-group">
        <button class="btn btn-primary lh-30" id="open_new_btpt">Adicionar Novo</button>
      </div>

      <!-- /Message -->
      <form method="POST" id="form_validator" class="form-btp-edit">
        <div class="form-group">
          <label>Todos os Itens</label><br/>

          <div class="items-btp-group" id="btp-form">
            <?php foreach($btpList as $p): ?>
              <div class="form-control no-padding">
                <input type="text" name="input_<?= $p['id']; ?>" value="<?= $p['name']; ?>" readonly class="form-control">

                <button id="btp_edit" class="btn btn-info" data-item="input_<?= $p['id']; ?>" >Editar</button>
                <button id="input_<?= $p['id']; ?>" class="btn btn-success hide-before-edit" data-item-save="input_<?= $p['id']; ?>" >Salvar</button>              
              </div>
            <?php endforeach; ?>
          </div>
        </div>
      </form>
    </div>
  </div>  		
</div>

<div class="message-add" id="show-msg-add"></div>

<?=$render('new_btp_type', ['ref_form' => 'btp-form', 'title_modal' => 'Novo Tipo de Conta a Pagar']);?>

<script type="text/javascript" src="<?=$base?>/assets/js/setings.js"></script>

<!-- /.content-system -->

<?=$render('footer');?>