<?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 | Preço Material</title>
  <!-- Tell the browser to be responsive to screen width -->
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <!-- Font Awesome -->
  <link rel="stylesheet" href="../plugins/fontawesome-free/css/all.min.css?versao=3.258.28.1">

  <!-- Theme style -->
  <link rel="stylesheet" href="../dist/css/adminlte.min.css?versao=3.258.28.1">
  <link rel="stylesheet" href="../dist/css/custom.css?versao=3.258.28.1">
  <link rel="stylesheet" href="../dist/css/sisplan.css?versao=3.258.28.1">
  <link rel="stylesheet" type="text/css" href="../plugins/datatables-keytable/css/keyTable.bootstrap4.min.css?versao=3.258.28.1">
  <!-- Toastr -->
  <link rel="stylesheet" href="../plugins/toastr/toastr.min.css?versao=3.258.28.1">
  <link rel="stylesheet" href="../plugins/fontawesome-free/css/all.min.css?versao=3.258.28.1">
  <link rel="shortcut icon" href="../favicon.ico">
  <link rel="stylesheet" type="text/css" href="../dist/css/driver.min.css?versao=3.258.28.1" />
  <link rel="stylesheet" href="../dist/css/jquery-ui.css?versao=3.258.28.1">

  <!-- Google Font: Source Sans Pro -->
  <link href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,400i,700" rel="stylesheet">
  <link rel="stylesheet" type="text/css" href="../dist/css/sisplan.newColorsButtons.css?versao=3.258.28.1" />
  <link rel="stylesheet" href="https://cdn.datatables.net/select/1.6.0/css/select.dataTables.min.css">

  <style>
    .form-control:disabled,
    .form-control[readonly] {
      background-color: #f7f7f7;
      opacity: 1;
    }

    #msform {
      text-align: start;
      position: relative;
    }

    .card {
      box-shadow: none !important;
      border-radius: 0 !important;
      margin-bottom: 0 !important;
    }

    .card-header {
      box-shadow: 0px 1px rgb(0 0 0 / 20%) !important;
    }

    .card-body {
      padding-left: 1.25rem !important;
      padding-top: 0px;
      padding-bottom: 0px;
      padding-right: 1.25rem !important;
    }

    .fa-angle-right,
    .fa-angle-down {
      color: #343a40;
    }

    .header-content-page .title-page,
    .title-content-page .title,
    .title-page {
      font-size: 20px;
      line-height: normal;
      font-weight: 500;
      color: var(--font-color);
      margin: 0;
      font-family: Roboto, Arial, sans-serif;
    }

    #bordaImagem {
      width: 100%;
      height: 350px;
      border: solid #e0e4e6;
      border-radius: 4px;
      border-width: 2px;
    }

    #infoprodimagem {
      max-width: 100%;
      max-height: 345px;
      width: auto;
      height: auto;

    }

    #divImg {
      margin-left: 3%;
    }

    .check-todos {
      background-color: var(--buttonCheckMedidas);
      border: 0px;
    }

    .border-Field .textoBorda {
      font-size: 1.1em !important;
      text-align: left !important;
      width: auto;
      padding: 0 10px;
      border-bottom: none;
    }

    .border-Field {
      border: 1px solid var(--font-color) !important;
      padding: 0 1.0em 1.0em 1.0em !important;
      margin: 0 0 1.0em 0 !important;
      -webkit-box-shadow: 0px 0px 0px 0px #000;
      box-shadow: 0px 0px 0px 0px #000;
    }

    .table.dataTable tbody td,
    .table.dataTable thead {
      white-space: nowrap;
      text-overflow: ellipsis;
      overflow: hidden;
    }

    .pagination {
      display: flex;
      justify-content: end;
    }

    .dataTables_wrapper>div:nth-child(3)>div:nth-child(2) {
      padding-right: .5rem !important;
    }

    .dataTables_wrapper>div:nth-child(2)>div:first {
      padding-right: 0 !important;
    }

    /* #tabelaControleItens tbody{
      height: 1px;
    } */

    /* #tabelaControleItens thead {
      display: table;
      width: 100%;
      table-layout: fixed;
    } */
  </style>


</head>

