<?php
include 'header.php';
include 'connect.php';
require_once 'inc/messages.php';
require_once 'inc/usuario.php';

checkLogin('login.php');

$id_usuario = $_SESSION[SESSION_USER_NAME]['id'];
?>
</br></br></br>
<form id=validate_custom method=POST action="erpc_mapa.php">
  <div class=block>
    <div class=header>
      <h2>Filtro do Mapa Teste</h2>
    </div>
      <div class="block">
    <div class="content">
      <?php
      displayMessagesAndErrors(true); ?>
    </div>
  </div>
   
<div class="content">
      <!-- Nav tabs -->
<ul class="nav nav-tabs" role="tablist">
  <li role="presentation" class="active"><a id="mform1" href="#form1" aria-controls="form1" role="tab" data-toggle="tab">Clientes</a></li>
  <li role="presentation"><a id="mform2" href="#form2" aria-controls="form2" role="tab" data-toggle="tab">Vendas</a></li>
  <li role="presentation"><a id="mform3" href="#form3" aria-controls="form3" role="tab" data-toggle="tab">Produtos</a></li>
</ul>
      <!-- Tab panes -->
<div class="tab-content">
  <div role="tabpanel" class="tab-pane fade in active" id="form1"><!--tab-1-->
  <div class="table-responsive">
  <table class="table table-bordered table-striped table-responsible sortable" >
      <thead>
          <tr>
              <th width=03% >Marcar</th>
              <th width=05% >ID</th>
               <th width=50% >Nome</th>
          </tr>
      </thead>
      <tbody>
  <?php


	$consulta_cliente = "select erpc_clientes.id
	                    ,erpc_clientes.ds_nome
					from erpc_clientes
					where ds_endereco is not null
					and erpc_clientes.st_ativo=1";
	
                $sql_cliente = mysqli_query($conexao, $consulta_cliente) or die (mysqli_error());

                 if(mysqli_num_rows($sql_cliente) > 0 ){
                    while ($registro 	= mysqli_fetch_array($sql_cliente)){
                        $id  		        = $registro['id'];
                        $ds_nome  			= $registro['ds_nome'];
                    echo "<tr>";
                      echo "<td> <input type='checkbox' value='" . $id . "' name='clientes[]' /></td>";
                      echo "<td>" . $id  . "</td>";
                      echo "<td>" . $ds_nome  . "</td>";
                      echo "</tr>";

					  }
                }
    
    ?></tbody>
    </table>
    </div>
  </div><!--tab-1-->

  <div role="tabpanel" class="tab-pane fade" id="form2" hidden><!--tab-2-->
  <h1>Em Breve!</h1>
  </div><!--tab-2-->

  <div role="tabpanel" class="tab-pane fade" id="form3" hidden><!--tab-3-->
<h1>Em Breve!</h1>
  </div><!--tab-3-->


</div><!-- Tab panes -->
</div><!--content-->
    <div class=footer>
      <div class="side pull-right">
        <div class=btn-group>
		        <button class="btn btn-default" type="button" onClick="window.history.go(-1)" value="Voltar">Voltar</button>
            <button class="btn btn-success" type="submit" value="buscar" name="buscar">Buscar</button>

		    </div>
      </div>
    </div>

  </div>
</form>


<?php include 'footer.php'; ?>
