<?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 | Serviço de Tingimento</title>
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <link rel="stylesheet" href="../dist/css/adminlte.min.css?versao=3.258.7.1">
  <link rel="stylesheet" href="../plugins/fontawesome-free/css/all.min.css?versao=3.258.7.1">
  <link href='https://fonts.googleapis.com/css?family=Roboto:400,300,500,600,700,400italic' rel='stylesheet' type='text/css'>
  <link rel="stylesheet" type="text/css" href="../dist/css/dataTables.bootstrap4.min.css?versao=3.258.7.1" />
  <link href='../dist/css/bootstrap.min.css?versao=3.258.7.1'>
  <link rel="stylesheet" href="../dist/css/custom.css?versao=3.258.7.1">
  <link rel="stylesheet" href="../dist/css/sisplan.css?versao=3.258.7.1">
  <link rel="stylesheet" type="text/css" href="../plugins/datatables-keytable/css/keyTable.bootstrap4.min.css?versao=3.258.7.1">
  <link rel="stylesheet" type="text/css" href="../dist/css/responsive.bootstrap.min.css?versao=3.258.7.1">
  <link rel="shortcut icon" href="../favicon.ico">
  <link rel="stylesheet" href="../dist/css/cadastro.css?versao=3.258.7.1">

  <!-- Toastr -->
  <link rel="stylesheet" href="../plugins/toastr/toastr.min.css?versao=3.258.7.1">
  <link rel="stylesheet" type="text/css" href="../dist/css/driver.min.css?versao=3.258.7.1" />
  <link rel="stylesheet" href="../dist/css/jquery-ui.css?versao=3.258.7.1">
  <!-- Google Font: Source Sans Pro -->
  <link href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,400i,700" rel="stylesheet">
  <style>
    #progressbar li {
      list-style-type: none;
      font-size: 12px;
      width: 50%;
      float: left;
      position: relative
    }

    .card-totais {
      margin-top: 2%;
    }

    #txtDados {
      padding-top: .7%;
      padding-left: .85%;
    }

    .input-group-append>a>i {
      margin-left: 0 !important;
      padding-left: 5px;
      padding-right: 5px;
    }

    .focus:read-only:focus {
      border-color: #aa1212 !important;
    }

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

    .border-Field {
      border: 1.0px 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;
      padding-bottom: 0px !important;
    }
  </style>
</head>

