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

$aba_tab = "categorias";

// Funções do Financeiro
$config_fingeral = array( "tipo"=>"financeiro" );
require_once('scripts/financeiro/functions_fingeral.php');


// ********************** CENTROS DE CUSTOS ***********************

// Cadastrando Categoria
if(isset($_POST['cadastrar']) && $_POST['cadastrar'] == 'categoria') {

  $nome = $_POST['nome'];
  if($nome!=""){

    $id_pai = $_POST['id_pai'];

    $sql = $bd->getConexao()->prepare('INSERT INTO fingeral_categorias
    (nome, id_pai, status) VALUES (:nome, :id_pai, 1)');
    $sql->bindValue(':nome', $nome, PDO::PARAM_STR);
    $sql->bindValue(':id_pai', $id_pai, PDO::PARAM_STR);
    if( $sql->execute() );

    $resul_fingeral_categorias = criarArvoreCat(sel_fingeral("categorias"));

    $mensagem = "ok";
  }else{
    $mensagem = "erro";
    $mensagem_frase = "O nome da Categoria não foi preenchido.";
  }
  $aba_tab = "categorias";
}


// Editando Categoria
if(isset($_POST['editar']) && $_POST['editar'] == 'categoria') {

  $id_cat = $_POST['id_cat'];
  $nome = $_POST['nome'];

  $sql = $bd->getConexao()->prepare('SELECT * FROM fingeral_categorias WHERE id = :id');
  $sql->bindValue(':id', $id_cat, PDO::PARAM_STR);
  if( $sql->execute() ) { $resul_cat = $sql->fetch(PDO::FETCH_ASSOC);}

  if($resul_cat['ordem']==0){

    $id_pai = $_POST['id_pai'];
    $status = $_POST['status'];

    $sql = $bd->getConexao()->prepare('UPDATE fingeral_categorias SET
    nome = :nome,
    status = :status,
    id_pai = :id_pai
    WHERE id = :id');
    $sql->bindValue(':id', $id_cat, PDO::PARAM_STR);
    $sql->bindValue(':nome', $nome, PDO::PARAM_STR);
    $sql->bindValue(':status', $status, PDO::PARAM_STR);
    $sql->bindValue(':id_pai', $id_pai, PDO::PARAM_STR);
    if( $sql->execute() );

    $categorias_filhas = criarArvoreCat(sel_fingeral("categorias"), $id_cat, 'id');

    $ids='';
    foreach($categorias_filhas as $l){$ids.=$l.',';}
    $ids = substr($ids, 0, -1);

    if(count($categorias_filhas)>0){
      // Status Filhas
      $sql = $bd->getConexao()->prepare('UPDATE fingeral_categorias SET
      status = :status
      WHERE id in('.$ids.')');
      $sql->bindValue(':status', $status, PDO::PARAM_STR);
      if( $sql->execute() );
    }

  }else{

    $sql = $bd->getConexao()->prepare('UPDATE fingeral_categorias SET
    nome = :nome WHERE id = :id');
    $sql->bindValue(':id', $id_cat, PDO::PARAM_STR);
    $sql->bindValue(':nome', $nome, PDO::PARAM_STR);
    if( $sql->execute() );

  }

  $resul_fingeral_categorias = criarArvoreCat(sel_fingeral("categorias"));

  $mensagem = "ok";
  $aba_tab = "categorias";
}


// Excluir Categoria
if(isset($_POST['excluir']) && $_POST['excluir'] == 'categoria') {

  $id_cat = $_POST['id_cat'];

  $sql = $bd->getConexao()->prepare('SELECT * FROM fingeral_categorias WHERE id = :id');
  $sql->bindValue(':id', $id_cat, PDO::PARAM_STR);
  if( $sql->execute() ) { $resul_cat = $sql->fetch(PDO::FETCH_ASSOC);}

  if($resul_cat['ordem']==0){

    $sql = $bd->getConexao()->prepare('UPDATE fingeral_categorias SET excluido = 1 WHERE id = :id');
    $sql->bindValue(':id', $id_cat, PDO::PARAM_STR);
    if( $sql->execute() );

    $categorias_filhas = criarArvoreCat(sel_fingeral("categorias"), $id_cat, 'id');

    $ids='';
    foreach($categorias_filhas as $l){$ids.=$l.',';}
    $ids = substr($ids, 0, -1);

    if(count($categorias_filhas)>0){
      // Status Filhas
      $sql = $bd->getConexao()->prepare('UPDATE fingeral_categorias SET excluido = 1 WHERE id in('.$ids.') AND sistema = 0');
      if( $sql->execute() );
    }

    $resul_fingeral_categorias = criarArvoreCat(sel_fingeral("categorias"));

    $mensagem = "ok";
    $aba_tab = "categorias";
  }
}


// ********************** CONTAS ***********************

// Cadastrando Conta
if(isset($_POST['cadastrar']) && $_POST['cadastrar'] == 'conta') {

  $nome = $_POST['nome'];
  $sigla = $_POST['sigla'];
  $descricao = $_POST['descricao'];

  $sql = $bd->getConexao()->prepare('INSERT INTO fingeral_contas
  (nome, sigla, descricao, status) VALUES (:nome, :sigla, :descricao, 1)');
  $sql->bindValue(':nome', $nome, PDO::PARAM_STR);
  $sql->bindValue(':sigla', $sigla, PDO::PARAM_STR);
  $sql->bindValue(':descricao', $descricao, PDO::PARAM_STR);
  if( $sql->execute() );

  $resul_fingeral_contas = sel_fingeral("contas");

  $mensagem = "ok";
  $aba_tab = "contas";
}


// Editando Conta
if(isset($_POST['editar']) && $_POST['editar'] == 'conta') {

  $id_conta = $_POST['id_conta'];
  if(isset($_POST['nome'])){$nome = $_POST['nome'];}
  if(isset($_POST['sigla'])){$sigla = $_POST['sigla'];}
  $status = $_POST['status'];
  $descricao = $_POST['descricao'];

  $sql = $bd->getConexao()->prepare('SELECT * FROM fingeral_contas WHERE id = :id');
  $sql->bindValue(':id', $id_conta, PDO::PARAM_STR);
  if( $sql->execute() ) { $resul_conta = $sql->fetch(PDO::FETCH_ASSOC);}

  $sql = $bd->getConexao()->prepare('UPDATE fingeral_contas SET
    nome = :nome,
    sigla = :sigla,
    descricao = :descricao,
    status = :status
    WHERE id = :id');
  $sql->bindValue(':id', $id_conta, PDO::PARAM_STR);
  $sql->bindValue(':nome', $nome, PDO::PARAM_STR);
  $sql->bindValue(':sigla', $sigla, PDO::PARAM_STR);
  $sql->bindValue(':descricao', $descricao, PDO::PARAM_STR);
  $sql->bindValue(':status', $status, PDO::PARAM_STR);
  if( $sql->execute() );

  $resul_fingeral_contas = sel_fingeral("contas");

  $mensagem = "ok";
  $aba_tab = "contas";
}


// Excluir Conta
if(isset($_POST['excluir']) && $_POST['excluir'] == 'conta') {

  $id_conta = $_POST['id_conta'];

  $sql = $bd->getConexao()->prepare('UPDATE fingeral_contas SET excluido = 1 WHERE id = :id');
  $sql->bindValue(':id', $id_conta, PDO::PARAM_STR);
  if( $sql->execute() );

  $resul_fingeral_contas = sel_fingeral("contas");

  $mensagem = "ok";
  $aba_tab = "contas";
}



// ********************** FORNECEDORES ***********************

// Cadastrando Fornecedor
if(isset($_POST['cadastrar']) && $_POST['cadastrar'] == 'fornecedor') {

  $nome = $_POST['nome'];
  $endereco = $_POST['endereco'];
  $cidade = $_POST['cidade'];
  $uf = $_POST['uf'];
  $tel1 = $_POST['tel1'];
  $tel2 = $_POST['tel2'];
  $contato = $_POST['contato'];
  $descricao = $_POST['descricao'];
  $folha = $_POST['folha'];
  $folha_categoria = $_POST['folha_categoria'];
  $folha_valor = moeda($_POST['folha_valor']);
  $bonus_mensal = moeda($_POST['bonus_mensal']);
  $status = $_POST['status'];

  $sql = $bd->getConexao()->prepare('INSERT INTO fingeral_fornecedores
  (nome, endereco, cidade, uf, tel1, tel2, contato, descricao, folha, folha_categoria, folha_valor, bonus_mensal, status) VALUES
  (:nome, :endereco, :cidade, :uf, :tel1, :tel2, :contato, :descricao, :folha, :folha_categoria, :folha_valor, :bonus_mensal, :status)');
  $sql->bindValue(':nome', $nome, PDO::PARAM_STR);
  $sql->bindValue(':endereco', $endereco, PDO::PARAM_STR);
  $sql->bindValue(':cidade', $cidade, PDO::PARAM_STR);
  $sql->bindValue(':uf', $uf, PDO::PARAM_STR);
  $sql->bindValue(':tel1', $tel1, PDO::PARAM_STR);
  $sql->bindValue(':tel2', $tel2, PDO::PARAM_STR);
  $sql->bindValue(':contato', $contato, PDO::PARAM_STR);
  $sql->bindValue(':descricao', $descricao, PDO::PARAM_STR);
  $sql->bindValue(':folha', $folha, PDO::PARAM_STR);
  $sql->bindValue(':folha_categoria', $folha_categoria, PDO::PARAM_STR);
  $sql->bindValue(':folha_valor', $folha_valor, PDO::PARAM_STR);
  $sql->bindValue(':bonus_mensal', $bonus_mensal, PDO::PARAM_STR);
  $sql->bindValue(':status', $status, PDO::PARAM_STR);
  if( $sql->execute() );

  $resul_fingeral_fornecedores = sel_fingeral("fornecedores");

  $mensagem = "ok";
  $aba_tab = "fornecedores";
}


// Editar Fornecedor
if(isset($_POST['editar']) && $_POST['editar'] == 'fornecedor') {

  $id_forn = $_POST['id_forn'];

  $nome = $_POST['nome'];
  $endereco = $_POST['endereco'];
  $cidade = $_POST['cidade'];
  $uf = $_POST['uf'];
  $tel1 = $_POST['tel1'];
  $tel2 = $_POST['tel2'];
  $contato = $_POST['contato'];
  $descricao = $_POST['descricao'];
  $folha = $_POST['folha'];
  $folha_categoria = $_POST['folha_categoria'];
  $folha_valor = moeda($_POST['folha_valor']);
  $bonus_mensal = moeda($_POST['bonus_mensal']);
  $status = $_POST['status'];

  $sql = $bd->getConexao()->prepare('UPDATE fingeral_fornecedores SET
    nome = :nome,
    endereco = :endereco,
    cidade = :cidade,
    uf = :uf,
    tel1 = :tel1,
    tel2 = :tel2,
    contato = :contato,
    descricao = :descricao,
    folha = :folha,
    folha_categoria = :folha_categoria,
    folha_valor = :folha_valor,
    bonus_mensal = :bonus_mensal,
    status = :status
    WHERE id = :id');
  $sql->bindValue(':id', $id_forn, PDO::PARAM_STR);
  $sql->bindValue(':nome', $nome, PDO::PARAM_STR);
  $sql->bindValue(':endereco', $endereco, PDO::PARAM_STR);
  $sql->bindValue(':cidade', $cidade, PDO::PARAM_STR);
  $sql->bindValue(':uf', $uf, PDO::PARAM_STR);
  $sql->bindValue(':tel1', $tel1, PDO::PARAM_STR);
  $sql->bindValue(':tel2', $tel2, PDO::PARAM_STR);
  $sql->bindValue(':contato', $contato, PDO::PARAM_STR);
  $sql->bindValue(':descricao', $descricao, PDO::PARAM_STR);
  $sql->bindValue(':folha', $folha, PDO::PARAM_STR);
  $sql->bindValue(':folha_categoria', $folha_categoria, PDO::PARAM_STR);
  $sql->bindValue(':folha_valor', $folha_valor, PDO::PARAM_STR);
  $sql->bindValue(':bonus_mensal', $bonus_mensal, PDO::PARAM_STR);
  $sql->bindValue(':status', $status, PDO::PARAM_STR);
  if( $sql->execute() );

  $resul_fingeral_fornecedores = sel_fingeral("fornecedores");

  $mensagem = "ok";
  $aba_tab = "fornecedores";
}



// Excluir Fornecedor
if(isset($_POST['excluir']) && $_POST['excluir'] == 'fornecedor') {

  $id_forn = $_POST['id_forn'];

  $sql = $bd->getConexao()->prepare('UPDATE fingeral_fornecedores SET excluido = 1 WHERE id = :id');
  $sql->bindValue(':id', $id_forn, PDO::PARAM_STR);
  if( $sql->execute() );

  $resul_fingeral_fornecedores = sel_fingeral("fornecedores");

  $mensagem = "ok";
  $aba_tab = "fornecedores";
}

?>

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

  <script type="text/javascript">

    $(document).ready(function() {

      // Modal Nova Categoria
      $("#modal_nova_categoria").on('show.bs.modal', function(event){
        var button = $(event.relatedTarget);  // Button that triggered the modal
        var id_pai = button.data('id_pai');
        $(this).find("[name='id_pai']").val(id_pai).change();;
      });

      // Modal Editar Categoria
      $("#modal_editar_categoria").on('show.bs.modal', function(event){
        var button = $(event.relatedTarget);  // Button that triggered the modal
        var id_cat = button.data('id_cat');
        var id_pai = button.data('id_pai');
        var nome = button.data('nome');
        var status = button.data('status');
        $(this).find("[name='id_pai']").val(id_pai).change();;
        $(this).find("[name='nome']").val(nome);
        $(this).find("[name='id_cat']").val(id_cat);
        // Ajustes Iniciais
        $(this).find("label.btn").removeClass('active');
        $(this).find("input[name=status][value='"+status+"']").prop("checked",true).parent().addClass("active");
      });

      // Modal Excluir Categoria
      $("#modal_excluir_categoria").on('show.bs.modal', function(event){
        var button = $(event.relatedTarget);  // Button that triggered the modal
        var id_cat = button.data('id_cat');
        $(this).find("[name='id_cat']").val(id_cat);
      });

      // Modal Editar Conta
      $("#modal_editar_conta").on('show.bs.modal', function(event){
        var button = $(event.relatedTarget);  // Button that triggered the modal
        var id_conta = button.data('id_conta');
        var nome = button.data('nome');
        var sigla = button.data('sigla');
        var descricao = button.data('descricao');
        var status = button.data('status');
        $(this).find("[name='id_conta']").val(id_conta).change();;
        $(this).find("[name='status']").val(status).change();;
        $(this).find("[name='sigla']").val(sigla);
        $(this).find("[name='nome']").val(nome);
        $(this).find("[name='descricao']").val(descricao);

        var tipo_sistema = button.data('tipo_sistema');
        if(tipo_sistema==1){
          $(this).find("[name='nome']").attr('disabled', 'disabled')
          $(this).find("[name='sigla']").attr('disabled', 'disabled')
        }else{
          $(this).find("[name='nome']").removeAttr('disabled')
          $(this).find("[name='sigla']").removeAttr('disabled')
        }
      });

      // Modal Excluir Forma de Pagamento
      $("#modal_excluir_conta").on('show.bs.modal', function(event){
        var button = $(event.relatedTarget);  // Button that triggered the modal
        var id_conta = button.data('id_conta');
        $(this).find("[name='id_conta']").val(id_conta);
      });

      // Modal Editar Fornecedor
      $("#modal_editar_fornecedor").on('show.bs.modal', function(event){
        var button = $(event.relatedTarget);  // Button that triggered the modal
        var id_forn = button.data('id_forn');
        var nome = button.data('nome');
        var endereco = button.data('endereco');
        var cidade = button.data('cidade');
        var uf = button.data('uf');
        var tel1 = button.data('tel1');
        var tel2 = button.data('tel2');
        var contato = button.data('contato');
        var descricao = button.data('descricao');
        var folha = button.data('folha');
        var folha_categoria = button.data('folha_categoria');
        var folha_valor = button.data('folha_valor');
        var bonus_mensal = button.data('bonus_mensal');
        var status = button.data('status');
        $(this).find("[name='id_forn']").val(id_forn);
        $(this).find("[name='nome']").val(nome);
        $(this).find("[name='endereco']").val(endereco);
        $(this).find("[name='cidade']").val(cidade);
        $(this).find("[name='uf']").val(uf);
        $(this).find("[name='tel1']").val(tel1);
        $(this).find("[name='tel2']").val(tel2);
        $(this).find("[name='contato']").val(contato);
        $(this).find("[name='descricao']").val(descricao);
        $(this).find("[name='folha']").val(folha).change();
        $(this).find("[name='folha_categoria']").val(folha_categoria).change();
        $(this).find("[name='folha_valor']").val(folha_valor);
        $(this).find("[name='bonus_mensal']").val(bonus_mensal);
        $(this).find("[name='status']").val(status).change();
      });

      // Modal Excluir Forma de Pagamento
      $("#modal_excluir_fornecedor").on('show.bs.modal', function(event){
        var button = $(event.relatedTarget);  // Button that triggered the modal
        var id_forn = button.data('id_forn');
        $(this).find("[name='id_forn']").val(id_forn);
      });

    });

  </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">Financeiro - Registros</h3>
    </div>

<section id="content" class="content-sidebar bg-white">
<section class="main">
<section class="panel">
  <header class="panel-heading text-right">
    <ul class="nav nav-tabs pull-left" id="tabs_app">
      <?php if($fingeral_centros){ ?><li<?php if($aba_tab == 'categorias'){echo ' class="active"';}?>><a href="#categorias" data-toggle="tab"><i class="fa fa-tags fa-lg text-info"></i> <strong> Centros de Custo</strong></a></li><?php } ?>
      <?php if($fingeral_contas){ ?><li<?php if($aba_tab == 'contas'){echo ' class="active"';}?>><a href="#contas" data-toggle="tab"><i class="fa fa-bank fa-lg text-info"></i> <strong> Contas</strong></a></li><?php } ?>
      <?php if($fingeral_fornecedores){ ?><li<?php if($aba_tab == 'fornecedores'){echo ' class="active"';}?>><a href="#fornecedores" data-toggle="tab"><i class="fa fa-truck fa-lg text-info"></i> <strong> Fornecedores</strong></a></li><?php } ?>
    </ul>
  </header>
<div class="panel-body">
<div class="tab-content">

<!-- ABA: CATEGORIAS -->
<?php if($fingeral_centros){ ?>
<div class="tab-pane <?php if($aba_tab == 'categorias'){echo 'active';}?>" id="categorias">
  <div class="row">
    <div class="col-lg-12">
      <section class="panel">
        <header class="panel-heading">
          <div class="pull-left" style="padding-top: 4px;">Centros de Custo</div>
        </header>
        <table class="table table-striped b-t text-small">
          <thead>
          <tr>
            <th width="10"></th>
            <th class="text-center" width="80" style="padding: 0 0 3px 0">
              <?php if($fingeral_centros_editar==1){ ?>
              <a data-toggle="modal" href="#modal_nova_categoria" data-backdrop="static" data-id_pai="0" title="Nova Categoria Pai"><i class="fa fa-plus-square fa-1x"></i></a>
              <?php } ?>
            </th>
            <th>Nome</th>
            <th class="text-center" width="120">Status</th>
            <th class="text-center" width="1"></th>
          </tr>
          </thead>
          <tbody>
          <?php foreach($resul_fingeral_categorias as $l) {

            $nivel = $l['nivel'];

            if($nivel>1){
              $img='';
              for($i=2;$i<=$nivel;$i++){
                if($i==$nivel){
                  $img.= '<img src="images/cat_level.png" style="height: 32px;margin-right: 10px;margin-left: 5px;opacity: 0.5">';
                }else{
                  $img.= '<img src="images/cat_level_0.png" style="height: 32px;margin-right: 20px;margin-left: 5px;opacity: 0.5">';
                }
              }
              $cat=$img.'<span style="color: #a0a0a1">' .$l['indice'].' - </span>'.$l['nome'];
            }else{
              $cat='<div class="pull-left" style="padding-top: 8px; font-weight: bold">'.$l['indice'].' - '.$l['nome'].'</div>';
            }

            if($l['status']==0){
              $status = '<span class="text-danger">Bloqueado</span>';
            }else{
              $status = '<span class="text-inverse">Liberado</span>';
            }

            ?>
            <tr>
              <td class="text-center" style="padding: 10px 0 0 0; font-size: 10px"><?php echo $l['id']?></td>
              <td class="text-info text-center" style="padding: 6px 5px">
                <?php if($fingeral_centros_editar==1){ ?>
                <a data-toggle="modal" href="#modal_editar_categoria" data-backdrop="static"  data-id_cat="<?php echo $l['id']?>" data-id_pai="<?php echo $l['id_pai']?>" data-nome="<?php echo $l['nome']?>" data-status="<?php echo $l['status']?>" title="Editar"><i class="fa fa-pencil-square fa-1x" style="margin-right: 10px"></i></a>
                <a data-toggle="modal" href="#modal_nova_categoria" data-backdrop="static" data-id_pai="<?php echo $l['id']?>" title="Nova Categoria Filha"><i class="fa fa-plus-square fa-1x"></i></a>
                <?php } ?>
              </td>
              <td style="padding: 0 5px"><?php echo $cat?></td>
              <td class="text-center"><?php echo $status?></td>
              <td class="text-center" style="padding: 6px 5px">
                <?php if($fingeral_centros_editar==1){ ?>
                <a data-toggle="modal" href="#modal_excluir_categoria" data-backdrop="static" data-id_cat="<?php echo $l['id']?>" title="Excluir"><i class="fa fa-times fa-1x text-danger"></i></a>
                <?php } ?>
              </td>
            </tr>
            <?php } ?>
          </tbody>
        </table>
      </section>
    </div>
  </div>
</div>
<!-- FIM DA ABA -->
<?php } ?>


<!-- ABA: CONTAS -->
<?php if($fingeral_contas){ ?>
<div class="tab-pane <?php if($aba_tab == 'contas'){echo 'active';}?>" id="contas">
  <div class="row">

    <div class="col-lg-12">
      <section class="panel">
        <header class="panel-heading">
          <div class="pull-left" style="padding-top: 4px;">Contas</div>
          <?php if($fingeral_contas_editar==1){ ?>
          <a data-toggle="modal" href="#modal_nova_conta" data-backdrop="static" class="btn btn-inverse btn-xs pull-right jsinbloq">Nova Conta</a>
          <?php } ?>
        </header>
        <table class="table table-striped b-t text-small">
          <thead>
          <tr>
            <th width="10"></th>
            <th width="1"></th>
            <th class="text-center" width="1">Sigla</th>
            <th width="250">Conta</th>
            <th width="700">Descrição</th>
            <th class="text-center" width="70">Status</th>
            <th class="text-center" width="1"></th>
          </tr>
          </thead>
          <tbody>
          <?php foreach($resul_fingeral_contas as $l) {
            if($l['status']==0){
              $status = '<span class="text-danger">Bloqueado</span>'; }else{
              $status = '<span class="text-inverse">Liberado</span>'; }
          ?>
            <tr>
              <td class="text-center" style="padding: 10px 0 0 0; font-size: 10px"><?php echo $l['id']?></td>
              <td class="text-info text-center" style="padding: 6px 5px">
                <?php if($fingeral_contas_editar==1){ ?>
                <a data-toggle="modal" href="#modal_editar_conta" data-backdrop="static"
                   data-id_conta="<?php echo $l['id']?>"
                   data-nome="<?php echo $l['nome']?>"
                   data-sigla="<?php echo $l['sigla']?>"
                   data-descricao="<?php echo $l['descricao']?>"
                   data-status="<?php echo $l['status']?>"
                   title="Editar"><i class="fa fa-pencil-square fa-1x"></i></a>
                <?php } ?>
              </td>
              <td class="text-center"><?php echo $l['sigla']?></td>
              <td><?php echo $l['nome']?></td>
              <td><?php echo $l['descricao']?></td>
              <td class="text-info text-center"><?php echo $status?></td>
              <td class="text-info text-center" style="padding: 6px 5px">
                <?php if($fingeral_contas_editar==1){ ?>
                <a data-toggle="modal" href="#modal_excluir_conta" data-backdrop="static" data-id_conta="<?php echo $l['id']?>" title="Excluir"><i class="fa fa-times fa-1x text-danger"></i></a>
                <?php } ?>
              </td>
            </tr>
          <?php } ?>
          </tbody>
        </table>
      </section>
    </div>

  </div>
</div>
<!-- FIM DA ABA -->
<?php } ?>


<!-- ABA: FORNECEDORES -->
<?php if($fingeral_fornecedores){ ?>
<div class="tab-pane <?php if($aba_tab == 'fornecedores'){echo 'active';}?>" id="fornecedores">
  <div class="row">
    <div class="col-lg-12">
      <section class="panel">
        <header class="panel-heading">
          <div class="pull-left" style="padding-top: 4px;">Fornecedores</div>
          <?php if($fingeral_fornecedores_editar==1){ ?>
          <a data-toggle="modal" href="#modal_novo_fornecedor" data-backdrop="static" class="btn btn-inverse btn-xs pull-right jsinbloq">Novo Fornecedor</a>
          <?php } ?>
        </header>
        <table class="table table-striped b-t text-small">
          <thead>
          <tr>
            <th rowspan="2" width="10"></th>
            <th rowspan="2" width="1"></th>
            <th rowspan="2" width="300">Nome</th>
            <th rowspan="2">Descrição</th>
            <th class="text-center" colspan="4">Folha</th>
            <th rowspan="2" class="text-center" width="70">Status</th>
            <th rowspan="2" class="text-center" width="1"></th>
          </tr>
          <tr>
            <th class="text-center" width="50">Ativo</th>
            <th width="120">Tipo</th>
            <th class="text-right" width="120">Valor</th>
            <th class="text-right" width="100">Bonus Mensal</th>
          </tr>
          </thead>
          <tbody>
          <?php foreach($resul_fingeral_fornecedores as $l) {

            if($l['status']==0){
              $status = '<span class="text-danger">Bloqueado</span>'; }else{
              $status = '<span class="text-inverse">Liberado</span>'; }

          ?>
            <tr>
              <td class="text-center" style="padding: 10px 0 0 0; font-size: 10px"><?php echo $l['id']?></td>
              <td class="text-info text-center" style="padding: 6px 5px">
                <?php if($fingeral_fornecedores_editar==1){ ?>
                <a data-toggle="modal" href="#modal_editar_fornecedor" data-backdrop="static"
                   data-id_forn="<?php echo $l['id']?>"
                   data-nome="<?php echo $l['nome']?>"
                   data-endereco="<?php echo $l['endereco']?>"
                   data-cidade="<?php echo $l['cidade']?>"
                   data-uf="<?php echo $l['uf']?>"
                   data-tel1="<?php echo $l['tel1']?>"
                   data-tel2="<?php echo $l['tel2']?>"
                   data-contato="<?php echo $l['contato']?>"
                   data-descricao="<?php echo $l['descricao']?>"
                   data-folha="<?php echo $l['folha']?>"
                   data-folha_categoria="<?php echo $l['folha_categoria']?>"
                   data-folha_valor="<?php echo echomoeda($l['folha_valor'])?>"
                   data-bonus_mensal="<?php echo echomoeda($l['bonus_mensal'])?>"
                   data-status="<?php echo $l['status']?>"
                   title="Editar"><i class="fa fa-pencil-square fa-1x"></i></a>
                <?php } ?>
              </td>
              <td><?php echo $l['nome']?></td>
              <td><?php echo $l['descricao']?></td>
              <td class="text-center"><?php echo $l['folha']==1 ? "SIM" : ""?></td>
              <td><?php echo $l['folha']==1 ? $l['folha_categoria_nome'] : ""?></td>
              <td class="text-right"><?php echo $l['folha']==1 ? echomoeda($l['folha_valor']) : ""?></td>
              <td class="text-right"><?php echo $l['folha']==1 ? echomoeda($l['bonus_mensal']) : ""?></td>
              <td class="text-center"><?php echo $status?></td>
              <td class="text-center" style="padding: 6px 5px">
                <?php if($fingeral_fornecedores_editar==1){ ?>
                <a data-toggle="modal" href="#modal_excluir_fornecedor" data-backdrop="static" data-id_forn="<?php echo $l['id']?>" title="Excluir"><i class="fa fa-times fa-1x text-danger"></i></a>
                <?php } ?>
              </td>
            </tr>
          <?php } ?>
          </tbody>
        </table>
      </section>
    </div>
  </div>
</div>
<!-- FIM DA ABA -->
<?php } ?>


</div>
</div>

</section>
</section>
</section>

<!-- FOOTER -->
<?php include('footer.php');?>
<?php include('scripts/financeiro/modals.php');?>

<!-- CATEGORIAS - Nova Categoria -->
<div id="modal_nova_categoria" class="modal fade bs-example-modal-sm">
  <form class="m-b-none" method="post" action="" data-validate="parsley" enctype="multipart/form-data">
    <input type="hidden" name="cadastrar" value="categoria" />
    <div class="modal-dialog modal-sm" style="width: 450px;">
      <div class="modal-content">
        <div class="modal-header bg-info">
          <button type="button" class="close" data-dismiss="modal"><i class="fa fa-times"></i></button>
          <h4 class="modal-title" id="myModalLabel">Nova Categoria</h4>
        </div>
        <div class="modal-body">
          <div class="row">
            <div class="col-lg-12">
              <section class="panel">
                <table class="table table-striped b-t text-small">
                  <thead>
                  <tr>
                    <th>Descrição</th>
                    <th>Valor</th>
                  </tr>
                  </thead>
                  <tbody>
                  <tr>
                    <td style="padding-top: 10px">Nome</td>
                    <td class="text-center"><input type="text" class="form-control nome" name="nome" placeholder="Ex: Telefone / Internet" data-parsley-required="true"></td>
                  </tr>
                  <tr>
                    <td style="padding-top: 12px">Categoria PAI</td>
                    <td>
                      <select class="select_filtro" name="id_pai" style="width: 100%">
                        <option value="0">Nenhuma</option>
                        <?php foreach($resul_fingeral_categorias as $l){
                          echo '<option value="'.$l['id'].'">'.$l['nome'].'</option>';
                        }?>
                      </select>
                    </td>
                  </tr>
                  </tbody>
                </table>
              </section>
            </div>
          </div>
        </div>
        <div class="modal-footer">
          <button type="button" class="btn btn-sm btn-default" data-dismiss="modal">Cancelar</button>
          <button type="submit" class="btn btn-sm btn-info" data-loading-text="Criando">Criar</button>
        </div>
      </div>
    </div>
  </form>
</div>

<!-- CATEGORIAS - Editar Categoria -->
<div id="modal_editar_categoria" class="modal fade bs-example-modal-sm">
  <form class="m-b-none" method="post" action="" enctype="multipart/form-data">
    <input type="hidden" name="editar" value="categoria" />
    <input type="hidden" name="id_cat" value="">
    <div class="modal-dialog modal-sm" style="width: 450px;">
      <div class="modal-content">
        <div class="modal-header bg-info">
          <button type="button" class="close" data-dismiss="modal"><i class="fa fa-times"></i></button>
          <h4 class="modal-title" id="myModalLabel">Editar Categoria</h4>
        </div>
        <div class="modal-body">
          <div class="row">
            <div class="col-lg-12">
              <section class="panel">
                <table class="table table-striped b-t text-small">
                  <thead>
                  <tr>
                    <th>Descrição</th>
                    <th>Valor</th>
                  </tr>
                  </thead>
                  <tbody>
                  <tr>
                    <td style="padding-top: 10px">Nome</td>
                    <td class="text-center"><input type="text" class="form-control nome" name="nome" placeholder="Ex: Telefone / Internet"></td>
                  </tr>
                  <tr>
                    <td style="padding-top: 12px">Categoria PAI</td>
                    <td>
                      <select class="select_filtro" name="id_pai" style="width: 100%">
                        <option value="0">Nenhuma</option>
                        <?php foreach($resul_fingeral_categorias as $l){
                          echo '<option value="'.$l['id'].'">'.$l['nome'].'</option>';
                        }?>
                      </select>
                    </td>
                  </tr>
                  <tr>
                    <td style="padding-top: 12px">Status</td>
                    <td>
                      <div class="btn-group" data-toggle="buttons">
                        <label class="btn btn-sm btn-white btn-on active">
                          <input type="radio" name="status" value="0" checked>Bloqueado
                        </label>
                        <label class="btn btn-sm btn-white btn-on">
                          <input type="radio" name="status" value="1">Liberado
                        </label>
                      </div>
                    </td>
                  </tr>
                  </tbody>
                </table>
              </section>
            </div>
          </div>
        </div>
        <div class="modal-footer">
          <button type="button" class="btn btn-sm btn-default" data-dismiss="modal">Cancelar</button>
          <button type="submit" class="btn btn-sm btn-info" data-loading-text="Salvar">Salvar</button>
        </div>
      </div>
    </div>
  </form>
</div>

<!-- CATEGORIAS - Excluir Categoria -->
<div id="modal_excluir_categoria" class="modal fade bs-example-modal-sm">
  <form class="m-b-none" method="post" action="" enctype="multipart/form-data">
    <input type="hidden" name="excluir" value="categoria" />
    <input type="hidden" name="id_cat" value="">
    <div class="modal-dialog modal-sm" style="width: 450px;">
      <div class="modal-content">
        <div class="modal-header bg-danger">
          <button type="button" class="close" data-dismiss="modal"><i class="fa fa-times"></i></button>
          <h4 class="modal-title" id="myModalLabel">Excluir Registro?</h4>
        </div>
        <div class="modal-footer">
          <button type="button" class="btn btn-sm btn-default" data-dismiss="modal">Cancelar</button>
          <button type="submit" class="btn btn-sm btn-danger pull-left" data-loading-text="Excluindo">Excluir</button>
        </div>
      </div>
    </div>
  </form>
</div>


<!-- CONTAS - Nova Conta -->
<div id="modal_nova_conta" class="modal fade bs-example-modal-sm">
  <form class="m-b-none" method="post" action="" data-validate="parsley" enctype="multipart/form-data">
    <input type="hidden" name="cadastrar" value="conta" />
    <div class="modal-dialog modal-sm" style="width: 450px;">
      <div class="modal-content">
        <div class="modal-header bg-info">
          <button type="button" class="close" data-dismiss="modal"><i class="fa fa-times"></i></button>
          <h4 class="modal-title" id="myModalLabel">Nova Conta</h4>
        </div>
        <div class="modal-body">
          <div class="row">
            <div class="col-lg-12">
              <section class="panel">
                <table class="table table-striped b-t text-small">
                  <thead>
                  <tr>
                    <th>Nome</th>
                    <th class="text-center" width="30%">Sigla</th>
                  </tr>
                  </thead>
                  <tbody>
                  <tr>
                    <td class="text-info text-center"><input type="text" class="form-control nome" name="nome" placeholder="Ex: Banco 001" data-parsley-required="true"></td>
                    <td class="text-info text-center"><input type="text" class="form-control nome" name="sigla" maxlength="3" placeholder="Ex: B1" data-parsley-required="true"></td>
                  </tr>
                  <tr>
                    <td class="text-info" colspan="2"><input type="text" class="form-control nome" name="descricao" placeholder="Descrição (Opcional)"></td>
                  </tr>
                  </tbody>
                </table>
              </section>
            </div>
          </div>
        </div>
        <div class="modal-footer">
          <button type="button" class="btn btn-sm btn-default" data-dismiss="modal">Cancelar</button>
          <button type="submit" class="btn btn-sm btn-info">Criar</button>
        </div>
      </div>
    </div>
  </form>
</div>

<!-- CONTAS - Editar Conta -->
<div id="modal_editar_conta" class="modal fade bs-example-modal-sm">
  <form class="m-b-none" method="post" action="" data-validate="parsley" enctype="multipart/form-data">
    <input type="hidden" name="editar" value="conta" />
    <input type="hidden" name="id_conta" value="" />
    <div class="modal-dialog modal-sm" style="width: 450px;">
      <div class="modal-content">
        <div class="modal-header bg-info">
          <button type="button" class="close" data-dismiss="modal"><i class="fa fa-times"></i></button>
          <h4 class="modal-title" id="myModalLabel">Editar Conta</h4>
        </div>
        <div class="modal-body">
          <div class="row">
            <div class="col-lg-12">
              <section class="panel">
                <table class="table table-striped b-t text-small">
                  <thead>
                  <tr>
                    <th>Campo</th>
                    <th class="text-center" width="70%">Valor</th>
                  </tr>
                  </thead>
                  <tbody>
                  <tr>
                    <td style="padding-top: 11px">Nome</td>
                    <td class="text-info text-center"><input type="text" class="form-control nome" name="nome" placeholder="Ex: Banco 001" data-parsley-required="true"></td>
                  </tr>
                  <tr>
                    <td style="padding-top: 11px">Sigla</td>
                    <td class="text-info text-center"><input type="text" class="form-control nome" name="sigla" maxlength="3" placeholder="Ex: B1" data-parsley-required="true"></td>
                  </tr>
                  <tr>
                    <td style="padding-top: 11px">Descrição</td>
                    <td class="text-info" colspan="2"><input type="text" class="form-control nome" name="descricao" placeholder="(Opcional)"></td>
                  </tr>
                  <tr>
                    <td style="padding-top: 11px">Status</td>
                    <td class="text-info">
                      <select class="select_filtro" name="status" style="width: 100%">
                        <option value="0">Bloqueado</option>
                        <option value="1">Liberado</option>
                      </select>
                    </td>
                  </tr>
                  </tbody>
                </table>
              </section>
            </div>
          </div>
        </div>
        <div class="modal-footer">
          <button type="button" class="btn btn-sm btn-default" data-dismiss="modal">Cancelar</button>
          <button type="submit" class="btn btn-sm btn-info" data-loading-text="Salvando">Salvar</button>
        </div>
      </div>
    </div>
  </form>
</div>

<!-- FORMA DE PAGAMENTO - Excluir Forma -->
<div id="modal_excluir_conta" class="modal fade bs-example-modal-sm">
  <form class="m-b-none" method="post" action="" enctype="multipart/form-data">
    <input type="hidden" name="excluir" value="conta" />
    <input type="hidden" name="id_conta" value="">
    <div class="modal-dialog modal-sm" style="width: 450px;">
      <div class="modal-content">
        <div class="modal-header bg-danger">
          <button type="button" class="close" data-dismiss="modal"><i class="fa fa-times"></i></button>
          <h4 class="modal-title" id="myModalLabel">Excluir Registro?</h4>
        </div>
        <div class="modal-footer">
          <button type="button" class="btn btn-sm btn-default" data-dismiss="modal">Cancelar</button>
          <button type="submit" class="btn btn-sm btn-danger pull-left" data-loading-text="Excluindo">Excluir</button>
        </div>
      </div>
    </div>
  </form>
</div>


<!-- FORNECEDORES - Novo Fornecedor -->
<div id="modal_novo_fornecedor" class="modal fade bs-example-modal-sm">
  <form class="m-b-none" method="post" action="" data-validate="parsley" enctype="multipart/form-data">
    <input type="hidden" name="cadastrar" value="fornecedor" />
    <div class="modal-dialog modal-sm" style="width: 550px;">
      <div class="modal-content">
        <div class="modal-header bg-info">
          <button type="button" class="close" data-dismiss="modal"><i class="fa fa-times"></i></button>
          <h4 class="modal-title" id="myModalLabel">Novo Fornecedor</h4>
        </div>
        <div class="modal-body">
          <div class="row">
            <div class="col-lg-12">
              <section class="panel">
                <table class="table table-striped b-t text-small">
                  <thead>
                  <tr>
                    <th width="170">Campo</th>
                    <th>Valor</th>
                  </tr>
                  </thead>
                  <tbody>
                  <tr>
                    <td style="padding-top: 11px">Nome</td>
                    <td class="text-info text-center"><input type="text" class="form-control" name="nome" placeholder="Ex: Mercado xyz" data-parsley-required="true"></td>
                  </tr>
                  <tr>
                    <td style="padding-top: 11px">Endereço</td>
                    <td class="text-info text-center"><input type="text" class="form-control" name="endereco" placeholder="Ex: Av. Brasil, 99"></td>
                  </tr>
                  <tr>
                    <td style="padding-top: 11px">Cidade - UF</td>
                    <td class="text-info text-center">
                      <input type="text" class="form-control pull-left" name="cidade" placeholder="Ex: Foz do Iguaçu" style="width: 68%;margin-right: 10px">
                      <input type="text" class="form-control pull-left" name="uf" maxlength="2" placeholder="Ex: PR" style="width: 28%">
                    </td>
                  </tr>
                  <tr>
                    <td style="padding-top: 11px">Telefones</td>
                    <td class="text-info text-center">
                      <input type="text" class="form-control pull-left" name="tel1" placeholder="Ex: 00 1122-3344" style="width: 48%;margin-right: 10px">
                      <input type="text" class="form-control pull-left" name="tel2" placeholder="Ex: 00 1122-3344" style="width: 48%">
                    </td>
                  </tr>
                  <tr>
                    <td style="padding-top: 11px">Nome de Contato</td>
                    <td class="text-info text-center"><input type="text" class="form-control" name="contato" placeholder="Ex: Fulano de Tal"></td>
                  </tr>
                  <tr>
                    <td style="padding-top: 11px">Descrição</td>
                    <td class="text-info text-center"><textarea class="form-control" name="descricao" placeholder="Ex: Fornecedor de Carnes" rows="5"></textarea></td>
                  </tr>
                  <tr>
                    <td style="padding-top: 11px">Folha de Pgto</td>
                    <td class="text-info">
                      <select class="select_filtro" name="folha" style="width: 100%">
                        <option value="0">Não</option>
                        <option value="1" selected>Sim</option>
                      </select>
                    </td>
                  </tr>
                  <tr>
                    <td style="padding-top: 11px">Folha - Categoria</td>
                    <td class="text-info">
                      <select class="select_filtro" name="folha_categoria" style="width: 100%">
                        <option value="0">Nenhuma</option>
                        <?php foreach($resul_fingeral_categorias as $l){
                          echo '<option value="'.$l['id'].'">'.$l['nome'].'</option>';
                        }?>
                      </select>
                    </td>
                  </tr>
                  <tr>
                    <td style="padding-top: 11px">Folha - Valor</td>
                    <td class="text-center"><input type="text" class="form-control pull-left" name="folha_valor" style="width: 48%;margin-right: 10px"></td>
                  </tr>
                  <tr>
                    <td style="padding-top: 11px">Bonus mensal fixo - Valor</td>
                    <td class="text-center"><input type="text" class="form-control pull-left" name="bonus_mensal" style="width: 48%;margin-right: 10px"></td>
                  </tr>
                  <tr>
                    <td style="padding-top: 11px">Status</td>
                    <td class="text-info">
                      <select class="select_filtro" name="status" style="width: 100%">
                        <option value="0">Bloqueado</option>
                        <option value="1" selected>Liberado</option>
                      </select>
                    </td>
                  </tr>
                  </tbody>
                </table>
              </section>
            </div>
          </div>
        </div>
        <div class="modal-footer">
          <button type="button" class="btn btn-sm btn-default" data-dismiss="modal">Cancelar</button>
          <button type="submit" class="btn btn-sm btn-info">Criar</button>
        </div>
      </div>
    </div>
  </form>
</div>

<!-- FORNECEDORES - Editar Fornecedor -->
<div id="modal_editar_fornecedor" class="modal fade bs-example-modal-sm">
  <form class="m-b-none" method="post" action="" data-validate="parsley" enctype="multipart/form-data">
    <input type="hidden" name="editar" value="fornecedor" />
    <input type="hidden" name="id_forn" value="" />
    <div class="modal-dialog modal-sm" style="width: 450px;">
      <div class="modal-content">
        <div class="modal-header bg-info">
          <button type="button" class="close" data-dismiss="modal"><i class="fa fa-times"></i></button>
          <h4 class="modal-title" id="myModalLabel">Editar Fornecedor</h4>
        </div>
        <div class="modal-body">
          <div class="row">
            <div class="col-lg-12">
              <section class="panel">
                <table class="table table-striped b-t text-small">
                  <thead>
                  <tr>
                    <th width="170">Campo</th>
                    <th>Valor</th>
                  </tr>
                  </thead>
                  <tbody>
                  <tr>
                    <td style="padding-top: 11px">Nome</td>
                    <td class="text-info text-center"><input type="text" class="form-control" name="nome" placeholder="Ex: Mercado xyz" data-parsley-required="true"></td>
                  </tr>
                  <tr>
                    <td style="padding-top: 11px">Endereço</td>
                    <td class="text-info text-center"><input type="text" class="form-control" name="endereco" placeholder="Ex: Av. Brasil, 99"></td>
                  </tr>
                  <tr>
                    <td style="padding-top: 11px">Cidade - UF</td>
                    <td class="text-info text-center">
                      <input type="text" class="form-control pull-left" name="cidade" placeholder="Ex: Foz do Iguaçu" style="width: 68%;margin-right: 10px">
                      <input type="text" class="form-control pull-left" name="uf" maxlength="2" placeholder="Ex: PR" style="width: 28%">
                    </td>
                  </tr>
                  <tr>
                    <td style="padding-top: 11px">Telefones</td>
                    <td class="text-info text-center">
                      <input type="text" class="form-control pull-left" name="tel1" placeholder="Ex: 00 1122-3344" style="width: 48%;margin-right: 10px">
                      <input type="text" class="form-control pull-left" name="tel2" placeholder="Ex: 00 1122-3344" style="width: 48%">
                    </td>
                  </tr>
                  <tr>
                    <td style="padding-top: 11px">Nome de Contato</td>
                    <td class="text-info text-center"><input type="text" class="form-control" name="contato" placeholder="Ex: Fulano de Tal"></td>
                  </tr>
                  <tr>
                    <td style="padding-top: 11px">Descrição</td>
                    <td class="text-info text-center"><textarea class="form-control" name="descricao" placeholder="Ex: Fornecedor de Carnes" rows="5"></textarea></td>
                  </tr>
                  <tr>
                    <td style="padding-top: 11px">Folha de Pgto</td>
                    <td class="text-info">
                      <select class="select_filtro" name="folha" style="width: 100%">
                        <option value="0">Não</option>
                        <option value="1">Sim</option>
                      </select>
                    </td>
                  </tr>
                  <tr>
                    <td style="padding-top: 11px">Folha - Categoria</td>
                    <td class="text-info">
                      <select class="select_filtro" name="folha_categoria" style="width: 100%">
                        <option value="0">Nenhuma</option>
                        <?php foreach($resul_fingeral_categorias as $l){
                          echo '<option value="'.$l['id'].'">'.$l['nome'].'</option>';
                        }?>
                      </select>
                    </td>
                  </tr>
                  <tr>
                    <td style="padding-top: 11px">Folha - Valor</td>
                    <td class="text-center"><input type="text" class="form-control pull-left" name="folha_valor" style="width: 48%;margin-right: 10px"></td>
                  </tr>
                  <tr>
                    <td style="padding-top: 11px">Bonus mensal fixo - Valor</td>
                    <td class="text-center"><input type="text" class="form-control pull-left" name="bonus_mensal" style="width: 48%;margin-right: 10px"></td>
                  </tr>
                  <tr>
                    <td style="padding-top: 11px">Status</td>
                    <td class="text-info">
                      <select class="select_filtro" name="status" style="width: 100%">
                        <option value="0">Bloqueado</option>
                        <option value="1">Liberado</option>
                      </select>
                    </td>
                  </tr>
                  </tbody>
                </table>
              </section>
            </div>
          </div>
        </div>
        <div class="modal-footer">
          <button type="button" class="btn btn-sm btn-default" data-dismiss="modal">Cancelar</button>
          <button type="submit" class="btn btn-sm btn-info">Salvar</button>
        </div>
      </div>
    </div>
  </form>
</div>

<!-- CATEGORIAS - Excluir Fornecedor -->
<div id="modal_excluir_fornecedor" class="modal fade bs-example-modal-sm">
  <form class="m-b-none" method="post" action="" enctype="multipart/form-data">
    <input type="hidden" name="excluir" value="fornecedor" />
    <input type="hidden" name="id_forn" value="">
    <div class="modal-dialog modal-sm" style="width: 450px;">
      <div class="modal-content">
        <div class="modal-header bg-danger">
          <button type="button" class="close" data-dismiss="modal"><i class="fa fa-times"></i></button>
          <h4 class="modal-title" id="myModalLabel">Excluir Registro?</h4>
        </div>
        <div class="modal-footer">
          <button type="button" class="btn btn-sm btn-default" data-dismiss="modal">Cancelar</button>
          <button type="submit" class="btn btn-sm btn-danger pull-left" data-loading-text="Excluindo">Excluir</button>
        </div>
      </div>
    </div>
  </form>
</div>

<!-- app -->
<script src="js/app.js"></script>
<script src="js/app.plugin.js"></script>
<script src="js/app.data.js"></script>
<!-- Sparkline Chart -->
<script src="js/charts/sparkline/jquery.sparkline.min.js"></script>
<!-- Easy Pie Chart -->
<script src="js/charts/easypiechart/jquery.easy-pie-chart.js"></script>
<!-- select2 -->
<script src="js/select2/select2.min.js"></script>
<!-- fuelux -->
<script src="js/fuelux/fuelux.js"></script>
<!-- datepicker -->
<script src="js/datepicker/bootstrap-datepicker.js"></script>
<!-- slider -->
<script src="js/slider/bootstrap-slider.js"></script>
<!-- file input -->
<script src="js/file-input/bootstrap.file-input.js"></script>
<!-- combodate -->
<script src="js/combodate/moment.min.js"></script>
<script src="js/combodate/combodate.js"></script>
<!-- parsley -->
<script src="js/parsley.js"></script>
<!-- Flot -->
<script src="js/charts/flot/jquery.flot.min.js"></script>
<script src="js/charts/flot/jquery.flot.tooltip.min.js"></script>
<script src="js/charts/flot/jquery.flot.resize.js"></script>
<script src="js/charts/flot/jquery.flot.orderBars.js"></script>
<script src="js/charts/flot/jquery.flot.pie.min.js"></script>

<!-- Autocompletar -->
<script type="text/javascript" src="js/simpleAutoComplete.js?id=1"></script>

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