D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
var
/
www
/
html
/
rosario
/
adm
/
app
/
gre
/
Views
/
Empresa
/
Filename :
VieEmpresaListar.php
back
Copy
<?php // VIEW - Listar Empresas if (!defined('URL')) { header("Location: /"); exit(); } //var_dump($this->Dados['listEmpresa']); ?> <style> tbody { display:block; max-height:200px; overflow-y:auto; } thead, tbody tr { display:table; width:100%; table-layout:fixed; } thead { width: calc( 100% - 1em ) } </style> <div class="content p-1"> <div class="list-group-item"> <div class="d-flex"> <div class="mr-auto p-2"> <h2 class="display-4 titulo">Listar Empresas</h2> </div> <?php //var_dump($this->Dados['botao']); if ($this->Dados['botao']['cad_empr']) { ?> <a href="<?php echo URLADM . 'con-empresa-cadastrar/cad-empr'; ?>"> <div class="p-2"> <button class="btn btn-outline-success btn-sm"> Cadastrar </button> </div> </a> <?php } ?> </div> <?php if (empty($this->Dados['listEmpresa'])) { ?> <div class="alert alert-danger" role="alert"> Nenhuma Empresa encontrada! <button type="button" class="close" data-dismiss="alert" aria-label="Close"> <span aria-hidden="true">×</span> </button> </div> <?php } if (isset($_SESSION['msg'])) { echo $_SESSION['msg']; unset($_SESSION['msg']); } ?> <div class="table-responsive"> <table id="example-crm" class="datatable-idoso-gre stripe " cellspacing="0" width="100%"> <thead> <tr> <th>ID</th> <th class="d-none d-lg-table-cell">CNPJ</th> <th>Nome Fantasia</th> <th class="d-none d-lg-table-cell">Município</th> <th class="d-none d-lg-table-cell">Situação</th> <th class="text-center">Ações</th> </tr> </thead> <tbody> <?php foreach ($this->Dados['listEmpresa'] as $empresa) { extract($empresa); ?> <tr> <th><?php echo $id; ?></th> <td> <?php $str = preg_replace("/([0-9]{2})([0-9]{3})([0-9]{3})([0-9]{4})([0-9]{2})/", "$1.$2.$3/$4-$5", $cnpj); echo $str; ?> </td> <td> <?php echo $nome_fantasia; ?> </td> <td> <?php echo ($municipio); ?> </td> <td class="d-none d-lg-table-cell"> <span class="badge badge-<?php echo $cor_cr; ?>"><?php echo $nome_sit; ?></span> </td> <td class="text-center"> <span class="d-none d-md-block"> <?php if ($this->Dados['botao']['vis_empr']) { echo "<a href='" . URLADM . "con-empresa-ver/ver-empr/$id' class='btn btn-outline-primary btn-sm'>Visualizar</a> "; } if ($this->Dados['botao']['edit_empr']) { echo "<a href='" . URLADM . "con-empresa-editar/edit-empr/$id' class='btn btn-outline-warning btn-sm'>Editar</a> "; } if ($this->Dados['botao']['del_empr']) { echo "<a href='" . URLADM . "con-empresa-apagar/apagar-empr/$id' class='btn btn-outline-danger btn-sm' data-confirm='Tem certeza de que deseja excluir o item selecionado?'>Apagar</a> "; } ?> </span> <div class="dropdown d-block d-md-none"> <button class="btn btn-primary dropdown-toggle btn-sm" type="button" id="acoesListar" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> Ações </button> <div class="dropdown-menu dropdown-menu-right" aria-labelledby="acoesListar"> <?php if ($this->Dados['botao']['vis_empr']) { echo "<a class='dropdown-item' href='" . URLADM . "con-empresa-ver/ver-empr/$id'>Visualizar</a>"; } if ($this->Dados['botao']['edit_empr']) { echo "<a class='dropdown-item' href='" . URLADM . "con-empresa-editar/edit-empr/$id'>Editar</a>"; } if ($this->Dados['botao']['del_empr']) { echo "<a class='dropdown-item' href='" . URLADM . "con-empresa-apagar/apagar-empr/$id' data-confirm='Tem certeza de que deseja excluir o item selecionado?'>Apagar</a>"; } ?> </div> </div> </td> </tr> <?php } ?> </tbody> </table> </div> </div> </div>