<?php
include 'header.php';
include 'erpc_adquirentes_toolbar.php'; //Nome da tabela _list.php
include_once 'connect.php';

// Método para post de Query Avançada
$consulta = "SELECT * FROM erpc_adquirentes where st_ativo = 1";
?>

<div class="block">
  <div class="header">
  <h2>Vendedores</h2>
  </div>
  <div class="content">
    <div class="table-responsive">
      <table class="table table-bordered table-striped table-responsible sortable">
        <thead>
          <tr>
            <!-- <th width=02%><input type="checkbox" class="checkall" /></th> -->
			<th width=10%>ID</th>
            <th width=35%>Adquirente</th>
            <th width=15%>Taxa Débito</th>
            <th width=15%>Taxa Crédito à Vista</th>
            <th width=15%>Taxa Crédito Parcelado</th>
			<th width=05%>Editar</th>
			<th width=05%>Excluir</th>
          </tr>
        </thead>
        <tbody>

          <?php

			$resultado = mysqli_query($conexao, $consulta) or die ($erro = mysqli_error($conexao));
			if (mysqli_num_rows($resultado)>0) {
            while ($registro = mysqli_fetch_assoc($resultado)){

            $id      = $registro['id'];
            $id_crip = base64_encode($id);
	  		$ds_adquirente = $registro['ds_adquirente'];
	  		$vl_pr_taxa_debito = $registro['vl_pr_taxa_debito'];
	  		$vl_pr_taxa_credito_a_vista = $registro['vl_pr_taxa_credito_a_vista'];
	  		$vl_pr_taxa_credito_parcelado = $registro['vl_pr_taxa_credito_parcelado'];

            echo "<tr>";            
                echo "<td>$id</td>";
                echo "<td>$ds_adquirente</td>";
    			echo "<td>$vl_pr_taxa_debito</td>";
    			echo "<td>$vl_pr_taxa_credito_a_vista</td>";
    			echo "<td>$vl_pr_taxa_credito_parcelado</td>";
    
                echo "<td class='text-center'><a href='erpc_adquirentes_edit.php?id=$id_crip'>  <i class='glyphicon glyphicon-pencil' title='Editar'><span class='sr-only'>Editar</span></i></a></td>";
                echo "<td class='text-center'><a href='erpc_adquirentes_remove.php?id=$id_crip'><i class='glyphicon glyphicon-remove' title='Remover'><span class='sr-only'>Remover</span></i></a></td>";
          	echo "</tr>";
            }
          }
          ?>
        </tbody>
      </table>
    </div> <!-- table-responsive -->
  </div> <!-- content -->
</div> <!-- block -->
<?php include 'footer.php';?>
