<?php
session_start();
///Construtoras listar
include "../phpconfig/config.php";
include "../phpconfig/valida_login.php";
include "../phpconfig/funcoes.php";
include "../includes/topo.php"; 

$sql = mysql_query("SELECT * FROM empresas ORDER BY id DESC");
$num = mysql_num_rows($sql);


$sql2 = mysql_query("SELECT * FROM empresas where id between 1 and 50000");




$n22 = "<loc>";



</script>

        <ul class="breadcrumb">
          <li><a href="<?php echo sti('adm');  ?>">Home</a></li>
          <li class="active">TODAS de <?php echo $num;    ?> empresas</li>
        </ul>


        <table class="table table-bordered">

        <thead>

        <?php  

          while($lin = mysql_fetch_assoc($sql2)){  ?>
          <tr id="listItem_<?php echo $lin['id']; ?>">

            <?php

            $cidade = retorna($lin['id_cidade'], 'l_cidades');
            $estado = retorna($lin['id_uf'], 'l_estados');
            $bairro = retorna($lin['id_bairro'], 'l_bairros');

            ?>
     <?php echo $estado['uf'].'-'.$lin['id'].'-'.$lin['id_uf'].'-'.$lin['id_cidade'].'-'.$lin['id_bairro'].'-'.$lin['slug'].'-'.$lin['empresa'].'-'.$lin['endereco'].'-'.$lin['telefone']; ?></br>
     
           <?php echo sti('urlbase');  ?><?php echo $estado['uf'].'*'.$lin['id'].'*'.$lin['id_uf'].'*'.$lin['id_cidade'].'*'.$lin['id_bairro'].'*'.$lin['slug'].'*'.$lin['empresa'].'*'.$lin['endereco'].'*'.$lin['telefone']; ?></br>
           
              
          <?php  } if($num==0){echo "<tr><td  colspan='16'>Não há cadastro de empresas</td></tr>";} ?>


        </tbody>
      </table>

<?php include "../includes/rodape.php"; ?>