<?php include_once('config.php') ?>

<!DOCTYPE html>
<html>

<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <title>Sisplan Web | Regras de Pedido</title>
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <link rel="stylesheet" href="plugins/fontawesome-free/css/all.min.css?versao=3.2510.21.1">
  <link rel="stylesheet" href="dist/css/adminlte.min.css?versao=3.2510.21.1">
  <link href='https://fonts.googleapis.com/css?family=Roboto:400,300,500,600,700,400italic' rel='stylesheet' type='text/css'>
  <link rel="stylesheet" href="dist/css/custom.css?versao=3.2510.21.1">
  <link rel="stylesheet" href="dist/css/sisplan.css?versao=3.2510.21.1">
  <link rel="stylesheet" href="dist/css/PesquisaVariosSelect2.css?versao=3.2510.21.1">
  <link rel="stylesheet" href="dist/css/sisplan.adjustDataTableButtons.css?versao=3.2510.21.1">
  <link rel="stylesheet" href="dist/css/sisplan.newColorsButtons.css?versao=3.2510.21.1">
  <link rel="stylesheet" type="text/css" href="dist/css/dataTables.bootstrap4.min.css?versao=3.2510.21.1" />
  <link rel="shortcut icon" href="favicon.ico">
  <link rel="stylesheet" href="plugins/toastr/toastr.min.css?versao=3.2510.21.1">
  <link rel="stylesheet" type="text/css" href="dist/css/driver.min.css?versao=3.2510.21.1" />
  <link rel="stylesheet" href="dist/css/jquery-ui.css?versao=3.2510.21.1">
  <link rel="stylesheet" href="plugins/select2/css/select2.min.css?versao=3.2510.21.1">
  <link rel="stylesheet" href="plugins/select2-bootstrap4-theme/select2-bootstrap4.min.css?versao=3.2510.21.1">
  <link rel="stylesheet" href="plugins/icheck-bootstrap/icheck-bootstrap.min.css?versao=3.2510.21.1">
  <style>
    .radioStyle {
      border: solid #e0e4e6;
      border-radius: 4px;
      border-width: 2px;
      padding: 7.25px;
      height: 136px;
    }

    .input-group>.custom-file,
    .input-group>.custom-select,
    .input-group>.form-control,
    .input-group>.form-control-plaintext {
      margin-bottom: 10px;
      bottom: -7px;

    }
    #tabelaRegraPedidoALTERACAO th.sorting:nth-child(3) {
      width: 550px !important;
      max-width: 550px !important;
    }

    #tabelaRegraPedidoALTERACAO td:nth-child(3) .d-flex {
      justify-content: flex-end !important;
    }

    #tabelaRegraPedidoALTERACAO td:nth-child(3) .form-group,
    #tabelaRegraPedidoALTERACAO td:nth-child(3) input,
    #tabelaRegraPedidoALTERACAO td:nth-child(3) select {
      margin-left: auto !important;
    }

    
  </style>
</head>

