<?php include('fncr-geral/configuracao_geral.php');
$pagina = "planos";
$blq_pag = "planos";
include('fncr-geral/permissoes_restricao.php');


// ************************************** GERAL **************************************

$sql = $bd->getConexao()->prepare('
SELECT g.*, ps.sistema, pr.descricao as regiao
FROM planos_grupos g
  LEFT JOIN planos_sistemas ps ON ps.id = g.id_plano_sistema
  LEFT JOIN planos_regiao pr ON pr.id = g.id_plano_regiao
  ');
if($sql->execute()){$grupos = $sql->fetchall(PDO::FETCH_ASSOC);}


?>
<!DOCTYPE html>
<html lang="pt-br">
<head>
  <?php include('fncr-geral/html-head.php');?>

<script type="text/javascript">

  // Confirmar utilização do ticket
  function ticketConfirm(id_ticket){
    loadingMsn('Confirmando Pagamento')
    $.ajax({
      url: 'scripts-app/gameid/scripts_ajax.php',
      type: 'POST', cache: false,
      data: {
        acao: "conf_utilizacao_ticket",
        id_ticket: id_ticket
      },
      success : function(r){
        try{ json = $.parseJSON(r)
          if(json.status=="ok"){
            gameidPainelRestart()
            $('.col_right #gid_ok').css('display', '')
          }
        }catch(e){}
      }
    });
  }
</script>

</head>
<body>

<!-- BARRA SUPERIOR -->
<?php include('barra-sup.php');?>
<!-- MENU PRINCIPAL -->
<?php include('menu.php');?>

<section id="content">
  <!-- MENSAGENS DE ALERTA -->
  <?php include('fncr-geral/mensagens.php');?>
  <div class="clearfix padder bg-fncr-clearfix">
<h3 class="m-b">Planos - Grupos</h3>
</div>

<section id="content" class="content-sidebar bg-white">
<section class="main">

<br>


  <div class="col-lg-12">
    <section class="panel">
      <header class="panel-heading">
        Grupos
      </header>
      <div class="table-responsive">
        <table class="table table-striped b-t text-small">
          <thead>
          <tr>
            <th class="text-center" width="1"></th>
            <th width="150">Sistema</th>
            <th>Descrição</th>
          </tr>
          </thead>
          <tbody>
          <?php foreach ($grupos as $l){?>
          <tr>
            <td class="text-info">
              <a href="planos_niveis.php?g=<?php echo $l['id']?>"><i class="fa fa-folder-open fa-lg" data-toggle="tooltip" data-placement="top" title="Entrar"></i></a>
            </td>
            <td><?php echo $l['sistema']?></td>
            <td><?php echo $l['regiao']?></td>
          </tr>
          <?php } ?>
          </tbody>
        </table>
      </div>
    </section>
  </div>

</section>
<!-- /.main -->
</section>

<!-- FOOTER -->
<?php include('footer.php');?>

<!-- app -->
<script src="js/app.js"></script>
<script src="js/app.plugin.js"></script>
<script src="js/app.data.js"></script>

</body>
</html>
<?php $bd = null; $bd_fn = null;?>