<script src="./template/plugins/jquery/jquery.min.js"></script>
<script src="./template/plugins/bootstrap/js/bootstrap.bundle.min.js"></script>
<script src="./template/dist/js/adminlte.min.js"></script>
<script src="./template/dist/js/demo.js"></script>
<script src="./template/plugins/datatables/jquery.dataTables.min.js"></script>
<script src="./template/plugins/datatables-bs4/js/dataTables.bootstrap4.min.js"></script>
<script src="./template/plugins/datatables-responsive/js/dataTables.responsive.min.js"></script>
<script src="./template/plugins/datatables-responsive/js/responsive.bootstrap4.min.js"></script>
<script src="./template/plugins/datatables-buttons/js/dataTables.buttons.min.js"></script>
<script src="./template/plugins/datatables-buttons/js/buttons.bootstrap4.min.js"></script>
<script src="./template/plugins/toastr/toastr.min.js"></script>
<script src="./template/plugins/jszip/jszip.min.js"></script>
<script src="./template/plugins/pdfmake/pdfmake.min.js"></script>
<script src="./template/plugins/pdfmake/vfs_fonts.js"></script>
<script src="./template/plugins/datatables-buttons/js/buttons.html5.min.js"></script>
<script src="./template/plugins/datatables-buttons/js/buttons.print.min.js"></script>
<script src="./template/plugins/datatables-buttons/js/buttons.colVis.min.js"></script>
<script src="./template/plugins/select2/js/select2.full.min.js"></script>
<script src="./template/plugins/inputmask/jquery.inputmask.min.js"></script>
<script src="./javascript/thousandSeparator.js"></script>
<script src="./javascript/sweetalert.min.js"></script>
<script src="./javascript/sweetalert2.min.js"></script>
<script src="./javascript/function.js"></script>
<script>
  let serie;
  let idSerie;
  let logotipo;
  let telefoneDoc;
  let emailDoc;

  $('[data-mask]').inputmask();

  $(document).ready(function() {
    $(function() {
      $('.select2').select2();
      $('.select2bs4').select2({
        theme: 'bootstrap4'
      });
    });
  });

  funcaoSelect("includes/select.inc.php", "post", "json", "configuracao", function success(data) {
    let favicon = document.querySelector("head");
    let link = document.createElement("link");
    link.setAttribute("rel", "icon");
    link.setAttribute("href", `../gestao/images/logo/${data[9]["valor"]}`);
    favicon.append(link);
    logotipo = "../gestao/images/logo/" + data[0]["valor"];
    telefoneDoc = data[4]["valor"];
    emailDoc = data[5]["valor"];
  }, function error(data) {

  }, function done(data) {

  });

  funcaoSelect("includes/select.inc.php", "post", "json", "definicao", function success(data) {
    funcaoQuerySelect("includes/querySelect.inc.php", "post", "json", {idSerie: data[2]['valor']}, "serie", function success(data) {
      serie = data[0]['descricao'];
      idSerie = data[0]['idSerie'];
      console.log("Pegar série: ", serie);
    }, function error(data){

    }, function done(data){

    });
  }, function error(data) {

  }, function done(data) {

  });
</script>