<body class="hold-transition sidebar-mini layout-fixed">
  <div class="wrapper">


    <div id="myModal" class="modal" tabindex="-1" role="dialog">
      <div class="modal-dialog" role="document">
        <div class="modal-content">
          <div class="modal-header">
            <h5 id="myModalLabel" class="modal-title">Modal title</h5>
            <button type="button" class="close" data-dismiss="modal" aria-label="Close">
              <span aria-hidden="true">&times;</span>
            </button>
          </div>
          <div class="modal-body">
            <p id="myModalText">Modal body text goes here.</p>
          </div>
          <div class="modal-footer">
            <button id="btnYes" type="button" class="btn btn-primary btn-sisp">Sim</button>
            <button id="btnNo" type="button" class="btn btn-secondary btn-sisp" data-dismiss="modal">Não</button>
          </div>
        </div>
      </div>
    </div>
    <!-- Content Wrapper. Contains page content -->

    <div class="content-wrapper">
      <section class="content">
        <div class="py-0">
          <div class="container-fluid">
            <div class="row mb-2">
              <div class="col-sm-6 flex">
              </div>
              <div class="col-sm-6">
              </div>
            </div>
          </div>
          <div class="row justify-content-center mt-0">
            <div class="col-12 p-0 mt-3 mb-2">
              <div class="container-fluid">
                <div class="row mb-2 ml-2">
                  <div class="col-sm-6 flex pl-1">
                    <h1 class="m-0 text-dark font-semibold" style="font-size: 1.8rem; font-weight: 500; line-height: 1.2;">Cadastro de Preço Material</h1>
                    <button class="btnTutorial" id="tutorial">
                      <i class="fas fa-question-circle"></i>
                    </button>
                  </div>
                </div>
              </div>
              <fieldset>
                <div class="card-body">
                  <form style="text-align:left!important;" id="msform" name="msform">
                    <div class="card card-header pl-0" role="tab" id="geral">
                      <a style="width:100%;" data-toggle="collapse" data-parent="#multiCollapseExample1" href="#multiCollapseExample1" aria-expanded="true" aria-controls="collapseOne1">
                        <div class="row">
                          <div style="max-width:20px;margin-top:auto; margin-bottom: auto" class="col-1">
                            <i class="fas fa-angle-down"></i>
                          </div>
                          <div class="col-11">
                            <h4 class="title-page">
                              Geral
                            </h4>
                          </div>
                        </div>
                      </a>
                    </div>
                    <div class="collapse show" id="multiCollapseExample1">
                      <div class="tab-pane fade show active" role="tabpanel" aria-labelledby="geral-tab">
                        <div class="form-row pt-2 pl-2">
                          <div class="form-group form-check icheck-primary">
                            <input type="checkbox" class="form-check-input" id="cbProduzido">
                            <label class="form-check-label pr-4" for="cbProduzido">Produzido</label>
                          </div>
                        </div>
                        <div class="form-row">
                          <div class="col-8" id="infoGerais">
                            <div class="form-row">
                              <div class="col-xl-2 col-6 form-group" id="tourcodigo">
                                <label data-error="wrong" class="labelGeral" data-success="right" for="txtCodigo">Código:</label>
                                <div class="input-group">
                                  <input type="text" class="input-default focus form-control campoForm" id="txtCodigo" aria-describedby="codError" name="txtCodigo" class="form-control" placeholder="Código">
                                  <div class="input-group-append">
                                    <button class="btn bg-danger" id="btnCodigo" name="btnCodigo" data-button="absolute" type="button"><i class="m-0 p-0 fas fa-search"></i></button>

                                  </div>
                                </div>
                              </div>
                              <div class="col-xl-5 col-6 form-group" id="tourdesc">
                                <label data-error="wrong" class="labelGeral" data-success="right" for="txtDescricao">Descrição:</label>
                                <input type="text" maxlength="100" class="input-default focus form-control validate create campoForm" id="txtDescricao" required aria-describedby="descError" name="txtDescricao" class="form-control" placeholder="Descrição">
                              </div>
                              <div class="col-xl-1 col-2 form-group" id="tourdesc">
                                <label data-error="wrong" class="labelGeral" data-success="right" for="txtUnidade">Unidade:</label>
                                <input type="text" maxlength="100" class="input-default focus form-control validate create campoForm" id="txtUnidade" required aria-describedby="descError" name="txtUnidade" class="form-control" placeholder="UN">
                              </div>
                              <div class="col-xl-2 col-3 form-group">
                                <label>Data:</label>
                                <input type="date" class="input-default focus form-control" id="txtData" disabled value="<?php echo date('Y-m-d'); ?>">
                              </div>
                              <div class="col-xl-2 col-3 form-group">
                                <label>Atualizado em:</label>
                                <input type="date" class="input-default focus form-control" disabled id="txtDataUltimaAtualizacao" value="<?php echo date('Y-m-d'); ?>">
                              </div>
                              <div class="col-xl-4 col-6 form-group">
                                <label data-error="wrong" class="labelGeral" data-success="right" for="txtGrupo">Grupo:</label>
                                <div class="input-group">
                                  <input type="text" class="input-default focus form-control create campoForm" id="txtGrupo" required aria-describedby="uError" name="txtGrupo" class="form-control" placeholder="Grupo">
                                  <div class="input-group-append">
                                    <button class="btn bg-danger create" id="btnGrupo" name="btnGrupo" data-button="absolute" type="button">
                                      <i class="m-0 p-0 fas fa-search"></i>
                                    </button>
                                    <button class="btn bg-danger create" id="btnLimpaGrupo" type="button">
                                      <i class="m-0 p-0 fas fa-trash"></i>
                                    </button>
                                  </div>
                                </div>
                              </div>
                              <div class="col-xl-4 col-6 form-group">
                                <label data-error="wrong" class="labelGeral" data-success="right" for="txtSetor">Setor:</label>
                                <div class="input-group">
                                  <input type="text" class="input-default focus form-control create campoForm" id="txtSetor" required aria-describedby="uError" name="txtSetor" class="form-control" placeholder="Setor">
                                  <div class="input-group-append">
                                    <button class="btn bg-danger create" id="btnSetor" name="btnSetor" data-button="absolute" type="button">
                                      <i class="m-0 p-0 fas fa-search"></i>
                                    </button>
                                    <button class="btn bg-danger create" id="btnLimpaSetor" type="button">
                                      <i class="m-0 p-0 fas fa-trash"></i>
                                    </button>
                                  </div>
                                </div>
                              </div>
                              <div class="col-xl-4 col-6 form-group">
                                <label data-error="wrong" class="labelGeral" data-success="right" for="txtParte">Parte:</label>
                                <div class="input-group">
                                  <input type="text" class="input-default focus form-control create campoForm" id="txtParte" required aria-describedby="uError" name="txtParte" class="form-control" placeholder="Parte">
                                  <div class="input-group-append">
                                    <button class="btn bg-danger create" id="btnParte" name="btnParte" data-button="absolute" type="button">
                                      <i class="m-0 p-0 fas fa-search"></i>
                                    </button>
                                    <button class="btn bg-danger create" id="btnLimpaParte" type="button">
                                      <i class="m-0 p-0 fas fa-trash"></i>
                                    </button>
                                  </div>
                                </div>
                              </div>
                              <div class="col-xl-2 col-3 form-group">
                                <label data-error="wrong" class="labelGeral" data-success="right" for="txtPrecoCompra">Preço Compra:</label>
                                <input type="text" class="input-default focus form-control create seisCasasDecimaisQuantityFormat text-right campoForm campoRecalcularCusto" id="txtPrecoCompra" name="txtPrecoCompra" class="form-control" placeholder="0,000000">
                              </div>
                              <div class="col-xl-2 col-3 form-group">
                                <label data-error="wrong" class="labelGeral" data-success="right" for="txtCreditoIPI">Crédito IPI %:</label>
                                <div class="flex w-100 align-items-center">
                                  <input type="text" class="input-default focus form-control create duasCasasDecimaisQuantityFormat text-right campoForm campoRecalcularCusto" id="txtCreditoIPI" name="txtCreditoIPI" class="form-control" placeholder="0,00">
                                  <div class="form-group form-check icheck-primary" style="margin-bottom: 0 !important">
                                    <input type="checkbox" class="form-check-input cbRecalcularCusto" id="cbCreditoIPI" />
                                    <label class="form-check-label" for="cbCreditoIPI"></label>
                                  </div>
                                </div>
                              </div>
                              <div class="col-xl-2 col-3 form-group">
                                <label data-error="wrong" class="labelGeral" data-success="right" for="txtCreditoICMS">Crédito ICMS %:</label>
                                <div class="flex w-100 align-items-center">
                                  <input type="text" class="input-default focus form-control create duasCasasDecimaisQuantityFormat text-right campoForm campoRecalcularCusto" id="txtCreditoICMS" name="txtCreditoICMS" class="form-control" placeholder="0,00">
                                  <div class="form-group form-check icheck-primary" style="margin-bottom: 0 !important">
                                    <input type="checkbox" class="form-check-input cbRecalcularCusto" id="cbCreditoICMS" />
                                    <label class="form-check-label" for="cbCreditoICMS"></label>
                                  </div>
                                </div>
                              </div>
                              <div class="col-xl-2 col-3 form-group">
                                <label data-error="wrong" class="labelGeral" data-success="right" for="txtCreditoPIS">Crédito PIS %:</label>
                                <div class="flex w-100 align-items-center">
                                  <input type="text" class="input-default focus form-control create duasCasasDecimaisQuantityFormat text-right campoForm campoRecalcularCusto" id="txtCreditoPIS" name="txtCreditoPIS" class="form-control" placeholder="0,00">
                                  <div class="form-group form-check icheck-primary" style="margin-bottom: 0 !important">
                                    <input type="checkbox" class="form-check-input cbRecalcularCusto" id="cbCreditoPIS" />
                                    <label class="form-check-label" for="cbCreditoPIS"></label>
                                  </div>
                                </div>
                              </div>
                              <div class="col-xl-2 col-3 form-group">
                                <label data-error="wrong" class="labelGeral" data-success="right" for="txtCreditoCOFINS">Crédito COFINS %:</label>
                                <div class="flex w-100 align-items-center">
                                  <input type="text" class="input-default focus form-control create duasCasasDecimaisQuantityFormat text-right campoForm campoRecalcularCusto" id="txtCreditoCOFINS" name="txtCreditoCOFINS" class="form-control" placeholder="0,00">
                                  <div class="form-group form-check icheck-primary" style="margin-bottom: 0 !important">
                                    <input type="checkbox" class="form-check-input cbRecalcularCusto" id="cbCreditoCOFINS" />
                                    <label class="form-check-label" for="cbCreditoCOFINS"></label>
                                  </div>
                                </div>
                              </div>
                              <div class="col-xl-2 col-3 form-group">
                                <label data-error="wrong" class="labelGeral" data-success="right" for="txtDespesasIPI">Despesas IPI %:</label>
                                <input type="text" class="input-default focus form-control create duasCasasDecimaisQuantityFormat text-right campoForm campoRecalcularCusto" id="txtDespesasIPI" name="txtDespesasIPI" class="form-control" placeholder="0,00">
                              </div>
                              <div class="col-xl-2 col-3 form-group">
                                <label data-error="wrong" class="labelGeral" data-success="right" for="txtFrete">Frete %:</label>
                                <input type="text" class="input-default focus form-control create duasCasasDecimaisQuantityFormat text-right campoForm campoRecalcularCusto" id="txtFrete" name="txtFrete" class="form-control" placeholder="0,00">
                              </div>
                              <div class="col-xl-2 col-3 form-group">
                                <label data-error="wrong" class="labelGeral" data-success="right" for="txtValorFrete">Valor Frete:</label>
                                <input type="text" class="input-default focus form-control create duasCasasDecimaisQuantityFormat text-right campoForm campoRecalcularCusto" id="txtValorFrete" name="txtValorFrete" class="form-control" placeholder="0,00">
                              </div>
                              <div class="col-xl-2 col-3 form-group">
                                <label data-error="wrong" class="labelGeral" data-success="right" for="txtFatorConversao">Fator de Conversão:</label>
                                <input type="text" class="input-default focus form-control campoForm" id="txtFatorConversao" name="txtFatorConversao" class="form-control" placeholder="0,00" disabled>
                              </div>
                              <div class="col-xl-2 col-3 form-group">
                                <label data-error="wrong" class="labelGeral" data-success="right" for="txtAproveitamento">Aproveitamento:</label>
                                <input type="text" class="input-default focus form-control create duasCasasDecimaisQuantityFormat text-right campoForm" id="txtAproveitamento" name="txtAproveitamento" class="form-control" placeholder="0,00">
                              </div>
                              <div class="col-xl-2 col-3 form-group">
                                <label data-error="wrong" class="labelGeral" data-success="right" for="txtPrecoAnterior">Preço Anterior:</label>
                                <input type="text" class="input-default focus form-control text-right campoForm" id="txtPrecoAnterior" name="txtPrecoAnterior" class="form-control" disabled placeholder="0.00">
                              </div>
                              <div class="col-xl-2 col-3 form-group">
                                <label data-error="wrong" class="labelGeral" data-success="right" for="txtMVA">MVA:</label>
                                <input type="text" class="input-default focus form-control create duasCasasDecimaisQuantityFormat text-right campoForm campoRecalcularCusto" id="txtMVA" name="txtMVA" class="form-control" placeholder="0,00">
                              </div>
                              <div class="col-xl-2 col-3 form-group">
                                <label data-error="wrong" class="labelGeral" data-success="right" for="txtPreco1">Preço 1:</label>
                                <input type="text" class="input-default focus form-control create seisCasasDecimaisQuantityFormat text-right campoForm" id="txtPreco1" name="txtPreco1" class="form-control" placeholder="0,000000">
                              </div>
                              <div class="col-xl-2 col-3 form-group">
                                <label data-error="wrong" class="labelGeral" data-success="right" for="txtPreco2">Preço 2:</label>
                                <input type="text" class="input-default focus form-control create seisCasasDecimaisQuantityFormat text-right campoForm" id="txtPreco2" name="txtPreco2" class="form-control" placeholder="0,000000">
                              </div>
                              <div class="col-xl-2 col-3 form-group">
                                <label data-error="wrong" class="labelGeral" data-success="right" for="txtPreco3">Preço 3:</label>
                                <input type="text" class="input-default focus form-control create seisCasasDecimaisQuantityFormat text-right campoForm" id="txtPreco3" name="txtPreco3" class="form-control" placeholder="0,000000">
                              </div>
                              <div class="col-xl-2 col-3 form-group">
                                <label data-error="wrong" class="labelGeral" data-success="right" for="txtLarguraMalha">Largura Malha:</label>
                                <input type="text" class="input-default focus form-control create duasCasasDecimaisQuantityFormat text-right campoForm" id="txtLarguraMalha" name="txtLarguraMalha" class="form-control" placeholder="0,00">
                              </div>
                              <div class="col-xl-2 col-3 form-group">
                                <label data-error="wrong" class="labelGeral" data-success="right" for="txtGramatura">Gramatura:</label>
                                <input type="text" class="input-default focus form-control create duasCasasDecimaisQuantityFormat text-right campoForm" id="txtGramatura" name="txtGramatura" class="form-control" placeholder="0,00">
                              </div>
                              <div class="col-xl-2 col-3 form-group">
                                <label data-error="wrong" class="labelGeral" data-success="right" for="txtLIndicePeso">Índice de Peso:</label>
                                <input type="text" class="input-default focus form-control create duasCasasDecimaisQuantityFormat text-right campoForm" id="txtIndicePeso" name="txtIndicePeso" class="form-control" placeholder="0,00">
                              </div>
                              <div class="col-12 form-group">
                                <label data-error="wrong" class="labelGeral" data-success="right" for="txtInfoCompl">Informações Complementares:</label>
                                <input type="text" class="input-default focus form-control create campoForm" id="txtInfoCompl" name="txtInfoCompl" class="form-control" placeholder="Informações Complementares">
                              </div>
                              <div class="col-12 form-group">
                                <label data-error="wrong" class="labelGeral" data-success="right" for="txtObs">Observações:</label>
                                <textarea class="input-default focus form-control create campoForm" id="txtObs" name="txtObs" placeholder="Observações" rows="4" cols="50" style="resize: none;"></textarea>
                              </div>
                            </div>
                          </div>
                          <div class="col-4 pl-2" id="divImagem">
                            <div id="divImg">
                              <label class="labelGeral" data-success="right" for="imgMat">Imagem do Material</label>
                              <div class="d-flex justify-content-center" id="bordaImagem" style="height: 100%">
                                <label id="btnEscolherFoto" class="btnEnviarFoto" for="fileimagem" data-button="absolute" type="button">
                                  <img class="pop img img-fluid imagem" id="imagemMat" src="./dist/img/prod-1.png">
                                </label>
                              </div>
                            </div>
                          </div>
                        </div>
                      </div>
                    </div>
                    <div class="card card-header pl-0" role="tab" id="aviamentos">
                      <a style="width:100%;" data-toggle="collapse" data-parent="#multiCollapseExample3" href="#multiCollapseExample3" aria-expanded="true" aria-controls="collapseOne1">
                        <div class="row">
                          <div style="max-width:20px;margin-top:auto; margin-bottom: auto" class="col-1">
                            <i class="fas fa-angle-down"></i>
                          </div>
                          <div class="col-11">
                            <h4 class="title-page">
                              Aviamentos
                            </h4>
                          </div>
                        </div>
                      </a>
                    </div>
                    <div class="collapse hide" id="multiCollapseExample3">
                      <div class="tab-pane fade show active" role="tabpanel" aria-labelledby="aviamentos-tab">
                        <div class="flex flex-wrap w-100">
                          <div class="d-flex flex-column col-12 px-0" style="gap: 8px" id="divTabelaItens">
                            <div class="table-responsive" style="overflow-x: hidden">
                              <table id="tabelaAviamentos" class="table table-sm table-select table-hover" width="100%">
                                <thead>
                                </thead>
                                <tbody>
                                </tbody>
                              </table>
                            </div>
                          </div>
                          <div class="flex w-100 flex-wrap justify-content-end" style="gap: 8px">
                            <button type="button" id="btnAviamentos" class="btn btn-primary btn-sisp create">Aviamentos</button>
                          </div>
                        </div>
                      </div>
                    </div>
                    <div class="card card-header pl-0" role="tab" id="compras">
                      <a style="width:100%;" data-toggle="collapse" data-parent="#multiCollapseExample4" href="#multiCollapseExample4" aria-expanded="true" aria-controls="collapseOne1">
                        <div class="row">
                          <div style="max-width:20px;margin-top:auto; margin-bottom: auto" class="col-1">
                            <i class="fas fa-angle-down"></i>
                          </div>
                          <div class="col-11">
                            <h4 class="title-page">
                              Últimas Compras
                            </h4>
                          </div>
                        </div>
                      </a>
                    </div>
                    <div class="collapse hide" id="multiCollapseExample4">
                      <div class="flex flex-wrap w-100">
                        <div class="tab-pane fade show active flex justify-content-center w-100" id="cardbody-compras" role="tabpanel" aria-labelledby="compras-tab">
                        </div>
                      </div>
                    </div>
                    <div class="flex w-100 justify-content-end mt-2" style="gap: 8px">
                      <button type="button" class="btn btn-secondary btn-sisp" id="btnVoltar" style="max-height: 40px">Voltar</button>
                      <button type="button" class="btn btnVerde btn-sisp" id="btnGravar" style="max-height: 40px">Gravar</button>
                    </div>
                  </form>
                </div>
              </fieldset>
            </div>
          </div>
        </div>
      </section>

      <div class="modal fade" id="modalAviamentos" tabindex="-1" data-backdrop="static" role="dialog" aria-labelledby="modalAviamentos" aria-hidden="true">
        <div class="modal-dialog" style="min-width: 95%; min-height: 100%">
          <div class="modal-content">
            <div class="modal-header">
              <h4 class="modal-title" id="tituloModalAviamentos"></h4>
              <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                <span aria-hidden="true">&times;</span>
              </button>
            </div>
            <div class="modal-body">
              <div class="flex flex-wrap align-items-end mb-2" style="gap: 8px">
                <button class="btn btn-primary btn-sisp" id="btnIncluirModalAviamentos">Incluir</button>
                <button class="btn btn-danger btn-sisp" id="btnExcluirModalAviamentos">Excluir</button>
                <button class="btn btn-secondary btn-sisp ml-auto" id="btnComposicaoModalAviamentos">Composição</button>
                <!-- <div class="flex flex-column">
                  <label>Preço:</label>
                  <select class="drilldown-item form-control select2 select2-danger focus" data-dropdown-css-class="select2-danger" id="selectBuscarPrecoModalAviamentos" style="border-color: #a9a9a9; font-size: 15px">
                    <option class="drilldown-item" value="M">Preço Máximo</option>
                    <option class="drilldown-item" value="P">Preço Padrão</option>
                  </select>
                </div> -->
              </div>
              <div class="table-responsive" style="overflow-x: hidden">
                <table id="tabelaModalAviamentos" class="table table-sm table-select table-hover" width="100%">
                  <thead>
                  </thead>
                  <tbody>
                  </tbody>
                </table>
              </div>
            </div>
            <div class="modal-footer">
              <button class="btn btnVerde btn-sisp mr-auto" id="btnConfirmarModalAviamentos"> Confirmar</button>
              <button class="btn btn-danger btn-sisp" data-dismiss="modal" id="btnFecharModalAviamentos"> Fechar</button>
            </div>
          </div>
        </div>
      </div>

      <?php
      include_once('../../../modais.php');
      ?>

      <!-- Control Sidebar -->
      <aside class="control-sidebar control-sidebar-dark">
        <!-- Control sidebar content goes here -->
      </aside>
      <!-- /.control-sidebar -->
    </div>
  </div>
  <!-- ./wrapper -->
  <script>
    function formatar(mascara, documento) {
      var i = documento.value.length;
      var saida = mascara.substring(0, 1);
      var texto = mascara.substring(i);

      if (texto.substring(0, 1) != saida) {
        documento.value += texto.substring(0, 1);
      }

    }
  </script>

  <!-- jQuery -->
  <script src="../plugins/jquery/jquery.min.js?versao=3.258.28.1"></script>
  <!-- jQuery UI 1.11.4 -->
  <script src="../plugins/jquery-ui/jquery-ui.min.js?versao=3.258.28.1"></script>
  <script type="text/javascript" src="../dist/js/jquery.dataTables.js?versao=3.258.28.1"></script>
  <script type="text/javascript" src="../dist/js/dataTables.bootstrap4.min.js?versao=3.258.28.1"></script>
  <!-- SweetAlert2 -->
  <script src="../plugins/sweetalert2/sweetalert2.min.js?versao=3.258.28.1"></script>
  <script src="../plugins/toastr/toastr.min.js?versao=3.258.28.1"></script>

  <!-- Resolve conflict in jQuery UI tooltip with Bootstrap tooltip -->
  <script>
    $.widget.bridge('uibutton', $.ui.button);
  </script>

  <script src="../plugins/bootstrap/js/bootstrap.bundle.min.js?versao=3.258.28.1"></script>

  <script src="../dist/js/adminlte.min.js?versao=3.258.28.1"></script>

  <script src="../dist/js/requisicoes.js?versao=3.258.28.1"></script>
  <script src="../dist/js/sisplan.js?versao=3.258.28.1"></script>
  <script src="../dist/js/cliente/entidade.js?versao=3.258.28.1"></script>
  <script src="../dist/js/loadingoverlay.min.js?versao=3.258.28.1"></script>
  <script src="../dist/js/valida_cpf_cnpj.js?versao=3.258.28.1"></script>
  <script src="../plugins/jquery-validation/jquery.validate.min.js?versao=3.258.28.1"></script>
  <script src="../dist/js/dataTables.keyTable.js?versao=3.258.28.1"></script>
  <script src="../utils/funcoes.js?versao=3.258.28.1"></script>
  <script src="../utils/cookies.js?versao=3.258.28.1"></script>
  <script src="../dist/js/jquery.maskMoney.min.js?versao=3.258.28.1"></script>
  <script src="../dist/js/jquery.mask.min.js?versao=3.258.28.1"></script>
  <script src="../dist/js/driver.min.js?versao=3.258.28.1"></script>
  <script type="text/javascript" src="../config.js?versao=3.258.28.1"></script>
  <script src="https://cdn.datatables.net/select/1.6.0/js/dataTables.select.min.js"></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('CADMATPRECO');
      // if (!temAcesso.resultado) {
      //   toastrAcesso(temAcesso, BASE_URI);
      //   return;
      // }

      // const permissaoUsuarioLogado = await permissaoAcessos("CADMATPRECO");

      // if (permissaoUsuarioLogado.INCLUI == 'N') {
      //   await criaMensagemErro("Sem permissão para incluir!", () => {
      //     window.location.href = `${BASE_URI}/cadmatpreco`
      //   });
      //   return;
      // }

      // const queryString = window.location.href;
      // const parametros = queryString.split("/");
      // const material = parametros[parametros.length - 1];

      // // $(window).on("beforeunload", function(e) {
      // //   // e.preventDefault();
      // //   e.stopPropagation();
      // //   if (material != 'create') {
      // //     deletaRegistro("CADMATPRECO", getCookie("usuario"), material, getCookie("usuario"));
      // //   }
      // //   return undefined;
      // // });

      // // if (material != 'create') {
      // //   await liberarRegistro("CADMATPRECO", material);
      // // }

      sArquivo = `${BASE_URI}/pages/cadmatpreco/cadastro_matpreco/cadmatpreco.js?versao=3.258.28.1`;
      insereJavaScriptPagina(sArquivo);

      // const nomeTela = ('<?php echo basename(__FILE__) ?>').replace('.php', '');
      // habilitaCamposObrigatoriosTela(nomeTela);
    });
  </script>
</body>

</html>