<body class="hold-transition sidebar-mini layout-fixed">
  <div class="wrapper">
    <? php;
    ?>
    <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"></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"></p>
          </div>
          <div class="modal-footer">
            <button id="btnYes" type="button" class="btn btn-primary">Sim</button>
            <button id="btnNo" type="button" class="btn btn-secondary" data-dismiss="modal">Não</button>
          </div>
        </div>
      </div>
    </div>
    <div class="content-wrapper">
      <section class="content">
        <div class="container-fluid" id="grad1">
          <div class="row justify-content-center mt-0">
            <div class="col-10 text-center p-0 mt-3 mb-2">
              <div class="card px-0 pt-4 pb-0 mt-3 mb-3">
                <div class="card-header text-center flex" style="border: none!important;box-shadow:none!important;">
                  <h2>Serviço de Tingimento/Estamparia 
                    <button title="Tutorial" type="button" class="btn btn-info btn-sm ml-2" style="color: white;" id="tutorial">
                      <i class="fas fa-question-circle"></i>
                    </button>
                  </h2>
                </div>

                <div class="row">
                  <div class="col-md-12 mx-0">
                    <form id="msform">
                      <ul id="progressbar">
                        <li class="active" id="account"><strong>Geral</strong></li>
                        <li id="payment"><strong>Itens</strong></li>
                      </ul>
                      <p>Preencha os dados e clique em avançar até a conclusão do serviço de tingimento</p>
                      <fieldset>
                        <div class="form-card" id="tourGeral">
                          <h2 class="fs-title"> Dados Gerais </h2>
                          <div class="row d-flex justify-content-center">

                            <div class="row col-lg-10">

                              <div class="col-lg-3 col-6 form-group">
                                <label data-error="wrong" data-success="right" for="txtSolicitacao">Solicitação</label>
                                <div class="input-group">
                                  <input type="text" disabled class="input-default focus form-control" id="txtSolicitacao" name="txtSolicitacao" class="form-control" placeholder="Solicitação">
                                </div>
                              </div>

                              <div class="col-lg-6 col-6 form-group">
                                <label data-error="wrong" data-success="right" for="txtCliente">Cliente</label>
                                <div class="input-group">
                                  <input type="text" class="input-default focus form-control" disabled id="txtCliente" name="txtCliente" class="form-control" placeholder="Cliente">
                                </div>
                              </div>

                              <div class="col-lg-3 col-12 form-group">
                                <label data-error="wrong" data-success="right" for="dtEmissao">Data emissão</label>
                                <div class="input-group">
                                  <input type="date" max="2500-12-31" value="" disabled class="input-default focus form-control" id="dtEmissao" name="dtEmissao" class="form-control" placeholder="Comissão 1">
                                </div>
                              </div>

                              <div class="col-lg-12 col-12 form-group">
                                <label data-error="wrong" data-success="right" for="txtObservacoes">Observações</label>
                                <textarea style="resize: none; padding-top: 7px;" id="txtObservacoes" placeholder="Observações" class="input-default focus form-control" rows="4"></textarea>
                              </div>

                              <div class="col-lg-6 col-6 form-group">
                                <label data-error="wrong" data-success="right" for="txtStatus">Status</label>
                                <div class="input-group">
                                  <input type="text" class="input-default focus form-control" disabled id="txtStatus" name="txtStatus" class="form-control" placeholder="Status">
                                </div>
                              </div>

                              <div class="col-lg-6 col-6 form-group">
                                <label data-error="wrong" data-success="right" for="txtQtdeTotal">Quantidade total</label>
                                <div class="input-group">
                                  <input type="text" class="input-default focus form-control" disabled id="txtQtdeTotal" name="txtQtdeTotal" class="form-control" placeholder="Quantidade total">
                                </div>
                              </div>

                              <div class="col-lg-6 col-6 form-group">
                                <div class="icheck-primary mx-2 "><input type="checkbox" id="cbFatPedidoCompleto"> <label for="cbFatPedidoCompleto">Faturar pedido completo</label></div>
                              </div>

                            </div>

                          </div>
                        </div>
                        <input type="button" id="avancar1" name="next" class="next action-button" value="Avançar" />
                        <input type="button" name="previous" id="btnVoltar" class="previous action-button-previous" value="Voltar" />
                      </fieldset>
                      <fieldset>
                        <div class="form-card">

                          <div class="row d-flex justify-content-between">
                            <div class="col-lg-2">
                              <h2 class="fs-title">Itens</h2>
                            </div>
                            <div class="col-lg-2">
                              <button id="btnAddItem" class="btn btn-danger">Adicionar Item</button>
                            </div>
                          </div>

                          <hr>
                          <!-- <div id="items-wrap" class="table-wrap">
                            <div class="col-sm-12 table-responsive" style="margin-top: 2%;">
                              <table id="tabelaItens" class="table table-sm table-select table-hover">
                              </table>
                            </div>
                          </div> -->

                          <div class="card-body">
                            <div class="card">

                              <div class="col-sm-12 table-responsive card-body">
                                <table id="tabelaItens" class="table table-sm table-select table-hover" width="100%">
                                  <thead>
                                  </thead>
                                  <tbody>
                                  </tbody>
                                </table>
                              </div>

                              <div class="row d-flex justify-content-between">
                                <div class="col-lg-3 col-sm-12 row">
                                  <div class="col-lg-4 col-sm-12 form-group"></div>
                                  <div class="col-lg-8 col-sm-12 form-group">
                                    <label data-error="wrong" data-success="right" for="txtSolicitacaoVisu">Solicitação</label>
                                    <div class="input-group">
                                      <input type="text" style="border-color: red !important" disabled class="input-default focus form-control" id="txtSolicitacaoVisu" name="txtSolicitacaoVisu" class="form-control" placeholder="Solicitação">
                                    </div>
                                  </div>
                                </div>

                                <div class="col-lg-9 col-sm-12 row">

                                  <div class="col-lg-2 col-sm-12 form-group"></div>
                                  <div class="col-lg-3 col-sm-12 form-group">
                                    <label data-error="wrong" data-success="right" for="txtCountFals">Total</label>
                                    <div class="input-group">
                                      <input type="text" disabled class="input-default focus form-control" id="txtCountFals" name="txtCountFals" class="form-control" placeholder="Total">
                                    </div>
                                  </div>
                                  <div class="col-lg-3 col-sm-12 form-group">
                                    <label data-error="wrong" data-success="right" for="txtTotQtde">Total qtde.</label>
                                    <div class="input-group">
                                      <input type="text" disabled class="input-default focus form-control" id="txtTotQtde" name="txtTotQtde" class="form-control" placeholder="Total qtde.">
                                    </div>
                                  </div>
                                  <div class="col-lg-3 col-sm-12 form-group">
                                    <label data-error="wrong" data-success="right" for="txtTotRolos">Total rolos</label>
                                    <div class="input-group">
                                      <input type="text" disabled class="input-default focus form-control" id="txtTotRolos" name="txtTotRolos" class="form-control" placeholder="Total rolos">
                                    </div>
                                  </div>
                                </div>
                              </div>

                            </div>
                          </div>

                        </div>

                        <input type="button" id="btnGravar" class="action-button" value="Gravar" />
                        <input type="button" name="previous" class="previous action-button-previous" value="Voltar" />

                      </fieldset>

                    </form>
                  </div>
                </div>
              </div>
            </div>
          </div>
        </div>
      </section>
    </div>
  </div>

  <div id="modalAddItem" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-dialog modal-xl">
      <div class="modal-content">
        <div class="modal-header">
          <h4 class="modal-title">Adicionar Item
          </h4>
          <div class="icheck-primary mx-2" style="padding-top: 8px"><input type="checkbox" id="cbDefinirEstampa"> <label for="cbDefinirEstampa">Estampa a definir</label></div>

          <button type="button" class="close" data-dismiss="modal" aria-label="Close">
            <span aria-hidden="true">&times;</span>
          </button>
        </div>
        <div class="modal-body">
          <form id="formValidate">
            <div class="row">

              <div class="col-lg-4 col-sm-12 form-group">
                <label data-error="wrong" data-success="right" for="txtFal">FAL</label>
                <div class="input-group">
                  <input type="text" disabled class="input-default focus form-control" id="txtFal" name="txtFal" class="form-control" placeholder="FAL">
                </div>
              </div>

              <div class="col-lg-4 col-sm-12 form-group">
                <label data-error="wrong" data-success="right" for="txtLote">Lote</label>
                <div class="input-group">
                  <input type="text" class="input-default focus form-control" id="txtLote" name="txtLote" class="form-control" placeholder="Lote">
                </div>
              </div>

              <div class="col-lg-2 form-group">
                <label data-error="wrong" data-success="right" for="rgTipo">Tipo</label>
                <div class="input-group">
                  <select style="width:100%;" class="form-control select2 select2-danger focus" data-dropdown-css-class="select2-danger" id="rgTipo" class="custom-select focus">
                    <option value="0" selected>Normal</option>
                    <option value="1">Especial</option>
                  </select>
                </div>
              </div>

              <div class="col-lg-2 form-group">
                <label data-error="wrong" data-success="right" for="rgAcabamento">Acabamento</label>
                <div class="input-group">
                  <select style="width:100%;" class="form-control select2 select2-danger focus" data-dropdown-css-class="select2-danger" id="rgAcabamento" class="custom-select focus">
                    <option value="0" selected>Normal</option>
                    <option value="1">Especial</option>
                  </select>
                </div>
              </div>

              <!-- <div class="col-lg-3 form-group">
                <label data-error="wrong" data-success="right" for="rgPediFluxo">Pedi fluxo</label>
                <div class="input-group">
                  <select style="width:100%;" class="form-control select2 select2-danger focus" data-dropdown-css-class="select2-danger" id="rgPediFluxo" class="custom-select focus">
                    <option value="1" selected>1 - Normal</option>
                    <option value="2">2 - Ramado</option>
                    <option value="3">3 - Tubular</option>
                  </select>
                </div>
              </div> -->

              <div class="col-lg-4 col-sm-3 form-group">
                <label data-error="wrong" data-success="right" for="txtTecido">Tecido</label>
                <div class="input-group">
                  <input type="text" class="input-default focus form-control" id="txtTecido" name="txtTecido" class="form-control" placeholder="Tecido">
                  <div class="input-group-append">
                    <button class="btn bg-danger" id="btnTecido" name="btnTecido" data-button="absolute" type="button"><i class="m-0 p-0 fas fa-search"></i></button>
                    <button class="btn bg-danger" id="btnATecido" type="button"><i class="m-0 p-0 fas fa-trash"></i></button>
                  </div>
                </div>
              </div>

              <div class="col-lg-4 col-sm-3 form-group">
                <label data-error="wrong" data-success="right" for="txtCor">Cor</label>
                <div class="input-group">
                  <input type="text" class="input-default focus form-control" id="txtCor" name="txtCor" class="form-control" placeholder="Cor">
                  <div class="input-group-append">
                    <button class="btn bg-danger" id="btnCor" name="btnCor" data-button="absolute" type="button"><i class="m-0 p-0 fas fa-search"></i></button>
                    <button class="btn bg-danger" id="btnACor" type="button"><i class="m-0 p-0 fas fa-trash"></i></button>
                  </div>
                </div>
              </div>

              <div class="col-lg-4 col-sm-3 form-group d-none">
                <label data-error="wrong" data-success="right" for="txtVariante">Variante</label>
                <div class="input-group">
                  <input type="text" class="input-default focus form-control" id="txtVariante" name="txtVariante" class="form-control" placeholder="Variante">
                  <div class="input-group-append">
                    <button class="btn bg-danger" id="btnVariante" name="btnVariante" data-button="absolute" type="button"><i class="m-0 p-0 fas fa-search"></i></button>
                    <button class="btn bg-danger" id="btnAVariante" type="button"><i class="m-0 p-0 fas fa-trash"></i></button>
                  </div>
                </div>
              </div>

              <div class="col-lg-4 col-sm-12 form-group">
                <label data-error="wrong" data-success="right" for="txtEstampa">Estampa</label>
                <div class="input-group">
                  <input type="text" class="input-default focus form-control" id="txtEstampa" name="txtEstampa" class="form-control" placeholder="Estampa">
                  <div class="input-group-append">
                    <button class="btn bg-danger" id="btnEstampa" name="btnEstampa" data-button="absolute" type="button"><i class="m-0 p-0 fas fa-search"></i></button>
                    <button class="btn bg-danger" id="btnAEstampa" type="button"><i class="m-0 p-0 fas fa-trash"></i></button>
                  </div>
                </div>
              </div>

              <div class="col-lg-3 col-sm-12 form-group">
                <label data-error="wrong" data-success="right" for="txtPedidoTinto">Pedido tinto</label>
                <div class="input-group">
                  <input type="text" class="input-default focus form-control" id="txtPedidoTinto" name="txtPedidoTinto" class="form-control" placeholder="Pedido tinto">
                </div>
              </div>

              <div class="col-lg-3 col-sm-12 form-group">
                <label data-error="wrong" data-success="right" for="txtItPedTinto">Item pedido tinto</label>
                <div class="input-group">
                  <input type="text" class="input-default focus form-control" id="txtItPedTinto" name="txtItPedTinto" class="form-control" placeholder="Item pedido tinto">
                </div>
              </div>

              <div class="col-lg-3 col-sm-12 form-group">
                <label data-error="wrong" data-success="right" for="txtPedidoCompra">Pedido compra</label>
                <div class="input-group">
                  <input type="text" class="input-default focus form-control" id="txtPedidoCompra" name="txtPedidoCompra" class="form-control" placeholder="Pedido compra">
                </div>
              </div>

              <div class="col-lg-3 col-sm-12 form-group">
                <label data-error="wrong" data-success="right" for="txtItPedCompra">Item pedido compra</label>
                <div class="input-group">
                  <input type="text" class="input-default focus form-control" id="txtItPedCompra" name="txtItPedCompra" class="form-control" placeholder="Item pedido compra">
                </div>
              </div>

              <div class="col-lg-3 col-sm-3 form-group">
                <label data-error="wrong" data-success="right" for="txtPediFluxo">Fluxo</label>
                <div class="input-group">
                  <input type="text" class="input-default focus form-control" id="txtPediFluxo" name="txtPediFluxo" class="form-control" placeholder="Fluxo">
                  <div class="input-group-append">
                    <button class="btn bg-danger" id="btnPediFluxo" name="btnPediFluxo" data-button="absolute" type="button"><i class="m-0 p-0 fas fa-search"></i></button>
                    <button class="btn bg-danger" id="btnAPediFluxo" type="button"><i class="m-0 p-0 fas fa-trash"></i></button>
                  </div>
                </div>
              </div>

              <div class="col-lg-3 col-sm-12 form-group">
                <label data-error="wrong" data-success="right" for="txtFichaTecnica">Ficha técnica</label>
                <div class="input-group">
                  <select style="width:100%;" class="form-control select2 select2-danger focus" data-dropdown-css-class="select2-danger" id="rgFichaTecnica" class="custom-select focus">
                    <option value="" selected>Selecione uma opção</option>
                  </select>
                </div>
              </div>

              <div class="col-lg-3 col-sm-12 form-group">
                <label data-error="wrong" data-success="right" for="txtLargura">Largura</label>
                <div class="input-group">
                  <input type="text" class="input-default focus form-control maskItens" disabled id="txtLargura" name="txtLargura" class="form-control" placeholder="Largura">
                </div>
              </div>

              <div class="col-lg-3 col-sm-12 form-group">
                <label data-error="wrong" data-success="right" for="txtGramatura">Gramatura</label>
                <div class="input-group">
                  <input type="text" class="input-default focus form-control maskItens" disabled id="txtGramatura" name="txtGramatura" class="form-control" placeholder="Gramatura">
                </div>
              </div>

              <div class="col-lg-3 col-sm-12 form-group">
                <label data-error="wrong" data-success="right" for="txtNf">Nota fiscal</label>
                <div class="input-group">
                  <input type="text" class="input-default focus form-control" id="txtNf" name="txtNf" class="form-control" placeholder="Nota fiscal">
                </div>
              </div>

              <div class="col-lg-3 col-sm-12 form-group">
                <label data-error="wrong" data-success="right" for="txtQuantidade">Quantidade</label>
                <div class="input-group">
                  <input type="text" class="input-default focus form-control maskItens" id="txtQuantidade" name="txtQuantidade" class="form-control" placeholder="Quantidade">
                </div>
              </div>

              <div class="col-lg-3 col-sm-12 form-group">
                <label data-error="wrong" data-success="right" for="txtPecas">Peças</label>
                <div class="input-group">
                  <input type="text" class="input-default focus form-control" id="txtPecas" name="txtPecas" class="form-control" placeholder="Peças">
                </div>
              </div>

              <div class="col-lg-3 col-sm-12 form-group">
                <label data-error="wrong" data-success="right" for="txtTitFioFab">Título do fio/fabricante</label>
                <div class="input-group">
                  <input type="text" class="input-default focus form-control" id="txtTitFioFab" name="txtTitFioFab" class="form-control" placeholder="Título do fio/fabricante">
                </div>
              </div>

              <div class="col-lg-3 form-group">
                <label data-error="wrong" data-success="right" for="rgUnidade">Unidade</label>
                <div class="input-group">
                  <select style="width:100%;" class="form-control select2 select2-danger focus" data-dropdown-css-class="select2-danger" id="rgUnidade" class="custom-select focus">
                    <option value="KG" selected>KG</option>
                    <option value="UN">UN</option>
                  </select>
                </div>
              </div>

              <div class="col-lg-3 form-group">
                <label data-error="wrong" data-success="right" for="rgOurelas">Ourelas</label>
                <div class="input-group">
                  <select style="width:100%;" class="form-control select2 select2-danger focus" data-dropdown-css-class="select2-danger" id="rgOurelas" class="custom-select focus">
                    <option value="Não cortar" selected>Não cortar</option>
                    <option value="Cortar">Cortar</option>
                  </select>
                </div>
              </div>

              <div class="col-lg-3 form-group">
                <label data-error="wrong" data-success="right" for="rgEngomar">Engomar</label>
                <div class="input-group">
                  <select style="width:100%;" class="form-control select2 select2-danger focus" data-dropdown-css-class="select2-danger" id="rgEngomar" class="custom-select focus">
                    <option value="Não" selected>Não</option>
                    <option value="Sim">Sim</option>
                  </select>
                </div>
              </div>

              <div class="col-lg-3 form-group">
                <label data-error="wrong" data-success="right" for="rgAgulha">Agulha</label>
                <div class="input-group">
                  <select style="width:100%;" class="form-control select2 select2-danger focus" data-dropdown-css-class="select2-danger" id="rgAgulha" class="custom-select focus">
                    <option value="Sem falha" selected>Sem falha</option>
                    <option value="Com falha">Com falha</option>
                  </select>
                </div>
              </div>

              <div class="col-lg-12 col-12 form-group">
                <label data-error="wrong" data-success="right" for="txtObsItem">Observações</label>
                <textarea style="resize: none; padding-top: 7px;" id="txtObsItem" placeholder="Observações" class="input-default focus form-control" rows="4" maxlength="440"></textarea>
              </div>

            </div>
          </form>  
        </div>
        <div class="modal-footer">
          <div class="row">
            <div class="col-sm-12">
              <button id="btnConfirmarItem" class="btn btn-danger"> Confirmar </button>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>

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

  <aside class="control-sidebar control-sidebar-dark">
  </aside>
  </div>
  <script type="text/javascript" src="../config.js?versao=3.258.7.1"></script>
  <script type="text/javascript" src="../plugins/jquery/jquery.min.js?versao=3.258.7.1"></script>
  <script type="text/javascript" src="../plugins/jquery-ui/jquery-ui.min.js?versao=3.258.7.1"></script>
  <script type="text/javascript" src="../dist/js/jquery.dataTables.js?versao=3.258.7.1"></script>
  <script type="text/javascript" src="../dist/js/dataTables.bootstrap4.min.js?versao=3.258.7.1"></script>
  <script type="text/javascript" src="../plugins/sweetalert2/sweetalert2.min.js?versao=3.258.7.1"></script>
  <script type="text/javascript" src="../plugins/toastr/toastr.min.js?versao=3.258.7.1"></script>
  <script>
    $.widget.bridge('uibutton', $.ui.button);
  </script>
  <script type="text/javascript" src="../plugins/bootstrap/js/bootstrap.bundle.min.js?versao=3.258.7.1"></script>
  <script type="text/javascript" src="../dist/js/adminlte.min.js?versao=3.258.7.1"></script>
  <script type="text/javascript" src="../dist/js/requisicoes.js?versao=3.258.7.1"></script>
  <script type="text/javascript" src="../dist/js/cliente/entidade.js?versao=3.258.7.1"></script>
  <script type="text/javascript" src="../dist/js/loadingoverlay.min.js?versao=3.258.7.1"></script>
  <script type="text/javascript" src="../dist/js/valida_cpf_cnpj.js?versao=3.258.7.1"></script>
  <script type="text/javascript" src="../plugins/jquery-validation/jquery.validate.min.js?versao=3.258.7.1"></script>
  <script type="text/javascript" src="../dist/js/sisplan.js?versao=3.258.7.1"></script>
  <script type="text/javascript" src="../utils/funcoes.js?versao=3.258.7.1"></script>
  <script type="text/javascript" src="../dist/js/driver.min.js?versao=3.258.7.1"></script>
  <script src="../dist/js/jquery.maskMoney.min.js?versao=3.258.7.1"></script>
  <script type="text/javascript" src="../utils/cookies.js?versao=3.258.7.1"></script>
  <script type="text/javascript" src="../dist/js/jquery.mask.min.js?versao=3.258.7.1"></script>
  <script type="text/javascript" src="../dist/js/dataTables.keyTable2.js?versao=3.258.7.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('SERVTINGIMENTO');
      if (!temAcesso.resultado) {
        toastrAcesso(temAcesso, BASE_URI);
        return;
      }

      const permissaoUsuarioLogado = await permissaoAcessos("SERVTINGIMENTO");

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

      sArquivo = `${BASE_URI}/pages/servtingimento/cadastro_servtingimento/servtingimento.js?versao=3.258.7.1`;
      insereJavaScriptPagina(sArquivo);

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

</body>

</html>