<body class="hold-transition sidebar-mini layout-fixed">
  <div class="wrapper">
    <div class="content-wrapper">
      <div class="content-header">
        <div class="container-fluid">
          <div class="row mb-2">
            <div class="col-sm-6 flex">
              <h1 class="m-0 text-dark">Regras de Pedido</h1>
              <button type="button" class="btn btn-info btn-sm ml-2" title="Tutorial" style="color: white;" id="tutorial">
                <i class="fas fa-question-circle"></i>
              </button>
            </div>
            <div class="col-sm-6">

            </div>
          </div>
        </div>
        <div class="container-fluid card">
          <div class="row card-body d-flex" id="abaGeral">

            <nav class="col-lg-12">
              <div class="nav nav-tabs d-flex flex-nowrap" id="nav-tab" role="tablist" style="text-decoration: none; max-width: none!important; white-space: nowrap!important; overflow-x: auto!important; overflow-y: hidden">
                <a class="nav-link abaLink" id="tabPedidoCapa" data-toggle="tab" href="#divPedidoCapa" role="tab" aria-controls="divPedidoCapa" aria-selected="false">Pedido</a>
              </div>
            </nav>
            <div class="tab-content col-lg-12" id="nav-tabContent">

              <div class="tab-pane fade" id="divPedidoCapa" role="tabpanel" aria-labelledby="tabPedidoCapa">
                <nav class="col-lg-12">
                  <div class="nav nav-tabs" id="nav-tab" role="tablist" style="text-decoration: none">
                    <a class="nav-link abaLink" id="tabInclusaoPedido" data-toggle="tab" href="#divInclusaoPedido" role="tab" aria-controls="divInclusaoPedido" aria-selected="false">Inclusão</a>
                    <a class="nav-link abaLink" id="tabAlteracaoPedido" data-toggle="tab" href="#divAlteracaoPedido" role="tab" aria-controls="divAlteracaoPedido" aria-selected="false">Alteração</a>
                  </div>
                </nav>
                <div class="tab-content col-lg-12" id="nav-tabContent">
                  <div class="tab-pane fade" id="divInclusaoPedido" role="subtabpanel" aria-labelledby="tabInclusaoPedido">
                    <div class="row" style="margin-top: 15px;">
                      <div class="col-sm-12">
                        <table id="tabelaRegraPedidoINCLUSAO" class="table table-sm table-select table-hover">
                          <thead>
                            <th>Regra</th>
                            <th>Descrição</th>
                            <th>Configuração</th>
                          </thead>
                          <tbody>
                          </tbody>
                        </table>
                      </div>
                    </div>
                  </div>
                  <div class="tab-pane fade" id="divAlteracaoPedido" role="subtabpanel" aria-labelledby="tabAlteracaoPedido">
                    <div class="row" style="margin-top: 15px;">
                      <div class="col-sm-12">
                        <table id="tabelaRegraPedidoALTERACAO" class="table table-sm table-select table-hover">
                          <thead>
                            <th>Regra</th>
                            <th>Descrição</th>
                            <th style="width: 500px;">Configuração</th>
                          </thead>
                          <tbody>
                          </tbody>
                        </table>
                      </div>
                    </div>
                  </div>
                </div>
              </div>

            </div>

            <div class="col-12" style="display: flex!important; justify-content: flex-end!important;">
              <button style="margin-top: 15px;" class="btn btnVerde btn-sisp" id="btnGravar">
                <i class="fas fa-save"></i> Gravar
              </button>
            </div>

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

    </div>
  </div>
  <?php
  include_once('../../modais.php');
  ?>
  <aside class="control-sidebar control-sidebar-dark">
  </aside>
  </div>
  <script src="plugins/jquery/jquery.min.js?versao=3.2510.21.1"></script>
  <script src="plugins/jquery-ui/jquery-ui.min.js?versao=3.2510.21.1"></script>
  <script type="text/javascript" src="dist/js/jquery.dataTables.js?versao=3.2510.21.1"></script>
  <script type="text/javascript" src="dist/js/dataTables.bootstrap4.min.js?versao=3.2510.21.1"></script>
  <script>
    $.widget.bridge('uibutton', $.ui.button);
  </script>
  <script src="plugins/bootstrap/js/bootstrap.bundle.min.js?versao=3.2510.21.1"></script>
  <script src="dist/js/adminlte.min.js?versao=3.2510.21.1"></script>
  <script src="dist/js/sisplan.js?versao=3.2510.21.1"></script>
  <script src="utils/funcoes.js?versao=3.2510.21.1"></script>
  <script src="utils/cookies.js?versao=3.2510.21.1"></script>
  <script src="dist/js/requisicoes.js?versao=3.2510.21.1"></script>
  <script src="dist/js/loadingoverlay.min.js?versao=3.2510.21.1"></script>
  <script src="dist/js/driver.min.js?versao=3.2510.21.1"></script>
  <script src="plugins/toastr/toastr.min.js?versao=3.2510.21.1"></script>
  <script src="plugins/select2/js/select2.full.min.js?versao=3.2510.21.1"></script>
  <script type="text/javascript" src="dist/js/sum().js?versao=3.2510.21.1"></script>
  <script type="text/javascript" src="config.js?versao=3.2510.21.1"></script>
  <script>
    $(document).ready(async function() {
      if (getCookie('usuario') == "") {
        window.location.href = `${BASE_URI}/login`;
        return;
      }

      let usuario = getCookie('usuario');
      let empresa = getCookie('empresa');

      ipInterno = IP_INTERNO;
      ipExterno = IP_EXTERNO;
      basicAuth = BASIC_AUTH;

      const temAcesso = await temAcessoTela('CADPADRAO');
      if (!temAcesso.resultado) {
        toastrAcesso(temAcesso, BASE_URI);
        return;
      }

      sArquivo = `${BASE_URI}/pages/pedregra/pedregra.js?versao=3.2510.21.1`;
      insereJavaScriptPagina(sArquivo);

    });
  </script>
</body>

</html>